/* WENERGY DEBUG – Ajout temporaire de classes de couleur pour distinguer visuellement certaines cartes du simulateur */
/* ===============================
   WENERGY – DC SOLAIRE (PREMIUM)
   CSS 100% compatible structure/JS
   Sections : layout, header, cartes (conso, batterie, capacité, invest), graphiques, jauge/cartes de gain, popups, modules batterie.
================================ */

/* ================================================= */
/* SECTION : Layout global (reset, body, shell) */
/* ================================================= */
*,
*::before,
*::after { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #f3f5f4;
  color: #0f172a;
}

/* ================================================= */
/* SECTION : Wrapper principal (contenu centré) */
/* ================================================= */
#simulatorContent {
  max-width: none;
  margin: 0;
  padding: 0;
}

.main-wrapper {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 20px 24px 80px;
}

/* ================================================= */
/* SECTION : Header premium (pleine largeur) */
/* ================================================= */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
  margin-top: 14px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.06);
}

.header-inner {
  max-width: 1220px;
  height: 56px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo img {
  height: 145px;
  width: auto;
  display: block;
}

.lang-switcher {
  display: flex;
  align-items: center;
  gap: 18px;
  text-align: right;
  margin-bottom: 0;
  font-size: 18px;
}

.lang-btn,
.lang-switcher .lang-switch {
  border: none;
  background: transparent;
  color: #64748b;
  font-size: 16px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.lang-btn:hover,
.lang-switcher .lang-switch:hover {
  background: rgba(100, 116, 139, 0.08);
}

.lang-btn.active,
.lang-switcher .lang-switch[aria-pressed="true"] {
  background: #e8f1ea;
  color: #1f9f58;
  box-shadow: inset 0 0 0 1px rgba(31, 159, 88, 0.04);
}

.lang-switcher-topbar .lang-switch {
  padding: 8px 14px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
}

/* ================================================= */
/* SECTION : Conteneur principal simulateur (shell, app-container) */
/* ----- Shell + “cadre général” (gros container premium) ----- */
#dc-solaire-simulator { overflow-x: hidden; }

.app-shell {
  padding: 48px 22px 84px;
}

.app-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  border-radius: 0;
  background: transparent;
  /* Layout vertical : une seule colonne (configuration → résultats → graphique) */
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  align-items: start;
}

/*
  (règles orphelines neutralisées)
  box-shadow: 0 18px... appliqué via .card-premium
*/
/* ================================================= */
/* SECTION : Titre et sous-titre (premium) */
/* ================================================= */
.sim-header {
  margin: 0 0 32px;
}

h1,
.sim-title {
  text-align: center;
  font-size: 38px;
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: #0f172a;
  margin: 0 0 12px;
}

.subtitle,
.sim-subtitle {
  text-align: center;
  font-size: 15px;
  line-height: 1.4;
  font-weight: 500;
  color: #6b7a95;
  max-width: 560px;
  margin: 0 auto 36px;
}

.lang-switcher .lang-switch {
  cursor: pointer;
}

/* ================================================= */
/* SECTION : Cartes du simulateur (inputs, conso, batterie) */
/* ================================================= */
.inputs-main {
  margin-bottom: 26px;
  width: 100%;
}

/* Conteneur commun : deux cartes même hauteur (bords alignés) */
.inputs-cards-row {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 22px;
  width: 100%;
}

.inputs-cards-row > .card.card-conso.card-1,
.inputs-cards-row > .card.card-battery.card-2 {
  flex: 1 1 0;
  min-width: 0;
  min-height: 0;
  height: auto;
  max-height: none;
  box-sizing: border-box;
  padding: 22px 24px;
  overflow: visible;
  align-self: stretch;
}

/* ----- Cartes premium : styles de base pour toutes les cartes (conso, batterie, capacité, invest, résultats) ----- */
.card,
.sim-card,
.card-premium,
.info-card,
.info-mini-card {
  border-radius: 28px;
  box-shadow:
    0 18px 45px rgba(15, 23, 42, 0.06),
    0 3px 10px rgba(15, 23, 42, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.55);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card-premium {
  padding: 22px 24px;
  background: #ffffff;
}

.card:hover,
.sim-card:hover,
.card-premium:hover,
.info-card:hover,
.info-mini-card:hover {
  transform: translateY(-2px);
  box-shadow:
    0 22px 54px rgba(15, 23, 42, 0.08),
    0 6px 18px rgba(15, 23, 42, 0.04);
}

/* Carte conso : fond neutre */
.card-conso.card-premium {
  background: #ffffff;
  border: 1px solid #e5e7eb;
}

/* Carte modules batterie : fond neutre */
.inputs-main .card-2.card-premium,
.card-battery.card-premium {
  background: #ffffff;
  border: 1px solid #e5e7eb;
}

/* Mini-carte capacité : fond neutre */
.info-mini-card-capacity.card-premium {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  box-shadow:
    0 18px 45px rgba(15, 23, 42, 0.06),
    0 3px 10px rgba(15, 23, 42, 0.03);
}

/* Mini-carte investissement : fond neutre */
.info-mini-card-invest.card-premium {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  box-shadow:
    0 18px 45px rgba(15, 23, 42, 0.06),
    0 3px 10px rgba(15, 23, 42, 0.03);
}

/* Mini-cartes capacité / investissement : pas d’étirement vertical (contenu naturel) */
.card-centered {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  text-align: center;
}

/* Titres de cartes */
.block-label,
.block-title {
  display: block;
  font-size: 16px;
  font-weight: 600;
  color: #334155;
  margin-bottom: 10px;
}

.card-conso .block-label {
  text-align: center;
  font-size: 16px;
  font-weight: 600;
}
#batteryCountTitle,
.card-battery .block-title {
  text-align: center;
  font-size: 16px;
  font-weight: 600;
}

/* Inputs premium */
.input-row { display: flex; align-items: center; gap: 12px; }

input[type="number"],
.input-row input,
.sim-input,
.input-full {
  height: 52px;
  width: 100%;
  padding: 0 18px;
  border-radius: 16px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.03);
  font-size: 18px;
  font-weight: 600;
  color: #0f172a;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
  box-sizing: border-box;
}

.input-full {
  height: auto;
  padding: 18px 24px;
  font-size: 18px;
  font-weight: 500;
}

.input-row input:focus,
.input-full:focus {
  outline: none;
  border-color: rgba(31, 157, 90, 0.55);
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(31, 157, 90, 0.14);
}

.unit {
  font-size: 18px;
  color: #64748b;
  white-space: nowrap;
}

.conso-help-link {
  display: block;
  margin-top: 14px;
  width: 100%;
  font-size: 17px;
  font-weight: 500;
  color: #1f9d5a;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  text-align: center;
  text-decoration: underline;
  transition: color 0.2s ease;
}
.conso-help-link:hover { color: #17884a; }

/* ----- Modules batterie : sélecteur 1–9 (battery-choices, battery-choice, état active/hover) ----- */
.battery-choices {
  display: flex;
  flex-wrap: nowrap;
  gap: 10px 14px;
  justify-content: center;
}

.battery-choice {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  box-shadow: none;
  border-radius: 0;
  flex-shrink: 0;
}

.battery-choice .battery-svg {
  width: 32px;
  height: 32px;
  opacity: 0.6;
  transition: opacity 0.2s ease;
}

.battery-choice.active .battery-svg,
.battery-choice.hover-active .battery-svg {
  opacity: 1;
}

.battery-choice .battery-label {
  margin-top: 6px;
  font-size: 16px;
  font-weight: 500;
  color: #64748b;
}

/* ----- Mini cards capacité / investissement (grille .info-mini-cards) ----- */
.info-mini-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  margin: 24px 0 28px;
  align-items: start;
}
.info-mini-cards > * {
  min-width: 0;
}
.info-mini-cards .card-premium {
  width: 100%;
  box-sizing: border-box;
}

.info-mini-cards .info-mini-card {
  padding: 12px 16px;
  max-width: 500px;
  margin: 0 auto;
  min-height: unset;
  height: auto;
  font-size: 16px;
  font-weight: 500;
  color: #334155;
  box-sizing: border-box;
}

/* Capacité totale + Mon investissement : hauteur naturelle, pas d’étirement forcé */
.info-mini-cards .info-mini-card-capacity,
.info-mini-cards .info-mini-card-invest {
  height: auto;
  min-height: unset;
  max-height: none;
  align-self: start;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.info-mini-cards .card-centered {
  gap: 0.35em;
}

.info-mini-label {
  flex-shrink: 0;
  font-size: 16px;
  font-weight: 500;
  color: #64748b;
  margin-bottom: 0;
}

.info-mini-value {
  font-size: 19px;
  font-weight: 700;
  color: #1e293b;
}

.info-mini-value-loading {
  color: #475569;
}

.info-mini-loader-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 600;
}

.info-mini-loader-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid rgba(71, 85, 105, 0.25);
  border-top-color: #2563eb;
  animation: infoMiniLoaderSpin 0.75s linear infinite;
}

