/* Waitlist block (wl-): the full page form and the compact card. Tokens only; phone breakpoint 720. */
.wl { padding-block: var(--section); }
.wl[data-variant="card"] { padding-block: clamp(32px, 5vw, 64px); }
.wl-hint { margin: 0; font-size: 14px; color: var(--muted); }
.wl-opt-tag { font-weight: 400; font-size: 13px; }

/* ---- layout: words on the left, the sign-up sheet on the right; the card is one narrow sheet ----------------------------- */
.wl-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); column-gap: clamp(24px, 4vw, 72px); align-items: start; }
.wl-grid > * { min-width: 0; }
.wl-head { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.wl-h { font-size: var(--t-h2); line-height: 1.1; text-wrap: balance; }
.wl-lead { color: var(--muted); font-size: var(--t-lead); max-width: 40ch; }
.wl[data-variant="page"] .wl-grid > :first-child { position: sticky; top: calc(var(--header-h) + 24px); }
.wl[data-variant="card"] .wl-grid { grid-template-columns: minmax(0, 1fr); row-gap: 20px; max-width: 760px; margin-inline: auto; }
.wl[data-variant="card"] .wl-h { font-size: var(--t-h3); }
.wl[data-variant="card"] .wl-lead { font-size: 16px; }

.wl-sheet { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: clamp(20px, 3vw, 36px); min-width: 0; }
.wl[data-variant="card"] .wl-sheet { padding: clamp(18px, 3vw, 28px); }

/* ---- the form ------------------------------------------------------------------------------------------------------------ */
.wl-form { display: grid; gap: 22px; position: relative; }
.wl-form.wl-leave { animation: k-out .18s var(--ease) forwards; }
.wl-who { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.wl-f-phone { grid-column: 1; }
.wl[data-variant="card"] .wl-who { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.wl[data-variant="card"] .wl-f-phone { grid-column: auto; }
.wl-who .k-err:not(:empty), .wl-picks > .k-err:not(:empty) { animation: k-fade var(--d) ease; }

/* what to hear about: grouped ruled blocks of tick rows */
.wl-picks { display: grid; gap: 18px; min-width: 0; }
.wl-picks-head { display: grid; gap: 2px; }
.wl-picks-h { margin: 0; font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }
.wl-picks-help { margin: 0; font-size: 14px; color: var(--muted); }
.wl-pick { margin: 0; padding: 0; border: 0; min-width: 0; display: grid; gap: 10px; }
.wl-pick legend { padding: 0; margin-bottom: 10px; font-size: 14px; font-weight: 600; color: var(--muted); }
.wl-opts { display: grid; grid-template-columns: repeat(auto-fill, minmax(224px, 1fr)); gap: 8px; }

/* one option: the whole label is the target, the real checkbox lies invisibly over it so it stays focusable and operable */
.wl-opt { position: relative; display: grid; grid-template-columns: 22px minmax(0, 1fr); align-items: center; column-gap: 12px; min-height: 52px; padding: 8px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); cursor: pointer; transition: background-color var(--d-fast) ease, border-color var(--d-fast) ease; }
.wl-box { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.wl-tick { width: 22px; height: 22px; border: 1.5px solid var(--field); border-radius: 7px; background: var(--surface); display: grid; place-items: center; color: var(--on-brand); transition: background-color var(--d-fast) ease, border-color var(--d-fast) ease; }
.wl-tick path { stroke-dasharray: 24; stroke-dashoffset: 24; transition: stroke-dashoffset .22s var(--ease); }
.wl-name { font-size: 16px; font-weight: 500; line-height: 1.3; min-width: 0; overflow-wrap: anywhere; }
.wl-opt:has(.wl-box:checked) { border-color: var(--brand); background: var(--brand-soft); }
.wl-opt:has(.wl-box:checked) .wl-tick { background: var(--brand); border-color: var(--brand); }
.wl-opt:has(.wl-box:checked) .wl-tick path { stroke-dashoffset: 0; }
.wl-opt:has(.wl-box:checked) .wl-name { font-weight: 600; }
.wl-opt:has(.wl-box:focus-visible) { box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 32%, transparent); border-color: var(--brand); }
.wl-picks[aria-invalid="true"] .wl-opt:not(:has(.wl-box:checked)) { border-color: var(--danger); }

/* the card keeps the same markup as chips: shorter, the tick appears only when chosen */
.wl[data-variant="card"] .wl-opts { display: flex; flex-wrap: wrap; gap: 8px; }
.wl[data-variant="card"] .wl-opt { display: inline-flex; min-height: 44px; padding: 0 14px; border-color: var(--field); gap: 0; }
.wl[data-variant="card"] .wl-tick { width: 0; height: 18px; border: 0; background: transparent; overflow: hidden; margin-right: 0; transition: width var(--d) var(--ease), margin-right var(--d) var(--ease); }
.wl[data-variant="card"] .wl-tick svg { flex: none; }
.wl[data-variant="card"] .wl-opt:has(.wl-box:checked) { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.wl[data-variant="card"] .wl-opt:has(.wl-box:checked) .wl-tick { width: 18px; margin-right: 8px; background: transparent; }
.wl[data-variant="card"] .wl-name { font-size: 15px; font-weight: 600; }
.wl[data-variant="card"] .wl-pick legend { margin-bottom: 8px; }

/* privacy: plain words next to the button, never hidden in a footer */
.wl-privacy { margin: 0; font-size: 14px; line-height: 1.5; color: var(--muted); max-width: 62ch; }
.wl-privacy a { color: inherit; text-decoration-color: color-mix(in srgb, var(--ink) 35%, transparent); }

.wl-actions { display: grid; }
.wl .wl-send { display: grid; place-items: center; }
.wl .wl-send > span { grid-area: 1 / 1; display: inline-flex; align-items: center; gap: 10px; }
.wl .wl-t-busy { visibility: hidden; }
.wl[data-state="busy"] .wl-send { cursor: progress; }
.wl[data-state="busy"] .wl-t-idle { visibility: hidden; }
.wl[data-state="busy"] .wl-t-busy { visibility: visible; }

/* the honeypot: out of sight and out of the tab order, present for anything that fills every field */
.wl-hp { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }

/* error: the form and what was typed stay; an alert with a retry sits above the button */
.wl-status { display: grid; }
.wl:not([data-state="error"]) .wl-status { margin-top: -22px; } /* the live region stays in the page but takes no room */
.wl-fail { display: none; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.wl[data-state="error"] .wl-fail { display: flex; animation: k-fade var(--d) ease; }
.wl-fail-msg { flex: 1 1 200px; }

/* ---- on the list: the authored moment ------------------------------------------------------------------------------------ */
/* the seal springs (base k-mark celebrate), then each ticked name is written onto the list in turn and its tick draws itself */
.wl-done { display: none; align-items: flex-start; gap: 24px; min-width: 0; }
.wl[data-state="sent"] .wl-form { display: none; }
.wl[data-state="sent"] .wl-done { display: flex; }
.wl-done .k-mark { flex: none; margin: 10px; }
.wl-done-body { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; min-width: 0; flex: 1; }
.wl-done-t { font-size: 24px; line-height: 1.15; font-weight: 700; letter-spacing: -0.01em; outline: none; }
.wl-done-p { color: var(--muted); max-width: 46ch; }
.wl-done-p strong { color: var(--ink); font-weight: 600; overflow-wrap: anywhere; }
.wl-done-list { list-style: none; margin: 4px 0 8px; padding: 0; display: grid; gap: 0; width: 100%; max-width: 46ch; }
.wl-done-list li { display: grid; grid-template-columns: 18px minmax(0, 1fr); column-gap: 12px; align-items: center; min-height: 44px; border-top: 1px solid var(--line); font-weight: 600; color: var(--ink); animation: wl-write .5s calc(.55s + var(--i) * .09s) var(--ease) backwards; }
.wl-done-list li:last-child { border-bottom: 1px solid var(--line); }
.wl-done-list li span { overflow-wrap: anywhere; }
.wl-done-list svg { color: var(--brand); }
.wl-done-list path { stroke-dasharray: 24; animation: wl-draw .4s calc(.7s + var(--i) * .09s) var(--ease) backwards; }
.wl-done .wl-again { margin-top: 6px; }
@keyframes wl-write { from { opacity: 0; transform: translateX(-10px); } }
@keyframes wl-draw { from { stroke-dashoffset: 24; } }

@media (hover: hover) and (pointer: fine) {
  .wl-opt:hover { border-color: var(--brand); }
  .wl-privacy a:hover { color: var(--brand); }
}

@media (max-width: 720px) {
  .wl-grid { grid-template-columns: minmax(0, 1fr); row-gap: 20px; }
  .wl[data-variant="page"] .wl-grid > :first-child { position: static; }
  .wl-who, .wl[data-variant="card"] .wl-who { grid-template-columns: minmax(0, 1fr); }
  .wl-f-phone { grid-column: auto; }
  .wl-opts { grid-template-columns: minmax(0, 1fr); }
  .wl[data-variant="card"] .wl-opts { display: flex; }
  .wl-done { flex-direction: column; gap: 8px; }
  /* the primary action stays in reach at the foot of the viewport while the form scrolls */
  .wl[data-variant="page"] .wl-actions { position: sticky; bottom: 0; z-index: 2; margin: 0 calc(-1 * clamp(20px, 3vw, 36px)); padding: 12px clamp(20px, 3vw, 36px) calc(12px + env(safe-area-inset-bottom)); background: var(--surface); box-shadow: 0 -1px 0 var(--line); border-radius: 0 0 var(--radius) var(--radius); }
}

@media (prefers-reduced-motion: reduce) {
  .wl-form.wl-leave { animation: none; }
  .wl-done-list li { animation: k-fade .3s ease backwards; }
  .wl-done-list path { animation: none; }
  .wl-tick path, .wl-opt, .wl-tick { transition: none; }
}
