/* =====================================================================
   Ecoplus — habat-eco.fr · feuille des pages réécrites (Lot A, 18/09/2026)
   Sans Tailwind, sans police externe, sans dégradé, sans ombre portée.
   Jetons : audit voix §2.d, adaptés (corps serif 18 px, titres sans-serif
   système). Une encre, un accent, des gris chauds. Rayon 4 px partout.
   ===================================================================== */

:root {
  /* Couleurs : 1 encre, 1 accent, 2 gris chauds. C'est tout. */
  --encre: #1c2b2a;        /* texte courant, 14:1 sur blanc */
  --encre-2: #4a5654;      /* texte secondaire, 7:1 */
  --accent: #1d5c3a;       /* vert forêt sobre, 7,9:1 sur blanc */
  --accent-fonce: #154429; /* survol */
  --accent-clair: #9fd0b4; /* anneau de focus uniquement */
  --fond: #ffffff;
  --fond-2: #f4f6f5;       /* bandes alternées */
  --fond-photo: #e9ece7;   /* cadres photo réservés (aplat, sans texte) */
  --filet: #d5dbd9;        /* bordures de tableaux, filets */
  --alerte: #8a3b12;       /* filet gauche de « ce qu'on ne fait pas » */
  --erreur: #8b1d1d;       /* messages d'erreur de formulaire, 9:1 */

  /* Typo : serif de lecture pour le corps, sans-serif système pour les titres et l'interface */
  --police: Charter, "Bitstream Charter", "Iowan Old Style", "Palatino Linotype", Georgia, "Times New Roman", serif;
  --police-ui: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --corps: 18px;
  --interligne: 1.6;
  --mesure: 720px;         /* largeur max du texte */
  --large: 960px;          /* tableaux, formulaire à deux colonnes */

  /* Forme */
  --rayon: 4px;
  --gouttiere: clamp(16px, 4vw, 40px);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--fond);
  color: var(--encre);
  font: 400 var(--corps) / var(--interligne) var(--police);
}
img, svg, video { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover, a:focus-visible { color: var(--accent-fonce); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent-clair); outline-offset: 2px; }
strong, b { font-weight: 700; }
hr { border: 0; border-top: 1px solid var(--filet); margin: 2rem 0; }
[hidden] { display: none !important; }

/* Titres : sans-serif système, alignés à gauche, jamais centrés */
h1, h2, h3, h4 { font-family: var(--police-ui); color: var(--encre); letter-spacing: -0.01em; text-align: left; }
h1 { font-size: clamp(28px, 4.5vw, 40px); line-height: 1.15; font-weight: 700; margin: 0 0 .75rem; max-width: 26ch; }
h2 { font-size: clamp(22px, 3vw, 28px); line-height: 1.2; font-weight: 700; margin: 2.5rem 0 1rem; }
h3 { font-size: 20px; line-height: 1.3; font-weight: 700; margin: 1.5rem 0 .5rem; }
h4 { font-size: 18px; line-height: 1.3; font-weight: 700; margin: 1.25rem 0 .5rem; }
p, li { max-width: var(--mesure); }
p { margin: 0 0 1rem; }
ul, ol { padding-left: 1.4em; margin: 0 0 1rem; }
li { margin: 0 0 .4rem; }
small, .petit { font-size: 15px; color: var(--encre-2); }
.secondaire { color: var(--encre-2); }
.ui { font-family: var(--police-ui); }

/* ---------- Grille simple ---------- */
.contenu { width: 100%; max-width: var(--mesure); margin-inline: auto; padding-inline: var(--gouttiere); }
.contenu-large { width: 100%; max-width: var(--large); margin-inline: auto; padding-inline: var(--gouttiere); }
.section { padding: 48px 0; }
.section-2 { background: var(--fond-2); }
@media (min-width: 720px) { .section { padding: 56px 0; } }

