/* =========================================================
   Solar Calculator Page Styles
   ========================================================= */

.calc-hero {
  background: var(--color-primary);
  color: #fff;
  padding-top: calc(var(--header-height) + var(--space-6));
  padding-bottom: var(--space-6);
}

.calc-hero .eyebrow { color: var(--color-accent-light); }
.calc-hero .eyebrow::before { background: var(--color-accent-light); }
.calc-hero h1 { color: #fff; font-size: var(--fs-2xl); margin-bottom: var(--space-2); }
.calc-hero p { color: rgba(246,248,251,0.75); max-width: 560px; }

.calc-wrap {
  max-width: 760px;
  margin: 0 auto;
  padding-block: var(--space-7);
}

/* Step indicator */
.step-indicator {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-6);
}

.step-indicator__item {
  flex: 1;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.step-indicator__dot {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--color-surface-alt);
  color: var(--text-muted);
  display: grid;
  place-items: center;
  font-size: var(--fs-xs);
  font-weight: 700;
  flex-shrink: 0;
  transition: background var(--transition-base), color var(--transition-base);
}

.step-indicator__line {
  height: 2px;
  flex: 1;
  background: var(--border-color);
}

.step-indicator__item.is-active .step-indicator__dot,
.step-indicator__item.is-done .step-indicator__dot {
  background: var(--color-accent);
  color: #fff;
}

.calc-card {
  background: var(--color-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--shadow-sm);
}

.calc-step { display: none; }
.calc-step.is-active { display: block; }

.calc-step h2 {
  font-size: var(--fs-lg);
  margin-bottom: var(--space-1);
}

.calc-step__desc {
  color: var(--text-secondary);
  font-size: var(--fs-sm);
  margin-bottom: var(--space-5);
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}

.appliance-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
}

.appliance-chip {
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  text-align: center;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: border-color var(--transition-fast), background var(--transition-fast), color var(--transition-fast);
}

.appliance-chip input { display: none; }

.appliance-chip:has(input:checked) {
  border-color: var(--color-accent);
  background: var(--color-accent-soft);
  color: var(--color-cta);
}

.calc-actions {
  display: flex;
  justify-content: space-between;
  margin-top: var(--space-6);
}

/* Calculating animation */
.calc-loading {
  display: none;
  text-align: center;
  padding: var(--space-8) var(--space-5);
}

.calc-loading.is-active { display: block; }

.calc-loading__sun {
  width: 90px;
  height: 90px;
  margin: 0 auto var(--space-5);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--color-accent-light), var(--color-cta) 70%);
  animation: float 1.6s ease-in-out infinite;
  box-shadow: 0 20px 40px rgba(173,86,35,0.3);
}

.calc-loading p { color: var(--text-secondary); }

/* Results */
.calc-results { display: none; }
.calc-results.is-active { display: block; animation: slide-up var(--transition-slow) both; }

.result-grid {
  grid-template-columns: repeat(4, 1fr);
  margin-bottom: var(--space-6);
}

.result-hero {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  background: var(--color-primary);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  margin-bottom: var(--space-6);
}

.result-hero__ring { flex-shrink: 0; }

