/* FormRiff account pages (w-billing 01.12.): sign in, approve a device, plan and billing. Same tokens as the app. */
@font-face { font-family: "Manrope"; src: url("Manrope.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("PlexMono.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }

:root {
  --ink: #0B0B0B; --paper: #F2EDDF; --cobalt: #0047FF; --vermilion: #FF533D;
  --font-ui: "Manrope", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-code: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --r-sm: 8px; --r-md: 12px; --r-lg: 16px; --r-pill: 999px;
  color-scheme: dark;
  --ground: #070707; --surface: #0E0E0E; --surface-2: #141414; --surface-3: #1B1B1B;
  --text: #F2EDDF; --muted: #B9B5AA; --faint: #908C83;
  --line: rgba(242, 237, 223, .08); --line-2: rgba(242, 237, 223, .14); --line-3: rgba(242, 237, 223, .26);
  --accent: var(--cobalt); --accent-text: #A6B9FF; --accent-soft: rgba(0, 71, 255, .16); --on-accent: #FFFFFF;
  --warn: #FF8A78; --warn-soft: rgba(255, 83, 61, .12);
  --ok: #8FD6A8; --ok-soft: rgba(68, 190, 120, .12);
  --glow: radial-gradient(1200px 560px at 50% -180px, rgba(0, 71, 255, .22), transparent 62%);
  --shadow: 0 1px 0 rgba(242, 237, 223, .04) inset, 0 24px 60px -28px rgba(0, 0, 0, .8);
}
:root[data-theme="light"] {
  color-scheme: light;
  --ground: #E9E3D4; --surface: #F2EDDF; --surface-2: #F7F3E8; --surface-3: #FBF9F3;
  --text: #0B0B0B; --muted: #4A463F; --faint: #625E56;
  --line: rgba(11, 11, 11, .08); --line-2: rgba(11, 11, 11, .14); --line-3: rgba(11, 11, 11, .26);
  --accent-text: #0039CC; --accent-soft: rgba(0, 71, 255, .10);
  --warn: #B3291A; --warn-soft: rgba(255, 83, 61, .12);
  --ok: #1D7A45; --ok-soft: rgba(29, 122, 69, .10);
  --glow: radial-gradient(1200px 560px at 50% -180px, rgba(0, 71, 255, .12), transparent 62%);
  --shadow: 0 1px 0 rgba(255, 255, 255, .6) inset, 0 24px 60px -32px rgba(11, 11, 11, .28);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100vh; background: var(--glow), var(--ground); background-repeat: no-repeat;
  color: var(--text); font: 400 15px/1.55 var(--font-ui); -webkit-font-smoothing: antialiased;
  font-feature-settings: "ss01", "cv11";
}
button, input { font: inherit; color: inherit; }
a { color: var(--accent-text); text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; }
::selection { background: var(--accent); color: #fff; }

.frame { min-height: 100vh; display: flex; flex-direction: column; max-width: 1120px; margin: 0 auto; padding: 0 32px; }
.top { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 700; font-size: 16px; letter-spacing: -.01em; }
.mark { width: 22px; height: 22px; border-radius: 6px; background: var(--text); position: relative; }
.mark::after { content: ""; position: absolute; left: 5px; top: 5px; width: 12px; height: 6px; border-radius: 6px 6px 6px 0; background: var(--ground); }
.mark::before { content: ""; position: absolute; left: 5px; bottom: 5px; width: 5px; height: 5px; border-radius: 3px 0 0 0; background: var(--ground); }
.top-end { display: flex; align-items: center; gap: 12px; }
.who { color: var(--muted); font-size: 13px; max-width: 40vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.theme { width: 36px; height: 36px; border-radius: var(--r-pill); border: 1px solid var(--line-2); background: var(--surface-2); cursor: pointer; display: grid; place-items: center; transition: border-color .2s var(--ease-out); }
.theme:hover { border-color: var(--line-3); }
.theme span { width: 14px; height: 14px; border-radius: 50%; background: linear-gradient(90deg, var(--text) 50%, transparent 50%); border: 1.5px solid var(--text); }

.main { flex: 1; display: flex; flex-direction: column; align-items: center; padding: 48px 0 64px; }
.foot { display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--faint); font-size: 12px; padding: 24px 0 32px; border-top: 1px solid var(--line); }
.foot .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--faint); }

