/* ==========================================================================
   CONFIGURATEUR PLANCHER CHAUFFANT ET RADIATEURS
   Chargé par /plancher-chauffant-radiateurs/ et son miroir anglais, jamais
   par la landing. Le configurateur tourne dans la page, sans cadre : le
   script js/chauffage.js rend chaque étape dans [data-chauffage], posé dans
   une section theme-pale. Les composants reprennent ceux du configurateur
   R-System (configurateur/index.html), préfixés ch- pour ne rien croiser
   dans styles.css, et ne consomment que des tokens.
   ========================================================================== */

/* Posé en premier écran, sous le chapeau de la page : le chapeau porte
   déjà sa marge basse. */
.hero .chauffage{ margin-top:0; }

.chauffage{
  /* Même raccordement que le configurateur R-System : l'accent lisible sur
     papier, le blanc pour les cartes posées sur le fond papier. */
  --ch-accent:var(--accent);
  --ch-encre:var(--fg);
  --ch-carte:var(--white);
  margin-top:var(--space-block);
  /* Recadré sous l'en-tête collant à chaque écran, avec cette respiration en
     plus de la marge d'ancre de html. */
  scroll-margin-top:var(--space-4);
}
/* Réinitialisations sans spécificité : les marges et fonds posés par les
   classes ch- passent toujours devant. */
:where(.chauffage) button{ font:inherit; color:inherit; background:none; border:0; padding:0; cursor:pointer; }
:where(.chauffage) p{ margin:0; }

/* Progression : un jalon par étape du parcours retenu. */
.ch-jauges{ display:flex; gap:var(--space-2); margin-bottom:var(--space-8); }
.ch-jauge{ flex:1; height:var(--jalon-h); background:var(--rule); border-radius:var(--radius-sharp); overflow:hidden; }
.ch-jauge-barre{ height:100%; background:var(--ch-accent); transition:width var(--duration-mid) var(--ease-standard); }

.ch-entete{ display:flex; align-items:center; justify-content:space-between; gap:var(--space-3); flex-wrap:wrap; }
.ch-badge{ display:inline-flex; align-items:center; background:var(--accent-voile); color:var(--ch-accent); border-radius:var(--radius-sharp); padding:var(--space-1) var(--space-3); font-family:var(--font-mono); font-size:var(--size-mono-sm); font-weight:var(--weight-bold); letter-spacing:var(--tracking-caps); text-transform:uppercase; }
.ch-entete--fin{ justify-content:flex-end; margin-bottom:var(--space-5); }
.chauffage .ch-retour{ display:inline-flex; align-items:center; gap:var(--space-2); background:var(--ch-carte); border:var(--border-hair) solid var(--ch-encre); border-radius:var(--radius-sharp); padding:var(--space-2) var(--space-4); font-size:var(--size-xs); font-weight:var(--weight-bold); color:var(--ch-encre); transition:border-color var(--duration-fast) var(--ease-standard); }
.chauffage .ch-retour:hover{ border-color:var(--ch-accent); }

.ch-titre{ margin:var(--space-3) 0 0; font-size:var(--size-h3); font-weight:var(--weight-bold); line-height:var(--leading-tight); letter-spacing:var(--tracking-tight); color:var(--ch-encre); }
.ch-titre:focus{ outline:none; }
.ch-titre:focus-visible{ outline:var(--focus-width) solid var(--focus-ring); outline-offset:var(--focus-offset); }
.ch-texte{ margin-top:var(--space-2); margin-bottom:var(--space-6); max-width:var(--measure-lead); color:var(--fg-soft); }

/* Tuiles de choix : un filet qui prend l'accent, ni ombre ni soulèvement. */
.ch-tuiles{ display:grid; gap:var(--space-3); }
.chauffage .ch-tuile{ display:flex; align-items:center; gap:var(--space-4); width:100%; text-align:left; background:var(--ch-carte); border:var(--border-accent) solid var(--rule); border-radius:var(--radius-sharp); padding:var(--space-5); transition:border-color var(--duration-fast) var(--ease-standard); }
.chauffage .ch-tuile:hover{ border-color:var(--ch-accent); }
.chauffage .ch-tuile--choisie{ border-color:var(--ch-accent); box-shadow:0 0 0 var(--border-accent) var(--accent-voile); }
.ch-tuile--haute{ align-items:flex-start; }
/* Premier choix, en grand : pictogrammes au-dessus, texte centré, la coche
   dans l'angle. */
