/* ==========================================================================
   Querelec Électricité — feuille de style unique
   Tout le design system tient dans les variables ci-dessous.
   ========================================================================== */

:root {
  /* Palette : bleu nuit électrique + jaune "phase" */
  --bleu-900: #0b1b2b;
  --bleu-800: #12293f;
  --bleu-700: #1b3c59;
  --bleu-100: #e8f0f7;
  --jaune: #f5b301;
  --jaune-fonce: #d99a00;
  /* Le jaune n'atteint pas 4.5:1 sur fond clair : variante réservée au TEXTE
     sur blanc/gris clair (5.5:1). Ne pas l'utiliser comme couleur de fond. */
  --jaune-texte: #8a6100;
  --gris-900: #16202b;
  --gris-600: #55636f;
  --gris-300: #d7dde3;
  --gris-100: #f4f6f8;
  --blanc: #ffffff;

  --ombre-s: 0 1px 2px rgba(11, 27, 43, .08);
  --ombre-m: 0 6px 24px rgba(11, 27, 43, .10);
  --ombre-l: 0 18px 48px rgba(11, 27, 43, .16);

  --rayon: 14px;
  --rayon-s: 8px;
  --largeur: 1120px;

  --police: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

/* --- Reset léger ---------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--police);
  color: var(--gris-900);
  background: var(--blanc);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  /* Empêche une longue chaîne insécable (e-mail, URL) de déborder sur mobile */
  overflow-wrap: break-word;
}
img, svg { max-width: 100%; display: block; }
a { color: var(--bleu-700); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .6em; color: var(--bleu-900); }
h1 { font-size: clamp(2rem, 5vw, 3.25rem); letter-spacing: -.02em; }
h2 { font-size: clamp(1.5rem, 3.2vw, 2.2rem); letter-spacing: -.01em; }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
ul { margin: 0 0 1em; padding-left: 1.2em; }

/* --- Utilitaires ---------------------------------------------------------- */
.conteneur { width: min(100% - 2.5rem, var(--largeur)); margin-inline: auto; }
.section { padding: clamp(3rem, 7vw, 5.5rem) 0; }
.section--gris { background: var(--gris-100); }
.section--sombre { background: var(--bleu-900); color: var(--bleu-100); }
.section--sombre h2, .section--sombre h3 { color: var(--blanc); }
.centre { text-align: center; }
.chapo { font-size: 1.1rem; color: var(--gris-600); max-width: 62ch; }
.centre .chapo { margin-inline: auto; }
.section--sombre .chapo { color: #b9cbdc; }
.surtitre {
  display: inline-block; font-size: .78rem; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase; color: var(--jaune-texte);
  margin-bottom: .6rem;
}
.section--sombre .surtitre { color: var(--jaune); }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
/* Sans cette règle, le lien d'évitement reste invisible même au focus clavier :
   il devient décoratif et inutilisable. */
.sr-only:focus, .sr-only:focus-visible {
  position: fixed; top: .5rem; left: .5rem; z-index: 100;
  width: auto; height: auto; margin: 0; padding: .75rem 1.25rem;
  clip: auto; overflow: visible; white-space: normal;
  background: var(--blanc); color: var(--bleu-900); font-weight: 700;
  border-radius: var(--rayon-s); box-shadow: var(--ombre-m);
}

/* Utilitaires d'espacement : la CSP interdit les attributs style= en ligne */
.mt-m { margin-top: 1rem; }
.mt-l { margin-top: 2.5rem; }

/* L'en-tête collante masquerait les titres visés par les ancres */
[id] { scroll-margin-top: 88px; }

/* --- Boutons -------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .85rem 1.5rem; border-radius: 999px;
  font-weight: 700; text-decoration: none; border: 2px solid transparent;
  transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }
.btn--principal { background: var(--jaune); color: var(--bleu-900); box-shadow: var(--ombre-m); }
.btn--principal:hover { background: var(--jaune-fonce); }
.btn--secondaire { background: transparent; color: var(--blanc); border-color: rgba(255,255,255,.45); }
.btn--secondaire:hover { border-color: var(--blanc); background: rgba(255,255,255,.08); }
.btn--sombre { background: var(--bleu-800); color: var(--blanc); }
.btn--sombre:hover { background: var(--bleu-700); }

/* --- En-tête -------------------------------------------------------------- */
.entete {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--gris-300);
}
.entete__inner { display: flex; align-items: center; gap: 1rem; min-height: 72px; }
.logo { display: flex; align-items: center; gap: .6rem; text-decoration: none; font-weight: 800; color: var(--bleu-900); font-size: 1.15rem; }
.logo svg { width: 34px; height: 34px; flex: none; }
.logo span small { display: block; font-size: .68rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--gris-600); }
.nav { margin-left: auto; display: flex; align-items: center; gap: .3rem; }
.nav a {
  padding: .5rem .8rem; border-radius: var(--rayon-s);
  text-decoration: none; color: var(--gris-900); font-weight: 600; font-size: .95rem;
}
.nav a:hover { background: var(--gris-100); }
.nav .btn { margin-left: .5rem; padding: .6rem 1.1rem; }
.burger {
  display: none; margin-left: auto; background: none; border: 0; padding: .5rem;
  cursor: pointer; color: var(--bleu-900);
}
.burger svg { width: 28px; height: 28px; }

