/* ToolLab design system: shared by every tool. Blue = trust, green = positive outcomes.
   Fonts are self-hosted (no Google Fonts → no IP transfer to third parties): shared/fonts, OFL licensed. */
@font-face { font-family: "Inter"; src: url("/shared/fonts/inter-latin-wght-normal.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Plus Jakarta Sans"; src: url("/shared/fonts/plus-jakarta-sans-latin-wght-normal.woff2") format("woff2"); font-weight: 200 800; font-style: normal; font-display: swap; }

:root {
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-head: "Plus Jakarta Sans", "Inter", system-ui, sans-serif;
  --bg: #f4f7fb; --surface: #ffffff; --surface-2: #f8fafd;
  --text: #0f1b2d; --muted: #5b6b80; --border: #dfe6ef;
  --accent: #2563eb; --accent-strong: #1d4ed8; --accent-text: #ffffff; --accent-soft: #e8f0fe;
  --positive: #0e9f6e; --positive-soft: #e6f6ef;
  --warn: #b45309; --warn-bg: #fff6e6; --err: #dc2626; --err-bg: #fdeeee;
  --shadow: 0 1px 2px rgba(15, 27, 45, .04), 0 8px 24px rgba(15, 27, 45, .06);
  --shadow-lg: 0 24px 60px rgba(15, 27, 45, .22);
  --radius: 16px; --radius-sm: 10px; --maxw: 800px;
  --glow: rgba(37, 99, 235, .14);
  color-scheme: light;
  font-family: var(--font-body);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a1120; --surface: #111a2c; --surface-2: #0e1626;
    --text: #e7eef8; --muted: #9babc1; --border: #24324b;
    --accent: #60a5fa; --accent-strong: #93c5fd; --accent-text: #08111f; --accent-soft: rgba(96, 165, 250, .14);
    --positive: #34d399; --positive-soft: rgba(52, 211, 153, .12);
    --warn: #fbbf24; --warn-bg: rgba(251, 191, 36, .10); --err: #f87171; --err-bg: rgba(248, 113, 113, .10);
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
    --shadow-lg: 0 24px 60px rgba(0, 0, 0, .55);
    --glow: rgba(96, 165, 250, .16);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; color: var(--text); line-height: 1.6; font-size: 16px;
  background: radial-gradient(1100px 420px at 50% -140px, var(--glow), transparent 70%) no-repeat, var(--bg);
  -webkit-font-smoothing: antialiased; font-feature-settings: "cv11", "ss01";
}
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--accent-strong); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* header */
header.site { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--surface) 82%, transparent); backdrop-filter: saturate(160%) blur(10px); -webkit-backdrop-filter: saturate(160%) blur(10px); border-bottom: 1px solid var(--border); }
header.site .wrap { display: flex; justify-content: space-between; align-items: center; min-height: 58px; gap: 12px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-head); font-weight: 800; letter-spacing: -.01em; text-decoration: none; color: var(--text); }
.brand::before { content: ""; width: 26px; height: 26px; border-radius: 8px; flex: none; background: linear-gradient(135deg, #3b82f6, #1d4ed8 55%, #0ea5e9); box-shadow: inset 0 0 0 1px rgba(255,255,255,.25), 0 4px 10px rgba(37,99,235,.35); }
.brand { min-width: 0; overflow-wrap: anywhere; hyphens: auto; -webkit-hyphens: auto; }
.langs { flex: none; display: flex; gap: 4px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 3px; }
.langs a { color: var(--muted); text-decoration: none; font-size: .85rem; font-weight: 600; padding: 4px 10px; border-radius: 999px; margin: 0; }
.langs a[aria-current="true"] { color: var(--accent-text); background: var(--accent); }

/* typography */
h1, h2, h3 { font-family: var(--font-head); letter-spacing: -.02em; line-height: 1.2; color: var(--text); }
h1 { font-size: clamp(1.8rem, 4.6vw, 2.6rem); font-weight: 800; margin: 40px 0 10px; }
h2 { font-size: 1.3rem; font-weight: 700; margin: 0 0 12px; }
h3 { font-size: 1.05rem; font-weight: 700; }
.lead { color: var(--muted); font-size: 1.08rem; margin: 0 0 8px; max-width: 62ch; }
.muted, .small, small { color: var(--muted); font-size: .88rem; }

/* cards & layout */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; margin: 22px 0; box-shadow: var(--shadow); }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 560px) {
  .row { grid-template-columns: 1fr; } .card { padding: 18px; }
  .brand { font-size: .92rem; line-height: 1.25; } .brand::before { width: 22px; height: 22px; }
  .langs a { padding: 4px 8px; font-size: .8rem; }
}

/* forms */
label { display: block; font-weight: 600; font-size: .94rem; margin: 16px 0 6px; }
input, select, textarea {
  width: 100%; min-height: 46px; padding: 10px 14px; font: inherit; font-size: 1rem; color: var(--text);
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
  transition: border-color .15s, box-shadow .15s, background .15s;
}
input:hover, select:hover, textarea:hover { border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 4px var(--accent-soft); }
input[type="checkbox"], input[type="radio"] { width: auto; min-height: 0; accent-color: var(--accent); }

/* buttons */
.btn, button {
  cursor: pointer; border: 0; border-radius: var(--radius-sm); padding: 12px 20px; font: inherit; font-size: 1rem; font-weight: 650;
  color: var(--accent-text); background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 88%, white), var(--accent));
  box-shadow: 0 1px 2px rgba(15,27,45,.1), 0 6px 16px color-mix(in srgb, var(--accent) 28%, transparent);
  transition: transform .12s, box-shadow .15s, filter .15s;
}
.btn:hover, button:hover { filter: brightness(1.05); transform: translateY(-1px); }
.btn:active, button:active { transform: translateY(0); }
button:disabled { cursor: default; transform: none; filter: none; }
.btn-secondary { background: var(--surface); color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--border)); box-shadow: none; text-decoration: none; display: inline-block; white-space: nowrap; }
.btn-secondary:hover { background: var(--accent-soft); filter: none; }
.link-btn { background: none; border: 0; padding: 0; color: var(--accent); text-decoration: underline; font-weight: 500; font-size: inherit; box-shadow: none; }
.link-btn:hover { transform: none; }

