/* ===== DESIGN TOKENS ===== */
:root {
  --ink: #0A2540; --ink-700: #0F2E4D;
  --teal: #0E7C7B; --teal-700: #0A5E5D; --teal-50: #E1F0F0;
  --gold: #C7A24B; --gold-600: #B8922F; --gold-50: #F7F1DF; --gold-200: #E8D9A8;
  --n0: #FFFFFF; --n50: #F7F9FC; --n100: #EEF2F7; --n200: #E2E8F0;
  --n400: #94A3B8; --n600: #475569; --n700: #334155; --n800: #1E293B; --n900: #0F172A;
  --radius: 12px; --radius-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(10,37,64,.06);
  --shadow-md: 0 10px 30px rgba(10,37,64,.08);
  --serif: 'Fraunces', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 100%; }
body { font-family: var(--sans); color: var(--n800); background: var(--n0); line-height: 1.65; display: flex; flex-direction: column; min-height: 100vh; -webkit-font-smoothing: antialiased; }
img, svg { max-width: 100%; display: block; height: auto; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; letter-spacing: -0.01em; color: var(--ink); line-height: 1.15; }
a { color: var(--teal); text-decoration: underline; text-underline-offset: 2px; }
a:hover, a:focus-visible { color: var(--teal-700); }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; border-radius: 3px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
.skip-link { position: absolute; top: -100%; left: 0; z-index: 10000; background: var(--teal); color: #fff; padding: 0.75rem 1.5rem; font-weight: 600; text-decoration: none; border-radius: 0 0 4px 0; }
.skip-link:focus { top: 0; }
.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 1.5rem; }

/* ===== HEADER (base) ===== */
.site-header { background: rgba(255,255,255,0.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--n200); position: sticky; top: 0; z-index: 1000; }
.logo a { display: inline-flex; align-items: center; gap: 0.6rem; text-decoration: none; }
.logo-mark { width: 34px; height: 34px; flex-shrink: 0; }
.logo-text { display: flex; flex-direction: column; line-height: 1.05; }
.logo-name { font-family: var(--serif); font-size: 1.4rem; font-weight: 600; color: var(--ink); letter-spacing: -0.02em; }
.logo .tagline { font-size: 0.7rem; font-weight: 500; color: var(--n600); letter-spacing: 0.01em; }
.header-cta-btn { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.5rem 1.1rem; border-radius: 8px; background: var(--gold); color: var(--ink); font-size: 0.85rem; font-weight: 700; text-decoration: none; white-space: nowrap; transition: background 0.2s; }
.header-cta-btn:hover { background: var(--gold-600); color: var(--ink); }
.header-login-btn { display: inline-flex; align-items: center; padding: 0.5rem 1rem; border-radius: 8px; background: transparent; color: var(--teal); border: 1.5px solid var(--teal); font-size: 0.85rem; font-weight: 600; text-decoration: none; white-space: nowrap; transition: background 0.2s, color 0.2s; }
.header-login-btn:hover { background: var(--teal-50); color: var(--teal-700); }
.nav-toggle { flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 0.5rem; border-radius: 4px; }
.nav-toggle span { display: block; width: 26px; height: 3px; background: var(--ink); border-radius: 2px; transition: transform 0.25s, opacity 0.25s; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }
.nav-toggle:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; }