.loading { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--line-2); border-top-color: var(--accent-text); animation: spin .8s linear infinite; margin-top: 80px; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.eyebrow { font: 500 11px/1 var(--font-code); text-transform: uppercase; letter-spacing: .08em; color: var(--faint); margin: 0 0 14px; }
.title { font-size: 44px; line-height: 1.08; font-weight: 700; letter-spacing: -.03em; margin: 0 0 14px; text-wrap: balance; }
.lede { font-size: 17px; color: var(--muted); margin: 0 0 32px; max-width: 46ch; text-wrap: pretty; }

.solo { width: 100%; max-width: 480px; animation: rise .5s var(--ease-out) both; }
.wide { width: 100%; max-width: 1040px; animation: rise .5s var(--ease-out) both; }

.card { background: var(--surface-2); border: 1px solid var(--line-2); border-radius: var(--r-lg); padding: 28px; box-shadow: var(--shadow); }
.card + .card { margin-top: 16px; }
.card h2 { font-size: 18px; font-weight: 700; letter-spacing: -.01em; margin: 0 0 6px; }
.card p { margin: 0; color: var(--muted); }
.card .eyebrow { margin-bottom: 12px; color: var(--faint); }
.card > .facts:last-child { margin-bottom: 0; }
.seat-save { margin-top: 16px; }
.card p.small { margin-top: 14px; }

.field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.field label { font-size: 13px; font-weight: 600; color: var(--muted); }
.input { height: 48px; border-radius: var(--r-md); border: 1px solid var(--line-2); background: var(--surface); padding: 0 16px; font-size: 16px; transition: border-color .2s var(--ease-out), box-shadow .2s var(--ease-out); }
.input:hover { border-color: var(--line-3); }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.input.code { font-family: var(--font-code); letter-spacing: .14em; text-transform: uppercase; text-align: center; font-size: 20px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 48px; padding: 0 22px; border-radius: var(--r-pill); border: 1px solid transparent; cursor: pointer; font-weight: 700; font-size: 15px; text-decoration: none; transition: transform .15s var(--ease-out), background .2s var(--ease-out), border-color .2s var(--ease-out), opacity .2s; white-space: nowrap; }
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .5; cursor: default; }
.btn-primary { background: var(--accent); color: var(--on-accent); box-shadow: 0 8px 24px -10px rgba(0, 71, 255, .7); }
.btn-primary:hover { background: #1A5BFF; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line-2); }
.btn-ghost:hover { border-color: var(--line-3); background: var(--surface-3); }
.btn-quiet { background: transparent; color: var(--muted); height: 36px; padding: 0 12px; font-weight: 600; font-size: 13px; }
.btn-quiet:hover { color: var(--text); }
.btn-danger { background: transparent; color: var(--warn); border-color: var(--line-2); }
.btn-danger:hover { background: var(--warn-soft); border-color: transparent; }
.btn-block { width: 100%; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.row.split > .btn { flex: 1 1 160px; }

.note { margin-top: 16px; padding: 14px 16px; border-radius: var(--r-md); font-size: 14px; color: var(--muted); background: var(--surface); border: 1px solid var(--line); }
.note.ok { color: var(--ok); background: var(--ok-soft); border-color: transparent; }
.note.warn { color: var(--warn); background: var(--warn-soft); border-color: transparent; }
.small { font-size: 13px; color: var(--faint); margin-top: 20px; }

/* The sent / done state: one big mark, one sentence. */
.state { text-align: center; padding: 40px 28px; }
.state .glyph { width: 56px; height: 56px; border-radius: 50%; margin: 0 auto 20px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); font-size: 24px; font-weight: 700; }
.state .glyph.ok { background: var(--ok-soft); color: var(--ok); }
.state .glyph.warn { background: var(--warn-soft); color: var(--warn); }
.state h2 { font-size: 24px; letter-spacing: -.02em; margin-bottom: 8px; }

/* Device approval */
.device { display: flex; align-items: center; gap: 16px; padding: 18px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); margin: 20px 0 24px; }
.device-icon { width: 44px; height: 32px; border-radius: 5px; border: 2px solid var(--muted); position: relative; flex: none; }
.device-icon::after { content: ""; position: absolute; left: -6px; right: -6px; bottom: -6px; height: 3px; border-radius: 2px; background: var(--muted); }
.device-name { font-weight: 700; font-size: 16px; }
.device-meta { color: var(--faint); font-size: 13px; }
.codebox { font: 500 28px/1 var(--font-code); letter-spacing: .16em; text-align: center; padding: 18px; border-radius: var(--r-md); border: 1px dashed var(--line-3); color: var(--text); margin-bottom: 8px; }

