/* ============================================================
   Sunpark — Simulatore Fotovoltaico
   Design System v1.2 — 20250227002
   ============================================================ */

/* ─── ALPINE CLOAK — nasconde il markup grezzo prima dell'init ─ */
/* Evita FOUC e flash di step multipli al caricamento            */
[x-cloak] { display: none !important; }

/* Step 2 e 3 nascosti da CSS fin dal primo render.
   goToStep() sovrascrive con style.display='block' al momento giusto. */
#step2, #step3 { display: none; }

/* ─── RESET & BASE ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --green-primary:  #407A00;
  --green-dark:     #2d5700;
  --green-light:    #5a9e00;
  --green-lighter:  #e8f5d9;
  --yellow:         #fbbf24;
  --gray-50:        #f9fafb;
  --gray-100:       #f3f4f6;
  --gray-200:       #e5e7eb;
  --gray-400:       #9ca3af;
  --gray-500:       #6b7280;
  --gray-700:       #374151;
  --gray-900:       #1f2937;
  --white:          #ffffff;
  --text-body:      #333333;
  --radius-sm:      8px;
  --radius-md:      12px;
  --radius-lg:      16px;
  --radius-xl:      24px;
  --shadow-sm:      0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md:      0 4px 12px rgba(0,0,0,.10), 0 2px 4px rgba(0,0,0,.06);
  --shadow-lg:      0 10px 30px rgba(0,0,0,.12), 0 4px 10px rgba(0,0,0,.08);
  --shadow-xl:      0 20px 50px rgba(0,0,0,.14);
  --transition:     all .25s ease;
}

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: 'Poppins', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-body);
  background: var(--gray-50);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Blocca scroll del body quando il modal è aperto */
body.modal-open {
  overflow: hidden;
}

/* ─── UTILITY ───────────────────────────────────────────────── */
.text-green  { color: var(--green-primary); }
.text-yellow { color: var(--yellow); }
.text-muted  { color: var(--gray-500); }
.text-center { text-align: center; }
.fw-600      { font-weight: 600; }
.fw-700      { font-weight: 700; }
.fw-800      { font-weight: 800; }

/* ─── HEADER WIZARD ─────────────────────────────────────────── */
.wizard-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
  padding: 14px 24px;
}

.wizard-header-inner {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.wizard-logo {
  height: 36px;
  width: auto;
}

.wizard-logo-text {
  font-size: 20px;
  font-weight: 800;
  color: var(--green-primary);
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.wizard-logo-img {
  height: 30px;
  width: auto;
}

.wizard-logo-text span { color: var(--green-light); }

/* ─── PROGRESS STEPS ────────────────────────────────────────── */
.progress-steps {
  display: flex;
  align-items: center;
  gap: 0;
  flex: 1;
  justify-content: center;
  max-width: 420px;
}

.progress-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  position: relative;
  flex: 1;
}

.progress-step-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  border: 2px solid var(--gray-200);
  background: var(--white);
  color: var(--gray-400);
  transition: var(--transition);
  position: relative;
  z-index: 2;
}

.progress-step.active .progress-step-circle {
  background: var(--green-primary);
  border-color: var(--green-primary);
  color: var(--white);
  box-shadow: 0 0 0 4px rgba(64,122,0,.15);
}

.progress-step.done .progress-step-circle {
  background: var(--green-light);
  border-color: var(--green-light);
  color: var(--white);
}

.progress-step-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--gray-400);
  white-space: nowrap;
  transition: var(--transition);
}

.progress-step.active .progress-step-label { color: var(--green-primary); }
.progress-step.done  .progress-step-label  { color: var(--green-light); }

.progress-line {
  flex: 1;
  height: 2px;
  background: var(--gray-200);
  margin-bottom: 20px;
  transition: background .4s ease;
  position: relative;
  z-index: 1;
}
.progress-line.done { background: var(--green-light); }

/* ─── WIZARD WRAP ───────────────────────────────────────────── */
.wizard-wrap {
  min-height: calc(100vh - 66px);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 20px 60px;
}

.wizard-step {
  width: 100%;
  max-width: 780px;
  will-change: transform, opacity;
}

/* ─── STEP HERO BANNER ──────────────────────────────────────── */
.step-hero {
  background: linear-gradient(135deg, var(--green-primary), var(--green-dark));
  border-radius: var(--radius-xl);
  padding: 40px 44px;
  color: var(--white);
  margin-bottom: 28px;
  position: relative;
  overflow: hidden;
}

.step-hero::before {
  content: '';
  position: absolute;
  top: -40px; right: -40px;
  width: 220px; height: 220px;
  background: rgba(255,255,255,.06);
  border-radius: 50%;
}

.step-hero::after {
  content: '';
  position: absolute;
  bottom: -60px; left: -30px;
  width: 160px; height: 160px;
  background: rgba(255,255,255,.04);
  border-radius: 50%;
}

.step-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 100px;
  padding: 4px 14px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .5px;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.step-hero h1 {
  font-size: 30px;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 8px;
}

.step-hero p {
  font-size: 15px;
  opacity: .85;
  font-weight: 400;
}

/* ─── CARD ──────────────────────────────────────────────────── */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-md);
  margin-bottom: 20px;
}

.card-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-title i {
  width: 36px;
  height: 36px;
  background: var(--green-lighter);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--green-primary);
  font-size: 15px;
  flex-shrink: 0;
}

.card-subtitle {
  font-size: 14px;
  color: var(--gray-500);
  margin-bottom: 24px;
}

/* ─── FORM ELEMENTS ─────────────────────────────────────────── */
.form-group { margin-bottom: 20px; }

label.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 8px;
  letter-spacing: .2px;
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: stretch;
}

