/*
 * register.css — funnel-specific styling for the pikel.app tournament registration
 * flow (/register, /checkout). Layered ON TOP of /lib/auth.css, which provides the
 * shared design tokens + base components (card, btn, field, seg, banner, msg, chip,
 * pay, rrow, empty, spinner, rise). This file adds ONLY the registration-specific
 * pieces: the step rail, selectable division/plan/partner cards, the sticky fee
 * summary, the waiver box, and the confirmation states. Same Apple-grade glass
 * aesthetic, light + dark via the inherited tokens, full reduced-motion support.
 */

/* Wider stage for the funnel; keeps the auth card max-width for narrow steps */
.stage.funnel { max-width: 480px; }

/* ---- Step rail (progress) ---------------------------------------------------- */
/* The rail now carries numeric/label context (WCAG/UX: not dot-only) — a caption
   row above the bars naming "Step N of M" + the current step label. */
.steprail { margin: 2px 0 20px; }
.steprail .steptxt { display: flex; align-items: baseline; justify-content: space-between;
  gap: 10px; margin-bottom: 8px; }
.steprail .stepcount { font-size: 11.5px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--ink-faint); }
.steprail .stepname { font-size: 12.5px; font-weight: 600; color: var(--ink-dim);
  letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.steps { display: flex; align-items: center; gap: 8px; }
.steps .step { flex: 1; height: 4px; border-radius: 999px; background: var(--hair); overflow: hidden; }
.steps .step.done { background: var(--accent); }
.steps .step.now { background: linear-gradient(90deg, var(--accent) 55%, var(--hair) 55%); }
.steplabel { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-faint); margin-bottom: 6px; }

/* ---- Event header (compact comp identity at the top of the funnel) ----------- */
.evhead { display: flex; gap: 13px; align-items: center; margin-bottom: 6px; }
.evhead .evthumb { flex: 0 0 auto; width: 52px; height: 52px; border-radius: 13px; object-fit: cover;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 22%, var(--bg2)), var(--bg2));
  border: 1px solid var(--card-brd); }
.evhead .evname { font-size: 17px; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; }
.evhead .evmeta { font-size: 13px; color: var(--ink-dim); margin-top: 2px; }

/* ---- Selectable cards (divisions, payment plans) ----------------------------- */
.pick { display: flex; flex-direction: column; gap: 10px; }
.pickcard { display: flex; align-items: center; gap: 13px; width: 100%; text-align: left;
  padding: 15px 16px; border-radius: 16px; cursor: pointer; font: inherit; color: var(--ink);
  background: color-mix(in srgb, var(--card) 60%, transparent);
  border: 1px solid var(--field-brd); transition: border-color .15s, background .15s, transform .15s; }
.pickcard:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--field-brd)); transform: translateY(-1px); }
.pickcard[aria-pressed="true"], .pickcard.selected {
  border-color: var(--accent); background: color-mix(in srgb, var(--accent) 13%, transparent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.pickcard[disabled] { opacity: .5; cursor: default; transform: none; }
.pickcard .pkmain { min-width: 0; flex: 1; }
.pickcard .pktitle { font-size: 15.5px; font-weight: 700; letter-spacing: -.01em; }
.pickcard .pksub { font-size: 13px; color: var(--ink-dim); margin-top: 3px; line-height: 1.4; }
.pickcard .pkright { flex: 0 0 auto; text-align: right; font-size: 13px; font-weight: 700; }
.pickcard .pkright .spots { color: var(--teal-text); }
.pickcard .pkright .spots.full { color: var(--ink-faint); }
.pickcard .pkright .price { font-size: 16px; color: var(--ink); }
/* radio dot on the left of plan cards */
.pickcard .radio { flex: 0 0 auto; width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid var(--field-brd); position: relative; transition: border-color .15s; }
.pickcard[aria-pressed="true"] .radio { border-color: var(--accent); }
.pickcard[aria-pressed="true"] .radio::after { content: ""; position: absolute; inset: 3px;
  border-radius: 50%; background: var(--accent); }

/* small inline format/entry badges on a division card */
.tagrow { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 7px; }
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600; border: 1px solid var(--card-brd); color: var(--ink-dim); }
.tag.entry { color: var(--accent-2); background: color-mix(in srgb, var(--accent) 12%, transparent);
  border-color: color-mix(in srgb, var(--accent) 24%, transparent); }

/* ---- Partner picker ---------------------------------------------------------- */
.presults { display: flex; flex-direction: column; gap: 8px; max-height: 320px; overflow-y: auto; margin-top: 4px; }
.presult { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 11px 13px;
  border-radius: 13px; cursor: pointer; font: inherit; color: var(--ink);
  background: color-mix(in srgb, var(--card) 55%, transparent); border: 1px solid var(--hair);
  transition: border-color .15s, transform .15s; }
.presult:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--hair)); transform: translateY(-1px); }
.presult[disabled] { opacity: .5; cursor: default; }
.presult .pav { flex: 0 0 auto; width: 38px; height: 38px; border-radius: 50%; object-fit: cover;
  background: linear-gradient(135deg, var(--accent), var(--teal)); color: #fff; font-weight: 700; font-size: 14px;
  display: flex; align-items: center; justify-content: center; border: 1px solid var(--card-brd); }
