/* Free CD Calculator — bank ledger / certificate of deposit (en-US) */
:root {
  --bg: #f0ebe1;
  --surface: #fffcf7;
  --surface-soft: #f7f3ea;
  --text: #0c1a2e;
  --ink: #0c1a2e;
  --muted: #5a6a7a;
  --border: #d2cbc0;
  --border-navy: #1e3a5f;
  --primary: #1e3a5f;
  --primary-hover: #152a45;
  --accent: #1a5f4a;
  --accent-soft: #e6f0eb;
  --cream: #faf6ee;
  --gold-rule: #b8975a;
  --success-bg: #e8f0ec;
  --warn-bg: #f5f1e8;
  --danger: #8b1e2d;
  --radius: 3px;
  --shadow: 0 1px 2px rgba(12, 26, 46, 0.05), 0 12px 32px rgba(12, 26, 46, 0.07);
  --font: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --mono: ui-monospace, "Cascadia Code", "SF Mono", Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background:
    linear-gradient(180deg, #e8e2d6 0, var(--bg) 180px),
    var(--bg);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; }

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; color: var(--accent); }

.container {
  width: min(100% - 2rem, 960px);
  margin-inline: auto;
}

/* —— Header: classic bank statement bar —— */
.site-header {
  background: var(--surface);
  border-bottom: none;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 1px 0 var(--border), 0 2px 0 var(--border-navy);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.95rem 0 0.85rem;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  font-size: 1.08rem;
  font-family: var(--serif);
  letter-spacing: -0.01em;
}

.brand:hover { text-decoration: none; color: var(--primary); }

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--primary);
  color: #f5efe3;
  display: grid;
  place-items: center;
  font-family: var(--serif);
  font-size: 0.72rem;
  font-weight: 700;
  flex-shrink: 0;
  border: 2px solid var(--gold-rule);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.15);
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.92rem;
}

.nav-links a {
  color: var(--muted);
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0;
  border-bottom: 1px solid transparent;
  font-weight: 500;
}

.nav-links a:hover {
  color: var(--primary);
  text-decoration: none;
  border-bottom-color: var(--gold-rule);
}

/* —— Hero —— */
.hero {
  padding: 2.1rem 0 0.4rem;
  text-align: center;
}

.hero h1 {
  margin: 0 0 0.65rem;
  font-size: clamp(1.65rem, 4vw, 2.35rem);
  line-height: 1.22;
  letter-spacing: -0.015em;
  font-family: var(--serif);
  font-weight: 600;
  color: var(--ink);
}

.hero .lead {
  margin: 0 auto 1rem;
  max-width: 38rem;
  color: var(--muted);
  font-size: 1.05rem;
}

.disclaimer-banner {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem 0.75rem;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-left: 3px solid var(--primary);
  color: var(--primary);
  font-size: 0.82rem;
  font-weight: 500;
  padding: 0.55rem 1rem;
  border-radius: var(--radius);
  margin: 0.65rem auto 0;
  max-width: 40rem;
  font-family: var(--serif);
  font-style: italic;
}

.disclaimer-banner span:nth-child(even) {
  color: var(--gold-rule);
  font-style: normal;
  font-family: var(--font);
}

/* —— Calculator: certificate frame —— */
.calc-section { padding: 1.35rem 0 2rem; }