.chauffage .ch-tuile--grande{ position:relative; flex-direction:column; align-items:center; justify-content:flex-start; gap:var(--space-3); text-align:center; padding:var(--space-8) var(--space-6) var(--space-7); }
.ch-tuile--grande .ch-tuile-titre{ font-size:var(--size-h3); }
.ch-tuile--grande .ch-tuile-sous{ max-width:var(--measure-tuile); margin-top:0; font-size:var(--size-body); }
.ch-tuile--grande .ch-tuile-coche{ position:absolute; top:var(--space-4); right:var(--space-4); }
.ch-pictos{ display:flex; justify-content:center; gap:var(--space-3); margin-bottom:var(--space-2); color:var(--ch-accent); }
.ch-picto{ width:var(--configurateur-picto); height:var(--configurateur-picto); }
.ch-tuile-photo{ flex-shrink:0; width:var(--configurateur-produit); height:var(--configurateur-produit); object-fit:contain; }
.ch-tuile-textes{ flex:1; min-width:0; }
.ch-tuile-titre{ display:block; font-weight:var(--weight-bold); font-size:var(--size-h4); color:var(--ch-encre); }
.ch-tuile-ref{ display:block; margin-top:var(--space-1); font-family:var(--font-mono); font-size:var(--size-mono-sm); letter-spacing:var(--tracking-caps); color:var(--ch-accent); }
.ch-tuile-sous{ display:block; margin-top:var(--space-2); font-size:var(--size-xs); color:var(--fg-soft); line-height:var(--leading-snug); }
.ch-tuile-prix{ display:block; margin-top:var(--space-3); font-family:var(--font-mono); font-size:var(--size-mono-sm); color:var(--ch-encre); }
.ch-tuile-coche{ flex-shrink:0; display:grid; place-items:center; width:var(--space-6); height:var(--space-6); background:var(--ch-accent); color:var(--ch-carte); border-radius:var(--radius-sharp); }
.ch-tuile-coche--vide{ background:none; box-shadow:inset 0 0 0 var(--border-hair) var(--rule-strong); }

/* Compteurs : quantités de zones, de boucles, de radiateurs. */
.ch-compteurs{ display:grid; gap:var(--space-3); }
.ch-compteur{ background:var(--ch-carte); border:var(--border-accent) solid var(--rule); border-radius:var(--radius-sharp); padding:var(--space-5); }
.ch-compteur-tete{ display:flex; align-items:center; gap:var(--space-4); }
.ch-compteur-photo{ flex-shrink:0; width:var(--configurateur-vignette-grande); height:var(--configurateur-vignette-grande); object-fit:contain; }
.ch-compteur-nom{ font-weight:var(--weight-bold); color:var(--ch-encre); }
.ch-compteur-aide{ margin-top:var(--space-1); font-size:var(--size-xs); color:var(--fg-soft); line-height:var(--leading-snug); }
.ch-compteur-boutons{ margin-top:var(--space-4); display:flex; align-items:center; justify-content:center; gap:var(--space-5); }
.ch-compteur-valeur{ width:var(--space-16); text-align:center; font-weight:var(--weight-bold); font-size:var(--size-stat); font-variant-numeric:tabular-nums; color:var(--ch-encre); }
.chauffage .ch-rond{ display:grid; place-items:center; width:var(--space-12); height:var(--space-12); border-radius:var(--radius-sharp); color:var(--ch-carte); background:var(--ch-encre); }
.chauffage .ch-rond--plus{ background:var(--ch-accent); }
/* Un bouton hors service reste lisible plutôt que délavé : il perd son fond
   plein pour un filet, comme sur le configurateur R-System. */
.chauffage .ch-rond:disabled{ background:none; color:var(--fg-mute); box-shadow:inset 0 0 0 var(--border-hair) var(--rule-strong); cursor:not-allowed; }

