/* BJ Polygraph — clean professional, white with deep blue accents. Light/dark via [data-theme]. */
:root {
  --bg: #ffffff; --surface: #f5f7fb; --surface-2: #eef2f8; --text: #0f1b33; --muted: #55637d; --border: #dbe2ee;
  --primary: #0b3d91; --primary-600: #1d4ed8; --primary-50: #e8efff; --on-primary: #ffffff;
  /* --gold is used as small text on white AND on --surface / --gold-bg: #8f5a08 keeps ≥ 5.4:1 on all three (WCAG AA). */
  --gold: #8f5a08; --gold-bg: #fdf6e7; --ok: #157347; --ok-bg: #e6f4ec; --warn: #9a5b00; --warn-bg: #fff4e0; --bad: #b42318; --bad-bg: #fdecec; --info: #0b3d91; --info-bg: #e8efff;
  --shadow: 0 1px 2px rgba(15,27,51,.06), 0 12px 32px -20px rgba(11,61,145,.35);
  --radius: 12px; --font: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
[data-theme="dark"] {
  --bg: #0b1220; --surface: #111a2e; --surface-2: #172238; --text: #e7edf8; --muted: #9fb0cc; --border: #22304d;
  --primary: #6d9bff; --primary-600: #8db2ff; --primary-50: #16244a; --on-primary: #0b1220;
  --gold: #e0b45a; --gold-bg: #2b2310; --ok: #5cd39a; --ok-bg: #0f2a1e; --warn: #f2c25b; --warn-bg: #2d2410; --bad: #ff8b80; --bad-bg: #3a1614; --info: #8db2ff; --info-bg: #16244a;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 12px 32px -20px rgba(0,0,0,.8);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font); color: var(--text); background: var(--bg); line-height: 1.55; font-size: 16px; overflow-x: hidden; }
img, svg { max-width: 100%; }
a { color: var(--primary); }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -0.02em; line-height: 1.15; }
p { margin: 0; }
.price, .money { white-space: nowrap; font-variant-numeric: tabular-nums; }
.num { font-variant-numeric: tabular-nums; }
.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.tiny { font-size: .75rem; }
.eyebrow { font-size: .72rem; font-weight: 700; letter-spacing: .22em; text-transform: uppercase; color: var(--gold); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.hidden { display: none !important; }

/* Buttons & inputs — touch targets ≥ 44px */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 18px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg); color: var(--text); font-weight: 600; cursor: pointer; text-decoration: none; transition: background .15s, border-color .15s, transform .05s, box-shadow .15s; }
.btn:hover { border-color: var(--primary); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary) 45%, transparent); outline-offset: 2px; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.btn-primary:hover { background: var(--primary-600); border-color: var(--primary-600); }
.btn-gold { background: var(--gold); border-color: var(--gold); color: #fff; }
[data-theme="dark"] .btn-gold { color: #0b1220; }
.btn-danger { background: var(--bad); border-color: var(--bad); color: #fff; }
[data-theme="dark"] .btn-danger { color: #0b1220; }
.btn-ghost { background: transparent; }
.btn-sm { min-height: 36px; padding: 6px 12px; font-size: .875rem; border-radius: 8px; }
.btn-lg { min-height: 52px; padding: 14px 26px; font-size: 1.05rem; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn-block { width: 100%; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.input, input.input, select.input, textarea.input { width: 100%; min-height: 44px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg); color: var(--text); }
.input:focus { border-color: var(--primary); }
textarea.input { min-height: 96px; resize: vertical; }
.help { font-size: .8rem; color: var(--muted); }
.error-text { color: var(--bad); font-size: .875rem; }
.check { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); cursor: pointer; }
.check input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--primary); flex: none; }

/* Modal dialogs (confirm / prompt) — <dialog> + showModal(), never native alert/confirm/prompt */
dialog.dialog { border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg); color: var(--text); padding: 0; width: min(92vw, 460px); box-shadow: var(--shadow); }
dialog.dialog::backdrop { background: rgba(6, 20, 52, .55); backdrop-filter: blur(2px); }
.dialog-body { padding: 22px; display: grid; gap: 14px; }
.dialog-body h2 { font-size: 1.25rem; }

/* Layout primitives */
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 960px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }
.card { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.card.flat { box-shadow: none; }
.card-surface { background: var(--surface); }
.section { padding: 72px 0; }
.section-tight { padding: 40px 0; }
.section-head { display: flex; flex-direction: column; gap: 10px; margin-bottom: 32px; }
.section-head h2 { font-size: clamp(1.75rem, 3vw, 2.4rem); }
.pulse { height: 2px; background: linear-gradient(90deg, var(--primary), var(--gold), transparent); width: 96px; border-radius: 2px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; border: 1px solid transparent; white-space: nowrap; }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.b-info { color: var(--info); background: var(--info-bg); }
.b-ok { color: var(--ok); background: var(--ok-bg); }
.b-warn { color: var(--warn); background: var(--warn-bg); }
.b-bad { color: var(--bad); background: var(--bad-bg); }
.b-gold { color: var(--gold); background: var(--gold-bg); }
.b-muted { color: var(--muted); background: var(--surface-2); }
.badge .icon-btn-inline { border: 0; background: none; color: inherit; cursor: pointer; min-width: 24px; min-height: 24px; display: inline-flex; align-items: center; justify-content: center; padding: 0; border-radius: 50%; }
.badge .icon-btn-inline:hover { background: color-mix(in srgb, currentColor 15%, transparent); }
.notice { padding: 12px 14px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); font-size: .9rem; }
.notice.ok { border-color: color-mix(in srgb, var(--ok) 40%, transparent); background: var(--ok-bg); }
.notice.warn { border-color: color-mix(in srgb, var(--warn) 40%, transparent); background: var(--warn-bg); }
.notice.bad { border-color: color-mix(in srgb, var(--bad) 40%, transparent); background: var(--bad-bg); }
.divider { height: 1px; background: var(--border); }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: .9rem; min-width: 640px; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); background: var(--surface); }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; font-size: .92rem; }
.kv dt { color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; padding-top: 3px; }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.skeleton { background: linear-gradient(90deg, var(--surface) 25%, var(--surface-2) 50%, var(--surface) 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: 8px; min-height: 18px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 12px 18px; border-radius: 10px; font-weight: 600; z-index: 100; box-shadow: var(--shadow); max-width: calc(100vw - 32px); }

/* Customer app chrome */
.topbar { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.topbar .container { display: flex; align-items: center; gap: 18px; min-height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-weight: 800; letter-spacing: -0.02em; }
.brand img { height: 36px; width: auto; }
.brand small { display: block; font-size: .62rem; letter-spacing: .25em; text-transform: uppercase; color: var(--gold); font-weight: 700; }
.nav { display: flex; gap: 4px; margin-left: auto; align-items: center; }
.nav a { padding: 10px 12px; border-radius: 8px; text-decoration: none; color: var(--muted); font-weight: 600; min-height: 44px; display: inline-flex; align-items: center; }
.nav a:hover, .nav a.active { color: var(--primary); background: var(--primary-50); }
/* The nav CTA is a primary button: keep white-on-blue regardless of the generic .nav a colour above. */
.nav a.btn-primary { color: var(--on-primary); background: var(--primary); border-color: var(--primary); }
.nav a.btn-primary:hover, .nav a.btn-primary.active { color: var(--on-primary); background: var(--primary-600); border-color: var(--primary-600); }
.icon-btn { width: 44px; height: 44px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.menu-btn { display: none; }
@media (max-width: 900px) {
  .nav { display: none; position: absolute; top: 68px; left: 0; right: 0; flex-direction: column; align-items: stretch; background: var(--bg); border-bottom: 1px solid var(--border); padding: 12px 20px 16px; gap: 4px; }
  .nav.open { display: flex; }
  .menu-btn { display: inline-flex; margin-left: auto; }
  .topbar .icon-btn.theme { margin-left: 0; }
}
.hero { position: relative; min-height: 78vh; display: flex; align-items: center; color: #fff; background: #0b1c3a url('/assets/hero-generated.webp') center/cover no-repeat; }
.hero::before { content: ''; position: absolute; inset: 0; background: linear-gradient(100deg, rgba(6,20,52,.94) 0%, rgba(6,20,52,.82) 45%, rgba(6,20,52,.35) 100%); }
.hero .container { position: relative; padding-top: 80px; padding-bottom: 96px; }
.hero h1 { font-size: clamp(3rem, 6.5vw, 5.25rem); line-height: .98; letter-spacing: -0.035em; font-weight: 900; max-width: 14ch; }
.hero h1 span { color: #8db2ff; }
.hero p.lead { margin-top: 24px; max-width: 56ch; font-size: 1.15rem; color: rgba(255,255,255,.85); }
.hero .btn { border-color: rgba(255,255,255,.35); color: #fff; }
.hero .btn-primary { background: #1d4ed8; border-color: #1d4ed8; }
.hero .btn-primary:hover { background: #2f62ee; }
.hero .chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; border: 1px solid rgba(255,255,255,.3); background: rgba(255,255,255,.08); font-size: .74rem; letter-spacing: .18em; text-transform: uppercase; font-weight: 700; }
.hero .chip i { width: 7px; height: 7px; border-radius: 50%; background: #e0b45a; box-shadow: 0 0 0 4px rgba(224,180,90,.25); }
.trust { border-top: 1px solid rgba(255,255,255,.15); background: rgba(6,20,52,.7); position: absolute; left: 0; right: 0; bottom: 0; padding: 12px 0; overflow: hidden; }
.trust .track { display: flex; gap: 48px; white-space: nowrap; width: max-content; animation: marquee 32s linear infinite; font-size: .72rem; letter-spacing: .3em; text-transform: uppercase; color: rgba(255,255,255,.75); font-weight: 700; }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.stat { text-align: center; padding: 20px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.stat b { display: block; font-size: 1.5rem; color: var(--primary); letter-spacing: -0.02em; }
.service-card { display: grid; grid-template-rows: auto auto 1fr auto; gap: 12px; height: 100%; }
.service-card .title-row { display: flex; flex-direction: column; gap: 8px; }
.service-card h3 { font-size: 1.12rem; }
.service-card .price-line { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; border-top: 1px dashed var(--border); padding-top: 12px; }
.service-card .price-line .price { font-size: 1.5rem; font-weight: 800; color: var(--primary); letter-spacing: -0.02em; }
.tier-card { text-align: left; }
.tier-card .price { font-size: 2rem; font-weight: 900; letter-spacing: -0.03em; }
.steps { counter-reset: step; }
.step { position: relative; padding: 22px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg); }
.step::before { counter-increment: step; content: '0' counter(step); font-size: .74rem; font-weight: 800; letter-spacing: .2em; color: var(--gold); }
.step h3 { margin-top: 10px; font-size: 1.05rem; }
.footer { border-top: 1px solid var(--border); background: var(--surface); padding: 56px 0 28px; margin-top: 40px; }
.footer .cols { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 32px; }
@media (max-width: 800px) { .footer .cols { grid-template-columns: 1fr; } }
.footer h4 { font-size: .72rem; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; }
.footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.footer a { color: var(--text); text-decoration: none; }
.footer .legal { margin-top: 32px; padding-top: 18px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: .8rem; color: var(--muted); }
.stamp { display: inline-block; padding: 4px 10px; border: 1px solid color-mix(in srgb, var(--gold) 55%, transparent); color: var(--gold); border-radius: 6px; font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; font-weight: 800; }

/* Wizard */
.stepper { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-bottom: 24px; }
.stepper div { text-align: center; font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding-top: 10px; border-top: 3px solid var(--border); }
.stepper div.done { border-color: var(--gold); color: var(--gold); }
.stepper div.active { border-color: var(--primary); color: var(--primary); font-weight: 800; }
.choice { text-align: left; padding: 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); cursor: pointer; display: grid; gap: 6px; min-height: 44px; width: 100%; }
.choice:hover { border-color: var(--primary); }
.choice.selected { border-color: var(--primary); background: var(--primary-50); box-shadow: 0 0 0 1px var(--primary) inset; }
.choice .price { font-weight: 800; color: var(--primary); }
.days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
@media (max-width: 560px) { .days { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.day { padding: 8px 4px; border: 1px solid var(--border); border-radius: 8px; text-align: center; cursor: pointer; background: var(--bg); min-height: 56px; }
.day small { display: block; font-size: .66rem; text-transform: uppercase; color: var(--muted); }
.day b { display: block; font-size: 1.05rem; }
.day.selected { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.day.selected small { color: color-mix(in srgb, var(--on-primary) 75%, transparent); }
.day[disabled] { opacity: .35; cursor: not-allowed; }
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.slot { min-height: 44px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); cursor: pointer; font-weight: 700; }
.slot.selected { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.review-row { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.review-row:last-child { border-bottom: 0; }
.review-row span:first-child { color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; flex: none; padding-top: 3px; }
.review-row span:last-child { text-align: right; overflow-wrap: anywhere; }
.total-box { border: 1px solid color-mix(in srgb, var(--gold) 50%, transparent); background: var(--gold-bg); border-radius: var(--radius); padding: 18px; display: grid; grid-template-columns: 1fr auto; gap: 8px 16px; align-items: end; }
.total-box .big { font-size: 1.9rem; font-weight: 900; color: var(--gold); letter-spacing: -0.03em; }

/* Admin console chrome */
.admin { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.sidebar { background: var(--surface); border-right: 1px solid var(--border); padding: 18px 14px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 6px; }
.sidebar .brand { padding: 6px 8px 16px; }
.sidebar a.navlink { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: 10px; text-decoration: none; color: var(--muted); font-weight: 600; min-height: 44px; }
.sidebar a.navlink:hover { background: var(--surface-2); color: var(--text); }
.sidebar a.navlink.active { background: var(--primary-50); color: var(--primary); }
.sidebar .foot { margin-top: auto; display: grid; gap: 8px; font-size: .8rem; color: var(--muted); }
.admin-main { padding: 26px 28px 60px; min-width: 0; }
.admin-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.admin-head h1 { font-size: 1.9rem; }
.kpi { padding: 18px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg); box-shadow: var(--shadow); }
.kpi span { font-size: .72rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
.kpi b { display: block; font-size: 1.8rem; letter-spacing: -0.03em; margin-top: 6px; }
.split { display: grid; grid-template-columns: 5fr 7fr; gap: 20px; }
.list { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.list button { text-align: left; padding: 14px; background: var(--bg); border: 0; border-bottom: 1px solid var(--border); border-left: 3px solid transparent; cursor: pointer; display: grid; gap: 4px; }
.list button:hover { background: var(--surface); }
.list button.active { background: var(--primary-50); border-left-color: var(--primary); }
.mobile-tabs { display: none; }
@media (max-width: 900px) {
  .admin { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 10px 14px; gap: 6px; }
  .sidebar .brand { padding: 4px 6px; width: 100%; }
  .sidebar a.navlink { padding: 8px 10px; font-size: .85rem; }
  .sidebar .foot { width: 100%; margin-top: 4px; flex-direction: row; }
  .split { grid-template-columns: 1fr; }
  .admin-main { padding: 18px 16px 60px; }
  .hero { min-height: 70vh; }
  .section { padding: 48px 0; }
}
