/* ==========================================================================
   Carbotrack — pages.css
   Page-specific styling
   ========================================================================== */

/* ==========================================================================
   1. HOME — HERO
   ========================================================================== */
.hero {
  position: relative;
  overflow: hidden;
  padding-block: 3.5rem 7rem;
  background: linear-gradient(180deg, var(--forest-50) 0%, var(--earth) 55%, rgba(239, 233, 220, .35) 100%);
  border-bottom: 1px solid var(--forest-100);
}

@media (min-width: 768px) { .hero { padding-block: 5rem 8rem; } }

.hero::before,
.hero::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(70px);
}

.hero::before {
  top: -4rem;
  left: 50%;
  transform: translateX(-50%);
  width: min(90%, 80rem);
  height: 24rem;
  background: rgba(52, 211, 153, .10);
}

.hero::after {
  bottom: -6rem;
  right: -4rem;
  width: 20rem;
  height: 20rem;
  background: rgba(157, 196, 177, .22);
}

.hero__grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  align-items: center;
}

@media (min-width: 1024px) {
  .hero__grid { grid-template-columns: 7fr 5fr; }
}

.hero__title {
  font-size: clamp(2.1rem, 5.2vw, 3.65rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -.02em;
  color: var(--forest-950);
}

.hero__title em {
  font-style: normal;
  color: var(--forest-600);
  text-decoration: underline wavy var(--leaf-400);
  text-underline-offset: 8px;
  text-decoration-thickness: 2px;
}

.hero__lede {
  margin-top: 1.35rem;
  font-size: clamp(1rem, 2vw, 1.15rem);
  color: #475569;
  line-height: 1.75;
  max-width: 40rem;
}

.hero__cta {
  display: flex;
  flex-direction: column;
  gap: .85rem;
  margin-top: 1.85rem;
}

@media (min-width: 640px) { .hero__cta { flex-direction: row; } }

.hero__pills {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(197, 221, 207, .7);
}

/* ---- Benchmark infographic card ---------------------------------------- */
.benchmark-card {
  position: relative;
  background: #fff;
  border: 1px solid var(--forest-100);
  border-radius: var(--r-2xl);
  padding: 2rem;
  box-shadow: var(--sh-xl);
}

.benchmark-card__flag {
  position: absolute;
  top: -.75rem;
  right: -.75rem;
  background: var(--leaf-500);
  color: #fff;
  font-size: .65rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: .35rem .8rem;
  border-radius: var(--r-pill);
  box-shadow: var(--sh-md);
}

.benchmark-card__title {
  font-size: 1.15rem;
  margin-bottom: .4rem;
}

.benchmark-card__sub {
  font-size: .72rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.benchmark-card__tip {
  margin-top: 1.5rem;
  padding: 1rem;
  background: var(--forest-50);
  border: 1px solid rgba(197, 221, 207, .8);
  border-radius: var(--r-lg);
  display: flex;
  gap: .75rem;
  align-items: flex-start;
  font-size: .72rem;
  line-height: 1.7;
  color: var(--forest-800);
}

/* ==========================================================================
   2. HOME — PROBLEM GRID
   ========================================================================== */
.problem-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.75rem;
}

@media (min-width: 768px)  { .problem-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .problem-grid { grid-template-columns: repeat(4, 1fr); } }

/* ==========================================================================
   3. CALCULATOR PAGE
   ========================================================================== */
.calc-shell {
  background: #fff;
  border: 1px solid var(--forest-100);
  border-radius: var(--r-2xl);
  box-shadow: var(--sh-xl);
  overflow: hidden;
}

.calc-head {
  background: var(--forest-900);
  color: #fff;
  padding: 2rem;
}

.calc-head__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: .78rem;
  font-weight: 600;
  margin-bottom: .75rem;
}

.calc-head__step { color: var(--leaf-400); text-transform: uppercase; letter-spacing: .08em; }
.calc-head__pct  { color: #cbd5e1; }

/* Step badges */
.step-track {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1.5rem;
  overflow-x: auto;
  padding-bottom: .35rem;
  gap: .5rem;
}

.step-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .3rem;
  font-size: .7rem;
  font-weight: 500;
  color: #64748b;
  flex-shrink: 0;
  transition: color var(--dur) var(--ease);
}

.step-badge__num {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, .08);
  transition: all var(--dur) var(--ease);
}