/* ===== PAGE HEADER ===== */
.page-header { background: #0A2540; color: #fff; padding: 3.5rem 0; text-align: center; }
.page-header h1 { font-size: clamp(1.9rem, 4vw, 2.7rem); color: #fff; margin-bottom: 0.6rem; }
.page-header p { font-size: 1.1rem; color: #CBD5E1; max-width: 640px; margin: 0 auto; }

/* ===== SECTIONS ===== */
section { padding: 4rem 0; }
.section-title { font-size: clamp(1.6rem, 3.2vw, 2.2rem); margin-bottom: 0.5rem; text-align: center; }
.section-sub { color: var(--n600); max-width: 660px; margin: 0 auto 3rem; font-size: 1.05rem; text-align: center; }
.bg-light { background: var(--n50); }
.center { text-align: center; }

/* ===== CALCULATOR ===== */
.calc { max-width: 680px; margin: 0 auto; background: var(--n0); border: 1px solid var(--n200); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); padding: 2rem; }
.calc-row { display: grid; grid-template-columns: 1fr; gap: 1.25rem; margin-bottom: 1.5rem; }
.calc-field label { display: block; font-weight: 600; color: var(--ink); margin-bottom: 0.35rem; }
.calc-input-wrap { position: relative; }
.calc-input-wrap .pre { position: absolute; left: 0.85rem; top: 50%; transform: translateY(-50%); color: var(--n400); font-weight: 600; }
.calc-field input { width: 100%; padding: 0.8rem 0.85rem 0.8rem 1.6rem; border: 1px solid #d1d5db; border-radius: 8px; font-size: 1rem; font-family: inherit; color: var(--ink); }
.calc-field input:focus { border-color: var(--teal); outline: none; box-shadow: 0 0 0 3px rgba(14,124,123,.15); }
.calc-result { text-align: center; padding: 1.5rem; border-radius: var(--radius); background: var(--n50); border: 1px solid var(--n200); }
.calc-result .pct { font-family: var(--serif); font-size: 3rem; font-weight: 600; line-height: 1; color: var(--ink); }
.calc-meter { height: 12px; border-radius: 999px; background: var(--n200); overflow: hidden; margin: 1rem 0 0.75rem; }
.calc-meter span { display: block; height: 100%; width: 0; border-radius: 999px; background: var(--teal); transition: width .4s ease, background .4s ease; }
.calc-rating { font-weight: 700; }
.calc-advice { color: var(--n600); font-size: 0.95rem; margin-top: 0.5rem; }
.calc-note { font-size: 0.82rem; color: var(--n400); text-align: center; margin-top: 1.25rem; }

/* ===== TOOL CARDS ===== */
.tool-grid { display: grid; grid-template-columns: 1fr; gap: 1.5rem; }
.tool-card { background: var(--n0); border: 1px solid var(--n200); border-radius: var(--radius-lg); padding: 1.75rem; }
.tool-card .ico { width: 46px; height: 46px; border-radius: 12px; background: var(--teal-50); display: flex; align-items: center; justify-content: center; margin-bottom: 1rem; }
.tool-card .ico svg { width: 24px; height: 24px; color: var(--teal-700); }
.tool-card h3 { font-size: 1.15rem; margin-bottom: 0.35rem; }
.tool-card p { color: var(--n600); font-size: 0.95rem; }

/* ===== BUTTONS ===== */
.btn { display: inline-flex; align-items: center; gap: 0.45rem; padding: 0.9rem 1.6rem; border-radius: 10px; font-size: 1rem; font-weight: 600; text-decoration: none; cursor: pointer; border: none; transition: background 0.2s, transform 0.15s; }
.btn:hover { transform: translateY(-2px); }
.btn:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.btn-gold { background: var(--gold); color: var(--ink); }
.btn-gold:hover { background: var(--gold-600); color: var(--ink); }
.btn svg { width: 18px; height: 18px; }

/* ===== FINAL CTA ===== */
.final-cta { background: #0A2540; color: #fff; text-align: center; }
.final-cta h2 { color: #fff; font-size: clamp(1.7rem, 4vw, 2.4rem); margin-bottom: 0.75rem; }
.final-cta p { color: #CBD5E1; max-width: 540px; margin: 0 auto 2rem; font-size: 1.05rem; }

/* ===== FOOTER ===== */
.site-footer { margin-top: auto; background: var(--n900); color: #cbd5e1; }
.footer-legal { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem 1.5rem; list-style: none; padding: 1.25rem 0; font-size: 0.85rem; }
.footer-legal a { color: var(--n400); text-decoration: none; }
.footer-legal a:hover { color: #fff; }
.footer-legal a:focus-visible { outline: 3px solid #38bdf8; outline-offset: 2px; border-radius: 2px; }
.footer-bottom { border-top: 1px solid var(--n800); padding: 1rem 0; text-align: center; font-size: 0.85rem; }
.footer-ada { background: var(--n800); color: var(--n400); padding: 0.75rem 0; text-align: center; font-size: 0.85rem; }
.footer-ada a { color: #38bdf8; }

@media (min-width: 640px) { .calc-row { grid-template-columns: 1fr 1fr; } .tool-grid { grid-template-columns: repeat(3, 1fr); } }

/* ================= CONSOLIDATED HEADER NAV (v3) ================= */
.site-header .container { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: nowrap; padding-top: 0.7rem; padding-bottom: 0.7rem; }
.nav-toggle { display: inline-flex; }
.primary-nav {
  position: absolute; top: 100%; left: 0; right: 0;
  display: block; width: 100%; max-height: none; overflow: visible;
  background: #ffffff; border-bottom: 1px solid #E2E8F0; box-shadow: 0 16px 30px rgba(10,37,64,.10);
  padding: 0.5rem 0 1.25rem; z-index: 999;
  visibility: hidden; opacity: 0; transform: translateY(-8px); pointer-events: none;
  transition: opacity .2s ease, transform .2s ease, visibility .2s;
}
.primary-nav.open { visibility: visible; opacity: 1; transform: none; pointer-events: auto; }
.primary-nav .nav-list { list-style: none; display: flex; flex-direction: column; gap: 0; margin: 0; padding: 0 1.25rem; border: 0; max-height: none; width: auto; }
.primary-nav .nav-list > li { border-bottom: 1px solid #EEF2F7; position: relative; }
.primary-nav .nav-list > li > a,
.primary-nav .dropdown-toggle {
  display: flex; align-items: center; justify-content: space-between; gap: .4rem; width: 100%;
  padding: .9rem .25rem; margin: 0; font-family: inherit; font-size: 1rem; font-weight: 500; color: #1E293B;
  background: none; border: none; border-radius: 0; cursor: pointer; text-align: left; text-decoration: none;
}
.primary-nav .nav-list > li > a:hover, .primary-nav .nav-list > li > a:focus-visible,
.primary-nav .dropdown-toggle:hover, .primary-nav .dropdown-toggle:focus-visible { color: #0E7C7B; background: none; }
.primary-nav .chev { width: 18px; height: 18px; flex-shrink: 0; transition: transform .2s; }
.primary-nav .has-dropdown.open > .dropdown-toggle .chev { transform: rotate(180deg); }
.primary-nav .dropdown { list-style: none; display: block; margin: 0; padding: 0; border: 0; max-height: 0; overflow: hidden; width: auto; transition: max-height .25s ease; }
.primary-nav .has-dropdown.open > .dropdown { max-height: 360px; }
.primary-nav .dropdown a { display: block; padding: .65rem .25rem .65rem 1.1rem; color: #475569; text-decoration: none; font-size: .95rem; font-weight: 500; }
.primary-nav .dropdown a:hover, .primary-nav .dropdown a:focus-visible { color: #0A5E5D; background: none; }
.primary-nav a.current, .primary-nav .dropdown-toggle.current { color: #0E7C7B; font-weight: 700; }
.nav-actions { display: flex; flex-direction: column; gap: .6rem; padding: 1rem 1.25rem 0; }
.nav-actions .header-login-btn, .nav-actions .header-cta-btn { width: 100%; justify-content: center; margin: 0; }
@media (min-width: 992px) {
  .nav-toggle { display: none; }
  .primary-nav { position: static; width: auto; max-height: none; overflow: visible; padding: 0; background: none; border: 0; box-shadow: none; visibility: visible; opacity: 1; transform: none; pointer-events: auto; display: flex; align-items: center; gap: 1.25rem; }
  .primary-nav .nav-list { flex-direction: row; align-items: center; padding: 0; gap: .15rem; }
  .primary-nav .nav-list > li { border: 0; }
  .primary-nav .nav-list > li > a, .primary-nav .dropdown-toggle { width: auto; padding: .5rem .7rem; border-radius: 8px; font-size: .92rem; }
  .primary-nav .nav-list > li > a:hover, .primary-nav .dropdown-toggle:hover { background: #E1F0F0; color: #0A5E5D; }
  .primary-nav .dropdown { position: absolute; top: calc(100% + 8px); left: 0; min-width: 220px; max-height: none; overflow: visible; background: #ffffff; border: 1px solid #E2E8F0; border-radius: 12px; box-shadow: 0 16px 40px rgba(10,37,64,.14); padding: .4rem; visibility: hidden; opacity: 0; transform: translateY(8px); pointer-events: none; transition: opacity .18s ease, transform .18s ease, visibility .18s; }
  .primary-nav .has-dropdown > .dropdown::before { content: ""; position: absolute; top: -14px; left: 0; right: 0; height: 16px; }
  &
  .primary-nav .dropdown a { border-radius: 8px; padding: .6rem .75rem; }
  .primary-nav .dropdown a:hover, .primary-nav .dropdown a:focus-visible { background: #E1F0F0; }
  .nav-actions { flex-direction: row; align-items: center; padding: 0; gap: .6rem; }
  .nav-actions .header-login-btn, .nav-actions .header-cta-btn { width: auto; }
}

/* ===== AFFILIATES ===== */
.aff-grid { display: grid; grid-template-columns: 1fr; gap: 1.5rem; }
.aff-step { background:#fff; border:1px solid #E2E8F0; border-radius:20px; padding:1.75rem; }
.aff-step .n { font-family: var(--serif); font-size: 1.1rem; font-weight:600; color:#C7A24B; margin-bottom:.4rem; }
.aff-step h3 { font-size:1.15rem; margin-bottom:.35rem; }
.aff-step p { color:#475569; font-size:.95rem; }
.aff-benefits { display:grid; grid-template-columns:1fr; gap:1.25rem; max-width:900px; margin:0 auto; }
.aff-benefit { display:flex; gap:.85rem; align-items:flex-start; }
.aff-benefit svg { width:26px; height:26px; color:#0E7C7B; flex-shrink:0; }
.aff-benefit strong { display:block; color:#0A2540; }
.aff-benefit span { color:#475569; font-size:.95rem; }
@media (min-width:640px){ .aff-grid{grid-template-columns:repeat(3,1fr);} .aff-benefits{grid-template-columns:repeat(2,1fr);} }
