@use '@/styles/variables' as *;
@use '@/styles/mixins' as *;

.inputWrapper {
  display: flex;
  flex-direction: column;
  gap: $spacing-xs;

  &__label {
    font-size: $font-size-sm;
    font-weight: $font-weight-medium;
    color: $text-primary;
  }

  &__helper {
    font-size: $font-size-xs;
    color: $text-secondary;

    &--error {
      color: $error-color;
    }
  }
}

.input {
  display: flex;
  align-items: center;
  gap: $spacing-sm;
  border: 1px solid $border-color;
  border-radius: $border-radius-base;
  background-color: $card-background;
  @include transition-fast;

  &:focus-within {
    border-color: $primary-color;
    box-shadow: 0 0 0 3px rgba($primary-color, 0.1);
  }

  &--sm {
    padding: $spacing-sm $spacing-md;

    .input__field {
      font-size: $font-size-sm;
    }
  }

  &--md {
    padding: $spacing-md $spacing-base;

    .input__field {
      font-size: $font-size-base;
    }
  }

  &--lg {
    padding: $spacing-base $spacing-lg;

    .input__field {
      font-size: $font-size-md;
    }
  }

  &--error {
    border-color: $error-color;

    &:focus-within {
      border-color: $error-color;
      box-shadow: 0 0 0 3px rgba($error-color, 0.1);
    }
  }

  &--disabled {
    background-color: $background-color;
    cursor: not-allowed;

    .input__field {
      cursor: not-allowed;
    }
  }

  &__prefix,
  &__suffix {
    @include flex-center;
    color: $text-secondary;
    flex-shrink: 0;

    svg {
      width: 16px;
      height: 16px;
    }
  }

  &__field {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    color: $text-primary;
    font-family: $font-family-base;
    min-width: 0;

    &::placeholder {
      color: $text-disabled;
    }
  }
}