.step-badge__label { display: none; }
@media (min-width: 640px) { .step-badge__label { display: inline; } }

.step-badge.is-active { color: var(--leaf-400); font-weight: 700; }
.step-badge.is-active .step-badge__num {
  background: rgba(52, 211, 153, .2);
  border: 1px solid var(--leaf-400);
}

.step-badge.is-done { color: var(--leaf-400); }
.step-badge.is-done .step-badge__num { background: rgba(52, 211, 153, .12); }

.step-badge.is-pending { color: #64748b; }

/* Form body */
.calc-body { padding: 2rem; display: grid; gap: 1.5rem; }

@media (min-width: 640px) { .calc-body { padding: 2.5rem; } }

.step-content { display: grid; gap: 1.5rem; }

.step-content__head {
  padding-bottom: 1rem;
  border-bottom: 1px solid #f1f5f3;
}

.step-content__title {
  display: flex;
  align-items: center;
  gap: .55rem;
  font-size: 1.15rem;
}

.step-content__title i { color: var(--leaf-600); }

.step-content__desc {
  font-size: .72rem;
  color: var(--text-muted);
  margin-top: .25rem;
}

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

@media (min-width: 640px) { .field-grid { grid-template-columns: repeat(2, 1fr); } }

.field-grid--full > * { grid-column: 1 / -1; }

.appliance-box {
  padding: 1rem;
  border-radius: var(--r-lg);
  background: var(--forest-50);
  border: 1px solid var(--forest-100);
}

.appliance-box__title {
  display: block;
  font-size: .72rem;
  font-weight: 700;
  color: var(--forest-900);
  margin-bottom: .65rem;
}

.appliance-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: .75rem;
}

@media (min-width: 640px) { .appliance-grid { grid-template-columns: repeat(3, 1fr); } }

.calc-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1.5rem;
  border-top: 1px solid #f1f5f3;
  gap: 1rem;
}

/* ==========================================================================
   4. RESULTS PAGE
   ========================================================================== */
.results-toolbar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 3rem;
}

@media (min-width: 768px) {
  .results-toolbar {
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-between;
  }
}

.toolbar-actions { display: flex; gap: .65rem; flex-wrap: wrap; }

/* KPI grid */
.kpi-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-bottom: 3rem;
}

@media (min-width: 768px) { .kpi-grid { grid-template-columns: repeat(4, 1fr); } }

.kpi-hero {
  grid-column: 1 / -1;
  position: relative;
  overflow: hidden;
  padding: 2rem;
  border-radius: var(--r-2xl);
  background: linear-gradient(135deg, var(--forest-900), var(--forest-950));
  color: #fff;
  box-shadow: var(--sh-xl);
}

@media (min-width: 768px) { .kpi-hero { grid-column: span 2; } }

.kpi-hero__glyph {
  position: absolute;
  right: -2rem;
  bottom: -2rem;
  font-size: 9rem;
  color: var(--forest-800);
  opacity: .22;
  pointer-events: none;
  line-height: 1;
}

.kpi-hero__label {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--leaf-400);
}

.kpi-hero__value {
  display: flex;
  align-items: baseline;
  gap: .75rem;
  margin: .75rem 0;
}

.kpi-hero__number {
  font-family: 'Poppins', sans-serif;
  font-size: clamp(2.75rem, 7vw, 3.75rem);
  font-weight: 800;
  line-height: 1;
  color: #fff;
}