@keyframes infoMiniLoaderSpin {
  to {
    transform: rotate(360deg);
  }
}

/* ----- PV toggle : barre « + Je connais mon installation solaire » premium ----- */
.panel-optional { margin-top: 32px; }

.panel-optional .card-pv-panel,
.card-pv-panel.card-premium {
  background: rgba(255, 255, 255, 0.74);
  backdrop-filter: blur(8px);
  box-shadow:
    0 18px 45px rgba(15, 23, 42, 0.06),
    0 3px 10px rgba(15, 23, 42, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 28px;
}

.card-pv-panel .panel-trigger {
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  font-size: 18px;
  font-weight: 500;
  color: #1f9d5a;
  padding: 0;
  line-height: normal;
  cursor: pointer;
  transition: opacity 0.15s ease, color 0.15s ease;
}

.card-pv-panel .panel-trigger:hover { opacity: .9; }

/* Carte PV fermée : hauteur au texte uniquement */
.panel-optional .card-pv-panel:has(#pvOptionalBlock[style*="none"]) {
  height: auto;
  min-height: unset;
  max-height: none;
  padding-top: 16px;
  padding-bottom: 16px;
  padding-left: 24px;
  padding-right: 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-sizing: border-box;
  overflow: hidden;
}

.panel-optional .card-pv-panel:has(#pvOptionalBlock[style*="block"]) {
  min-height: unset;
  max-height: none;
  overflow: visible;
}

.panel-optional .card-pv-panel:has(#pvOptionalBlock[style*="none"]) .panel-trigger {
  display: flex;
  align-items: center;
  padding: 0;
  flex: 0 1 auto;
  min-height: 0;
}

.card-pv-panel .panel-content {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
}

.card-pv-panel .panel-content .block-label {
  font-size: 18px;
  font-weight: 400;
  color: #334155;
  text-align: center;
}

.panel-trigger {
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  font-size: 15px;
  font-weight: 500;
  color: #1f9d5a;
  padding: 16px 6px;
  cursor: pointer;
  transition: opacity .15s ease, transform .15s ease;
}

.panel-trigger:hover { opacity: .9; transform: translateY(-1px); }

.micro-message {
  margin: 6px 6px 0;
  min-height: 1.2em;
  font-size: 13px;
  color: #64748b;
}

.panel-content {
  margin-top: 14px;
  padding: 26px 26px;
  border-radius: 18px;
  background: rgba(255,255,255,0.92);
  border: 1px solid rgba(15, 23, 42, 0.06);
  box-shadow:
    0 20px 55px rgba(15, 23, 42, 0.10),
    0 8px 18px rgba(15, 23, 42, 0.05);
}

.input-full { margin-bottom: 16px; }
.input-full:last-of-type { margin-bottom: 0; }

/* ================================================= */
/* SECTION : Bouton d’action (calculer) */
/* ================================================= */
.actions,
.button-wrap,
.cta-wrap,
.calc-wrap {
  display: flex;
  justify-content: center;
  margin-top: 36px;
  margin-bottom: 18px;
  text-align: center;
}

.btn-primary-premium,
#simulateBtn,
.btn-calc,
.calc-button {
  min-width: 320px;
  height: 64px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(180deg, #27ae60 0%, #1f9a54 100%);
  color: white;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  box-shadow:
    0 16px 30px rgba(39, 174, 96, 0.22),
    0 6px 14px rgba(39, 174, 96, 0.14);
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
  cursor: pointer;
  padding: 0 36px;
  font-family: inherit;
}

.btn-primary-premium:hover,
#simulateBtn:hover,
.btn-calc:hover,
.calc-button:hover {
  transform: translateY(-2px);
  box-shadow:
    0 22px 38px rgba(39, 174, 96, 0.28),
    0 8px 18px rgba(39, 174, 96, 0.18);
  filter: saturate(1.03);
}

/* ================================================= */
/* SECTION : Zone résultats (titre, cartes, texte) */
/* ================================================= */
.results-section {
  margin-top: 48px;
  width: 100%;
  max-width: none;
  padding: 44px;
  border-radius: 28px;
  background: #ffffff;
  box-shadow:
    0 18px 45px rgba(15, 23, 42, 0.06),
    0 3px 10px rgba(15, 23, 42, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.55);
}

.results-title {
  margin: 0 0 20px;
  font-size: 20px;
  font-weight: 400;
  letter-spacing: -0.3px;
  color: #0b1220;
  text-align: center;
}

/* ================================================= */
/* SECTION : Graphiques */
/* ================================================= */
.card-chart { padding: 28px; margin-top: 0; }
.chart-legend {
  width: 100%;
  position: relative;
}
#roiChart { width: 100% !important; max-width: 100%; }
.card-chart canvas {
  max-height: 400px;
}

.chart-hint {
  text-align: center;
  font-size: 13px;
  color: #6b7280;
  margin-top: 10px;
  line-height: 1.5;
}

/* Résumé dynamique sous les icônes batteries — largeur élargie (1–2 lignes desktop) */
#simulation-summary.simulation-summary,
#simulation-summary {
  max-width: min(1100px, 100%);
  width: 100%;
  margin: 20px auto 0;
  padding: 0 8px;
  box-sizing: border-box;
  text-align: center;
  font-size: 15px;
  line-height: 1.5;
  color: #0f172a;
}

/* Résumé des données calcul – sobre et lisible */
.card-results {
  margin-top: 18px;
  padding: 12px 16px !important;
  border-radius: 14px;
  background: #fafbfc;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.03);
  min-height: unset;
  height: auto;
}

.summary-text {
  margin: 0 0 12px;
  color: #64748b;
  line-height: 1.45;
  font-size: 12px;
}

.summary-table-wrapper {
  overflow-x: auto;
  border-radius: 10px;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.05);
}

