/* Retire Ready — Design System
 * Aesthetic: warm paper, deep moss, sage, clay accents.
 * Editorial spacing, generous whitespace, soft shadows, calm.
 */

:root {
  /* Surfaces — warm off-whites */
  --paper:        #F6F1E8;   /* page background */
  --paper-2:      #FBF7EF;   /* card surface */
  --paper-3:      #FFFFFF;   /* elevated surface */
  --paper-edge:   #ECE4D4;   /* hairline divider */

  /* Ink — deep moss/charcoal */
  --ink:          #1F2A24;   /* primary text */
  --ink-2:        #364840;   /* secondary text */
  --ink-3:        #6B7A72;   /* tertiary / meta */
  --ink-4:        #98A39B;   /* faint */

  /* Sage — supportive accent */
  --sage:         #6E8A78;
  --sage-2:       #8FA899;
  --sage-soft:    #DCE4DA;
  --sage-tint:    #EBF0E8;

  /* Moss — primary brand */
  --moss:         #2F4A3A;
  --moss-deep:    #233A2D;

  /* Clay — terracotta CTA */
  --clay:         #B96B4A;
  --clay-deep:    #9E5638;
  --clay-soft:    #F2D9CB;
  --clay-tint:    #F8E7DC;

  /* Status */
  --status-ok:    #5E8266;
  --status-warn:  #C28A3F;
  --status-risk:  #B5594A;

  /* Type */
  --serif:  "Fraunces", "Cormorant Garamond", "Georgia", "Times New Roman", serif;
  --sans:   "Inter", "Söhne", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono:   "JetBrains Mono", "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Radii */
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;
  --r-pill: 999px;

  /* Shadows — soft, low-spread */
  --sh-1: 0 1px 2px rgba(31,42,36,0.04), 0 1px 1px rgba(31,42,36,0.03);
  --sh-2: 0 2px 6px rgba(31,42,36,0.05), 0 8px 24px -8px rgba(31,42,36,0.08);
  --sh-3: 0 4px 14px rgba(31,42,36,0.06), 0 24px 48px -16px rgba(31,42,36,0.12);

  /* Spacing rhythm */
  --gutter: clamp(20px, 4vw, 48px);
}

/* Reset-ish */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }

/* Typography helpers */
.serif { font-family: var(--serif); font-weight: 400; letter-spacing: -0.01em; }
.mono  { font-family: var(--mono); font-feature-settings: "tnum"; }
.eyebrow {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.lead {
  font-size: clamp(17px, 1.4vw, 19px);
  color: var(--ink-2);
  line-height: 1.55;
  max-width: 60ch;
  text-wrap: pretty;
}

h1, h2, h3, h4 { margin: 0; font-family: var(--serif); font-weight: 400; letter-spacing: -0.02em; color: var(--ink); }
h1 { font-size: clamp(40px, 6vw, 80px); line-height: 1.02; }
h2 { font-size: clamp(28px, 3.4vw, 44px); line-height: 1.08; }
h3 { font-size: clamp(20px, 1.8vw, 26px); line-height: 1.2; }
h4 { font-size: 18px; line-height: 1.3; font-family: var(--sans); font-weight: 600; letter-spacing: -0.005em; }

p  { margin: 0; }

/* Layout */
.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.container {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.container-narrow {
  width: 100%;
  max-width: 880px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 48px;
  padding: 0 22px;
  border-radius: var(--r-pill);
  font-weight: 500;
  font-size: 15px;
  letter-spacing: -0.005em;
  transition: transform .15s ease, background .2s ease, box-shadow .2s ease, border-color .2s ease, color .2s ease;
  white-space: nowrap;
  cursor: pointer;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--clay);
  color: #FBF7EF;
  box-shadow: 0 1px 0 rgba(255,255,255,0.15) inset, 0 6px 18px -8px rgba(158,86,56,0.55);
}
.btn-primary:hover { background: var(--clay-deep); }
.btn-secondary {
  background: var(--moss);
  color: #F2EFE4;
}
.btn-secondary:hover { background: var(--moss-deep); }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--paper-edge);
}
.btn-ghost:hover { background: var(--paper-2); border-color: #DCD2BD; }
.btn-link {
  height: auto; padding: 0; border-radius: 0;
  color: var(--moss); border-bottom: 1px solid currentColor;
  background: transparent; font-weight: 500;
}
.btn-sm { height: 38px; padding: 0 16px; font-size: 14px; }
.btn-lg { height: 56px; padding: 0 26px; font-size: 16px; }

/* Cards */
.card {
  background: var(--paper-2);
  border: 1px solid var(--paper-edge);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-1);
}
.card-elev {
  background: var(--paper-3);
  border: 1px solid var(--paper-edge);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-3);
}

