button,
input,
optgroup,
select,
textarea {
  font-family: inherit;
}

fieldset {
  border: none;
  margin: 0;
  padding: 0;
}

.input {
  position: relative;
  margin-bottom: 10px;

  label {
    font-size: @font-size-small;
    color: @blue-dark;
    display: block;
    margin-bottom: 3px;
    font-style: normal;

    .checkbox&,
    .radio& {
      min-height: 21px;
      margin-bottom: 0;
      font-weight: normal;
      cursor: pointer;
      font-size: @font-size-medium;
    }
  }

  input[type="text"],
  input[type="password"],
  textarea {
    padding: 3px 7px;
  }

  input[type="number"] {
    padding: 3px 0px 3px 7px;
  }

  input[type="text"],
  input[type="password"],
  input[type="number"],
  textarea
  {
    max-width: 350px;
    background: @blue-1;
    color: @blue-dark;
    font-weight: bold;
    border: 2px solid @blue-2;
    width: 100%;
    .border-radius(2px);

    &:focus {
      outline: none;
      border: 2px solid @blue;
    }

    .input-validation.error & {
      border: 2px solid @red;
    }

    .input--wide& {
      max-width: none;
    }

    .input--narrow& {
      max-width: 150px;
    }

    .input--icon& {
      padding-left: 30px;
    }
  }

  &.input--icon {
    [class^="icon-"],
    [class*=" icon-"] {
      position: absolute;
      left: 8px;
      top: 8px;
      font-size: 14px;
    }
  }

  textarea {
    padding: 5px 7px;
    min-height: 60px;
  }

  input[type="text"],
  input[type="password"],
  input[type="number"] {
    height: 31px;
    line-height: 31px;
  }

  input[type="checkbox"],
  input[type="radio"] {
    margin: 4px 4px 0;
    margin-top: 4px \9;
  }

  select {
    .select();
    width: 100%;
    max-width: 350px;

    &:focus {
      outline: none;
    }

    .input-validation.error & {
      border: 1px solid @red;
    }
  }

  select[multiple] {
    height: auto;
    padding: 5px;
  }

  .help-block {
    font-size: @font-size-small;
    color: @gray-5;
    display: block;
    margin-top: 5px;
    max-width: 350px;
  }

  [disabled] & {
    input[type="text"],
    input[type="password"],
    input[type="number"],
    textarea {
      background: transparent;
      border: none;
      padding-left: 0;

      &::-webkit-input-placeholder {
        color: transparent;
      }
      &:-moz-placeholder {
        color: transparent;
        opacity: 1;
      }
      &::-moz-placeholder {
        color: transparent;
        opacity: 1;
      }
      &:-ms-input-placeholder {
        color: transparent;
      }
    }
  }
}

.input.radio,
.input.checkbox {
  border-bottom: 1px solid @gray-2;
  max-width: 350px;
  margin-bottom: 3px;
  padding-bottom: 5px;

  &.full-width {
    max-width: none;
  }

  .help-block {
    margin-top: 2px;
    margin-left: 23px;
  }
}

.input-validation__message {
  font-size: @font-size-small;
  color: @red;
  display: block;
  margin-top: -5px;
  max-width: 350px;
  margin-bottom: 10px;
}

.input--inline {
  display: inline-block;
  margin-bottom: 0;

  label {
    display: inline-block;
  }

  input[type="text"],
  input[type="password"],
  textarea {
    width: 250px;
    max-width: none;
  }
}

.input--filter-bar {
  input[type="text"],
  input[type="password"],
  textarea {
    position: relative;
    top: -4px;
    background-color: @white;
  }

  .input__action {
    position: absolute;
    right: 5px;
    top: 4px;
  }
}

.input--small {
  input[type="text"],
  input[type="password"],
  textarea {
    width: 150px;
  }
}

.input--large {
  input[type="text"],
  input[type="password"],
  textarea {
    width: 400px;
  }
}

