@import '../../../../globals/variables';
@import '../../../../globals/mixins';
@import '../../../../globals/fonts';

.default-input {
  font-family: Poppins-Regular, Inter, system-ui, sans-serif;
  font-size: 0.875rem;
  font-weight: normal;
  margin-bottom: 3.125rem;
  max-height: 3.625rem;
  max-width: 20.625rem;
  width: 100%;

  @include respond-to('tablet') {
    max-width: 25rem;
  }

  &__label {
    color: $ads-input-text-color;
    display: block;
    font-family: Poppins-Medium, Inter, sans-serif;
    font-size: 0.875rem;
    font-weight: normal;
    margin-bottom: 0.5rem;
  }

  &__container {
    align-items: center;
    background: $ads-secondary-twenty-five;
    border: 0.0625rem solid $ads-input-border-color;
    border-radius: 0.375rem;
    display: flex;
    height: 2.625rem;
    transition: all 0.15s ease;

    &:not(.disabled, .error) {
      border-color: $ads-input-border-color;
    }

    &:focus-within:not(.disabled) {
      border-color: $ads-input-focus-color;
      box-shadow: 0 0 0 0.125rem rgba($ads-input-focus-color, 0.25);
    }

    &.filled:not(.disabled, .error) {
      border-color: $ads-input-border-color;
    }

    &.error:not(.filled) {
      border-color: $ads-input-error-color;
    }

    &.error:not(.disabled) {
      &:focus-within {
        border-color: $ads-input-error-border-color;
        box-shadow: 0 0 0 0.125rem rgba($ads-input-error-border-color, 0.25);
      }

      &.filled {
        border-color: $ads-input-error-border-color;
      }
    }

    &.disabled {
      background: $ads-input-disabled-color;
      border-color: $ads-input-disabled-border-color;
      cursor: not-allowed;
      opacity: $ads-input-disabled-opacity;
    }
  }

  &__field {
    background: transparent;
    border: none;
    color: $ads-input-text-color;
    flex: 1;
    font-size: 0.875rem;
    height: 100%;
    outline: none;
    padding: 0.625rem 0.875rem;
    width: 100%;

    &:disabled {
      color: $ads-input-hint-color;
      cursor: not-allowed;
    }

    &::placeholder {
      color: $ads-input-hint-color;
      opacity: 1;
    }
  }

  &__icon {
    display: none;
  }

  &__message {
    color: $ads-input-hint-color;
    font-size: 0.8125rem;
    line-height: 1.3;
    margin-top: 0.5rem;

    &.error {
      color: $ads-input-error-color;
    }
  }

  &.sharp-corners &__container {
    border-radius: 0;
  }

  &.rounded-corners &__container {
    border-radius: 0.3rem;
  }

  &.pill-shape &__container {
    border-radius: 1.3rem;
  }
}
