/**
 * Theme. Every surface, border and text colour in the platform resolves to one
 * of these tokens, so switching the palette switches the whole product.
 * Loaded last; `body.theme-*` beats the per-page :root defaults.
 *
 *  light = "Blue & White" (the current design): white ground, navy accent,
 *          thin gold outlines on cards and buttons, bold text.
 *  dark  = navy variant of the same design (deep blue ground, gold outlines).
 */

:root{
  --goldline:#b8902f; --goldsoft:rgba(184,144,47,.35);
}

/* ── LIGHT: Blue & White ────────────────────────────────────────────────── */
body.theme-light{
  color-scheme:light;
  --bg:#ffffff; --s1:#f5f7fb; --s2:#eef2f8; --s3:#e5ebf4;
  --bd:#d6deea; --bd2:#c3cddd; --dim:#8b98b0;
  --text:#0b2a63; --muted:#3d5784;
  --hair:rgba(18,61,140,0.06);
  --shadow:0 6px 18px rgba(11,42,99,.05);

  --black:#ffffff; --white:#0b2a63;
  --gold:#123d8c; --gold2:#1d4f9e; --gold3:#2b64b8;
  --goldfade:rgba(18,61,140,0.06); --goldbdr:rgba(18,61,140,0.22);
  --silver:#1f3a6b; --silver2:#16305c; --silver3:#0b2a63;
  --silverfade:rgba(31,58,107,0.06); --silverbdr:rgba(31,58,107,0.18);
  --green:#2e7a46; --greenfade:rgba(46,122,70,0.08); --greenbdr:rgba(46,122,70,0.25);
  --red:#a94442; --redfade:rgba(169,68,66,0.07); --redbdr:rgba(169,68,66,0.2);
  --blue:#1d4f9e; --blue2:#2b64b8; --bluefade:rgba(29,79,158,0.08); --bluebdr:rgba(29,79,158,0.22);
  --amber:#8a6a1c; --amberfade:rgba(184,144,47,0.1); --amberbdr:rgba(184,144,47,0.3);
  --purple:#5b3fa0; --purplefade:rgba(91,63,160,0.08);
}

/* ── DARK: navy ─────────────────────────────────────────────────────────── */
:root, body.theme-dark{
  color-scheme:dark;
  --bg:#0a1734; --s1:#0f2147; --s2:#132a58; --s3:#193468;
  --bd:#2a4475; --bd2:#3a568c; --dim:#5e7399;
  --text:#f2f5fb; --muted:#aab9d6;
  --hair:rgba(255,255,255,0.06);
  --shadow:0 6px 18px rgba(0,0,0,.25);

  --black:#0a1734; --white:#f2f5fb;
  --gold:#d8b45a; --gold2:#e6c97a; --gold3:#f0dca0;
  --goldfade:rgba(216,180,90,0.10); --goldbdr:rgba(216,180,90,0.35);
  --silver:#aab9d6; --silver2:#d5deef; --silver3:#f2f5fb;
  --silverfade:rgba(170,185,214,0.08); --silverbdr:rgba(170,185,214,0.22);
  --green:#6fcf97; --greenfade:rgba(111,207,151,0.10); --greenbdr:rgba(111,207,151,0.3);
  --red:#f28b82; --redfade:rgba(242,139,130,0.10); --redbdr:rgba(242,139,130,0.3);
  --blue:#5b8def; --blue2:#7aa4f5; --bluefade:rgba(91,141,239,0.12); --bluebdr:rgba(91,141,239,0.35);
  --amber:#e6c97a; --amberfade:rgba(230,201,122,0.10); --amberbdr:rgba(230,201,122,0.3);
  --purple:#b39ddb; --purplefade:rgba(179,157,219,0.10);
}

/* ── shared: what the tokens alone cannot reach ─────────────────────────── */
body{ background:var(--bg); color:var(--text); font-weight:500; }

.card,.kpi,.insight-card,.borrow-card,.signal-card,.how-step,.mini-db,.test-card,.listing-card,.biz-card,.inv-card{
  border:1.5px solid var(--goldline) !important; box-shadow:var(--shadow); }