/* results */
.result { font-size: 1.05rem; }
.result .big { font-family: var(--font-head); font-size: clamp(2rem, 6vw, 2.6rem); font-weight: 800; letter-spacing: -.02em; color: var(--accent-strong); line-height: 1.1; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th { text-align: left; font-weight: 600; padding: 10px 6px; border-bottom: 1px solid var(--border); }
thead th { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
td { text-align: left; padding: 10px 6px; border-bottom: 1px solid var(--border); }
tbody tr:hover td { background: var(--surface-2); }

/* FAQ / details */
details { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 0 16px; margin: 10px 0; }
details[open] { box-shadow: var(--shadow); }
summary { cursor: pointer; font-weight: 650; padding: 14px 0; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; color: var(--accent); font-weight: 700; font-size: 1.2rem; line-height: 1; }
details[open] > summary::after { content: "−"; }
.card details { background: var(--surface-2); box-shadow: none; }

/* footer */
footer.site { border-top: 1px solid var(--border); margin-top: 56px; padding: 28px 0 48px; color: var(--muted); font-size: .86rem; background: var(--surface-2); }
footer.site details { background: transparent; border: 0; padding: 0; box-shadow: none; }
footer.site summary { padding: 6px 0; justify-content: flex-start; }

/* fake door / checkout modal */
.fd-overlay { position: fixed; inset: 0; background: rgba(8, 15, 30, .55); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 50; animation: fd-fade .15s ease-out; }
.fd-modal { background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 20px; padding: 28px; max-width: 460px; width: 100%; max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow-lg); animation: fd-pop .18s ease-out; }
.fd-modal h2 { font-size: 1.35rem; }
@keyframes fd-fade { from { opacity: 0; } }
@keyframes fd-pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.fd-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.fd-actions button:not(:first-child) { background: var(--surface); color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--border)); box-shadow: none; }
.fd-small { color: var(--muted); font-size: .8rem; margin-bottom: 0; }
.co-table { margin: 10px 0 6px; }
.co-table td { padding: 10px 0; }
.co-amt { text-align: right; white-space: nowrap; }
.co-total td { font-weight: 800; border-bottom: 0; font-family: var(--font-head); font-size: 1.1rem; }
.fd-modal .fd-chips button { padding: 7px 14px; font-size: .9rem; border-radius: 999px; background: var(--surface); color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--border)); box-shadow: none; }
.fd-modal .fd-chips button.chosen { background: var(--accent); color: var(--accent-text); }
.fd-chips button:disabled:not(.chosen) { opacity: .45; }
.fd-modal .ref-box { border-top: 1px solid var(--border); margin-top: 16px; padding-top: 6px; }
.fd-modal .ref-box h3 { font-size: 1rem; }

/* referrals */
[data-referrals] h3 { margin-top: 0; }
.ref-card { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.ref-card p { margin: 2px 0; color: var(--muted); font-size: .9rem; }
.ref-risk { color: var(--warn) !important; font-weight: 600; }
.ref-disclosure { font-size: .8rem; color: var(--muted); }

/* unpaid ad box (loop-002): visually separate from the tool */
.ad-box { border: 1px dashed color-mix(in srgb, var(--muted) 55%, var(--border)); border-radius: var(--radius); padding: 18px 20px; margin: 28px 0; background: var(--surface-2); }
.ad-box h3 { margin: 2px 0 6px; font-size: 1.1rem; }
.ad-box p { margin: 6px 0; }
.ad-label { font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 0 0 4px !important; }
.ad-facts { padding-left: 20px; margin: 8px 0; font-size: .95rem; }
.ad-facts li { margin: 3px 0; }
.ad-cta { margin: 12px 0 8px !important; }
.ad-cta .btn { display: inline-block; text-decoration: none; }
.ad-small { font-size: .78rem; color: var(--muted); }

/* consent bar */
.consent-bar { position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 40; max-width: 680px; margin: 0 auto; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 16px; padding: 16px 18px; box-shadow: var(--shadow-lg); font-size: .9rem; animation: fd-pop .2s ease-out; }
.consent-bar p { margin: 0 0 12px; }
.consent-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.consent-actions button { padding: 10px 18px; font-size: .95rem; }

@media (max-width: 560px) {
  /* keep the consent bar to roughly a third of a phone screen */
  .consent-bar { left: 8px; right: 8px; bottom: 8px; padding: 12px 14px; font-size: .8rem; line-height: 1.45; max-height: 42vh; overflow-y: auto; }
  .consent-bar p { margin-bottom: 10px; }
  .consent-actions { gap: 8px; }
  .consent-actions button { flex: 1 1 auto; padding: 10px 12px; font-size: .9rem; white-space: nowrap; }
  .langs a { padding: 7px 10px; }
  .fd-modal { padding: 20px 18px; }
  textarea, select, input { font-size: 16px; } /* stop iOS zoom-on-focus */
  th, td { padding: 8px 4px; }
  table { font-size: .92rem; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
@media print {
  body { background: #fff; color: #000; }
  header.site { position: static; backdrop-filter: none; }
  .card, details { box-shadow: none; }
  .consent-bar, .fd-overlay, .ad-box { display: none !important; }
}