/* Encart d'explication, au teal des jalons. */
.ch-encart{ margin-top:var(--space-5); max-width:var(--measure-lead); background:var(--accent-alt-voile); border:var(--border-hair) solid var(--accent-alt-border); border-radius:var(--radius-sharp); padding:var(--space-4); font-size:var(--size-xs); line-height:var(--leading-snug); color:var(--ch-encre); }
.ch-encart b{ font-weight:var(--weight-bold); }

.ch-groupe{ margin-top:var(--space-8); }
.ch-encart--haut{ margin-top:0; margin-bottom:var(--space-5); }
.ch-total{ margin-top:var(--space-5); max-width:var(--measure-lead); font-size:var(--size-xs); color:var(--fg-soft); }
.ch-total b{ font-weight:var(--weight-bold); color:var(--ch-encre); }

/* Pictogramme d'une tuile sans photo : le wifi de l'étape internet. */
.ch-tuile-icone{ flex-shrink:0; display:grid; place-items:center; width:var(--space-12); height:var(--space-12); background:var(--accent-voile); color:var(--ch-accent); border-radius:var(--radius-sharp); }
.ch-tuile-icone--eteinte{ background:none; color:var(--fg-mute); box-shadow:inset 0 0 0 var(--border-hair) var(--rule); }

/* Cartes de collecteur, structure du configurateur d'origine : nom et
   bouton retirer en tête, compteur au centre, légende dessous, puis la
   carte en pointillés qui en ajoute un. */
.ch-collecteurs{ display:grid; gap:var(--space-3); }
.ch-collecteur{ background:var(--ch-carte); border:var(--border-accent) solid var(--rule); border-radius:var(--radius-sharp); padding:var(--space-5); }
.ch-collecteur-tete{ display:flex; align-items:center; gap:var(--space-3); }
.ch-collecteur-picto{ flex-shrink:0; color:var(--ch-accent); }
.ch-collecteur-picto .ch-picto{ width:var(--space-10); height:var(--space-10); }
.ch-collecteur-noms{ flex:1; min-width:0; }
.chauffage .ch-retirer{ flex-shrink:0; font-size:var(--size-xs); font-weight:var(--weight-bold); color:var(--fg-mute); transition:color var(--duration-fast) var(--ease-standard); }
.chauffage .ch-retirer:hover{ color:var(--danger); }
.ch-legende{ margin-top:var(--space-2); text-align:center; font-size:var(--size-xs); color:var(--fg-soft); }
.chauffage .ch-ajouter{ display:block; width:100%; border:var(--border-accent) dashed var(--rule-strong); border-radius:var(--radius-sharp); padding:var(--space-5); font-weight:var(--weight-bold); color:var(--ch-accent); background:var(--ch-carte); transition:border-color var(--duration-fast) var(--ease-standard); }
.chauffage .ch-ajouter:hover{ border-color:var(--ch-accent); }

/* Thermostats par modèle : une ligne par référence, compteur à droite. */
.ch-modeles{ display:grid; gap:var(--space-3); }
.ch-modele{ display:flex; align-items:center; gap:var(--space-4); background:var(--ch-carte); border:var(--border-accent) solid var(--rule); border-radius:var(--radius-sharp); padding:var(--space-4); }
.ch-modele--choisi{ border-color:var(--ch-accent); }
.ch-modele-photo{ flex-shrink:0; width:var(--configurateur-vignette); height:var(--configurateur-vignette); object-fit:contain; }
.ch-modele-textes{ flex:1; min-width:0; }
.ch-modele-textes .ch-tuile-sous{ margin-top:var(--space-1); }
.ch-compteur-boutons--petit{ margin-top:0; flex-shrink:0; gap:var(--space-2); }
.chauffage .ch-rond--petit{ width:var(--space-10); height:var(--space-10); }
.ch-compteur-valeur--petit{ width:var(--space-8); font-size:var(--size-h4); }

/* Schéma de l'installation : SVG composé par le script, une colonne par
   collecteur. Les couleurs passent par les tokens, les tailles de texte et
   de trait sont des cotes du viewBox, posées en attributs par le script ;
   le cadre défile sur téléphone plutôt que de réduire les textes. */
