/* Calculateur eau chaude solaire (CESI) — port fidèle de la maquette validée
   docs/superpowers/specs/assets/2026-08-10-calculateur-ecs-maquette.html
   Tokens et sélecteurs scopés à .ecs-wrap pour ne pas fuiter dans base.html. */

.ecs-wrap{
  --orange:#E8820C; --orange-50:#fdf4e7; --yellow:#F4B400; --yellow-50:#fdf7e3;
  --navy:#0F2D52; --navy-700:#1a3d6b; --navy-50:#eaf0f8; --ink:#0F2D52;
  --text:#27364b; --text-muted:#667085; --border:#e7ebf1; --border-strong:#d6dbe4;
  --bg:#ffffff; --bg-soft:#fbfaf7; --good:#117a57; --good-50:#e6f4ee; --warn:#b45309; --warn-50:#fef3c7;
  --shadow-sm:0 1px 2px rgba(15,45,82,.05);
  --shadow-md:0 4px 20px -4px rgba(15,45,82,.1), 0 2px 4px rgba(15,45,82,.04);
  --shadow-lg:0 20px 50px -12px rgba(15,45,82,.18), 0 4px 8px rgba(15,45,82,.05);
  /* tokens repris du parcours particulier (form_v2) pour les composants avancés */
  --surface:#ffffff; --line:#ece7dd; --line-strong:#ded6c7; --muted:#6b7688; --orange-700:#a95905;
  --mono:'JetBrains Mono',ui-monospace,monospace; --shadow-s:0 1px 2px rgba(50,40,20,.06);

  max-width:900px; margin:0 auto; padding:28px 20px 60px;
  color:var(--text);
  font-family:'Inter',-apple-system,BlinkMacSystemFont,sans-serif;
  -webkit-font-smoothing:antialiased;
}
.ecs-wrap *{ box-sizing:border-box; }
.ecs-wrap .mono{ font-family:'JetBrains Mono',ui-monospace,monospace; font-feature-settings:'tnum'; }
.ecs-wrap h1,.ecs-wrap h2,.ecs-wrap h3{ color:var(--ink); font-weight:700; letter-spacing:-.02em; margin:0; }
.ecs-wrap p{ margin:0; }

.ecs-wrap .card{ background:var(--bg); border:1px solid var(--border); border-radius:14px; box-shadow:var(--shadow-sm); padding:26px; margin-bottom:18px; }

/* Hero */
.ecs-wrap .hero{ padding:0; overflow:hidden; position:relative; }
.ecs-wrap .hero::before{ content:''; position:absolute; top:0; left:0; right:0; height:4px; background:linear-gradient(90deg,var(--yellow),var(--orange)); }
.ecs-wrap .hero-inner{ padding:34px 34px 28px; }
.ecs-wrap .eyebrow{ display:inline-flex; align-items:center; gap:8px; font-size:11px; font-weight:600; letter-spacing:.12em; text-transform:uppercase; color:var(--orange); padding:5px 11px; border-radius:999px; background:var(--orange-50); }
.ecs-wrap .eyebrow .dot{ width:5px; height:5px; border-radius:999px; background:currentColor; }
.ecs-wrap .hero h1{ font-size:clamp(26px,3.4vw,34px); margin-top:14px; line-height:1.2; }
.ecs-wrap .hero p{ font-size:15px; line-height:1.65; color:var(--text-muted); margin-top:14px; max-width:660px; }

/* Step header */
.ecs-wrap .steph{ display:flex; align-items:flex-start; gap:14px; margin-bottom:20px; }
.ecs-wrap .stepn{ width:32px; height:32px; border-radius:9px; flex-shrink:0; background:var(--orange-50); color:var(--orange); display:flex; align-items:center; justify-content:center; font-weight:700; font-size:14px; }
.ecs-wrap .steph h2{ font-size:18px; }
.ecs-wrap .steph p{ font-size:13px; color:var(--text-muted); margin-top:4px; line-height:1.5; }

.ecs-wrap .fieldlabel{ font-size:13px; font-weight:600; color:var(--ink); margin-bottom:8px; }
.ecs-wrap .field{ margin-bottom:20px; }
.ecs-wrap .field:last-child{ margin-bottom:0; }