.summary-table-wrapper table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.summary-table-wrapper tr {
  border-bottom: 1px solid rgba(15, 23, 42, 0.04);
}

.summary-table-wrapper tr:last-child {
  border-bottom: none;
}

.summary-table-wrapper td {
  padding: 10px 14px;
  color: #475569;
  vertical-align: middle;
}

.summary-table-wrapper td:last-child {
  text-align: right;
  font-weight: 500;
  color: #0f172a;
}

.summary-table-wrapper td.cost-compare-title {
  text-align: center;
  font-weight: 600;
  font-size: 12px;
  color: #6b7280;
  padding: 8px 14px 6px;
  border-bottom: none;
  background: transparent;
}

.summary-table-wrapper tr.summary-row-gain td {
  background: rgba(236, 253, 245, 0.6);
  border-bottom: none;
  padding: 12px 14px;
  font-weight: 600;
  color: #0f172a;
}

.summary-table-wrapper tr.summary-row-gain td:last-child {
  font-weight: 700;
  color: #0f172a;
}

.result-highlight {
  font-size: 18px;
  font-weight: 700;
  color: #1f9d5a;
  letter-spacing: -0.2px;
}

/* ----- Résumé en 2 cartes (Gain + Coût comparatif) ----- */
.results-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 8px;
  align-items: flex-start;
}

.card-result-gain,
.card-result-compare {
  flex: 0 1 280px;
  min-width: 0;
  align-self: flex-start;
}

/* Cartes gain / comparatif : padding compact */
.results-cards > .card.card-premium {
  padding: 12px 16px;
}


.card-result-gain-title,
.card-result-compare-title {
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 600;
  color: #334155;
  text-align: center;
}

/* =====================================================
   JAUGES – 3 cartes de gain (Par mois / Par an / 16 ans)
   Grille 3 colonnes, titre + valeur + zone mini-graphique Chart.js. Teintes optionnelles par carte (mois/an/16y).
   ===================================================== */

.gauge-gain-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin: 18px 0 22px 0;
  align-items: start;
}

/* Carte : dégradé très subtil, pas de relief marqué */
.gauge-gain-card {
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border-radius: 18px;
  padding: 12px 16px;
  border: 1px solid rgba(148,163,184,0.18);
  box-shadow: 0 6px 16px rgba(0,0,0,0.05);
  min-height: unset;
  height: auto;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 8px;
  align-self: start;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

/* Hover discret : légère élévation, ombre douce */
.gauge-gain-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(0,0,0,0.06);
}

/* Titre centré et discret */
.gauge-gain-card-title {
  text-align: center;
  font-size: 17px;
  font-weight: 600;
  color: #64748b;
  margin-bottom: 8px;
}

/* Ligne montant + graphique : overflow pour garder le graphique dans la carte */
.gauge-gain-card-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  overflow: hidden;
}

/* Montant : taille réduite pour ne pas dominer la carte */
.gauge-gain-card-value {
  font-size: 32px;
  font-weight: 700;
  color: #2f9e44;
  line-height: 1;
  white-space: nowrap;
}

/* Mini-graphe Chart.js : contenu dans la carte */
.gauge-gain-card-chart-wrap {
  width: 120px;
  height: 56px;
  flex: 0 0 auto;
  overflow: hidden;
}

.gauge-gain-card-chart {
  width: 120px !important;
  height: 56px !important;
  display: block;
}

/* Teinte optionnelle par carte (mois / an / 16 ans) */
.card-month {
  box-shadow: 0 10px 24px rgba(34,197,94,0.10);
}

.card-year {
  box-shadow: 0 10px 24px rgba(59,130,246,0.10);
}

.card-16y {
  box-shadow: 0 10px 24px rgba(239,68,68,0.10);
}

/* ================================================= */
/* SECTION : Responsive (mobile / tablette) – un seul bloc 768px, un seul bloc 600px */
/* ================================================= */

.card-result-gain-value {
  margin: 0 0 16px;
  font-size: 28px;
  font-weight: 700;
  color: #1f9d5a;
  text-align: center;
  letter-spacing: -0.5px;
}