.ch-schema{ overflow-x:auto; background:var(--ch-carte); border:var(--border-accent) solid var(--rule); border-radius:var(--radius-sharp); padding:var(--space-4); }
.ch-schema-svg{ display:block; width:100%; height:auto; min-width:calc(var(--ch-colonnes) * var(--configurateur-schema-colonne)); }
.ch-noeud rect{ fill:var(--ch-carte); stroke:var(--rule-strong); }
.ch-noeud-titre{ font-family:var(--font-mono); font-weight:var(--weight-bold); fill:var(--ch-encre); }
.ch-noeud-sous{ fill:var(--fg-soft); }
.ch-noeud-picto{ color:var(--ch-accent); }
.ch-lien{ fill:none; }
.ch-lien--filaire{ stroke:var(--ch-encre); }
.ch-lien--radio{ stroke:var(--ch-accent); }
.ch-lien--internet{ stroke:var(--fg-mute); }

/* Fiches techniques et notices, sous les actions du récapitulatif. */
.ch-docs{ margin-top:var(--space-8); }
.ch-docs-titre{ margin:0; font-size:var(--size-h3); font-weight:var(--weight-bold); color:var(--ch-encre); }
.ch-docs .ch-texte{ margin-bottom:var(--space-4); }
.ch-docs-liste{ display:grid; gap:var(--space-2); }
.ch-doc{ background:var(--ch-carte); border:var(--border-accent) solid var(--rule); border-radius:var(--radius-sharp); padding:var(--space-3) var(--space-4); }
.ch-doc-tete{ display:flex; align-items:center; gap:var(--space-3); }
.ch-doc-photo{ flex-shrink:0; width:var(--space-12); height:var(--space-12); object-fit:contain; }
.ch-doc-nom{ font-weight:var(--weight-bold); color:var(--ch-encre); }
.ch-doc-liens{ display:flex; flex-wrap:wrap; gap:var(--space-2); margin-top:var(--space-2); padding-left:calc(var(--space-12) + var(--space-3)); }
.ch-doc-lien{ display:inline-flex; align-items:center; gap:var(--space-2); border:var(--border-hair) solid var(--rule-strong); border-radius:var(--radius-sharp); padding:var(--space-1) var(--space-3); font-size:var(--size-xs); font-weight:var(--weight-bold); color:var(--ch-encre); text-decoration:none; transition:border-color var(--duration-fast) var(--ease-standard), color var(--duration-fast) var(--ease-standard); }
.ch-doc-lien:hover{ border-color:var(--ch-accent); color:var(--ch-accent); }
.ch-doc-lien--plein{ background:var(--accent-voile); border-color:transparent; color:var(--ch-accent); }
.ch-doc-absent{ font-size:var(--size-xs); color:var(--fg-mute); padding:var(--space-1) 0; }
.ch-groupe-titre{ margin:0 0 var(--space-3); font-size:var(--size-body); font-weight:var(--weight-bold); color:var(--ch-encre); }

.ch-suite{ margin-top:var(--space-7); display:flex; align-items:center; gap:var(--space-4); flex-wrap:wrap; }
.chauffage .ch-principal{ display:inline-flex; align-items:center; gap:var(--space-2); background:var(--ch-encre); color:var(--ch-carte); border-radius:var(--radius-sharp); padding:var(--space-3) var(--space-7); font-weight:var(--weight-bold); transition:filter var(--duration-fast) var(--ease-standard); }
.chauffage .ch-principal:hover{ filter:brightness(1.1); }
.chauffage .ch-principal:disabled{ background:none; color:var(--fg-mute); box-shadow:inset 0 0 0 var(--border-hair) var(--rule-strong); cursor:not-allowed; filter:none; }
.ch-suite-aide{ font-size:var(--size-xs); color:var(--fg-soft); }
/* Ouverture du récapitulatif : la plaque cyan des appels à l'action de la
   landing, texte marine et filet d'accent comme le veut la charte sur un fond
   clair, sur toute la largeur et au palier du chapeau. En bouton marine, il
   se lisait comme un Continuer de plus. */
