// Input switch
//
// The switch is a based around the input type `checkbox` element.
// Wrap the checkbox in a `<label>` element and put a span with class `lever` next to the
// input element. Now you can put your labels at the beginning and end of the label.
//
// markup: form-input-switch.twig
//
// Weight: 6
//
// Style guide: atoms.form-controls.input-switch

.switch * {
  user-select: none;
  cursor: pointer;
}

.switch {
  display: flex;
  width: 100%;
}

.switch__label {
  flex: 1 1 auto;
}

.switch__options {
  flex: 1 0 150px;
  text-align: right;
}

.switch input[type=checkbox]{
  opacity: 0;
  width: 0;
  height: 0;
}

.switch label {
  font-weight: 400;
}

.switch .lever {
    content: "";
    display: inline-block;
    position: relative;
    width: 40px;
    height: 15px;
    background-color: $switch-unchecked-lever-bg;
    border-radius: 15px;
    margin-right: 10px;
    transition: background 0.3s ease;
    vertical-align: middle;
    margin: 0 16px;
}

.switch .lever:after {
  @include z-depth-1;
  content: "";
  position: absolute;
  display: inline-block;
  width: 21px;
  height: 21px;
  background-color: $switch-unchecked-bg;
  border-radius: 21px;
  left: -5px;
  top: -3px;
  transition: left 0.3s ease, background .3s ease, box-shadow 0.1s ease;
}

input[type=checkbox]:not(:disabled) ~ .lever:active:after {
  box-shadow: 0 1px 3px 1px rgba(0,0,0,.4), 0 0 0 15px rgba(0, 0, 0, .08);
}

.switch input[type=checkbox]:checked + .lever:after {
  left: 24px;
}

// Disabled Styles
.switch input[type=checkbox][disabled] + .lever{
  cursor: default;
}
.switch input[type=checkbox][disabled] + .lever:after,
.switch input[type=checkbox][disabled]:checked + .lever:after {
  background-color: $input-disabled-solid-color;
}