/* Rupture à 1024px et non 860px : les 4 rubriques + le bouton téléphone
   demandent ~966px de large, l'en-tête débordait entre 861 et 1000px. */
@media (max-width: 1024px) {
  .burger { display: block; }
  .nav {
    /* top:100% et non inset:72px : suit la hauteur réelle de l'en-tête
       si le visiteur agrandit la taille du texte */
    position: absolute; top: 100%; left: 0; right: 0;
    max-height: calc(100vh - 72px); overflow-y: auto;
    flex-direction: column; align-items: stretch;
    background: var(--blanc); border-bottom: 1px solid var(--gris-300);
    padding: .75rem 1.25rem 1.25rem; gap: .25rem; display: none;
    box-shadow: var(--ombre-m);
  }
  .nav[data-ouvert="true"] { display: flex; }
  .nav a { padding: .7rem .8rem; }
  .nav .btn { margin: .5rem 0 0; justify-content: center; }
}

/* --- Hero ----------------------------------------------------------------- */
.hero {
  position: relative; overflow: hidden;
  background: linear-gradient(160deg, var(--bleu-900) 0%, var(--bleu-700) 100%);
  color: var(--blanc);
  padding: clamp(3.5rem, 9vw, 6.5rem) 0;
}
.hero::after {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(circle at 82% 18%, rgba(245,179,1,.22), transparent 45%);
  pointer-events: none;
}
.hero__grille { position: relative; z-index: 1; display: grid; gap: 3rem; grid-template-columns: 1.15fr .85fr; align-items: center; }
.hero h1 { color: var(--blanc); }
.hero h1 em { font-style: normal; color: var(--jaune); }
.hero p { color: #cfe0ee; font-size: 1.12rem; max-width: 52ch; }
.hero__actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.8rem; }
.hero__preuves { display: flex; flex-wrap: wrap; gap: 1.6rem; margin-top: 2.4rem; padding-top: 1.6rem; border-top: 1px solid rgba(255,255,255,.15); }
.preuve { font-size: .9rem; color: #cfe0ee; }
.preuve strong { display: block; color: var(--blanc); font-size: 1.35rem; }
.hero__visuel svg { width: 100%; height: auto; filter: drop-shadow(0 18px 40px rgba(0,0,0,.35)); }
@media (max-width: 860px) {
  .hero__grille { grid-template-columns: 1fr; }
  .hero__visuel { display: none; }
}


/* --- Grilles de cartes ---------------------------------------------------- */
.grille { display: grid; gap: 1.5rem; }
/* min() indispensable : sans lui la piste garde sa largeur mini en dessous de
   360 px de viewport et déborde horizontalement. */
.grille--3 { grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); }
.grille--2 { grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); }

