@input-input-text-color: #555;
@input-error-color: var(--color-danger);
@input-blur-color: #888;
@input-focus-color: var(--color-primary);
@input-placeholder-size: 16px;
@input-textarea-height: auto;
@input-textarea-padding-top: 8px;
@input-icon-padding: 16px 0 0;
@input-icon-size: 20px;
@input-line-size: 1px;
@input-line-spread-size: 2px;
@input-disabled-color: var(--color-text-disabled);

:root {
  --input-input-text-color: @input-input-text-color;
  --input-error-color: @input-error-color;
  --input-blur-color: @input-blur-color;
  --input-focus-color: @input-focus-color;
  --input-placeholder-size: @input-placeholder-size;
  --input-textarea-height: @input-textarea-height;
  --input-textarea-padding-top: @input-textarea-padding-top;
  --input-icon-padding: @input-icon-padding;
  --input-icon-size: @input-icon-size;
  --input-line-size: @input-line-size;
  --input-line-spread-size: @input-line-spread-size;
  --input-disabled-color: @input-disabled-color;
}

.var {
  &-input-footer-margin-enter,
  &-input-footer-margin-leave-to {
    opacity: 0;
    margin-top: 2px !important;
  }

  &-input-footer-margin-enter-active,
  &-input-footer-margin-leave-active {
    transition: 0.2s all var(--cubic-bezier);
  }
}

.var-input {
  width: 100%;
  color: var(--input-input-text-color);

  &__controller {
    width: 100%;
    display: flex;
    position: relative;
  }

  &__wrap {
    position: relative;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    padding-top: var(--input-placeholder-size);
  }

  &__icon {
    display: flex;
    align-items: center;
    padding: var(--input-icon-padding);
    font-size: 20px;
  }

  &__placeholder {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    transform-origin: left;
    transition-property: top, transform, width;
    transition-duration: 0.3s;
    transform: translate(0, calc(-50% + var(--input-placeholder-size) / 2)) scale(1);
    font-size: var(--input-placeholder-size);
    color: var(--input-blur-color);
  }

  &__textarea-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    transform-origin: left;
    transition-property: transform, width;
    transition-duration: 0.3s;
    transform: translate(0, calc(var(--input-textarea-padding-top) + var(--input-placeholder-size))) scale(1);
    font-size: var(--input-placeholder-size);
    color: var(--input-blur-color);
  }

  &__autocomplete {
    width: 0;
    height: 0;
    padding: 0;
    border: none;
    outline: none;
    font-size: 0;
  }

  &__input {
    width: 100%;
    height: 32px;
    padding: 0;
    outline: none;
    border: none;
    background: transparent;
    color: var(--input-input-text-color);
    caret-color: var(--input-focus-color);
    font: inherit;
  }

  &__line {
    width: 100%;
    height: var(--input-line-size);
    background: var(--input-blur-color);
  }

  &__dot {
    width: 100%;
    height: var(--input-line-spread-size);
    background: var(--input-focus-color);
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 0.3s var(--cubic-bezier);
  }

  &__clear-icon[var-input-cover] {
    display: flex;
    margin-left: 4px;
  }

  &--textarea {
    padding-top: var(--input-textarea-padding-top);
    height: var(--input-textarea-height);
  }

  &--placeholder-hint {
    top: 0;
    width: 133.33%;
    transform: translate(0, 0) scale(0.75);
  }

  &--placeholder-non-hint {
    top: 50%;
    transform: translate(0, -50%) scale(1);
  }

  &--non-hint {
    padding-top: 0;
  }

  &--placeholder-hidden {
    visibility: hidden;
  }

  &--focus {
    color: var(--input-focus-color);
  }

  &--spread {
    transform: scaleX(1);
  }

  &--disabled {
    -webkit-text-fill-color: var(--input-disabled-color);
    opacity: 1;
    color: var(--input-disabled-color);
  }

  &--error {
    color: var(--input-error-color);
  }

  &--line-disabled {
    background: var(--input-disabled-color);
  }

  &--line-error {
    background: var(--input-error-color);
  }

  &--caret-error {
    caret-color: var(--input-error-color);
  }
}
