/* =========================================================================
   SOLAR ENERGY — page: savings calculator
   ========================================================================= */

/* ============================ 14. CALCULATOR ============================ */
.calc { background: var(--paper-2); }
.calc__panel {
  display: grid;
  grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr);
  gap: 0;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-lg);
  overflow: hidden;
}

.calc__form { padding: clamp(1.8rem, 3.5vw, 3rem); display: grid; gap: 2.2rem; align-content: start; }

.field { display: grid; gap: .75rem; }
.field__label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
}
.field__out {
  font-size: 1.32rem;
  font-weight: 700;
  color: var(--brand);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
}
.field__help { font-size: .84rem; color: var(--text-muted); }

/* range input */
.slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  border-radius: var(--r-pill);
  background:
    linear-gradient(90deg, var(--brand) var(--fill, 30%), rgba(10,20,14,.09) var(--fill, 30%));
  cursor: pointer;
}
.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--brand);
  box-shadow: 0 3px 10px rgba(10,20,14,.22);
  transition: transform .25s var(--ease-spring), border-color .25s;
}
.slider::-webkit-slider-thumb:hover { transform: scale(1.14); border-color: var(--sun); }
.slider::-moz-range-thumb {
  width: 20px; height: 20px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--brand);
  box-shadow: 0 3px 10px rgba(10,20,14,.22);
}
.slider__scale {
  display: flex;
  justify-content: space-between;
  font-size: .76rem;
  color: var(--text-muted);
  margin-top: -.35rem;
}

.segmented {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: .4rem;
  padding: .35rem;
  background: var(--paper-3);
  border-radius: var(--r-pill);
}
.segmented label { position: relative; }
.segmented input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.segmented span {
  display: block;
  padding: .68rem 1rem;
  text-align: center;
  font-family: var(--font-display);
  font-size: .95rem;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: var(--r-pill);
  transition: all .3s var(--ease-out);
}
.segmented input:checked + span {
  background: var(--paper);
  color: var(--brand);
  box-shadow: var(--sh-sm);
}
.segmented input:focus-visible + span { outline: 3px solid var(--sun); outline-offset: 2px; }

/* results side */
.calc__results {
  padding: clamp(1.8rem, 3.5vw, 3rem);
  background: var(--grad-dark);
  color: #fff;
  display: grid;
  gap: 1.5rem;
  align-content: start;
  position: relative;
  isolation: isolate;
  overflow: hidden;
}
.calc__results::before {
  content: "";
  position: absolute;
  top: -160px; right: -120px;
  width: 420px; height: 420px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,176,32,.28), transparent 66%);
  filter: blur(50px);
  z-index: -1;
}

