/* ============================================================
   SPI L.A. Préventif - feuille de style commune à toutes les pages.
   Ne contient que ce qui se répète partout : variables, réglages
   de base, en-tête, pied de page, bandeau cookies, animations.
   Le style propre à une page est dans assets/css/<page>.css
   ============================================================ */

/* --- VARIABLES --- */
:root {
    --primary: #014296;    /* Bleu foncé */
    --secondary: #0192ef;  /* Bleu clair */
    --white: #ffffff;
    --dark: #1a1a1a;
    --text: #4a4a4a;
    --bg-light: #f4f7f6;
    --transition: all 0.3s ease-in-out;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    --topbar-height: 45px;
    --header-height: 90px;
    --total-header-height: calc(var(--topbar-height) + var(--header-height));
}

/* --- RESET & BASE --- */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    font-family: 'Open Sans', sans-serif;
    color: var(--text);
    line-height: 1.6;
    background-color: var(--white);
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 { font-family: 'Montserrat', sans-serif; color: var(--primary); line-height: 1.2; }
a { text-decoration: none; color: inherit; transition: var(--transition); }
img { max-width: 100%; height: auto; display: block; }
ul { list-style: none; }

/* --- ACCESSIBILITÉ : focus clavier visible partout --- */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible,
textarea:focus-visible, [tabindex]:focus-visible {
    outline: 3px solid var(--secondary);
    outline-offset: 3px;
    border-radius: 4px;
}

/* --- LIEN D'ÉVITEMENT (skip link) --- */
.skip-link {
    position: absolute; left: -999px; top: 0; z-index: 2000;
    background: var(--primary); color: var(--white);
    padding: 12px 20px; font-family: 'Montserrat', sans-serif; font-weight: 700;
}
.skip-link:focus { left: 0; }

/* --- LAYOUT UTILS --- */
.container { width: 100%; max-width: 1250px; margin: 0 auto; padding: 0 20px; }
.section-padding { padding: 90px 0; }
.text-center { text-align: center; }
.section-title { font-size: 2.5rem; font-weight: 800; margin-bottom: 20px; text-transform: uppercase; }
.section-subtitle { font-size: 1.1rem; max-width: 800px; margin: 0 auto 50px auto; color: var(--text); }

/* --- BUTTONS --- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    padding: 14px 30px; border-radius: 50px; font-family: 'Montserrat', sans-serif;
    font-weight: 700; text-transform: uppercase; font-size: 0.9rem;
    letter-spacing: 0.5px; cursor: pointer; border: 2px solid transparent;
    transition: var(--transition); text-align: center;
}
.btn-primary { background-color: var(--secondary); color: var(--white) !important; box-shadow: 0 4px 15px rgba(1, 146, 239, 0.4); }
.btn-primary:hover { background-color: var(--primary); transform: translateY(-2px); box-shadow: 0 6px 20px rgba(1, 66, 150, 0.4); }
.btn-outline { background-color: transparent; color: var(--white); border-color: var(--white); }
.btn-outline:hover { background-color: var(--white); color: var(--primary); }
.btn-outline-primary { background-color: transparent; color: var(--primary) !important; border-color: var(--primary); }
.btn-outline-primary:hover { background-color: var(--primary); color: var(--white) !important; }
.btn-sm { padding: 11px 22px; font-size: 0.8rem; }
.hero-buttons { display: flex; gap: 15px; flex-wrap: wrap; justify-content: center; }

/* --- HEADER WRAPPER --- */
.header-wrapper { position: fixed; top: 0; left: 0; width: 100%; z-index: 1000; box-shadow: 0 4px 20px rgba(0,0,0,0.08); display: flex; flex-direction: column; }