/* Pills / badges */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: var(--r-pill);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
  background: var(--sage-tint);
  color: var(--moss);
  border: 1px solid var(--sage-soft);
}
.pill-clay { background: var(--clay-tint); color: var(--clay-deep); border-color: var(--clay-soft); }
.pill-warn { background: #F7EBD2; color: #8C6021; border-color: #EFD9A8; }
.pill-risk { background: #F2DAD3; color: #8E3F2F; border-color: #E8C2B7; }
.pill-dot::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: currentColor; display: inline-block;
}

/* Forms */
.field { display: flex; flex-direction: column; gap: 8px; }
.field-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.005em;
}
.field-help {
  font-size: 13px;
  color: var(--ink-3);
  line-height: 1.45;
}
.field-error {
  font-size: 13px;
  color: var(--clay-deep);
}
/* Remove browser spinner arrows from number inputs — prevents accidental -1 from spinner clicks */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type="number"] { -moz-appearance: textfield; }

.input, .select, .textarea {
  width: 100%;
  height: 56px;
  padding: 0 18px;
  background: var(--paper-3);
  border: 1px solid var(--paper-edge);
  border-radius: var(--r-md);
  font-size: 16px;
  color: var(--ink);
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.textarea { height: auto; padding: 14px 18px; min-height: 96px; }
.input:hover, .select:hover { border-color: #D7CCB4; }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--moss);
  box-shadow: 0 0 0 4px rgba(47,74,58,0.10);
}
.input.has-error { border-color: var(--clay); box-shadow: 0 0 0 4px rgba(185,107,74,0.12); }
.input-prefix {
  position: relative;
}
.input-prefix .input { padding-left: 36px; }
.input-prefix .prefix {
  position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
  color: var(--ink-3); font-size: 16px;
}
.input-suffix .input { padding-right: 60px; }
.input-suffix .suffix {
  position: absolute; right: 16px; top: 50%; transform: translateY(-50%);
  color: var(--ink-3); font-size: 14px;
}

/* Choice cards (radio-as-card) */
.choice {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 18px 20px;
  background: var(--paper-3);
  border: 1px solid var(--paper-edge);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: all .15s ease;
  text-align: left;
  width: 100%;
}
.choice:hover { border-color: #D7CCB4; background: #FFFDF7; }
.choice.selected {
  border-color: var(--moss);
  background: var(--sage-tint);
  box-shadow: 0 0 0 3px rgba(47,74,58,0.08);
}
.choice .choice-mark {
  width: 22px; height: 22px; border-radius: 50%;
  border: 1.5px solid #C9BDA3;
  flex: 0 0 auto;
  margin-top: 2px;
  display: grid; place-items: center;
  background: var(--paper-3);
  transition: all .15s ease;
}
.choice.selected .choice-mark { border-color: var(--moss); background: var(--moss); }
.choice.selected .choice-mark::after {
  content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--paper);
}
.choice-title { font-weight: 500; color: var(--ink); font-size: 15px; }
.choice-sub   { font-size: 13px; color: var(--ink-3); margin-top: 2px; line-height: 1.45; }

/* Segmented */
.segmented {
  display: inline-flex;
  background: var(--paper-2);
  border: 1px solid var(--paper-edge);
  border-radius: var(--r-pill);
  padding: 4px;
  gap: 4px;
}
.segmented button {
  height: 36px; padding: 0 16px; border-radius: var(--r-pill);
  color: var(--ink-2); font-size: 13px; font-weight: 500;
  transition: background .15s ease, color .15s ease;
}
.segmented button.active { background: var(--moss); color: #F2EFE4; }

/* Divider */
.divider { height: 1px; background: var(--paper-edge); border: 0; margin: 0; }

/* Utilities */
.row { display: flex; }
.col { display: flex; flex-direction: column; }
.gap-4  { gap: 4px; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-20 { gap: 20px; }
.gap-24 { gap: 24px; }
.gap-32 { gap: 32px; }
.gap-48 { gap: 48px; }
.center { align-items: center; }
.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.grow { flex-grow: 1; }
.tnum { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-3); }
.muted-2 { color: var(--ink-4); }
.tiny { font-size: 12px; }
.small { font-size: 13px; }
.right { text-align: right; }
.center-text { text-align: center; }

/* Section spacing */
.section { padding: clamp(56px, 8vw, 112px) 0; }
.section-tight { padding: clamp(40px, 5vw, 72px) 0; }

/* Nav */
.nav {
  position: sticky;
  top: 0; left: 0; right: 0;
  z-index: 50;
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  background: rgba(246,241,232,0.82);
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease, background .2s ease;
}
.nav.scrolled { border-bottom-color: var(--paper-edge); }
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 72px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--serif);
  font-size: 22px;
  letter-spacing: -0.01em;
  color: var(--moss);
}
.brand-mark {
  width: 28px; height: 28px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, var(--sage-2), var(--moss) 70%);
  position: relative;
  flex: 0 0 auto;
}
.brand-mark::after {
  content: ""; position: absolute; inset: 6px;
  border-radius: 50%;
  border: 1px dashed rgba(255,255,255,0.55);
}
.nav-links { display: flex; gap: 28px; }
.nav-link {
  color: var(--ink-2); font-size: 14px; font-weight: 500;
  padding: 6px 0; border-bottom: 1.5px solid transparent;
  transition: color .15s ease, border-color .15s ease;
}
.nav-link:hover { color: var(--moss); }
.nav-link.active { color: var(--moss); border-bottom-color: var(--moss); }

