/* ============================================================
 * waitlist-sheet.css
 *
 * Shared styles for the JOIN WAITLIST decision flow:
 *   Sheet 1 — cross-sell bottom sheet ("almost on the waitlist")
 *   Embed panel — inline "pick your list + $4.04 ask" (.wl-embed),
 *     mounted directly in the page under the tapped .wl-cta button
 *     instead of an overlay.
 *
 * Loaded alongside /waitlist-sheet.js on every surface that surfaces
 * a JOIN WAITLIST button — index.html, account.html, event.html.
 * CSS variables (--salmon, --border, --card, --blue, etc.) resolve
 * against the host page's palette; account.html and event.html alias
 * these to their own --green/--green-dark/--card-bg vars in :root so
 * the same rules light up there too.
 *
 * Depends on the @keyframes btn-glitch-flicker keyframe being
 * defined by the host page (index.html, account.html and event.html
 * all already have it). .glitch-flash re-triggers it on every CTA
 * tap; .glitch-flicker (aliased to the same keyframe here) is used
 * for inline validation errors.
 * ============================================================ */

.glitch-flicker { animation: btn-glitch-flicker .4s linear; }

/* ── Sheet 1 — cross-sell bottom sheet ─────────────────────────────
   Backdrop and panel are split into two fixed-positioned siblings so
   the panel's `bottom:0` anchors directly to the viewport bottom —
   flex alignment inside the backdrop turned out unreliable on iOS
   Safari (the panel ended above the URL-bar area, letting page
   content show below it). padding-bottom uses
   env(safe-area-inset-bottom) so the panel still extends through the
   iOS home-indicator gesture area. */
.wl-sheet-dim {
  position:fixed; inset:0; z-index:100;
  background:rgba(0,0,0,.88);
  opacity:0; pointer-events:none;
  transition:opacity .22s ease-out;
}
.wl-sheet-dim.shown { opacity:1; pointer-events:auto; }
.wl-sheet-panel {
  position:fixed; left:0; right:0; bottom:0; z-index:101;
  width:100%; max-width:640px;
  margin:0 auto;
  background:var(--bg);
  border:1px solid var(--salmon-dim); border-bottom:0;
  border-radius:10px 10px 0 0;
  box-shadow:0 -8px 30px rgba(0,0,0,.55);
  transform:translateY(110%);
  transition:transform .26s cubic-bezier(.2,.7,.2,1);
  padding:.4rem 1.2rem max(1.2rem, env(safe-area-inset-bottom)) 1.2rem;
  font-family:inherit;
  pointer-events:none;
}
.wl-sheet-panel.shown { transform:translateY(0); pointer-events:auto; }
.wl-sheet-handle {
  width:2.6rem; height:3px; background:var(--salmon-dim);
  border-radius:2px; margin:.5rem auto 1.1rem; opacity:.55;
}
.wl-sheet-header {
  font-size:clamp(.95rem,2.7vw,1.05rem); color:var(--text);
  margin-bottom:.25rem; letter-spacing:.01em;
}
.wl-sheet-header .arrow { color:var(--salmon); margin-right:.35rem; }
.wl-sheet-meta {
  font-size:.78rem; color:var(--text-dim); letter-spacing:.03em;
  margin-bottom:1rem; line-height:1.5;
}
.wl-sheet-sep {
  border:none; border-top:1px solid var(--border);
  margin:0 0 1rem;
}
.wl-sheet-headline {
  font-size:clamp(.95rem,2.7vw,1.05rem); color:var(--text);
  font-weight:500; margin-bottom:.35rem; line-height:1.4;
}
.wl-sheet-sub {
  font-size:.78rem; color:var(--text-dim); margin-bottom:1.2rem;
  letter-spacing:.02em; line-height:1.55;
}
.wl-sheet-sub strong { color:var(--salmon); font-weight:600; }
.wl-sheet-cta {
  display:flex; align-items:center; gap:.8rem;
  width:100%; padding:.85rem 1rem; margin-bottom:.6rem;
  font-family:inherit; text-align:left; cursor:pointer;
  border-radius:6px;
  transition:opacity .15s, border-color .15s, color .15s;
}
.wl-sheet-cta-primary {
  background:var(--salmon); color:var(--bg);
  border:1px solid var(--salmon);
}
.wl-sheet-cta-primary:hover { opacity:.88; }
.wl-sheet-cta-secondary {
  background:transparent; color:var(--text);
  border:1px solid var(--border);
}
.wl-sheet-cta-secondary:hover { border-color:var(--salmon); color:var(--salmon); }
.wl-sheet-cta .body { flex:1; min-width:0; }
.wl-sheet-cta .main {
  display:block; font-size:clamp(.92rem,2.7vw,1rem);
  letter-spacing:.04em; font-weight:600;
}
.wl-sheet-cta-secondary .main { font-weight:500; }
.wl-sheet-cta .sub {
  display:block; font-size:.72rem; opacity:.72; margin-top:.18rem;
  letter-spacing:.04em; font-weight:400;
}
.wl-sheet-cta .arrow { font-size:1.15rem; flex:0 0 auto; }
.wl-sheet-cta-secondary .arrow { color:var(--text-dim); }
.wl-sheet-footer {
  text-align:center; font-size:.7rem; color:var(--text-dim);
  margin-top:1rem; letter-spacing:.04em;
}

