@import '~styles/base/colors';
@import '~styles/base/type';
@import '~styles/base/media-queries';
@import '~styles/tools/mixins';
@import '~styles/tools/animations';

$inputRadius: 5px;

.otInput {
  @include display-flex();
  border-radius: $inputRadius;
  position: relative;

  &__field {
    width: 70% !important;
    border-radius: 0 $inputRadius $inputRadius 0 !important;

    &:focus {
      box-shadow: rgba(#2D9BE3, .4) 0 0 0 2px;
      border-color: #2D9BE3;
      border-left-color: #2D9BE3 !important;
    }
  }

  label {
    width: 30%;
    padding: 0.85rem;
    font-size: font-size(body, small);
    text-align: center;
    line-height: line-height(body);
    font-weight: font-weight(medium);
    vertical-align: middle;
    white-space: nowrap;
    background: palette(gray, xx-light);
    border: 1px solid #CBD7DE;
    border-right: 1px solid transparent;
    margin-bottom: 0;
    border-radius: $inputRadius 0 0 $inputRadius;
  }

  i {
    opacity: 1;
    font-size: font-size(body);
    position: absolute;
    right: 10px;
    @include center(v);
  }

  &--disabled {
    opacity: 0.5;
  }

  @each $var, $color in $ui-colors {
    &--#{$var} {
      border: 1px solid $color;

      input {
        border: {
          right: none !important;
          top: none !important;
          bottom: none !important;
        }

        &:focus {
          border-left-color: $color !important;
          box-shadow: 0 0 0 3px rgba($color, 0.4);
        }
      }

      label {
        border-top: none;
        border-left: none;
        border-bottom: none;
        color: $color;
      }
    }
  }

  @include gmq(iphone5) {
    label {
      width: 35% !important;
    }

    &__field {
      width: 65% !important;
    }
  }
}

.hasIcon {
  .otInput__field {
    padding-right: 26px !important;
  }
}

.passwordEye {
  color: darken($gray, 10%);
  cursor: pointer;
}

.passwordEyeVisible {
  color: palette(gray, dark);
  cursor: pointer;
}

.isSecureIcon {
  width: 15px;
  height: 15px;
  position: absolute;
  right: 10px;
  @include center(v);
}
