@import (reference) "../less/utilities";

.TextInput2--container {
  font-family: "Proxima Nova";
}

.TextInput2--infoRow {
  .flexbox();
  .justify--between();
  .padding--bottom--2xs();
  color: @neutral_medium_gray;
  .text--small();

  &--labelHidden {
    .justify--end();
  }
}

.TextInput2--label {
  &--error {
    .text--semi-bold();
  }

  /*
    for a11y purposes
    https://a11y-guidelines.orange.com/en/web/components-examples/accessible-hiding/#
  */
  &--hidden {
    /* stylelint-disable */
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap; /* added line */
    border: 0;
    /* stylelint-enable */
  }
}

.TextInput2--infoRequirement {
  .text--italic();
}

.TextInput2--leadingIcon {
  color: @neutral_medium_gray;
  .margin--right--2xs();
}

.TextInput2--inputContainer {
  width: 100%;
  .inlineFlexbox();
  .items--baseline();
  .border--s(@neutral_silver);
  .borderRadius--l();
  background-color: @neutral_white;
  .padding--x--xs();
  box-sizing: border-box;
  transition: all @timingQuickly ease-out;

  &--focused {
    box-shadow: 0 0 0 @size_2xs ~"@{primary_blue_tint_2}80";

    .border--s(@primary_blue);
  }

  &--error {
    .border--s(@alert_red);
  }

  /* stylelint-disable-next-line no-descending-specificity */
  &:hover {
    .border--s(@primary_blue);
  }
  /*
    error border is always on, so override the hover state
  */
  /* stylelint-disable-next-line no-descending-specificity */
  &--error:hover {
    .border--s(@alert_red);
  }

  &--disabled {
    .border--s(@neutral_silver);
  }

  &--disabled:hover {
    .border--s(@neutral_silver);
  }
}

.TextInput2--inputContainer--focused.TextInput2--inputContainer--error {
  box-shadow: 0 0 0 @size_2xs ~"@{alert_red_tint_2}80";
}

.TextInput2--input {
  outline: none;
  font-family: "Proxima Nova";
  .text--medium();
  border: none;
  .borderRadius--l();
  width: 100%;
  height: @size_2xl;
  line-height: @size_l;

  &::placeholder {
    color: @neutral_gray;
  }

  &::-webkit-input-placeholder {
    color: @neutral_gray;
  }

  &::-moz-placeholder {
    color: @neutral_gray;
  }

  &:-ms-input-placeholder {
    color: @neutral_gray;
  }

  &:disabled {
    background-color: @neutral_white;
  }
}

.TextInput2--footerText {
  color: @neutral_medium_gray;
  .text--small();
  .padding--top--2xs();

  &--error {
    color: @alert_red;
  }
}

.TextInput2--errorIcon {
  color: @alert_red;
  .margin--left--xs();
}

.Button.TextInput2--hideShowButton {
  .margin--left--xs();
}