.input-wrap .input-icon,
.has-icon .input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-400);
  font-size: 15px;
  pointer-events: none;
}

input[type="text"],
input[type="number"],
input[type="email"],
input[type="tel"],
textarea,
select {
  width: 100%;
  padding: 13px 16px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-family: 'Poppins', sans-serif;
  font-size: 15px;
  color: var(--text-body);
  background: var(--white);
  transition: border-color .2s, box-shadow .2s;
  outline: none;
  appearance: none;
}

.has-icon input { padding-left: 44px; }

input:focus, textarea:focus, select:focus {
  border-color: var(--green-primary);
  box-shadow: 0 0 0 3px rgba(64,122,0,.12);
}

input.error { border-color: #dc2626; }
.form-error { font-size: 12px; color: #dc2626; margin-top: 4px; }

.input-suffix {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-500);
  pointer-events: none;
}

/* ─── BUTTONS ───────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 28px;
  border-radius: var(--radius-sm);
  font-family: 'Poppins', sans-serif;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid transparent;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--green-primary);
  color: var(--white);
}
.btn-primary:hover {
  background: var(--green-light);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(64,122,0,.3);
}
.btn-primary:active { transform: translateY(0); }

.btn-outline {
  background: transparent;
  border-color: var(--green-primary);
  color: var(--green-primary);
}
.btn-outline:hover {
  background: var(--green-lighter);
}

.btn-ghost {
  background: transparent;
  color: var(--gray-500);
}
.btn-ghost:hover { color: var(--gray-900); background: var(--gray-100); }

.btn-lg { padding: 16px 36px; font-size: 16px; }
.btn-full { width: 100%; }

.btn:disabled {
  opacity: .45;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.btn-search {
  padding: 13px 22px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  flex-shrink: 0;
}

.search-input-group {
  display: flex;
  align-items: stretch;
}

.search-input-group input {
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  border-right: none;
  flex: 1;
}

.search-input-group input:focus { border-right: none; }

/* ─── MAP CONTAINER ─────────────────────────────────────────── */
.map-container {
  width: 100%;
  height: 340px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-top: 20px;
  box-shadow: var(--shadow-md);
  border: 2px solid var(--gray-200);
  position: relative;
}

#map {
  width: 100%;
  height: 100%;
}

.map-hint {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,.65);
  color: var(--white);
  font-size: 12px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 100px;
  backdrop-filter: blur(4px);
  pointer-events: none;
  white-space: nowrap;
}

/* ─── ADDRESS RESULT ────────────────────────────────────────── */
.address-result {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--green-lighter);
  border: 1px solid rgba(64,122,0,.2);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-top: 14px;
  font-size: 14px;
  color: var(--green-dark);
  font-weight: 500;
}

.address-result i { color: var(--green-primary); flex-shrink: 0; }

/* ─── MODE SELECTOR (Step 2) ────────────────────────────────── */
.mode-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

.mode-card {
  padding: 24px 20px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
  background: var(--white);
  position: relative;
}

.mode-card:hover {
  border-color: var(--green-light);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.mode-card.selected {
  border-color: var(--green-primary);
  background: var(--green-lighter);
  box-shadow: 0 0 0 3px rgba(64,122,0,.1);
}

.mode-card-icon {
  width: 56px; height: 56px;
  background: var(--green-lighter);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
  font-size: 22px;
  color: var(--green-primary);
  transition: var(--transition);
}

.mode-card.selected .mode-card-icon {
  background: var(--green-primary);
  color: var(--white);
}

.mode-card h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 4px;
}

.mode-card p {
  font-size: 13px;
  color: var(--gray-500);
  line-height: 1.4;
}

.mode-card .check-badge {
  position: absolute;
  top: 12px; right: 12px;
  width: 22px; height: 22px;
  background: var(--green-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-size: 11px;
  opacity: 0;
  transition: opacity .2s;
}
.mode-card.selected .check-badge { opacity: 1; }

/* ─── INFO BANNER (bolletta) ────────────────────────────────── */
.info-banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 16px;
  font-size: 13px;
  color: #92400e;
  line-height: 1.5;
}
.info-banner i { color: #f59e0b; flex-shrink: 0; margin-top: 1px; }

/* ─── LINK LABEL ────────────────────────────────────────────── */
.link-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--green-primary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  margin-top: 8px;
  transition: color .2s;
}
.link-label:hover { color: var(--green-dark); text-decoration: underline; }

/* ─── HELPER CONSUMO ────────────────────────────────────────── */
.helper-panel {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-top: 16px;
  animation: fadeDown .25s ease;
}

@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.helper-section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: .8px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.consumption-options {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
  margin-bottom: 24px;
}

.consumption-opt {
  padding: 14px 12px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
  background: var(--white);
}

.consumption-opt:hover {
  border-color: var(--green-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.consumption-opt .opt-icon {
  font-size: 20px;
  margin-bottom: 6px;
  display: block;
}

.consumption-opt .opt-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-700);
  display: block;
  margin-bottom: 4px;
}

.consumption-opt .opt-value {
  font-size: 12px;
  color: var(--green-primary);
  font-weight: 700;
}

.helper-divider {
  height: 1px;
  background: var(--gray-200);
  margin: 20px 0;
  position: relative;
}
.helper-divider::before {
  content: 'oppure per uso industriale';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--gray-50);
  padding: 0 12px;
  font-size: 11px;
  font-weight: 600;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: .6px;
  white-space: nowrap;
}

.industry-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.industry-opt {
  padding: 14px 16px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  background: var(--white);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.industry-opt:hover {
  border-color: var(--green-light);
  box-shadow: var(--shadow-sm);
}

.industry-opt .ind-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700);
  display: flex;
  align-items: center;
  gap: 8px;
}

.industry-opt .ind-value {
  font-size: 12px;
  color: var(--green-primary);
  font-weight: 700;
}