.ch-suite--fin{ display:grid; gap:var(--space-2); justify-items:center; }
.chauffage .ch-principal--recap{ justify-content:center; gap:var(--space-3); width:100%; background:var(--accent-surface); color:var(--accent-fg); border:var(--border-hair) solid var(--ch-accent); padding:var(--space-5) var(--space-7); font-size:var(--size-lead); transition:filter var(--duration-fast) var(--ease-standard), transform var(--duration-fast) var(--ease-standard); }
.chauffage .ch-principal--recap:hover{ filter:brightness(1.05); transform:translateY(var(--lift)); }
.chauffage .ch-principal--recap svg{ transition:transform var(--duration-fast) var(--ease-standard); }
.chauffage .ch-principal--recap:hover svg{ transform:translateX(var(--space-1)); }
.chauffage .ch-principal--recap:disabled{ border-color:transparent; transform:none; }

/* Récapitulatif : îlot du thème sombre au milieu de la section papier. Les
   tokens sémantiques y reprennent localement leurs valeurs du thème par
   défaut, comme le récapitulatif du configurateur R-System. */
.ch-recap{
  --fg:var(--white);
  --fg-soft:var(--grey-200);
  --fg-mute:var(--grey-400);
  --rule:var(--alpha-light-16);
  --voile:var(--alpha-light-07);
  background:var(--ch-encre);
  color:var(--fg);
  border-radius:var(--radius-sharp);
  padding:var(--space-6);
}
.ch-recap-badge{ display:inline-flex; align-items:center; gap:var(--space-2); background:var(--rule); border-radius:var(--radius-sharp); padding:var(--space-1) var(--space-3); font-family:var(--font-mono); font-size:var(--size-mono-sm); font-weight:var(--weight-bold); letter-spacing:var(--tracking-caps); text-transform:uppercase; }
.ch-recap .ch-titre{ color:var(--fg); }
.ch-recap-resume{ margin-top:var(--space-2); font-size:var(--size-xs); color:var(--fg-soft); }
.ch-recap-lignes{ margin-top:var(--space-6); display:grid; gap:var(--space-2); }
.ch-recap-ligne{ display:flex; align-items:center; gap:var(--space-4); background:var(--voile); border-radius:var(--radius-sharp); padding:var(--space-3) var(--space-4); }
.ch-recap-photo{ flex-shrink:0; width:var(--configurateur-vignette); height:var(--configurateur-vignette); object-fit:contain; }
.ch-recap-textes{ flex:1; min-width:0; }
.ch-recap-nom{ display:flex; align-items:baseline; gap:var(--space-2); font-weight:var(--weight-bold); }
.ch-recap-qte{ color:var(--cyan-500); font-size:var(--size-xs); font-variant-numeric:tabular-nums; }
.ch-recap-sous{ font-size:var(--size-xs); color:var(--fg-mute); }
.ch-recap-notes{ margin-top:var(--space-5); display:grid; gap:var(--space-2); font-size:var(--size-xs); color:var(--fg-soft); }

.ch-actions{ margin-top:var(--space-5); display:grid; gap:var(--space-3); }
.chauffage .ch-action{ display:inline-flex; align-items:center; justify-content:center; gap:var(--space-2); border-radius:var(--radius-sharp); padding:var(--space-3) var(--space-4); font-weight:var(--weight-bold); border:var(--border-accent) solid var(--ch-encre); color:var(--ch-encre); transition:filter var(--duration-fast) var(--ease-standard), border-color var(--duration-fast) var(--ease-standard), background-color var(--duration-fast) var(--ease-standard), color var(--duration-fast) var(--ease-standard); }
.chauffage .ch-action:hover{ border-color:var(--ch-accent); }
.chauffage .ch-action--plein{ background:var(--ch-accent); border-color:var(--ch-accent); color:var(--ch-carte); }
.chauffage .ch-action--plein:hover{ filter:brightness(1.05); }

.ch-aide{ margin-top:var(--space-8); background:var(--ch-carte); border:var(--border-hair) solid var(--rule); border-radius:var(--radius-sharp); padding:var(--space-5); }
.ch-aide-titre{ margin-bottom:var(--space-3); font-weight:var(--weight-bold); color:var(--ch-encre); }
.ch-aide-liens{ display:grid; gap:var(--space-2); font-size:var(--size-xs); }
.ch-aide-lien{ display:flex; align-items:center; gap:var(--space-2); color:var(--ch-encre); text-decoration:none; transition:color var(--duration-fast) var(--ease-standard); }
.ch-aide-lien:hover{ color:var(--ch-accent); }