.calc-card {
  background: var(--surface);
  border: 1px solid var(--border-navy);
  outline: 1px solid var(--gold-rule);
  outline-offset: 3px;
  border-radius: 0;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.calc-grid {
  display: grid;
  grid-template-columns: 1fr;
}

@media (min-width: 800px) {
  .calc-grid { grid-template-columns: 1.05fr 0.95fr; }
}

.calc-inputs, .calc-results {
  padding: 1.4rem 1.3rem 1.55rem;
}

.calc-results {
  background:
    linear-gradient(180deg, #f7faf8 0%, var(--accent-soft) 100%);
  border-top: 1px solid var(--border);
  position: relative;
}

.calc-results::before {
  content: "CERTIFICATE SUMMARY";
  display: block;
  font-family: var(--serif);
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  color: var(--accent);
  text-align: center;
  margin-bottom: 0.35rem;
  font-weight: 600;
}

@media (min-width: 800px) {
  .calc-results {
    border-top: none;
    border-left: 1px solid var(--border);
  }
}

.calc-inputs h2 {
  margin: 0 0 1rem;
  font-size: 1.2rem;
  font-family: var(--serif);
  font-weight: 600;
  color: var(--ink);
}

.calc-results h2 {
  margin: 0 0 0.85rem;
  font-size: 1.05rem;
  font-family: var(--serif);
  font-weight: 600;
  color: var(--primary);
  text-align: center;
}

.field { margin-bottom: 1rem; }

.field label {
  display: block;
  font-weight: 600;
  font-size: 0.88rem;
  margin-bottom: 0.35rem;
  color: var(--ink);
}

.field .hint {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 400;
  margin-top: 0.25rem;
}

.field input[type="number"],
.field input[type="text"],
.field select {
  width: 100%;
  padding: 0.7rem 0.85rem;
  font-size: 1.05rem;
  min-height: 44px;
  border: 1px solid var(--border);
  border-bottom-color: var(--primary);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  font-family: var(--font);
  font-variant-numeric: tabular-nums;
}

.field input:focus,
.field select:focus {
  outline: 2px solid rgba(30, 58, 95, 0.28);
  border-color: var(--primary);
}

.input-with-prefix {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--border);
  border-bottom-color: var(--primary);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
}

.input-with-prefix:focus-within {
  outline: 2px solid rgba(30, 58, 95, 0.28);
  border-color: var(--primary);
}

.input-with-prefix .prefix {
  display: inline-flex;
  align-items: center;
  padding: 0 0.75rem;
  background: var(--surface-soft);
  color: var(--primary);
  font-weight: 700;
  font-family: var(--serif);
  border-right: 1px solid var(--border);
  min-height: 44px;
}

.input-with-prefix input {
  border: none !important;
  border-radius: 0 !important;
  outline: none !important;
  flex: 1;
  min-width: 0;
}

.input-with-suffix {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--border);
  border-bottom-color: var(--primary);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
}

.input-with-suffix:focus-within {
  outline: 2px solid rgba(30, 58, 95, 0.28);
  border-color: var(--primary);
}

.input-with-suffix input {
  border: none !important;
  border-radius: 0 !important;
  outline: none !important;
  flex: 1;
  min-width: 0;
}

.input-with-suffix .suffix {
  display: inline-flex;
  align-items: center;
  padding: 0 0.75rem;
  background: var(--surface-soft);
  color: var(--primary);
  font-weight: 700;
  font-family: var(--serif);
  border-left: 1px solid var(--border);
  min-height: 44px;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  background: var(--surface-soft);
  padding: 0;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
}

.segmented label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 44px;
  margin: 0;
  font-weight: 600;
  font-size: 0.88rem;
  border-radius: 0;
  cursor: pointer;
  color: var(--muted);
  border-right: 1px solid var(--border);
}

.segmented label:last-child { border-right: none; }

.segmented input { position: absolute; opacity: 0; pointer-events: none; }

.segmented label:has(input:checked) {
  background: var(--primary);
  color: #f5efe3;
  box-shadow: none;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.5rem;
}

.btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 0.7rem 1.2rem;
  min-height: 44px;
  font-size: 0.92rem;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: background 0.15s, transform 0.05s, border-color 0.15s;
}

.btn:active { transform: scale(0.98); }

.btn-primary {
  background: var(--primary);
  color: #f5efe3;
  border-color: var(--primary-hover);
}

.btn-primary:hover { background: var(--primary-hover); }

.btn-secondary {
  background: var(--surface);
  color: var(--primary);
  border: 1px solid var(--border-navy);
}

.btn-secondary:hover { background: var(--surface-soft); }

.result-big {
  text-align: center;
  padding: 0.35rem 0 1.1rem;
  border-bottom: 1px double var(--gold-rule);
  margin-bottom: 1rem;
}