/* ─── KWP RESULT BOX ────────────────────────────────────────── */
.kwp-result-box {
  background: linear-gradient(135deg, var(--green-primary), var(--green-dark));
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 20px;
}

.kwp-result-main { display: flex; flex-direction: column; }

.kwp-result-label {
  font-size: 13px;
  opacity: .8;
  font-weight: 500;
  margin-bottom: 4px;
}

.kwp-result-value {
  font-size: 40px;
  font-weight: 800;
  line-height: 1;
}

.kwp-result-unit {
  font-size: 18px;
  font-weight: 600;
  opacity: .8;
  margin-top: 2px;
}

.kwp-result-icon {
  font-size: 48px;
  opacity: .3;
}

/* ─── SLIDER ────────────────────────────────────────────────── */
.slider-wrap { margin-top: 8px; }

input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--gray-200);
  outline: none;
  padding: 0;
  border: none;
  cursor: pointer;
  transition: background .2s;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--green-primary);
  cursor: pointer;
  border: 3px solid var(--white);
  box-shadow: 0 2px 6px rgba(64,122,0,.4);
  transition: transform .15s, box-shadow .15s;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 3px 10px rgba(64,122,0,.5);
}

.slider-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-size: 12px;
  color: var(--gray-400);
}

.slider-value-display {
  text-align: center;
  margin-top: 4px;
}

.slider-value-display .value-big {
  font-size: 28px;
  font-weight: 800;
  color: var(--green-primary);
  line-height: 1;
}

.slider-value-display .value-label {
  font-size: 11px;
  font-family: 'Courier New', monospace;
  color: var(--gray-500);
  display: block;
  margin-top: 2px;
}

/* ─── BATTERIE DISPLAY ──────────────────────────────────────── */
.battery-display {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  transition: var(--transition);
}

.battery-display.has-batteries {
  background: var(--green-lighter);
  border-color: rgba(64,122,0,.25);
}

.battery-display-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.battery-display-left i {
  font-size: 22px;
  color: var(--green-primary);
}

.battery-display-text .label {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700);
}

.battery-display-text .value {
  font-size: 13px;
  color: var(--green-primary);
  font-weight: 700;
}

/* ─── NAVIGATION BUTTONS ────────────────────────────────────── */
.step-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 28px;
  gap: 12px;
}

.step-nav-right { display: flex; gap: 12px; margin-left: auto; }

/* ─── STEP 3 — REPORT ───────────────────────────────────────── */
.report-header {
  background: linear-gradient(135deg, var(--green-primary), var(--green-dark));
  border-radius: var(--radius-xl);
  padding: 40px 44px;
  color: var(--white);
  margin-bottom: 28px;
  position: relative;
  overflow: hidden;
}

.report-header::before {
  content: '';
  position: absolute;
  top: -50px; right: -50px;
  width: 250px; height: 250px;
  background: rgba(255,255,255,.07);
  border-radius: 50%;
}

.report-header-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(251,191,36,.25);
  border: 1px solid rgba(251,191,36,.5);
  border-radius: 100px;
  padding: 4px 14px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--yellow);
  margin-bottom: 12px;
}

.report-header h1 {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 6px;
}

.report-header .report-address {
  font-size: 14px;
  opacity: .75;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ─── SPECS GRID ────────────────────────────────────────────── */
.specs-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.spec-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 22px 20px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-100);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.spec-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.spec-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 4px; height: 100%;
  background: var(--green-primary);
  border-radius: 0 0 0 0;
}

.spec-card-icon {
  width: 44px; height: 44px;
  background: var(--green-lighter);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--green-primary);
  font-size: 18px;
  margin-bottom: 12px;
}

.spec-card-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 4px;
}

.spec-card-value {
  font-size: 24px;
  font-weight: 800;
  color: var(--gray-900);
  line-height: 1.1;
}

.spec-card-unit {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-500);
}

.spec-card-note {
  font-size: 11px;
  color: var(--gray-400);
  margin-top: 4px;
}

/* ─── CHART CARD ────────────────────────────────────────────── */
.chart-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 28px 28px 20px;
  box-shadow: var(--shadow-md);
  margin-bottom: 20px;
}

.chart-card-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.chart-card-title i {
  color: var(--green-primary);
  font-size: 16px;
}

.chart-card-subtitle {
  font-size: 13px;
  color: var(--gray-500);
  margin-bottom: 20px;
}

.chart-wrap {
  height: 240px;
  position: relative;
}

/* ─── ECO CARDS ─────────────────────────────────────────────── */
.eco-section {
  background: linear-gradient(135deg, var(--green-primary), var(--green-dark));
  border-radius: var(--radius-xl);
  padding: 32px 28px;
  margin-bottom: 20px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.eco-card {
  text-align: center;
  color: var(--white);
}

.eco-card-icon {
  width: 52px; height: 52px;
  background: rgba(255,255,255,.15);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  margin: 0 auto 12px;
}

.eco-card-value {
  font-size: 26px;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 4px;
}

.eco-card-label {
  font-size: 12px;
  opacity: .8;
  line-height: 1.3;
}

/* ─── SAVINGS CARD ──────────────────────────────────────────── */
.savings-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-md);
  margin-bottom: 28px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: center;
}

.savings-headline {
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 6px;
}

.savings-value {
  font-size: 36px;
  font-weight: 800;
  color: var(--green-primary);
  line-height: 1;
  margin-bottom: 4px;
}

.savings-sub {
  font-size: 13px;
  color: var(--gray-500);
}

.payback-display {
  background: var(--gray-50);
  border-radius: var(--radius-md);
  padding: 20px;
  text-align: center;
}

.payback-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--gray-900);
  margin-bottom: 4px;
}