.ch-reinit-zone{ margin-top:var(--space-5); text-align:center; }
.chauffage .ch-reinit{ display:inline-flex; align-items:center; gap:var(--space-2); font-size:var(--size-xs); font-weight:var(--weight-bold); color:var(--fg-soft); transition:color var(--duration-fast) var(--ease-standard); }
.chauffage .ch-reinit:hover{ color:var(--ch-encre); }

.ch-sans-script{ color:var(--fg-soft); }

@keyframes ch-entree{ from{ opacity:0; transform:translateY(var(--reveal-shift)); } to{ opacity:1; transform:none; } }
.ch-etape{ animation:ch-entree var(--duration-reveal) var(--ease-standard) both; }

@media (prefers-reduced-motion:reduce){
  .ch-etape{ animation:none; }
  .ch-jauge-barre{ transition:none; }
}

/* Points de rupture de la landing : 600 px et 1000 px. Sur téléphone, la
   photo d'une tuile passe à la taille de la vignette du compteur, pour
   laisser au texte la place de se lire. */
@media (max-width:599px){
  .ch-tuile-photo{ width:var(--configurateur-vignette-grande); height:var(--configurateur-vignette-grande); }
  .chauffage .ch-tuile{ padding:var(--space-4); gap:var(--space-3); }
}
@media (min-width:600px){
  .ch-recap{ padding:var(--space-8); }
  .ch-tuiles--2,.ch-compteurs,.ch-collecteurs{ grid-template-columns:repeat(2,1fr); }
  .ch-compteurs--seul{ grid-template-columns:minmax(0,1fr); max-width:var(--measure-lead); }
  .ch-tuiles--3,.ch-actions,.ch-aide-liens{ grid-template-columns:repeat(3,1fr); }
}
@media (min-width:1000px){
  .ch-recap-lignes,.ch-docs-liste{ grid-template-columns:repeat(2,1fr); }
  /* Le récapitulatif tient dans l'écran d'arrivée, documentation comprise :
     la carte à gauche, les trois actions et les documents empilés à droite,
     un document par ligne, sa photo, son nom et ses liens côte à côte. Le
     schéma, plus haut qu'un écran à lui seul, vient dessous. */
  .ch-recap-grille{ display:grid; grid-template-columns:7fr 5fr; gap:var(--space-6); align-items:start; }
  .ch-recap-grille .ch-recap{ padding:var(--space-6); }
  .ch-recap-cote .ch-actions{ margin-top:0; grid-template-columns:1fr; gap:var(--space-2); }
  .ch-recap-cote .ch-docs{ margin-top:var(--space-5); }
  .ch-entete--fin{ margin-bottom:var(--space-3); }
  .ch-recap-cote .ch-docs-liste{ grid-template-columns:1fr; }
  .ch-recap-cote .ch-docs .ch-texte{ margin-bottom:var(--space-3); }
  .ch-recap-cote .ch-docs-liste{ gap:var(--space-1); }
  .ch-recap-cote .ch-doc{ display:flex; align-items:center; justify-content:space-between; gap:var(--space-3); padding-block:var(--space-2); }
  .ch-recap-cote .ch-doc-photo{ width:var(--space-10); height:var(--space-10); }
  .ch-recap-cote .ch-doc-liens{ margin-top:0; padding-left:0; justify-content:flex-end; flex-wrap:nowrap; }
  .ch-recap-cote{ container-type:inline-size; }
}
/* Colonne étroite, autour de 1024 px de fenêtre : la vignette du document
   cède sa place pour que le nom et ses deux liens tiennent sur une ligne.
   Une requête de conteneur ne lit pas de variable CSS, comme une media
   query : la largeur s'écrit ici, celle où la ligne commençait à casser. */
@container (max-width:439px){
  .ch-recap-cote .ch-doc-photo{ display:none; }
}
