/* CPQ Pilot Account — the marketing-site design language (Gemini/Joule register),
   hand-written so the FastAPI app stays build-free. Tokens mirror DESIGN.md. */
:root {
  --bg: #ffffff;
  --surface: #f6f8fc;
  --surface-2: #eaeef7;
  --ink: #1f1f1f;
  --muted: #5f6368;
  --line: #e4e7ec;
  --brand: #1a73e8;
  --brand-ink: #1559c0;
  --violet: #9b72cb;
  --pink: #d96570;
  --ok: #1e8e5a;
  --grad: linear-gradient(100deg, #4285f4 0%, #9b72cb 50%, #d96570 100%);
  --grad-btn: linear-gradient(100deg, #1a73e8 0%, #7b5cf0 55%, #c84d8f 100%);
  --display: "Plus Jakarta Sans", ui-sans-serif, system-ui, sans-serif;
  --body: "Inter", ui-sans-serif, system-ui, sans-serif;
  --mono: "Roboto Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  -webkit-font-smoothing: antialiased;
}
.boot { display: grid; place-items: center; min-height: 100vh; color: var(--muted); font-family: var(--mono); }

/* Post-checkout finalizing state — spinner while we poll for the webhook */
.finalize { min-height: 100vh; display: flex; flex-direction: column; align-items: center;
  justify-content: center; text-align: center; gap: 10px; padding: 40px 24px; }
.finalize h2 { font-family: var(--display); font-size: 22px; font-weight: 700; color: var(--ink); margin: 6px 0 0; }
.finalize .sub { color: var(--muted); max-width: 360px; line-height: 1.5; }
.spinner { width: 40px; height: 40px; border-radius: 50%;
  border: 3px solid var(--surface-2); border-top-color: var(--brand);
  animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2.2s; } }

/* soft ambient glow behind the auth/account hero */
.glow {
  background:
    radial-gradient(55% 45% at 80% 12%, rgba(155, 114, 203, 0.16), transparent 70%),
    radial-gradient(50% 50% at 18% 8%, rgba(66, 133, 244, 0.13), transparent 70%);
}

a { color: var(--brand-ink); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ── brand mark ─────────────────────────────────────────────────────────── */
.spark { width: 22px; height: 22px; flex: none; }
.wordmark { display: inline-flex; align-items: center; gap: 8px; font-family: var(--display); font-weight: 800; font-size: 17px; letter-spacing: -0.01em; }
.text-grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ── pills / buttons ────────────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0;
  border-radius: 999px; font-family: var(--display); font-weight: 600; font-size: 15px;
  padding: 11px 20px; cursor: pointer; transition: filter .15s, background .15s, box-shadow .15s; text-decoration: none; }
.btn-primary { background-image: var(--grad-btn); color: #fff; box-shadow: 0 8px 20px -8px rgba(123, 92, 240, .55); }
.btn-primary:hover { filter: brightness(1.06); }
.btn-secondary { background: var(--bg); color: var(--ink); border: 1px solid var(--line); }
.btn-secondary:hover { background: var(--surface); }
.btn[disabled] { opacity: .6; cursor: progress; }
.btn-block { width: 100%; }

/* ── auth view ──────────────────────────────────────────────────────────── */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card { width: 100%; max-width: 400px; border: 1px solid var(--line); border-radius: 24px;
  background: var(--bg); padding: 32px 28px; box-shadow: 0 30px 60px -30px rgba(31, 31, 31, .22); }
.auth-card h1 { font-family: var(--display); font-weight: 800; font-size: 26px; letter-spacing: -0.02em; margin: 18px 0 4px; }
.auth-card .sub { color: var(--muted); font-size: 14.5px; margin: 0 0 22px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.field input { width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 11px 13px;
  font-family: var(--body); font-size: 15px; color: var(--ink); background: var(--bg); }
.field input:focus { border-color: var(--brand); outline: none; }
.auth-error { background: #fdeceb; color: #b3261e; border-radius: 10px; padding: 9px 12px; font-size: 13.5px; margin-bottom: 14px; }
.auth-alt { text-align: center; margin-top: 18px; font-size: 14px; color: var(--muted); }
.auth-alt button { background: none; border: 0; color: var(--brand-ink); font-weight: 600; cursor: pointer; font-size: 14px; }

/* ── account view ───────────────────────────────────────────────────────── */
.topbar { border-bottom: 1px solid var(--line); }
.topbar-in { max-width: 880px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; }
.topbar .who { display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--muted); }
.topbar .who .email { color: var(--ink); font-weight: 500; }
.link-btn { background: none; border: 0; color: var(--muted); font-size: 14px; cursor: pointer; font-weight: 500; }
.link-btn:hover { color: var(--ink); }

.page { max-width: 880px; margin: 0 auto; padding: 36px 20px 64px; }
.page h2 { font-family: var(--display); font-weight: 800; font-size: 30px; letter-spacing: -0.02em; margin: 0 0 4px; }
.page .lede { color: var(--muted); font-size: 16px; margin: 0 0 28px; }

.card { border: 1px solid var(--line); border-radius: 22px; background: var(--bg); padding: 24px; margin-bottom: 18px; }
.card.feature { box-shadow: 0 24px 50px -34px rgba(31,31,31,.3); }
.card-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.eyebrow { font-family: var(--display); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .14em; }
.plan-name { font-family: var(--display); font-weight: 800; font-size: 34px; letter-spacing: -0.02em; margin: 6px 0 2px; }
.plan-tag { color: var(--muted); font-size: 14.5px; }
.badge { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 5px 11px;
  font-family: var(--display); font-size: 12px; font-weight: 700; }
.badge-grad { background: var(--grad); color: #fff; }
.badge-soft { background: var(--surface-2); color: var(--muted); }

/* usage meter */
.meter { margin-top: 6px; }
.meter-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 14px; margin-bottom: 8px; }
.meter-head .amt { font-family: var(--mono); font-size: 13.5px; color: var(--muted); }
.meter-track { height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.meter-fill { height: 100%; border-radius: 999px; background: var(--grad-btn); transition: width .5s ease; }
.meter-fill.warn { background: linear-gradient(100deg, #e8a02c, #d96570); }
.meter-note { margin-top: 10px; font-size: 13.5px; color: var(--muted); }

/* entitlement chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.chip { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 999px;
  padding: 7px 13px; font-size: 13.5px; color: var(--ink); background: var(--surface); }
.chip .dot { width: 7px; height: 7px; border-radius: 999px; background: var(--brand); }

.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; }

/* upgrade plan cards */
.plans { display: grid; gap: 14px; grid-template-columns: 1fr; margin-top: 14px; }
@media (min-width: 720px) { .plans { grid-template-columns: 1fr 1fr; } }
.plan-card { border: 1px solid var(--line); border-radius: 18px; padding: 20px; }
.plan-card.rec { border: 0; background: var(--grad); padding: 2px; box-shadow: 0 24px 50px -30px rgba(123,92,240,.55); }
.plan-card.rec > .inner { background: var(--bg); border-radius: 16px; padding: 19px; height: 100%; }
.plan-card h3 { font-family: var(--display); font-weight: 800; font-size: 19px; margin: 0; }
.plan-card .price { font-family: var(--display); font-weight: 800; font-size: 30px; margin: 8px 0 2px; }
.plan-card .price span { font-family: var(--body); font-weight: 500; font-size: 14px; color: var(--muted); }
.plan-card ul { list-style: none; padding: 0; margin: 14px 0 18px; display: grid; gap: 9px; }
.plan-card li { font-size: 14px; display: flex; gap: 8px; }
.plan-card li svg { flex: none; margin-top: 2px; color: var(--brand); }

.upsell { display: flex; align-items: center; gap: 12px; border: 1px solid #f3d9a6;
  background: #fdf5e6; border-radius: 14px; padding: 13px 16px; margin-bottom: 18px; font-size: 14px; }
.muted-note { color: var(--muted); font-size: 12.5px; text-align: center; margin-top: 22px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ── upgrade modal ──────────────────────────────────────────────────────── */
.modal-backdrop { position: fixed; inset: 0; background: rgba(20,24,33,.45); backdrop-filter: blur(2px);
  display: grid; place-items: center; padding: 20px; z-index: 60; animation: fade .14s ease; }
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }
.modal { width: 100%; max-width: 480px; background: var(--bg); border-radius: 24px;
  box-shadow: 0 40px 90px -30px rgba(20,24,33,.55); padding: 26px 26px 22px;
  animation: pop .18s cubic-bezier(.2,.7,.2,1); }
@keyframes pop { from { opacity:0; transform: translateY(10px) scale(.985) } to { opacity:1; transform:none } }
.modal-head { display:flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.modal-head h3 { font-family: var(--display); font-weight: 800; font-size: 23px; letter-spacing:-.02em; margin:0; }
.modal-head p { color: var(--muted); font-size: 14px; margin: 5px 0 0; }
.modal-x { background:none; border:0; cursor:pointer; color: var(--muted); border-radius: 999px;
  width:32px; height:32px; font-size:16px; flex:none; }
.modal-x:hover { background: var(--surface); color: var(--ink); }
.opt-grid { display:grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 20px; }
.opt { text-align:left; border:1.5px solid var(--line); border-radius: 16px; padding: 14px 15px;
  cursor:pointer; background: var(--bg); transition: border-color .12s, background .12s, box-shadow .12s; }
.opt:hover { border-color: #b9c4d6; }
.opt.selected { border-color: var(--brand); background: #eef3fe; box-shadow: 0 0 0 3px rgba(26,115,232,.12); }
.opt .nm { font-family: var(--display); font-weight: 800; font-size: 16px; }
.opt .pr { font-family: var(--display); font-weight: 800; font-size: 23px; margin-top: 3px; }
.opt .pr span { font-family: var(--body); font-weight:500; font-size: 12.5px; color: var(--muted); }
.opt .tag { display:inline-block; margin-top:9px; background: var(--grad); color:#fff; border-radius:999px;
  padding:3px 9px; font-family:var(--display); font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:.08em; }
.summary { background: var(--surface); border-radius: 16px; padding: 15px 16px; margin-top: 18px; }
.summary .row { display:flex; justify-content: space-between; align-items:baseline; font-size: 15px; }
.summary .amt { font-family: var(--display); font-weight: 800; font-size: 18px; }
.summary .amt small { font-family: var(--body); font-weight:500; font-size: 12.5px; color: var(--muted); }
.summary .feat { color: var(--muted); font-size: 13px; margin-top: 9px; line-height: 1.5; }
.modal-note { color: var(--muted); font-size: 12.5px; margin: 14px 0 0; display:flex; align-items:center; gap:7px; }
.modal-note svg { color: var(--ok); flex:none; }
.modal-actions { display:flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
@media (max-width: 460px) { .opt-grid { grid-template-columns: 1fr; } }
