/* calculators.css — shared shell for the free, no-login calculator pages
 * (idle-cash, card-vs-savings, emergency-fund, debt-payoff).
 *
 * Colors, fonts, radii come from tokens.css (link it BEFORE this file). This file owns only the
 * layout the calculators share: nav, forest hero + input/result cards, sections, projection tiles,
 * the input/output two-column pattern, verdict banner, prose, FAQ, related-tools row, CTA, footer.
 * Mobile-first: base rules target the phone; min-width queries add the desktop treatment. One fix
 * here updates every calculator. Anything genuinely unique to one page lives in that page's <style>.
 */

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { font-family: var(--ff-sans); background: var(--cream); color: var(--charcoal); -webkit-font-smoothing: antialiased; overflow-x: hidden; }

/* NAV — matches the landing/score forest bar */
nav { position: fixed; top: 0; left: 0; right: 0; z-index: 100; background: rgba(45,74,62,0.97); backdrop-filter: blur(14px); }
.nav-inner { max-width: 1100px; margin: 0 auto; padding: 14px 20px; display: flex; align-items: center; justify-content: space-between; }
.logo { font-family: var(--ff-serif); font-size: 20px; font-weight: 700; color: white; letter-spacing: -0.5px; display: flex; align-items: center; gap: 8px; text-decoration: none; }
.logo svg { width: 26px; height: 26px; }
.nav-right { display: flex; align-items: center; gap: 18px; }
.nav-signin { font-size: 14px; color: rgba(255,255,255,0.7); text-decoration: none; transition: color 0.2s; }
.nav-signin:hover { color: white; }
.nav-cta { background: var(--terracotta); color: white; padding: 9px 20px; border-radius: var(--radius-pill); font-family: var(--ff-sans); font-size: 14px; font-weight: 500; text-decoration: none; transition: all 0.2s; white-space: nowrap; }
.nav-cta:hover { background: var(--terracotta-dark); transform: translateY(-1px); }
@media (max-width: 520px) { .nav-signin { display: none; } }

/* HERO — forest, holds the calculator inputs + the headline result */
.hero { background: var(--forest); position: relative; overflow: hidden; padding: 100px 20px 56px; }
.hero::before { content: ''; position: absolute; width: 520px; height: 520px; border-radius: 50%; background: radial-gradient(circle, rgba(196,113,74,0.13) 0%, transparent 70%); right: -160px; top: -140px; pointer-events: none; }
.hero-inner { position: relative; max-width: 1040px; margin: 0 auto; }
.hero-eyebrow { display: inline-flex; align-items: center; gap: 8px; background: rgba(212,184,150,0.15); border: 1px solid rgba(212,184,150,0.3); color: var(--clay); padding: 7px 15px; border-radius: var(--radius-pill); font-size: 12px; font-weight: 600; letter-spacing: 0.5px; text-transform: uppercase; margin-bottom: 20px; }
.hero h1 { font-family: var(--ff-serif); font-size: clamp(30px, 6.4vw, 46px); font-weight: 700; line-height: 1.1; color: white; margin-bottom: 16px; max-width: 640px; }
.hero h1 em { font-style: italic; color: var(--clay); }
.hero-sub { font-size: clamp(15px, 4vw, 18px); line-height: 1.6; color: rgba(255,255,255,0.72); max-width: 560px; margin-bottom: 34px; }
.hero-disclaimer { font-size: 12.5px; color: rgba(255,255,255,0.5); margin-top: 20px; max-width: 620px; line-height: 1.5; }

/* Calculator layout — single column on phone, two columns (inputs | result) on desktop */
.calc { display: grid; grid-template-columns: 1fr; gap: 18px; }
@media (min-width: 780px) { .calc { grid-template-columns: 1.05fr 0.95fr; gap: 24px; align-items: stretch; } }

.calc-card { background: white; border-radius: var(--radius-card); box-shadow: var(--shadow-float); padding: 24px; }
.calc-card-title { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--mid-gray); margin-bottom: 18px; }

