/* Divorce Number — calm, trust-forward design system for a sensitive-topic finance tool.
   Vanilla CSS, no build step. Light/airy palette, serif headings + sans body. */

:root {
  --bg: #f7f5f0;          /* warm off-white */
  --surface: #ffffff;
  --surface-2: #f1efe8;
  --ink: #2b3138;         /* muted slate */
  --ink-soft: #5c6670;
  --line: #e3e0d6;
  --primary: #3f7a72;     /* soft sage/teal */
  --primary-dark: #2f5d57;
  --primary-tint: #e7f0ee;
  --accent: #c8794f;      /* warm terracotta accent */
  --accent-tint: #f6e8dd;
  --a: #3f7a72;           /* spouse A */
  --b: #c8794f;           /* spouse B */
  --good: #3f7a72;
  --warn: #b4602e;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(43,49,56,.04), 0 6px 24px rgba(43,49,56,.06);
  --wrap: 1080px;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }

h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.2; color: var(--ink); }
h1 { font-size: clamp(1.9rem, 4.5vw, 3rem); margin: 0 0 .5em; letter-spacing: -.01em; }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); margin: 1.6em 0 .6em; }
h3 { font-size: 1.2rem; margin: 0 0 .4em; }
p { margin: 0 0 1em; }
a { color: var(--primary-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
strong { font-weight: 600; }

/* ---------- Header ---------- */
header.site {
  background: rgba(247,245,240,.85);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 50;
}
header.site .wrap { display: flex; align-items: center; justify-content: space-between; gap: 10px 22px; min-height: 64px; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
.logo { font-family: var(--serif); font-size: 1.4rem; font-weight: 600; color: var(--ink); flex: 0 0 auto; }
.logo span { color: var(--primary); }
.logo:hover { text-decoration: none; }
nav.main { display: flex; gap: 14px 18px; flex-wrap: wrap; }
nav.main a { color: var(--ink-soft); font-size: .94rem; font-weight: 500; white-space: nowrap; }
nav.main a:hover { color: var(--primary-dark); text-decoration: none; }
@media (max-width: 680px){
  header.site .wrap { justify-content: center; }
  nav.main { width: 100%; justify-content: center; }
}

/* ---------- Hero ---------- */
.hero { text-align: center; padding: 56px 20px 28px; }
.hero .sub { font-size: 1.15rem; color: var(--ink-soft); max-width: 680px; margin: 0 auto 1.4em; }
.hero .trust { display: inline-flex; gap: 18px; flex-wrap: wrap; justify-content: center; font-size: .9rem; color: var(--ink-soft); }
.hero .trust span { display: inline-flex; align-items: center; gap: 6px; }
.hero .trust span::before { content: "✓"; color: var(--primary); font-weight: 700; }

.chips { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; margin: 26px 0 6px; }
.chip {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 22px; min-width: 180px; box-shadow: var(--shadow);
}
.chip .label { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-soft); }
.chip .value { font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; margin-top: 4px; }
.chip.a .value { color: var(--a); }
.chip.b .value { color: var(--b); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block; cursor: pointer; font-family: var(--sans); font-size: .95rem; font-weight: 600;
  color: #fff; background: var(--primary); border: 1px solid var(--primary);
  padding: 11px 20px; border-radius: 999px; transition: background .15s, transform .05s;
}
.btn:hover { background: var(--primary-dark); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: transparent; color: var(--primary-dark); border-color: var(--line); }
.btn.ghost:hover { background: var(--surface-2); color: var(--primary-dark); }
.btn.accent { background: var(--accent); border-color: var(--accent); }
.btn.accent:hover { background: #b06a43; }

/* ---------- Cards / layout ---------- */
main { padding: 14px 0 40px; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px; margin: 20px 0; box-shadow: var(--shadow);
}
.card > h2:first-child { margin-top: 0; }
.hint { color: var(--ink-soft); font-size: .95rem; margin-bottom: 1.1em; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
@media (max-width: 760px){ .grid2 { grid-template-columns: 1fr; } }

/* ---------- Form fields ---------- */
.field-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px dashed var(--line); }
.field-row:last-child { border-bottom: none; }
label { font-size: .95rem; font-weight: 500; display: inline-flex; align-items: center; gap: 6px; }
.num, select, input[type=text] {
  font-family: var(--sans); font-size: .98rem; text-align: right; font-variant-numeric: tabular-nums;
  width: 150px; max-width: 48vw; padding: 8px 11px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink);
}
select { text-align: left; width: auto; max-width: 70vw; }
.num:focus, select:focus, input:focus { outline: 2px solid var(--primary-tint); border-color: var(--primary); }
.out { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink); }
.out.big { font-size: 1.25rem; color: var(--primary-dark); }

.toggle-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; }
.toggle-row input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--primary); }

