input, select, textarea {
  width: 100%;
  height: 40px;
  padding: 8px 16px;
  border-radius: 12px;
  border: solid 1px var(--second-dis);
  font-family: "PT Sans";
  font-size: 20px;
  color: var(--second-act);
  background-color: #fff;
  &:hover{
    border-color: var(--second);
    outline: none;
  }
  &:focus, &:focus-visible {
    border-color: var(--prime);
    outline: none;
    
  }
  &:disabled{
    border-color: #EDEDED;
    outline: none;
  }
}

.invalid {
  input, select, .textbox {
    border-color: #e60046!important;
  }
}


.switch {
  width: 44px;
  height: 24px;
  margin: auto 0;
  padding: 2px;
  border-radius: 12px;
  background-color: #fff;
  border: 1px solid var(--second);
  cursor: pointer;
  transition: background-color 0.3s;
  &:before {
    display: block;
    width: 18px;
    height: 18px;
    background-color: var(--second-dis);
    border-radius: 9px;
    transition: transform 0.3s;
    content: '';
  }
  &.active {
    background-color:var(--prime);
    border-color:var(--prime);
    &:before {
      transform: translateX(20px);
      background-color: #fff;
    }
  }
  &.active{
    &:hover {
      background-color:var(--prime-hov);
      border-color:var(--prime-hov);
      &:before {
        transform: translateX(20px);
      }
    }
    &:focus{
      background-color:var(--prime-act);
      border-color:var(--prime-act);
      &:before {
        transform: translateX(20px);
      }
    }
  }
  &:not(.active):hover {
    border-color:var(--second-hov);
    &:before {
      background-color: var(--second);
    }
  }
  &.disabled {
    opacity: 0.5;
  }
}



.checkbox {
  position: absolute;
  z-index: -1;
  opacity: 0;
}

.checkbox+label {
  display: inline-flex;
  align-items: center;
  user-select: none;
  font-size: 20px;
}
.checkbox+label::before {
  content: '';
  display: inline-block;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  flex-grow: 0;
  margin-right: 0.5em;
  background-repeat: no-repeat;
  background-position: center center;
  background-size: 100% 100%;
  background-image: url("~/src/assets/images/icons/checkbox/checbox_none_base_24dp.svg");
}
.checkbox:checked+label::before {
  background-image: url("~/src/assets/images/icons/checkbox/checbox_check_base_24dp.svg");
}
.checkbox:not(:disabled):not(:checked)+label:hover::before {
  background-image: url("~/src/assets/images/icons/checkbox/checbox_none_hover_24dp.svg");
}
.checkbox:not(:disabled):checked+label:hover::before {
  background-image: url("~/src/assets/images/icons/checkbox/checbox_check_hover_24dp.svg");
}
.checkbox:not(:disabled):checked:active+label::before {
  background-image: url("~/src/assets/images/icons/checkbox/checbox_check_active_24dp.svg");
}
.checkbox:not(:disabled):not(:checked):active+label::before {
  background-image: url("~/src/assets/images/icons/checkbox/checbox_none_active_24dp.svg");
}
.checkbox:focus:checked+label::before {
  background-image: url("~/src/assets/images/icons/checkbox/checbox_check_hover_24dp.svg");
}
.checkbox:focus:not(:checked)+label::before {
  background-image: url("~/src/assets/images/icons/checkbox/checbox_none_hover_24dp.svg");
}
.checkbox:disabled:checked+label::before {
  background-image: url("~/src/assets/images/icons/checkbox/checbox_check_disabled_24dp.svg");
}
.checkbox:disabled:not(:checked)+label::before {
  background-image: url("~/src/assets/images/icons/checkbox/checbox_none_disabled_24dp.svg");
}




form-field-document{
  .area {
    position: relative;
    display: flex;
    height: 100px;
    padding: 16px;
    border: var(--prime) dashed 1px;
    border-radius: 4px;
    overflow: hidden;
    font-size: 20px;
    &.hover {
      background-color: #e0e0e0;
    }
    p {
      margin: auto;
      color: var(--second-dis);
      text-align: center;
      span {
        color: var(--orange-2);
        cursor: pointer;
      }
    }
    input {
      display: none;
    }
    .indicator {
      display: flex;
      flex-direction: column;
      justify-content: center;
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      padding: 16px;
      background-color: #f7f7f7;
      .label {
        margin-bottom: 4px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
      }
      .progress {
        height: 4px;
        background-color: #dfdfdf;
        overflow: hidden;
        .fill {
          width: 0;
          height: 100%;
          background-color: #3ca128;
        }
      }
    }
  }
  
  .values {
  
    .item {
      margin-top: $p;
      .doc-item-header{
        display: flex;
        align-items: flex-start;
        gap: $pxs;
      }
      .doc-item-form{
        input{
          margin-bottom: $pxs;
        }
        .doc-item-form-bar{
          display: flex;
          justify-content: flex-end;
          gap:  $pxs;
        }
      }
    }
    .fader {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background-color: rgba(0,0,0,0.6);
    }
    
    .form {
      position: relative;
      background-color: #ffffff;
      z-index: 10000;
    }
    
  }
}


auth-page{
  .authentication {
    display: flex;
    flex-direction: row;
    .logo {
      display: flex;
      width: 50%;
      flex-shrink: 0;
      height: 100%;
      border-right: #E0E0E0 solid 1px;
      text-align: center;
      color: #0071BB;
    }
  
    .form {
      display: flex;
      flex-grow: 1;
      padding: 24px;
    }
  
    .center {
      width: 100%;
      max-width: 416px;
      margin: auto;
    }
  }
  
  
  @media screen and (max-width: 959px) {
    .authentication {
      flex-direction: column;
      justify-content: center;
      .logo {
        width: 100%;
        height: auto;
        border-right: none;
      }
      .form {
        flex-grow: 0;
      }
      ::ng-deep h2 {
        text-align: center;
      }
    }
  }
  
}