/* Fields + inputs */
.field { margin-bottom: 16px; }
.field:last-child { margin-bottom: 0; }
.field label { display: block; font-size: 13.5px; font-weight: 600; color: var(--charcoal); margin-bottom: 7px; }
.field .hint { font-weight: 400; color: var(--mid-gray); }
.input-wrap { position: relative; display: flex; align-items: center; }
.input-affix { position: absolute; font-size: 16px; font-weight: 600; color: var(--mid-gray); pointer-events: none; }
.input-affix.pre { left: 15px; }
.input-affix.suf { right: 15px; }
.field input, .field select {
  width: 100%; padding: 14px 16px; border: 1.5px solid var(--sand); border-radius: var(--radius-control);
  font-family: var(--ff-sans); font-size: 16px; font-weight: 600; background: var(--cream); color: var(--charcoal);
  outline: none; transition: border-color 0.15s; font-variant-numeric: tabular-nums; -moz-appearance: textfield;
}
.field input.has-pre { padding-left: 30px; }
.field input.has-suf { padding-right: 34px; }
.field input::-webkit-outer-spin-button, .field input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.field input:focus, .field select:focus { border-color: var(--forest); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* RESULT card — forest-light panel with the headline number */
.result-card { background: var(--forest-light); border: 1px solid rgba(255,255,255,0.14); border-radius: var(--radius-card); padding: 26px 24px; display: flex; flex-direction: column; justify-content: center; text-align: center; }
.result-eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: rgba(255,255,255,0.6); margin-bottom: 10px; }
.result-big { font-family: var(--ff-serif); font-size: clamp(42px, 10vw, 60px); font-weight: 700; color: var(--mint); line-height: 1; font-variant-numeric: tabular-nums; }
.result-big.neutral { color: white; }
.result-big-sub { font-size: 14px; color: rgba(255,255,255,0.7); margin-top: 8px; }
.result-split { display: flex; gap: 12px; margin-top: 22px; }
.result-cell { flex: 1; background: rgba(255,255,255,0.06); border-radius: 12px; padding: 13px 10px; }
.result-cell-lab { font-size: 11px; color: rgba(255,255,255,0.6); margin-bottom: 5px; }
.result-cell-val { font-family: var(--ff-serif); font-size: 18px; font-weight: 700; color: white; font-variant-numeric: tabular-nums; }
.result-cell-val.pos { color: var(--mint); }
.result-cell-val.neg { color: var(--amber); }

/* CREAM BODY sections */
.section { max-width: 1000px; margin: 0 auto; padding: 56px 20px; }
@media (min-width: 700px) { .section { padding: 72px 20px; } }
.section-label { font-size: 11px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: var(--terracotta); margin-bottom: 12px; }
.section-title { font-family: var(--ff-serif); font-size: clamp(24px, 5vw, 34px); font-weight: 700; color: var(--forest); line-height: 1.2; margin-bottom: 14px; }
.section-title em { font-style: italic; color: var(--terracotta); }
.section-body { font-size: 16px; line-height: 1.7; color: var(--mid-gray); max-width: 620px; }

/* PROJECTION / milestone tiles */
.proj-grid { display: grid; grid-template-columns: 1fr; gap: 12px; margin-top: 28px; }
@media (min-width: 620px) { .proj-grid { grid-template-columns: repeat(3, 1fr); gap: 16px; } }
.proj-card { background: white; border: 1px solid var(--sand); border-radius: 16px; padding: 22px; text-align: center; }
.proj-yr { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--mid-gray); margin-bottom: 8px; }
.proj-val { font-family: var(--ff-serif); font-size: clamp(26px, 6vw, 34px); font-weight: 700; color: var(--green-accent); font-variant-numeric: tabular-nums; }
.proj-note { font-size: 12.5px; color: var(--light-gray); margin-top: 6px; }

/* SUBSECTION — a warm-white band holding a two-column input/output pair */
.subsection { background: var(--warm-white); }
.subsection-inner { max-width: 1000px; margin: 0 auto; padding: 56px 20px; }
@media (min-width: 700px) { .subsection-inner { padding: 72px 20px; } }
.io-grid { display: grid; grid-template-columns: 1fr; gap: 20px; margin-top: 28px; align-items: start; }
@media (min-width: 780px) { .io-grid { grid-template-columns: 1fr 1fr; gap: 26px; } }
.io-card { background: white; border: 1px solid var(--sand); border-radius: var(--radius-card); box-shadow: var(--shadow-card); padding: 24px; }

/* OUT-PANEL — a green-light results readout (label ⟷ value rows, with an emphasised hero row) */
.out-panel { background: var(--green-light); border-radius: 14px; padding: 20px; margin-top: 18px; }
.out-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 7px 0; }
.out-lab { font-size: 14px; color: var(--forest); }
.out-val { font-family: var(--ff-serif); font-weight: 700; color: var(--forest); font-variant-numeric: tabular-nums; white-space: nowrap; }
.out-hero { border-top: 1px solid var(--green-mid); margin-top: 8px; padding-top: 14px; }
.out-hero .out-lab { font-weight: 700; font-size: 15px; }
.out-hero .out-val { font-size: clamp(24px, 6vw, 30px); }
.out-note { font-size: 13.5px; line-height: 1.55; color: var(--mid-gray); margin-top: 14px; }
.out-note strong { color: var(--green-accent); }

/* VERDICT — a full-width call that states the trade-off / recommendation (flips with the inputs) */
.verdict { margin-top: 22px; border-radius: 14px; padding: 20px 22px; border: 1px solid var(--sand); background: white; }
.verdict-lab { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--terracotta); margin-bottom: 8px; }
.verdict-line { font-family: var(--ff-serif); font-size: clamp(18px, 4.4vw, 22px); font-weight: 700; color: var(--forest); line-height: 1.3; }
.verdict-sub { font-size: 14px; line-height: 1.6; color: var(--mid-gray); margin-top: 8px; }
.verdict-sub a { color: var(--green-accent); font-weight: 600; }

