/**
* Base input
*/
.bp-input,
.bp-input[disabled],
.bp-input[readonly],
.bp-input[type="email"],
.bp-input[type="email"][disabled],
.bp-input[type="email"][readonly],
.bp-input[type="number"],
.bp-input[type="number"][disabled],
.bp-input[type="number"][readonly],
.bp-input[type="search"],
.bp-input[type="search"][disabled],
.bp-input[type="search"][readonly],
.bp-input[type="text"],
.bp-input[type="text"][disabled],
.bp-input[type="text"][readonly],
.bp-input[type="tel"],
.bp-input[type="tel"][disabled],
.bp-input[type="tel"][readonly],
.bp-input[type="url"],
.bp-input[type="url"][disabled],
.bp-input[type="url"][readonly],
.bp-input[type="password"],
.bp-input[type="password"][disabled],
.bp-input[type="password"][readonly] {
  border: none;
  font-size: $bp-fs-6;
  background: $bp-color-white;
  margin-top: 0.2 * $m;
  width: 100%;
  margin-right: 1 * $m;
  height: 1.9 * $m;
  line-height: 1.9 * $m;
  padding: 0;
  @include placeholder($bp-color-cloud);

  &:focus {
    border: none;
    outline: none;
  }
}

.bp-input[disabled],
.bp-input[type="email"][disabled],
.bp-input[type="number"][disabled],
.bp-input[type="search"][disabled],
.bp-input[type="text"][disabled],
.bp-input[type="tel"][disabled],
.bp-input[type="url"][disabled],
.bp-input[type="password"][disabled] {
  background-color: $bp-color-offwhite;
}

/**
* Eliminating arrows from number input
*/
.bp-input[type="number"]::-webkit-outer-spin-button,
.bp-input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.bp-input[type="number"] {
  -moz-appearance: textfield;
}

/**
* Input of type password
*/

.bp-input__password-strength {
  position: absolute;
  right: 10px;
  top: 5px;
  .str-lvl {
    height: 7px !important;
    width: 16px !important;
    background: #d3d3d3;
    border-radius: 3.5px;
    display: inline-block;
    &.lvl-one {
      &.weak {
        background-color: $bp-color-warning;
      }
      &.medium {
        background-color: $bp-color-warning-yellow;
      }
      &.strong {
        background-color: $bp-color-true;
      }
    }
    &.lvl-two {
      &.medium {
        background-color: $bp-color-warning-yellow;
      }
      &.strong {
        background-color: $bp-color-true;
      }
    }
    &.lvl-three {
      &.strong {
        background-color: $bp-color-true;
      }
    }
  }
}

/**
* Input of type checkbox
*/
.bp-input--check--wrapper {
  display: inline-flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: flex-start;
  font-size: $bp-fs-6;
  line-height: $bp-lh-6;
}

.bp-input[type="checkbox"],
.bp-input[type="radio"] {
  display: none;
}

.bp-input--checkbox,
.bp-input--radio {
  cursor: default;
  @include no-select();
  color: transparent;
  text-align: center;
  margin-right: 0.8 * $m;
  flex-shrink: 0;
  font-size: $bp-fs-6;
  line-height: $bp-lh-6;
  border: 0.1 * $m solid $bp-color-bot;
  transition: all 500ms;
  svg, svg path {
    width: 100%;
    height: 100%;
    padding: 20%;
    fill: transparent;
  }
}

.bp-input--checkbox {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.4 * $m;
  width: 1.7 * $m;
  height: 1.7 * $m;
}

.bp-input--radio {
  width: 2.1 * $m;
  height: 2.1 * $m;
  border-radius: 2 * $m;
  padding: 0.4 * $m;
  background-clip: content-box;
}

.bp-input[type="checkbox"]:checked ~ .bp-input--checkbox,
.bp-input[type="radio"]:checked ~ .bp-input--radio {
  color: $bp-color-white;
  background-color: $bp-color-bot;
  border-color: $bp-color-bot;

  &:hover {
    background-color: bp-darken($bp-color-blip-light);
    border-color: bp-darken($bp-color-blip-light);
  }
  svg, svg path {
    fill: $bp-color-white;
  }
}

.bp-input[type="checkbox"]:indeterminate ~ .bp-input--checkbox {
  background-clip: content-box;
  padding: 0.3 * $m;
  color: transparent;
  background-color: $bp-color-bot;
  border-color: $bp-color-bot;
  transition: background-color 0;

  svg, svg path {
    fill: transparent;
  }
}

.bp-input[type="checkbox"]:disabled ~ .bp-input--checkbox,
.bp-input[type="radio"]:disabled ~ .bp-input--radio {
  background-color: $bp-color-whisper;
  color: $bp-color-time;
  border-color: $bp-color-offwhite;
  &:hover {
    border-color: $bp-color-breeze;
    background-color: transparent;
  }
  svg, svg path {
    fill: $bp-color-time;
  }
}

.bp-input[type="checkbox"]:disabled:not(:checked) ~ .bp-input--checkbox {
  color: transparent;
  svg, svg path {
    fill: transparent;
  }
}

.bp-input[type="radio"]:disabled:not(:checked) ~ .bp-input--radio {
  padding: 0;
}

/**
* Wrapper
*/
.bp-input-wrapper {
  height: 4.7 * $m;
  border: 0.1 * $m solid $bp-color-breeze;
  border-radius: 0.8 * $m;
  padding: 0.5 * $m 1 * $m;
  position: relative;
  background-color: $bp-color-white;
}

.bp-input--with-bullet {
  &:after {
    content: "";
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid $bp-color-desk;
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
  }
}

.bp-input-wrapper--disabled {
  background-color: $bp-color-offwhite;
  border-color: $bp-color-breeze;
}

.bp-input-wrapper--focus {
  box-shadow: 0 0.2 * $m 1.2 * $m 0 rgba(0, 0, 0, 0.1);
  border-color: $bp-color-blip-light;
  transition: box-shadow 0.5s ease-in;
}

.bp-input-wrapper--invalid {
  border-color: $bp-color-warning;
  box-shadow: 0px 0px 1px 2px $bp-color-delete;
}

.bp-input-wrapper--valid {
  border-color: $bp-color-true;
}

// ==========
// States
// =========

/**
* Check
*/
.bp-input-check {
  position: absolute;
  right: 0;
  bottom: 0;
  background-color: $bp-color-white;
  font-size: 1.9 * $m;
  line-height: 0.5 * $m;
  padding-left: 5px;
}

