/* =========================================================
   Sujet Énergie — style.css (UNIFIÉ + boutons OK global/Services)
   ========================================================= */

/* ---------- Variables & reset ---------- */
:root{
  --brand-forest:#004E29;
  --brand-forest-2:#00592F;
  --brand-leaf:#83BE25;
  --brand-offwhite:#F2F6F3;
  --text:#0B1F16;
  --white:#FFFFFF;

  --container:1120px;
  --radius:16px;
  --shadow:0 10px 30px rgba(0,0,0,.12);
}

*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{
  margin:0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Inter, Arial, sans-serif;
  color:var(--text); background:#fff; line-height:1.55;
  -webkit-font-smoothing:antialiased; text-rendering:optimizeLegibility;
}
img{max-width:100%; height:auto; display:block}
a{color:var(--brand-forest); text-decoration:none}
a:hover{text-decoration:underline}
strong,b{font-weight:700}

/* ---------- Accessibilité ---------- */
:focus-visible{outline:3px solid var(--brand-leaf); outline-offset:2px}
.skip-link{position:absolute; left:-9999px; top:auto; width:1px; height:1px; overflow:hidden}
.skip-link:focus{
  position:fixed; left:16px; top:16px; width:auto; height:auto;
  background:#fff; color:#000; padding:.5rem .75rem; z-index:9999; border-radius:8px
}