/* PROSE (SEO body copy) */
.prose { max-width: 680px; }
.prose h2 { font-family: var(--ff-serif); font-size: clamp(22px, 4.6vw, 30px); font-weight: 700; color: var(--forest); line-height: 1.2; margin-bottom: 16px; }
.prose h3 { font-family: var(--ff-serif); font-size: 20px; font-weight: 700; color: var(--forest); margin: 30px 0 10px; }
.prose p { font-size: 16px; line-height: 1.72; color: var(--charcoal); margin-bottom: 16px; }
.prose p:last-child { margin-bottom: 0; }
.prose a { color: var(--green-accent); font-weight: 600; }

/* FAQ — native <details>, no JS */
.faq-wrap { background: var(--cream-warm); }
.faq-inner { max-width: 760px; margin: 0 auto; padding: 56px 20px; }
@media (min-width: 700px) { .faq-inner { padding: 72px 20px; } }
.faq-list { margin-top: 28px; }
.faq-item { border-top: 1px solid var(--sand); }
.faq-item:last-child { border-bottom: 1px solid var(--sand); }
.faq-q { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 20px 0; font-family: var(--ff-sans); font-size: 16.5px; font-weight: 600; color: var(--forest); }
.faq-q::-webkit-details-marker { display: none; }
.faq-q::after { content: '+'; flex: none; font-size: 24px; font-weight: 400; line-height: 1; color: var(--terracotta); }
.faq-item[open] .faq-q::after { content: '\2212'; }
.faq-a { font-size: 15.5px; line-height: 1.65; color: var(--charcoal); max-width: 64ch; padding: 0 0 20px; }
.faq-a a { color: var(--green-accent); font-weight: 600; }

/* RELATED TOOLS — internal-link row to the other three calculators (above the CTA) */
.related { background: var(--cream); }
.related-inner { max-width: 1000px; margin: 0 auto; padding: 48px 20px 8px; }
.related-title { font-size: 11px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: var(--terracotta); margin-bottom: 20px; }
.related-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 560px) { .related-grid { grid-template-columns: 1fr 1fr; gap: 14px; } }
@media (min-width: 900px) { .related-grid { grid-template-columns: repeat(4, 1fr); gap: 16px; } }
.related-card { display: block; background: white; border: 1px solid var(--sand); border-radius: 16px; padding: 20px; text-decoration: none; transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s; }
.related-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-card); border-color: var(--green-mid); }
.related-card-name { font-family: var(--ff-serif); font-size: 17px; font-weight: 700; color: var(--forest); margin-bottom: 6px; }
.related-card-desc { font-size: 13.5px; line-height: 1.5; color: var(--mid-gray); }
.related-card-go { display: inline-block; margin-top: 10px; font-size: 13px; font-weight: 600; color: var(--terracotta); }

/* CTA — one, at the bottom */
.cta { background: var(--forest); padding: 64px 20px; text-align: center; position: relative; overflow: hidden; }
.cta::before { content: ''; position: absolute; width: 520px; height: 520px; border-radius: 50%; background: radial-gradient(circle, rgba(196,113,74,0.12) 0%, transparent 70%); top: 50%; left: 50%; transform: translate(-50%,-50%); pointer-events: none; }
.cta-inner { position: relative; max-width: 600px; margin: 0 auto; }
.cta h2 { font-family: var(--ff-serif); font-size: clamp(26px, 5vw, 38px); font-weight: 700; color: white; line-height: 1.15; margin-bottom: 14px; }
.cta h2 em { font-style: italic; color: var(--clay); }
.cta p { font-size: 16.5px; line-height: 1.6; color: rgba(255,255,255,0.78); margin-bottom: 28px; }
.cta-btn { display: inline-block; background: var(--terracotta); color: white; padding: 16px 36px; border-radius: var(--radius-pill); font-size: 16px; font-weight: 600; text-decoration: none; transition: all 0.2s; }
.cta-btn:hover { background: var(--terracotta-dark); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(168,90,56,0.4); }
.cta-note { margin-top: 18px; font-size: 13px; color: rgba(255,255,255,0.55); }

/* FOOTER */
footer { background: var(--charcoal); padding: 28px 20px; }
.footer-inner { max-width: 1000px; margin: 0 auto; display: flex; flex-direction: column; align-items: center; gap: 16px; text-align: center; }
@media (min-width: 640px) { .footer-inner { flex-direction: row; justify-content: space-between; text-align: left; } }
.footer-logo { font-family: var(--ff-serif); font-size: 20px; font-weight: 700; color: white; }
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 20px; }
.footer-link { font-size: 13px; color: rgba(255,255,255,0.45); text-decoration: none; transition: color 0.2s; }
.footer-link:hover { color: rgba(255,255,255,0.85); }
.footer-copy { font-size: 13px; color: rgba(255,255,255,0.35); }