.payback-label {
  font-size: 13px;
  color: var(--gray-500);
}

/* ─── ADD-ON SECTION ────────────────────────────────────────── */
.addon-section-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--gray-900);
  margin-bottom: 6px;
}

.addon-section-sub {
  font-size: 14px;
  color: var(--gray-500);
  margin-bottom: 24px;
}

.addon-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  box-shadow: var(--shadow-sm);
  border: 2px solid var(--gray-100);
  margin-bottom: 14px;
  transition: var(--transition);
  display: flex;
  align-items: flex-start;
  gap: 20px;
}

.addon-card.selected {
  border-color: var(--green-primary);
  background: var(--green-lighter);
}

.addon-card-icon {
  width: 52px; height: 52px;
  background: var(--green-lighter);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: var(--green-primary);
  flex-shrink: 0;
  margin-top: 2px;
}

.addon-card.selected .addon-card-icon {
  background: var(--green-primary);
  color: var(--white);
}

.addon-card-body { flex: 1; }

.addon-card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 4px;
}

.addon-card-desc {
  font-size: 13px;
  color: var(--gray-500);
  margin-bottom: 10px;
}

.addon-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.addon-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--gray-100);
  border-radius: 100px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-700);
}

.addon-card-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  flex-shrink: 0;
}

.addon-price {
  font-size: 20px;
  font-weight: 800;
  color: var(--green-primary);
  text-align: right;
}

.addon-price small {
  font-size: 12px;
  color: var(--gray-500);
  font-weight: 500;
  display: block;
}

/* Controllo quantità batterie */
.qty-control {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--white);
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: 4px;
}