/* ---------- Tables ---------- */
.table-scroll { overflow-x: auto; }
.calc-table { width: 100%; border-collapse: collapse; min-width: 520px; }
.calc-table th, .calc-table td { padding: 9px 8px; text-align: right; font-size: .92rem; border-bottom: 1px solid var(--line); }
.calc-table th:first-child, .calc-table td:first-child { text-align: left; }
.calc-table thead th { color: var(--ink-soft); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; }
.calc-table tfoot td { font-weight: 700; border-top: 2px solid var(--line); border-bottom: none; }
.calc-table .calc { font-variant-numeric: tabular-nums; }
.calc-table input.num { width: 110px; }
.calc-table select { font-size: .9rem; padding: 6px 8px; }
.row-add { margin-top: 10px; }

/* ---------- Split bar (Spouse A / Spouse B) ---------- */
.splitbar-wrap { margin: 8px 0 4px; }
.splitbar { display: flex; height: 46px; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--line); }
.splitbar .seg { display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: .95rem; font-variant-numeric: tabular-nums; transition: width .3s ease; white-space: nowrap; min-width: 0; }
.splitbar .seg.a { background: var(--a); }
.splitbar .seg.b { background: var(--b); }
.splitlegend { display: flex; gap: 22px; flex-wrap: wrap; margin-top: 12px; font-size: .92rem; }
.splitlegend .key { display: inline-flex; align-items: center; gap: 7px; }
.splitlegend .dot { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.splitlegend .dot.a { background: var(--a); }
.splitlegend .dot.b { background: var(--b); }

/* ---------- Result panel ---------- */
.result { background: var(--primary-tint); border: 1px solid #cfe0dc; border-radius: var(--radius); padding: 22px; margin-top: 4px; }
.result h3 { margin-top: 0; }
.result .row { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px dashed #cfe0dc; }
.result .row:last-child { border-bottom: none; }
.result .row.total { font-size: 1.15rem; font-weight: 700; border-bottom: none; padding-top: 12px; }
.result .row.total span:last-child { color: var(--primary-dark); }

.scenario-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 760px){ .scenario-grid { grid-template-columns: 1fr; } }
.scenario { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 16px; }
.scenario h4 { font-family: var(--serif); margin: 0 0 6px; font-size: 1.05rem; }
.scenario .amt { font-size: 1.35rem; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--primary-dark); }
.scenario p { font-size: .85rem; color: var(--ink-soft); margin: 6px 0 0; }

.note { background: var(--accent-tint); border-left: 3px solid var(--accent); border-radius: 6px; padding: 12px 16px; font-size: .9rem; color: #6b4a32; margin: 16px 0; }

/* ---------- Help tooltip ---------- */
.help {
  display: inline-flex; align-items: center; justify-content: center; width: 17px; height: 17px;
  border-radius: 50%; background: var(--surface-2); color: var(--ink-soft); font-size: .72rem; font-weight: 700;
  cursor: help; position: relative; border: 1px solid var(--line);
}
.help::after {
  content: attr(data-tip); position: absolute; bottom: 130%; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 9px 12px; border-radius: 8px; font-size: .8rem; font-weight: 400;
  line-height: 1.4; width: 230px; max-width: 70vw; text-align: left; opacity: 0; pointer-events: none; transition: opacity .15s; z-index: 20;
}
.help:hover::after, .help:focus::after { opacity: 1; }

/* ---------- Tool cards (hub) ---------- */
.tool-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 880px){ .tool-grid { grid-template-columns: 1fr; } }
.tool-card { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); transition: transform .12s, border-color .12s; }
.tool-card:hover { text-decoration: none; transform: translateY(-2px); border-color: var(--primary); }
.tool-card .ico { font-size: 1.6rem; }
.tool-card h3 { margin: 10px 0 4px; color: var(--primary-dark); }
.tool-card p { color: var(--ink-soft); font-size: .92rem; margin: 0; }

