/* ============================================================
   Cost Calculator page — additional styles
   Same var(--token, fallback) approach as homeowners-additions.css
   so it inherits your real style.css tokens automatically once
   confirmed. See that file's header comment for details.
   ============================================================ */

/* This page is usually shown inside homeowners.html's floating iframe
   frame — its content is taller than that frame, so it scrolls, but the
   browser's default scrollbar down the side looked out of place against
   the rest of the frame's chrome-less design. Content stays fully
   scrollable (wheel/touch/keyboard); only the visible scrollbar track is
   hidden. */
html, body {
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* legacy Edge */
}
html::-webkit-scrollbar, body::-webkit-scrollbar {
  display: none; /* Chrome, Safari, modern Edge */
}

.page-calculator {
  /* Corrected to the real variable names defined in style-v5.css's :root
     (--brick, --chalk, --line, etc.) — same fallback-name bug found and
     fixed in homeowners-additions.css: --rust/--accent/--paper/--hairline/
     --font-* don't actually exist there, so this page had been rendering
     with guessed fallback colors instead of the site's real palette. */
  --c-paper: var(--chalk, #F3EFE5);
  --c-ink: var(--ink, #2A2420);
  --c-ink-soft: var(--ink-soft, #6b6459);
  --c-rust: var(--brick, #A85138);
  --c-card: var(--chalk-2, #EAE4D6);
  --c-line: var(--line, rgba(42, 36, 32, 0.14));
  --c-serif: var(--serif, 'Fraunces', serif);
  --c-sans: var(--sans, 'Work Sans', sans-serif);
  --c-mono: var(--mono, 'IBM Plex Mono', monospace);

  background: var(--c-paper);
  color: var(--c-ink);
}

.calc-header {
  padding: 40px 0 40px;
  border-bottom: 1px solid var(--c-line);
}

.calc-header h1 {
  font-family: var(--c-serif);
  font-weight: 400;
  font-size: clamp(2rem, 3vw + 1rem, 3.2rem);
  margin: 18px 0 20px;
  max-width: 18ch;
}

.calc-header h1 em { color: var(--c-rust); font-style: italic; }

.calc-header-sub {
  font-family: var(--c-sans);
  color: var(--c-ink-soft);
  max-width: 56ch;
  line-height: 1.6;
  font-size: 1.05rem;
}

/* ---------- Layout ---------- */
.calc-body { padding: 60px 0 20px; }

.calc-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 56px;
  align-items: start;
}

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

/* ---------- Inputs ---------- */
.calc-field { margin-bottom: 30px; }

.calc-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--c-mono);
  font-size: 0.85rem;
  letter-spacing: 0.03em;
  color: var(--c-ink-soft);
  margin-bottom: 12px;
}

.calc-label em { font-style: italic; color: var(--c-ink-soft); font-family: var(--c-sans); }

.calc-value-pill {
  font-family: var(--c-mono);
  background: var(--c-card);
  border: 1px solid var(--c-line);
  border-radius: 20px;
  padding: 2px 12px;
  color: var(--c-ink);
}

.calc-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

/* Segmented control */
.segmented {
  display: flex;
  border: 1px solid var(--c-line);
  border-radius: 6px;
  overflow: hidden;
}

.segmented__btn {
  flex: 1;
  padding: 10px 8px;
  font-family: var(--c-sans);
  font-size: 0.9rem;
  background: transparent;
  border: none;
  border-right: 1px solid var(--c-line);
  color: var(--c-ink-soft);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.segmented__btn:last-child { border-right: none; }

.segmented__btn.is-active {
  background: var(--c-rust);
  color: var(--c-paper);
}

/* Slider */
.calc-slider {
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  border-radius: 2px;
  background: var(--c-line);
  outline: none;
}

.calc-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--c-rust);
  cursor: pointer;
  border: 3px solid var(--c-paper);
  box-shadow: 0 0 0 1px var(--c-rust);
}

.calc-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--c-rust);
  cursor: pointer;
  border: 3px solid var(--c-paper);
  box-shadow: 0 0 0 1px var(--c-rust);
}

.calc-slider-scale {
  display: flex;
  justify-content: space-between;
  font-family: var(--c-mono);
  font-size: 0.75rem;
  color: var(--c-ink-soft);
  margin-top: 6px;
}

/* Stepper */
.stepper {
  display: flex;
  align-items: center;
  gap: 16px;
  border: 1px solid var(--c-line);
  border-radius: 6px;
  padding: 8px 16px;
  width: fit-content;
}

.stepper__btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--c-line);
  background: var(--c-paper);
  color: var(--c-ink);
  font-family: var(--c-mono);
  font-size: 1rem;
  cursor: pointer;
  line-height: 1;
}
.stepper__btn:hover { background: var(--c-rust); color: var(--c-paper); border-color: var(--c-rust); }

.stepper__value {
  font-family: var(--c-mono);
  min-width: 1.4ch;
  text-align: center;
}

/* Toggle checkbox */
.calc-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--c-sans);
  font-size: 0.95rem;
  cursor: pointer;
  color: var(--c-ink);
}

.calc-toggle input { position: absolute; opacity: 0; width: 0; height: 0; }

.calc-toggle__box {
  width: 20px;
  height: 20px;
  border: 1px solid var(--c-line);
  border-radius: 4px;
  flex-shrink: 0;
  position: relative;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.calc-toggle input:checked + .calc-toggle__box {
  background: var(--c-rust);
  border-color: var(--c-rust);
}

.calc-toggle input:checked + .calc-toggle__box::after {
  content: '';
  position: absolute;
  left: 6px;
  top: 2px;
  width: 5px;
  height: 10px;
  border: solid var(--c-paper);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.calc-divider {
  height: 1px;
  background: var(--c-line);
  margin: 36px 0 30px;
}

/* ---------- Output ---------- */
.calc-output__card {
  background: var(--c-card);
  border-radius: 6px;
  padding: 36px;
  position: sticky;
  top: 110px;
}

.calc-total {
  font-family: var(--c-serif);
  font-weight: 500;
  font-size: clamp(1.8rem, 2vw + 1rem, 2.4rem);
  margin: 10px 0 6px;
  color: var(--c-ink);
}

.calc-total-sub {
  font-family: var(--c-sans);
  font-size: 0.85rem;
  color: var(--c-ink-soft);
  margin-bottom: 24px;
}

.calc-breakdown { border-top: 1px solid var(--c-line); padding-top: 16px; }

.calc-breakdown__row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-family: var(--c-sans);
  font-size: 0.9rem;
  color: var(--c-ink-soft);
  padding: 8px 0;
  border-bottom: 1px solid var(--c-line);
}
.calc-breakdown__row:last-child { border-bottom: none; }

.calc-cta { margin-top: 26px; width: 100%; justify-content: center; }

.calc-disclaimer {
  font-family: var(--c-sans);
  font-size: 0.82rem;
  line-height: 1.6;
  color: var(--c-ink-soft);
  margin-top: 20px;
  max-width: 46ch;
}

/* ---------- Methodology ---------- */
.calc-methodology {
  padding: 60px 0 100px;
  border-top: 1px solid var(--c-line);
  margin-top: 40px;
}

.methodology-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 24px;
}

@media (max-width: 900px) {
  .methodology-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .methodology-grid { grid-template-columns: 1fr; }
}

.methodology-card h3 {
  font-family: var(--c-serif);
  font-weight: 500;
  font-size: 1.1rem;
  margin-bottom: 10px;
}

.methodology-card p {
  font-family: var(--c-sans);
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--c-ink-soft);
}
