/* Live savings calculator — guide-specific. Pairs with src/calculator.js and
   the markup in src/sections/01-calculator.html. Built on the shared tokens. */

.calc {
  margin: 32px 0 12px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  align-items: stretch;
}

/* Left: the inputs panel */
.calc-inputs {
  background: var(--tm-white);
  border: 1px solid var(--border-1);
  border-radius: var(--radius-lg);
  padding: 26px 26px 22px;
  box-shadow: var(--shadow-sm);
}
.calc-inputs .calc-legend {
  font-family: var(--font-body);
  font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--tm-slate-500); font-weight: 700;
  margin-bottom: 18px;
}
.calc-field { margin-bottom: 18px; }
.calc-field:last-child { margin-bottom: 0; }
.calc-field label {
  display: block;
  font-family: var(--font-display);
  font-weight: 700; font-size: 14.5px;
  color: var(--tm-ink);
  margin-bottom: 7px;
}
.calc-field .calc-hint {
  font-weight: 500; font-size: 12.5px; color: var(--tm-slate-500);
  font-family: var(--font-body); margin-left: 6px;
}
.calc-input-wrap { position: relative; display: flex; align-items: center; }
.calc-input-wrap .calc-prefix,
.calc-input-wrap .calc-suffix {
  position: absolute;
  font-family: var(--font-mono); font-size: 14px; font-weight: 600;
  color: var(--tm-slate-400);
  pointer-events: none;
}
.calc-input-wrap .calc-prefix { left: 14px; }
.calc-input-wrap .calc-suffix { right: 14px; }
.calc input[type="number"] {
  width: 100%;
  font-family: var(--font-mono);
  font-size: 17px; font-weight: 600;
  color: var(--tm-ink);
  background: var(--tm-bg);
  border: 1.5px solid var(--border-1);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  transition: border-color 160ms, box-shadow 160ms, background 160ms;
  -moz-appearance: textfield;
}
.calc input.has-prefix { padding-left: 30px; }
.calc input.has-suffix { padding-right: 64px; }
.calc input[type="number"]:focus {
  outline: none;
  border-color: var(--tm-orange);
  background: var(--tm-white);
  box-shadow: 0 0 0 3px var(--tm-orange-100);
}
.calc input[type="number"]::-webkit-outer-spin-button,
.calc input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* Rate presets */
.calc-presets { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.calc-preset {
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 12px; font-weight: 600;
  color: var(--tm-slate-700);
  background: var(--tm-slate-100);
  border: 1.5px solid transparent;
  border-radius: 999px;
  padding: 6px 13px;
  transition: all 150ms;
}
.calc-preset:hover { background: var(--tm-indigo-100); }
.calc-preset.is-active {
  background: var(--tm-indigo);
  color: #fff;
  border-color: var(--tm-indigo);
}

/* Right: the result panel */
.calc-result {
  position: relative; overflow: hidden;
  background: linear-gradient(150deg, var(--tm-indigo) 0%, var(--tm-indigo-700) 55%, var(--tm-indigo-900) 100%);
  border-radius: var(--radius-lg);
  padding: 30px 30px 26px;
  color: #fff;
  display: flex; flex-direction: column; justify-content: center;
  box-shadow: var(--shadow-md);
}
.calc-result::before {
  content: '';
  position: absolute; right: -120px; top: -80px;
  width: 320px; height: 320px;
  background: radial-gradient(circle, rgba(247,148,29,0.28) 0%, transparent 70%);
  border-radius: 50%; pointer-events: none;
}
.calc-result-eyebrow {
  position: relative; z-index: 1;
  font-family: var(--font-body);
  font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--tm-orange); font-weight: 700;
  margin-bottom: 10px;
}
.calc-result-headline {
  position: relative; z-index: 1;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(46px, 8vw, 76px);
  line-height: 0.95; letter-spacing: -0.03em;
  color: #fff;
  margin-bottom: 6px;
}
.calc-result-headline .calc-per { color: rgba(255,255,255,0.6); font-size: 26px; font-weight: 700; letter-spacing: 0; }
.calc-result-sub {
  position: relative; z-index: 1;
  font-family: var(--font-body);
  font-size: 14px; color: rgba(255,255,255,0.78);
  line-height: 1.5; margin-bottom: 22px; max-width: 36ch;
}
.calc-breakdown {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px;
  border-top: 1px solid rgba(255,255,255,0.14); padding-top: 18px;
}
.calc-bd { text-align: left; }
.calc-bd-v {
  font-family: var(--font-display); font-weight: 800;
  font-size: 22px; color: var(--tm-yellow); line-height: 1;
  letter-spacing: -0.02em;
}
.calc-bd-k {
  font-family: var(--font-body); font-size: 11px; font-weight: 600;
  color: rgba(255,255,255,0.62); letter-spacing: 0.04em;
  margin-top: 6px;
}

.calc-formula {
  margin: 4px 0 0;
  font-family: var(--font-mono);
  font-size: 12.5px; color: var(--tm-slate-500);
  background: var(--tm-slate-100);
  border-radius: var(--radius-md);
  padding: 11px 16px;
  line-height: 1.6;
}
.calc-formula strong { color: var(--tm-indigo); font-weight: 600; }

@media (max-width: 720px) {
  .calc { grid-template-columns: 1fr; }
}

/* Print: the calculator is interactive, so in the PDF show the seeded default
   scenario as a static figure rather than empty inputs. The values are already
   computed into the DOM by calculator.js before the PDF snapshot. */
@media print {
  .calc { grid-template-columns: 1fr 1fr; break-inside: avoid; }
  .calc-presets { display: none; }
  .calc input[type="number"] { background: #fff; border-color: var(--border-1); }
}

/* Flowchart (Mermaid) — the shared theme renders node labels too dark on the
   indigo node fill. Force white text on the boxes, scoped to this guide only so
   the n8n-not-dead diagram theme is untouched. */
.mermaid .nodeLabel,
.mermaid .nodeLabel p,
.mermaid .node .label,
.mermaid span.nodeLabel { color: #FFFFFF !important; }
.mermaid .node text,
.mermaid text.nodeLabel { fill: #FFFFFF !important; }