/* Footer */
.footer {
  margin-top: auto;
  padding: 56px 0 40px;
  border-top: 1px solid var(--paper-edge);
  background: var(--paper);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 48px;
}
@media (max-width: 720px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .nav-links { display: none; }
}
.footer h5 {
  font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-3); margin-bottom: 16px; font-weight: 500;
}
.footer a { display: block; color: var(--ink-2); font-size: 14px; padding: 6px 0; }
.footer a:hover { color: var(--moss); }

/* Animations — no opacity-from-0 (so backgrounded iframes render content) */
@keyframes rise {
  from { transform: translateY(6px); }
  to   { transform: translateY(0); }
}
.rise { animation: rise .5s ease both; }

@keyframes fade {
  from { transform: translateY(2px); }
  to   { transform: translateY(0); }
}
.fade { animation: fade .25s ease both; }

/* Stat numbers */
.stat-num {
  font-family: var(--serif);
  font-size: clamp(36px, 4vw, 56px);
  letter-spacing: -0.02em;
  color: var(--ink);
  line-height: 1;
  font-feature-settings: "tnum";
}
.stat-label {
  font-size: 13px;
  color: var(--ink-3);
  letter-spacing: 0.02em;
}

/* Texture: subtle paper grain */
.paper-grain {
  background-image:
    radial-gradient(rgba(31,42,36,0.025) 1px, transparent 1px),
    radial-gradient(rgba(31,42,36,0.018) 1px, transparent 1px);
  background-size: 3px 3px, 7px 7px;
  background-position: 0 0, 1px 2px;
}

/* Scroll behavior */
html { scroll-behavior: smooth; }

/* Focus */
:focus-visible {
  outline: 2px solid var(--moss);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Mobile tweaks */
@media (max-width: 720px) {
  h1 { font-size: 44px; }
  .nav-inner { height: 64px; }
}

/* Mobile fix for Built With Guidance section */
@media (max-width: 720px) {
  [class*="guidance"],
  [class*="Guidance"],
  [class*="built"],
  [class*="Built"] {
    text-align: center !important;
  }

  .guidance-section,
  .built-with-guidance,
  .builtWithGuidance {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 24px !important;
  }

  .guidance-section *,
  .built-with-guidance *,
  .builtWithGuidance * {
    text-align: center !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }
}
.trust-strip-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
}

.trust-strip-logos {
  display: flex;
  flex: 1;
  justify-content: flex-end;
  gap: 32px;
  flex-wrap: wrap;
  color: var(--ink-3);
  font-family: var(--serif);
  font-size: 18px;
  letter-spacing: 0.02em;
}

@media (max-width: 720px) {
  .trust-strip-inner {
    flex-direction: column;
    justify-content: center;
    text-align: center;
    gap: 24px;
  }

  .trust-strip-logos {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 18px;
    width: 100%;
    flex: none;
  }
}
.summary-stats-row {
  display: flex;
}

.summary-stats-row > * {
  min-width: 0;
  flex: 1;
}

@media (max-width: 640px) {
  .summary-stats-row {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
    align-self: stretch !important;
  }
}

