/* Presentation only: keep native checkbox state, validation, labels and change handlers. */
html body input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  position: relative;
  display: inline-block;
  box-sizing: border-box;
  width: 52px;
  min-width: 52px;
  max-width: 52px;
  height: 44px;
  min-height: 44px;
  max-height: 44px;
  flex: 0 0 52px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  box-shadow: none;
  vertical-align: middle;
  cursor: pointer;
  accent-color: var(--brand, #6962bb);
  -webkit-tap-highlight-color: transparent;
}

html body input[type="checkbox"]::before {
  content: "";
  position: absolute;
  top: calc(50% - 16px);
  left: 0;
  right: 0;
  height: 32px;
  box-sizing: border-box;
  border: 1px solid #727f90;
  border-radius: 999px;
  background: #8491a2;
  transition: background-color 160ms ease, border-color 160ms ease;
  pointer-events: none;
}

html body input[type="checkbox"]::after {
  content: "";
  position: absolute;
  top: calc(50% - 13px);
  left: 3px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px #26334a40, 0 1px 1px #26334a1a;
  transform: translateX(0);
  transition: transform 160ms ease;
  pointer-events: none;
}

html body input[type="checkbox"]:checked::before,
html body input[type="checkbox"]:indeterminate::before {
  background: var(--brand, #6962bb);
  border-color: var(--brand, #6962bb);
}

html body input[type="checkbox"]:checked::after { transform: translateX(20px); }
html body input[type="checkbox"]:indeterminate::after { transform: translateX(10px); }

html body input[type="checkbox"]:focus-visible {
  outline: 2px solid var(--brand, #6962bb);
  outline-offset: 3px;
}

html body input[type="checkbox"]:disabled { opacity: .58; cursor: not-allowed; }

body :is(.toggle-label, .checkbox-label, .face-consent) { gap: 10px; min-height: 44px; }
body .toggle-label { white-space: normal; }
body :is(.toggle-label, .checkbox-label, .face-consent) > span { min-width: 0; }

@media (hover: hover) {
  html body input[type="checkbox"]:enabled:hover::before { filter: brightness(.96); }
}

@media (prefers-reduced-motion: reduce) {
  html body input[type="checkbox"]::before,
  html body input[type="checkbox"]::after { transition: none; }
}

@media (forced-colors: active) {
  html body input[type="checkbox"] { forced-color-adjust: none; }
  html body input[type="checkbox"]::before { background: Canvas; border: 2px solid ButtonText; }
  html body input[type="checkbox"]::after { background: ButtonText; box-shadow: none; }
  html body input[type="checkbox"]:checked::before,
  html body input[type="checkbox"]:indeterminate::before { background: Highlight; border-color: Highlight; }
  html body input[type="checkbox"]:checked::after,
  html body input[type="checkbox"]:indeterminate::after { background: HighlightText; }
  html body input[type="checkbox"]:focus-visible { outline-color: Highlight; }
  html body input[type="checkbox"]:disabled { opacity: 1; }
  html body input[type="checkbox"]:disabled::before { border-color: GrayText; background: Canvas; }
  html body input[type="checkbox"]:disabled::after { background: GrayText; }
}