.card-result-sep {
  border: none;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  margin: 0 0 16px;
}

.card-result-payback-line {
  margin: 0;
  font-size: 14px;
  color: #334155;
  text-align: center;
}

.card-result-payback-label {
  font-weight: 400;
}

.card-result-payback-line #summaryPaybackValue {
  font-weight: 700;
}

.card-result-columns {
  display: flex;
  gap: 0;
  align-items: flex-start;
}

.card-result-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 12px;
  border-right: 1px solid rgba(15, 23, 42, 0.08);
}

.card-result-col:last-child {
  border-right: none;
}

.card-result-col-with {
  border-right: none;
}

.card-result-col-label {
  font-size: 14px;
  color: #334155;
  margin-bottom: 8px;
}

.card-result-col-value {
  font-size: 22px;
  font-weight: 700;
  color: #0f172a;
}

.card-result-col-value-green {
  color: #1f9d5a;
}

.results-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 14px;
  text-align: center;
  margin-top: 24px;
}

.btn-secondary {
  padding: 14px 32px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 17px;
  border: none;
  background: #e2e8f0;
  color: #475569;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.btn-secondary:hover {
  background: #cbd5e1;
  color: #334155;
}

.btn-commander {
  padding: 14px 32px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 17px;
  border: none;
  background: #1f9d5a;
  color: #fff;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-commander:hover {
  background: #17884a;
}

/* ================================================= */
/* SECTION : Popup commande / formulaire / devis */
/* Overlay, carte, bandeau logo, récapitulatif (order-summary), boutons. Utilisé par order-popup et popup-devis. */
/* ================================================= */
.order-popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 100001;
  padding: 20px;
}

.order-popup-card {
  background: #fff;
  padding: 0 0 28px;
  border-radius: 20px;
  max-width: 820px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.2);
  position: relative;
}

.order-popup-bandeau {
  position: relative;
  height: 70px;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 20px 20px 0 0;
}

.order-popup-bandeau-logo {
  position: absolute;
  left: 32px;
  top: 50%;
  transform: translateY(-50%);
}

.order-popup-bandeau-logo img {
  height: 140px;
  width: auto;
  display: block;
}

.order-popup-card .order-form-sections {
  padding: 0 32px;
  padding-top: 0;
}

@keyframes orderSpin {
  to { transform: rotate(360deg); }
}

/* Overlay de chargement plein écran (bouton Commander) : fond semi-transparent, spinner centré, compatible mobile */
.command-loader-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 100002;
  padding: 20px;
}

.command-loader-spinner {
  width: 44px;
  height: 44px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: orderSpin 0.7s linear infinite;
}

.command-loader-text {
  margin: 16px 0 0;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  text-align: center;
}

.order-popup-title {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  font-size: 22px;
  font-weight: 600;
  color: #0f172a;
  text-align: center;
  white-space: nowrap;
}

.order-form-sections {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.order-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.order-form-row .order-form-section {
  min-width: 0;
}

.order-form-section label {
  display: block;
  font-size: 17px;
  font-weight: 600;
  color: #334155;
  margin-bottom: 8px;
}

.order-input {
  width: 100%;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: #fafbfc;
  font-size: 17px;
  color: #0f172a;
  box-sizing: border-box;
}

.order-input:focus {
  outline: none;
  border-color: #1f9d5a;
  background: #fff;
}

.order-form-section .order-voucher-apply {
  margin-top: 8px;
  padding: 10px 18px;
  border-radius: 10px;
  border: 1px solid #1f9d5a;
  background: #1f9d5a;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.order-form-section .order-voucher-apply:hover {
  background: #1a8a4e;
  border-color: #1a8a4e;
}

.order-voucher-error {
  display: block;
  margin-top: 6px;
  font-size: 14px;
  color: #b91c1c;
}

.order-voucher-message {
  display: block;
  margin-top: 6px;
  font-size: 14px;
}

.order-voucher-message.order-voucher-success {
  color: #1f9d5a;
  font-weight: 500;
}

.order-voucher-message.order-voucher-error {
  color: #b91c1c;
}

.coupon-error {
  font-weight: 700;
  color: #d32f2f;
}

.order-cgv-link {
  margin-top: 8px;
  margin-bottom: 4px;
}

.order-cgv-link a {
  display: block;
  text-align: center;
  font-weight: 500;
  font-size: 16px;
  color: #334155;
  text-decoration: underline;
  cursor: pointer;
}

.order-cgv-link a:hover {
  color: #1f9d5a;
}

.order-captcha-row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
}

.order-captcha-row .order-input {
  flex: 1;
}

.order-captcha-question {
  font-weight: 600;
  font-size: 17px;
  color: #334155;
}

.order-captcha-help {
  display: block;
  margin-top: -8px;
  margin-bottom: 12px;
  font-size: 15px;
  color: #555;
  text-align: center;
}

.order-summary {
  margin: 20px 32px 10px 32px;
  padding: 18px 22px;
  background: #f7faf8;
  border-radius: 14px;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.order-summary-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 12px;
}

#quoteSuccessMessage {
  text-align: center;
  margin-top: 12px;
  display: block;
  width: 100%;
}

.battery-advice {
  margin-top: 10px;
  font-size: 14px;
  color: #64748b;
  text-align: center;
}

.order-summary-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.quote-summary-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.quote-summary-table th,
.quote-summary-table td {
  padding: 6px 4px;
}

.quote-summary-table .label.total,
.quote-summary-table .price.total {
  font-weight: 600;
}

.order-summary-item {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  padding: 6px 0;
}

.order-summary-item:not(:last-child) {
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.order-item-label {
  color: #64748b;
}

.order-item-value {
  font-weight: 600;
}

.tooltip {
  position: relative;
  display: inline-block;
  margin-left: 6px;
}

.tooltip-icon {
  cursor: pointer;
  font-size: 12px;
  color: #666;
}

.tooltip-text {
  display: none;
  position: absolute;
  left: 0;
  top: 20px;
  background: #fff;
  border: 1px solid #ddd;
  padding: 8px 10px;
  width: 220px;
  font-size: 13px;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  z-index: 20;
}

.tooltip.open .tooltip-text {
  display: block;
}

.order-popup-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 24px;
  padding: 0 32px;
  flex-wrap: wrap;
}