/* ---------- Content sections / guides ---------- */
.content-section { padding: 18px 0 10px; }
.content-section ol, .content-section ul { padding-left: 22px; }
.content-section li { margin-bottom: .5em; }
.guide-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; margin-top: 8px; }
@media (max-width: 880px){ .guide-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px){ .guide-grid { grid-template-columns: 1fr; } }
.guide-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 18px; box-shadow: var(--shadow); }
.guide-card:hover { text-decoration: none; border-color: var(--primary); }
.guide-card h3 { font-size: 1.05rem; color: var(--primary-dark); }
.guide-card p { font-size: .88rem; color: var(--ink-soft); margin: 0; }

/* article */
.article { max-width: 760px; margin: 0 auto; padding: 20px 0; }
.article p, .article li { font-size: 1.04rem; }
.breadcrumb { font-size: .85rem; color: var(--ink-soft); margin: 10px 0 0; }

/* ---------- FAQ ---------- */
.faq { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0 18px; margin: 10px 0; box-shadow: var(--shadow); }
.faq summary { cursor: pointer; font-weight: 600; padding: 16px 0; list-style: none; position: relative; padding-right: 28px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 4px; top: 14px; font-size: 1.3rem; color: var(--primary); font-weight: 400; }
.faq[open] summary::after { content: "–"; }
.faq p { padding-bottom: 16px; margin: 0; color: var(--ink-soft); }

