/* ==========================================================================
   SECTION: SAVINGS CALCULATOR — the signature element of the page
   ========================================================================== */

.calc { background: var(--c-base); }

.calc__panel {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 0;
  background: var(--c-white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0,0,0,0.28);
}

/* --- LEFT: inputs --------------------------------------------------------- */

.calc__inputs {
  padding: var(--sp-8);
  background: var(--c-surface);
  border-right: 1px solid var(--c-line);
}
.calc__inputs h3 { margin-bottom: var(--sp-6); }

/* Live readout above the bill slider */
.calc__billout {
  display: flex; align-items: baseline; gap: var(--sp-2);
  margin-bottom: var(--sp-3);
}
.calc__billout strong {
  font-size: 1.75rem; font-weight: var(--w-bold);
  letter-spacing: -0.025em; font-variant-numeric: tabular-nums;
  color: var(--c-ink); line-height: 1;
}
.calc__billout span { font-size: var(--fs-caption); color: var(--c-muted); }

/* --- RIGHT: results ------------------------------------------------------- */

.calc__results {
  padding: var(--sp-8);
  background: var(--c-white);
  display: flex; flex-direction: column;
}

.calc__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--c-line);
  border: 1px solid var(--c-line);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: var(--sp-6);
}

.calc__cell { background: var(--c-white); padding: var(--sp-5); }

.calc__cell--hero { grid-column: 1 / -1; background: rgba(245,166,35,0.10); }

.calc__cell label {
  display: block;
  font-size: var(--fs-eyebrow); font-weight: var(--w-semi);
  letter-spacing: 0.10em; text-transform: uppercase;
  color: var(--c-muted); margin-bottom: var(--sp-2);
}
.calc__cell output {
  display: block;
  font-size: 1.5rem; font-weight: var(--w-bold);
  line-height: 1.1; letter-spacing: -0.022em;
  font-variant-numeric: tabular-nums;
  color: var(--c-ink);
}
.calc__cell--hero output {
  font-size: clamp(2rem, 1.4rem + 2vw, 2.75rem);
  color: var(--c-primary);
}
.calc__cell small {
  display: block;
  font-size: var(--fs-caption); color: var(--c-muted);
  margin-top: var(--sp-1);
}

/* --- PAYBACK CHART -------------------------------------------------------- */

.calc__chart {
  margin-bottom: var(--sp-6);
}
.calc__chart-head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: var(--sp-3);
}
.calc__chart-head h4 {
  font-size: var(--fs-caption); font-weight: var(--w-semi);
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--c-muted);
}
.calc__legend { display: flex; gap: var(--sp-4); font-size: var(--fs-caption); color: var(--c-muted); }
.calc__legend i {
  display: inline-block; width: 10px; height: 2px;
  margin-right: 6px; vertical-align: middle;
}
.calc__legend .k-save { background: var(--c-primary); }
.calc__legend .k-cost { background: var(--c-accent); }

.calc__chart svg { width: 100%; height: auto; display: block; }

/* Lines draw themselves in — length set by JS */
.calc-line {
  fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round;
  transition: stroke-dashoffset 1400ms var(--ease);
}
.calc-line--save { stroke: var(--c-primary); }
.calc-line--cost { stroke: var(--c-accent); stroke-width: 1.5; stroke-dasharray: 4 4; }
.calc-fill { fill: rgba(27,94,58,0.10); }
.calc-axis { stroke: var(--c-line); stroke-width: 1; }
.calc-tick { font-size: 10px; fill: var(--c-muted); font-family: var(--font); font-variant-numeric: tabular-nums; }
.calc-breakeven circle { fill: var(--c-energy); stroke: var(--c-white); stroke-width: 2; }
.calc-breakeven text { font-size: 11px; font-weight: 600; fill: var(--c-ink); font-family: var(--font); }

/* --- LEAD GATE ------------------------------------------------------------ */

.calc__gate {
  margin-top: auto;
  padding-top: var(--sp-6);
  border-top: 1px solid var(--c-line);
}
.calc__gate p {
  font-size: var(--fs-small); color: var(--c-muted);
  margin-bottom: var(--sp-4); max-width: none;
}
.calc__gate-row { display: flex; gap: var(--sp-3); }
.calc__gate-row .field { flex: 1; margin: 0; }
.calc__gate-row .btn { flex-shrink: 0; }

/* The reassurance line under the gate. Centred under the field and button so
   it reads as a promise about the form, not as another label beside it. */
.calc__gate-note {
  margin-top: var(--sp-3);
  text-align: center;
}

/* Runs the full width of the section, matching the panel above it. The global
   readable-line-length cap that applies to body copy is deliberately lifted
   here — as a four-line block under a full-width panel it read as a stray
   column, and at caption size the line length is still comfortable. */
.calc__disclaimer {
  font-size: var(--fs-caption); line-height: 1.5;
  color: rgba(247,245,240,0.50);
  max-width: none;
  margin-top: var(--sp-6);
}

/* --- RESPONSIVE ----------------------------------------------------------- */

@media (max-width: 980px) {
  .calc__panel { grid-template-columns: 1fr; }
  .calc__inputs { border-right: 0; border-bottom: 1px solid var(--c-line); }
}
@media (max-width: 560px) {
  .calc__inputs, .calc__results { padding: var(--sp-6) var(--sp-5); }
  .calc__grid { grid-template-columns: 1fr; }
  .calc__gate-row { flex-direction: column; }
  .calc__gate-row .btn { width: 100%; }
}