.result-big .label {
  font-size: 0.78rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 600;
  font-family: var(--font);
}

.result-big .value {
  font-size: clamp(1.9rem, 5vw, 2.5rem);
  font-weight: 700;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  margin: 0.2rem 0;
  font-family: var(--serif);
}

.result-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  margin-bottom: 0.75rem;
  border: 1px solid var(--border);
  background: var(--surface);
}

.stat {
  background: transparent;
  border: none;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  padding: 0.8rem 0.75rem;
  text-align: left;
}

.stat:nth-child(2n) { border-right: none; }
.stat:nth-last-child(-n+2) { border-bottom: none; }

.stat .label {
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.2rem;
}

.stat .value {
  font-size: 1.12rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  font-family: var(--mono);
}

.error-msg {
  color: var(--danger);
  font-size: 0.9rem;
  margin: 0.5rem 0 0;
  display: none;
}

.error-msg.visible { display: block; }

.rates-meta {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.85rem;
  text-align: center;
  font-family: var(--serif);
  font-style: italic;
}

/* —— Schedule: passbook / ledger —— */
.schedule-card {
  margin-top: 1.35rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid var(--primary);
  border-radius: 0;
  box-shadow: var(--shadow);
  padding: 1.25rem 1.25rem 1.35rem;
}

.schedule-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid var(--gold-rule);
}

.schedule-header h2 {
  margin: 0;
  font-size: 1.25rem;
  font-family: var(--serif);
  font-weight: 600;
  color: var(--ink);
}

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.schedule-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.schedule-table th,
.schedule-table td {
  text-align: left;
  padding: 0.6rem 0.5rem;
  border-bottom: 1px solid #e5dfd3;
  font-variant-numeric: tabular-nums;
}

.schedule-table th {
  font-size: 0.72rem;
  color: var(--primary);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--primary);
}

.schedule-table td.num { text-align: right; font-family: var(--mono); }
.schedule-table th.num { text-align: right; }

.schedule-table tbody tr:nth-child(even) {
  background: rgba(240, 235, 225, 0.45);
}

.schedule-table tfoot th,
.schedule-table tfoot td {
  border-bottom: none;
  background: var(--accent-soft);
  font-weight: 700;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
  color: var(--accent);
  border-top: 2px solid var(--accent);
}

.schedule-table .empty-row td {
  color: var(--muted);
  text-align: center;
  font-style: italic;
  font-family: var(--serif);
}

/* —— Content —— */
.content-section { padding: 2rem 0; }

.content-section h2 {
  margin: 0 0 0.85rem;
  font-size: 1.5rem;
  letter-spacing: -0.01em;
  font-family: var(--serif);
  font-weight: 600;
  color: var(--ink);
}

.content-section p, .content-section li { color: var(--muted); }
.content-section p { margin: 0 0 0.85rem; }

.steps {
  display: grid;
  gap: 0.85rem;
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps li {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0;
  padding: 1rem 1rem 1rem 3.4rem;
  position: relative;
  color: var(--text);
  border-left: 3px solid var(--primary);
}

.steps li::before {
  counter-increment: step;
  content: counter(step, decimal-leading-zero);
  position: absolute;
  left: 0.75rem;
  top: 1rem;
  width: auto;
  height: auto;
  border-radius: 0;
  background: transparent;
  color: var(--gold-rule);
  font-weight: 700;
  font-size: 0.95rem;
  font-family: var(--serif);
  display: block;
}

.prose-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0;
  padding: 1.35rem 1.45rem;
  box-shadow: var(--shadow);
}

.prose-card ul { margin: 0 0 0.85rem; padding-left: 1.25rem; }

.faq details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0;
  padding: 0.85rem 1rem;
  margin-bottom: 0.55rem;
  border-left: 2px solid var(--gold-rule);
}

.faq summary {
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  font-family: var(--serif);
}

.faq summary::-webkit-details-marker { display: none; }

.faq summary::after {
  content: "+";
  color: var(--primary);
  font-weight: 400;
  font-family: var(--font);
  flex-shrink: 0;
}