.input--full-width {
  input[type="text"],
  input[type="password"],
  textarea {
    width: 100%;
    max-width: none;
  }
}

.input__action {
  position: absolute;
  right: 7px;
  top: 7px;
  font-size: @font-size-base;
}

.form-controls {
  margin-top: 20px;
}

.form-message {
  max-width: 350px;
  padding: 10px;
  font-size: @font-size-small;
  margin-bottom: 10px;
  .border-radius(2px);

  .is-error& {
    border: 1px solid @red-light;
    background: @red-hover;
    color: @red;
  }

  .is-success& {
    border: 1px solid @green-light;
    background: @green-hover;
    color: @green;
  }

  .is-info& {
    border: 1px solid @blue-light;
    background: @blue-hover;
    color: @blue;
  }
}

::-webkit-input-placeholder {
  color: @grey-18;
  font-weight: normal;
}
:-moz-placeholder {
  color: @grey-18;
  opacity: 1;
  font-weight: normal;
}
::-moz-placeholder {
  color: @grey-18;
  opacity: 1;
  font-weight: normal;
}
:-ms-input-placeholder {
  color: @grey-18;
  font-weight: normal;
}

input.toggle {
  position: absolute;
  margin-left: -9999px;
  visibility: hidden;
}

input.toggle + label {
  display: block;
  position: relative;
  cursor: pointer;
  outline: none;
  user-select: none;
  padding: 2px;
  width: 50px;
  height: 20px;
  background-color: @gray-3;
  border-radius: 2px;
  transition: border 0.4s;
}

input.toggle + label:before,
input.toggle + label:after {
  display: block;
  position: absolute;
  top: 1px;
  left: 1px;
  bottom: 1px;
  content: "";
}

input.toggle + label:before {
  right: 1px;
  background-color: #f1f1f1;
  border-radius: 2px;
  transition: background 0.4s;
}

input.toggle + label:after {
  width: 20px;
  background-color: #fff;
  border-radius: 2px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  transition: margin 0.15s;
}

input.toggle:checked + label {
  background-color: @green;
}

input.toggle:checked + label:before {
  background-color: @green-light;
}

input.toggle:checked + label:after {
  margin-left: 28px;
}

.autocomplete {
  position: absolute;
  top: 26px;
  width: 100%;
  min-width: 120px;
  list-style: none;
  border: 2px solid @gray-3;
  padding: 5px;
  margin: 0;
  background: @white;
  z-index: 202;
  .border-radius(3px);
  .box-shadow(0,1px,3px,@gray-3);

  li {
    padding: 5px 7px;
    margin: 0;
    font-size: @font-size-medium;
    .border-radius(2px);

    [class^="icon-"],
    [class*=" icon-"] {
      position: relative;
      top: 2px;
      font-size: @font-size-base;
    }

    &:hover {
      background: @blue-hover;
      cursor: pointer;
    }

    &.is-disabled {
      color: @gray-4;

      &:hover {
        background: @white;
        cursor: not-allowed;
      }
    }

    &.is-selected {
      background: @blue-hover;
      cursor: pointer;
    }
  }
}

@track-color: @gray-4;
@thumb-color: @gray-7;
@thumb-radius: 8px;
@thumb-height: 16px;
@thumb-width: 16px;
@track-width: 100%;
@track-height: 6px;
@track-border-width: 1px;
@track-border-color: @gray-4;
@track-radius: 5px;
@contrast: 5%;

.track() {
  width: @track-width;
  height: @track-height;
  cursor: pointer;
  animate: 0.2s;
}

.thumb() {
  border: none;
  height: @thumb-height;
  width: @thumb-width;
  border-radius: @thumb-radius;
  background: @thumb-color;
  cursor: pointer;
}