/* ── Embed panel — pick your list + $4.04 ask ──────────────────────
   Mounted inline right after the tapped .wl-cta button (see
   openDepositEmbed in waitlist-sheet.js) — an accordion, not an
   overlay. The 0fr→1fr grid-row trick animates to the content's true
   height (card fields, errors, whatever's showing) instead of a
   guessed max-height, which would either clip a tall state or make
   the reveal look like an instant snap for a short one. .wl-embed-inner
   supplies the min-height:0 escape hatch grid items need for the row
   to actually collapse to 0. */
.wl-embed {
  display:grid;
  grid-template-rows: 0fr;
  margin:.8rem 0 .5rem;
  border:1px solid var(--border);
  border-radius:6px;
  background:var(--card);
  opacity:0;
  transition:grid-template-rows .35s ease, opacity .3s ease;
  /* Reset — insertAdjacentElement('afterend') mounts this as a sibling of
     whatever .wl-cta button was tapped, so it inherits that button's own
     wrapper alignment (e.g. event.html's per-tier waitlist button sits in
     a text-align:right div). Never let host-page text-align leak in. */
  text-align:left;
}
.wl-embed.shown { grid-template-rows: 1fr; opacity:1; }
.wl-embed-inner {
  overflow:hidden;
  min-height:0;
  padding:1rem 1.1rem 1.2rem;
}
.wl-embed-meta {
  font-size:.76rem; color:var(--text-dim); letter-spacing:.03em;
  margin-bottom:.9rem; line-height:1.5;
}
.wl-embed-label {
  font-size:.72rem; color:var(--text-dim); letter-spacing:.06em;
  margin:1rem 0 .5rem;
}
.wl-embed-label:first-child { margin-top:0; }

/* Selectable list-choice cards — mutually exclusive, [ ]/[x] glyph
   toggled by JS. Selected state gets the neon border + glow used on
   every other primary CTA in the terminal aesthetic. */
.wl-embed-option {
  border:1px solid var(--border); border-radius:5px;
  padding:.8rem .9rem; margin-bottom:.6rem;
  cursor:pointer;
  transition:border-color .15s, box-shadow .15s;
}
.wl-embed-option:hover { border-color:var(--salmon-dim); }
.wl-embed-option.selected {
  border-color:var(--salmon);
  box-shadow:0 0 10px var(--salmon-glow);
}
.wl-embed-option-row { display:flex; align-items:baseline; gap:.5rem; }
.wl-embed-check {
  font-size:.85rem; color:var(--salmon); flex:0 0 auto;
  line-height:1.4; user-select:none;
}
.wl-embed-option-label {
  font-size:.9rem; letter-spacing:.03em; font-weight:600; color:var(--text);
  white-space:nowrap;
}
.wl-embed-leader {
  flex:1 1 auto; min-width:.75rem;
  border-bottom:1px dotted var(--border);
  transform:translateY(-.4em);
  margin:0 .15rem;
}
.wl-embed-option-price {
  font-size:.95rem; font-weight:600; letter-spacing:.03em;
  color:var(--salmon); flex:0 0 auto;
}
.wl-embed-option-desc {
  font-size:.72rem; color:var(--text-dim); line-height:1.6;
  margin:.4rem 0 0 1.5rem;
}

/* Party-size stepper — square mono buttons matching the qty selectors
   used elsewhere on the terminal (tickets.html etc). */
