/*
  © 2026 California Bathrooms, Inc. / RiskLogic™. All rights reserved.
  PROPRIETARY & CONFIDENTIAL — Owner: Bill Thompson (RiskLogic / California Bathrooms, Inc.).
  Unauthorized copying, modification, distribution, reverse-engineering, or use of this
  file or its scoring logic, content, or design — in whole or in part — is prohibited.
  Trademarks: RiskLogic™, Crafted to Zero™, Net-Zero Bathroom™, Path to Net Zero™.
  Tracked in the RiskLogic git repo and listed in CHECKSUMS.sha256 — any change is detectable.
  Permissions/notices: bthompson@calibathrooms.com
*/
/* ============================================================
   RiskLogic — shared design system
   One stylesheet for the landing page + all city calculators.
   Per-character accent is injected via the --accent / --accent-soft
   CSS variables set on <body data-character="...">.
   ============================================================ */

:root {
  --navy: #0A2540;
  --deep: #103A5C;
  --teal: #0E9488;
  --aqua: #14B8A6;
  --ghost: #ECFDF8;
  --white: #FFFFFF;
  --warm: #F8FAFC;
  --text: #1E293B;
  --muted: #64748B;
  --line: #E2E8F0;
  --gold: #C9A227;
  --goldsoft: #FBF3D9;
  --green: #10B981;
  --amber: #F59E0B;
  --orange: #EA580C;
  --red: #E11D48;

  /* Defaults; overridden per character below */
  --accent: #14B8A6;
  --accent-soft: #ECFDF8;
  --grad-a: #0A2540;
  --grad-b: #0E4F5C;

  --serif: 'DM Serif Display', Georgia, serif;
  --sans: 'Instrument Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ---- Per-character theming ----------------------------------- */
body[data-character="nate"]    { --accent:#14B8A6; --accent-soft:#E6FBF7; --grad-a:#06314A; --grad-b:#0E6E72; }
body[data-character="carl"]    { --accent:#3B82F6; --accent-soft:#EAF2FF; --grad-a:#0B2545; --grad-b:#1E4E8C; }
body[data-character="charlie"] { --accent:#F59E0B; --accent-soft:#FFF6E5; --grad-a:#3A2606; --grad-b:#7A4F12; }
body[data-character="kai"]     { --accent:#10B981; --accent-soft:#E7FBF1; --grad-a:#053D2E; --grad-b:#0E7A5A; }
body[data-character="paula"]   { --accent:#EA580C; --accent-soft:#FFF0E8; --grad-a:#3A1505; --grad-b:#8A3310; }
body[data-character="sam"]     { --accent:#64748B; --accent-soft:#EEF1F5; --grad-a:#1E293B; --grad-b:#475569; }

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: var(--sans);
  color: var(--text);
  background: linear-gradient(160deg, var(--grad-a) 0%, var(--grad-b) 100%);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ============================================================
   CALCULATOR SHELL
   ============================================================ */
.rl-stage {
  display: flex; align-items: flex-start; justify-content: center;
  padding: 32px 16px;
}
.calculator { width: 100%; max-width: 620px; position: relative; }

.brandbar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 18px; padding: 0 4px;
}
.brandbar .logo { color: var(--white); font-family: var(--serif); font-size: 20px; letter-spacing: .2px; }
.brandbar .logo span { color: var(--accent); }
.brandbar .city {
  color: #fff; font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 1.4px;
  background: rgba(255,255,255,.08); padding: 6px 12px; border-radius: 999px;
  border: 1px solid rgba(255,255,255,.14);
}

.progress-bar {
  width: 100%; height: 5px; background: rgba(255,255,255,0.12);
  border-radius: 4px; margin-bottom: 22px; overflow: hidden;
}
.progress-fill {
  height: 100%; background: linear-gradient(90deg, var(--accent), var(--aqua));
  border-radius: 4px; transition: width 0.45s ease; width: 0%;
}

.calc-card {
  background: var(--white); border-radius: 22px; padding: 40px 34px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.35); position: relative; overflow: hidden;
}
@media (max-width: 480px) { .calc-card { padding: 30px 22px; } }

.step { display: none; animation: fadeIn 0.35s ease-out; }
.step.active { display: block; }
@keyframes fadeIn { from { opacity:0; transform: translateY(12px); } to { opacity:1; transform: translateY(0); } }

.charchip { display:flex; align-items:center; gap:12px; margin-bottom:16px; }
.charchip img { width:46px; height:46px; border-radius:50%; border:2px solid var(--accent-soft); }
.charchip .who { font-size:13px; color:var(--muted); line-height:1.3; }
.charchip .who b { color:var(--navy); display:block; font-size:14.5px; }

.eyebrow {
  font-size: 12px; font-weight: 700; color: var(--accent);
  text-transform: uppercase; letter-spacing: 1.6px; margin-bottom: 12px;
}
.step-count { font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 8px; }
h1 { font-family: var(--serif); font-size: 30px; line-height: 1.15; color: var(--navy); margin-bottom: 14px; font-weight: 400; }
h2 { font-family: var(--serif); font-size: 25px; line-height: 1.2; color: var(--navy); margin-bottom: 12px; font-weight: 400; }
.lede { font-size: 16px; line-height: 1.55; color: var(--muted); margin-bottom: 26px; }
.question { font-size: 19px; font-weight: 600; color: var(--navy); margin-bottom: 6px; }
.qhint { font-size: 14px; color: var(--muted); margin-bottom: 20px; line-height: 1.5; }

.options { display: flex; flex-direction: column; gap: 10px; margin-bottom: 8px; }
.opt {
  display: flex; align-items: center; gap: 14px;
  border: 1.5px solid var(--line); border-radius: 13px;
  padding: 16px 18px; cursor: pointer; transition: all .18s ease; background: var(--white);
}
.opt:hover { border-color: var(--accent); background: var(--accent-soft); }
.opt.selected { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 3px rgba(20,184,166,.14); }
.opt .dot { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line); flex-shrink: 0; position: relative; transition: all .18s; }
.opt.selected .dot { border-color: var(--accent); }
.opt.selected .dot::after { content:''; position:absolute; inset:3px; border-radius:50%; background: var(--accent); }
.opt.check .dot { border-radius: 6px; }
.opt.check.selected .dot::after { border-radius: 3px; }
.opt .label { font-size: 15.5px; font-weight: 500; color: var(--text); line-height: 1.35; }

.input-group { margin-bottom: 14px; }
.input-group label { display: block; font-size: 13px; font-weight: 600; color: var(--navy); margin-bottom: 6px; }
.input-group input {
  width: 100%; padding: 14px 16px; border: 1.5px solid var(--line);
  border-radius: 12px; font-size: 16px; font-family: var(--sans); color: var(--text); transition: border .18s;
}
.input-group input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(20,184,166,.12); }

.btn {
  width: 100%; padding: 17px; border: none; border-radius: 13px;
  font-size: 16px; font-weight: 700; font-family: var(--sans); cursor: pointer;
  transition: all .2s ease; margin-top: 18px;
}
.btn-primary { background: var(--navy); color: var(--white); }
.btn-primary:hover { background: var(--deep); transform: translateY(-1px); }
.btn-primary:disabled { background: #CBD5E1; cursor: not-allowed; transform: none; }
.btn-gold { background: var(--gold); color: var(--navy); }
.btn-gold:hover { background: #B8941F; transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--muted); font-weight: 600; padding: 12px; margin-top: 8px; }
.btn-ghost:hover { color: var(--navy); }

.back-link { font-size: 14px; color: var(--muted); cursor: pointer; font-weight: 600; padding: 8px 0; display: inline-block; }
.back-link:hover { color: var(--navy); }

.factbox {
  background: var(--accent-soft); border-left: 3px solid var(--accent);
  border-radius: 10px; padding: 14px 16px; margin: 18px 0 6px; font-size: 13.5px; line-height: 1.5; color: var(--deep);
}
.factbox strong { color: var(--navy); }

/* ---- RESULT ------------------------------------------------- */
.gauge-wrap { text-align: center; margin: 6px 0 22px; }
.score-num { font-family: var(--serif); font-size: 56px; line-height: 1; color: var(--navy); }
.score-of { font-size: 14px; color: var(--muted); font-weight: 600; }
.tier-badge {
  display: inline-block; padding: 7px 18px; border-radius: 999px;
  font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; margin-top: 6px;
}
.drivers { margin: 22px 0; }
.driver {
  display: flex; gap: 13px; align-items: flex-start;
  padding: 14px 0; border-bottom: 1px solid var(--line);
}
.driver:last-child { border-bottom: none; }
.driver .ic { width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 15px; }
.driver .dt { font-size: 15px; font-weight: 700; color: var(--navy); margin-bottom: 2px; }
.driver .dd { font-size: 13.5px; color: var(--muted); line-height: 1.5; }

/* ---- Neighborhood comparison -------------------------------- */
.nbhd { margin: 24px 0; }
.nbhd-title { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.2px; color: var(--muted); margin-bottom: 14px; }
.nbhd-row { display: grid; grid-template-columns: 120px 1fr 42px; align-items: center; gap: 10px; margin-bottom: 10px; }
.nbhd-row .nm { font-size: 13px; font-weight: 600; color: var(--navy); }
.nbhd-row .nm small { display:block; font-weight:500; color:var(--muted); font-size:11px; }
.nbhd-bar { height: 12px; background: var(--line); border-radius: 999px; overflow: hidden; }
.nbhd-bar > span { display: block; height: 100%; border-radius: 999px; transition: width .8s ease; }
.nbhd-row .pct { font-size: 13px; font-weight: 700; text-align: right; color: var(--navy); }
.nbhd-row.you .nm { color: var(--accent); }
.nbhd-row.you .pct { color: var(--accent); }

.exposure {
  background: linear-gradient(135deg, var(--navy), var(--deep));
  border-radius: 16px; padding: 22px 24px; margin: 22px 0; color: var(--white); text-align: center;
}
.exposure .x-label { font-size: 12px; text-transform: uppercase; letter-spacing: 1.4px; color: var(--accent); font-weight: 700; margin-bottom: 8px; }
.exposure .x-num { font-family: var(--serif); font-size: 34px; line-height: 1.1; margin-bottom: 8px; }
.exposure .x-sub { font-size: 13px; color: #CBD5E1; line-height: 1.5; }

.ctz {
  background: var(--goldsoft); border: 1px solid #EBDDA8; border-radius: 14px;
  padding: 20px 22px; margin: 22px 0;
}
.ctz .ctz-title { font-family: var(--serif); font-size: 20px; color: var(--navy); margin-bottom: 8px; }
.ctz .ctz-title span { color: var(--gold); }
.ctz p { font-size: 14px; line-height: 1.55; color: var(--deep); }

.disclaimer { font-size: 11.5px; color: #94A3B8; line-height: 1.5; margin-top: 16px; text-align: center; }

.footer { text-align: center; margin-top: 18px; color: rgba(255,255,255,.65); font-size: 12px; line-height: 1.6; }
.footer strong { color: rgba(255,255,255,.9); }
.footer a { color: rgba(255,255,255,.8); }

.spinner { width: 22px; height: 22px; border: 3px solid rgba(255,255,255,.3); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   CROSS-CITY COMPARISON POP-UP
   ============================================================ */
.xcity-overlay {
  position: fixed; inset: 0; z-index: 800; background: rgba(8,18,30,.72);
  display: none; align-items: center; justify-content: center; padding: 22px;
  animation: fadeIn .25s ease-out;
}
.xcity-overlay.open { display: flex; }
.xcity-card {
  background: var(--white); border-radius: 20px; max-width: 420px; width: 100%;
  padding: 30px 28px; text-align: center; position: relative;
  box-shadow: 0 30px 80px rgba(0,0,0,.5);
}
.xcity-card .xclose {
  position: absolute; top: 14px; right: 16px; font-size: 22px; color: var(--muted);
  cursor: pointer; line-height: 1; background: none; border: none;
}
.xcity-card .xavatar { width: 92px; height: 92px; border-radius: 50%; margin: 0 auto 14px; display:block; border: 3px solid var(--accent-soft); }
.xcity-card .xeyebrow { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.4px; color: var(--accent); margin-bottom: 8px; }
.xcity-card h3 { font-family: var(--serif); font-size: 23px; color: var(--navy); margin-bottom: 10px; font-weight: 400; }
.xcity-card p { font-size: 14.5px; line-height: 1.55; color: var(--muted); margin-bottom: 20px; }
.xcity-card .xrisk { font-weight: 700; color: var(--navy); }

/* ============================================================
   LANDING PAGE
   ============================================================ */
.hero { max-width: 1080px; margin: 0 auto; padding: 64px 22px 30px; text-align: center; color: #fff; }
.hero .logo { font-family: var(--serif); font-size: 30px; margin-bottom: 22px; }
.hero .logo span { color: var(--aqua); }
.hero h1 { font-family: var(--serif); font-size: 46px; line-height: 1.08; color: #fff; margin-bottom: 18px; font-weight: 400; }
@media (max-width:600px){ .hero h1 { font-size: 33px; } }
.hero p { font-size: 18px; line-height: 1.6; color: #CBD5E1; max-width: 640px; margin: 0 auto 8px; }

.grid {
  max-width: 1080px; margin: 0 auto; padding: 20px 22px 80px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px;
}
.ccard {
  background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.12);
  border-radius: 18px; padding: 26px 24px; color: #fff; text-decoration: none;
  display: block; transition: transform .2s ease, background .2s ease, border-color .2s;
}
.ccard:hover { transform: translateY(-3px); background: rgba(255,255,255,.07); border-color: rgba(255,255,255,.28); }
.ccard .top { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.ccard img { width: 60px; height: 60px; border-radius: 50%; border: 2px solid rgba(255,255,255,.2); }
.ccard .nm { font-family: var(--serif); font-size: 21px; }
.ccard .loc { font-size: 12.5px; color: #94A3B8; text-transform: uppercase; letter-spacing: 1px; font-weight: 600; }
.ccard .risk { font-size: 14.5px; color: #CBD5E1; line-height: 1.5; margin-bottom: 16px; }
.ccard .links { display: flex; flex-wrap: wrap; gap: 8px; }
.ccard .pill {
  font-size: 12px; font-weight: 600; color: #fff; background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.18); padding: 7px 13px; border-radius: 999px;
}
.land-footer { text-align: center; color: rgba(255,255,255,.55); font-size: 12.5px; line-height: 1.7; padding: 0 22px 60px; max-width: 760px; margin: 0 auto; }
.land-footer a { color: rgba(255,255,255,.75); }