.result-hero__ring text { fill: #fff; font-weight: 800; }

.result-hero__text h2 { color: #fff; font-size: var(--fs-xl); margin-bottom: var(--space-2); }
.result-hero__text p { color: rgba(246,248,251,0.75); font-size: var(--fs-sm); }

.result-card .stat-card__value { color: var(--color-primary); }

.calc-cta-row {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
}

@media (max-width: 640px) {
  .field-row { grid-template-columns: 1fr; }
  .appliance-grid { grid-template-columns: repeat(2, 1fr); }
  .result-grid { grid-template-columns: repeat(2, 1fr); }
  .result-hero { flex-direction: column; text-align: center; }
  .step-indicator__item span.step-indicator__label { display: none; }
}

/* =========================================================
   12-month bill simulator
   ========================================================= */
.bill-sim {
  margin-top: var(--space-7);
  padding-top: var(--space-6);
  border-top: 1px solid var(--border-color, #e2e8f0);
}
.bill-sim__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}
.bill-sim__title {
  font-size: var(--fs-xl);
  margin: 0 0 var(--space-2);
  color: var(--text-primary);
}
.bill-sim__sub {
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  margin: 0;
  max-width: 520px;
}
.badge--estimated {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: #fef3c7;
  color: #92400e;
  white-space: nowrap;
}
.bill-sim__summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}
.bill-sim__card {
  background: var(--color-surface-alt, #f8fafc);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: var(--radius-md, 12px);
  padding: var(--space-4);
}
.bill-sim__card--expected {
  border-color: #0d9488;
  background: #f0fdfa;
}
.bill-sim__card--conservative {
  border-color: #f59e0b;
  background: #fffbeb;
}
.bill-sim__card-label {
  font-size: var(--fs-xs);
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.bill-sim__card-value {
  font-size: var(--fs-lg);
  font-weight: 700;
  color: var(--text-primary);
}
.bill-sim__card-delta {
  margin-top: 6px;
  font-size: var(--fs-sm);
  color: #0d9488;
  font-weight: 600;
}
.bill-sim__chart-wrap { margin-bottom: var(--space-5); }
.bill-sim__legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin-bottom: var(--space-3);
  font-size: var(--fs-xs);
  color: var(--text-secondary);
}
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.legend-item i {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  display: inline-block;
}
.legend-item--current i { background: #94a3b8; }
.legend-item--expected i { background: #0d9488; }
.legend-item--conservative i { background: #f59e0b; }
.bill-sim__chart {
  overflow-x: auto;
  background: var(--color-surface, #fff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: var(--radius-md, 12px);
  padding: var(--space-3);
  color: var(--text-muted);
}
.bill-sim__table-wrap {
  overflow-x: auto;
  margin-bottom: var(--space-5);
}
.bill-sim__table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-sm);
}
.bill-sim__table th,
.bill-sim__table td {
  padding: 10px 12px;
  text-align: right;
  border-bottom: 1px solid var(--border-color, #e2e8f0);
}
.bill-sim__table th {
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--color-surface-alt, #f8fafc);
  white-space: nowrap;
}
.bill-sim__table td.is-positive {
  color: #0d9488;
  font-weight: 600;
}
.bill-sim__assumptions {
  background: var(--color-surface-alt, #f8fafc);
  border-radius: var(--radius-md, 12px);
  padding: var(--space-3) var(--space-4);
  font-size: var(--fs-sm);
  color: var(--text-secondary);
}
.bill-sim__assumptions summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--text-primary);
}
.bill-sim__assumptions-body { margin-top: var(--space-3); }
.bill-sim__assumptions-body ul {
  margin: 0;
  padding-right: 18px;
  line-height: 1.7;
}
@media (max-width: 768px) {
  .bill-sim__summary { grid-template-columns: 1fr; }
  .bill-sim__header { flex-direction: column; }
}


/* Phase 3 — outcome / dossier completeness */
.calc-outcome {
  margin-top: var(--space-5);
  padding: 20px 22px 22px;
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(15, 39, 68, 0.06);
}
.calc-outcome__banner {
  font-size: 13px;
  font-weight: 600;
  color: #9a3412;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 12px;
  padding: 10px 14px;
  margin-bottom: 16px;
  line-height: 1.6;
}
.calc-outcome__grid {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 18px;
  margin-bottom: 16px;
}
@media (max-width: 720px) {
  .calc-outcome__grid { grid-template-columns: 1fr; }
}
.calc-outcome__label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #64748b;
  margin-bottom: 6px;
}
.calc-outcome__score strong {
  font-size: 1.75rem;
  color: #1b2a4a;
  display: block;
  margin-bottom: 8px;
}
.calc-outcome__bar {
  height: 8px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
  margin-bottom: 8px;
}
.calc-outcome__bar i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #d97b3f, #1b2a4a);
  transition: width 0.35s ease;
}
.calc-outcome__hint {
  margin: 0;
  font-size: 12px;
  color: #64748b;
  line-height: 1.6;
}
.calc-outcome__summary p {
  margin: 0 0 8px;
  font-size: 14px;
  line-height: 1.75;
  color: #1b2a4a;
}
.calc-outcome .calc-city-meta {
  font-size: 12px;
  color: #64748b;
  margin: 0;
  line-height: 1.65;
}
.calc-cta-row--priority {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}


/* Phase 4 — site photos (optional, human review) */
.site-photos {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px dashed var(--border-color, #e2e8f0);
}
.site-photos__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}
.site-photos__head label {
  font-weight: 700;
  font-size: 14px;
  color: #1b2a4a;
}
.site-photos__count {
  font-size: 12px;
  color: #64748b;
  font-weight: 600;
}
.site-photos__drop {
  position: relative;
  border: 1.5px dashed #cbd5e1;
  border-radius: 14px;
  background: #f8fafc;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #475569;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.site-photos__drop:hover {
  border-color: #d97b3f;
  background: #fff7ed;
}
.site-photos__drop input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.site-photos__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.site-photos__item {
  position: relative;
  aspect-ratio: 1;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  background: #f1f5f9;
}
.site-photos__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.site-photos__item button {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.75);
  color: #fff;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}
.site-photos__item button:hover {
  background: #b91c1c;
}


/* Phase 5 — bill upload */
.bill-upload {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed var(--border-color, #e2e8f0);
}
.bill-upload__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}
.bill-upload__head label {
  font-weight: 700;
  font-size: 14px;
  color: #1b2a4a;
}
.bill-upload__status {
  font-size: 12px;
  color: #64748b;
  font-weight: 600;
}
.bill-upload__drop {
  position: relative;
  border: 1.5px dashed #cbd5e1;
  border-radius: 14px;
  background: #f8fafc;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #475569;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.bill-upload__drop:hover {
  border-color: #d97b3f;
  background: #fff7ed;
}
.bill-upload__drop input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.bill-upload__preview {
  margin-top: 12px;
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  background: #fff;
}
.bill-upload__preview img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 8px;
  background: #f1f5f9;
}
.bill-upload__meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.bill-upload__meta strong {
  font-size: 13px;
  color: #1b2a4a;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 220px;
}
.calc-tools-note {
  margin: -6px 0 14px;
  font-size: 11px;
  line-height: 1.65;
  color: #64748b;
}

.bill-upload__preview[hidden],
.bill-upload__preview.is-empty[hidden] {
  display: none !important;
}
.bill-upload__preview:not([hidden]) {
  display: flex;
}