.kpi-hero__unit { font-size: 1rem; color: #cbd5e1; }

.kpi-hero__foot {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding-top: .85rem;
  border-top: 1px solid var(--forest-800);
  font-size: .72rem;
  color: #cbd5e1;
  flex-wrap: wrap;
}

.kpi-card {
  padding: 1.5rem;
  border-radius: var(--r-2xl);
  background: var(--earth);
  border: 1px solid var(--forest-100);
  box-shadow: var(--sh-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.kpi-card__label {
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.kpi-card__value {
  display: flex;
  align-items: baseline;
  gap: .5rem;
  margin-top: .55rem;
}

.kpi-card__number {
  font-family: 'Poppins', sans-serif;
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--forest-900);
}

.kpi-card__unit { font-size: .72rem; color: var(--text-muted); font-weight: 500; }

.kpi-card__foot {
  margin-top: 1rem;
  padding-top: .75rem;
  border-top: 1px solid var(--forest-100);
  font-size: .68rem;
  color: var(--text-muted);
  line-height: 1.55;
}

/* Charts */
.chart-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin-bottom: 4rem;
}

@media (min-width: 1024px) { .chart-grid { grid-template-columns: repeat(2, 1fr); } }

.chart-container {
  background: var(--earth);
  border: 1px solid var(--forest-100);
  border-radius: var(--r-2xl);
  padding: 2rem;
  box-shadow: var(--sh-sm);
}

.chart-container__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.chart-container__title { font-size: 1.05rem; }
.chart-container__meta  { font-size: .68rem; color: #94a3b8; }

.chart-canvas-wrap {
  position: relative;
  height: 17rem;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

@media (min-width: 640px) { .chart-canvas-wrap { height: 18rem; } }

/* Recommendations panel */
.rec-panel {
  background: var(--forest-50);
  border: 1px solid var(--forest-200);
  border-radius: var(--r-2xl);
  padding: 2.5rem;
  margin-bottom: 4rem;
}

.rec-panel__head {
  display: flex;
  align-items: center;
  gap: .85rem;
  margin-bottom: 1.75rem;
}

.rec-panel__icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--r-md);
  background: var(--forest-900);
  color: var(--leaf-400);
  display: grid;
  place-items: center;
  font-size: 1rem;
}

.rec-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 768px) { .rec-grid { grid-template-columns: repeat(3, 1fr); } }

/* Empty state */
.empty-state {
  max-width: 34rem;
  margin-inline: auto;
  text-align: center;
  padding: 4rem 1.5rem;
}

.empty-state__icon {
  width: 4.5rem;
  height: 4.5rem;
  margin: 0 auto 1.5rem;
  border-radius: var(--r-xl);
  background: var(--forest-100);
  color: var(--forest-700);
  display: grid;
  place-items: center;
  font-size: 1.75rem;
}

/* ==========================================================================
   5. SIMULATOR PAGE
   ========================================================================== */
.sim-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  align-items: center;
}

@media (min-width: 1024px) { .sim-grid { grid-template-columns: 7fr 5fr; } }

.sim-controls {
  background: #fff;
  border: 1px solid var(--forest-100);
  border-radius: var(--r-2xl);
  padding: 2rem;
  box-shadow: var(--sh-sm);
  display: grid;
  gap: 1.5rem;
}

.sim-slider-head {
  display: flex;
  justify-content: space-between;
  font-size: .75rem;
  font-weight: 600;
  color: #334155;
  margin-bottom: .5rem;
}

.sim-slider-head span:last-child { color: var(--forest-700); font-weight: 800; }

.sim-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
  border-radius: var(--r-md);
  background: rgba(242, 247, 244, .7);
  border: 1px solid var(--forest-100);
}

.sim-toggle__body {
  display: flex;
  align-items: center;
  gap: .8rem;
}

.sim-toggle__icon { color: var(--leaf-600); font-size: 1.05rem; }

.sim-toggle__title {
  display: block;
  font-size: .78rem;
  font-weight: 700;
  color: var(--forest-950);
}

.sim-toggle__desc {
  display: block;
  font-size: .68rem;
  color: var(--text-muted);
  margin-top: .1rem;
}

.sim-output {
  background: var(--forest-900);
  color: #fff;
  border-radius: var(--r-2xl);
  padding: 2rem;
  box-shadow: var(--sh-xl);
  display: grid;
  gap: 1.5rem;
}

.sim-output__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sim-output__label {
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--leaf-400);
}

.sim-output__live {
  font-size: .68rem;
  font-weight: 700;
  padding: .3rem .7rem;
  border-radius: var(--r-pill);
  background: rgba(16, 185, 129, .18);
  color: var(--leaf-300);
}

.sim-output__block span:first-child {
  font-size: .72rem;
  color: #cbd5e1;
}

.sim-output__baseline {
  font-size: 1.5rem;
  font-weight: 700;
  color: #e2e8f0;
}

.sim-output__projected {
  font-family: 'Poppins', sans-serif;
  font-size: 2.35rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.1;
}

.sim-output__savings {
  padding: 1rem;
  border-radius: var(--r-lg);
  background: rgba(40, 70, 58, .85);
  border: 1px solid rgba(47, 87, 71, .7);
}

.sim-output__savings-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--leaf-400);
}

.sim-output__bar {
  height: 8px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, .12);
  overflow: hidden;
}

