/* Waitlist and consent banner, shared by every page that has a "Get Babya" button.
   Uses the page's own tokens (--amber, --ink, --line, --card, --muted, --display, --body).

   Launch switch. scripts/build-site.mjs stamps <html data-mode>:
     "waitlist"  while APP_STORE_URL is empty: forms show, store buttons hide
     "live"      once it is set: store buttons show, forms hide
   The raw source files have no data-mode and preview as the waitlist. */
html:not([data-mode="live"]) [data-cta] { display: none !important; }
html[data-mode="live"] .wl { display: none !important; }

.wl-form { width: 100%; max-width: 480px; }
.wl-row {
  display: flex; align-items: center; gap: 6px; padding: 6px;
  background: var(--card); border: 2px solid var(--ink); border-radius: 999px;
  box-shadow: 0 10px 28px rgba(22,24,28,.08);
}
.wl-row:focus-within { box-shadow: 0 0 0 4px rgba(255,180,67,.45), 0 10px 28px rgba(22,24,28,.08); }
.wl-row input {
  flex: 1 1 auto; min-width: 0; border: 0; background: transparent; outline: none;
  /* 16px or larger, or iOS Safari zooms the page on focus. */
  font: 600 16px/1.2 var(--body); color: var(--ink); padding: 12px 8px 12px 16px;
}
.wl-row input::placeholder { color: var(--muted); font-weight: 500; }
.wl-row .btn { flex-shrink: 0; padding: 13px 22px; box-shadow: none; }
.wl-row .btn[disabled] { opacity: .6; cursor: progress; }
@media (max-width: 419px) {
  .wl-row { flex-direction: column; align-items: stretch; border-radius: 26px; padding: 6px; }
  .wl-row input { padding: 12px 14px; text-align: center; }
  .wl-row .btn { justify-content: center; }
}
.wl-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wl-msg { margin-top: 10px; font-size: 14px; font-weight: 600; min-height: 0; }
.wl-msg:empty { display: none; }
.wl-msg.err { color: #B3261E; }

/* After signing up: the confirmation, then two optional questions. */
.wl-done:focus { outline: none; }
.wl-done { background: var(--card); border: 2px solid var(--ink); border-radius: 26px; padding: 20px 20px 18px; text-align: left; }
.wl-done h3 { font-family: var(--display); font-weight: 800; font-size: 22px; letter-spacing: -0.02em; line-height: 1.1; margin: 0; }
.wl-done > p { margin-top: 6px; font-size: 14.5px; color: var(--muted); }
.wl-q { margin: 16px 0 0; padding: 0; border: 0; min-width: 0; }
.wl-q legend { padding: 0; font-weight: 700; font-size: 15px; color: var(--ink); }
.wl-q legend span { font-weight: 500; color: var(--muted); }
.wl-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.wl-chip {
  font: 700 14px/1 var(--body); color: var(--ink); cursor: pointer;
  background: var(--card); border: 1.5px solid var(--line); border-radius: 999px; padding: 10px 14px;
  transition: background-color .12s ease, border-color .12s ease, transform .12s ease;
}
.wl-chip:hover { border-color: var(--ink); }
.wl-chip:active { transform: scale(.97); }
.wl-chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.wl-other { display: flex; gap: 8px; margin-top: 10px; }
.wl-other input {
  flex: 1 1 auto; min-width: 0; font: 600 16px/1.2 var(--body); color: var(--ink);
  border: 1.5px solid var(--line); border-radius: 999px; padding: 10px 14px; background: var(--card);
}
.wl-other input:focus { outline: none; border-color: var(--ink); }
.wl-other .btn { padding: 10px 18px; font-size: 14.5px; box-shadow: none; }
.wl-note { margin-top: 10px; font-size: 13.5px; color: var(--muted); }
.wl-saved { margin-top: 14px; font-size: 13.5px; font-weight: 700; color: var(--ink); min-height: 1.3em; }

/* On an amber card the button goes ink, so it does not vanish into the background. */
.wl-on-amber .wl-row { border-color: var(--ink); box-shadow: 0 12px 30px rgba(90,54,5,.18); }
.wl-on-amber .wl-row .btn { background: var(--ink); color: #fff; }
.wl-on-amber .wl-row .btn:hover { background: #2A2E35; }
.wl-on-amber .wl-msg.err { color: var(--ink); }

/* Cookie choice. Only appears when a GA measurement ID is configured. */
.consent {
  position: fixed; z-index: 40; left: 12px; right: 12px; bottom: 12px; margin: 0 auto; max-width: 560px;
  background: var(--ink); color: #fff; border-radius: 22px; padding: 16px 18px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px;
  box-shadow: 0 18px 44px rgba(22,24,28,.3);
  margin-bottom: env(safe-area-inset-bottom, 0px);
}
.consent p { flex: 1 1 260px; margin: 0; font-size: 13.5px; line-height: 1.45; color: rgba(255,255,255,.86); }
.consent a { color: #fff; font-weight: 700; }
.consent-actions { display: flex; gap: 8px; margin-left: auto; }
.consent .btn { padding: 10px 18px; font-size: 14px; box-shadow: none; }
.consent .btn-quiet { background: transparent; color: #fff; border-color: rgba(255,255,255,.35); }
.consent .btn-quiet:hover { border-color: #fff; }
.wl-joined { font-family: var(--display); font-weight: 800; font-size: 18px; letter-spacing: -0.01em; }
.wl-on-amber { width: min(100%, 440px); position: relative; z-index: 1; }
.dock .wl, .nav .wl { white-space: nowrap; }

/* TestFlight beta line under each waitlist form. Shown only when
   scripts/build-site.mjs has a TESTFLIGHT_URL and no APP_STORE_URL yet. */
.wl-form p.wl-beta { display: none; margin-top: 12px; font-size: 14.5px; font-weight: 600; color: var(--muted); }
.wl-beta a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }
.wl-beta-ico { width: 1.15em; height: 1.15em; vertical-align: -0.22em; margin-right: 0.3em;
  fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.wl-form.wl-on-amber p.wl-beta { color: var(--ink); }
html[data-mode="beta"] .wl-form p.wl-beta { display: block; }