.order-btn {
  padding: 14px 28px;
  border-radius: 12px;
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  border: none;
}

.order-btn-primary {
  background: #1f9d5a;
  color: #fff;
}

.order-btn-primary:hover {
  background: #17884a;
}

.order-btn-secondary {
  background: #e2e8f0;
  color: #475569;
}

.order-btn-secondary:hover {
  background: #cbd5e1;
}

/* Champ adresse Google (gmp-place-autocomplete) : fond blanc, évite héritage style global sombre */
#wenergy-simulator gmp-place-autocomplete input {
  background: #ffffff !important;
  color: #0f172a !important;
}
#wenergy-simulator gmp-place-autocomplete {
  --gmpx-color-surface: #ffffff;
  --gmpx-color-on-surface: #0f172a;
}

/* Google Places : PlaceAutocompleteElement (nouvelle API) + liste des suggestions au-dessus du popup */
.order-address-autocomplete {
  width: 100%;
}
.order-address-autocomplete gmp-place-autocomplete,
.order-address-autocomplete .gmp-place-autocomplete {
  display: block;
  width: 100%;
}
/* Style du champ de saisie intégré au composant (aligné sur .order-input) */
.order-address-autocomplete input,
.order-address-autocomplete [role="combobox"] {
  width: 100% !important;
  padding: 14px 16px !important;
  border-radius: 12px !important;
  border: 1px solid rgba(15, 23, 42, 0.12) !important;
  background: #fafbfc !important;
  font-size: 17px !important;
  color: #0f172a !important;
  box-sizing: border-box !important;
}
.order-address-autocomplete input:focus,
.order-address-autocomplete [role="combobox"]:focus {
  outline: none !important;
  border-color: #1f9d5a !important;
  background: #fff !important;
}
.pac-container {
  z-index: 100002 !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* ================================================= */
/* SECTION : Popup CGV */
/* ================================================= */
.cgv-popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 100003;
  padding: 20px;
}

.cgv-popup-card {
  background: #fff;
  padding: 28px 32px;
  border-radius: 20px;
  max-width: 680px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.2);
  border-top: 4px solid #1f9d5a;
}

.cgv-popup-title {
  margin: 0 0 20px;
  font-size: 20px;
  font-weight: 600;
  color: #0f172a;
  text-align: center;
}

.cgv-popup-content {
  font-size: 13px;
  line-height: 1.6;
  color: #334155;
}

.cgv-popup-content p {
  margin: 0 0 10px;
}

.cgv-popup-actions {
  text-align: center;
  margin-top: 24px;
}

/* ================================================= */
/* SECTION : Jauge / indicateur rentabilité */
/* ================================================= */
.adequation-gauge {
  margin-top: 22px;
  margin-bottom: 28px;
  padding: 24px;
  border-radius: 20px;
  background: #ffffff;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.10), 0 8px 24px rgba(0, 0, 0, 0.06);
}

.gauge-summary {
  margin-bottom: 20px;
}

.gauge-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 8px;
}

.gauge-summary-label {
  font-size: 18px;
  color: #334155;
}

.gauge-summary-value {
  font-size: 18px;
  font-weight: 600;
  color: #0f172a;
}

#gaugeGainValue {
  font-size: 22px;
  font-weight: 700;
  color: #1f9d5a;
}

.gauge-bar {
  position: relative;
  height: 12px;
  border-radius: 6px;
  overflow: visible;
  background: #e2e8f0;
  --gauge-percent: 0%;
}

.gauge-bar::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--gauge-percent, 0%);
  max-width: 100%;
  border-radius: 6px;
  background: linear-gradient(90deg, #e8f5e9 0%, #a5d6a5 40%, #66bb6a 70%, #2e7d32 100%);
  transition: width .35s ease;
}

.gauge-marker {
  position: absolute;
  top: 50%;
  left: 0%;
  transform: translate(-50%, -50%);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  pointer-events: none;
  transition: left .35s ease;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gauge-marker svg:not(.gauge-bolt-icon) {
  display: none;
}

.gauge-bolt-icon {
  display: block;
  color: #1f6ed4;
  width: 22px;
  height: 22px;
}

.zone-text {
  display: none;
}

.payback-text {
  text-align: center;
  margin: 18px 0 0;
  font-weight: 750;
  color: #334155;
}

.calc-method {
  margin-top: 20px;
  text-align: center;
  color: #64748b;
  font-size: 12px;
  line-height: 1.5;
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}

.note-contract {
  margin-top: 12px;
  text-align: center;
  color: #64748b;
  font-size: 13px;
}

/* ================================================= */
/* SECTION : Popup estimation consommation */
/* ================================================= */
.conso-popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 100000;
  padding: 20px;
}

.conso-popup-card {
  background: #fff;
  padding: 28px 32px;
  border-radius: 20px;
  max-width: 560px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.2);
}

.conso-popup-title {
  margin: 0 0 12px;
  font-size: 20px;
  font-weight: 600;
  color: #0f172a;
  text-align: center;
}

.conso-popup-intro {
  font-size: 13px;
  line-height: 1.5;
  color: #64748b;
  margin-bottom: 22px;
  text-align: center;
}

.conso-popup-section {
  margin-bottom: 20px;
  width: 100%;
}

.conso-popup-label {
  font-size: 14px;
  font-weight: 600;
  color: #334155;
  margin-bottom: 10px;
}

.conso-popup-choices {
  display: grid;
  gap: 10px;
  width: 100%;
}

.conso-popup-choices--3 {
  grid-template-columns: repeat(3, 1fr);
}

.conso-popup-choices--7 {
  grid-template-columns: repeat(7, 1fr);
}

.conso-popup-btn {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  background: #fff;
  font-size: 14px;
  color: #334155;
  cursor: pointer;
  transition: border-color .2s, background .2s, color .2s;
  min-width: 0;
  text-align: center;
}

.conso-popup-btn:hover {
  border-color: #1f9d5a;
  color: #1f9d5a;
}

.conso-popup-btn.selected {
  border-color: #1f9d5a;
  background: rgba(31, 157, 90, 0.1);
  color: #1f9d5a;
}

.conso-popup-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 24px;
}