.qty-btn {
  width: 32px; height: 32px;
  border: none;
  background: var(--green-lighter);
  border-radius: 6px;
  color: var(--green-primary);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.qty-btn:hover { background: var(--green-primary); color: var(--white); }
.qty-btn:disabled { opacity: .35; cursor: not-allowed; }

.qty-value {
  font-size: 16px;
  font-weight: 700;
  color: var(--gray-900);
  min-width: 24px;
  text-align: center;
}

/* Toggle checkbox addon */
.toggle-switch {
  position: relative;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
  cursor: pointer;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-switch-track {
  position: absolute;
  inset: 0;
  background: var(--gray-300, #d1d5db);
  border-radius: 13px;
  transition: background .25s;
}

.toggle-switch input:checked + .toggle-switch-track {
  background: var(--green-primary);
}

.toggle-switch-thumb {
  position: absolute;
  top: 3px; left: 3px;
  width: 20px; height: 20px;
  background: var(--white);
  border-radius: 50%;
  box-shadow: var(--shadow-sm);
  transition: transform .25s;
}

.toggle-switch input:checked ~ .toggle-switch-thumb {
  transform: translateX(22px);
}

/* ─── PRICE SUMMARY ─────────────────────────────────────────── */
.price-summary {
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: 32px 36px;
  box-shadow: var(--shadow-xl);
  border: 2px solid var(--green-lighter);
  margin-top: 28px;
  margin-bottom: 28px;
}

.price-summary-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--gray-900);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 0;
  font-size: 14px;
  color: var(--gray-700);
  border-bottom: 1px solid var(--gray-100);
}

.price-row:last-of-type { border-bottom: none; }

.price-row.discount {
  color: var(--green-primary);
  font-weight: 600;
}

.price-row.total {
  padding-top: 14px;
  margin-top: 4px;
  border-top: 2px solid var(--gray-200);
  font-size: 18px;
  font-weight: 800;
  color: var(--gray-900);
}

.price-row.total .amount { color: var(--green-primary); }

.incentivo-note {
  font-size: 12px;
  color: var(--gray-500);
  margin-top: 12px;
  line-height: 1.5;
  text-align: center;
}

/* ─── CONTACT FORM ──────────────────────────────────────────── */
.contact-section {
  background: linear-gradient(135deg, var(--green-primary), var(--green-dark));
  border-radius: var(--radius-xl);
  padding: 44px 40px;
  margin-top: 24px;
  color: var(--white);
  position: relative;
  overflow: hidden;
}

.contact-section::before {
  content: '';
  position: absolute;
  top: -60px; right: -60px;
  width: 280px; height: 280px;
  background: rgba(255,255,255,.05);
  border-radius: 50%;
}

.contact-section h2 {
  font-size: 26px;
  font-weight: 800;
  margin-bottom: 8px;
}

.contact-section p {
  font-size: 15px;
  opacity: .8;
  margin-bottom: 28px;
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.contact-grid .full { grid-column: 1 / -1; }

.contact-input {
  width: 100%;
  padding: 13px 16px;
  border: 2px solid rgba(255,255,255,.25);
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,.12);
  color: var(--white);
  font-family: 'Poppins', sans-serif;
  font-size: 14px;
  outline: none;
  transition: border-color .2s, background .2s;
  backdrop-filter: blur(4px);
}

.contact-input::placeholder { color: rgba(255,255,255,.55); }

.contact-input:focus {
  border-color: rgba(255,255,255,.7);
  background: rgba(255,255,255,.18);
}

.btn-contact {
  background: var(--yellow);
  color: var(--gray-900);
  font-weight: 700;
  padding: 15px 36px;
  font-size: 16px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.btn-contact:hover {
  background: #fcd34d;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(251,191,36,.4);
}

.privacy-note {
  font-size: 12px;
  opacity: .65;
  margin-top: 12px;
}

/* ─── TOAST ─────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--gray-900);
  color: var(--white);
  padding: 14px 24px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow-xl);
  z-index: 9999;
  transition: transform .35s cubic-bezier(.34,1.56,.64,1);
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

.toast.show { transform: translateX(-50%) translateY(0); }
.toast.success i { color: #4ade80; }
.toast.error i { color: #f87171; }

/* ─── LOADING SPINNER ───────────────────────────────────────── */
.spinner {
  display: inline-block;
  width: 18px; height: 18px;
  border: 3px solid rgba(255,255,255,.3);
  border-top-color: var(--white);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ─── SECTION DIVIDER ───────────────────────────────────────── */
.section-divider {
  height: 1px;
  background: var(--gray-200);
  margin: 28px 0;
}

/* ─── RESPONSIVE ────────────────────────────────────────────── */
@media (max-width: 768px) {
  /* ── Prevent horizontal overflow that causes zoom/asymmetric margins ── */
  html { overflow-x: hidden; }
  .wizard-wrap { padding-left: 16px; padding-right: 16px; }
  .wizard-step { max-width: 100%; overflow-x: hidden; }

  .wizard-header { padding: 14px 16px; }
  .wizard-header-inner { flex-wrap: wrap; }
  .progress-steps { order: 2; width: 100%; max-width: none; }
  .wizard-logo-text { order: 1; }

  .step-hero, .report-header {
    padding: 28px 24px;
  }
  .step-hero h1, .report-header h1 { font-size: 22px; }

  .card { padding: 22px 20px; }

  .mode-grid { grid-template-columns: 1fr; }

  .specs-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .eco-section {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .savings-card {
    grid-template-columns: 1fr;
  }

  .contact-grid {
    grid-template-columns: 1fr;
  }

  .contact-section { padding: 32px 24px; }
  .contact-section h2 { font-size: 22px; }

  .price-summary {
    padding: 24px 20px;
  }

  .industry-options { grid-template-columns: 1fr; }

  .consumption-options {
    grid-template-columns: repeat(3, 1fr);
  }

  .addon-card {
    flex-direction: column;
    gap: 14px;
  }
  .addon-card-right { flex-direction: row; align-items: center; }

  /* ── Step nav: stack vertically on mobile to prevent button overflow ── */
  .step-nav {
    flex-wrap: wrap;
    gap: 10px;
  }
  .step-nav-right {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  /* ── Buttons: reduce padding so they fit on narrow screens ── */
  .btn { white-space: normal; }
  .btn-lg { padding: 14px 24px; font-size: 15px; }

  /* ── Step 3 report bottom nav: wrap action buttons ── */
  #step3 .step-nav > div:last-child {
    width: 100%;
    justify-content: flex-end;
  }

  /* ── kwp-result-box: allow column layout on narrow screens ── */
  .kwp-result-box { flex-wrap: wrap; padding: 20px 22px; }
  .kwp-result-icon { display: none; }
}

@media (max-width: 480px) {
  .wizard-wrap { padding-left: 12px; padding-right: 12px; }

  .step-hero, .report-header { padding: 24px 18px; }
  .step-hero h1 { font-size: 20px; }
  .step-hero p, .report-header p { font-size: 14px; }

  .card { padding: 18px 16px; }

  .specs-grid { grid-template-columns: 1fr; }
  .consumption-options { grid-template-columns: repeat(2, 1fr); }
  .progress-step-label { display: none; }
  .progress-step-circle { width: 30px; height: 30px; font-size: 12px; }
  .cashflow-flows { grid-template-columns: repeat(2, 1fr); }

  /* ── Step nav: full-width stacked buttons ── */
  .step-nav {
    flex-direction: column;
    align-items: stretch;
  }
  .step-nav .btn-ghost { order: 2; }
  .step-nav .step-nav-right,
  .step-nav > div:last-child { order: 1; width: 100%; }
  .step-nav .btn-lg { width: 100%; justify-content: center; }
  .step-nav-right { width: 100%; }

  /* ── Smaller btn padding ── */
  .btn-lg { padding: 13px 18px; font-size: 14px; }
  .btn { padding: 11px 18px; font-size: 14px; }

  /* ── Step 3 report action buttons: wrap properly ── */
  #step3 .step-nav > div:last-child {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: stretch;
  }
  #step3 .step-nav > div:last-child .btn {
    flex: 1 1 auto;
    min-width: 0;
    justify-content: center;
  }

  /* ── Price summary: tighter padding ── */
  .price-summary { padding: 20px 16px; }
  .price-summary-title { font-size: 16px; }

  /* ── Savings card: smaller text ── */
  .savings-value { font-size: 28px; }
  .payback-value { font-size: 22px; }

  /* ── Map hint: allow wrapping ── */
  .map-hint { white-space: normal; text-align: center; max-width: 90vw; }

  /* ── Addon cards: tighter on small screens ── */
  .addon-price { font-size: 18px; }
  .addon-card-title { font-size: 15px; }

  /* ── Header: hide "Simulatore gratuito" label ── */
  .wizard-header-inner > div:last-child { display: none; }
}

/* ─── KWP OVERRIDE TOGGLE (Step 2) ─────────────────────────── */
.kwp-override-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 20px;
  padding: 16px 20px;
  background: var(--gray-50);
  border-radius: 12px;
  border: 1.5px solid var(--gray-200);
  transition: border-color .2s, background .2s;
}

.kwp-override-row:has(input:checked) {
  border-color: var(--green-light);
  background: var(--green-lighter);
}

.kwp-override-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-heading);
  margin-bottom: 3px;
}

.kwp-override-hint {
  font-size: 12px;
  color: var(--gray-500);
  line-height: 1.4;
}

.kwp-manual-input {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1.5px dashed var(--gray-200);
}

/* ─── FLUSSO DI CASSA ─────────────────────────────────────── */
.cashflow-flows {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 20px 0 4px;
}

@media (max-width: 680px) {
  .cashflow-flows { grid-template-columns: repeat(2, 1fr); }
}