.presult .pinfo { min-width: 0; flex: 1; }
.presult .pdn { font-size: 14.5px; font-weight: 600; letter-spacing: -.01em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.presult .pir { font-size: 12.5px; color: var(--ink-dim); margin-top: 1px; }
.presult .pir.bad { color: var(--amber-text); }
/* selected partner pill */
.partner-pill { display: flex; align-items: center; gap: 11px; padding: 12px 14px; border-radius: 14px;
  background: color-mix(in srgb, var(--teal) 12%, transparent); border: 1px solid color-mix(in srgb, var(--teal) 26%, transparent); }
.partner-pill .pav { width: 36px; height: 36px; }
.partner-pill .x { margin-left: auto; background: none; border: 0; color: var(--ink-dim); font: inherit;
  font-size: 13px; font-weight: 600; cursor: pointer; padding: 4px 8px; border-radius: 8px; }
.partner-pill .x:hover { color: var(--ink); background: var(--hair); }

/* ---- Waiver box -------------------------------------------------------------- */
.waiver { max-height: 220px; overflow-y: auto; padding: 15px 16px; border-radius: 14px;
  background: var(--field); border: 1px solid var(--field-brd); font-size: 13.5px; color: var(--ink-dim);
  line-height: 1.55; white-space: pre-wrap; }
.checkrow { display: flex; align-items: flex-start; gap: 11px; margin-top: 14px; cursor: pointer; }
.checkrow input { flex: 0 0 auto; width: 20px; height: 20px; margin-top: 1px; accent-color: var(--accent); }
.checkrow label { font-size: 14px; color: var(--ink); line-height: 1.45; }

/* ---- Fee summary (sticky footer within the card flow) ------------------------ */
.feesum { display: flex; flex-direction: column; gap: 8px; margin-top: 18px; padding: 15px 16px;
  border-radius: 16px; border: 1px solid var(--card-brd); background: color-mix(in srgb, var(--card) 60%, transparent); }
.feeline { display: flex; justify-content: space-between; align-items: baseline; font-size: 14px; color: var(--ink-dim); }
.feeline .fv { color: var(--ink); font-weight: 600; }
.feeline.total { padding-top: 9px; margin-top: 2px; border-top: 1px solid var(--hair); font-size: 16px; color: var(--ink); }
.feeline.total .fv { font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
/* WCAG 1.4.3: fee/explanatory body copy reads as real content (e.g. the success-peak
   "Run & play your event" line), so it uses --ink-dim (passes AA), not --ink-faint. */
.feenote { font-size: 12.5px; color: var(--ink-dim); line-height: 1.45; margin-top: 2px; }

/* ---- Action row -------------------------------------------------------------- */
.actions { display: flex; gap: 10px; margin-top: 20px; }
.actions .btn { flex: 1; }
.btn.back { background: var(--field); color: var(--ink); border: 1px solid var(--field-brd); box-shadow: none; flex: 0 0 auto; width: auto; padding: 14px 18px; }
.btn.back:hover { border-color: var(--accent); filter: none; }

/* ---- Confirmation / result states ------------------------------------------- */
.result { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 12px 6px 6px; }
.result .glyph { width: 64px; height: 64px; border-radius: 20px; display: flex; align-items: center; justify-content: center;
  font-size: 30px; margin-bottom: 16px; }
.result .glyph.ok { background: color-mix(in srgb, var(--teal) 16%, transparent); color: var(--teal-text); }
.result .glyph.wait { background: color-mix(in srgb, var(--amber) 16%, transparent); color: var(--amber-text); }
.result .glyph.no { background: color-mix(in srgb, var(--red) 14%, transparent); color: var(--red); }
.result h1 { font-size: clamp(22px, 6vw, 28px); }
.result p { margin-top: 10px; color: var(--ink-dim); font-size: 15px; max-width: 340px; line-height: 1.5; }
.result .actions { width: 100%; margin-top: 22px; }
/* Off-platform "pay the organizer $X" callout on the registration confirmation.
   Amber-tinted content box (not a dimmed .feenote) — the fee owed is read-critical,
   so it gets real contrast + an accent border, AA-compliant via --amber-text. */
.result .payowed { width: 100%; margin-top: 16px; padding: 11px 14px; border-radius: 12px;
  background: color-mix(in srgb, var(--amber) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--amber) 30%, transparent);
  color: var(--amber-text); font-size: 13.5px; line-height: 1.45; max-width: 340px; }

/* ---- Stripe Express Checkout (wallet-first) + Payment Element hosts ----------- */
/* Apple Pay / Google Pay one-tap buttons, pulled to the top above the card window.
   Both host + the "Or pay another way" divider stay hidden until a wallet is
   available for this device (checkout.js toggles [hidden]). */
#express-checkout { margin-top: 6px; }
#payment-element { margin-top: 6px; min-height: 200px; }
.pay-amt { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 4px 0 18px;
  padding: 15px 16px; border-radius: 16px; border: 1px solid var(--card-brd);
  background: color-mix(in srgb, var(--card) 60%, transparent); }
.pay-amt .lab { font-size: 14px; color: var(--ink-dim); }
.pay-amt .amt { font-size: 24px; font-weight: 800; letter-spacing: -.025em; }
/* WCAG 1.4.3: the "Secured by Stripe · card never stored" trust line is read-critical
   reassurance at the pay moment — --ink-dim (passes AA both themes), not --ink-faint. */
.securednote { display: flex; align-items: center; justify-content: center; gap: 7px; margin-top: 14px;
  font-size: 12.5px; color: var(--ink-dim); }
.securednote svg { width: 14px; height: 14px; opacity: .8; }

/* small helper text under a heading */
.hint { font-size: 13.5px; color: var(--ink-dim); margin-top: 6px; line-height: 1.45; }
.searchwrap { position: relative; margin-top: 14px; }

/* Invite-by-email CTA + inline error in the partner step */
.invitecta { display: block; width: 100%; margin-top: 10px; padding: 11px 13px; border-radius: 12px;
  border: 1px dashed color-mix(in srgb, var(--accent) 45%, var(--field-brd)); background: transparent;
  color: var(--accent-2, var(--accent)); font: inherit; font-size: 13.5px; font-weight: 600;
  cursor: pointer; text-align: center; transition: border-color .15s, background .15s; }
.invitecta:hover { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.empty.bad { color: var(--amber-text, #d9534f); }

/* Partner-step segmented control reuses the shared auth.css `.seg` rules (no local
   `.seg`/`.segbtn` override — a duplicate collided with auth.css). Only the solo note
   below is register-specific. (founder 2026-06-16) */
/* Honest note shown in the solo ("Register without a partner") segment. */
.solonote { padding: 13px 15px; border-radius: 12px; background: color-mix(in srgb, var(--accent) 7%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--field-brd));
  color: var(--ink-dim); font-size: 13.5px; line-height: 1.5; }

/* ---- Keyboard focus rings (WCAG 2.4.7) --------------------------------------
   The custom selection/interaction controls in the register + checkout funnels
   are <button>/<input> without the auth.css base focus rule, so they had NO
   visible focus indicator. Token-based ring (same --accent-2 outline + offset as
   auth.css's a/.btn/.input rule) on every custom control: division/plan/partner
   pickcards, partner results, the invite CTA, the waiver checkbox, the checkout
   summary inputs, the promo field, and every [data-*] control. */
.pickcard:focus-visible,
.presult:focus-visible,
.invitecta:focus-visible,
.checkrow input:focus-visible,
.checkrow:focus-within,
.promo-input:focus-visible,
.promo-apply:focus-visible,
.dupr-info:focus-visible,
[data-div]:focus-visible,
[data-plan]:focus-visible,
[data-promo]:focus-visible,
[data-action]:focus-visible {
  outline: 3px solid var(--accent-2); outline-offset: 2px; border-radius: 14px;
}
/* The waiver checkbox is small; tighten its ring radius so it hugs the box. */
.checkrow input:focus-visible { outline-offset: 3px; border-radius: 6px; }

/* ---- DUPR jargon gloss (decision-moment tooltip) ----------------------------
   A plain-language one-liner the first time DUPR appears in the register funnel,
   so a beginner isn't asked to decide against an unexplained acronym. Rendered as
   an inline info affordance with an accessible expanded gloss (details/summary —
   no JS, keyboard-operable, announced by AT). */
.dupr-gloss { margin-top: 10px; border: 1px solid var(--card-brd); border-radius: 12px;
  background: color-mix(in srgb, var(--accent) 8%, transparent); overflow: hidden; }
.dupr-gloss > summary { list-style: none; cursor: pointer; display: flex; align-items: center;
  gap: 8px; padding: 10px 13px; font-size: 13px; font-weight: 600; color: var(--ink-dim); }
.dupr-gloss > summary::-webkit-details-marker { display: none; }
.dupr-gloss .dupr-info { flex: 0 0 auto; width: 18px; height: 18px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center; font-size: 12px;
  font-weight: 800; color: var(--accent-2); border: 1.5px solid color-mix(in srgb, var(--accent) 50%, transparent); }
.dupr-gloss .dupr-chev { margin-left: auto; color: var(--ink-faint); transition: transform .15s; }
.dupr-gloss[open] .dupr-chev { transform: rotate(180deg); }
.dupr-gloss .dupr-body { padding: 0 13px 12px 39px; font-size: 12.5px; color: var(--ink-dim); line-height: 1.5; }

/* ---- Checkout order summary (three-group breakdown) -------------------------
   Replaces the bare pay-amt row. Three Miller-chunked groups: context, what you
   pay (entry + service-fee line when player-pays), and trust (paid-to + refund).
   Reuses the .feesum / .feeline tokens but adds the emphasized single Total and
   the trust block. The Total is the ONE Von-Restorff anchor — shown exactly once. */
.cosum { margin: 4px 0 16px; display: flex; flex-direction: column; gap: 12px; }
.cosum .co-context { font-size: 13px; color: var(--ink-dim); line-height: 1.45; }
.cosum .co-group { padding: 15px 16px; border-radius: 16px; border: 1px solid var(--card-brd);
  background: color-mix(in srgb, var(--card) 60%, transparent); }
.cosum .co-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline;
  gap: 0 12px; font-size: 14px; color: var(--ink-dim); }
.cosum .co-row + .co-row { margin-top: 9px; }
.cosum .co-row .cv { color: var(--ink); font-weight: 600; }
.cosum .co-row.muted { color: var(--ink-faint); }
/* caption drops to its own line beneath the entry+amount baseline row.
   WCAG 1.4.3: this is the M4 fee-rationale sentence low-numeracy payers must READ,
   so it uses --ink-dim (light #6e6e73 ≈ 4.6:1, dark #a1a1a6 ≈ 6:1 — both pass AA),
   never --ink-faint (~2.6:1 light / ~3.0:1 dark, sub-AA). */
.cosum .co-feecap { flex-basis: 100%; font-size: 12px; color: var(--ink-dim);
  margin-top: 3px; line-height: 1.45; }
.cosum .co-discount .cv { color: var(--teal-text); }
.cosum .co-total { display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  padding-top: 12px; margin-top: 12px; border-top: 1px solid var(--hair); }
.cosum .co-total .tl { font-size: 16px; font-weight: 700; color: var(--ink); letter-spacing: -.01em; }
.cosum .co-total .tv { font-size: 26px; font-weight: 800; letter-spacing: -.03em; color: var(--ink);
  /* never clip a long currency string (e.g. JPY) at large type */
  max-width: 62%; text-align: right; overflow-wrap: anywhere; }
/* WCAG 1.4.3: the trust block (paid-to + refund line) is load-bearing money copy at
   the highest-anxiety moment, so the whole container is --ink-dim (passes AA both
   themes), not --ink-faint. co-paidto was already --ink-dim; co-refund now inherits it. */
.cosum .co-trust { font-size: 12.5px; color: var(--ink-dim); line-height: 1.5; }
.cosum .co-trust .co-paidto { color: var(--ink-dim); font-weight: 600; }
.cosum .co-trust svg { width: 13px; height: 13px; vertical-align: -2px; margin-right: 5px; opacity: .85; }
.cosum .co-trust .co-refund { display: block; margin-top: 5px; }

/* ---- Promo code field (apply at checkout) ----------------------------------- */
.promo { margin: 0 0 16px; }
.promo-toggle { background: none; border: 0; color: var(--accent-2); font: inherit; font-size: 13.5px;
  font-weight: 600; cursor: pointer; padding: 4px 0; }
.promo-toggle:hover { text-decoration: underline; }
.promo-row { display: flex; gap: 8px; margin-top: 10px; }
.promo-input { flex: 1; appearance: none; padding: 12px 13px; border-radius: 12px;
  background: var(--field); border: 1px solid var(--field-brd); color: var(--ink); font: inherit;
  font-size: 15px; letter-spacing: .04em; text-transform: uppercase; transition: border-color .15s, box-shadow .15s; }
.promo-input::placeholder { color: var(--ink-faint); text-transform: none; letter-spacing: 0; }
.promo-input:focus { outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 24%, transparent); }
.promo-apply { flex: 0 0 auto; padding: 12px 18px; border-radius: 12px; border: 1px solid var(--field-brd);
  background: var(--field); color: var(--ink); font: inherit; font-weight: 600; font-size: 14px;
  cursor: pointer; transition: border-color .15s, filter .15s; }
.promo-apply:hover { border-color: var(--accent); }
.promo-apply[disabled] { opacity: .55; cursor: default; }
.promo-msg { margin-top: 9px; font-size: 13px; line-height: 1.45; display: none; }
.promo-msg.show { display: block; }
.promo-msg.ok { color: var(--teal-text); }
.promo-msg.bad { color: var(--amber-text); }
/* applied state: a removable pill + the free badge */
.promo-applied { display: flex; align-items: center; gap: 9px; margin-top: 10px; padding: 10px 13px;
  border-radius: 12px; background: color-mix(in srgb, var(--teal) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--teal) 26%, transparent); }