.wl-embed-seats-row {
  display:flex; align-items:center; gap:.9rem;
  margin:.1rem 0 .3rem;
}
.wl-embed-seats-suffix {
  font-size:.78rem; color:var(--text-dim); letter-spacing:.02em;
}
.wl-deposit-seats-stepper {
  display:flex; align-items:center; gap:.5rem;
}
.wl-deposit-seats-btn {
  width:2rem; height:2rem; flex:0 0 auto;
  background:transparent; border:1px solid var(--border);
  color:var(--text); font-family:inherit; font-size:1rem; line-height:1;
  cursor:pointer; transition:border-color .15s, color .15s, box-shadow .15s;
}
.wl-deposit-seats-btn:hover {
  border-color:var(--salmon); color:var(--salmon);
  box-shadow:0 0 8px var(--salmon-glow);
}
.wl-deposit-seats-btn:active { transform:translateY(1px); }
.wl-deposit-seats-display {
  min-width:1.6rem; text-align:center;
  font-size:1rem; color:var(--salmon); font-family:inherit;
}

/* Name/email/phone fields — bare underline, no boxed row, matching
   the lighter-weight input treatment elsewhere on the terminal
   (index.html's skeptic form, account.html's host-msg field). The
   .wl-deposit-field-row classname stays so email-suggest.js's
   "did you mean?" popover (which looks for it) keeps working; only
   the visual treatment changes here. */
.wl-embed-field { margin:.75rem 0; }
.wl-embed-field-label {
  display:block; font-size:.64rem; color:var(--text-dim);
  letter-spacing:.1em; margin-bottom:.3rem;
}
.wl-deposit-field-row {
  display:flex; align-items:center;
  border:none; border-bottom:1px solid var(--border); background:transparent;
  padding:.3rem 0;
  transition:border-color .15s;
}
.wl-deposit-field-row:focus-within { border-bottom-color:var(--salmon); }
.wl-deposit-field-row input {
  flex:1; min-width:0; width:100%;
  background:transparent; border:none; outline:none;
  color:var(--text); font-family:inherit; font-size:.86rem;
  padding:.2rem 0; caret-color:var(--salmon);
}
.wl-deposit-field-row input::placeholder { color:var(--text-dim); opacity:.6; }
/* Browser autofill (keychain / contacts) tints inputs with a
   yellow-cream background that clashes with the terminal palette.
   Paint the panel's own bg over it via the canonical 1000px
   inset-shadow trick, and force the text + caret colors to brand.
   Same pattern used elsewhere in the codebase (tickets.html,
   account.html, etc). */
.wl-deposit-field-row input:-webkit-autofill,
.wl-deposit-field-row input:-webkit-autofill:hover,
.wl-deposit-field-row input:-webkit-autofill:focus,
.wl-deposit-field-row input:-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0 1000px var(--card) inset !important;
  box-shadow: 0 0 0 1000px var(--card) inset !important;
  -webkit-text-fill-color: var(--text) !important;
  caret-color: var(--salmon) !important;
  transition: background-color 9999s ease-out 0s;
}

/* Marketing consent rows — same [x]/[ ] glyph pattern + fine-print
   structure as event.html's purchase-flow consent rows, so the
   waitlist ask reads as the same system rather than a one-off. The
   email row is a genuinely optional toggle; the SMS/event-info row is
   mandatory to join the waitlist at all (see api/waitlist-join.js) so
   it's pre-checked and labeled as required rather than framed as
   skippable. */
.wl-embed-consent-row {
  display:flex; align-items:flex-start; gap:.5rem;
  cursor:pointer; margin:.7rem 0;
}
.wl-embed-consent-check {
  font-size:.82rem; color:var(--salmon); flex:0 0 auto;
  line-height:1.4; user-select:none;
}
.wl-embed-consent-text {
  font-size:.7rem; line-height:1.5; color:var(--text-dim);
}
.wl-embed-consent-fine {
  display:block; font-size:.6rem; line-height:1.6; color:var(--text-dim);
  opacity:.8; letter-spacing:.02em; margin-top:.2rem;
}
.wl-embed-consent-fine strong { color:var(--salmon); font-weight:600; }
.wl-embed-consent-fine a { color:var(--blue); text-decoration:none; }
.wl-embed-consent-required {
  display:block; font-size:.6rem; color:var(--blue);
  margin-top:.2rem; letter-spacing:.03em;
}

/* Card section — revealed the moment "waitlist preferred" is picked
   (no separate expand tap). Number gets its own row; expiry/cvc/zip
   share a three-column row. */
