/* Lagos Life checkbox. Owner 5c. Spec: inputs.html#checkbox-radio.
   Replaces the native 16px box with accent-color in leaf (scr/signup-sheet-bottom-light-390).
   Markup: <label class="ll-checkbox ll-checkbox--consent">
             <input class="ll-checkbox__box" type="checkbox" name="terms">
             <span class="ll-checkbox__label">I'm <b>18+</b> and I agree to the …</span>
           </label>
   The whole label is the target (44px or taller). Native input, so Space toggles and forms submit as usual. */

.ll-checkbox {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  min-height: var(--tap-min);
  padding: calc((var(--tap-min) - var(--checkbox-size)) / 2) 0;
  color: var(--ink);
  font: var(--type-body-sm);
  cursor: pointer;
}
.ll-checkbox--consent {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-sheet);
  background-color: var(--mist);
  font: var(--type-label);
  font-weight: var(--weight-medium);
}
.ll-checkbox__label { padding-top: var(--space-0-5); min-width: 0; }

/* Shared box for checkbox and radio */
.ll-checkbox__box,
.ll-radio__box {
  appearance: none;
  -webkit-appearance: none;
  display: inline-grid;
  place-content: center;
  flex: none;
  width: var(--checkbox-size);
  height: var(--checkbox-size);
  margin: 0;
  border-radius: var(--checkbox-radius);
  background-color: var(--paper);
  color: var(--paper);
  box-shadow: inset 0 0 0 2px var(--border-control);
  cursor: pointer;
  transition: background-color var(--duration-state) var(--ease-standard), box-shadow var(--duration-state) var(--ease-standard);
}
.ll-checkbox__box::before {
  content: "";
  width: var(--space-1-5);
  height: var(--space-2-5);
  margin-top: calc(var(--space-0-5) * -1);
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) scale(0);
  transition: transform var(--duration-pop) var(--ease-spring);
}
.ll-checkbox__box:checked { background-color: var(--leaf-deep); box-shadow: none; }
.ll-checkbox__box:checked::before { transform: rotate(45deg) scale(1); }

/* Focus: the system ring, plus the box's own edge. */
.ll-checkbox__box:focus-visible,
.ll-radio__box:focus-visible,
.ll-checkbox__box[data-demo-state="focus"],
.ll-radio__box[data-demo-state="focus"] {
  outline: var(--focus-width) solid var(--ring);
  outline-offset: var(--focus-offset);
  box-shadow: 0 0 0 var(--focus-offset) var(--focus-halo), inset 0 0 0 2px var(--border-control);
}
.ll-checkbox__box:checked:focus-visible,
.ll-checkbox__box:checked[data-demo-state="focus"] { box-shadow: 0 0 0 var(--focus-offset) var(--focus-halo); }

/* Error */
.ll-checkbox__box[aria-invalid="true"],
.ll-radio__box[aria-invalid="true"] { box-shadow: inset 0 0 0 2px var(--rose-deep); }

/* Inactive */
.ll-checkbox__box:disabled,
.ll-radio__box:disabled { background-color: var(--mist); box-shadow: inset 0 0 0 2px var(--ink-inactive); cursor: not-allowed; }
.ll-checkbox__box:disabled:checked { background-color: var(--ink-inactive); box-shadow: none; }
.ll-checkbox:has(:disabled), .ll-radio:has(:disabled) { color: var(--ink-inactive); cursor: not-allowed; }

@media (prefers-reduced-motion: reduce) {
  .ll-checkbox__box, .ll-checkbox__box::before, .ll-radio__box, .ll-radio__box::before { transition: none; }
}

/* Links on the mist consent card: lagoon-deep on mist is 4.47:1 in Light, so they use ink and keep the underline. */
.ll-checkbox--consent .ll-text-button--inline { color: var(--ink); }