.btn-primary,.btn-gold,.btn-gold-nav{ border:2px solid var(--goldline); font-weight:700; }
.btn-ghost,.btn-secondary,.btn-ghost-nav{ border:2px solid var(--goldline); font-weight:700; }
.kpi-val,.card-title{ font-weight:700; }
.nav-logo em,.brand-name span,.brand-logo span,.footer-logo em{ color:var(--goldline) !important; }
.hero-headline,.section-title,.cta-headline{ font-weight:600; }
.hero-headline strong{ font-weight:700; color:var(--gold); }
.hero-sub,.section-sub,.cta-sub{ font-weight:500; }
.nav-link{ font-weight:600; }
.audience-picker{ background:var(--goldline); border:1.5px solid var(--goldline); }
.compare-section,.trust-section,.ticker-wrap{ border-top:2px solid var(--goldline); border-bottom:2px solid var(--goldline); }
.trust-item{ border-right-color:var(--goldsoft); }
nav.scrolled{ border-bottom:2px solid var(--goldline); }
.tick-gold{ background:var(--goldline); }
.sidebar{ background:var(--s1); border-right:1px solid var(--bd); }
.sidebar .brand{ border-bottom:1px solid var(--bd); }
.topbar{ background:var(--s1); border-bottom:1px solid var(--bd); }
.adm-side{ background:var(--s1); border-right:1px solid var(--bd); }
.nav-item.on{ color:var(--gold2); border-left-color:var(--gold); background:var(--goldfade); }
.nav-badge{ background:var(--gold); color:#fff; }
.nav-badge.nav-new{ background:linear-gradient(90deg,var(--gold),var(--gold2)); color:#fff; }
.btn-primary{ background:var(--gold); color:#fff; }
.btn-primary:hover{ background:var(--gold2); }
.btn-ghost{ color:var(--text); background:transparent; }
.btn-ghost:hover{ border-color:var(--gold); color:var(--gold); }
.form-input{ background:var(--s2); border:1.5px solid var(--bd2); color:var(--text); }
.form-input:focus{ border-color:var(--gold); }
.uav{ color:#fff; }
.tick-val{ color:var(--gold2); }
.hero-bg{ background:radial-gradient(ellipse at 50% 0%, var(--goldfade) 0%, transparent 65%); }
.hero-grid-lines{ background-image:linear-gradient(var(--hair) 1px, transparent 1px), linear-gradient(90deg, var(--hair) 1px, transparent 1px); }
nav.scrolled{ background:var(--bg); }
.ticker-wrap{ background:var(--s1); border-color:var(--goldline); }
.sim-banner{ background:var(--amberfade); border-top:1px solid var(--amberbdr); color:var(--amber); }
.score-ring svg circle:first-child,.score-wrap svg circle:first-child{ stroke:var(--hair); }
.fund-tabs button.on{ color:#fff; }
.inv-slider::-webkit-slider-thumb,.ap-slider::-webkit-slider-thumb{ background:var(--gold); box-shadow:0 0 0 3px var(--goldfade); }
body.theme-light nav.scrolled{ background:rgba(255,255,255,0.92); backdrop-filter:blur(16px); }
body.theme-light .btn-primary,body.theme-light .btn-gold-nav{ color:#fff; }
body.theme-light .btn-ghost,body.theme-light .btn-secondary,body.theme-light .btn-ghost-nav{ color:#0b2a63; }
body.theme-dark .btn-ghost,body.theme-dark .btn-secondary,body.theme-dark .btn-ghost-nav{ color:#f2f5fb; }
body.theme-dark .btn-primary,body.theme-dark .btn-gold-nav{ color:#0a1734; }
body.theme-dark .nav-badge{ color:#0a1734; }

/* theme switch in the top bar */
.theme-toggle{ background:transparent; border:1px solid var(--bd2); color:var(--muted); border-radius:20px;
  padding:5px 12px; font-size:12px; font-weight:600; cursor:pointer; text-decoration:none; display:inline-flex;
  align-items:center; gap:.35rem; font-family:var(--font-body); }
.theme-toggle:hover{ border-color:var(--gold); color:var(--gold); }

/* alerts: readable on both grounds */
.al-red{ color:var(--red) !important; } .al-amber{ color:var(--amber) !important; } .al-green{ color:var(--green) !important; }
.al-blue{ color:var(--blue) !important; } .al-purple{ color:var(--purple) !important; } .al-gold{ color:var(--gold) !important; }
.al-silver{ color:var(--silver2) !important; }
.alert strong{ color:inherit; }