.conso-popup-cancel {
  padding: 12px 24px;
  border-radius: 12px;
  border: 1px solid #cbd5e1;
  background: #fff;
  font-size: 15px;
  color: #64748b;
  cursor: pointer;
}

.conso-popup-validate {
  padding: 12px 24px;
  border-radius: 12px;
  border: none;
  background: #1f9d5a;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
}

.conso-popup-validate:hover {
  background: #17884a;
}

/* ================================================= */
/* SECTION : Responsive (mobile / tablette) – uniquement 768px et 600px pour préserver le desktop */
/* ================================================= */

@media (max-width: 768px) {
  .app-container {
    grid-template-columns: 1fr;
  }
  .inputs-cards-row { flex-direction: column; }
  .info-mini-cards { grid-template-columns: 1fr; }
  .results-section { padding: 28px; }

  .gauge-gain-cards {
    grid-template-columns: 1fr;
  }
  .gauge-gain-card-row {
    flex-direction: column;
    align-items: center;
    gap: 8px;
  }

  .app-shell { padding: 32px 12px 40px; }
  .app-container { padding: 28px 20px 44px; border-radius: 20px; }
  .sim-header { margin-bottom: 24px; }
  .sim-title { font-size: 26px; letter-spacing: -0.5px; }
  .sim-subtitle { font-size: 15px; max-width: 100%; }
  .lang-switcher { font-size: 16px; margin-bottom: 10px; }
  .lang-switcher .lang-switch { padding: 6px 12px; margin-left: 6px; }

  .card-premium { padding: 20px 18px; border-radius: 16px; }
  .results-cards > .card.card-premium {
    padding: 12px 16px;
  }
  .block-label, .block-title { margin-bottom: 10px; font-size: 13px; }
  .card-conso .block-label { font-size: 16px; }
  #batteryCountTitle, .card-battery .block-title { font-size: 16px; }
  .input-row input, .input-full { padding: 12px 14px; font-size: 16px; }
  .input-row { gap: 8px; }
  .conso-help-link { font-size: 14px; margin-top: 8px; }

  .battery-choices { flex-wrap: wrap; justify-content: center; gap: 8px 10px; }
  .battery-choice .battery-svg { width: 28px; height: 28px; }
  .battery-choice .battery-label { font-size: 11px; margin-top: 2px; }

  .info-mini-cards { margin: 18px 0 22px; gap: 12px; }
  .info-mini-cards .info-mini-card { padding: 12px 16px; font-size: 16px; }
  .info-mini-label, .info-mini-value { font-size: 16px; }

  .panel-optional { margin-top: 16px; }
  .card-pv-panel .panel-trigger { font-size: 14px; padding: 0; line-height: normal; }
  .card-pv-panel .panel-content .block-label { font-size: 16px; }
  .panel-content { padding: 18px 18px; margin-top: 12px; }
  .input-full { margin-bottom: 12px; }

  .actions { margin: 32px 0 14px; }
  .btn-primary-premium,
  #simulateBtn,
  .btn-calc,
  .calc-button {
    padding: 18px 32px;
    font-size: 18px;
    min-width: 0;
    width: 100%;
    max-width: 360px;
    height: 72px;
  }

  .results-title { font-size: 18px; margin-bottom: 16px; }
  .adequation-gauge { margin-top: 16px; margin-bottom: 20px; padding: 18px 16px; border-radius: 16px; }
  .gauge-summary-row { flex-wrap: wrap; gap: 4px 12px; margin-bottom: 6px; }
  .gauge-summary-label, .gauge-summary-value { font-size: 15px; }
  #gaugeGainValue { font-size: 18px; }
  .gauge-bar { height: 10px; border-radius: 5px; }
  .gauge-marker { width: 20px; height: 20px; }

  .card-chart { padding: 20px 16px; min-height: unset; height: auto; }
  .chart-hint { font-size: 12px; margin-top: 10px; }

  /* Cartes Mois / Année / 16 ans : centrer texte, hauteur au contenu */
  .gauge-gain-card {
    text-align: center;
    align-items: center;
    justify-content: flex-start;
  }
  /* Masquer uniquement les mini graphiques dans les cartes Mois / Année / 16 ans (valeurs restent visibles) */
  .gauge-gain-card svg {
    display: none;
  }
  .gauge-gain-card .gauge-gain-card-chart-wrap {
    display: none;
  }
  .gauge-gain-card-row {
    justify-content: center;
  }
  .gauge-gain-card-value {
    font-size: 22px;
  }
  /* Graphique ROI : hauteur fixe mobile uniquement (ne pas cibler #roiChart pour préserver le desktop) */
  .card-chart canvas {
    height: 360px !important;
    max-height: 360px;
  }
  /* Sélecteur batteries sous le graphique : 1 ou 2 lignes si besoin, dans la carte */
  .chart-battery-selector {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px;
  }
  .chart-battery-selector .chart-battery-choices {
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
  }
  .chart-battery-selector .chart-battery-choices svg {
    width: 32px;
    height: auto;
  }
  /* Espacement mobile : cartes formulaire / mini-cartes — pas gain/coût (.card-chart garde padding dédié ci-dessus) */
  .inputs-main .card,
  .info-mini-cards .info-mini-card,
  .panel-optional .card {
    padding: 18px;
  }

  .results-cards { flex-direction: column; gap: 14px; margin-top: 6px; align-items: flex-start; }
  .card-result-gain, .card-result-compare {
    flex: 0 1 auto;
    min-width: 0;
    align-self: flex-start;
    width: 100%;
  }
  .card-result-gain-title, .card-result-compare-title { font-size: 15px; margin-bottom: 10px; }
  .card-result-gain-value { font-size: 24px; margin-bottom: 12px; }
  .card-result-sep { margin-bottom: 12px; }
  .card-result-payback-line { font-size: 13px; }
  .card-result-columns { flex-direction: column; }
  .card-result-col { padding: 14px 12px; border-right: none; border-bottom: 1px solid rgba(15, 23, 42, 0.08); }
  .card-result-col:last-child { border-bottom: none; }
  .card-result-col-label { font-size: 13px; margin-bottom: 6px; }
  .card-result-col-value { font-size: 20px; }
  .results-actions { margin-top: 20px; }
  .btn-commander { padding: 14px 24px; font-size: 16px; width: 100%; max-width: 280px; }
  .calc-method { font-size: 11px; margin-top: 16px; padding: 0 8px; }
  .note-contract { font-size: 12px; margin-top: 10px; }

  .conso-popup-overlay { padding: 12px; align-items: flex-start; padding-top: 24px; }
  .conso-popup-card { padding: 20px 18px; border-radius: 16px; max-width: 100%; margin: 0 auto; }
  .conso-popup-title { font-size: 18px; margin-bottom: 10px; }
  .conso-popup-intro { font-size: 12px; margin-bottom: 16px; }
  .conso-popup-section { margin-bottom: 16px; }
  .conso-popup-label { font-size: 13px; margin-bottom: 8px; }
  .conso-popup-btn { padding: 10px 8px; font-size: 13px; }
  .conso-popup-actions { margin-top: 20px; flex-wrap: wrap; justify-content: center; }
  .conso-popup-cancel, .conso-popup-validate { padding: 10px 20px; font-size: 14px; }

  .order-popup-overlay { padding: 12px; align-items: flex-start; padding-top: 20px; }
  .order-popup-card { padding: 0 0 22px; border-radius: 16px; max-width: 100%; }
  .order-popup-bandeau { padding: 10px 18px 6px; }
  .order-popup-bandeau-logo img { height: 22px; }
  .order-popup-card .order-form-sections { padding: 6px 18px 0; }
  .order-popup-title { font-size: 18px; }
  .order-form-row { grid-template-columns: 1fr; }
  .order-form-sections { gap: 14px; }
  .order-form-section label { font-size: 15px; margin-bottom: 6px; }
  .order-input { padding: 12px 14px; font-size: 16px; }
  .order-popup-actions { margin-top: 20px; flex-wrap: wrap; padding: 0 18px; }
  .order-btn { padding: 12px 22px; font-size: 15px; }

  .cgv-popup-overlay { padding: 12px; }
  .cgv-popup-card { padding: 22px 18px; border-radius: 16px; max-width: 100%; }
  .cgv-popup-title { font-size: 18px; margin-bottom: 16px; }
  .cgv-popup-content { font-size: 12px; }
}

