/* ODC design system: one stylesheet for the public site, the app and admin.
   Principles (docs/portal-plan.md §8): neutral ink on white, ONE action colour
   (teal) used only on things you press, status colours only for status, no
   gradients, hairline cards, 8px grid, works at 360px, dark mode via tokens. */

:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --subtle: #f6f7f9;
  --ink: #111827;
  --muted: #5b6472;
  --faint: #8a93a1;
  --line: #e5e7eb;
  --line-strong: #d1d5db;
  --action: #0f766e;
  --action-ink: #ffffff;
  --action-hover: #0d6560;
  --action-soft: #e6f4f2;
  --ok: #15803d;      --ok-soft: #e8f5ec;
  --warn: #b45309;    --warn-soft: #fdf3e2;
  --danger: #b91c1c;  --danger-soft: #fdecec;
  --info: #1d4ed8;    --info-soft: #eaf0fd;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(17, 24, 39, .04);
  --focus: 0 0 0 3px rgba(15, 118, 110, .35);
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0f14; --surface: #11161d; --subtle: #151b23; --ink: #e8ebef; --muted: #a3acb9; --faint: #7d8794;
    --line: #232b36; --line-strong: #2f3946; --action: #2bb3a3; --action-ink: #06201d; --action-hover: #3cc4b4; --action-soft: #10302c;
    --ok: #4ade80; --ok-soft: #10261a; --warn: #fbbf24; --warn-soft: #2a2110; --danger: #f87171; --danger-soft: #2c1414; --info: #93b4ff; --info-soft: #141d33;
  }
}
:root[data-theme="dark"] {
  --bg: #0b0f14; --surface: #11161d; --subtle: #151b23; --ink: #e8ebef; --muted: #a3acb9; --faint: #7d8794;
  --line: #232b36; --line-strong: #2f3946; --action: #2bb3a3; --action-ink: #06201d; --action-hover: #3cc4b4; --action-soft: #10302c;
  --ok: #4ade80; --ok-soft: #10261a; --warn: #fbbf24; --warn-soft: #2a2110; --danger: #f87171; --danger-soft: #2c1414; --info: #93b4ff; --info-soft: #141d33;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.6 var(--font); font-feature-settings: 'cv11', 'ss01'; }
img, svg { max-width: 100%; display: block; }
a { color: var(--action); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 12px; letter-spacing: -0.01em; }
h1 { font-size: clamp(30px, 5vw, 48px); font-weight: 700; }
h2 { font-size: clamp(22px, 3vw, 30px); font-weight: 700; }
h3 { font-size: 17px; font-weight: 600; }
p { margin: 0 0 12px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 13px; }
.num { font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 6px; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 560px; margin: 0 auto; }
.stack > * + * { margin-top: 16px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

/* Header & footer */
.topbar { border-bottom: 1px solid var(--line); background: var(--surface); position: sticky; top: 0; z-index: 10; }
.topbar .container { display: flex; align-items: center; justify-content: space-between; height: 60px; gap: 12px; }
.brand { font-weight: 700; font-size: 18px; color: var(--ink); display: flex; align-items: center; gap: 8px; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 26px; height: 26px; border-radius: 7px; background: var(--ink); color: var(--bg); display: grid; place-items: center; font-size: 13px; font-weight: 800; }
.nav { display: flex; gap: 20px; align-items: center; }
.nav a { color: var(--muted); font-weight: 500; }
.nav a:hover, .nav a.active { color: var(--ink); text-decoration: none; }
@media (max-width: 720px) { .nav .hide-sm { display: none; } }
.footer { border-top: 1px solid var(--line); margin-top: 80px; padding: 32px 0; color: var(--muted); font-size: 13px; }
.footer .row { gap: 20px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font: 600 14px var(--font); cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { background: var(--subtle); text-decoration: none; }
.btn-primary { background: var(--action); border-color: var(--action); color: var(--action-ink); }
.btn-primary:hover { background: var(--action-hover); border-color: var(--action-hover); }
.btn-danger { color: var(--danger); border-color: var(--danger); background: transparent; }
.btn-danger:hover { background: var(--danger-soft); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn-lg { min-height: 48px; padding: 0 22px; font-size: 15px; }
.btn-block { width: 100%; }
.btn[disabled], .btn.loading { opacity: .6; cursor: not-allowed; }

/* Cards */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.card-tight { padding: 16px; }
.card h3 { margin-bottom: 8px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; }
.divider { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }

/* Forms */
label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 6px; }
.field { margin-bottom: 16px; }
.hint { font-size: 12px; color: var(--muted); margin-top: 6px; }
.err { font-size: 13px; color: var(--danger); margin-top: 6px; }
input, select, textarea { width: 100%; min-height: 42px; padding: 9px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink); font: 15px var(--font); }
textarea { min-height: 120px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--action); box-shadow: var(--focus); }
.input-group { display: flex; align-items: stretch; }
.input-group input { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.input-addon { display: flex; align-items: center; padding: 0 12px; border: 1px solid var(--line-strong); border-left: 0; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; background: var(--subtle); color: var(--muted); font-size: 14px; white-space: nowrap; }
.code-input { font-size: 26px; letter-spacing: 10px; text-align: center; font-variant-numeric: tabular-nums; }

/* Choice tiles (bundles, plans) */
.tiles { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.tile { border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 16px; cursor: pointer; background: var(--surface); text-align: left; font: inherit; color: inherit; }
.tile:hover { border-color: var(--action); }
.tile[aria-pressed="true"] { border-color: var(--action); box-shadow: inset 0 0 0 1px var(--action); background: var(--action-soft); }
.tile strong { display: block; margin-bottom: 4px; }

/* Status */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--subtle); color: var(--muted); }
.pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.danger { background: var(--danger-soft); color: var(--danger); }
.pill.info { background: var(--info-soft); color: var(--info); }
.banner { border-radius: var(--radius-sm); padding: 12px 16px; display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; font-size: 14px; }
.banner.info { background: var(--info-soft); color: var(--info); }
.banner.warning { background: var(--warn-soft); color: var(--warn); }
.banner.danger { background: var(--danger-soft); color: var(--danger); }
.banner.ok { background: var(--ok-soft); color: var(--ok); }
.banner a { color: inherit; font-weight: 600; text-decoration: underline; }

/* Meters */
.meter { height: 8px; border-radius: 99px; background: var(--subtle); overflow: hidden; border: 1px solid var(--line); }
.meter > span { display: block; height: 100%; background: var(--action); width: 0; }
.meter.warn > span { background: var(--warn); }
.meter.danger > span { background: var(--danger); }
.stat { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 6px; }

/* Public site */
.hero { padding: 72px 0 48px; }
.hero p.lead { font-size: 19px; color: var(--muted); max-width: 640px; }
.section { padding: 56px 0; }
.section-head { max-width: 680px; margin-bottom: 28px; }
.kicker { font-size: 13px; font-weight: 600; color: var(--action); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 8px; }
.steps { counter-reset: step; }
.steps .card::before { counter-increment: step; content: counter(step); display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--action-soft); color: var(--action); font-weight: 700; margin-bottom: 12px; }
.app-chip { display: flex; gap: 10px; align-items: flex-start; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.app-chip small { display: block; color: var(--muted); }
.check-list { list-style: none; padding: 0; margin: 12px 0 0; }
.check-list li { padding-left: 24px; position: relative; margin-bottom: 8px; font-size: 14px; }
.check-list li::before { content: '✓'; position: absolute; left: 0; color: var(--action); font-weight: 700; }

/* Pricing */
.toggle { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 999px; padding: 3px; background: var(--surface); }
.toggle button { border: 0; background: transparent; color: var(--muted); font: 600 13px var(--font); padding: 6px 14px; border-radius: 999px; cursor: pointer; }
.toggle button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.price-card { display: flex; flex-direction: column; }
.price-card.featured { border-color: var(--action); box-shadow: inset 0 0 0 1px var(--action); }
.price { font-size: 36px; font-weight: 700; letter-spacing: -0.02em; }
.price small { font-size: 14px; font-weight: 500; color: var(--muted); }
.price-card .check-list { flex: 1; }
.badge { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: var(--action-soft); color: var(--action); text-transform: uppercase; letter-spacing: .04em; }

/* Tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: var(--subtle); font-weight: 600; }
tr:last-child td { border-bottom: 0; }

/* FAQ */
details { border-bottom: 1px solid var(--line); padding: 16px 0; }
summary { cursor: pointer; font-weight: 600; list-style: none; }
summary::-webkit-details-marker { display: none; }
summary::after { content: '+'; float: right; color: var(--muted); }
details[open] summary::after { content: '–'; }
details p { margin-top: 10px; color: var(--muted); }

/* App shell */
.app-main { padding: 32px 0 48px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 24px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 24px; overflow-x: auto; }
.tabs a { padding: 10px 14px; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a:hover { text-decoration: none; color: var(--ink); }
.tabs a.active { color: var(--ink); border-bottom-color: var(--ink); }
.progress-list { list-style: none; padding: 0; margin: 0; }
.progress-list li { padding: 10px 0; display: flex; gap: 10px; align-items: center; border-bottom: 1px solid var(--line); }
.progress-list li:last-child { border-bottom: 0; }
.dot { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line-strong); flex: none; }
.dot.done { background: var(--ok); border-color: var(--ok); }
.dot.active { border-color: var(--action); border-top-color: transparent; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .dot.active { animation: none; } }
.stepper { display: flex; align-items: center; gap: 0; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); overflow: hidden; width: max-content; }
.stepper button { width: 40px; height: 40px; border: 0; background: var(--subtle); color: var(--ink); font-size: 18px; cursor: pointer; }
.stepper output { min-width: 48px; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: var(--radius-sm); font-size: 14px; z-index: 50; max-width: calc(100% - 32px); }
.empty { text-align: center; padding: 48px 16px; color: var(--muted); }
.skeleton { background: var(--subtle); border-radius: var(--radius-sm); min-height: 18px; }
.legal { max-width: 760px; }
.legal h2 { margin-top: 32px; font-size: 20px; }
