/* Styles for the DOM-mounted contract modules on the React pages
   (/dashboard, /profile): auth wall, gating paywall card, header
   account buttons. Replaces the legacy styles.css on those pages —
   styles.css carries an unlayered `* { margin:0; padding:0 }` reset
   that, per CSS cascade-layer rules, overrides every Tailwind v4
   utility (they live in @layer). Class names here are the contract;
   the look matches the v3 briefing design system.

   auth-modal.css and checkout-toast.css still load separately. */

:root {
  /* Legacy variable aliases consumed by auth-modal.css / toast css. */
  --bg-primary: #08080d;
  --bg-secondary: #0e0e15;
  --bg-card: #11111a;
  --border: #232333;
  --border-accent: #2b2b3b;
  --text-primary: #f4f4f6;
  --text-secondary: #a8a8ba;
  --text-muted: #8a8aa3;
  --accent-amber: #e8a817;
  --accent-amber-glow: rgba(232, 168, 23, 0.12);
  --accent-green: #34d399;
  --accent-red: #e5484d;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;
  --font-sans: 'DM Sans', system-ui, sans-serif;
  --font-display: 'Instrument Serif', Georgia, serif;
}

/* ── Boot skeleton ───────────────────────────────────────────────────
   Lives inside #root in dashboard.html / profile.html and shows the
   moment the HTML parses — before the React bundle downloads + mounts.
   createRoot().render() replaces it on mount, by which point React paints
   its OWN sx-veil skeletons, so the page goes shimmer → shimmer → settle
   instead of blank → pop. Uses sx-veil (from the index.css bundle, also
   render-blocking in <head>) for the shimmer; reduced-motion is handled by
   the same catch-all. Tier gating mirrors the app: anon sees the wall card,
   signed-in sees the content panels. */
.sx-boot { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
@media (min-width: 768px) { .sx-boot { padding: 0 40px; } }
.sx-boot-bar {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px; padding-top: 14px;
}
.sx-boot-logo { width: 132px; height: 30px; border-radius: 6px; background: var(--bg-card); }
.sx-boot-status { width: 200px; height: 12px; border-radius: 4px; }
.sx-boot-main { padding: 56px 0; }
.sx-boot-panel { display: block; border-radius: 14px; }
.sx-boot-panel + .sx-boot-panel { margin-top: 20px; }
.sx-boot-wall { display: flex; justify-content: center; padding: 72px 20px; }
.sx-boot-wall-card { width: 420px; max-width: 100%; height: 360px; border-radius: 14px; }
body.is-anonymous .sx-boot-main { display: none; }
body:not(.is-anonymous) .sx-boot-wall { display: none; }

/* Landing variant (no auth wall) — two-column hero: statement lines + the
   live-readout terminal panel. */
.sx-boot-hero { padding: 64px 0; display: grid; gap: 48px; align-items: center; }
@media (min-width: 1024px) { .sx-boot-hero { grid-template-columns: 1.05fr 1fr; } }

/* ── Auth wall ───────────────────────────────────────────────────── */
.dashboard-auth-wall {
  min-height: calc(100vh - 120px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 20px;
}
.auth-wall-card {
  width: min(420px, 100%);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 40%), var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 40px 36px;
  text-align: center;
}
.auth-wall-eyebrow {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.22em;
  color: var(--accent-amber);
  margin-bottom: 14px;
}
.auth-wall-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 30px;
  line-height: 1.1;
  color: var(--text-primary);
  margin-bottom: 12px;
}
.auth-wall-sub {
  font-family: var(--font-sans);
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text-secondary);
  margin-bottom: 24px;
}
.auth-wall-sub strong { color: var(--text-primary); font-weight: 500; }
.auth-google-btn {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--border-accent);
  border-radius: 8px;
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.2s ease;
}
.auth-google-btn:hover { border-color: var(--accent-amber); }
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 11px;
}
.auth-divider::before, .auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}
.auth-forgot {
  margin-top: 14px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 12.5px;
  cursor: pointer;
  min-height: 44px;
}
.auth-forgot:hover { color: var(--text-secondary); }
.auth-wall-foot {
  margin-top: 20px;
  font-family: var(--font-sans);
  font-size: 12.5px;
  color: var(--text-muted);
}
.auth-wall-foot a { color: var(--accent-amber); text-decoration: none; }

/* ── Gating paywall card (inserted by gating.js) ─────────────────── */
.paywall-section { margin-top: 24px; }