.cf-flow {
  background: var(--gray-50);
  border-radius: 12px;
  padding: 14px 16px;
  border: 1.5px solid transparent;
  transition: border-color .2s;
}

.cf-flow-total {
  background: var(--green-lighter);
  border-color: rgba(64,122,0,.25);
}

.cf-flow-inactive {
  opacity: .4;
}

.cf-flow-icon {
  font-size: 18px;
  margin-bottom: 8px;
}

/* colori icona per posizione */
.cf-flow:nth-child(1) .cf-flow-icon { color: #f59e0b; }
.cf-flow:nth-child(2) .cf-flow-icon { color: #3b82f6; }
.cf-flow:nth-child(3) .cf-flow-icon { color: #6b7280; }
.cf-flow-total .cf-flow-icon         { color: var(--green-primary); }

.cf-flow-label {
  font-size: 11px;
  color: var(--gray-500);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .4px;
  margin-bottom: 8px;
  line-height: 1.3;
}

.cf-flow-kwh {
  font-size: 12px;
  color: var(--gray-500);
  margin-bottom: 4px;
  min-height: 16px;
}

.cf-flow-eur {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-heading);
}

.cf-flow-total .cf-flow-eur {
  color: var(--green-primary);
  font-size: 17px;
}

/* ─── ORIENTAMENTO TETTO (Step 2) ───────────────────────────── */
.orientation-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 16px;
}

.orientation-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 6px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-md);
  background: var(--white);
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
  width: 100%;
  font-family: 'Poppins', sans-serif;
}

.orientation-btn:hover {
  border-color: var(--green-light);
  background: var(--green-lighter);
}

.orientation-btn.active {
  border-color: var(--green-primary);
  background: var(--green-lighter);
  box-shadow: 0 0 0 3px rgba(64,122,0,.1);
}

.orient-icon {
  font-size: 18px;
  line-height: 1;
}

.orient-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--gray-700);
  line-height: 1.3;
}

.orient-prod {
  font-size: 10px;
  color: var(--gray-500);
  font-weight: 500;
}

.orientation-btn.active .orient-label { color: var(--green-primary); }
.orientation-btn.active .orient-prod  { color: var(--green-dark);    }

.orient-info-bar {
  margin-top: 14px;
  padding: 10px 14px;
  background: var(--green-lighter);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--green-dark);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

@media (max-width: 600px) {
  .orientation-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 400px) {
  .orientation-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ─── SHARE ICON BUTTON ─────────────────────────────────────── */
.btn-share-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid var(--gray-300);
  background: var(--white);
  color: var(--gray-500);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: var(--transition);
  flex-shrink: 0;
}
.btn-share-icon:hover {
  border-color: var(--green-primary);
  color: var(--green-primary);
  background: var(--green-lighter);
}

/* ─── POPUP CONSULENZA GRATUITA ─────────────────────────────── */
.consult-backdrop {
  position: fixed;
  inset: 0;
  /* Liquid glass effect: oscuramento completo + blur leggero
     Nota: backdrop-filter applicato solo al backdrop, non al modal interno
     per evitare problemi di rendering con l'iframe Bitrix */
  background: rgba(17,24,39,.85);
  backdrop-filter: blur(8px) saturate(120%);
  -webkit-backdrop-filter: blur(8px) saturate(120%);
  z-index: 1000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
  /* Smooth scroll per il contenitore */
  scroll-behavior: smooth;
}

.consult-modal {
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: 40px 36px 36px;
  max-width: 600px;
  width: 100%;
  position: relative;
  box-shadow: var(--shadow-xl);
  max-height: 90vh;
  overflow-y: auto;
  margin-top: 40px;
  margin-bottom: 40px;
  /* Isolamento per evitare che il backdrop-filter del parent influenzi l'iframe */
  isolation: isolate;
  /* Focus outline per accessibilità */
  outline: none;
}

/* Iframe Bitrix iniettato da core.js nel .module-container:
   senza dimensioni esplicite apparirebbe come quadrato vuoto */
.consult-modal .module-container {
  min-height: 420px;
  width: 100%;
}
.consult-modal .module-container iframe {
  display: block;
  width: 100%;
  min-height: 420px;
  height: 100%;
  border: none;
}

.consult-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: var(--gray-100);
  color: var(--gray-500);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  transition: var(--transition);
}
.consult-close:hover {
  background: var(--gray-200);
  color: var(--gray-900);
}

.consult-modal-header {
  text-align: center;
  margin-bottom: 28px;
}

.consult-modal-icon {
  width: 64px;
  height: 64px;
  background: var(--green-lighter);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  font-size: 26px;
  color: var(--green-primary);
}

.consult-modal-header h3 {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-heading);
  margin-bottom: 8px;
}

.consult-modal-header p {
  font-size: 14px;
  color: var(--gray-500);
  line-height: 1.55;
}

@media (max-width: 480px) {
  .consult-modal { padding: 32px 20px 28px; }
  .consult-modal-header h3 { font-size: 19px; }
}

/* ═══════════════════════════════════════════════════════════════
   PRINT PDF REPORT STYLES
   ═══════════════════════════════════════════════════════════════ */

/* Container PDF - iframe per html2pdf 
   Deve essere visibile per il rendering ma fuori viewport */
#pdfReportFrame {
  position: fixed;
  top: 0;
  left: 0;
  width: 210mm;
  height: 100vh;
  opacity: 0;
  pointer-events: none;
  z-index: -1;
  border: none;
}

/* Stili specifici per il contenuto PDF */
.pdf-report {
  width: 210mm;
  min-height: 297mm;
  padding: 15mm;
  background: white;
  font-family: 'Poppins', sans-serif;
  color: #333;
  box-sizing: border-box;
}

.pdf-report * {
  box-sizing: border-box;
}