.sim-output__bar-fill {
  height: 100%;
  border-radius: var(--r-pill);
  background: linear-gradient(90deg, var(--leaf-500), var(--leaf-300));
  transition: width .45s var(--ease);
}

.sim-output__foot {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding-top: 1rem;
  border-top: 1px solid var(--forest-800);
  font-size: .72rem;
  color: #cbd5e1;
  line-height: 1.6;
}

.sim-output__foot i { color: var(--leaf-400); font-size: 1rem; }

/* ==========================================================================
   6. CHALLENGE PAGE
   ========================================================================== */
.challenge-tracker {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .85rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.challenge-tracker .progress { width: 12rem; }

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

@media (min-width: 768px) { .challenge-grid { grid-template-columns: repeat(2, 1fr); } }

.challenge-grid .challenge-item--wide { grid-column: 1 / -1; }

@media (max-width: 767px) {
  .challenge-item--wide { grid-column: auto; }
}

.challenge-badge {
  margin-top: 2rem;
  padding: 2rem;
  text-align: center;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: var(--r-2xl);
}

.challenge-badge i {
  font-size: 2rem;
  color: var(--leaf-600);
  margin-bottom: .5rem;
}

.challenge-badge h4 {
  font-size: 1.15rem;
  color: var(--forest-900);
}

.challenge-badge p {
  max-width: 30rem;
  margin: .4rem auto 0;
  font-size: .78rem;
  color: var(--text-muted);
}

/* ==========================================================================
   7. METHODOLOGY PAGE
   ========================================================================== */
.method-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin-bottom: 3rem;
}

@media (min-width: 768px) { .method-grid { grid-template-columns: repeat(2, 1fr); } }

.method-card {
  background: #fff;
  border: 1px solid var(--forest-100);
  border-radius: var(--r-2xl);
  padding: 2rem;
  box-shadow: var(--sh-sm);
}

.method-card__title {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-size: 1.05rem;
  margin-bottom: .85rem;
}

.method-card__title i { color: var(--forest-700); }

.formula {
  padding: 1rem;
  border-radius: var(--r-lg);
  background: rgba(242, 247, 244, .85);
  border: 1px solid var(--forest-100);
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: .72rem;
  color: var(--forest-900);
  margin-bottom: 1rem;
  line-height: 1.7;
}

.method-card p { font-size: .78rem; color: var(--text-muted); line-height: 1.75; }

.table-shell {
  background: #fff;
  border: 1px solid var(--forest-100);
  border-radius: var(--r-2xl);
  box-shadow: var(--sh-sm);
  overflow: hidden;
}

.table-shell__head {
  padding: 1.5rem;
  border-bottom: 1px solid var(--forest-100);
}

.table-shell__title { font-size: 1rem; }
.table-shell__meta  { font-size: .68rem; color: #94a3b8; }

/* ==========================================================================
   8. ABOUT PAGE
   ========================================================================== */
.about-panel {
  background: linear-gradient(100deg, var(--forest-900), var(--forest-800));
  border-radius: var(--r-2xl);
  padding: 3rem;
  color: #fff;
  box-shadow: var(--sh-xl);
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  align-items: center;
}

@media (min-width: 1024px) { .about-panel { grid-template-columns: 8fr 4fr; } }

.about-panel h3 { color: #fff; font-size: clamp(1.35rem, 3vw, 1.85rem); }

.about-panel p { color: #cbd5e1; font-size: .85rem; line-height: 1.8; }

.about-specs {
  background: rgba(13, 26, 21, .6);
  border: 1px solid rgba(47, 87, 71, .55);
  border-radius: var(--r-lg);
  padding: 1.5rem;
  display: grid;
  gap: .85rem;
}

.about-specs__title {
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--leaf-400);
}

.about-specs li {
  font-size: .75rem;
  color: #cbd5e1;
  padding-left: .9rem;
  position: relative;
}

.about-specs li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--leaf-400);
}

/* ==========================================================================
   9. RESPONSIVE TWEAKS
   ========================================================================== */
@media (max-width: 640px) {
  .section { padding-block: 3.5rem; }
  .calc-body { padding: 1.25rem; }
  .calc-head { padding: 1.5rem; }
  .benchmark-card { padding: 1.5rem; }
  .rec-panel { padding: 1.5rem; }
  .kpi-hero { padding: 1.5rem; }
  .sim-output { padding: 1.5rem; }
  .about-panel { padding: 1.75rem; }
}