/* Tools page — retirement calculators.
   Builds on pages.css tokens; everything here is prefixed nq-calc- so it can't
   collide with existing page styles. */

.nq-calc-section { background: var(--nq-cream); padding: 40px 32px 56px; }
.nq-calc-inner { max-width: 1240px; margin: 0 auto; }

/* ── Tabs ─────────────────────────────────────────────────────────────── */
.nq-calc-tabs {
  display: flex; gap: 8px; flex-wrap: wrap;
  border-bottom: 1px solid var(--border-strong);
  margin-bottom: 28px;
}
.nq-calc-tab {
  appearance: none; border: 0; background: transparent; cursor: pointer;
  font-family: var(--font-sans); font-size: 15px; font-weight: 500;
  color: var(--fg-2); padding: 12px 4px; margin-right: 20px;
  border-bottom: 3px solid transparent; margin-bottom: -1px;
}
.nq-calc-tab:hover { color: var(--nq-navy); }
.nq-calc-tab[aria-selected="true"] { color: var(--nq-navy); border-bottom-color: var(--nq-gold, #B68330); font-weight: 700; }
.nq-calc-tab:focus-visible { outline: 2px solid var(--nq-navy-700); outline-offset: 2px; }

.nq-calc-panel[hidden] { display: none; }
.nq-calc-intro { max-width: 100%; margin: 0 0 24px; }
.nq-calc-intro h2 {
  font-family: var(--font-display); font-weight: 900; color: var(--nq-navy);
  font-size: clamp(28px, 3.4vw, 40px); line-height: 1.05; letter-spacing: -0.03em; margin: 0 0 12px;
}
.nq-calc-intro p { font-size: 16px; line-height: 1.65; color: var(--fg-2); margin: 0; text-align: justify; }

/* ── Layout ───────────────────────────────────────────────────────────── */
.nq-calc-grid { display: grid; grid-template-columns: minmax(300px, 380px) 1fr; gap: 24px; align-items: start; }
@media (max-width: 920px) { .nq-calc-grid { grid-template-columns: 1fr; } }

.nq-calc-card {
  background: #fff; border: 1px solid var(--border-subtle); border-radius: 10px;
  padding: 24px; box-shadow: 0 1px 2px rgba(8, 38, 92, 0.04);
  min-width: 0;
}

/* ── Inputs ───────────────────────────────────────────────────────────── */
.nq-calc-form fieldset { border: 0; padding: 0; margin: 0 0 20px; }
.nq-calc-form fieldset:last-of-type { margin-bottom: 0; }
.nq-calc-form legend {
  font-family: var(--font-sans); font-size: 11px; font-weight: 500;
  letter-spacing: 0.22em; text-transform: uppercase; color: var(--nq-gold, #B68330);
  margin-bottom: 12px; padding: 0;
}
.nq-calc-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.nq-calc-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; min-width: 0; }
.nq-calc-field label { font-size: 13px; font-weight: 500; color: var(--nq-navy); line-height: 1.3; }
.nq-calc-field .hint { font-size: 12px; color: var(--fg-3); line-height: 1.4; }
.nq-calc-input { position: relative; display: flex; align-items: center; }
.nq-calc-input input, .nq-calc-field select {
  width: 100%; box-sizing: border-box;
  font-family: var(--font-mono); font-size: 15px; color: var(--nq-navy);
  background: #fff; border: 1px solid var(--border-strong); border-radius: 6px;
  padding: 10px 12px; min-height: 42px;
}
.nq-calc-field select { font-family: var(--font-sans); font-size: 14px; }
.nq-calc-input input:focus, .nq-calc-field select:focus { outline: 2px solid var(--nq-navy-700); outline-offset: 0; border-color: var(--nq-navy-700); }
.nq-calc-input .pre, .nq-calc-input .suf {
  position: absolute; font-family: var(--font-mono); font-size: 14px; color: var(--fg-3); pointer-events: none;
}
.nq-calc-input .pre { left: 12px; }
.nq-calc-input .suf { right: 12px; }
.nq-calc-input.has-pre input { padding-left: 26px; }
.nq-calc-input.has-suf input { padding-right: 34px; }
.nq-calc-input input[aria-invalid="true"] { border-color: var(--nq-negative); background: var(--nq-negative-soft); }

.nq-calc-check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--nq-navy); margin: 4px 0 12px; line-height: 1.4; cursor: pointer; }
.nq-calc-check input { margin-top: 2px; width: 16px; height: 16px; accent-color: var(--nq-navy); flex: none; }