/* Header PDF */
.pdf-header {
  background: linear-gradient(135deg, #407A00, #2d5700);
  border-radius: 12px;
  padding: 20px 24px;
  color: white;
  margin-bottom: 16px;
  position: relative;
  overflow: hidden;
}

.pdf-header::before {
  content: '';
  position: absolute;
  top: -30px;
  right: -30px;
  width: 120px;
  height: 120px;
  background: rgba(255,255,255,0.08);
  border-radius: 50%;
}

.pdf-logo {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 8px;
  position: relative;
}

.pdf-logo span {
  color: #a3d977;
}

.pdf-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 4px;
  position: relative;
}

.pdf-subtitle {
  font-size: 11px;
  opacity: 0.85;
  position: relative;
}

.pdf-date {
  position: absolute;
  top: 20px;
  right: 24px;
  font-size: 10px;
  opacity: 0.75;
  background: rgba(255,255,255,0.15);
  padding: 4px 10px;
  border-radius: 20px;
}

/* Sezioni PDF */
.pdf-section {
  margin-bottom: 14px;
}

.pdf-section-title {
  font-size: 13px;
  font-weight: 700;
  color: #407A00;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 2px solid #e8f5d9;
  display: flex;
  align-items: center;
  gap: 8px;
}

.pdf-section-title i {
  font-size: 12px;
}

/* Grid specifiche */
.pdf-specs-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}

.pdf-spec-card {
  background: #f9fafb;
  border-radius: 10px;
  padding: 12px;
  border: 1px solid #e5e7eb;
  text-align: center;
}

.pdf-spec-icon {
  width: 32px;
  height: 32px;
  background: #e8f5d9;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #407A00;
  font-size: 14px;
  margin: 0 auto 8px;
}

.pdf-spec-label {
  font-size: 9px;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 2px;
}

.pdf-spec-value {
  font-size: 16px;
  font-weight: 700;
  color: #1f2937;
}

.pdf-spec-unit {
  font-size: 10px;
  color: #6b7280;
  font-weight: 600;
}

.pdf-spec-note {
  font-size: 8px;
  color: #9ca3af;
  margin-top: 2px;
}