.carte {
  background: var(--blanc); border: 1px solid var(--gris-300); border-radius: var(--rayon);
  padding: 1.6rem; box-shadow: var(--ombre-s);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.carte:hover { transform: translateY(-4px); box-shadow: var(--ombre-m); border-color: var(--jaune); }
.carte h3 { margin-bottom: .4rem; }
.carte p { color: var(--gris-600); margin: 0; font-size: .96rem; }
.carte ul { color: var(--gris-600); font-size: .93rem; margin: .6rem 0 0; }
.carte__icone {
  width: 48px; height: 48px; border-radius: 12px; margin-bottom: 1rem;
  background: var(--bleu-100); display: grid; place-items: center; color: var(--bleu-700);
}
.carte__icone svg { width: 26px; height: 26px; }


/* --- Zone d'intervention -------------------------------------------------- */
.villes { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: .6rem; margin: 1.5rem 0 0; }
.villes li {
  background: var(--blanc); border: 1px solid var(--gris-300); border-radius: 999px;
  padding: .4rem 1rem; font-size: .92rem; font-weight: 600; color: var(--bleu-800);
}

/* --- FAQ ------------------------------------------------------------------ */
.faq { max-width: 780px; margin-inline: auto; }
.faq details {
  background: var(--blanc); border: 1px solid var(--gris-300);
  border-radius: var(--rayon-s); margin-bottom: .8rem; padding: 0 1.2rem;
}
.faq details[open] { border-color: var(--jaune); box-shadow: var(--ombre-s); }
.faq summary {
  cursor: pointer; font-weight: 700; padding: 1.05rem 0; list-style: none;
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 1.5rem; color: var(--bleu-700); line-height: 1; }
.faq details[open] summary::after { content: "–"; color: var(--bleu-700); }
.faq details p { color: var(--gris-600); margin: 0 0 1.1rem; }

/* --- Contact -------------------------------------------------------------- */
.contact__grille { display: grid; gap: 2.5rem; grid-template-columns: .9fr 1.1fr; align-items: start; }
@media (max-width: 860px) { .contact__grille { grid-template-columns: 1fr; } }
.coord { list-style: none; padding: 0; margin: 1.5rem 0 0; }
.coord li { display: flex; gap: .9rem; align-items: flex-start; margin-bottom: 1.1rem; }
.coord svg { width: 22px; height: 22px; flex: none; color: var(--jaune); margin-top: .25rem; }
.coord a { color: var(--blanc); font-weight: 600; }
.coord span { display: block; font-size: .82rem; color: #9db4c8; text-transform: uppercase; letter-spacing: .08em; }

/* Bloc de contact direct (remplace l'ancien formulaire) */
.appel-direct {
  background: var(--blanc); border-radius: var(--rayon); padding: 2rem 1.8rem;
  box-shadow: var(--ombre-l); color: var(--gris-900); text-align: center;
}
/* color explicite : .section--sombre h3 (0-1-1) rendrait ce titre blanc sur blanc */
.appel-direct h3 { color: var(--bleu-900); margin-bottom: .4rem; }
.appel-direct__intro { color: var(--gris-600); font-size: .95rem; }
.appel-direct__cta {
  width: 100%; justify-content: center; font-size: 1.15rem; padding: 1rem 1.5rem;
  /* annule le nowrap de .btn : l'adresse e-mail déborde sinon sous 360 px */
  white-space: normal;
}
.appel-direct__ou {
  position: relative; margin: 1.4rem 0; color: var(--gris-600);
  font-size: .85rem; text-transform: uppercase; letter-spacing: .1em;
}
.appel-direct__ou::before, .appel-direct__ou::after {
  content: ""; position: absolute; top: 50%; width: calc(50% - 4.5rem);
  height: 1px; background: var(--gris-300);
}
.appel-direct__ou::before { left: 0; }
.appel-direct__ou::after { right: 0; }
.appel-direct .btn--sombre { font-size: .98rem; }
.appel-direct__note {
  font-size: .86rem; color: var(--gris-600); margin: 1.4rem 0 0;
  padding-top: 1.2rem; border-top: 1px solid var(--gris-300);
}

/* --- Pied de page --------------------------------------------------------- */
.pied { background: var(--bleu-900); color: #a9c0d3; padding: 3rem 0 1.5rem; font-size: .92rem; }
.pied a { color: #cfe0ee; text-decoration: none; }
.pied a:hover { color: var(--jaune); text-decoration: underline; }
.pied__grille { display: grid; gap: 2rem; grid-template-columns: 1.4fr 1fr 1fr; }
@media (max-width: 720px) { .pied__grille { grid-template-columns: 1fr; } }
.pied h3 { color: var(--blanc); font-size: 1rem; margin-bottom: .8rem; }
.pied ul { list-style: none; padding: 0; margin: 0; }
.pied li { margin-bottom: .45rem; }
.pied__bas {
  margin-top: 2.5rem; padding-top: 1.25rem; border-top: 1px solid rgba(255,255,255,.12);
  display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; justify-content: space-between; font-size: .85rem;
}
.pied .logo { color: var(--blanc); margin-bottom: .8rem; }
.pied .logo small { color: #a9c0d3; }

/* --- Pages de contenu (mentions légales, etc.) ---------------------------- */
.page-contenu { max-width: 780px; }
.page-contenu h2 { margin-top: 2.5rem; font-size: 1.4rem; }
.page-contenu h3 { margin-top: 1.6rem; }
.page-contenu table { width: 100%; border-collapse: collapse; margin: 1rem 0 1.5rem; font-size: .95rem; }
.page-contenu th, .page-contenu td { text-align: left; padding: .6rem .8rem; border-bottom: 1px solid var(--gris-300); vertical-align: top; }
.page-contenu th { width: 38%; color: var(--bleu-800); font-weight: 700; }
.entete-page { background: var(--bleu-900); color: var(--blanc); padding: 3rem 0 2.5rem; }
/* Sous 560 px les tableaux légaux passent en liste empilée (libellé au-dessus) */
@media (max-width: 560px) {
  .page-contenu table, .page-contenu tbody, .page-contenu tr, .page-contenu th, .page-contenu td {
    display: block; width: 100%;
  }
  .page-contenu tr { border-bottom: 1px solid var(--gris-300); padding: .5rem 0; }
  .page-contenu th { border: 0; padding: 0 0 .1rem; font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; }
  .page-contenu td { border: 0; padding: 0; }
}
.entete-page h1 { color: var(--blanc); font-size: clamp(1.8rem, 4vw, 2.6rem); margin: 0; }
.entete-page p { color: #b9cbdc; margin: .5rem 0 0; }
.fil-ariane { font-size: .85rem; color: #9db4c8; margin-bottom: .8rem; }
.fil-ariane a { color: #cfe0ee; }

/* tabindex="-1" sur <main> rend la cible du lien d'évitement focusable
   (Safari ne déplace pas le focus sur une simple ancre) sans anneau visible */
main:focus { outline: none; }

/* --- Page 404 -------------------------------------------------------------- */
.page-404 { min-height: 100vh; display: grid; place-items: center; text-align: center; }
.page-404 p { margin-inline: auto; }
.page-404 .hero__actions { justify-content: center; }

/* --- Bouton d'appel flottant (mobile) ------------------------------------- */
.appel-flottant {
  position: fixed; bottom: 1rem; left: 1rem; right: 1rem; z-index: 60;
  display: none; justify-content: center; box-shadow: var(--ombre-l);
  white-space: normal; padding-inline: 1rem;
}
@media (max-width: 640px) {
  .appel-flottant { display: flex; }
  /* 6rem et non 4.5 : le bouton fait ~58px + 16px de décalage bas, il
     recouvrait les derniers liens du pied de page. */
  body { padding-bottom: 6rem; }
}
/* En paysage ou à 200 % de zoom, en-tête collante + bouton flottant
   mangeraient plus d'un tiers de la hauteur utile. */
@media (max-height: 500px) {
  .entete { position: static; }
  .appel-flottant { display: none; }
  body { padding-bottom: 0; }
}

/* --- Accessibilité / préférences ------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
/* Double anneau : le jaune seul ne fait que 1.85:1 sur fond clair (seuil 3:1).
   Le contour sombre assure le contraste, le halo jaune la visibilité sur sombre. */
:focus-visible {
  outline: 3px solid var(--bleu-900);
  outline-offset: 2px;
  box-shadow: 0 0 0 6px rgba(245, 179, 1, .65);
}
.hero :focus-visible, .section--sombre :focus-visible, .pied :focus-visible,
.entete-page :focus-visible {
  outline-color: var(--blanc);
}

@media print {
  .entete, .appel-flottant, .hero__visuel { display: none; }
  body { color: #000; }
}