/* Chips */
.ecs-wrap .chips{ display:flex; gap:8px; flex-wrap:wrap; align-items:center; }
.ecs-wrap .chip{ display:inline-flex; align-items:center; gap:6px; padding:9px 15px; border-radius:999px; font-size:13px; font-weight:600; border:1px solid var(--border-strong); background:var(--bg); color:var(--text); transition:all .15s ease; cursor:pointer; white-space:nowrap; font-family:inherit; }
.ecs-wrap .chip:hover{ border-color:var(--orange); }
.ecs-wrap .chip.active{ border-color:var(--orange); background:var(--orange); color:#fff; box-shadow:0 4px 12px -4px rgba(232,130,12,.5); }
.ecs-wrap .chip .sub{ opacity:.72; font-weight:500; font-size:11.5px; }

/* Input */
.ecs-wrap .input{ border:1px solid var(--border-strong); border-radius:10px; padding:12px 14px; font-size:14px; width:100%; outline:none; background:var(--bg); color:var(--text); font-family:inherit; transition:border-color .15s,box-shadow .15s; }
.ecs-wrap .input:focus{ border-color:var(--orange); box-shadow:0 0 0 3px rgba(232,130,12,.12); }
.ecs-wrap .input-ico{ position:relative; }
.ecs-wrap .input-ico svg{ position:absolute; left:13px; top:50%; transform:translateY(-50%); color:var(--text-muted); }
.ecs-wrap .input-ico .input{ padding-left:40px; }
.ecs-wrap .loc{ display:flex; align-items:center; gap:6px; margin-top:10px; font-size:12px; color:var(--text-muted); }
.ecs-wrap .kit-sug{ border:1px solid var(--border); border-radius:10px; margin-top:6px; overflow:hidden; display:none; box-shadow:var(--shadow-md); background:var(--bg); }
.ecs-wrap .kit-sug div{ padding:10px 14px; font-size:13px; cursor:pointer; border-bottom:1px solid var(--border); }
.ecs-wrap .kit-sug div:last-child{ border-bottom:0; }
.ecs-wrap .kit-sug div:hover{ background:var(--orange-50); }

/* Stepper */
.ecs-wrap .stepper{ display:inline-flex; align-items:center; border:1px solid var(--border-strong); border-radius:10px; overflow:hidden; }
.ecs-wrap .stepper button{ width:42px; height:42px; border:none; background:var(--bg); color:var(--navy); font-size:20px; font-weight:600; cursor:pointer; font-family:inherit; }
.ecs-wrap .stepper button:hover{ background:var(--orange-50); color:var(--orange); }
.ecs-wrap .stepper .val{ width:52px; text-align:center; font-weight:700; font-size:16px; color:var(--ink); border-left:1px solid var(--border); border-right:1px solid var(--border); height:42px; line-height:42px; }

.ecs-wrap .advanced{ border-top:1px solid var(--border); margin-top:22px; padding-top:18px; }
.ecs-wrap .advanced summary{ cursor:pointer; font-size:13px; font-weight:600; color:var(--navy-700); list-style:none; display:flex; align-items:center; gap:8px; }
.ecs-wrap .advanced summary::-webkit-details-marker{ display:none; }
.ecs-wrap .advanced[open] .chev{ transform:rotate(180deg); }
.ecs-wrap .chev{ transition:transform .2s; }
.ecs-wrap .grid2{ display:grid; grid-template-columns:1fr 1fr; gap:20px; margin-top:18px; }
.ecs-wrap .grid3{ display:grid; grid-template-columns:repeat(3,1fr); gap:12px; }

.ecs-wrap .cta{ display:inline-flex; align-items:center; gap:8px; background:var(--orange); color:#fff; padding:15px 26px; border-radius:10px; font-weight:600; font-size:15px; text-decoration:none; border:none; cursor:pointer; box-shadow:0 1px 0 rgba(255,255,255,.2) inset,0 8px 20px -6px rgba(232,130,12,.45); transition:transform .15s ease; font-family:inherit; }
.ecs-wrap .cta:hover{ transform:translateY(-1px); }
.ecs-wrap .cta-full{ width:100%; justify-content:center; margin-top:24px; }

.ecs-wrap .divider{ display:flex; align-items:center; gap:14px; margin:34px 4px 22px; color:var(--text-muted); font-size:12px; font-weight:600; letter-spacing:.1em; text-transform:uppercase; }
.ecs-wrap .divider::before,.ecs-wrap .divider::after{ content:''; flex:1; height:1px; background:var(--border); }

/* KPI band */
.ecs-wrap .kpis{ display:grid; grid-template-columns:1.4fr 1fr 1fr 1fr; gap:14px; }
.ecs-wrap .kpi{ background:var(--bg-soft); border:1px solid var(--border); border-radius:12px; padding:18px 18px 16px; }
.ecs-wrap .kpi.hero-kpi{ background:linear-gradient(135deg,#0F2D52,#1a3d6b); border-color:transparent; color:#fff; }
.ecs-wrap .kpi .lbl{ font-size:11.5px; font-weight:600; letter-spacing:.04em; text-transform:uppercase; color:var(--text-muted); }
.ecs-wrap .kpi.hero-kpi .lbl{ color:rgba(255,255,255,.72); }
.ecs-wrap .kpi .num{ font-size:30px; font-weight:800; letter-spacing:-.02em; color:var(--ink); margin-top:7px; line-height:1; }
.ecs-wrap .kpi.hero-kpi .num{ color:#fff; }
.ecs-wrap .kpi .num .u{ font-size:15px; font-weight:600; color:var(--text-muted); margin-left:2px; }
.ecs-wrap .kpi.hero-kpi .num .u{ color:rgba(255,255,255,.7); }
.ecs-wrap .kpi .foot{ font-size:11.5px; color:var(--text-muted); margin-top:6px; }
.ecs-wrap .kpi.hero-kpi .foot{ color:rgba(255,255,255,.78); }

/* Chart */
.ecs-wrap .chart-head{ display:flex; align-items:baseline; justify-content:space-between; margin-bottom:4px; flex-wrap:wrap; gap:8px; }
.ecs-wrap .chart-head h3{ font-size:16px; }
.ecs-wrap .legend{ display:flex; gap:16px; font-size:12px; color:var(--text); font-weight:500; }
.ecs-wrap .legend > span{ display:inline-flex; align-items:center; gap:6px; }
.ecs-wrap .swatch{ width:11px; height:11px; border-radius:3px; display:inline-block; }
.ecs-wrap .chart-sub{ font-size:13px; color:var(--text-muted); margin:6px 0 20px; line-height:1.55; }
.ecs-wrap .chart-box{ width:100%; }
.ecs-wrap .chart-box svg{ width:100%; height:auto; display:block; overflow:visible; }

/* secondary KPIs */
.ecs-wrap .sec{ display:grid; grid-template-columns:1fr 1fr; gap:14px; margin-top:20px; }
.ecs-wrap .sec-item{ display:flex; align-items:center; gap:14px; padding:16px; border:1px solid var(--border); border-radius:12px; background:var(--bg); }
.ecs-wrap .sec-item .ico{ width:40px; height:40px; border-radius:10px; display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.ecs-wrap .sec-item .ico.g{ background:var(--good-50); color:var(--good); }
.ecs-wrap .sec-item .ico.n{ background:var(--navy-50); color:var(--navy); }
.ecs-wrap .sec-item .num{ font-size:20px; font-weight:800; color:var(--ink); letter-spacing:-.01em; }
.ecs-wrap .sec-item .lbl{ font-size:12px; color:var(--text-muted); margin-top:2px; }
.ecs-wrap .badge-ok{ display:inline-flex; align-items:center; gap:5px; font-size:11px; font-weight:700; color:var(--good); background:var(--good-50); border-radius:999px; padding:2px 9px; margin-left:7px; vertical-align:middle; }

/* verdict / alert */
.ecs-wrap .verdict{ margin-top:20px; padding:15px 17px; border-radius:11px; display:flex; align-items:flex-start; gap:12px; font-size:13.5px; line-height:1.55; background:var(--warn-50); border:1px solid rgba(232,130,12,.28); color:#7a4a12; }
.ecs-wrap .verdict .vico{ flex-shrink:0; margin-top:1px; color:var(--warn); }
.ecs-wrap .verdict b{ color:#5f3a0e; }
/* variante « info » (ex. cible non atteignable) — distincte du garde-fou orange */
.ecs-wrap .verdict.info{ background:var(--navy-50); border-color:#dbe4f2; color:var(--navy-700); }
.ecs-wrap .verdict.info .vico{ color:var(--navy); }

/* hypothèses */
.ecs-wrap .hyp{ margin-top:18px; border:1px solid var(--border); border-radius:12px; overflow:hidden; }
.ecs-wrap .hyp summary{ cursor:pointer; padding:14px 18px; font-size:13px; font-weight:600; color:var(--navy-700); list-style:none; display:flex; align-items:center; justify-content:space-between; background:var(--bg-soft); }
.ecs-wrap .hyp summary::-webkit-details-marker{ display:none; }
.ecs-wrap .hyp[open] .chev{ transform:rotate(180deg); }
.ecs-wrap .hyp-body{ padding:6px 18px 18px; }
.ecs-wrap .hyp-row{ display:flex; justify-content:space-between; gap:16px; padding:9px 0; border-bottom:1px dashed var(--border); font-size:13px; }
.ecs-wrap .hyp-row:last-child{ border-bottom:0; }
.ecs-wrap .hyp-row .k{ color:var(--text-muted); }
.ecs-wrap .hyp-row .v{ font-weight:600; color:var(--ink); text-align:right; }

/* France Rénov */
.ecs-wrap .renov{ display:flex; gap:16px; align-items:flex-start; padding:22px; border-radius:14px; background:var(--navy-50); border:1px solid #dbe4f2; margin-top:20px; }
.ecs-wrap .renov .flag{ width:44px; height:44px; border-radius:11px; background:#fff; border:1px solid #dbe4f2; display:flex; align-items:center; justify-content:center; flex-shrink:0; box-shadow:var(--shadow-sm); }
.ecs-wrap .renov h3{ font-size:15px; }
.ecs-wrap .renov p{ font-size:13.5px; color:var(--text); margin-top:6px; line-height:1.6; }
.ecs-wrap .renov a{ display:inline-flex; align-items:center; gap:6px; margin-top:12px; font-size:13px; font-weight:600; color:var(--navy); text-decoration:none; border:1px solid var(--navy); padding:9px 16px; border-radius:9px; background:#fff; }
.ecs-wrap .renov a:hover{ background:var(--navy); color:#fff; }

/* passerelle */
.ecs-wrap .cross{ text-align:center; margin:32px 0 0; }
.ecs-wrap .cross p{ font-size:14px; color:var(--text-muted); margin-bottom:14px; }
.ecs-wrap .cross .cta.ghost{ background:#fff; color:var(--orange); border:1px solid var(--orange); box-shadow:none; }
.ecs-wrap .cross .cta.ghost:hover{ background:var(--orange-50); }

.ecs-wrap .statebadge{ display:inline-block; font-size:11px; font-weight:700; letter-spacing:.08em; text-transform:uppercase; color:#fff; background:var(--navy); border-radius:6px; padding:4px 10px; margin:26px 0 12px; }

/* ══ Mode avancé — repris à l'identique du parcours particulier (form_v2) ══ */
.ecs-wrap .adv{ margin-top:22px; border:1px dashed var(--line-strong); border-radius:14px; overflow:hidden; background:var(--bg-soft); }
.ecs-wrap .adv__btn{ display:flex; align-items:center; gap:11px; width:100%; padding:13px 16px; text-align:left; color:var(--ink); font-weight:700; font-size:13.5px; background:none; border:none; cursor:pointer; font-family:inherit; }
.ecs-wrap .adv__btn .ci{ width:30px; height:30px; border-radius:9px; background:var(--surface); border:1px solid var(--line); color:var(--orange); display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.ecs-wrap .adv__btn .cx{ flex:1; min-width:0; }
.ecs-wrap .adv__btn .cx small{ display:block; font-size:11px; font-weight:500; color:var(--muted); margin-top:1px; }
.ecs-wrap .adv__btn .chev{ color:var(--muted); transition:transform .2s; flex-shrink:0; }
.ecs-wrap .adv.open .adv__btn .chev{ transform:rotate(180deg); }
.ecs-wrap .adv__body{ display:none; padding:6px 16px 18px; border-top:1px dashed var(--line-strong); }
.ecs-wrap .adv.open .adv__body{ display:block; }
.ecs-wrap .subf{ margin-top:16px; }
.ecs-wrap .subf>label{ display:block; font-size:11.5px; font-weight:700; color:var(--ink); margin-bottom:8px; }
.ecs-wrap .optn{ font-size:11.5px; color:var(--muted); margin:2px 0 0; }
.ecs-wrap .adv .chips{ display:flex; gap:8px; flex-wrap:wrap; }
.ecs-wrap .adv .chip{ font-size:13px; font-weight:600; padding:9px 15px; border-radius:11px; border:1.5px solid var(--line); background:var(--surface); color:var(--text); transition:.15s; cursor:pointer; }
.ecs-wrap .adv .chip:hover{ border-color:var(--line-strong); }
.ecs-wrap .adv .chip.sel{ border-color:var(--orange); background:var(--orange-50); color:var(--orange-700); }
.ecs-wrap .orient-wrap{ display:flex; gap:22px; align-items:center; flex-wrap:wrap; background:var(--surface); border:1px solid var(--line); border-radius:14px; padding:18px; }
.ecs-wrap .dialw{ width:150px; height:150px; position:relative; flex-shrink:0; }
.ecs-wrap .dialw svg{ width:100%; height:100%; cursor:pointer; touch-action:none; display:block; }
.ecs-wrap .orient-side{ flex:1; min-width:200px; }
.ecs-wrap .orient-read{ font-family:var(--mono); font-size:20px; font-weight:600; color:var(--ink); margin-bottom:12px; }
.ecs-wrap .orient-read small{ font-size:12px; color:var(--muted); text-transform:uppercase; letter-spacing:.06em; margin-left:6px; font-family:inherit; }
.ecs-wrap .orientation-quick{ display:flex; flex-wrap:wrap; gap:7px; }
.ecs-wrap .opill{ font-size:12px; font-weight:600; color:var(--muted); background:var(--surface); border:1px solid var(--line); border-radius:8px; padding:7px 11px; transition:.12s; cursor:pointer; font-family:inherit; }
.ecs-wrap .opill:hover{ border-color:var(--line-strong); }
.ecs-wrap .opill.active{ background:var(--orange); border-color:var(--orange); color:#fff; }
.ecs-wrap .tilt-card{ background:var(--surface); border:1px solid var(--line); border-radius:14px; padding:18px; }
.ecs-wrap .tilt-row{ display:flex; gap:20px; align-items:center; justify-content:center; margin-bottom:16px; }
.ecs-wrap .roof-vis svg{ width:150px; height:84px; display:block; }
.ecs-wrap .tilt-display{ text-align:center; }
.ecs-wrap .tilt-display .deg{ font-family:var(--mono); font-size:28px; font-weight:600; color:var(--ink); }
.ecs-wrap .tilt-display .lbl{ font-size:11px; color:var(--muted); text-transform:uppercase; letter-spacing:.05em; margin-top:2px; }
.ecs-wrap .tilt-slider{ -webkit-appearance:none; appearance:none; width:100%; height:6px; border-radius:6px; background:linear-gradient(90deg,var(--orange) var(--fill,50%),var(--line-strong) var(--fill,50%)); outline:none; }
.ecs-wrap .tilt-slider::-webkit-slider-thumb{ -webkit-appearance:none; appearance:none; width:22px; height:22px; border-radius:50%; background:var(--orange); border:3px solid var(--surface); box-shadow:var(--shadow-s); cursor:pointer; }
.ecs-wrap .tilt-slider::-moz-range-thumb{ width:22px; height:22px; border-radius:50%; background:var(--orange); border:3px solid var(--surface); box-shadow:var(--shadow-s); cursor:pointer; }
.ecs-wrap .tilt-marks{ display:flex; justify-content:space-between; font-family:var(--mono); font-size:11px; color:var(--muted); margin-top:9px; }

/* ── Graphe interactif ── */
.ecs-wrap .chart-box{ position:relative; }
.ecs-wrap .chart-tip{ position:absolute; transform:translate(-50%,-100%); background:var(--navy); color:#fff; padding:7px 11px; border-radius:8px; font-size:11.5px; font-weight:500; line-height:1.4; white-space:nowrap; pointer-events:none; box-shadow:var(--shadow-md); display:none; z-index:5; }
.ecs-wrap .chart-tip b{ display:block; font-weight:700; margin-bottom:2px; }
.ecs-wrap .chart-tip::after{ content:''; position:absolute; left:50%; bottom:-5px; transform:translateX(-50%); border:5px solid transparent; border-top-color:var(--navy); }
.ecs-wrap #ecsChart .col{ cursor:pointer; }
.ecs-wrap #ecsChart .barf{ transition:opacity .12s; }
.ecs-wrap #ecsChart.hovering .barf{ opacity:.42; }
.ecs-wrap #ecsChart .col.on .barf{ opacity:1; }

@media (max-width:680px){
  .ecs-wrap .kpis{ grid-template-columns:1fr 1fr; }
  .ecs-wrap .sec,.ecs-wrap .grid2,.ecs-wrap .grid3{ grid-template-columns:1fr; }
  .ecs-wrap .hero-inner{ padding:26px 22px 24px; } .ecs-wrap .card{ padding:22px; }
}