/* Eco section PDF */
.pdf-eco-section {
  background: linear-gradient(135deg, #407A00, #2d5700);
  border-radius: 12px;
  padding: 16px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 14px;
}

.pdf-eco-card {
  text-align: center;
  color: white;
}

.pdf-eco-icon {
  width: 36px;
  height: 36px;
  background: rgba(255,255,255,0.15);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  margin: 0 auto 8px;
}

.pdf-eco-value {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 2px;
}

.pdf-eco-label {
  font-size: 9px;
  opacity: 0.85;
  line-height: 1.3;
}

/* Risparmio section */
.pdf-savings {
  background: white;
  border-radius: 12px;
  padding: 16px;
  border: 2px solid #e8f5d9;
  margin-bottom: 14px;
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 16px;
}

.pdf-savings-title {
  font-size: 10px;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.pdf-savings-value {
  font-size: 26px;
  font-weight: 700;
  color: #407A00;
  line-height: 1;
  margin-bottom: 4px;
}

.pdf-savings-sub {
  font-size: 10px;
  color: #6b7280;
}

.pdf-payback {
  background: #f9fafb;
  border-radius: 8px;
  padding: 12px;
  text-align: center;
}

.pdf-payback-value {
  font-size: 20px;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 2px;
}

.pdf-payback-label {
  font-size: 9px;
  color: #6b7280;
}

/* Grafici PDF */
.pdf-chart-container {
  background: #f9fafb;
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 12px;
}

.pdf-chart-title {
  font-size: 11px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.pdf-chart-title i {
  color: #407A00;
}

.pdf-chart-wrap {
  height: 140px;
  position: relative;
}

.pdf-chart-wrap-large {
  height: 180px;
  position: relative;
}

/* Tabella flussi */
.pdf-flows {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.pdf-flow {
  background: #f9fafb;
  border-radius: 8px;
  padding: 10px;
  text-align: center;
  border: 1px solid #e5e7eb;
}

.pdf-flow-icon {
  font-size: 14px;
  margin-bottom: 6px;
  color: #407A00;
}

.pdf-flow-label {
  font-size: 8px;
  color: #6b7280;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 4px;
  line-height: 1.2;
}

.pdf-flow-value {
  font-size: 11px;
  font-weight: 700;
  color: #1f2937;
}

.pdf-flow-inactive {
  opacity: 0.5;
}

/* Preventivo PDF */
.pdf-preventivo {
  background: white;
  border-radius: 12px;
  padding: 16px;
  border: 2px solid #407A00;
  margin-top: 14px;
}

.pdf-preventivo-title {
  font-size: 13px;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.pdf-preventivo-title i {
  color: #407A00;
}

.pdf-price-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 10px;
  color: #4b5563;
  border-bottom: 1px solid #f3f4f6;
}

.pdf-price-row:last-of-type {
  border-bottom: none;
}

.pdf-price-row.total {
  padding-top: 10px;
  margin-top: 4px;
  border-top: 2px solid #e5e7eb;
  border-bottom: none;
  font-size: 14px;
  font-weight: 700;
  color: #1f2937;
}

.pdf-price-row.discount {
  color: #407A00;
  font-weight: 600;
}

.pdf-price-amount {
  font-weight: 700;
}

.pdf-price-total {
  color: #407A00;
  font-size: 18px;
}

.pdf-note {
  font-size: 8px;
  color: #6b7280;
  margin-top: 10px;
  line-height: 1.5;
  text-align: center;
  font-style: italic;
}

/* Footer PDF */
.pdf-footer {
  margin-top: 20px;
  padding-top: 12px;
  border-top: 1px solid #e5e7eb;
  text-align: center;
}

.pdf-footer-logo {
  font-size: 14px;
  font-weight: 700;
  color: #407A00;
  margin-bottom: 4px;
}

.pdf-footer-logo span {
  color: #5a9e00;
}

.pdf-footer-text {
  font-size: 8px;
  color: #9ca3af;
  line-height: 1.5;
}

/* Page break per paginazione */
.pdf-page-break {
  page-break-before: always;
  break-before: page;
}

/* Forza stampa bianco e nero/grayscale se necessario */
@media print {
  .pdf-report {
    width: 100% !important;
    padding: 10mm !important;
  }
}

/* Responsive per il container nascosto */
@media screen {
  #pdfReportContainer {
    display: none;
  }
}

/* ═══════════════════════════════════════════════════════════════
   STEP 4 — BITRIX FORM INTERMEDIATE STEP
   ═══════════════════════════════════════════════════════════════ */

/* Step 4 nascosto inizialmente come step 2 e 3 */
#step4 { display: none; }

/* ─── BITRIX FORM CONTAINER ─────────────────────────────────── */
.bitrix-form-container {
  position: relative;
  min-height: 350px;
  margin-top: 20px;
  border-radius: var(--radius-md);
  background: var(--white);
  transition: opacity 0.3s ease;
}

.bitrix-form-container.loading {
  opacity: 0.5;
  pointer-events: none;
}

.bitrix-form-container iframe {
  display: block;
  width: 100%;
  min-height: 350px;
  border: none;
  border-radius: var(--radius-md);
  transition: opacity 0.3s ease;
}

/* ─── LOADING SPINNER OVERLAY ───────────────────────────────── */
.loading-spinner-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  border-radius: var(--radius-md);
}

.loading-spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.spinner-circle {
  width: 60px;
  height: 60px;
  border: 4px solid var(--gray-200);
  border-top-color: var(--green-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-spinner p {
  font-size: 16px;
  font-weight: 600;
  color: var(--green-primary);
  margin: 0;
}

/* ─── SUBMIT SUCCESS OVERLAY ───────────────────────────────── */
.submit-success-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 320px;
  padding: 40px 20px;
}

.submit-success-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
  max-width: 360px;
}

.submit-success-icon {
  width: 72px;
  height: 72px;
  background: linear-gradient(135deg, #e8f5d9, #d1ebc0);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: successPop 0.5s ease-out;
}

.submit-success-icon i {
  font-size: 36px;
  color: var(--green-primary);
}

.submit-success-content h3 {
  font-size: 20px;
  font-weight: 700;
  color: var(--green-primary);
  margin: 4px 0 0;
}

.submit-success-content p {
  font-size: 14px;
  color: #6b7280;
  margin: 0;
  line-height: 1.5;
}

.submit-success-bar {
  width: 200px;
  height: 4px;
  background: #e5e7eb;
  border-radius: 2px;
  overflow: hidden;
  margin-top: 8px;
}

.submit-success-bar-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--green-primary), var(--green-light, #5a9e00));
  border-radius: 2px;
  animation: progressFill 4.5s ease-in-out forwards;
}

@keyframes successPop {
  0%   { transform: scale(0.3); opacity: 0; }
  60%  { transform: scale(1.1); }
  100% { transform: scale(1);   opacity: 1; }
}

@keyframes progressFill {
  0%   { width: 0%; }
  100% { width: 100%; }
}

/* ─── FORM ERROR MESSAGE ────────────────────────────────────── */
.form-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: var(--radius-sm);
  padding: 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 20px;
}

.form-error i {
  color: #dc2626;
  font-size: 18px;
  flex-shrink: 0;
  margin-top: 2px;
}

.form-error span {
  flex: 1;
  font-size: 14px;
  color: #991b1b;
  line-height: 1.5;
}

.form-error .btn {
  margin-top: 12px;
}

/* ─── RESPONSIVE MOBILE ──────────────────────────────────────── */
@media (max-width: 768px) {
  .bitrix-form-container {
    min-height: 300px;
  }

  .bitrix-form-container iframe {
    min-height: 300px;
  }
  
  .spinner-circle {
    width: 50px;
    height: 50px;
  }
  
  .loading-spinner p {
    font-size: 14px;
  }
}

@media (max-width: 480px) {
  .bitrix-form-container {
    min-height: 250px;
  }

  .bitrix-form-container iframe {
    min-height: 250px;
  }

  .spinner-circle {
    width: 40px;
    height: 40px;
    border-width: 3px;
  }

  .loading-spinner p {
    font-size: 13px;
  }

  .form-error {
    padding: 12px;
    font-size: 13px;
  }

  .submit-success-overlay {
    min-height: 240px;
    padding: 24px 16px;
  }

  .submit-success-icon {
    width: 56px;
    height: 56px;
  }

  .submit-success-icon i {
    font-size: 28px;
  }

  .submit-success-content h3 {
    font-size: 17px;
  }

  .submit-success-content p {
    font-size: 13px;
  }
}

/* ─── ACCESSIBILITY ──────────────────────────────────────────── */
.bitrix-form-container:focus-visible,
.btn:focus-visible {
  outline: 3px solid var(--green-primary);
  outline-offset: 2px;
}

/* Ensure ARIA live regions are announced */
[aria-live="polite"] {
  position: relative;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .spinner-circle {
    border-width: 5px;
  }
  
  .form-error {
    border-width: 2px;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .spinner-circle {
    animation: none;
    border-top-color: var(--green-primary);
    border-right-color: var(--green-primary);
  }

  .bitrix-form-container,
  .bitrix-form-container iframe {
    transition: none;
  }

  .submit-success-icon {
    animation: none;
  }

  .submit-success-bar-fill {
    animation: none;
    width: 100%;
  }
}
