@import "../../style/index.scss";

.text-input {
  position: relative;

  label {
    @include label;
    position: relative;
  }

  input,
  textarea {
    @include textField;
    max-width: var(--form-field-long);
    display: block;

    &:active:not(:disabled),
    &:hover:not(:disabled),
    &:focus:not(:disabled) {
      @include textField--active;
    }

    &:disabled {
      @include textField--disabled;
    }

    &::placeholder {
      color: var(--gray-40);
    }
  }

  textarea {
    width: 100%;
    max-width: none;
    box-sizing: border-box;
    height: var(--textarea-height);
    resize: none;
  }

  textarea.text-input__textarea--small {
    height: var(--textarea-height-small);
  }

  &--has-error {
    input,
    textarea {
      border-color: var(--color-negative);

      &:active:not(:disabled),
      &:hover:not(:disabled),
      &:focus:not(:disabled) {
        border-color: var(--color-negative);
      }
    }
  }

  &__error {
    color: var(--color-negative);
    font-size: var(--tag-font-size);
  }
}