/* ---------- Containers & header ---------- */
.container{width:min(100% - 2rem, var(--container)); margin-inline:auto}
.header-wrap,.footer-cols{display:flex; align-items:center; justify-content:space-between; gap:1rem}
header{position:sticky; top:0; z-index:100; background:var(--white); border-bottom:1px solid #e6efe9}

/* Brand : logo + nom côte à côte (forcé) */
.brand{display:flex; align-items:center; gap:.6rem; flex-shrink:0}
.brand-link{display:inline-flex; align-items:center; gap:.6rem}
.brand-logo{width:48px; height:auto; flex:0 0 auto}
.brand-name{display:inline-block; font-weight:700; color:var(--brand-forest); white-space:nowrap}
.header-wrap{flex-wrap:nowrap}

/* ---------- Navigation ---------- */
.nav{list-style:none; display:flex; gap:1rem; padding:0; margin:0; align-items:center}
.nav a{padding:.625rem .75rem; border-radius:10px}
.nav a.active,.nav a:hover{background:var(--brand-offwhite); text-decoration:none}
.nav-phone a{font-weight:700}

/* ---------- Hero ---------- */
.hero{position:relative; padding:clamp(3rem,6vw,6rem) 0; color:#fff}
.hero-bg{
  background:
    linear-gradient(180deg, rgba(0,78,41,.85) 0%, rgba(0,78,41,.70) 40%, rgba(0,78,41,.55) 100%),
    url("images/imagefond.webp") center/cover no-repeat;
}
.hero .overlay{display:none}
.hero-content{position:relative}
.hero h1{margin:0 0 1rem; font-size:clamp(1.6rem,2.8vw,2.4rem); line-height:1.2}
.hero .lead{max-width:60ch; margin:0 0 1.25rem; color:#eef6f1}

/* ---------- Boutons (base + contextes) ---------- */
.btn{
  display:inline-flex; align-items:center; gap:.45rem;
  font-weight:700; border-radius:999px;
  padding:.9rem 1.2rem; transition:.2s ease;
  border:2px solid transparent; line-height:1; white-space:nowrap;
}
.btn-primary{ background:var(--brand-leaf); color:#053b21 }
.btn-primary:hover{ filter:brightness(.95); text-decoration:none }

/* Outline par défaut (fonds clairs) */
.btn-outline{
  background:transparent; color:var(--brand-forest); border-color:var(--brand-forest);
}
.btn-outline:hover{ background:rgba(0,78,41,.06); text-decoration:none }

/* Contexte sombre (hero & popup) */
.hero .btn-outline,
.site-notice .btn-outline{ color:#fff; border-color:#bfe69a }
.hero .btn-outline:hover,
.site-notice .btn-outline:hover{ background:rgba(255,255,255,.12) }

/* CTA (style voulu plein vert) */
.cta .btn-outline{ background:var(--brand-forest); color:#fff; border-color:var(--brand-forest) }
.cta .btn-outline:hover{ filter:brightness(.95); text-decoration:none }

.cta-buttons{display:flex; flex-wrap:wrap; gap:.75rem}

/* ---------- Sections & headings ---------- */
section{padding:clamp(2.5rem,4vw,4rem) 0}
h2{font-size:clamp(1.4rem,2.2vw,2rem); margin:0 0 1rem; color:var(--brand-forest)}
h3{font-size:clamp(1.1rem,1.8vw,1.3rem); margin:.25rem 0 .5rem; color:var(--brand-forest-2)}

/* ---------- Grids & Cards ---------- */
.grid{display:grid; gap:1rem}
.grid-3{grid-template-columns:1fr}
@media (min-width:720px){ .grid-3{grid-template-columns:repeat(3,1fr)} }

.card{
  background:#fff; border:1px solid #e6efe9; border-radius:var(--radius);
  padding:1.25rem 1.5rem; box-shadow:var(--shadow); position:relative;
}
.card p{margin:0; color:#2a3c33}

/* Titres des cartes : ne collent pas aux bords */
.card h3{
  margin:.15rem 0 .55rem !important;
  padding:.2rem .65rem !important;
  line-height:1.25; border-radius:10px;
}

/* Listes dans les cartes */
.card ul{ padding-left:1.1rem; margin:.5rem 0 .75rem }
.card li{ margin:.25rem 0 }
.card li:empty{ display:none }
.card li::marker{ color:var(--brand-forest) }

/* ---------- Marques & Partenaires ---------- */
.brands{ background:var(--brand-offwhite) }
.brands-grid{ display:grid; gap:1.2rem; grid-template-columns:1fr }
@media (min-width:720px){ .brands-grid{ grid-template-columns:repeat(3,1fr) } }

.brand-card{
  background:#fff; border:1px solid #e1ebe5; border-radius:var(--radius);
  box-shadow:var(--shadow); padding:1.25rem; text-align:center;
  display:flex; flex-direction:column; align-items:center; min-height:320px;
}

/* LOGO BOX responsive (tous ratios) */
.logo-box{
  width:100%; height:clamp(110px,12vw,170px);
  padding:10px 14px; display:flex; align-items:center; justify-content:center;
  background:transparent; border-radius:12px;
}
.logo-box img{ max-width:100%; max-height:100%; width:auto; height:auto; object-fit:contain; }
/* logos plus hauts que larges */
.logo-box--tall{ height:clamp(140px,16vw,220px) }

.brand-card figcaption{ margin-top:auto; line-height:1.5; max-width:56ch }

/* ---------- CTA finale ---------- */
.cta{ background:linear-gradient(180deg,#f8fbf9 0%,#eef5f1 100%); text-align:center }
.cta p{ margin:.5rem 0 }
.cta-phone a{ font-weight:700; color:var(--brand-forest) }
.cta .cta-buttons{ display:flex; flex-wrap:wrap; gap:.75rem; justify-content:center }

/* ---------- Footer ---------- */
footer{ background:#0f2f22; color:#dfeae5; padding-top:2rem }
footer a{ color:#cfe9d8 }
footer .footer-cols{ gap:2rem; align-items:flex-start }
footer .container:last-child{ text-align:center; padding-top:1rem }
.host-note{ opacity:.85 }

/* ---------- Utilities ---------- */
.hidden{display:none !important}
@media (prefers-reduced-motion:reduce){ *{transition:none !important; animation:none !important} }

/* ---------- Dark mode (optionnel) ---------- */
html[data-theme="dark"] body{ background:#0a1b14; color:#dfeae5 }
html[data-theme="dark"] header{ background:#0f261d; border-color:#113324 }
html[data-theme="dark"] .card{ background:#10251d; border-color:#153726 }
html[data-theme="dark"] .brands{ background:#0e221a }
html[data-theme="dark"] .brand-card{ background:#10251d; border-color:#153726 }

/* ---------- POPUP chantier en cours (si utilisé) ---------- */
html.no-scroll, html.no-scroll body { overflow: hidden !important; }
.site-notice-backdrop{
  position: fixed; inset: 0; background: rgba(0,0,0,.55);
  z-index: 9998; opacity: 0; pointer-events: none; transition: opacity .25s ease;
}
.site-notice-backdrop.is-visible{ opacity:1; pointer-events:auto; }
.site-notice{
  position: fixed; top:50%; left:50%; transform:translate(-50%,-50%);
  z-index: 9999; width:min(520px, calc(100% - 32px));
  background: var(--brand-forest); color:#fff; border:1px solid #0a3b24;
  border-radius:16px; box-shadow:0 22px 60px rgba(0,0,0,.25);
  padding: 1.15rem; opacity:0; transition: opacity .22s ease;
}
.site-notice.is-visible{ opacity:1; }
.site-notice__close{
  position:absolute; top:.5rem; right:.5rem;
  appearance:none; background:transparent; border:none;
  color:#e8f5ee; font-size:1.25rem; line-height:1;
  padding:.25rem .4rem; border-radius:8px; cursor:pointer;
}
.site-notice__close:hover{ background: rgba(255,255,255,.08); }
.site-notice__content strong{ display:block; color:#fff; margin-bottom:.35rem; }
.site-notice__content p{ margin:0 0 .9rem; line-height:1.55; color:#ffffff; }
.site-notice__actions{ display:flex; gap:.6rem; flex-wrap:wrap; justify-content:flex-start; }
.site-notice .btn-primary{ background: var(--brand-leaf); color:#053b21; border-color: var(--brand-leaf); }
.site-notice .btn-outline{ background:transparent; color:#fff; border-color:#fff; }
.site-notice .btn-outline:hover{ background: rgba(255,255,255,.12); }

/* =========================================================
   BOUTONS DANS LES CARTES — RÈGLE GLOBALE (par défaut)
   1er = SOLID vert foncé, 2e = LEAF vert clair
   ========================================================= */
.card .cta-inline > .btn:first-of-type{
  background: var(--brand-forest) !important;
  color:#fff !important;
  border-color: var(--brand-forest) !important;
}
.card .cta-inline > .btn:nth-of-type(2){
  background: var(--brand-leaf) !important;
  color:#053b21 !important;
  border-color: var(--brand-leaf) !important;
}
.card .cta-inline > .btn:nth-of-type(2):hover{ filter:brightness(.95) !important }

/* (on n’utilise PAS de fallback .btn + .btn global pour éviter les conflits) */

/* =========================================================
   PATCH PAGE SERVICES (#liste-services) — INVERSION LOCALE
   1er = LEAF vert clair, 2e = SOLID vert foncé
   ========================================================= */
body #liste-services .card .cta-inline > .btn:first-of-type{
  background: var(--brand-leaf) !important;
  color: #053b21 !important;
  border-color: var(--brand-leaf) !important;
}
body #liste-services .card .cta-inline > .btn:nth-of-type(2){
  background: var(--brand-forest) !important;
  color: #fff !important;
  border-color: var(--brand-forest) !important;
}
body #liste-services .card .cta-inline > .btn:hover{
  filter: brightness(.95) !important; text-decoration:none !important;
}
/* === FIX marge/padding titres des cartes (Accueil) === */
section.interventions .grid .card {
  padding: 1.25rem 1.5rem !important; /* s’assure que le contenu ne colle pas aux bords */
}

section.interventions .grid .card h3{
  margin: .2rem 0 .6rem !important;   /* espace au-dessus et dessous du titre */
  padding: .2rem .65rem !important;    /* léger rembourrage interne du h3 */
  line-height: 1.25 !important;
  border-radius: 10px;
}

/* Optionnel : un peu d’air pour le 1er paragraphe/listes après le titre */
section.interventions .grid .card h3 + p,
section.interventions .grid .card h3 + ul{
  margin-top: .25rem !important;
}
/* ========= Form UI — Contact ========== */
.form-grid{
  display:grid;
  gap:1rem 1rem;
  grid-template-columns: 1fr;
}
@media (min-width: 760px){
  .form-grid{ grid-template-columns: repeat(2, 1fr); }
}
.field{ display:flex; flex-direction:column; gap:.4rem; }
.field-full{ grid-column: 1 / -1; }
.field-half{ width:100%; }
.req{ color:var(--brand-leaf); font-weight:700; margin-left:.15rem; }

.form-grid input,
.form-grid select,
.form-grid textarea{
  appearance:none;
  border:1.5px solid #e1ebe5;
  background: var(--brand-offwhite);
  color: var(--text);
  padding:.85rem 1rem;
  border-radius:12px;
  font: inherit;
  line-height:1.35;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
.form-grid textarea{ resize:vertical; min-height:140px; }
.form-grid input::placeholder,
.form-grid textarea::placeholder{ color:#80968b; }

.form-grid input:focus,
.form-grid select:focus,
.form-grid textarea:focus{
  outline: none;
  border-color: var(--brand-leaf);
  box-shadow: 0 0 0 3px rgba(131,190,37,.25);
  background:#fff;
}

/* Sélecteur joli */
.form-grid select{
  background-image:
    linear-gradient(45deg, transparent 50%, #5b7b68 50%),
    linear-gradient(135deg, #5b7b68 50%, transparent 50%);
  background-position:
    calc(100% - 18px) calc(50% - 3px),
    calc(100% - 12px) calc(50% - 3px);
  background-size:6px 6px;
  background-repeat:no-repeat;
  padding-right:2.2rem;
}

/* Aides */
.hint{ font-size:.9rem; color:#5b7b68; margin:.2rem 0 0; }

/* Boutons larges dans le formulaire */
.btn-wide{ width:100%; text-align:center; }

/* Anti-bot (honeypot) */
.hp{ position:absolute; left:-9999px; width:1px; height:1px; overflow:hidden; }

/* Encadré infos de contact (droite) */
.contact-aside{ margin-top:1rem; }
@media (min-width: 980px){
  .contact-aside{ margin-top:1.5rem; }
}
.contact-highlights{
  list-style:none; padding:0; margin:1rem 0 0;
  display:grid; gap:.4rem;
}
.contact-highlights a{ text-decoration:underline; }

/* Alertes (succès/erreur) */
.alert{
  border-radius:14px;
  padding:.9rem 1rem;
  font-weight:600;
  box-shadow: var(--shadow);
  border:1px solid transparent;
}
.alert.success{
  background: #e9f7da;
  border-color:#cdebb0;
  color:#184b12;
}
.alert.error{
  background: #ffecec;
  border-color:#ffd1d1;
  color:#9a1b1b;
}

/* Harmonisation des boutons dans cartes/formulaires (rappel) */
.card .btn{ border-width:2px; }
.card .btn.btn-primary{ background: var(--brand-leaf); color:#053b21; border-color:var(--brand-leaf); }
.card .btn.btn-outline{ background: var(--brand-forest); color:#fff; border-color: var(--brand-forest); }