/* ── Results ──────────────────────────────────────────────────────────── */
.nq-calc-results { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.nq-calc-hero-label { font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--fg-3); margin: 0 0 8px; }
.nq-calc-hero-num {
  font-family: var(--font-display); font-weight: 900; color: var(--nq-navy);
  font-size: clamp(40px, 5.6vw, 64px); line-height: 1; letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums; margin: 0;
}
.nq-calc-hero-sub { font-size: 15px; color: var(--fg-2); margin: 10px 0 0; line-height: 1.5; }
.nq-calc-hero-sub strong { color: var(--nq-navy); }

.nq-calc-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-top: 20px; }
.nq-calc-stat { border-top: 1px solid var(--border-subtle); padding-top: 12px; }
.nq-calc-stat .k { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--fg-2); line-height: 1.3; }
.nq-calc-stat .v { font-family: var(--font-mono); font-size: 18px; font-weight: 600; color: var(--nq-navy); margin-top: 4px; font-variant-numeric: tabular-nums; }
.nq-calc-swatch { width: 10px; height: 10px; border-radius: 2px; flex: none; }

.nq-calc-note {
  font-size: 14px; line-height: 1.55; color: var(--nq-navy);
  background: var(--nq-gold-soft, #F6E9CC); border-left: 3px solid var(--nq-gold, #B68330);
  border-radius: 4px; padding: 12px 14px; margin: 16px 0 0;
}
.nq-calc-note[hidden] { display: none; }

/* compare cards (Roth vs Traditional) */
.nq-calc-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 520px) { .nq-calc-compare { grid-template-columns: 1fr; } }
.nq-calc-compare > div { border: 1px solid var(--border-subtle); border-radius: 8px; padding: 16px; position: relative; }
.nq-calc-compare > div.is-ahead { border-color: var(--nq-navy); box-shadow: inset 0 0 0 1px var(--nq-navy); }
.nq-calc-compare .k { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; color: var(--nq-navy); }
.nq-calc-compare .v { font-family: var(--font-display); font-weight: 900; font-size: clamp(26px, 3vw, 34px); color: var(--nq-navy); margin-top: 8px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.nq-calc-compare .d { font-size: 12px; color: var(--fg-3); margin-top: 6px; line-height: 1.45; }
.nq-calc-badge {
  position: absolute; top: 12px; right: 12px; font-size: 10px; font-weight: 700; letter-spacing: 0.14em;
  text-transform: uppercase; color: #fff; background: var(--nq-navy); padding: 3px 7px; border-radius: 3px;
}

/* ── Chart ────────────────────────────────────────────────────────────── */
.nq-calc-chart-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.nq-calc-chart-head h3 { font-family: var(--font-display); font-weight: 700; font-size: 17px; color: var(--nq-navy); margin: 0; }
.nq-calc-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; color: var(--fg-2); }
.nq-calc-legend span { display: inline-flex; align-items: center; gap: 6px; }
.nq-calc-chart { position: relative; width: 100%; }
.nq-calc-chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.nq-calc-chart .axis text { font-family: var(--font-mono); font-size: 11px; fill: var(--fg-3); }
.nq-calc-chart .grid line { stroke: var(--nq-fog-100); stroke-width: 1; }
.nq-calc-chart .baseline { stroke: var(--nq-fog-300); stroke-width: 1; }
.nq-calc-tip {
  position: absolute; pointer-events: none; z-index: 5;
  background: #fff; border: 1px solid var(--border-strong); border-radius: 6px;
  box-shadow: 0 6px 18px rgba(8, 38, 92, 0.12);
  padding: 10px 12px; font-size: 12px; color: var(--nq-navy); min-width: 180px;
  opacity: 0; transition: opacity 0.12s ease; white-space: nowrap;
}
.nq-calc-tip.on { opacity: 1; }
.nq-calc-tip .t { font-weight: 700; margin-bottom: 6px; }
.nq-calc-tip .r { display: flex; align-items: center; gap: 8px; justify-content: space-between; margin-top: 3px; }
.nq-calc-tip .r .l { display: inline-flex; align-items: center; gap: 6px; color: var(--fg-2); }
.nq-calc-tip .r .n { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.nq-calc-tip .r.total { border-top: 1px solid var(--border-subtle); padding-top: 5px; margin-top: 6px; font-weight: 700; }

/* ── Table view ───────────────────────────────────────────────────────── */
.nq-calc-table { margin-top: 16px; }
.nq-calc-table summary { cursor: pointer; font-size: 13px; font-weight: 500; color: var(--nq-navy-700); }
.nq-calc-table-wrap { overflow-x: auto; margin-top: 12px; max-height: 360px; overflow-y: auto; border: 1px solid var(--border-subtle); border-radius: 6px; }
.nq-calc-table table { width: 100%; border-collapse: collapse; font-size: 12px; }
.nq-calc-table th, .nq-calc-table td { padding: 7px 10px; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--nq-fog-100); }
.nq-calc-table th { position: sticky; top: 0; background: var(--nq-fog-50); color: var(--nq-navy); font-weight: 500; }
.nq-calc-table td { font-family: var(--font-mono); color: var(--fg-1); font-variant-numeric: tabular-nums; }
.nq-calc-table th:first-child, .nq-calc-table td:first-child { text-align: left; }