.result--hero { padding-bottom: 1.4rem; border-bottom: 1px solid rgba(255,255,255,.12); }
.result__label {
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(255,255,255,.55);
}
.result__value {
  font-family: var(--font-display);
  font-size: clamp(3rem, 6vw, 4.2rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -.04em;
  margin-top: .3rem;
  font-variant-numeric: tabular-nums;
  background: var(--grad-sun);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.result__unit { font-size: .32em; margin-left: .1em; }
.result__sub { font-size: .92rem; color: rgba(255,255,255,.68); margin-top: .35rem; }
.result__meter {
  height: 6px;
  margin-top: 1rem;
  border-radius: var(--r-pill);
  background: rgba(255,255,255,.12);
  overflow: hidden;
}
.result__meter span {
  display: block;
  height: 100%;
  border-radius: var(--r-pill);
  background: var(--grad-sun);
  transition: width .6s var(--ease-out);
}
.result__cap {
  font-size: .82rem;
  color: var(--sun-300);
  margin-top: .55rem;
  min-height: 1.2em;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: .85rem;
}
.result-item {
  padding: 1rem 1.15rem;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.09);
  border-radius: var(--r-md);
}
.result-item dt {
  font-size: .78rem;
  color: rgba(255,255,255,.58);
  margin-bottom: .25rem;
}
.result-item dd {
  font-family: var(--font-display);
  font-size: 1.32rem;
  font-weight: 700;
  letter-spacing: -.025em;
  font-variant-numeric: tabular-nums;
}
.result-item--good dd   { color: var(--brand-300); }
.result-item--strong    { background: rgba(255,255,255,.09); border-color: rgba(255,255,255,.18); }
.result-item--sun dd    { color: var(--sun-300); }

.result-eco {
  display: flex;
  gap: .85rem;
  align-items: flex-start;
  padding: 1.05rem 1.2rem;
  background: rgba(23,163,77,.14);
  border: 1px solid rgba(70,197,120,.28);
  border-radius: var(--r-md);
  font-size: .9rem;
  color: rgba(255,255,255,.82);
  line-height: 1.6;
}
.result-eco .icon { width: 1.4rem; height: 1.4rem; color: var(--brand-300); stroke-width: 1.8; flex: none; margin-top: .1rem; }
.result-eco strong { color: #fff; }

.calc__actions { display: grid; gap: .85rem; }
.calc__note { font-size: .8rem; color: rgba(255,255,255,.5); line-height: 1.6; }

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

@media (max-width: 700px) {
  .result-item dd { font-size: 1.16rem; }
}

/* =========================================================================
   CALCULATOR PAGE — additions for the standalone tool page
   ========================================================================= */
.page-hero--short { min-height: clamp(280px, 40vh, 420px); }

.calc { background: var(--paper-2); padding-top: clamp(2.5rem, 5vw, 4rem); }
.calc .calc__panel { margin-top: 0; }

/* four-up segmented control for roof orientation */
.segmented--four span { padding-inline: .35rem; }
.segmented--four span { padding: .6rem .35rem; font-size: .88rem; }

.calc__actions .btn--glass {
  border-color: rgba(255,255,255,.24);
  justify-content: center;
}

/* ---------------- generation profile ---------------- */
.profile { background: var(--paper); }
.profile__card {
  padding: clamp(1.6rem, 3.5vw, 2.75rem);
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-sm);
}
.profile__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1rem;
}
.profile__label {
  font-size: .76rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.profile__big {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 5vw, 3.4rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -.035em;
  color: var(--brand);
  font-variant-numeric: tabular-nums;
  margin-top: .3rem;
}
.profile__big small { font-size: .3em; margin-left: .3rem; color: var(--text-muted); font-weight: 600; }
.profile__peak { text-align: right; }
.profile__peak-value {
  font-family: var(--font-display);
  font-size: 1.16rem;
  font-weight: 600;
  color: var(--sun-ink);
  margin-top: .35rem;
}
.profile__foot {
  margin-top: 2.6rem;
  font-size: .86rem;
  color: var(--text-muted);
  min-height: 1.4em;
}
.profile .chart__bar { cursor: default; }

/* ---------------- assumptions ---------------- */
.assumptions .compare-wrap {
  background: rgba(255,255,255,.04);
  border-color: rgba(255,255,255,.12);
}
.assumptions .compare thead th {
  background: rgba(255,255,255,.05);
  border-bottom-color: rgba(255,255,255,.12);
  color: rgba(255,255,255,.6);
}
.assumptions .compare tbody tr + tr { border-top-color: rgba(255,255,255,.08); }
.assumptions .compare tbody th { color: #fff; }
.assumptions .compare td { color: var(--text-light); }
.assumptions .compare tbody tr:hover { background: rgba(255,255,255,.05); }

.cta-band__lead {
  max-width: 54ch;
  font-size: clamp(1rem, 1.3vw, 1.12rem);
  line-height: 1.7;
  color: rgba(42,24,3,.78);
}

@media (max-width: 700px) {
  .segmented--four { grid-auto-flow: row; grid-template-columns: repeat(2, 1fr); }
  .profile__peak { text-align: left; }
}