.promo-applied .pa-code { font-size: 13.5px; font-weight: 700; color: var(--teal-text); letter-spacing: .04em; }
.promo-applied .pa-sub { font-size: 12.5px; color: var(--ink-dim); }
.promo-applied .pa-x { margin-left: auto; background: none; border: 0; color: var(--ink-dim); font: inherit;
  font-size: 13px; font-weight: 600; cursor: pointer; padding: 4px 8px; border-radius: 8px; }
.promo-applied .pa-x:hover { color: var(--ink); background: var(--hair); }

/* ---- Success "peak" reveal motion ------------------------------------------
   The payment-complete / registered glyph gets a real reveal moment: a spring
   pop + a sweeping ring, not a static ✓. Gated on prefers-reduced-motion below. */
.result .glyph.reveal { animation: glyphPop .5s cubic-bezier(.2,.9,.3,1.3) both; }
.result .glyph.reveal::after { content: ""; position: absolute; inset: -6px; border-radius: 24px;
  border: 2px solid currentColor; opacity: 0; animation: glyphRing .7s ease-out .1s both; }
.result .glyph { position: relative; }
@keyframes glyphPop {
  0% { transform: scale(.4); opacity: 0; }
  60% { transform: scale(1.08); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes glyphRing {
  0% { transform: scale(.7); opacity: .55; }
  100% { transform: scale(1.25); opacity: 0; }
}
.result h1.reveal, .result p.reveal { animation: rise .5s cubic-bezier(.2,.7,.2,1) .12s both; }
.result .actions.reveal { animation: rise .5s cubic-bezier(.2,.7,.2,1) .2s both; }

/* Animate the auto-expanded promo breakdown in (no jarring layout jump). */
.cosum .co-group.swap-in { animation: rise .35s cubic-bezier(.2,.7,.2,1) both; }

@media (prefers-reduced-motion: reduce) {
  .result .glyph.reveal { animation: none; }
  .result .glyph.reveal::after { animation: none; opacity: 0; }
  .result h1.reveal, .result p.reveal, .result .actions.reveal { animation: none; opacity: 1; transform: none; }
  .cosum .co-group.swap-in { animation: none; }
  .dupr-gloss .dupr-chev { transition: none; }
  .promo-apply, .promo-input { transition: none; }
}