/* --- TOP BAR --- */
.top-bar { background-color: var(--primary); height: var(--topbar-height); display: flex; align-items: center; color: var(--white); font-size: 0.85rem; font-family: 'Montserrat', sans-serif; }
.top-bar-container { display: flex; justify-content: space-between; align-items: center; width: 100%; height: 100%; }
.top-bar-left { display: flex; align-items: center; gap: 15px; font-weight: 600; letter-spacing: 0.5px; }
.top-bar-left i { color: var(--secondary); font-size: 1rem; }
.top-bar-right { display: flex; align-items: center; height: 100%; }
.top-phone { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 1.05rem; margin-right: 25px; color: var(--white); }
.top-phone i { color: var(--secondary); }
.top-phone:hover { color: var(--secondary); }
.top-cta { background-color: var(--secondary); height: 100%; display: flex; align-items: center; padding: 0 25px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px; color: var(--white); transition: var(--transition); }
.top-cta i { margin-left: 8px; }
.top-cta:hover { background-color: #017bc9; }

/* --- MAIN HEADER --- */
header.site-header { background-color: var(--white); height: var(--header-height); display: flex; align-items: center; }
.nav-container { display: flex; justify-content: space-between; align-items: center; width: 100%; }

/* --- LOGO --- */
.logo-wrapper { display: flex; flex-direction: column; justify-content: center; text-align: left; line-height: 1; z-index: 1001; }
.logo-img { height: 45px; object-fit: contain; margin-bottom: 5px; margin-left: -22px; }
.logo-text { color: var(--primary); font-family: 'Montserrat', sans-serif; font-size: 0.70rem; text-transform: uppercase; letter-spacing: 1.2px; font-weight: 800; }

/* --- DESKTOP NAV --- */
.main-nav { display: flex; align-items: center; }
.nav-links { display: flex; gap: 20px; align-items: center; }
.nav-links li a { color: var(--primary); font-family: 'Montserrat', sans-serif; font-weight: 700; font-size: 0.85rem; text-transform: uppercase; position: relative; padding: 8px 0; letter-spacing: 0.5px; }
.nav-links li a::after { content: ''; position: absolute; width: 0; height: 3px; bottom: 0; left: 0; background-color: var(--secondary); transition: var(--transition); }
.nav-links li a:hover::after, .nav-links li a.is-active::after { width: 100%; }
.nav-links li a.is-active { color: var(--secondary); }

/* --- MOBILE MENU ELEMENTS --- */
.mobile-menu-btn { display: none; color: var(--primary); font-size: 1.8rem; cursor: pointer; background: none; border: none; z-index: 1001; padding: 10px; }
.mobile-contact-block { display: none; }
.mobile-menu-header { display: none; }
.mobile-menu-close { background: none; border: none; color: var(--white); font-size: 1.7rem; cursor: pointer; padding: 8px; line-height: 1; }
.menu-overlay { display: none; position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: rgba(0,0,0,0.6); z-index: 998; opacity: 0; transition: opacity 0.3s ease; }


/* --- BANDEAU DE TITRE DES PAGES INTÉRIEURES ---
   La hauteur est identique partout : c'est ce qui donne au site
   sa régularité d'une page à l'autre. */
.page-hero { margin-top: var(--total-header-height); position: relative; overflow: hidden; background: linear-gradient(135deg, var(--primary), #012f6b); color: var(--white); padding: 62px 0 110px; text-align: center; }
.page-hero h1 { color: var(--white); font-size: 2.7rem; font-weight: 800; margin-bottom: 18px; }
.page-hero h1 span { color: var(--secondary); }
.page-hero .lead { max-width: 790px; margin: 0 auto; font-size: 1.12rem; color: rgba(255,255,255,0.92); }

/* Fil d'Ariane : position et style identiques partout */
.page-hero .breadcrumb { font-size: 0.85rem; color: rgba(255,255,255,0.72); margin: 0 0 20px; font-family: 'Montserrat', sans-serif; letter-spacing: 0.3px; line-height: 1.6; max-width: none; }
.breadcrumb a { color: rgba(255,255,255,0.86); }
.breadcrumb a:hover { color: var(--white); text-decoration: underline; }

/* La vague décorative sous le bandeau de titre. Sa couleur doit être
   celle de la section qui suit, sinon une bande blanche apparaît :
   les pages dont la section suivante est blanche redéfinissent
   .hero-wave path dans leur propre feuille de style. */
.hero-wave { position: absolute; left: 0; bottom: -1px; width: 100%; line-height: 0; pointer-events: none; }
.hero-wave svg { display: block; width: 100%; height: 70px; }
.hero-wave path { fill: var(--bg-light); }

/* Aucune section ne doit remonter par-dessus la vague */
.keyfigures { margin-top: 0 !important; }

/* Numérotation des articles des pages légales : style unique */
.legal-content h2 { align-items: center; }
.legal-content h2 .num { width: 32px; height: 32px; flex-shrink: 0; border-radius: 8px; background: var(--primary); color: var(--white); display: flex; align-items: center; justify-content: center; font-size: 0.85rem; font-weight: 800; }

/* --- FOOTER --- */
footer.site-footer { background-color: var(--dark); color: #cccccc; padding: 80px 0 20px; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 50px; margin-bottom: 60px; }
.footer-col h4 { color: var(--white); font-family: 'Montserrat', sans-serif; font-size: 1.3rem; margin-bottom: 30px; position: relative; padding-bottom: 12px; }
.footer-col h4::after { content: ''; position: absolute; left: 0; bottom: 0; width: 50px; height: 3px; background-color: var(--secondary); }
.footer-col p { margin-bottom: 15px; display: flex; align-items: flex-start; gap: 15px; line-height: 1.5; }
.footer-col i { color: var(--secondary); margin-top: 4px; font-size: 1.1rem; }
.footer-logo { align-items: flex-start; text-align: left; margin-bottom: 20px; }
.footer-logo-img { height: 40px; width: auto; object-fit: contain; margin-bottom: 8px; margin-left: -20px; }
.footer-logo-text { font-size: 0.6rem; color: #ccc; text-align: left; }
.social-links { display: flex; gap: 15px; margin-top: 25px; }
.social-links a { display: flex; align-items: center; justify-content: center; width: 45px; height: 45px; background-color: rgba(255,255,255,0.1); color: var(--white); border-radius: 50%; transition: var(--transition); font-size: 1.2rem; }
.social-links a:hover { background-color: var(--secondary); transform: translateY(-3px); }
.footer-legal-links { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 20px; }
.footer-legal-links a { font-size: 0.9rem; color: #cccccc; }
.footer-legal-links a:hover { color: var(--secondary); }
.footer-bottom { text-align: center; padding-top: 25px; border-top: 1px solid rgba(255,255,255,0.1); font-size: 0.9rem; }

/* --- BARRE CTA STICKY MOBILE --- */
.mobile-sticky-cta { display: none; }

/* --- ANIMATIONS (Micro-UI & Scroll) --- */
.reveal { opacity: 0; transform: translateY(40px); transition: all 0.8s cubic-bezier(0.5, 0, 0, 1); }
.reveal.active { opacity: 1; transform: translateY(0); }
.delay-1 { transition-delay: 0.15s; }
.delay-2 { transition-delay: 0.3s; }
.delay-3 { transition-delay: 0.45s; }

/* --- RESPECT DE prefers-reduced-motion (accessibilité) --- */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
    * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}


/* ============================================================
   FORMULAIRES : éléments communs aux pages Contact et Tarifs
   ============================================================ */
/* Piège à robots : hors écran plutôt que display:none, que certains
   robots savent détecter. Retiré du parcours clavier par tabindex="-1". */
.piege { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Champ masqué par le script selon le profil choisi. */
.hidden { display: none !important; }

/* Message renvoyé par le serveur après l'envoi d'un formulaire. */
.form-feedback { margin: 0 0 24px; padding: 16px; border-radius: 8px; font-weight: 600; font-size: 0.95rem; }
.form-feedback.success { background: #e6f4ea; color: #1e7e34; border: 1px solid #a3d9b1; }
.form-feedback.error { background: #fdecea; color: #b3261e; border: 1px solid #f0b4ae; }

/* ============================================================
   BANDEAU COOKIES ET MESURE D'AUDIENCE
   Affiché par assets/js/consent.js, seulement si un identifiant
   de mesure est renseigné dans includes/config.php.
   ============================================================ */
.cookie-banner { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1300; background: var(--primary); color: #e8eef7; box-shadow: 0 -6px 24px rgba(0,0,0,0.25); transform: translateY(110%); transition: transform 0.4s ease-in-out; }
.cookie-banner.show { transform: translateY(0); }
.cookie-inner { max-width: 1250px; margin: 0 auto; padding: 18px 20px; display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.cookie-message { flex: 1 1 380px; }
.cookie-titre { font-family: 'Montserrat', sans-serif; font-size: 1rem; font-weight: 800; color: var(--white); margin: 0 0 6px; }
.cookie-text { font-size: 0.9rem; line-height: 1.55; margin: 0; }
.cookie-text a { color: var(--secondary); text-decoration: underline; }
.cookie-text a:hover { color: var(--white); }
.cookie-actions { display: flex; gap: 12px; flex: none; }
.cookie-banner .btn { padding: 12px 26px; font-size: 0.85rem; min-width: 140px; }
.cookie-refuse { background: transparent; color: var(--white); border-color: rgba(255,255,255,0.55); }
.cookie-refuse:hover { background: var(--white); color: var(--primary); }
.cookie-accept { background: var(--secondary); color: var(--white); box-shadow: 0 4px 15px rgba(1,146,239,0.35); }
.cookie-accept:hover { background: #017bc9; transform: translateY(-2px); }

/* Bouton « Gérer les cookies » du pied de page : il doit se fondre
   parmi les liens légaux qui l'entourent. */
.lien-cookies { background: none; border: none; padding: 0; font: inherit; font-size: 0.9rem; color: #cccccc; cursor: pointer; transition: var(--transition); }
.lien-cookies:hover { color: var(--secondary); }

/* ============================================================
   CARTES GOOGLE MAPS EN ATTENTE DE CONSENTEMENT
   L'iframe n'est jamais dans le HTML livré : assets/js/consent.js
   l'insère après accord, ou au clic sur cet aperçu.
   ============================================================ */
.map-embed { position: relative; width: 100%; height: 100%; background: var(--bg-light); }
.map-embed iframe { width: 100%; height: 100%; border: 0; display: block; }
.map-placeholder { width: 100%; height: 100%; min-height: 220px; border: 0; background: linear-gradient(135deg, #e8eef7, #d7e3f3); color: var(--primary); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 24px; text-align: center; cursor: pointer; font-family: 'Open Sans', sans-serif; }
.map-placeholder i { font-size: 2rem; color: var(--secondary); }
.map-placeholder strong { font-family: 'Montserrat', sans-serif; font-size: 0.95rem; }
.map-placeholder span { font-size: 0.82rem; line-height: 1.5; max-width: 320px; color: var(--text); }
.map-placeholder:hover { background: linear-gradient(135deg, #dfe8f5, #cbdbf0); }

/* ============================================================
   RESPONSIVE : bascule sur le menu burger
   ============================================================ */
@media (max-width: 1120px) {
    .top-bar { display: none; }
    :root { --total-header-height: var(--header-height); }
    /* Burger a gauche, logo juste apres */
    .nav-container { justify-content: flex-start; gap: 12px; position: relative; }
    .mobile-menu-btn { display: block; position: static; order: 1; padding-left: 0; padding-right: 6px; }
    .logo-wrapper { align-items: flex-start; order: 2; }
    .logo-img { height: 35px; margin-left: -17px; }
    .logo-text { text-align: left; font-size: 0.60rem;}

    .main-nav {
        position: fixed; top: 0; left: -100%; width: 85%; max-width: 350px; height: 100vh;
        background-color: var(--primary); flex-direction: column; align-items: flex-start;
        padding: 0 0 40px; transition: left 0.4s cubic-bezier(0.77, 0.2, 0.05, 1);
        z-index: 1002; box-shadow: 10px 0 20px rgba(0,0,0,0.2); overflow-y: auto;
    }
    .main-nav.active { left: 0; }
    .menu-overlay.active { display: block; opacity: 1; }

    /* Quand le menu est ouvert : on masque le logo et le burger du header
       pour éviter tout chevauchement et toute interception de clic sur la croix */
    body.menu-open .site-header .logo-wrapper { visibility: hidden; }
    body.menu-open .mobile-menu-btn { display: none; }

    /* En-tête sticky du menu : reste en haut, les liens défilent dessous */
    .mobile-menu-header {
        display: flex; align-items: center; justify-content: space-between;
        width: 100%; position: sticky; top: 0; z-index: 3;
        background-color: var(--primary); padding: 18px 20px 18px 25px;
        border-bottom: 1px solid rgba(255,255,255,0.14);
        box-shadow: 0 6px 12px rgba(0,0,0,0.15);
    }
    .mobile-menu-logo { display: flex; flex-direction: column; align-items: flex-start; text-align: left; line-height: 1; }
    .mobile-menu-logo img { height: 34px; width: auto; object-fit: contain; margin-bottom: 5px; margin-left: -17px; }
    .mobile-menu-logo span { color: var(--white); font-family: 'Montserrat', sans-serif; font-size: 0.58rem; text-transform: uppercase; letter-spacing: 1px; font-weight: 800; }
    .mobile-menu-close { position: relative; z-index: 4; }

    .nav-links { flex-direction: column; width: 100%; align-items: flex-start; margin: 0; gap: 25px; padding: 28px 30px 0; }
    .nav-links li { width: 100%; border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 15px;}
    .nav-links li a { font-size: 1.1rem; display: block; width: 100%; color: var(--white); }
    .nav-links li a.is-active { color: var(--secondary); }
    .nav-links li a::after { display: none; }

    .mobile-contact-block { display: flex; flex-direction: column; margin-top: 40px; width: 100%; gap: 20px; padding: 0 30px; }
    .mobile-contact-block .phone-link { color: var(--white); font-size: 1.3rem; font-weight: 700; display: flex; align-items: center; gap: 10px; }
    .mobile-contact-block .phone-link i { color: var(--secondary); }
    .mobile-contact-block .btn { width: 100%; }

    .page-hero { padding: 48px 0 80px; }
    .page-hero h1 { font-size: 2rem; }
    .page-hero .lead { font-size: 1rem; }
    .section-title { font-size: 2rem; }
    .section-padding { padding: 60px 0; }
    /* Barre CTA sticky en bas d'écran sur mobile */
    .mobile-sticky-cta {
        display: flex; position: fixed; bottom: 0; left: 0; width: 100%; z-index: 990;
        box-shadow: 0 -4px 15px rgba(0,0,0,0.15);
    }
    .mobile-sticky-cta a { flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 15px 10px; font-family: 'Montserrat', sans-serif; font-weight: 800; text-transform: uppercase; font-size: 0.85rem; color: var(--white); }
    .mobile-sticky-cta .sticky-call { background-color: var(--primary); }
    .mobile-sticky-cta .sticky-quote { background-color: var(--secondary); }
    body { padding-bottom: 56px; } /* évite que la barre masque le footer */
}

@media (max-width: 1120px) {
  .cookie-banner { bottom: 56px; }
}
@media (max-width: 600px) {
  .cookie-inner { padding: 14px 16px; gap: 14px; }
  .cookie-actions { width: 100%; }
  .cookie-actions .btn { flex: 1; min-width: 0; }
}

/* --- MENU : réduction progressive, jamais en dessous de 0.74rem --- */
@media (max-width: 1240px) {
    .nav-links { gap: 15px; }
    .nav-links li a { font-size: 0.78rem; letter-spacing: 0.3px; }
}
@media (max-width: 1160px) {
    .nav-links { gap: 12px; }
    .nav-links li a { font-size: 0.74rem; letter-spacing: 0.2px; }
}
/* En dessous de 1120px : bascule sur le menu burger, taille lisible retablie */
@media (max-width: 1120px) {
    .nav-links { gap: 25px; }
    .nav-links li a { font-size: 1.1rem; letter-spacing: 0.5px; }
}

@media print {
  .cookie-banner, .mobile-sticky-cta, .header-wrapper { display: none; }
}
