/* Investor & Credit-Guarantor Portal — custom styles that complement the Tailwind CDN utilities.
   Theme tokens live here so index.html and thank-you.html share one palette. */
:root {
  --forest: #0A2218;
  --midnight: #0F172A;
  --alabaster: #F8FAFC;
  --emerald: #10B981;
  --gold: #D97706;
  --nav-h: 112px;          /* brand row + section-tab row */
}
@media (min-width: 1024px) { :root { --nav-h: 120px; } }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 12px); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }
body { padding-top: var(--nav-h); font-feature-settings: "cv11", "ss01"; -webkit-font-smoothing: antialiased; }
.num, .tabular { font-variant-numeric: tabular-nums; }

/* ---------- Top navigation ---------- */
.nav-tabs { scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.nav-tabs::-webkit-scrollbar { display: none; }
.nav-link { position: relative; white-space: nowrap; }
.nav-link::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: 0; height: 2px;
  background: var(--emerald); transform: scaleX(0); transform-origin: left; transition: transform .25s ease;
}
.nav-link[aria-current="true"] { color: #fff; }
.nav-link[aria-current="true"]::after { transform: scaleX(1); }
.nav-link[aria-current="true"] .nav-idx { color: var(--emerald); }

/* ---------- Segmented buttons (radio-backed) ---------- */
.seg { display: grid; gap: .5rem; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label {
  cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: 56px; padding: .55rem .5rem; border-radius: .75rem; border: 1px solid #E2E8F0; background: #fff;
  font-weight: 600; color: #0F172A; text-align: center; transition: border-color .15s, background .15s, box-shadow .15s, color .15s;
}
.seg label:hover { border-color: #94A3B8; }
.seg label small { font-weight: 500; font-size: 11px; color: #64748B; font-family: "JetBrains Mono", ui-monospace, monospace; }
.seg input:checked + label { border-color: var(--forest); background: var(--forest); color: #fff; box-shadow: 0 6px 18px -8px rgba(10,34,24,.6); }
.seg input:checked + label small { color: #6EE7B7; }
.seg input:focus-visible + label { outline: 2px solid var(--emerald); outline-offset: 2px; }

/* ---------- Range slider ---------- */
.range { -webkit-appearance: none; appearance: none; width: 100%; height: 8px; border-radius: 999px; outline: none;
  background: linear-gradient(to right, var(--forest) 0%, var(--emerald) var(--fill, 13%), #E2E8F0 var(--fill, 13%)); }
.range::-webkit-slider-thumb { -webkit-appearance: none; width: 26px; height: 26px; border-radius: 50%; background: #fff;
  border: 3px solid var(--forest); box-shadow: 0 2px 8px rgba(15,23,42,.25); cursor: grab; }
.range::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 3px solid var(--forest); cursor: grab; }
.range:focus-visible::-webkit-slider-thumb { outline: 3px solid rgba(16,185,129,.5); outline-offset: 2px; }

/* ---------- Toggle switch ---------- */
.switch { position: relative; width: 52px; height: 30px; border-radius: 999px; background: #CBD5E1; flex-shrink: 0; transition: background .2s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.25); transition: transform .2s; }
.switch[aria-checked="true"] { background: var(--emerald); }
.switch[aria-checked="true"]::after { transform: translateX(22px); }
.switch:focus-visible { outline: 3px solid rgba(16,185,129,.45); outline-offset: 2px; }

/* ---------- Donut + gauges ---------- */
.donut circle { transition: stroke-dasharray .6s cubic-bezier(.2,.8,.2,1), stroke-dashoffset .6s cubic-bezier(.2,.8,.2,1), stroke .3s; }
.bar-fill { transition: width .6s cubic-bezier(.2,.8,.2,1), background .3s; }
.flash { animation: flash .6s ease; }
@keyframes flash { 0% { opacity: .35; transform: translateY(2px); } 100% { opacity: 1; transform: none; } }

/* ---------- Case-study tabs ---------- */
.cs-tab[aria-selected="true"] { background: var(--forest); color: #fff; border-color: var(--forest); box-shadow: 0 10px 24px -12px rgba(10,34,24,.7); }
.cs-tab[aria-selected="true"] .cs-tab-sub { color: #6EE7B7; }
.cs-panel[hidden] { display: none; }
.cs-panel { animation: panelIn .35s ease; }
@keyframes panelIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.parcel { cursor: pointer; transition: filter .2s, opacity .2s; }
.parcel:hover, .parcel:focus-visible { filter: brightness(1.12); outline: none; }

/* ---------- FAQ accordion ---------- */
.faq summary { list-style: none; cursor: pointer; }
.faq summary::-webkit-details-marker { display: none; }
.faq .chev { transition: transform .25s ease; }
.faq[open] .chev { transform: rotate(45deg); }
.faq[open] { border-color: rgba(16,185,129,.55); box-shadow: 0 12px 30px -18px rgba(10,34,24,.45); }

/* ---------- Modal ---------- */
dialog#apply { overflow-y: auto; padding: 0; border: 0; background: transparent; max-width: 100vw; max-height: 100dvh; width: 100%; height: 100%; }
dialog#apply::backdrop { background: rgba(2, 6, 23, .72); backdrop-filter: blur(4px); }
dialog#apply[open] .modal-card { animation: modalIn .28s cubic-bezier(.2,.8,.2,1); }
@keyframes modalIn { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
body.modal-open { overflow: hidden; }

/* ---------- Misc ---------- */
.grain { background-image: radial-gradient(rgba(255,255,255,.06) 1px, transparent 1px); background-size: 3px 3px; }
.hairline-grid { background-image: linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px); background-size: 48px 48px; }
.honeypot { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