@media (max-width: 600px) {
  .conso-popup-choices--7 { grid-template-columns: repeat(4, 1fr); }

  #dc-solaire-simulator button,
  .btn-primary-premium,
  .btn-secondary,
  .btn-commander,
  .order-btn,
  .conso-help-link {
    width: 100%;
    padding: 14px 18px;
    min-height: 48px;
  }
  .results-actions { flex-direction: column; }
  .results-actions .btn-secondary,
  .results-actions .btn-commander { width: 100%; }

  .order-popup-overlay { padding: 12px; align-items: flex-start; padding-top: 24px; }
  .order-popup-card { width: 95%; max-width: 95%; max-height: 90vh; overflow-y: auto; }
  .conso-popup-card { width: 95%; max-height: 90vh; overflow-y: auto; }
  .order-form-row { grid-template-columns: 1fr; }

  .main-wrapper { padding: 16px 16px 60px; }
  .app-shell { padding: 24px 12px 60px; }
  .app-container { padding: 0 12px 24px; }
  .card,
  .card-premium,
  .inputs-main .card-premium,
  .info-mini-card { margin-bottom: 16px; }
  .inputs-main { margin-bottom: 20px; }
  .inputs-cards-row { gap: 16px; align-items: stretch; }
  .info-mini-cards { gap: 16px; margin: 16px 0 20px; }
  .sim-header { margin-bottom: 24px; }
  h1, .sim-title { font-size: 26px; }
  .sim-subtitle, .subtitle { font-size: 15px; }

  /* Très petit écran (≤600px) : ajustements supplémentaires */
  .app-shell { padding: 20px 10px 32px; }
  .app-container { padding: 20px 14px 36px; border-radius: 16px; }
  .sim-title { font-size: 22px; }
  .sim-subtitle { font-size: 14px; }
  .lang-switcher .lang-switch { padding: 5px 10px; font-size: 14px; }
  .card-premium { padding: 16px 14px; }
  .results-cards > .card.card-premium {
    padding: 12px 16px;
  }
  .battery-choices { gap: 6px 8px; }
  .battery-choice .battery-svg { width: 26px; height: 26px; }
  .info-mini-cards .info-mini-card { padding: 12px 16px; font-size: 15px; }
  .btn-primary-premium,
  #simulateBtn,
  .btn-calc,
  .calc-button {
    padding: 16px 24px;
    font-size: 16px;
    height: 64px;
    min-width: 0;
  }
  .results-section { padding: 20px 14px; border-radius: 18px; }
  .adequation-gauge { padding: 14px 12px; }
  .gauge-summary-label, .gauge-summary-value { font-size: 14px; }
  #gaugeGainValue { font-size: 16px; }
  .card-result-gain-value { font-size: 22px; }
  .card-result-col-value { font-size: 18px; }
  .conso-popup-card { padding: 18px 14px; }
  .conso-popup-title { font-size: 16px; }
  .conso-popup-btn { padding: 10px 6px; font-size: 12px; }
}

