.Demio-Autocomplete-field-invalid {
  .ant-select-selection {
    border-color: #ee4c3b !important;
    box-shadow: none;
  }
}

.ant-select-focused .ant-select-selection,
.ant-select-selection:focus,
.ant-select-selection:active {
  border-color: #000000;
  box-shadow: none;
}

.Demio-Autocomplete {
  &.--disabled {
    cursor: not-allowed;

    .Demio-Autocomplete-selection {
      color: rgba(0, 0, 0, 0.25);
      background: #f7f7f7;
      border-color: #dee4e8 !important;
    }
  }
}

.Demio-Autocomplete-field {
  margin-bottom: 17px;

  .ant-select {
    width: 100%;
    min-width: 160px;
  }

  .ant-select-arrow {
    top: 5px;
    right: 5px;
  }

  .ant-select-search__field {
    font-size: 16px;
  }

  &:focus {
    outline: none;
  }

  label {
    display: block;
    position: relative;
    margin-bottom: 0;
  }
}

.Demio-Autocomplete-label,
.Demio-Autocomplete-label-optional {
  color: #9fa6ad;
  position: absolute;
  top: -9px;
  z-index: 4;
  background: #fff;
  left: 8px;
  line-height: 17px;
  padding: 0 8px;
  font-size: 12px;
  letter-spacing: 0.4px;
  border-radius: 4px;
  font-weight: normal;
}

.Demio-Autocomplete-label-optional {
  left: auto;
  right: 14px;
  font-style: italic;
}

.Demio-Autocomplete-label {
  max-width: ~"calc(100% - 78px)";
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
  top: -9px;
  height: 17px;
  display: flex;
  line-height: 14px;
  align-items: center;
}

.Demio-Autocomplete-field-hint {
  .Demio-Autocomplete-label,
  .Demio-Autocomplete-label-optional {
    color: #2c3336;
  }
}

.Demio-Autocomplete-field-hint,
.Demio-Autocomplete-field-invalid {
  .Demio-Autocomplete-field-error {
    padding: 5px 8px 0;
    font-size: 12px;
    letter-spacing: 0.4px;
    border-radius: 4px;
    font-weight: normal;
    line-height: normal;
  }
}

.Demio-Autocomplete-field-invalid {
  .Demio-Autocomplete-field-error {
    color: #ee4c3b;
  }
  .Demio-Autocomplete-selection,
  input {
    border-color: #ee4c3b !important;
  }
}

.Demio-Autocomplete-field-error {
  display: flex;
  justify-content: space-between;
}

.Demio-Autocomplete--open .Demio-Autocomplete-selection {
  border-color: #2c3336;
  // border-color: #02BF6F;
  // TODO: we will use these other colors in a future change

  .Demio-Autocomplete-arrow {
    transform: rotate(0deg);
    // fill: #02BF6F;
  }
}

.Demio-Autocomplete {
  font-weight: normal;
  font-size: 14px;
  line-height: 20px;
  letter-spacing: 0.25px;
  color: #9fa6ad;
  line-height: 47px;
  position: relative;
  cursor: pointer;
  height: 48px;
  user-select: none;

  &.Demio-Autocomplete--minwidth {
    min-width: 270px;
  }

  &.--disabled {
    cursor: not-allowed;

    .Demio-Autocomplete-selection {
      color: rgba(0, 0, 0, 0.25);
      background: #f7f7f7;
      border-color: #dee4e8 !important;
    }
  }
}

.Demio-Autocomplete--open,
.Demio-Autocomplete:hover {
  .Demio-Autocomplete-selection {
    border-color: #2c3336;
    transition: all 0.3s;
  }
}

.Demio-Autocomplete-selection {
  padding: 0 19px;
  padding-right: 40px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  border-radius: 5px;
  border: 1px solid #dee4e8;
  background: #fff;
  position: relative;
  z-index: 1;
  height: 48px;
  outline: none;

  &.--no-arrow .Demio-Select-arrow {
    display: none;
  }

  &.--selected {
    color: #2c3336;
  }
}

.Demio-Autocomplete-arrow {
  transform: rotate(180deg);
  position: absolute;
  top: 16px;
  right: 16px;
  fill: #5d676b;
  transition: transform 0.4s;
}

.Demio-Autocomplete-options {
  position: absolute;
  top: 51px;
  max-height: 148px;
  overflow: auto;
  line-height: 22px;
  background: #fff;
  width: 100%;
  border-radius: 5px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  animation: fadeInSlideAbit 0.3s ease-in-out;
  z-index: 5;

  &.--custom-options {
    max-height: unset;
  }

  > div {
    outline: none;
  }

  .Demio-Autocomplete-option {
    padding: 5px 20px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    color: rgba(0, 0, 0, 0.65);
    font-weight: normal;
    line-height: 22px;
    height: 40px;
    display: flex;
    align-items: center;

    &:hover {
      background-color: #e6fff0;
    }
  }
}
