/* ==========================================================================
   Four Buckets — shared "calculator page" styles
   Loaded by /rmd-calculator/, /mortgage-payoff-calculator/, and future tools.
   Foundational palette/body/nav/footer live in /css/shared.css.
   ========================================================================== */

main { position: relative; z-index: 1; }

/* ── Page header / intro ── */
.page-header {
  padding: 7rem 1.5rem 3rem;
  max-width: 880px;
  margin: 0 auto;
  text-align: center;
}

.page-header .eyebrow {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold2);
  background: rgba(212,168,50,0.12);
  border: 1px solid rgba(212,168,50,0.3);
  padding: 0.3rem 0.9rem;
  border-radius: 999px;
  margin-bottom: 1.5rem;
}

main h1, .page-header h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2.1rem, 4.6vw, 3.6rem);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 1.5rem;
}
main h1 em, .page-header h1 em { font-style: italic; color: var(--teal2); }

.intro-text {
  font-size: 1.05rem;
  font-weight: 300;
  color: rgba(255,255,255,0.7);
  line-height: 1.75;
  text-align: left;
  max-width: 760px;
  margin: 0 auto;
}
.intro-text p + p { margin-top: 1rem; }

/* ── Calculator section (two-pane form + result) ── */
.calculator {
  max-width: 1100px;
  margin: 2rem auto 0;
  padding: 0 1.5rem;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 1.75rem;
  align-items: stretch;
}

.calc-form, .result-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 2rem;
}

.calc-form h2, .result-card h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem 1.25rem;
}

.form-grid .full { grid-column: 1 / -1; }

.input-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: rgba(255,255,255,0.7);
  margin-bottom: 0.4rem;
  letter-spacing: 0.01em;
}

.input-group .help {
  font-size: 0.7rem;
  color: rgba(255,255,255,0.4);
  margin-top: 0.35rem;
  line-height: 1.4;
}

.input-group input {
  width: 100%;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px;
  padding: 0.7rem 0.85rem;
  color: var(--white);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.18s, background 0.18s;
}
.input-group input::placeholder { color: rgba(255,255,255,0.3); }
.input-group input:focus {
  border-color: var(--teal);
  background: rgba(255,255,255,0.10);
}
.input-group input.error {
  border-color: rgba(239,68,68,0.6);
}

.input-group .with-suffix, .input-group .with-prefix {
  position: relative;
}
.input-group .with-suffix input { padding-right: 2.2rem; }
.input-group .with-prefix input { padding-left: 2rem; }
.input-group .with-suffix .suffix,
.input-group .with-prefix .prefix {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255,255,255,0.4);
  font-size: 0.9rem;
  pointer-events: none;
}
.input-group .with-suffix .suffix { right: 0.85rem; }
.input-group .with-prefix .prefix { left: 0.85rem; }

.field-error {
  color: #fca5a5;
  font-size: 0.72rem;
  margin-top: 0.35rem;
  min-height: 1em;
}

/* ── Result card ── */
.result-card { display: flex; flex-direction: column; }

.result-status {
  display: inline-block;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.45);
  margin-bottom: 0.6rem;
}

.result-headline {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.15rem, 2vw, 1.45rem);
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 1rem;
  color: var(--white);
}
.result-headline + .result-headline { margin-top: 0.25rem; }
.result-headline .amount {
  color: var(--gold2);
  font-style: italic;
}
.result-headline .accent,
.result-headline .age,
.result-headline .year,
.result-headline .date,
.result-headline .duration { color: var(--teal2); }

.result-meta {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: auto;
}

.result-note {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.6);
  line-height: 1.55;
  background: rgba(13,148,136,0.06);
  border-left: 3px solid var(--teal);
  padding: 0.7rem 0.9rem;
  border-radius: 0 6px 6px 0;
}
.result-note.gold {
  background: rgba(212,168,50,0.06);
  border-left-color: var(--gold);
}
.result-note.warn {
  background: rgba(239,68,68,0.07);
  border-left-color: rgba(239,68,68,0.8);
  color: rgba(255,255,255,0.75);
}
.result-note strong { color: var(--white); font-weight: 600; }

.result-empty {
  color: rgba(255,255,255,0.4);
  font-size: 0.95rem;
  font-family: 'DM Sans', sans-serif;
  font-style: normal;
  line-height: 1.6;
}

/* ── Results detail (chart + table) ── */
.results-detail {
  max-width: 1100px;
  margin: 2.5rem auto 0;
  padding: 0 1.5rem;
}

.results-detail.hidden { display: none; }

.chart-wrap {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}
.chart-wrap h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 1rem;
}
.chart-wrap .chart-container {
  position: relative;
  height: 320px;
  width: 100%;
}

