@import '../../00-materials/styles/mixins/check-mark-animated';

$border-width: 1px;
$border-type: solid;

axa-input-text {
  .a-input-text__input-wrapper {
    display: flex;
    align-items: center;
    width: 100%;
  }

  .a-input-text__input-elements {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
  }

  .a-input-text__info-button {
    margin-left: 10px;
    width: 32px;
    height: 32px;
  }

  .a-input-text__input {
    @include text(t4);
    appearance: none;
    background: $color-prim-white;
    border: $border-width $border-type $color-light-grey;
    border-radius: 0;
    box-sizing: border-box;
    color: $color-dark-grey;
    height: 40px;
    padding: 0 20px;
    width: 100%;

    &::placeholder {
      color: $color-light-grey;
    }

    &::-ms-clear {
      display: none;
    }

    &:hover,
    &:active,
    &:focus {
      border: $border-width $border-type $color-axa-blue;
    }

    &:focus,
    &.focus {
      border: $border-width $border-type $color-axa-blue;
      outline: $border-width $border-type $color-axa-blue;
      outline-offset: -2px;
    }

    &--error {
      border: $border-width $border-type $color-shy-tomato;

      &:hover,
      &:active,
      &:focus {
        border: $border-width $border-type $color-shy-tomato;
      }

      &:focus,
      &.focus {
        outline: $border-width $border-type $color-shy-tomato;
        outline-offset: -2px;
      }
    }

    &:disabled,
    &--readonly {
      background-color: $color-alabaster;
      border-color: $color-mercury;
      color: $color-light-grey;
      -webkit-text-fill-color: $color-light-grey;
      opacity: 1;
    }
  }

  .a-input-text__input--check {
    padding-right: 31px;
  }

  .a-input-text__label {
    @include text(t3);
    display: block;
    font-weight: 600;
    color: $color-dark-grey;
    margin-bottom: 10px;
  }

  &[disabled] .a-input-text__label,
  &[readonly] .a-input-text__label {
    color: $color-light-grey;
  }

  .a-input-text__check {
    @include check-mark-animated();
    position: absolute;
    top: 7px;
    right: 5px;
  }

  .a-input-text__error {
    @include text(t4);
    display: block;
    color: $color-shy-tomato;
    margin-top: 10px;
  }

  .a-input-text__character-overflow-error {
    color: $color-shy-tomato;
  }

  .a-input-text__counter-info {
    margin-top: 10px;
  }
}