/* ── Disclosure ───────────────────────────────────────────────────────── */
.nq-calc-disclosure { margin-top: 28px; padding: 20px 24px; background: #fff; border: 1px solid var(--border-subtle); border-radius: 10px; }
.nq-calc-disclosure h3 { font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--fg-3); margin: 0 0 10px; font-weight: 500; }
.nq-calc-disclosure p, .nq-calc-disclosure li { font-size: 12.5px; line-height: 1.65; color: var(--fg-2); }
.nq-calc-disclosure p { margin: 0 0 8px; text-align: justify; }
.nq-calc-disclosure ul { margin: 0 0 8px; padding-left: 18px; max-width: 110ch; }

@media (max-width: 640px) {
  .nq-calc-section { padding: 28px 16px 40px; }
  .nq-calc-card { padding: 18px; }
  .nq-calc-row { grid-template-columns: 1fr; gap: 0; }
}

/* CTA button — undo the .bp-prose link underline/padding it sits inside */
.bp-prose a.nq-calc-cta-btn {
  padding: 14px 26px; border: 0; color: #fff;
  display: inline-flex; align-items: center; justify-content: center; line-height: 1;
}
.bp-prose a.nq-calc-cta-btn:hover { color: #fff; }

.nq-calc-form .hint a { color: var(--nq-navy-700); text-decoration: underline; }
.nq-calc-linkbtn { appearance: none; border: 0; background: none; padding: 0; font: inherit; color: var(--nq-navy-700); text-decoration: underline; cursor: pointer; }
.nq-calc-form [hidden] { display: none !important; }
.nq-calc-hint { font-size: 12px; color: var(--fg-3); line-height: 1.5; margin: -4px 0 14px; }
.nq-calc-hint strong { color: var(--nq-navy); }
.nq-calc-hint a { color: var(--nq-navy-700); text-decoration: underline; }

/* ── Booking prompts inside results ───────────────────────────────────── */
.nq-calc-prompt { margin: 16px 0 0; padding: 14px 16px; border: 1px solid var(--nq-navy-100, #DEE5F1); background: var(--nq-cream, #F4F7FB); border-radius: 8px; }
.nq-calc-prompt[hidden] { display: none; }
.nq-calc-prompt p { font-size: 14px; line-height: 1.55; color: var(--fg-2); margin: 0 0 12px; }
.nq-calc-prompt p strong { color: var(--nq-navy); }
.nq-calc-prompt-actions { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.nq-calc-prompt-actions .nq-btn { padding: 10px 16px; font-size: 14px; }

/* ── Email me my results ──────────────────────────────────────────────── */
.nq-email { margin-top: 28px; display: grid; grid-template-columns: 1fr minmax(300px, 460px); gap: 32px; align-items: start; scroll-margin-top: 90px; }
@media (max-width: 920px) { .nq-email { grid-template-columns: 1fr; gap: 20px; } }
.nq-email-eyebrow { font-size: 11px; font-weight: 500; letter-spacing: 0.22em; text-transform: uppercase; color: var(--nq-gold, #B68330); margin: 0 0 8px; }
.nq-email-copy h2 { font-family: var(--font-display); font-weight: 900; color: var(--nq-navy); font-size: clamp(24px, 2.6vw, 32px); line-height: 1.1; letter-spacing: -0.02em; margin: 0 0 12px; }
.nq-email-copy p { font-size: 15px; line-height: 1.6; color: var(--fg-2); margin: 0 0 16px; }
.nq-email-copy .nq-email-small { margin-top: 10px; }
.nq-email form { display: flex; flex-direction: column; gap: 4px; }
.nq-email .nq-calc-input input { font-family: var(--font-sans); }
.nq-email .nq-calc-input input[aria-invalid="true"] { border-color: var(--nq-negative); background: var(--nq-negative-soft); }
.nq-email .nq-calc-check { font-size: 13px; color: var(--fg-2); }
.nq-email .nq-calc-check span { line-height: 1.5; }
.nq-optional { font-style: normal; color: var(--fg-3); }
.nq-email form .nq-btn { align-self: flex-start; margin-top: 8px; }
.nq-email form .nq-btn[disabled] { opacity: .55; cursor: not-allowed; }
.nq-form-note { font-size: 12px; line-height: 1.55; color: var(--fg-3); margin: 6px 0 0; }
.nq-form-note a { color: var(--nq-navy-700); text-decoration: underline; }
.nq-form-error { font-size: 13px; line-height: 1.5; margin: 10px 0 0; padding: 10px 12px; border-radius: 6px; background: var(--nq-negative-soft); color: var(--nq-negative); }
.nq-form-error[hidden] { display: none; }
.nq-form-error a { color: inherit; text-decoration: underline; }
.nq-hp { position: absolute !important; left: -10000px !important; width: 1px; height: 1px; overflow: hidden; }
.nq-ts:empty { display: none; }
.nq-email-done { padding: 20px; border: 1px solid var(--nq-positive, #1E7A52); background: var(--nq-positive-soft, #D8EBE0); border-radius: 8px; outline: none; }
.nq-email-done[hidden] { display: none; }
.nq-email-done h3 { font-family: var(--font-display); font-size: 20px; color: var(--nq-navy); margin: 0 0 8px; }
.nq-email-done p { font-size: 14px; line-height: 1.6; color: var(--fg-1); margin: 0 0 10px; }
.nq-email-done .nq-ref { font-family: var(--font-mono); font-size: 12px; color: var(--fg-2); }

.nq-disc-version { font-size: 11.5px !important; color: var(--fg-3) !important; margin-top: 10px !important; }

/* ── Bottom CTA row ───────────────────────────────────────────────────── */
.nq-calc-cta-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.bp-prose a.nq-calc-cta-btn.nq-btn-outline { color: var(--nq-navy); border: 1px solid var(--nq-navy); background: #fff; }
.bp-prose a.nq-calc-cta-btn.nq-btn-outline:hover { color: var(--nq-navy); background: var(--nq-navy-100, #DEE5F1); }