/* =========================
   BATTERIES – SYSTÈME PROGRESSIF
========================= */
.battery-choice { color: #94a3b8; }
.battery-choice .battery-svg { stroke: currentColor; transition: stroke .15s ease, transform .15s ease; }
.battery-choice.hover-active { color: #1f9d5a; }
.battery-choice.active { color: #1f9d5a; }
.battery-choice.hover-active .battery-label,
.battery-choice.active .battery-label { color: inherit; }

.cost-compare-title {
  text-align: center;
  font-weight: 600;
  font-size: 14px;
  color: #6b7280;
  margin: 0 0 12px 0;
}

/* ================================================= */
/* SECTION : Email gate (popup accès simulateur) */
/* ================================================= */
#simulatorContent {
  display: none;
}

#emailGate {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.emailGate-modal {
  background: white;
  padding: 40px;
  border-radius: 16px;
  width: 420px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: #0f172a;
}

.emailGate-modal h2 {
  margin: 0 0 16px;
  font-size: 24px;
  font-weight: 700;
  color: #0b1220;
}

.emailGate-text {
  margin: 0;
  font-size: 15px;
  line-height: 1.5;
  color: #475569;
}

.emailGate-modal input {
  width: 100%;
  padding: 12px;
  margin-top: 16px;
  border-radius: 8px;
  border: 1px solid #ddd;
  font-size: 15px;
  box-sizing: border-box;
}

.emailGate-error {
  margin: 8px 0 0;
  font-size: 14px;
  color: #dc2626;
  text-align: center;
}

.emailGate-modal button {
  margin-top: 16px;
  width: 100%;
  padding: 12px;
  background: #1f9d5a;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.emailGate-modal button:hover {
  box-shadow: 0 4px 20px rgba(31, 157, 90, 0.35);
}

/* =====================================================
   WENERGY DEBUG – Couleurs temporaires des cartes
   Ce bloc est placé en bas pour pouvoir être supprimé
   facilement après les tests visuels.
   ===================================================== */

.card-premium.card-1 {
  background: #ffffff;
  border: 1px solid #e5e7eb;
}

.card-premium.card-2 {
  background: #ffffff;
  border: 1px solid #e5e7eb;
}

.card-premium.card-3 {
  background: #ffffff;
  border: 1px solid #e5e7eb;
}

.card-premium.card-4 {
  background: #ffffff;
  border: 1px solid #e5e7eb;
}

/* END WENERGY DEBUG */

/* DEBUG VISUEL CARTES */
.card-1 { background: #ffffff; border: 1px solid #e5e7eb; }
.card-2 { background: #ffffff; border: 1px solid #e5e7eb; }
.card-3 { background: #ffffff; border: 1px solid #e5e7eb; }
.card-4 { background: #ffffff; border: 1px solid #e5e7eb; }
/* END DEBUG VISUEL */

/* WENERGY : sélecteur batterie sous graphique (recalcul immédiat + sync bloc haut) */
.chart-battery-selector {
  margin-top: 20px;
  display: flex;
  justify-content: center;
}

.chart-battery-choices {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

/* WENERGY : amélioration visuelle graphique (compacité) */
.card-chart {
  padding-bottom: 20px;
}

.chart-battery-selector {
  margin-top: 15px;
}

/* WENERGY : réduction espace graphique (jauge + graphique + sélecteur sur un écran) */
.card-chart {
  padding-bottom: 10px;
}

.chart-battery-selector {
  margin-top: 10px;
}

input,
select,
.order-input,
.input-full,
.input-row input {
  width: 100%;
  box-sizing: border-box;
}

/* WENERGY FIX – éviter la colonne vide résultats */

#results:empty {
  display: none;
}

#results:not(:empty) {
  display: block;
}

/* Overlay maintenance — empilement depuis le haut (aligné simulateur Plug) */
#maintenance-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: #f5f7fb;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: max(24px, calc(50vh - 480px)) 40px 40px;
  gap: 0;
  text-align: center;
}
#maintenance-overlay > .maintenance-lottie-wrap {
  flex-shrink: 0;
  width: 560px;
  height: 560px;
  margin: 0 auto 6px auto;
  line-height: 0;
}
#maintenance-overlay .maintenance-lottie {
  display: block !important;
  width: 560px !important;
  height: 560px !important;
  margin: 0 auto !important;
}
#maintenance-overlay > .maintenance-title {
  display: block;
  margin: 0 auto 6px auto;
  padding: 0;
  font-size: 34px;
  font-weight: 600;
  color: #111827;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  text-align: center;
}
#maintenance-overlay > .maintenance-description {
  display: block;
  margin: 0 auto 4px auto;
  padding: 0;
  max-width: 520px;
  font-size: 18px;
  line-height: 1.7;
  color: #4b5563;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  text-align: center;
}
#maintenance-overlay > .maintenance-sub {
  display: block;
  margin: 0 auto;
  padding: 0;
  max-width: 520px;
  font-size: 16px;
  color: #6b7280;
  line-height: 1.5;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  text-align: center;
}

/* Réduction espacements vertical + horizontal entre cartes */
.row {
  --bs-gutter-x: 12px !important;
  --bs-gutter-y: 12px !important;
}

.row > [class*="col"] {
  padding-left: 6px !important;
  padding-right: 6px !important;
}

/* Simulateur DC : vrais conteneurs (pas de Bootstrap .row) — ~÷2 des gaps / marges entre blocs */
#dc-solaire-simulator .app-container {
  gap: 12px;
}
#dc-solaire-simulator .sim-header {
  margin: 0 0 16px;
}
#dc-solaire-simulator .inputs-main {
  margin-bottom: 13px;
}
#dc-solaire-simulator .inputs-cards-row {
  gap: 11px;
}
#dc-solaire-simulator .info-mini-cards {
  gap: 11px;
  margin: 12px 0 14px;
}
#dc-solaire-simulator .panel-optional {
  margin-top: 16px;
}
#dc-solaire-simulator .results-section {
  margin-top: 24px;
}
#dc-solaire-simulator .results-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 8px;
  align-items: stretch;
}
#dc-solaire-simulator .card-result-gain,
#dc-solaire-simulator .card-result-compare {
  height: 100%;
  display: flex;
  flex-direction: column;
  background: #fff !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  border-radius: 16px;
  padding: 20px 24px;
}
#dc-solaire-simulator .card-result-gain .card-result-payback-line,
#dc-solaire-simulator .card-result-compare .card-result-columns {
  flex: 1;
}
#dc-solaire-simulator .card-result-columns {
  align-items: stretch;
}
#dc-solaire-simulator .gauge-gain-cards {
  gap: 9px;
  margin: 9px 0 11px 0;
}
#dc-solaire-simulator .chart-battery-selector {
  margin-top: 10px;
}
#dc-solaire-simulator .chart-battery-choices {
  gap: 6px;
}

@media (max-width: 768px) {
  #dc-solaire-simulator .results-cards {
    grid-template-columns: 1fr;
    gap: 14px;
    margin-top: 6px;
  }
  #dc-solaire-simulator .card-result-gain,
  #dc-solaire-simulator .card-result-compare {
    padding: 18px 16px;
  }
  #dc-solaire-simulator .card-result-gain-title,
  #dc-solaire-simulator .card-result-compare-title {
    font-size: 15px;
    margin-bottom: 10px;
  }
  #dc-solaire-simulator .card-result-gain-value {
    font-size: 24px;
    margin-bottom: 12px;
  }
}