/* En-tête réduit : nom en texte + téléphone. Pas d'icône, pas de « by Habat ». */
.entete { border-bottom: 1px solid var(--filet); background: var(--fond); }
.entete-int { max-width: var(--large); margin-inline: auto; padding: 12px var(--gouttiere); display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.marque { font: 700 22px / 1 var(--police-ui); color: var(--encre); text-decoration: none; letter-spacing: -0.01em; }
.marque:hover { color: var(--encre); }
.entete .tel { font: 600 17px / 1 var(--police-ui); text-decoration: none; color: var(--accent); white-space: nowrap; }

/* ---------- Boutons : un seul style plein, un style de lien ---------- */
.btn {
  display: inline-block; font: 600 18px / 1.2 var(--police-ui); color: #fff;
  background: var(--accent); border: 2px solid var(--accent); border-radius: var(--rayon);
  padding: 14px 24px; min-height: 48px; text-decoration: none; text-align: center; cursor: pointer;
  -webkit-appearance: none; appearance: none;
}
.btn:hover, .btn:focus-visible { background: var(--accent-fonce); border-color: var(--accent-fonce); color: #fff; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .7; cursor: default; }
.btn-bloc { display: block; width: 100%; }
.lien-btn { display: inline-block; font: 600 17px / 1.2 var(--police-ui); color: var(--accent); background: transparent; border: 0; padding: 12px 0; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.lien-btn:hover, .lien-btn:focus-visible { color: var(--accent-fonce); }

/* ---------- Tableaux 2 colonnes, responsives ---------- */
table { width: 100%; border-collapse: collapse; font-family: var(--police-ui); font-size: 17px; margin: 1.5rem 0; }
caption { text-align: left; font-weight: 600; padding: 0 0 8px; color: var(--encre-2); font-size: 16px; }
th, td { padding: 12px 14px; border: 1px solid var(--filet); vertical-align: top; text-align: left; line-height: 1.5; }
th { background: var(--fond-2); font-weight: 600; }
td p, th p, td li { max-width: none; font-family: inherit; font-size: inherit; }
@media (max-width: 640px) {
  table, thead, tbody, tr, th, td { display: block; }
  caption { display: block; width: 100%; }  /* sinon la légende s'empile mot par mot */
  thead { display: none; }
  tr { border-top: 1px solid var(--filet); padding: 6px 0; }
  td { border: 0; border-bottom: 1px solid var(--filet); padding: 8px 0; }
  td:last-child { border-bottom: 0; }
  td::before { content: attr(data-label); display: block; font-weight: 600; color: var(--encre-2); font-size: 14px; margin-bottom: 2px; }
}

/* ---------- Le bloc « Ce qu'on ne fait pas » ---------- */
.non { border-left: 4px solid var(--alerte); padding: 4px 0 4px 20px; margin: 2rem 0; }
.non p { margin: .4rem 0; }

/* ---------- Formulaire : étiquettes visibles, champs 48 px, erreurs rouge sombre ---------- */
form { font-family: var(--police-ui); }
fieldset { border: 0; padding: 0; margin: 0 0 1rem; min-width: 0; }
legend { font: 600 18px / 1.3 var(--police-ui); padding: 0; margin: 0 0 .5rem; }
label { display: block; font: 600 16px / 1.3 var(--police-ui); margin: 14px 0 6px; color: var(--encre); }
.aide-champ { display: block; font-size: 15px; color: var(--encre-2); margin: 4px 0 0; }
input[type="text"], input[type="tel"], input[type="email"], input[type="number"], select, textarea {
  font: 400 18px / 1.3 var(--police-ui); color: var(--encre); background: #fff;
  width: 100%; max-width: 440px; min-height: 48px; padding: 11px 14px;
  border: 2px solid var(--encre-2); border-radius: var(--rayon);
  -webkit-appearance: none; appearance: none;
}
select { background-image: linear-gradient(45deg, transparent 50%, var(--encre-2) 50%), linear-gradient(135deg, var(--encre-2) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 40px; }
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: 3px solid var(--accent-clair); outline-offset: 0; }
input[aria-invalid="true"], select[aria-invalid="true"] { border-color: var(--erreur); }
.erreur { color: var(--erreur); font: 600 15px / 1.4 var(--police-ui); margin: 6px 0 0; }
.champ-case { display: flex; gap: 12px; align-items: flex-start; margin: 16px 0; }
.champ-case input[type="checkbox"] { width: 24px; height: 24px; min-height: 0; margin: 2px 0 0; flex: 0 0 auto; accent-color: var(--accent); border-radius: var(--rayon); }
.champ-case label { margin: 0; font-weight: 400; font-size: 16px; line-height: 1.5; }
.identite { font: 400 15px / 1.5 var(--police-ui); color: var(--encre-2); margin: 12px 0; }
.form-field-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; opacity: 0; } /* champ anti-robot, hors écran */
.succes { border: 1px solid var(--filet); border-left: 4px solid var(--accent); padding: 16px 20px; border-radius: var(--rayon); background: var(--fond-2); }

/* Bloc formulaire : une colonne, deux au-dessus de 860 px (texte + formulaire) */
.deux-colonnes { display: grid; gap: 32px; }
@media (min-width: 860px) { .deux-colonnes { grid-template-columns: 1.2fr .8fr; gap: 40px; align-items: start; } }

/* ---------- Cadres photo réservés : aplat, aucun texte visible ---------- */
.cadre { background: var(--fond-photo); border: 1px solid var(--filet); border-radius: var(--rayon); width: 100%; overflow: hidden; }
.cadre img { width: 100%; height: 100%; object-fit: cover; }
.cadre-hero { aspect-ratio: 16 / 10; }
.cadre-portrait { aspect-ratio: 4 / 5; max-width: 320px; }
figure { margin: 1.5rem 0; }
figcaption { font: 400 15px / 1.4 var(--police-ui); color: var(--encre-2); margin-top: 8px; }

/* ---------- Barre collante mobile : 2 boutons, fond blanc, filet haut ---------- */
.eco-barre { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 10px 12px; background: #fff; border-top: 1px solid var(--filet); }
.eco-barre .btn { min-height: 48px; padding: 12px 8px; font-size: 17px; }
.eco-barre .btn-appel { background: #fff; color: var(--accent); }
.eco-barre .btn-appel:hover { background: var(--fond-2); color: var(--accent-fonce); }
body.a-barre { padding-bottom: 80px; }
@media (min-width: 768px) { .eco-barre { display: none; } body.a-barre { padding-bottom: 0; } }
.eco-barre[data-masquee="1"] { display: none; }

/* =====================================================================
   BLOCS COMMUNS À TOUTES LES PAGES (copie identique dans css/legacy.css :
   si l'un change, changer l'autre) — consentement, France Rénov', pied.
   ===================================================================== */

/* Bannière de consentement (générée par js/consentement.js), compacte ≤ 110 px */
.eco-consent { position: fixed; left: 8px; right: 8px; bottom: 8px; z-index: 60; max-width: 640px; margin-inline: auto; background: #fff; color: #1c2b2a; border: 1px solid #d5dbd9; border-radius: 4px; padding: 8px 10px; font: 400 13.5px / 1.35 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; display: grid; grid-template-columns: 1fr auto auto; gap: 8px 10px; align-items: center; }
.eco-consent p { margin: 0; max-width: none; font: inherit; }
.eco-consent a { color: #1d5c3a; }
.eco-consent button { font: 600 15px / 1 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; min-height: 44px; padding: 8px 12px; border-radius: 4px; border: 2px solid #1d5c3a; background: #fff; color: #1d5c3a; cursor: pointer; }
.eco-consent button:hover, .eco-consent button:focus-visible { background: #f4f6f5; }
.eco-consent button.eco-consent-ok { background: #1d5c3a; color: #fff; }
.eco-consent button.eco-consent-ok:hover, .eco-consent button.eco-consent-ok:focus-visible { background: #154429; border-color: #154429; }
@media (max-width: 560px) {
  .eco-consent { grid-template-columns: 1fr 1fr; }
  .eco-consent p { grid-column: 1 / -1; }
}

/* Bannière France Rénov' (obligation légale, arrêté du 07/07/2026) — texte sobre, cliquable */
.eco-fr { background: #f4f6f5; border-top: 1px solid #d5dbd9; border-bottom: 1px solid #d5dbd9; }
.eco-fr a { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; max-width: 960px; margin-inline: auto; padding: 16px clamp(16px, 4vw, 40px); color: #1c2b2a; text-decoration: none; font: 400 16px / 1.45 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; }
.eco-fr a:hover .eco-fr-texte, .eco-fr a:focus-visible .eco-fr-texte { text-decoration: underline; }
.eco-fr-marque { font-weight: 700; font-size: 18px; white-space: nowrap; padding: 6px 10px; border: 2px solid #1c2b2a; border-radius: 4px; }
.eco-fr-texte { flex: 1 1 320px; margin: 0; max-width: none; }
.eco-fr-texte strong { font-weight: 600; }

/* Pied de page commun */
.eco-footer { background: #fff; border-top: 1px solid #d5dbd9; color: #1c2b2a; font: 400 15px / 1.55 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; padding: 32px 0 40px; }
.eco-footer-int { max-width: 960px; margin-inline: auto; padding-inline: clamp(16px, 4vw, 40px); display: grid; gap: 20px 40px; }
@media (min-width: 720px) { .eco-footer-int { grid-template-columns: 1.3fr 1fr 1fr; } }
.eco-footer p { margin: 0 0 8px; max-width: none; font: inherit; }
.eco-footer h2 { font: 700 15px / 1.3 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; margin: 0 0 8px; color: #4a5654; text-transform: uppercase; letter-spacing: .04em; }
.eco-footer ul { list-style: none; margin: 0; padding: 0; }
.eco-footer li { margin: 0 0 6px; max-width: none; font: inherit; }
.eco-footer a { color: #1d5c3a; text-decoration: underline; text-underline-offset: 3px; }
.eco-footer a:hover, .eco-footer a:focus-visible { color: #154429; }
.eco-footer .eco-footer-marque { font-weight: 700; font-size: 20px; color: #1c2b2a; text-decoration: none; }
.eco-footer .eco-footer-legal { grid-column: 1 / -1; border-top: 1px solid #d5dbd9; padding-top: 14px; color: #4a5654; font-size: 14px; }
.eco-footer button.eco-lien { background: none; border: 0; padding: 0; font: inherit; color: #1d5c3a; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* Impression */
@media print { .entete, .eco-barre, .eco-consent, .eco-footer nav { display: none !important; } body { font-size: 12pt; color: #000; } }

/* 18/09/2026 — en attendant les vraies photos (Lot B), les cadres réservés sont MASQUÉS : un aplat vide ressemble
   à une image cassée. À retirer quand les <img> sont posées (pompe-a-chaleur.html, index.html). */
.hero-photo, .cadre-hero, .cadre-portrait, .portrait-bloc > figure { display: none !important; }