auth-page, auth-modal{
  h2 {
    margin: 0 0 24px;
    font-size: 24px;
    font-weight: normal;
  }
  
  .field {
    margin: 0 0 16px;
  
    label {
      font-size: 14px;
      color: #666666;
      line-height: 20px;
    }
  
    .checkbox {
      display: flex;
      flex-direction: row;
      gap: 12px;
      margin: 0 0 12px;
      &:last-child {margin: 0;}
      label {
        font-size: 0.875rem;
        color: #86898E;
        a {
          color: #F9B417;
        }
      }
      input {
        flex-shrink: 0;
        width: 20px;
        height: 20px;
        margin: 0;
        padding: 0;
      }
    }
  }
  
  .error {
    margin: 0 0 16px;
    font-size: 14px;
    color: #D91519;
    text-align: center;
  }
  
  .bar {
    display: flex;
    flex-direction: row;
    align-items: center;
    width: 100%;
    flex-wrap: wrap;
    row-gap: 18px;
    .remember {
      display: flex;
      flex-direction: row;
      align-items: center;
      input {
        width: 16px;
        height: 16px;
        margin-right: 8px;
        border-radius: 2px;
        border: 1px solid #86898E;
      }
    }
    .forget {
      cursor: pointer;
      display: flex;
      justify-content: space-between;
      flex-basis: 100%;
    }
  }
  
  .bottom {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    gap: 24px;
    margin: 24px 0 0;
  }
  
  
  @media screen and (max-width: 600px) {
    .bottom {
      flex-direction: column-reverse;
      button {
        width: 100%;
      }
    }
  }
  
}


.combobox {
  position: relative;
  font-family: "PT Sans";
  border: solid 1px var(--second-dis);
  border-radius: 12px;
  font-size: 20px;
  color: var(--second-act);
  padding: 8px 12px 8px 16px;
  background: no-repeat left 16px center / 173px 19px url('~src/assets/images/icons/placeholder.svg');

  &:hover{
    border-color: var(--second);
    outline: none;
  }
  &.active {
    border-color: var(--prime);
    outline: none;
    
  }
  &:disabled{
    border-color: #EDEDED;
    outline: none;
  }

  .toggle {
    display: flex;
    flex-direction: row;
    align-items: center;
    width: 100%;
    height: 24px;
    font-size: 20px;
    box-sizing: border-box;
    cursor: pointer;
    .caption {
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      width: 100%;
      background-color: #ffffff;
      p {
        padding: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        &.faded {
          font-size: 0.875rem;
          color: #7f7f7f;
        }
      }
    }
    .filter {
      display: none;
      width: 100%;
      input {
        width: 100%;
        padding: 8px 0;
        border: 0;
      }
    }



    &:after {
      display: block;
      width: 24px;
      height: 20px;
      margin-left: auto;
      background: url('~src/assets/images/icons/arrow_drop_down_grey_24dp.svg') 50% 50% no-repeat;
      content: "";
      transition: transform 0.2s;
    }
    
    &:hover:after {
      background: url('~src/assets/images/icons/arrow_drop_down_dark_24dp.svg') 50% 50% no-repeat;
    }   

  }

  &.active .toggle:after {
    background: url('~src/assets/images/icons/arrow_drop_down_24dp.svg') 50% 50% no-repeat;
  }

  .dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 1px);
    left: -1px;
    width: calc(100% + 2px);
    margin-bottom: 50px;
    background-color: #ffffff;
    border: #dfdfdf solid 1px;
    border-radius: 4px;
    box-shadow: rgba(0, 0, 0, 0.16) 0 2px 3px 0;
    overflow: hidden;
    z-index: 100;

    ul {
      padding: 0;
      margin: 0;
      max-height: 280px;
      overflow: auto;
      -webkit-overflow-scrolling: touch;
      .empty {
        padding: 10px 16px;
        background-color: #f7f7f7;
        color: #7f7f7f;
        .add {
          display: block;
          color: #2c86cd;
          cursor: pointer;
        }
      }

      li {
        .title {
          padding: 10px 16px;
          border-bottom: #dfdfdf solid 1px;
          cursor: pointer;
          p {
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            margin: 0;
            padding: 0;
            &.faded {
              font-size: 0.875rem;
              color: #7f7f7f;
            }
          }
          &:hover {
            background-color: #f7f7f7;
          }
          &.selected {
            background-color: #e3eff9;
          }
        }
      }
    }
  }

  &.active {
    .toggle {
      .caption {
        display: none;
      }
      .filter {
        display: block;
      }
      &::after {
        transform: rotateZ(180deg);
      }
    }
    .dropdown {
      display: block;
    }
  }
}


.values {
  display: flex;
  flex-direction: row;
  align-items: center;
  flex-wrap: wrap;

  .item {
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 4px 8px 4px 12px;
    margin: 8px 8px 0 0;
    background-color: #E3EFF9;
    border-radius: 16px;

    .name {
      padding-right: 8px;
      font-size: 0.875rem;
      line-height: 20px;

      p {
        margin: 0;
      }

      .faded {
        color: #7f7f7f;

      }
    }

    .remove {
      width: 16px;
      height: 16px;
      padding: 0;
      margin: auto;
      border: none;
      //background: transparent url('~src/assets/images/icons/close_16dp.svg') 50% 50% no-repeat;
      cursor: pointer;
    }
  }
}
