/* ─── Fonts ──────────────────────────────────────────────────────────────── */
@font-face {
    font-family: 'Cabin Condensed';
    src: url('../fonts/cabin-condensed-400.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Cabin Condensed';
    src: url('../fonts/cabin-condensed-600.woff2') format('woff2');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Cabin Condensed';
    src: url('../fonts/cabin-condensed-700.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Candal';
    src: url('../fonts/candal-400.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

/* ─── Variables ──────────────────────────────────────────────────────────── */
:root {
    --red:        #dd0000; /* rouge unique : contraste AA en texte sur blanc et sur gris clair */
    --red-dark:   #b00000; /* survol des boutons uniquement */
    --red-light:  #ff4d4d; /* petits textes sur fond noir (formulaire) uniquement */
    --accent-text: var(--red); /* textes colorés : suit la couleur de la section */
    --dark:       #1c1c1c;
    --dark-mid:   #2c2c2c;
    --gray:       #f2f2f2;
    --gray-mid:   #e0e0e0;
    --text:       #333333;
    --text-light: #666666;
    --white:      #ffffff;
    --hero-h:     440px;
    --radius:     4px;
    --red-tint:   #fdeeee;
    --panel-1:    #f7f2f2;
    --accent-line: rgba(221, 0, 0, .22);
    --surface-tint: #faf7f7;
    --shadow:     0 2px 12px rgba(0,0,0,.12);
    --transition: .25s ease;
    --font-body:  'Cabin Condensed', system-ui, sans-serif;
    --font-head:  'Candal', 'Cabin Condensed', system-ui, sans-serif;
}

/* ─── Reset ──────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: var(--font-body); font-weight: 400; color: var(--text); background: var(--white); line-height: 1.7; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
address { font-style: normal; }
sup { line-height: 0; } /* exposants (1re) sans décaler la ligne */
button { cursor: pointer; border: none; background: none; font: inherit; }

/* ─── Utilities ──────────────────────────────────────────────────────────── */
.container        { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.container-narrow { max-width: 860px; margin: 0 auto; padding: 0 24px; }
.text-center      { text-align: center; }
.lead             { font-size: 1.15rem; line-height: 1.8; max-width: 700px; margin: 0 auto; }

/* Texte réservé aux lecteurs d'écran */
.sr-only {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* Lien d'évitement : visible uniquement au focus clavier */
.skip-link {
    position: absolute;
    top: 8px; left: 8px;
    z-index: 2000;
    padding: 10px 18px;
    background: var(--dark);
    color: var(--white);
    font-weight: 700;
    border-radius: var(--radius);
    transform: translateY(-200%);
    transition: transform var(--transition);
}
.skip-link:focus { transform: none; }

/* Focus clavier visible partout (rouge sur fond clair, blanc sur fond sombre/rouge) */
:focus-visible { outline: 3px solid var(--accent-text); outline-offset: 3px; }
.site-header :focus-visible,
.site-footer :focus-visible,
.page-anchors :focus-visible,
.section-dark-red :focus-visible,
.btn-primary:focus-visible,
.scroll-top:focus-visible { outline-color: var(--white); }
main:focus { outline: none; }

/* ─── Buttons ────────────────────────────────────────────────────────────── */
.btn {
    display: inline-block;
    padding: 12px 28px;
    border-radius: var(--radius);
    font-family: var(--font-head);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    transition: background var(--transition), color var(--transition), transform var(--transition);
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--red); color: var(--white); }
.btn-primary:hover { background: var(--red-dark); }

/* ─── Header global (fonds feu + contenu) ────────────────────────────────── */
.site-header {
    position: relative;
    height: var(--hero-h);
    display: flex;            /* bandeau en haut, puis logo + panneaux qui occupent le reste */
    flex-direction: column;
    overflow: visible;
    color: var(--white);
    z-index: 100;
}

/* Wrapper isolé : couvre le header + dépasse de 120 px pour la zone de transition */
.header-bg-wrapper {
    position: absolute;
    top: 0; left: 0; right: 0;
    bottom: -118px; /* 2 px de moins que la transition : évite une ligne de jointure (positions décimales) */
    overflow: hidden;
    z-index: 0;
}

/* Fonds feu – fondu enchaîné */
.hero-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    will-change: opacity;
}
.hero-bg--1 { background-image: url('../images/hero-feu-1.webp'); z-index: 0; }
.hero-bg--2 { background-image: url('../images/hero-feu-2.webp'); z-index: 1; animation: heroFade 12s ease-in-out infinite, heroZoom 30s ease-in-out infinite alternate; }
.hero-bg--1 { animation: heroZoom 30s ease-in-out infinite alternate; }
/* Zoom très lent sur le feu */
@keyframes heroZoom {
    from { transform: scale(1); }
    to   { transform: scale(1.08); }
}
@keyframes heroFade {
    0%,40%  { opacity: 1; }
    50%,90% { opacity: 0; }
    100%    { opacity: 1; }
}
.hero-overlay { position: absolute; inset: 0; background: rgba(0,0,0,.42); z-index: 2; }
/* Fumée : couvre le header + la zone de transition (120 px), au-dessus de la découpe, sous le contenu */
.hero-smoke {
    position: absolute;
    top: 0; left: 0; right: 0;
    width: 100%;
    height: calc(100% + 120px);
    z-index: 2;
    pointer-events: none;
}


/* Transition « mirage de chaleur » : le canvas WebGL remplace les deux fonds CSS dès qu'il est prêt */
.hero-burn {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    opacity: 0;
    animation: heroZoom 30s ease-in-out infinite alternate;
}
.header-bg-wrapper.is-burn .hero-burn { opacity: 1; }
.header-bg-wrapper.is-burn .hero-bg   { display: none; }

/* ── Bandeau : titre (initiales FMSI) + coordonnées ── */
.top-band {
    position: relative;
    z-index: 3;
    padding: 16px 24px 14px;
    background: linear-gradient(rgba(0, 0, 0, .55), rgba(0, 0, 0, 0)); /* lisibilité sur les flammes */
    color: var(--white);
    text-align: center;
    text-shadow: 0 1px 4px rgba(0, 0, 0, .6);
}
.top-band-info {
    margin: 8px 0 0;
    font-size: .88rem;
    letter-spacing: .02em;
    color: rgba(255, 255, 255, .75);
}
.top-band-info .hl { color: var(--red-light); font-weight: 700; }
.top-band-info a { color: rgba(255, 255, 255, .9); transition: color var(--transition); }
.top-band-info a:hover { color: var(--white); text-decoration: underline; }

/* Titre : mots en lettres fines espacées, initiale en pastille rouge (esprit pictogramme) */
.header-tagline {
    margin: 0; /* <p> sur les pages intérieures, <h1> sur l'accueil : même rendu */
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    row-gap: 8px;
    font-family: var(--font-body);
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: .28em;
    text-transform: uppercase;
    line-height: 1.2;
    color: var(--white);
}
.header-tagline .tw {
    display: inline-flex;
    align-items: baseline; /* initiale et mot sur la même ligne de base */
    white-space: nowrap;
}
.header-tagline .hl {
    display: inline-block;
    width: 1.55em;
    height: 1.55em;
    margin-right: .4em;
    background: var(--red);
    color: var(--white);
    font-family: var(--font-head);
    font-weight: 400;
    font-size: 1.15em;
    line-height: 1.55em;
    letter-spacing: 0;
    text-align: center;
    vertical-align: baseline; /* l'initiale repose sur la même ligne de base que le reste du mot */
}
/* Filet rouge fin entre les mots */
.header-tagline .tw + .tw::before {
    content: '';
    display: inline-block;
    width: 1px;
    height: 1.4em;
    margin: 0 1em 0 .7em; /* .7em + l'espacement des lettres (.28em) qui suit le mot précédent */
    background: var(--red);
    align-self: center; /* centré sur la hauteur des pastilles */
}

/* ── Visuel : logo + appel | prestations affichées en permanence ── */
.header-inner {
    position: relative;
    z-index: 3;
    flex: 1;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 12px 24px 40px;
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 40px;
}
.header-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}
.header-logo { flex-shrink: 0; }
.header-logo img {
    height: 170px;
    width: auto;
    filter: drop-shadow(0 4px 12px rgba(0,0,0,.5));
    transition: transform var(--transition);
}
.header-logo:hover img { transform: scale(1.04); }
.header-call {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--red);
    color: var(--white);
    font-family: var(--font-head);
    letter-spacing: .05em;
    white-space: nowrap;
    transition: background var(--transition);
}
.header-call:hover { background: var(--red-dark); }
.header-call svg { width: 18px; height: 18px; }

/* Panneaux de prestations : cadres rouges (le vert d'évacuation reste sur les liens concernés) */
.hero-menu {
    display: grid;
    grid-template-columns: 1.1fr 1fr 1fr;
    gap: 16px;
}
.hero-panel {
    --c: var(--red);
    position: relative;
    padding: 18px 20px 16px;
    background: rgba(0, 0, 0, .42);
    border: 1px solid rgba(255, 255, 255, .16);
    isolation: isolate;
    transition: background var(--transition), border-color var(--transition);
}
.hero-panel::before { /* flou derrière le panneau */
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}
/* Repères d'angle, comme les panneaux du site ; ils s'allongent au survol */
.hero-panel::after {
    content: '';
    position: absolute;
    inset: -1px;
    pointer-events: none;
    background:
        linear-gradient(var(--c), var(--c)) top left,
        linear-gradient(var(--c), var(--c)) top left,
        linear-gradient(var(--c), var(--c)) bottom right,
        linear-gradient(var(--c), var(--c)) bottom right;
    background-repeat: no-repeat;
    background-size: 18px 2px, 2px 18px, 18px 2px, 2px 18px;
    transition: background-size .35s ease;
}
.hero-panel:hover,
.hero-panel:focus-within { background: rgba(0, 0, 0, .55); border-color: rgba(255, 255, 255, .28); }
.hero-panel:hover::after,
.hero-panel:focus-within::after { background-size: 36px 2px, 2px 36px, 36px 2px, 2px 36px; }
/* Page en cours : panneau souligné */
.hero-panel:has([aria-current="page"]) { border-color: rgba(255, 255, 255, .4); }

.hero-panel-head {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, .14);
    transition: border-color var(--transition);
}
.hero-panel-title {
    display: block;
    flex: 1;
    font-family: var(--font-head);
    font-size: .95rem;
    letter-spacing: .04em;
    line-height: 1.3;
    text-transform: uppercase;
    color: var(--white);
}
.hero-panel-title .hl { color: var(--red); }
.hero-panel-head:has(.hero-panel-title:hover),
.hero-panel-head:has([aria-current="page"]) { border-bottom-color: var(--c); }
/* Bouton de dépliage : mobile uniquement */
.hero-panel-toggle { display: none; }
.hero-panel li a {
    position: relative;
    display: block;
    padding: 3px 0;
    font-size: .95rem;
    color: rgba(255, 255, 255, .82);
    transition: color var(--transition), padding-left var(--transition);
}
/* Code couleur au survol : le lien glisse et révèle un trait rouge, vert (évacuation) ou gris */
.hero-panel li a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    width: 2px;
    height: 0;
    background: var(--red);
    transform: translateY(-50%);
    transition: height .2s ease;
}
.hero-panel li a.nav-evac::before   { background: #2fbf6a; }
.hero-panel li a.nav-neutre::before { background: #9a9a9a; }
.hero-panel li a:hover,
.hero-panel li a:focus-visible { color: var(--white); padding-left: 12px; }
.hero-panel li a:hover::before,
.hero-panel li a:focus-visible::before { height: 1.1em; }

.header-transition {
    position: absolute;       /* sous le header, dans la zone couverte par le fond (−120 px) */
    top: 100%;
    left: 0; right: 0;
    height: 120px;
    overflow: hidden;
    pointer-events: none;
    background: transparent;
}
.ht {
    position: absolute;
    inset: 0;
    background: var(--white);
    z-index: 2; /* au-dessus du hero-overlay (même z-index, mais plus tard dans le DOM), en dessous de .header-inner (z-index:3) → méga menu visible */
}
.ht-1 { clip-path: polygon(0 40px, 100% 0, 100% 40px, 0 40px); opacity: .2; }
.ht-2 { clip-path: polygon(0 40px, 100% 40px, 100% 80px, 0 40px); opacity: .5; }
.ht-3 { clip-path: polygon(0 40px, 100% 80px, 100% 120px, 0 120px); opacity: 1;   }

/* Lisière incandescente : halo flouté qui respire, puis fil de braise avec un reflet qui court */
.ht-glow,
.ht-edge {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    overflow: visible;
}
.ht-glow {
    filter: blur(14px);
    animation: htBreath 3.2s ease-in-out infinite alternate;
}
.ht-edge { filter: drop-shadow(0 0 3px rgba(255, 140, 0, .9)); }
@keyframes htBreath {
    from { opacity: .6; }
    to   { opacity: .95; }
}

/* Décale le premier élément de page pour compenser la zone de transition (120 px) */
.site-header + * {
    margin-top: 120px;
}

/* ─── En-tête de page intérieure ────────────────────────────────────────── */
.page-hero {
    background: var(--white);
    padding: 52px 0 36px;
    border-bottom: 3px solid var(--red);
}
.page-hero-title {
    font-family: var(--font-head);
    font-size: clamp(2rem, 5vw, 3.4rem);
    color: var(--red);
    text-transform: uppercase;
    letter-spacing: .04em;
    line-height: 1.1;
    margin-bottom: 10px;
}
.page-hero-sub {
    font-size: 1rem;
    color: var(--text-light);
    margin: 0;
    letter-spacing: .01em;
}

/* ─── Anchor nav ─────────────────────────────────────────────────────────── */
.page-anchors {
    background: var(--red);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.page-anchors .container { padding: 0 24px; }
.page-anchors ul { display: flex; gap: 0; white-space: nowrap; }

@media (max-width: 768px) {
    .page-anchors .container { padding: 0; }
    .page-anchors:has(ul.is-looping) { overflow: hidden; }
    .page-anchors ul.is-looping {
        width: max-content;
        animation: anchors-scroll 12s linear infinite;
    }
    .page-anchors ul.is-looping:hover,
    .page-anchors ul.is-looping:focus-within { animation-play-state: paused; }
}

@keyframes anchors-scroll {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}
.page-anchors ul li a {
    display: block;
    padding: 14px 20px;
    color: var(--white);
    font-family: var(--font-head);
    font-size: .85rem;
    letter-spacing: .05em;
    text-transform: uppercase;
    border-bottom: 3px solid transparent;
    transition: color var(--transition), border-color var(--transition);
}
.page-anchors ul li a:hover { border-bottom-color: var(--white); }

/* ─── Sections ───────────────────────────────────────────────────────────── */
.section { padding: 80px 0; }
.section-light  { background: var(--white); }
.section-gray   { background: var(--gray); }
.section-dark-red { background: var(--red); color: var(--white); }
.section-dark-red h2 { color: var(--white); }

h2 {
    font-family: var(--font-head);
    font-size: clamp(1.1rem, 2.2vw, 1.6rem);
    color: var(--dark);
    letter-spacing: .04em;
    text-transform: uppercase;
    margin-bottom: 20px;
    line-height: 1.2;
}
h3 { font-family: var(--font-head); font-size: 1.2rem; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 10px; }
p  { margin-bottom: 16px; }
p:last-child { margin-bottom: 0; }

/* ─── Two-col layout ─────────────────────────────────────────────────────── */
.section-two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 64px;
    align-items: center;
}
.section-two-col.reverse .section-text { order: 2; }
.section-two-col.reverse .section-image { order: 1; }
.section-text { display: flex; flex-direction: column; gap: 4px; }
.section-text > .btn { align-self: flex-start; margin-top: 12px; }

/* Titres de prestation : numéro de section (01, 02…) + filet rouge */
main { counter-reset: prestation; }
.service-section { counter-increment: prestation; }
.service-section .section-text > h2::before {
    content: counter(prestation, decimal-leading-zero);
    display: block;
    margin-bottom: 10px;
    padding-left: 38px;
    background: linear-gradient(var(--red), var(--red)) no-repeat left center / 28px 2px;
    font-size: .8rem;
    letter-spacing: .2em;
    color: var(--accent-text);
}
.service-section .section-text > h2::after {
    content: '';
    display: block;
    width: 48px;
    height: 3px;
    margin-top: 14px;
    background: var(--red);
    border-radius: 2px;
}

/* Cadres « plan technique » : filet fin, repères d'angle à la couleur de la section
   (s'allongent au survol), sans arrondi ni ombre. Partagé par les panneaux d'images,
   les cartes de l'accueil et les étiquettes d'extincteurs. */
.section-image:not(.section-image--masked),
.card,
.extincteur-item {
    position: relative;
    border: 1px solid var(--accent-line);
    isolation: isolate;
}
.section-image:not(.section-image--masked)::after,
.card::after,
.extincteur-item::after {
    content: '';
    position: absolute;
    inset: -1px;
    pointer-events: none;
    background:
        linear-gradient(var(--red), var(--red)) top left,
        linear-gradient(var(--red), var(--red)) top left,
        linear-gradient(var(--red), var(--red)) bottom right,
        linear-gradient(var(--red), var(--red)) bottom right;
    background-repeat: no-repeat;
    background-size: 22px 2px, 2px 22px, 22px 2px, 2px 22px;
    transition: background-size .35s ease;
}
.section-image:not(.section-image--masked):hover::after,
.card:hover::after,
.extincteur-item:hover::after {
    background-size: 44px 2px, 2px 44px, 44px 2px, 2px 44px;
}

/* Visuels produits : aplat clair + trame de points sur les bords (images détourées) */
.section-image:not(.section-image--masked) {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(28px, 4vw, 48px);
    background: var(--panel-1);
}
.section-gray .section-image:not(.section-image--masked) { background: var(--white); }
.section-image:not(.section-image--masked)::before,
.extincteur-item::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background: radial-gradient(circle, var(--accent-line) 1px, transparent 1.4px) 0 0 / 14px 14px;
    /* trame estompée au centre pour laisser le produit lisible */
    -webkit-mask-image: radial-gradient(ellipse at center, transparent 40%, #000 90%);
    mask-image: radial-gradient(ellipse at center, transparent 40%, #000 90%);
}
.section-image:not(.section-image--masked) img {
    max-height: 420px;
    width: auto;
    transition: transform .5s ease;
}
.section-image:not(.section-image--masked):hover img { transform: scale(1.04); }

/* Code couleur de la signalétique de sécurité : rouge = lutte contre l'incendie,
   vert = évacuation. Redéfinir les variables suffit à passer toute la section en vert
   (numéro, filets, puces, boutons, panneaux, citations…). */
.theme-evacuation {
    --red:           #00873f; /* vert sécurité, contraste AA avec le blanc */
    --red-dark:      #006b32;
    --accent-text:   #006b32; /* vert plus foncé pour les petits textes */
    --red-light:     #2fbf6a;
    --red-tint:      #e8f5ec;
    --panel-1:       #f1f7f3;
    --accent-line:   rgba(0, 135, 63, .28);
    --surface-tint:  #f5faf6;
}
.theme-evacuation .meta-item--public::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23006b32' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='9' cy='8' r='3.2'/%3E%3Cpath d='M3.2 19.5c0-3.2 2.6-5.5 5.8-5.5s5.8 2.3 5.8 5.5'/%3E%3Ccircle cx='16.6' cy='8.8' r='2.5'/%3E%3Cpath d='M16.3 14.2c2.7.1 4.5 2.2 4.5 4.8'/%3E%3C/svg%3E"); }
.theme-evacuation .meta-item--objectif::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23006b32' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='8.5'/%3E%3Ccircle cx='12' cy='12' r='5'/%3E%3Ccircle cx='12' cy='12' r='1.2' fill='%23006b32'/%3E%3C/svg%3E"); }
.theme-evacuation .meta-item--prerequis::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23006b32' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='8.5'/%3E%3Cpath d='M8.3 12.3l2.5 2.5 4.9-5.2'/%3E%3C/svg%3E"); }
.theme-evacuation .meta-item--demande::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23006b32' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 5h14a1.5 1.5 0 0 1 1.5 1.5V15a1.5 1.5 0 0 1-1.5 1.5h-8.5L6 20v-3.5H5A1.5 1.5 0 0 1 3.5 15V6.5A1.5 1.5 0 0 1 5 5z'/%3E%3Cpath d='M8 9.5h8M8 12.5h5'/%3E%3C/svg%3E"); }

/* Couleur neutre : prestations hors code incendie / évacuation (étude personnalisée) */
.theme-neutre {
    --red:           #444444;
    --red-dark:      #333333;
    --accent-text:   #333333;
    --red-light:     #9a9a9a;
    --red-tint:      #ededed;
    --panel-1:       #f4f4f4;
    --accent-line:   rgba(0, 0, 0, .20);
    --surface-tint:  #f7f7f7;
}
.theme-neutre .meta-item--public::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23444444' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='9' cy='8' r='3.2'/%3E%3Cpath d='M3.2 19.5c0-3.2 2.6-5.5 5.8-5.5s5.8 2.3 5.8 5.5'/%3E%3Ccircle cx='16.6' cy='8.8' r='2.5'/%3E%3Cpath d='M16.3 14.2c2.7.1 4.5 2.2 4.5 4.8'/%3E%3C/svg%3E"); }
.theme-neutre .meta-item--objectif::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23444444' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='8.5'/%3E%3Ccircle cx='12' cy='12' r='5'/%3E%3Ccircle cx='12' cy='12' r='1.2' fill='%23444444'/%3E%3C/svg%3E"); }
.theme-neutre .meta-item--prerequis::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23444444' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='8.5'/%3E%3Cpath d='M8.3 12.3l2.5 2.5 4.9-5.2'/%3E%3C/svg%3E"); }
.theme-neutre .meta-item--demande::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23444444' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 5h14a1.5 1.5 0 0 1 1.5 1.5V15a1.5 1.5 0 0 1-1.5 1.5h-8.5L6 20v-3.5H5A1.5 1.5 0 0 1 3.5 15V6.5A1.5 1.5 0 0 1 5 5z'/%3E%3Cpath d='M8 9.5h8M8 12.5h5'/%3E%3C/svg%3E"); }

/* Textes longs : l'image reste visible pendant la lecture */
@media (min-width: 769px) {
    .section-two-col--wide { align-items: start; }
    .section-two-col--wide > .section-image { position: sticky; top: 32px; }
}
.img-crop-right { clip-path: inset(0 15px 0 0); }
.text-alert { color: var(--accent-text); }
.section-cta-buttons { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 28px; }

/* Layout 2 colonnes texte large (2/3) + image (1/3) */
.section-two-col--wide          { grid-template-columns: 2fr 1fr; }
.section-two-col--wide.reverse  { grid-template-columns: 1fr 2fr; }
@media (max-width: 768px) {
    .section-two-col--wide,
    .section-two-col--wide.reverse { grid-template-columns: 1fr; }
}

/* Grille 3 extincteurs */
.extincteurs-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
    margin-top: 48px;
}
.extincteur-item {
    display: flex;
    justify-content: center;
    padding: 28px;
    background: var(--white);
}
.extincteur-item img { width: auto; max-height: 340px; }
@media (max-width: 600px) {
    .extincteurs-grid { grid-template-columns: 1fr; }
}

/* Layout 3 colonnes : image | texte | image */
.section-three-col {
    display: grid;
    grid-template-columns: 1fr 1.4fr 1fr;
    gap: 48px;
    align-items: center;
}
@media (max-width: 768px) {
    .section-three-col { grid-template-columns: 1fr; gap: 24px; }
}

/* Image À propos : centrée, grande, avec masque */
.apropos-image {
    margin-top: 36px;
    display: flex;
    justify-content: center;
}
.apropos-image img {
    max-width: 600px;
    width: 100%;
    -webkit-mask-image: url('../images/mask-accueil.webp');
    mask-image: url('../images/mask-accueil.webp');
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
}

/* Masque de forme sur l'image d'accueil */
.section-image--masked img {
    -webkit-mask-image: url('../images/mask-accueil.webp');
    mask-image: url('../images/mask-accueil.webp');
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
    border-radius: 0;
    box-shadow: none;
}

/* ─── Blockquote ─────────────────────────────────────────────────────────── */
blockquote {
    border-left: 4px solid var(--red);
    padding: 12px 20px;
    margin: 20px 0;
    background: var(--surface-tint);
    font-style: italic;
    color: var(--text-light);
    font-size: .95rem;
}

/* ─── Check list ─────────────────────────────────────────────────────────── */
.check-list { display: flex; flex-direction: column; gap: 8px; margin: 16px 0; }
.check-list li {
    position: relative;
    padding-left: 28px;    /* espace pour le bullet absolu */
    font-size: .95rem;
    color: var(--text-light);
    line-height: 1.6;
}
/* bullet positionné en absolu → le contenu (strong + texte) reste un seul flux inline */
.check-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 4px;
    width: 18px;
    height: 18px;
    background: var(--red);
    border-radius: 50%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
    background-size: 11px;
    background-repeat: no-repeat;
    background-position: center;
}
.check-list li strong { font-weight: 700; color: var(--text); }

/* ─── Cards grid ─────────────────────────────────────────────────────────── */
.cards-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; margin-top: 8px; }
.card {
    background: var(--white);
    padding: 32px 28px 28px;
    transition: background var(--transition);
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.card:hover { background: var(--surface-tint); }
.card-icon {
    display: grid;
    place-items: center;
    width: 64px;
    height: 64px;
    margin-bottom: 6px;
    border: 1px solid var(--accent-line);
    background: var(--red-tint);
    color: var(--accent-text);
    transition: background var(--transition), color var(--transition);
}
.card-icon svg { width: 34px; height: 34px; display: block; }
.card:hover .card-icon { background: var(--red); color: var(--white); }
.card h3 { font-size: 1.1rem; color: var(--dark); }
.card p   { color: var(--text-light); font-size: .95rem; flex: 1; }
.card-link { align-self: flex-start; color: var(--accent-text); font-weight: 700; font-size: .9rem; letter-spacing: .04em; text-transform: uppercase; }
.card-link span { display: inline-block; transition: transform var(--transition); }
.card:hover .card-link span { transform: translateX(4px); }

/* ─── Formation meta ─────────────────────────────────────────────────────── */
.formation-meta { display: flex; flex-direction: column; gap: 16px; margin: 20px 0; }
.meta-item {
    display: grid;
    grid-template-columns: 40px 1fr;
    column-gap: 14px;
    align-items: start;
    padding: 14px 18px 14px 14px;
    background: var(--white);
    border: 1px solid #e6e6e6;
    border-left: 2px solid var(--red);
}
.section-light .meta-item { background: var(--surface-tint); }
/* Pastille d'icône selon la rubrique */
.meta-item::before {
    content: '';
    grid-row: 1 / span 2;
    width: 40px;
    height: 40px;
    border: 1px solid var(--accent-line);
    background: var(--red-tint) no-repeat center / 22px;
}
.meta-item--public::before    { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23dd0000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='9' cy='8' r='3.2'/%3E%3Cpath d='M3.2 19.5c0-3.2 2.6-5.5 5.8-5.5s5.8 2.3 5.8 5.5'/%3E%3Ccircle cx='16.6' cy='8.8' r='2.5'/%3E%3Cpath d='M16.3 14.2c2.7.1 4.5 2.2 4.5 4.8'/%3E%3C/svg%3E"); }
.meta-item--objectif::before  { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23dd0000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='8.5'/%3E%3Ccircle cx='12' cy='12' r='5'/%3E%3Ccircle cx='12' cy='12' r='1.2' fill='%23dd0000'/%3E%3C/svg%3E"); }
.meta-item--prerequis::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23dd0000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='8.5'/%3E%3Cpath d='M8.3 12.3l2.5 2.5 4.9-5.2'/%3E%3C/svg%3E"); }
.meta-item--demande::before   { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23dd0000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 5h14a1.5 1.5 0 0 1 1.5 1.5V15a1.5 1.5 0 0 1-1.5 1.5h-8.5L6 20v-3.5H5A1.5 1.5 0 0 1 3.5 15V6.5A1.5 1.5 0 0 1 5 5z'/%3E%3Cpath d='M8 9.5h8M8 12.5h5'/%3E%3C/svg%3E"); }
.meta-item strong { display: block; font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; color: var(--accent-text); margin-bottom: 2px; }
.meta-item p { color: var(--text); margin: 0; font-size: .95rem; }

/* ─── Service section scroll target offset ───────────────────────────────── */
.service-section { scroll-margin-top: 24px; position: relative; }
/* Anciennes ancres du site WordPress : même point d'arrivée que la section */
.anchor-alias { position: absolute; top: 0; scroll-margin-top: 24px; }

/* ─── Formulaire de contact : décalage visuel à l'ancre ─────────────────── */
#formulaire { scroll-margin-top: 32px; }

/* ─── Politique page ─────────────────────────────────────────────────────── */
.container-narrow h2 { font-size: 1.4rem; margin-top: 40px; margin-bottom: 12px; color: var(--red); font-family: var(--font-head); text-transform: uppercase; letter-spacing: .04em; }
.container-narrow p, .container-narrow li { font-size: .97rem; color: var(--text); }
.container-narrow ul { list-style: disc; padding-left: 24px; margin: 12px 0; display: flex; flex-direction: column; gap: 6px; }
.container-narrow a { color: var(--accent-text); text-decoration: underline; }
.container-narrow a:hover { color: var(--red); }

/* ─── Footer ─────────────────────────────────────────────────────────────── */
.site-footer { background: var(--dark); color: #ccc; }
.footer-main { padding: 64px 0; }
.footer-grid { display: grid; grid-template-columns: 1fr 2fr; gap: 48px; }

.footer-site-name {
    display: block;
    font-family: var(--font-head);
    font-size: clamp(1.1rem, 2vw, 1.5rem);
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--white);
    line-height: 1.3;
    margin-bottom: 12px;
}
.footer-site-name .hl { color: var(--red); }
.footer-tagline { font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; color: #aaa; margin-bottom: 16px; }
address a { color: #ccc; transition: color var(--transition); }
address a:hover { color: var(--white); }
address p { margin-bottom: 6px; font-size: .9rem; }

.footer-social { display: flex; gap: 12px; margin-top: 16px; }
.footer-social a { color: #aaa; display: inline-flex; padding: 4px; transition: color var(--transition); }
.footer-social a:hover { color: var(--white); }
.footer-social svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.footer-contact-form h2 {
    font-family: var(--font-head);
    font-size: 1rem;
    line-height: 1.7;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--white);
    margin-bottom: 18px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--red);
}

/* ─── Contact form ───────────────────────────────────────────────────────── */
.contact-form { display: flex; flex-direction: column; gap: 12px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-group { display: flex; flex-direction: column; gap: 4px; }
.form-group label { font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; color: #aaa; }
.form-group label span,
.form-required-note span { color: var(--red-light); }
.form-required-note { font-size: .8rem; color: #aaa; margin: 0; }
.form-group input,
.form-group select,
.form-group textarea {
    background: rgba(255,255,255,.07);
    border: 1px solid rgba(255,255,255,.15);
    border-radius: var(--radius);
    padding: 10px 14px;
    color: var(--white);
    font-family: var(--font-body);
    font-size: .95rem;
    transition: border-color var(--transition), background var(--transition);
    width: 100%;
}
.form-group input::placeholder,
.form-group textarea::placeholder { color: #8a8a8a; }
.form-group select option { background: var(--dark-mid); color: var(--white); }
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { outline: none; border-color: var(--red); background: rgba(255,255,255,.1); }
.form-group textarea { resize: vertical; }
.form-group .is-invalid { border-color: var(--red-light); background: rgba(255,51,51,.08); }
.form-check input.is-invalid { outline: 2px solid var(--red-light); outline-offset: 2px; }
/* Champ anti-spam : hors écran (pas display:none, que certains robots détectent) */
.form-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-check { flex-direction: row; align-items: flex-start; gap: 10px; }
.form-check input[type="checkbox"] { width: 16px; height: 16px; min-width: 16px; margin-top: 3px; accent-color: var(--red); cursor: pointer; }
.form-check label { font-size: .82rem; text-transform: none; letter-spacing: 0; color: #aaa; cursor: pointer; }
.form-check label a { color: var(--red-light); text-decoration: underline; }

.form-success { background: #1e7e45; color: var(--white); padding: 14px 18px; border-radius: var(--radius); margin-bottom: 16px; font-size: .9rem; }
.form-error   { background: var(--red-dark); color: var(--white); padding: 14px 18px; border-radius: var(--radius); margin-bottom: 16px; font-size: .9rem; }

/* ─── Footer bottom ──────────────────────────────────────────────────────── */
.footer-map { margin-top: 20px; }
.footer-map iframe,
.map-consent {
    width: 100%;
    height: 180px;
    border: 0;
    border-radius: 6px;
}
.footer-map iframe { display: block; filter: grayscale(30%); }
.map-consent {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 16px;
    background: var(--dark-mid);
    border: 1px solid rgba(255,255,255,.12);
    color: #ccc;
    text-align: center;
    transition: background var(--transition), border-color var(--transition);
}
.map-consent:hover { background: #333; border-color: var(--red); }
.map-consent svg { width: 28px; height: 28px; fill: none; stroke: var(--red-light); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.map-consent-title { font-family: var(--font-head); text-transform: uppercase; letter-spacing: .06em; color: var(--white); }
.map-consent-note { font-size: .8rem; color: #aaa; }
.map-link { display: inline-block; margin-top: 8px; font-size: .85rem; color: #aaa; text-decoration: underline; }
.map-link:hover { color: var(--white); }

.footer-bottom {
    background: rgba(0,0,0,.3);
    padding: 16px 0;
    font-size: .8rem;
    color: #999;
}
.footer-bottom .container { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.footer-bottom p { margin: 0; }
.footer-bottom a { color: #aaa; transition: color var(--transition); }
.footer-bottom a:hover { color: var(--white); }

/* ─── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
    .cards-grid  { grid-template-columns: repeat(2, 1fr); }
    .footer-grid { grid-template-columns: 1fr; }
    /* Tablette : logo + appel sur une ligne, panneaux en dessous */
    :root { --hero-h: 560px; }
    .header-inner { grid-template-columns: 1fr; gap: 22px; padding-top: 22px; }
    .header-brand { flex-direction: row; justify-content: center; gap: 24px; }
    .header-logo img { height: 110px; }
}

@media (max-width: 768px) {
    :root { --hero-h: 560px; }

    /* Mobile : logo + appel, puis panneaux empilés en accordéon (titre + bouton de dépliage).
       Le header prend la hauteur de son contenu, qui grandit quand on déplie un panneau. */
    .site-header { height: auto; }
    .header-inner { padding-bottom: 28px; }
    .header-logo img { height: 92px; }
    .hero-menu { grid-template-columns: 1fr; gap: 10px; }
    .hero-panel { padding: 12px 14px; }
    .hero-panel-head { align-items: center; margin: 0; padding: 0; border-bottom: 0; }
    .hero-panel-toggle {
        display: grid;
        place-items: center;
        flex-shrink: 0;
        width: 40px;
        height: 40px;
        margin: -4px -4px -4px 0;
        border: 1px solid rgba(255, 255, 255, .22);
        color: var(--white);
        transition: background var(--transition), border-color var(--transition);
    }
    .hero-panel-toggle:hover { background: rgba(255, 255, 255, .08); }
    .hero-panel-toggle svg { width: 18px; height: 18px; transition: transform var(--transition); }
    .hero-panel ul { display: none; margin-top: 12px; padding-top: 8px; border-top: 1px solid rgba(255, 255, 255, .14); }
    .hero-panel.is-open ul { display: block; }
    .hero-panel.is-open .hero-panel-toggle { border-color: var(--red); background: rgba(221, 0, 0, .25); }
    .hero-panel.is-open .hero-panel-toggle svg { transform: rotate(180deg); }
    .hero-panel li a { padding: 6px 0; } /* cibles tactiles plus confortables */

    /* Sections */
    .section { padding: 48px 0; }
    .section-two-col { grid-template-columns: 1fr; gap: 32px; }
    .section-two-col.reverse .section-text,
    .section-two-col.reverse .section-image { order: unset; }
    .cards-grid { grid-template-columns: 1fr; }

    /* Footer */
    .footer-grid { grid-template-columns: 1fr; gap: 32px; }
    .form-row { grid-template-columns: 1fr; }
    .footer-bottom .container { flex-direction: column; text-align: center; }
}

@media (max-width: 600px) {
    /* Bandeau : titre en grille 2 × 2, sans filets */
    .top-band { padding: 12px 16px 10px; }
    .header-tagline {
        display: grid;
        grid-template-columns: repeat(2, max-content);
        justify-content: center;
        justify-items: start;
        column-gap: 1.2em;
        font-size: .9rem;
        letter-spacing: .2em;
    }
    .header-tagline .tw + .tw::before { display: none; }
    .top-band-info { font-size: .78rem; }
}

/* ─── Bouton retour en haut ──────────────────────────────────────────────── */
.scroll-top {
    display: flex;
    position: fixed;
    top: 18px;
    right: 20px;
    z-index: 1100;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--red);
    color: var(--white);
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,.25);
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s ease, transform .25s ease, background .2s ease;
    cursor: pointer;
}
.scroll-top svg { width: 20px; height: 20px; display: block; }
.scroll-top:hover { background: var(--red-dark); transform: translateY(-2px); }
.scroll-top.is-visible { opacity: 1; pointer-events: auto; }

/* ─── Animations réduites (réglage système de l'utilisateur) ────────────── */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
    .hero-bg--2 { animation: none; }
    .page-anchors { overflow-x: auto; }
}

@media (max-width: 768px) {
    /* Bouton « retour en haut » en bas à droite : le haut est occupé par la barre */
    .scroll-top { top: auto; bottom: 18px; right: 16px; }
}
