/* ========== Switch ========== */
/*
 * Toggle built on a native checkbox: 44x24 track, 20px knob.
 *   <input type="checkbox" role="switch" class="exa-switch" aria-label="Analytics cookies">
 * Port of ExaLife Switch.
 */

.exa-switch {
  box-sizing: border-box;
  appearance: none;
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
  width: 44px;
  height: 24px;
  margin: 0;
  border-radius: var(--exa-radius-full);
  background-color: var(--exa-neutral-4);
  cursor: pointer;
  outline: none;
  transition: background-color var(--exa-duration-base) var(--exa-ease-standard);
}

.exa-switch::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: var(--exa-radius-full);
  background-color: var(--exa-white);
  box-shadow: var(--exa-shadow-xs);
  transition: transform var(--exa-duration-base) var(--exa-ease-standard);
}

.exa-switch:checked {
  background-color: var(--exa-color-primary);
}

.exa-switch:checked::before {
  transform: translateX(20px);
}

.exa-switch:focus-visible {
  box-shadow: var(--exa-focus-ring);
}

.exa-switch:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

@media (prefers-reduced-motion: reduce) {
  .exa-switch,
  .exa-switch::before { transition: none; }
}