/* ---------- Footer ---------- */
footer.site { background: #2b3138; color: #c6cdd2; margin-top: 50px; }
footer.site .wrap { padding: 34px 20px; }
footer.site a { color: #e7ece9; font-size: .92rem; margin-right: 18px; }
footer.site .links { margin-bottom: 14px; }
.disclaimer { font-size: .82rem; color: #98a1a8; line-height: 1.6; max-width: 820px; }

/* ---------- Verdict / badges ---------- */
.verdict { margin-top: 12px; padding: 10px 14px; border-radius: 8px; font-size: .9rem; font-weight: 500; }
.verdict.even { background: var(--primary-tint); color: var(--primary-dark); }
.verdict.tilt { background: var(--accent-tint); color: #6b4a32; }

.privacy-pill { display: inline-flex; align-items: center; gap: 7px; background: var(--primary-tint); color: var(--primary-dark); border-radius: 999px; padding: 6px 14px; font-size: .85rem; font-weight: 500; }
.privacy-pill::before { content: "🔒"; }

/* ============================================================
   Iteration 2 — print report, show-the-math, state note, factor checklist
   ============================================================ */

/* Result action buttons (print / save) */
.result-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.btn.print { background: var(--surface); color: var(--primary-dark); border-color: var(--line); }
.btn.print:hover { background: var(--surface-2); color: var(--primary-dark); }

/* Show-the-math breakdown */
.math { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); margin: 14px 0 0; padding: 0 16px; }
.math > summary { cursor: pointer; font-weight: 600; font-size: .92rem; padding: 12px 0; list-style: none; color: var(--primary-dark); position: relative; padding-right: 24px; }
.math > summary::-webkit-details-marker { display: none; }
.math > summary::after { content: "▸"; position: absolute; right: 6px; top: 12px; transition: transform .15s; color: var(--primary); display: inline-block; }
.math[open] > summary::after { transform: rotate(90deg); }
.math ol { margin: 0 0 14px; padding-left: 22px; }
.math li { font-size: .9rem; color: var(--ink-soft); margin-bottom: .5em; font-variant-numeric: tabular-nums; }
.math li b { color: var(--ink); font-weight: 600; }

/* State rule info panel */
.statenote { display: flex; gap: 10px; background: var(--primary-tint); border: 1px solid #cfe0dc; border-radius: var(--radius-sm); padding: 12px 16px; font-size: .92rem; color: var(--primary-dark); margin: 14px 0 0; line-height: 1.5; }
.statenote::before { content: "📍"; flex: 0 0 auto; }

/* Statutory factor checklist */
.factors .head-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.factor-count { font-weight: 700; color: var(--primary-dark); font-variant-numeric: tabular-nums; font-size: .9rem; white-space: nowrap; }
.factor-list { list-style: none; padding: 0; margin: 8px 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 0 26px; }
@media (max-width: 700px){ .factor-list { grid-template-columns: 1fr; } }
.factor-list li { padding: 10px 0; border-bottom: 1px dashed var(--line); }
label.factor { display: flex; gap: 11px; align-items: flex-start; font-weight: 400; font-size: .95rem; cursor: pointer; }
label.factor input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--primary); flex: 0 0 auto; }
label.factor .factor-sub { color: var(--ink-soft); font-size: .82rem; display: block; margin-top: 2px; }

/* Printable summary report — hidden on screen, isolated in print */
.report { display: none; }
@media print {
  body * { visibility: hidden; }
  .report, .report * { visibility: visible; }
  .report { display: block !important; position: absolute; left: 0; top: 0; width: 100%; padding: 24px; }
  body { background: #fff; }
  .report .rep-head { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 2px solid #2b3138; padding-bottom: 8px; margin-bottom: 16px; }
  .report .rep-brand { font-family: var(--serif); font-size: 1.45rem; font-weight: 600; color: #2b3138; }
  .report .rep-brand span { color: var(--primary); }
  .report .rep-date { font-size: .85rem; color: #555; text-align: right; }
  .report h2 { font-size: 1.3rem; margin: 0 0 14px; }
  .report .rep-section { margin: 0 0 18px; page-break-inside: avoid; }
  .report .rep-section h3 { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: #555; margin: 0 0 7px; border-bottom: 1px solid #ccc; padding-bottom: 3px; }
  .report .rep-row { display: flex; justify-content: space-between; gap: 18px; padding: 3px 0; font-size: .95rem; font-variant-numeric: tabular-nums; }
  .report .rep-row span:first-child { color: #333; }
  .report .rep-row.total { font-weight: 700; border-top: 1px solid #2b3138; margin-top: 5px; padding-top: 7px; font-size: 1.05rem; }
  .report ol { padding-left: 22px; margin: 0; }
  .report ol li { font-size: .9rem; margin-bottom: 4px; font-variant-numeric: tabular-nums; }
  .report .rep-splitbar { display: flex; height: 40px; border-radius: 6px; overflow: hidden; border: 1px solid #ccc; margin: 6px 0; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .report .rep-splitbar .seg { display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: .9rem; min-width: 0; white-space: nowrap; }
  .report .rep-splitbar .seg.a { background: var(--a); }
  .report .rep-splitbar .seg.b { background: var(--b); }
  .report .rep-disc { font-size: .72rem; color: #666; border-top: 1px solid #ccc; margin-top: 22px; padding-top: 10px; line-height: 1.5; }
  @page { margin: 1.4cm; }
}