/* Reveal when the card is first shown (gating.js adds .fade-up, removes it
   on animationend). Animates max-height + margin so the content below
   slides down instead of the card hard-popping in (it can't reserve space
   — the tier resolves after auth). max-height is a generous ceiling the
   real card never reaches, so the slide tracks the card's true height and
   nothing clips; opacity + a slight rise carry the entrance. Same easing as
   the React reveals. Neutralized by index.css's reduced-motion catch-all. */
@keyframes sx-paywall-reveal {
  from { opacity: 0; max-height: 0;     margin-top: 0;    transform: translateY(-4px); }
  to   { opacity: 1; max-height: 800px; margin-top: 24px; transform: translateY(0); }
}
.paywall-section.fade-up {
  overflow: hidden;
  animation: sx-paywall-reveal 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.paywall-card {
  background: linear-gradient(180deg, rgba(232, 168, 23, 0.04), transparent 45%), var(--bg-card);
  border: 1px solid rgba(232, 168, 23, 0.25);
  border-radius: 14px;
  padding: 36px 40px;
}
.paywall-eyebrow {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.22em;
  color: var(--accent-amber);
  margin-bottom: 12px;
}
.paywall-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 28px;
  line-height: 1.12;
  color: var(--text-primary);
  margin-bottom: 8px;
}
.paywall-sub {
  font-family: var(--font-sans);
  font-size: 13.5px;
  color: var(--text-secondary);
  margin-bottom: 18px;
}
.paywall-bullets {
  list-style: none;
  margin: 0 0 22px;
  padding: 0;
  display: grid;
  gap: 8px;
}
.paywall-bullets li {
  font-family: var(--font-sans);
  font-size: 13.5px;
  color: var(--text-secondary);
  padding-left: 22px;
  position: relative;
}
.paywall-bullets li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 9px;
  width: 12px;
  height: 1px;
  background: var(--accent-amber);
}
.paywall-cta {
  min-height: 44px;
  padding: 0 26px;
  border: none;
  border-radius: 8px;
  background: var(--accent-amber);
  color: #0a0a10;
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: filter 0.2s ease;
}
.paywall-cta:hover { filter: brightness(1.1); }
.paywall-fineprint {
  margin-top: 14px;
  font-family: var(--font-sans);
  font-size: 11.5px;
  color: var(--text-muted);
}

/* ── Header account buttons (account-button.js) ──────────────────── */
.account-btn {
  min-height: 34px;
  padding: 6px 14px;
  border-radius: 7px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}
.account-btn-primary {
  background: var(--accent-amber);
  border: 1px solid var(--accent-amber);
  color: #0a0a10;
  font-weight: 600;
}
.account-btn-primary:hover { filter: brightness(1.1); }
.account-btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
}
.account-btn-ghost:hover { border-color: var(--border-accent); color: var(--text-secondary); }
.account-trial-chip {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  padding: 5px 10px;
  border-radius: 5px;
  color: var(--accent-amber);
  background: rgba(232, 168, 23, 0.08);
  border: 1px solid rgba(232, 168, 23, 0.25);
  white-space: nowrap;
}
.account-trial-chip.urgent {
  color: var(--accent-red);
  background: rgba(229, 72, 77, 0.08);
  border-color: rgba(229, 72, 77, 0.3);
}

/* Landing "Sign out" — injected by landing-checkout.js next to the
   header CTA for signed-in visitors. The real .header-cta is Tailwind-
   styled inline; this injected button only has legacy class names, so
   it needs its own rule (a ghost variant of the amber CTA). */
.header-signout-landing {
  min-height: 36px;
  padding: 8px 16px;
  border-radius: 7px;
  border: 1px solid var(--border-accent);
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.header-signout-landing:hover {
  color: var(--text-secondary);
  border-color: var(--text-muted);
}

/* Spinner used by withButtonLoading (subscription.js) */
.checkout-spinner {
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 8px;
  border: 2px solid rgba(10, 10, 16, 0.3);
  border-top-color: rgba(10, 10, 16, 0.9);
  border-radius: 50%;
  animation: checkout-spin 0.7s linear infinite;
  vertical-align: -2px;
}
@keyframes checkout-spin { to { transform: rotate(360deg); } }

/* Visible keyboard focus for the JS-mounted contract buttons (the React
   app sets this globally; these elements are created outside React). */
.account-btn:focus-visible,
.auth-google-btn:focus-visible,
.auth-forgot:focus-visible,
.paywall-cta:focus-visible,
.header-signout-landing:focus-visible {
  outline: 2px solid var(--accent-amber);
  outline-offset: 2px;
}
