.wrapper {
  position: relative;
  overflow: hidden;

  display: flex;
  align-items: center;
  cursor: pointer;

  width: 39px;
  height: 24px;

  border-radius: 12px;
}

.hidden {
  position: absolute;
  block-size: 1px;
  inline-size: 1px;
  padding: 0;
  margin: -1px;
  white-space: nowrap;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  overflow: hidden;
  border: 0;
  opacity: 0;
}

.wrapper--disabled {
  cursor: default;
  opacity: 0.4;
}

.control::before {
  position: absolute;
  content: '';
  inset: 0;

  background: #efeff4;
}

.control::after {
  position: absolute;
  content: '';

  top: 50%;
  transform: translateY(-50%);

  border-radius: 50%;
}

.wrapper--ios .control::after {
  width: 20.5px;
  height: 20.5px;

  margin-left: 2px;
  box-shadow:
    0 3px 1px 0 rgba(0, 0, 0, 0.06),
    0 3px 8px 0 rgba(0, 0, 0, 0.15),
    0 0 0 1px rgba(0, 0, 0, 0.04);
  background: white;
}

.input:checked + .control::before {
  border-color: #007aff;
  background-color: #007aff;
}

.input:checked + .control::after {
  transform: translateX(14.5px) translateY(-50%);
}

@media (prefers-reduced-motion: no-preference) {
  .control::before {
    transition:
      background-color,
      border-color 67ms linear;
  }

  .control::after {
    /** Value from https://material-web.dev/components/switch/ */
    transition: transform 300ms cubic-bezier(0.175, 0.885, 0.32, 1.275) 0s;
  }

  .wrapper--ios .control::before {
    transition: background-color 0.2s ease;
  }

  .wrapper--ios .control::after {
    transition: transform 0.2s cubic-bezier(0.36, -0.24, 0.26, 1.32);
  }
}
