:root {
  --ink: #101828; --body: #344054; --muted: #5b6577;
  --line: #e2e8f0; --line-strong: #d0d5dd; --ground: #f5f7fa;
  --accent: #274a8c; --accent-hover: #1e3a70;
  --ok: #166534; --ok-bg: #ecfdf3;
  --bad: #991b1b; --bad-bg: #fef2f2; --bad-line: #fecaca; --bad-detail: #7f1d1d;
  --radius: 8px;
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.5 "Public Sans", system-ui, sans-serif; color: var(--ink); background: var(--ground); }
h1, h2 { margin: 0; font-family: Sora, "Public Sans", sans-serif; font-weight: 600; line-height: 1.2; }
h1 { font-size: 26px; }
h1.h-small { font-size: 20px; }
h2 { font-size: 22px; }
p { margin: 0; }
a { color: var(--accent); cursor: pointer; }
code, pre { font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; }
strong { font-weight: 600; color: var(--ink); }
.hidden { display: none !important; }

.topbar { height: 64px; padding: 0 48px; display: flex; align-items: center; justify-content: space-between; background: #fff; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 14px; }
.brand img { height: 20px; width: auto; }
.brand .divider { width: 1px; height: 22px; background: var(--line); }
.brand .product { font-family: Sora, sans-serif; font-weight: 600; font-size: 15px; }
.who { display: flex; align-items: center; gap: 14px; font-size: 13px; color: var(--muted); }
.who a { color: var(--muted); text-decoration: none; font-weight: 500; }

.steps { display: flex; justify-content: center; gap: 40px; padding: 36px 48px 0; }
.step { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); }
.step .dot { width: 28px; height: 28px; border-radius: 999px; border: 1px solid var(--line-strong); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; }
.step .tick { display: none; }
.step.current { color: var(--ink); font-weight: 600; }
.step.current .dot { background: var(--accent); border-color: var(--accent); color: #fff; }
.step.done .dot { background: var(--ok-bg); border-color: var(--ok-bg); color: var(--ok); }
.step.done .n { display: none; }
.step.done .tick { display: block; }
.rule { width: 56px; height: 1px; background: var(--line-strong); align-self: center; }

main { display: flex; flex-direction: column; align-items: center; gap: 20px; padding: 40px 16px 64px; }
.card { width: 100%; max-width: 560px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 40px; display: flex; flex-direction: column; gap: 24px; box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04); }
.card.narrow { max-width: 520px; }
.card.wide { max-width: 640px; padding: 32px; }
.intro { display: flex; flex-direction: column; gap: 8px; }
.lede { color: var(--muted); }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); }

form { display: flex; flex-direction: column; gap: 20px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field.sep { border-top: 1px solid var(--line); padding-top: 16px; margin-top: 4px; }
label { font-size: 13px; font-weight: 500; color: var(--body); }
label .optional { font-weight: 400; color: var(--muted); }
.help { font-size: 12px; line-height: 1.4; color: var(--muted); }
input { width: 100%; height: 44px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: var(--radius); font: inherit; color: var(--ink); background: #fff; }
input::placeholder { color: #98a2b3; }
input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
input.invalid { border-color: #ef4444; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }

button { height: 44px; padding: 0 16px; border: 0; border-radius: var(--radius); background: var(--accent); color: #fff; font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 10px; }
button:hover { background: var(--accent-hover); }
button.secondary { background: #fff; color: var(--ink); border: 1px solid var(--line-strong); font-weight: 500; }
button.secondary:hover { background: var(--ground); }
button.danger { color: var(--bad); }
button.small { height: 36px; padding: 0 14px; font-size: 13px; border-radius: 6px; }
button:disabled { opacity: 0.6; cursor: default; }
.row { display: flex; gap: 12px; }
.row > * { flex: 1; }
.or { display: flex; align-items: center; gap: 12px; font-size: 12px; color: var(--muted); }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.center { text-align: center; font-size: 14px; color: var(--muted); }
.center a { font-weight: 500; }

.fineprint { width: 100%; max-width: 520px; font-size: 13px; line-height: 1.5; color: var(--muted); display: flex; align-items: flex-start; gap: 8px; }
.card .fineprint { font-size: 12px; max-width: none; }
.fineprint svg { flex-shrink: 0; margin-top: 3px; }

#auth-msg:empty, #consent-msg:empty, #status-msg:empty { display: none; }
.msg { padding: 10px 12px; border-radius: var(--radius); font-size: 14px; white-space: pre-wrap; }
.msg.ok { background: var(--ok-bg); color: var(--ok); }
.msg.bad { background: var(--bad-bg); color: var(--bad); }
.alert { display: flex; gap: 12px; padding: 14px 16px; background: var(--bad-bg); border: 1px solid var(--bad-line); border-radius: var(--radius); color: var(--bad); }
.alert svg { flex-shrink: 0; margin-top: 1px; }
.alert .title { font-size: 14px; font-weight: 600; }
.alert .detail { font-size: 13px; line-height: 1.45; color: var(--bad-detail); margin-top: 4px; }

.panel { display: flex; flex-direction: column; gap: 10px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); min-width: 0; }
.panel-title { font-size: 13px; font-weight: 600; color: var(--ink); }
.panel-title.ok { color: var(--ok); }
.panel ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; font-size: 14px; line-height: 1.45; color: var(--body); }
.ticks li, .crosses li { display: flex; gap: 8px; }
.ticks svg, .crosses svg { flex-shrink: 0; margin-top: 2px; }
.ticks svg { color: var(--ok); }
.crosses svg { color: #98a2b3; }
.handoff { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: var(--ground); border-radius: var(--radius); font-size: 13px; color: var(--body); }
.handoff svg { flex-shrink: 0; color: var(--muted); }

.status-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.status-title { display: flex; align-items: center; gap: 12px; }
.badge { width: 32px; height: 32px; border-radius: 999px; background: var(--ok-bg); color: var(--ok); display: flex; align-items: center; justify-content: center; }
.actions { display: flex; gap: 8px; }
.facts { margin: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.facts > div { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.facts dt { font-size: 12px; color: var(--muted); }
.facts dd { margin: 0; font-size: 14px; font-weight: 500; overflow-wrap: anywhere; }

.urlbox { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 14px; background: var(--ground); border: 1px solid var(--line); border-radius: var(--radius); }
.urlbox code { flex-grow: 1; min-width: 0; font-size: 14px; overflow-wrap: anywhere; }
.urlbox button { flex-shrink: 0; }
.clients { display: flex; flex-direction: column; gap: 14px; }
.tabs { display: flex; gap: 4px; padding: 4px; background: var(--ground); border-radius: var(--radius); align-self: flex-start; }
.tab { height: 32px; padding: 0 14px; border-radius: 6px; background: transparent; color: var(--muted); font-size: 13px; font-weight: 500; }
.tab:hover { background: transparent; color: var(--ink); }
.tab[aria-selected="true"] { background: #fff; color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(16, 24, 40, 0.08); }
.tabpanel { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; font-size: 14px; line-height: 1.5; color: var(--body); }
.tabpanel pre { margin: 6px 0 0; padding: 10px 12px; background: var(--ground); border-radius: 6px; overflow-x: auto; white-space: pre-wrap; overflow-wrap: anywhere; }

@media (max-width: 640px) {
  .topbar { padding: 0 16px; }
  .who span { display: none; }
  .steps { gap: 16px; padding: 24px 16px 0; }
  .step:not(.current) .label { display: none; }
  .rule { width: 24px; }
  .card, .card.wide { padding: 24px; }
  .grid2 { grid-template-columns: minmax(0, 1fr); }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