.faq details[open] summary::after { content: "−"; }

.faq details p {
  margin: 0.65rem 0 0.15rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.ad-slot {
  margin: 1.5rem 0;
  min-height: 90px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 0.8rem;
  background: var(--surface-soft);
}

.site-footer {
  border-top: 2px solid var(--primary);
  background: var(--primary);
  color: #d9e2ec;
  padding: 2rem 0 2.5rem;
  margin-top: 1.25rem;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  justify-content: space-between;
  align-items: flex-start;
}

.footer-brand {
  font-weight: 600;
  margin-bottom: 0.35rem;
  font-family: var(--serif);
  font-size: 1.05rem;
  color: #f5efe3;
}

.footer-note {
  font-size: 0.85rem;
  color: #a8b8c8;
  max-width: 28rem;
  margin: 0;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.9rem;
}

.footer-links a {
  color: #d9e2ec;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.footer-links a:hover { color: #f5efe3; }

.legal-page { padding: 2rem 0 3rem; }

.legal-page h1 {
  margin: 0 0 1rem;
  font-size: 1.75rem;
  font-family: var(--serif);
}

.legal-page h2 {
  margin: 1.75rem 0 0.5rem;
  font-size: 1.15rem;
  font-family: var(--serif);
}

.legal-page p, .legal-page li { color: var(--muted); }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.print-only { display: none; }

@media (max-width: 640px) {
  .container { width: min(100% - 1.25rem, 960px); }
  .nav {
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
    padding: 0.75rem 0;
  }
  .brand { font-size: 0.98rem; max-width: 100%; }
  .nav-links {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 0.35rem 1rem;
    overflow: visible;
  }
  .nav-links a {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    min-height: 44px;
    padding: 0.35rem 0;
    border-radius: 0;
    background: transparent;
    font-size: 0.88rem;
    color: var(--primary);
    border-bottom: 1px solid var(--border);
  }
  .nav-links a:hover {
    text-decoration: none;
    border-bottom-color: var(--gold-rule);
    background: transparent;
  }
  .actions { gap: 0.5rem; }
  .actions .btn { flex: 1 1 calc(50% - 0.25rem); text-align: center; }
  .hero { padding-top: 1.45rem; }
  .calc-card {
    outline-offset: 2px;
  }
  .calc-inputs, .calc-results { padding: 1.15rem 1rem 1.3rem; }
  .field-row { grid-template-columns: 1fr; }
  .schedule-card { padding: 1.1rem 1rem 1.2rem; }
}

@media (max-width: 380px) {
  .brand span:last-child { font-size: 0.9rem; }
  .result-stats { grid-template-columns: 1fr; }
  .stat { border-right: none !important; }
  .stat:not(:last-child) { border-bottom: 1px solid var(--border); }
}

@media print {
  .site-header, .hero .disclaimer-banner, .content-section,
  .site-footer, .actions, .ad-slot, .no-print {
    display: none !important;
  }
  .print-only { display: block !important; }
  .calc-card, .schedule-card {
    box-shadow: none;
    outline: none;
    border: 1px solid #ccc;
    break-inside: avoid;
  }
  body { background: #fff; }
  .hero { padding: 0 0 1rem; text-align: left; }
}


/* --- Intent upgrades: term presets, trust line, breadcrumb --- */
.term-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.preset-btn {
  appearance: none;
  min-height: 44px;
  min-width: 44px;
  padding: 0.45rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-soft, #f3efe6);
  color: var(--primary);
  font-weight: 650;
  font-size: 0.85rem;
  cursor: pointer;
  font-family: inherit;
}

.preset-btn:hover {
  border-color: var(--primary);
  background: #fff;
}

.preset-btn.active {
  background: var(--primary);
  color: #f5efe3;
  border-color: var(--primary);
}

.trust-line {
  font-weight: 600;
  color: var(--muted);
}

.breadcrumb {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0 0 0.75rem;
}

.breadcrumb a { color: var(--primary); }

.subtool-nav {
  font-size: 0.95rem;
}