@media (max-width: 640px) {
  .report-card {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    transform: none !important;
    /* Reduce horizontal card padding on mobile — inline styles use 28px,
       which combined with the 20px container gutter puts content 48px from
       each screen edge (26% of a 375px screen). This brings it down to ~20px. */
    padding-left: 20px !important;
    padding-right: 20px !important;
    /* Stack flex children (icon + content) vertically on mobile.
       The AISummary card uses display:flex with a 40px icon beside the text,
       consuming 60px of horizontal space and leaving only ~235px for content.
       column + stretch makes the content div fill the full card width.
       Cards without display:flex are unaffected by these properties. */
    flex-direction: column !important;
    align-items: stretch !important;
  }
}

/* ─── Interactive report grid — chart + What-if sliders ─────────────────────
   Desktop: two columns side by side so users can adjust sliders and see the
   chart update without scrolling. align-items: start prevents the columns
   from stretching to match each other's height.
   Mobile (≤980px): single column, natural stacking order.                    */
@media (min-width: 981px) {
  .interactive-report-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.85fr);
    gap: 24px;
    align-items: start;
    margin-bottom: 24px;
  }
}
@media (max-width: 980px) {
  .interactive-report-grid {
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin-bottom: 24px;
  }
}

/* ─── Social Security step — option cards ─────────────────────────────────── */
.option-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.option-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 20px;
  border-radius: var(--r-md);
  border: 1.5px solid var(--paper-edge);
  background: var(--paper-2);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
  text-align: left;
  width: 100%;
}

.option-card:hover {
  border-color: var(--sage-2);
  background: var(--sage-tint);
}

.option-card.selected {
  border-color: var(--moss);
  background: var(--sage-tint);
  box-shadow: 0 0 0 1px var(--moss);
}

.option-card .choice-mark {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--sage-2);
  margin-top: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s, background 0.15s;
}

.option-card.selected .choice-mark {
  border-color: var(--moss);
  background: var(--moss);
  box-shadow: inset 0 0 0 3px var(--sage-tint);
}

.choice-title {
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.3;
  margin-bottom: 3px;
}

.option-card.selected .choice-title {
  color: var(--moss-deep);
}

.choice-sub {
  font-size: 13px;
  color: var(--ink-3);
  line-height: 1.5;
}

/* ─── SS estimate grid — report AssumptionsCard detail rows ─────────────── */
.ss-estimate-grid {
  display: flex;
  flex-direction: column;
}

/* ─── Estimate preview card — shown while filling SS estimate form ───────── */
.estimate-preview-card {
  margin-top: 4px;
  padding: 24px 26px;
  border-radius: var(--r-lg);
  background: var(--sage-tint);
  border: 1px solid var(--sage-soft);
}

.estimate-preview-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--moss);
  margin-bottom: 10px;
}

.estimate-preview-amount {
  font-family: var(--serif);
  font-size: clamp(32px, 5vw, 44px);
  color: var(--moss-deep);
  line-height: 1.05;
}

.estimate-preview-sub {
  font-size: 14px;
  color: var(--ink-3);
  margin-top: 5px;
  margin-bottom: 16px;
}

.estimate-preview-body {
  font-size: 14px;
  color: var(--ink-2);
  line-height: 1.65;
  padding-top: 16px;
  border-top: 1px solid var(--sage-soft);
  margin-bottom: 12px;
}

.estimate-preview-disclaimer {
  font-size: 12px;
  color: var(--ink-3);
  line-height: 1.65;
  font-style: italic;
}

/* ─── Helper text below form fields ─────────────────────────────────────── */
.form-helper-text {
  font-size: 12px;
  color: var(--ink-3);
  margin-top: 5px;
  line-height: 1.5;
}

.field-note {
  font-size: 12.5px;
  color: var(--ink-3);
  line-height: 1.55;
  margin-top: 6px;
}

/* ─── Assumption note — small disclaimer text in report ─────────────────── */
.assumption-note {
  font-size: 12px;
  color: var(--ink-3);
  line-height: 1.6;
  font-style: italic;
}

/* ─── SS detail card inside AssumptionsCard ──────────────────────────────── */
.assumption-detail-card {
  padding: 14px 16px;
  border-radius: var(--r-md);
  background: var(--sage-tint);
  border: 1px solid var(--sage-soft);
}

.ss-estimate-grid-row {
  display: flex;
  justify-content: space-between;
  padding: 7px 0;
  border-top: 1px dashed var(--paper-edge);
}

.ss-estimate-grid-row:first-child {
  border-top: none;
}