.wl-embed-card-section {
  margin-top:.9rem; padding-top:.9rem;
  border-top:1px dashed var(--border);
}
.wl-deposit-field-label {
  display:block; font-size:.64rem; color:var(--text-dim);
  letter-spacing:.1em; margin:.6rem 0 .3rem;
}
.wl-deposit-field-label:first-child { margin-top:0; }
.wl-deposit-card-element {
  border:1px solid var(--border); background:var(--card);
  padding:.6rem .7rem; transition:border-color .15s, box-shadow .15s;
}
.wl-deposit-card-element.StripeElement--focus {
  border-color:var(--salmon); box-shadow:0 0 8px var(--salmon-glow);
}
.wl-deposit-card-element.StripeElement--invalid { border-color:var(--text); }
.wl-embed-card-row3 {
  display:flex; gap:.6rem; margin-top:0;
}
.wl-embed-card-row3 > div { flex:1 1 0; min-width:0; }

/* Inline validation / payment errors. */
.wl-embed-err {
  min-height:1em; font-size:.72rem; color:var(--salmon);
  margin:.7rem 0; letter-spacing:.02em;
}

/* Confirm button reuses the site-wide .crt-cta (from crt-buttons.css)
   so it renders as the same bracket-CTA every other primary action
   uses. Idle state (nothing picked yet) adds .crt-cta--ghost for a
   dimmer, clearly-inactive look; JS removes it once a choice is made.

   Host pages scope status-color overrides to their own descendant
   selectors (e.g. index.html's .timeslot-block.is-soldout .crt-cta →
   red, event.html's #cta-slot .crt-cta:disabled → accent). An ID
   selector beats index.html's class-chain rule on specificity alone,
   but event.html's own override is ALSO ID-anchored
   (#cta-slot .crt-cta:disabled), which ties with the plain-ID form
   below and is decided by source order instead — and event.html's own
   <style> loads after this stylesheet's <link>, so it would win that
   tie. !important is the deliberate, narrow fix: this one button is
   the site's single neutral go-action regardless of which host page
   or CSS-cascade position it lands in, so it shouldn't be at the mercy
   of an unrelated page's rule ever happening to out-rank or out-order
   it — a case where !important is the right tool, not a workaround.

   Sizing is likewise pinned explicitly (matching index.html's
   .timeslot-block .crt-cta / account.html's .oc-cta compact numbers)
   rather than relying on inherited host-page scoping, since
   account.html's own CTAs use a different class (.oc-cta) entirely
   and never give this shared, hardcoded .crt-cta button any sizing at
   all. */
#wl-embed-confirm,
#wl-embed-confirm:disabled {
  color: var(--off-green-lit, #5BFF3A) !important;
  border-color: rgba(57,255,20,0.4) !important;
  text-shadow: 0 0 8px rgba(57,255,20,.9), 0 0 16px rgba(57,255,20,.45) !important;
  box-shadow: 0 0 12px rgba(57,255,20,.3), inset 0 0 16px rgba(57,255,20,.1) !important;
}
#wl-embed-confirm.crt-cta--ghost,
#wl-embed-confirm.crt-cta--ghost:disabled {
  color: var(--off-green, #39FF14) !important;
  border-color: rgba(57,255,20,0.22) !important;
  text-shadow: 0 0 6px rgba(57,255,20,.55) !important;
  box-shadow: 0 0 8px rgba(57,255,20,.18) !important;
}
#wl-embed-confirm {
  margin-top:.3rem;
  font-size:.82rem !important;
  padding:.85rem 1rem !important;
  letter-spacing:.18em !important;
}
.wl-embed-cancel {
  display:block; text-align:center;
  font-size:.72rem; color:var(--text-dim);
  margin-top:.65rem; cursor:pointer; text-decoration:underline;
  letter-spacing:.02em;
}
.wl-embed-cancel:hover { color:var(--text); }

/* Inline success state — swapped in for .wl-embed-form on a
   successful FREE join (no page navigation). */
.wl-embed-success { text-align:center; padding:.4rem 0 .2rem; }
.wl-embed-success-check {
  font-size:2.2rem; color:var(--salmon); margin-bottom:.3rem;
  text-shadow:0 0 10px var(--salmon-glow);
}
.wl-embed-success-head {
  font-size:.9rem; letter-spacing:.16em; font-weight:600; color:var(--text);
}
.wl-embed-success-detail {
  font-size:.76rem; color:var(--text-dim); margin-top:.6rem; line-height:1.6;
}

/* Click-flash: a brief CRT glitch on any embed/sheet button when
   tapped. Re-uses the existing @keyframes btn-glitch-flicker defined
   by the host page (band clip-path + opacity drops). JS toggles the
   class on tap and removes it after the animation completes so the
   next tap can re-fire. */
.wl-sheet-cta.glitch-flash,
#wl-embed-confirm.glitch-flash {
  animation: btn-glitch-flicker .4s linear;
}