input[type=range] {
  -webkit-appearance: none;
  margin: @thumb-height/2 0;
  width: @track-width;

  &:focus {
    outline: none;
  }

  &::-webkit-slider-runnable-track {
    .track();
    background: @track-color;
    border-radius: @track-radius;
    border: @track-border-width solid @track-border-color;
  }

  &::-webkit-slider-thumb {
    .thumb();
    -webkit-appearance: none;
    margin-top: ((-@track-border-width * 2 + @track-height) / 2) - (@thumb-height / 2);
  }

  &:focus::-webkit-slider-runnable-track {
    background: lighten(@track-color, @contrast);
  }

  &::-moz-range-track {
    .track();
    background: @track-color;
    border-radius: @track-radius;
    border: @track-border-width solid @track-border-color;
  }

  &::-moz-range-thumb {
    .thumb();
  }

  &::-ms-track {
    .track();
    background: transparent;
    border-color: transparent;
    border-width: @thumb-width 0;
    color: transparent;
  }

  &::-ms-fill-lower {
    background: darken(@track-color, @contrast);
    border: @track-border-width solid @track-border-color;
    border-radius: @track-radius*2;
  }

  &::-ms-fill-upper {
    background: @track-color;
    border: @track-border-width solid @track-border-color;
    border-radius: @track-radius*2;
  }

  &::-ms-thumb {
    .thumb();
  }

  &:focus::-ms-fill-lower {
    background: @track-color;
  }

  &:focus::-ms-fill-upper {
    background: lighten(@track-color, @contrast);
  }
}

.select() {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  border: 2px solid @blue-2;
  background: url("data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg width='24px' height='24px' viewBox='0 0 24 24' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Ctitle%3EIcon / -small-down%3C/title%3E%3Cdefs%3E%3Crect id='path-1' x='0' y='0' width='24' height='24'%3E%3C/rect%3E%3C/defs%3E%3Cg id='Icon-/--small-down' stroke='none' stroke-width='1' fill='none' fill-rule='evenodd'%3E%3Cmask id='mask-2' fill='white'%3E%3Cuse xlink:href='%23path-1'%3E%3C/use%3E%3C/mask%3E%3Cg id='Background'%3E%3C/g%3E%3Cg id='small-down' mask='url(%23mask-2)' stroke='%23022E61' stroke-linecap='round' stroke-linejoin='round' stroke-width='2'%3E%3Cg transform='translate(8.000000, 10.000000)' id='Path'%3E%3Cpolyline points='8 0 4 4 0 0'%3E%3C/polyline%3E%3C/g%3E%3C/g%3E%3C/g%3E%3C/svg%3E") @blue-1 right center no-repeat;
  border-radius: 2px;
  padding-left: 10px;
  padding-right: 40px;
  height: 31px;
  font-size: @font-size-small;
  padding-top: 0px;
  padding-bottom: 0px;
  text-overflow: '';
  text-indent: 0.01px;
  outline: none;
  font-weight: bold;
  color: @blue-dark;

  &:focus,
  &:active {
    outline: none;
    border-color: @blue;
  }

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

  &:-moz-focusring {
    color: transparent;
    text-shadow: 0 0 0 #000;
  }
}

.selectCustom(@height: 31px) {
  height: @height;
  line-height: @height;
}

select {
  .select();
}

.date-input {
  max-width: 350px;

  .help-block {
    font-size: @font-size-small;
    color: @gray-5;
    display: block;
    margin-top: 5px;
    max-width: 350px;
  }
}

.mt-otp-input {
  display: flex;

  &__digit {
    width: 50px;
    height: 70px;

    background-color: @gray-0;
    color: @blue-23;
    border: 2px solid @blue-23;
    border-radius: 4px;

    font-size: 30px;
    text-align: center;

    margin-right: 15px;

    transition: all 200ms ease;

    &:disabled {
      border-color: @gray-3;
    }

    &:focus {
      outline: none;
      border-color: @blue-23;
    }

    &:last-child {
      margin-right: 0px;
    }

    &--active {
      border-color: @blue-23;
    }
  }
}