/* Plan page */
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-bottom: 32px; }
.head .lede { margin-bottom: 0; }
.grid { display: grid; grid-template-columns: 1.35fr 1fr; gap: 16px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack > .card + .card { margin-top: 0; }
.planname { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 4px 0 10px; }
.planname strong { font-size: 32px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; }
.badge { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: var(--r-pill); font: 600 12px/1 var(--font-ui); background: var(--accent-soft); color: var(--accent-text); }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; margin: 22px 0 24px; }
.fact { background: var(--surface); padding: 14px 16px; min-width: 0; }
.fact span { display: block; font: 500 10.5px/1 var(--font-code); text-transform: uppercase; letter-spacing: .08em; color: var(--faint); margin-bottom: 8px; }
.fact b { font-size: 15px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.meter { height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; margin-top: 10px; }
.meter i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }

.seg { display: inline-flex; padding: 4px; border-radius: var(--r-pill); background: var(--surface); border: 1px solid var(--line-2); gap: 2px; }
.seg button { height: 36px; padding: 0 16px; border-radius: var(--r-pill); border: 0; background: transparent; cursor: pointer; font-weight: 600; font-size: 14px; color: var(--muted); transition: background .2s var(--ease-out), color .2s; }
.seg button[aria-checked="true"] { background: var(--surface-3); color: var(--text); box-shadow: 0 1px 0 var(--line-2) inset, 0 2px 8px -4px rgba(0, 0, 0, .5); }
.seg .save { color: var(--accent-text); font-size: 12px; margin-left: 4px; }
.offers { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 20px; }
.offer { text-align: left; padding: 20px; border-radius: var(--r-md); border: 1px solid var(--line-2); background: var(--surface); cursor: pointer; transition: border-color .2s var(--ease-out), box-shadow .2s var(--ease-out); display: flex; flex-direction: column; gap: 4px; }
.offer:hover { border-color: var(--line-3); }
.offer[aria-checked="true"] { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.offer .eyebrow { margin-bottom: 6px; }
.offer .price { font-size: 30px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; color: var(--text); }
.offer .per { font-size: 13px; color: var(--faint); }
.offer .what { font-size: 13px; color: var(--muted); margin-top: 8px; }
.stepper { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; padding: 12px 12px 12px 18px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); }
.stepper .lbl { font-weight: 600; }
.stepper .lbl small { display: block; color: var(--faint); font-weight: 400; font-size: 13px; }
.stepper .ctl { display: flex; align-items: center; gap: 4px; }
.stepper .ctl button { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line-2); background: var(--surface-2); cursor: pointer; font-size: 18px; line-height: 1; }
.stepper .ctl button:hover { border-color: var(--line-3); }
.stepper .ctl output { min-width: 40px; text-align: center; font: 600 18px/1 var(--font-ui); }
.total { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 20px 0 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.total span { color: var(--muted); font-size: 14px; }
.total b { font-size: 20px; letter-spacing: -.01em; }

.devices { list-style: none; margin: 14px 0 0; padding: 0; }
.devices li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.devices li:first-child { border-top: 0; }
.devices .d-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.devices .d-meta { color: var(--faint); font-size: 12.5px; }
.devices .d-this { font: 500 10.5px/1 var(--font-code); text-transform: uppercase; letter-spacing: .08em; color: var(--accent-text); margin-left: 8px; }

@media (min-width: 1600px) {
  .frame { max-width: 1280px; }
  .wide { max-width: 1200px; }
  .title { font-size: 56px; }
}
@media (max-width: 860px) {
  .grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .frame { padding: 0 16px; }
  .top { height: 60px; }
  .who { display: none !important; }
  .main { padding: 24px 0 40px; }
  .title { font-size: 32px; }
  .lede { font-size: 16px; margin-bottom: 24px; }
  .card { padding: 20px; }
  .facts { grid-template-columns: 1fr 1fr; }
  .facts > :last-child:nth-child(odd) { grid-column: 1 / -1; }
  .offers { grid-template-columns: 1fr; }
  .codebox { font-size: 22px; }
  .planname strong { font-size: 26px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
