
.form-toggle {
  position: relative;
  display: flex;
  flex-direction: row;
  align-items: center;
  height: auto;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  color: inherit;
  width: 60px;
  height: 30px;
  margin-bottom: 0;
}

.toggle-switch-label {
  display: inline-block;
  margin-left: $spacing-xs;
  padding-top: 0.5rem;
  font: $font-size-base $font-weight-base;
  color: $black;
  cursor: pointer;
}

.toggle-switch input, .translation-header-toggle input {
  visibility: hidden;
  width: 0;
  height: 0;
}

.toggle-switch .slider {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  cursor: pointer;
  background-color: $gray-light;
  border-radius: 20px;
  @apply hover:outline hover:outline-hover-light transition-transform;
}

.toggle-switch .slider:before {
  @apply transition-transform;
  position: absolute;
  background-color: $white;
  border-radius: 100%;
  content: "";
  height: 26px;
  width: 26px;
  left: 2px;
  bottom: 2px;
  top: 2px;
}

.toggle-switch input:checked + .slider {
  background-color: $info;
}

.toggle-switch input:focus + .slider {
  box-shadow: 0 0 1px $link-hover-color;
}

.toggle-switch input:checked + .slider:before {
  -webkit-transform: translateX(30px);
  -ms-transform: translateX(30px);
  transform: translateX(30px);
}

.toggle-switch.disabled .slider {
  background-image: url("@images/pattern-striped-bright.png");
  background-repeat: repeat;
  background-color: transparent;
  border: 1px solid $disabled;
  cursor: not-allowed;

  &::before {
    top: 1px;
    background-color: $disabled;
  }
}

.toggle-switch input:disabled + .slider,
.toggle-switch input:disabled + label {
  background-color: transparent;
}

.toggle-switch input:checked { 
  &:disabled + .slider:before {
    -webkit-transform: translateX(29px);
    -ms-transform: translateX(29px);
    transform: translateX(29px);
  }
}

.toggle-switch.disabled .toggle-switch-label {
  cursor: not-allowed;
}

.form-toggle.inverted .toggle-switch .slider:before {
  background-color: $dark;
}

.form-toggle.inverted .toggle-switch .slider {
  background-color: $gray-dark;
}

.form-toggle.inverted .toggle-switch input:checked + .slider {
  background-color: $gray;
}

.form-toggle.inverted .toggle-switch-label {
  color: $white;
}

.form-toggle.sm .toggle-switch {
  border-radius: 10px;
  width: 20px;
  height: 12px;
}

.form-toggle.sm .toggle-switch .slider:before {
  width: 8px;
  height: 8px;
}

.form-toggle.sm .toggle-switch input:checked + .slider:before {
  -webkit-transform: translateX(8px);
  -ms-transform: translateX(8px);
  transform: translateX(8px);
}

.form-toggle.sm {
  align-items: center;
}

.form-toggle .toggle-label {
  font-size: $font-size-label;
}