.table-wrap {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  overflow: hidden;
}
.table-wrap-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.5rem 0.75rem;
  flex-wrap: wrap;
}
.table-wrap h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  font-weight: 700;
}
/* When <h3> is a direct child of .table-wrap (no header bar), give it the
   padding the header bar normally provides. */
.table-wrap > h3 {
  padding: 1.25rem 1.5rem 0.75rem;
}
.table-toggle {
  display: inline-flex;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  padding: 2px;
  font-size: 0.78rem;
}
.table-toggle button {
  background: none;
  border: none;
  color: rgba(255,255,255,0.55);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.78rem;
  font-weight: 500;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}
.table-toggle button:hover { color: var(--white); }
.table-toggle button.active {
  background: rgba(13,148,136,0.18);
  color: var(--white);
}
.table-scroll {
  overflow-x: auto;
  overflow-y: auto;
}
.table-scroll.tall { max-height: 480px; }
.results-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.results-table th, .results-table td {
  padding: 0.7rem 1rem;
  text-align: right;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  white-space: nowrap;
}
.results-table th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255,255,255,0.5);
  font-weight: 600;
  background: rgba(255,255,255,0.03);
  position: sticky;
  top: 0;
  z-index: 1;
}
.results-table th:first-child, .results-table td:first-child {
  text-align: left;
  padding-left: 1.5rem;
}
.results-table tbody tr:hover { background: rgba(255,255,255,0.02); }
.results-table tbody tr:last-child td { border-bottom: none; }
.results-table tbody tr.year-end td {
  background: rgba(212,168,50,0.04);
  font-weight: 500;
}

.table-footnote {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.35);
  padding: 0.85rem 1.5rem;
  border-top: 1px solid rgba(255,255,255,0.05);
  line-height: 1.5;
}

/* ── Waitlist CTA box ── */
.waitlist-cta-box {
  max-width: 760px;
  margin: 3rem auto;
  padding: 2rem 2.25rem;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(212,168,50,0.3);
  border-left: 4px solid var(--gold);
  border-radius: 14px;
  text-align: center;
}
.waitlist-cta-box h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 0.6rem;
}
.waitlist-cta-box p {
  color: rgba(255,255,255,0.65);
  font-size: 0.95rem;
  line-height: 1.65;
  margin-bottom: 1.5rem;
}
.waitlist-cta-box a {
  display: inline-block;
  background: var(--gold);
  color: var(--navy);
  text-decoration: none;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: background 0.2s, transform 0.15s;
}
.waitlist-cta-box a:hover { background: var(--gold2); transform: translateY(-1px); }

/* ── FAQ ── */
.faq-section {
  max-width: 800px;
  margin: 4rem auto 5rem;
  padding: 0 1.5rem;
}
.faq-section h2 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 700;
  text-align: center;
  margin-bottom: 2.5rem;
}

.faq details {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 1rem 1.25rem;
  margin-bottom: 0.75rem;
  transition: border-color 0.15s, background 0.15s;
}
.faq details[open] {
  border-color: rgba(13,148,136,0.3);
  background: rgba(255,255,255,0.05);
}
.faq summary {
  cursor: pointer;
  font-family: 'Playfair Display', serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--white);
  list-style: none;
  position: relative;
  padding-right: 1.5rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: '+';
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.4rem;
  font-weight: 300;
  color: var(--gold);
  transition: transform 0.2s;
}
.faq details[open] summary::after { content: '−'; }
.faq details > div {
  margin-top: 0.85rem;
  font-size: 0.95rem;
  color: rgba(255,255,255,0.7);
  line-height: 1.7;
}
.faq details > div p + p { margin-top: 0.75rem; }

/* ── Disclaimer ── */
.disclaimer {
  max-width: 800px;
  margin: 0 auto 4rem;
  padding: 1.25rem 1.5rem;
  font-size: 0.78rem;
  color: rgba(255,255,255,0.4);
  line-height: 1.6;
  text-align: center;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .page-header { padding: 6rem 1.25rem 2rem; }
  .calculator { grid-template-columns: 1fr; gap: 1rem; padding: 0 1.25rem; }
  .calc-form, .result-card { padding: 1.5rem; }
  .form-grid { grid-template-columns: 1fr; }
  .results-detail { padding: 0 1.25rem; }
  .chart-wrap .chart-container { height: 260px; }
  .results-table { font-size: 0.78rem; }
  .results-table th, .results-table td { padding: 0.55rem 0.6rem; }
  .results-table th:first-child, .results-table td:first-child { padding-left: 0.85rem; }
  .waitlist-cta-box { padding: 1.5rem 1.25rem; margin: 2rem 1.25rem; }
  .faq-section { padding: 0 1.25rem; }
  .table-wrap-header { padding: 1rem 1.25rem 0.5rem; }
}
