@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700;800&display=swap');

:root {
    --green: #7BB942;
    --green-light: #A8D45E;
    --green-dark: #5A9C2C;
    --blue: #5A9CB8;
    --blue-dark: #1E5C8B;
    --orange: #E85A2C;
    --red: #E94B4B;
    --grey: #6b7280;
    --grey-2: #9ca3af;
    --grey-light: #f3f4f6;
    --bg: #f7fbf3;
    --border: #e5e7eb;
    --shadow-sm: 0 1px 3px rgba(30, 92, 139, 0.06);
    --shadow-md: 0 8px 24px rgba(30, 92, 139, 0.08);
    --shadow-lg: 0 24px 60px rgba(30, 92, 139, 0.14);
}

*, *::before, *::after { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Poppins', system-ui, -apple-system, sans-serif;
    color: #2a3a4d;
    background: white;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

a { color: var(--blue-dark); }

/* === Skip link RGAA === */
.skip-link {
    position: absolute;
    top: -100px; left: 1rem;
    background: var(--green); color: white;
    padding: 0.7rem 1.2rem;
    border-radius: 0 0 0.5rem 0.5rem;
    text-decoration: none; font-weight: 600;
    z-index: 1000;
    transition: top 0.2s;
}
.skip-link:focus { top: 0; }
:focus-visible { outline: 3px solid var(--green); outline-offset: 2px; border-radius: 4px; }
button:focus-visible, a.btn:focus-visible { outline-offset: 4px; }
#main-content:focus { outline: none; }

/* === Bandeau alerte === */
.alert-banner {
    background: var(--red); color: white;
    padding: 0.7rem 1.5rem;
    text-align: center; font-weight: 600; font-size: 0.95rem;
}

/* === Header === */
/* IMPORTANT : sur mobile, le header est position:relative (pas sticky) car
   position:sticky crée un stacking context qui emprisonne le drawer (position:fixed)
   sous le backdrop. On accepte que le header scrolle avec la page sur mobile. */
.site-header {
    background: white;
    border-bottom: 1px solid rgba(30, 92, 139, 0.08);
    position: relative;
}
/* Sticky + glassmorphism uniquement sur desktop */
@media (min-width: 1001px) {
    .site-header {
        background: rgba(255, 255, 255, 0.85);
        position: sticky; top: 0;
        z-index: 100;
        backdrop-filter: saturate(180%) blur(12px);
        -webkit-backdrop-filter: saturate(180%) blur(12px);
    }
}
.header-inner {
    display: flex; align-items: center; justify-content: space-between;
    gap: 2rem; padding: 1.4rem 2.5rem;
    max-width: 1400px; margin: 0 auto;
}
.brand { display: flex; align-items: center; text-decoration: none; flex-shrink: 0; transition: transform 0.3s; }
.brand:hover { transform: scale(1.02); }
.brand img { height: 130px; width: auto; display: block; }
@media (max-width: 1300px) { .brand img { height: 110px; } }
@media (max-width: 1100px) { .brand img { height: 95px; } }
/* Sur mobile, on garde une hauteur de boîte modérée (header pas étiré)
   mais on agrandit visuellement le logo via transform: scale().
   transform-origin: left center → le logo grossit vers la droite/bas
   sans pousser les boutons du header (burger, phone). */
@media (max-width: 900px)  {
    .brand img {
        height: 60px;
        transform: scale(1.5);
        transform-origin: left center;
    }
    .header-inner { padding: 0.55rem 1rem; overflow: visible; }
    .site-header { overflow: visible; }
}
@media (max-width: 600px)  {
    .brand img {
        height: 52px;
        transform: scale(1.55);
    }
}
@media (max-width: 400px)  {
    .brand img {
        height: 46px;
        transform: scale(1.4);
    }
}

/* =========================================================
   HEADER — single row sobre, hiérarchie pro (1 seule CTA colorée)
   ========================================================= */
.header-inner {
    max-width: 1500px;
    gap: 1.5rem;
    padding: 1rem 2rem;
}

/* Bloc d'actions à droite — gap fin pour groupement visuel */
.header-actions {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

/* =========================================================
   PILULES FLOTTANTES (téléphone + Contact)
   Positionnées en bas à droite du header, chevauchent le hero
   façon maquette pour donner une "épaisseur" à la composition.
   ========================================================= */
.header-overhang {
    position: absolute;
    bottom: 0;
    right: 2rem;
    transform: translateY(50%);   /* moitié dans le header, moitié dans le hero */
    display: flex;
    align-items: center;
    gap: 0.6rem;
    z-index: 20;
}

/* Pilule téléphone — vert plein, ombre verte douce */
.overhang-phone {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 1.3rem 0.55rem 0.45rem;
    border-radius: 999px;
    background: var(--green, #7BB942);
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    font-size: 1rem;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    box-shadow: 0 14px 28px -10px rgba(123, 185, 66, 0.55),
                0 4px 10px -4px rgba(123, 185, 66, 0.35);
    transition: background 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}
.overhang-phone:hover {
    background: var(--green-dark, #5a9a2e);
    transform: translateY(-2px);
    box-shadow: 0 20px 36px -10px rgba(123, 185, 66, 0.6),
                0 6px 12px -4px rgba(123, 185, 66, 0.4);
}
.overhang-phone-icon {
    display: inline-grid; place-items: center;
    width: 32px; height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    flex-shrink: 0;
}

/* Pilule Contact — bleu plein, ombre bleue */
.overhang-contact {
    display: inline-flex;
    align-items: center;
    padding: 0.85rem 1.8rem;
    border-radius: 999px;
    background: var(--blue, #1e6aa8);
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    font-size: 1rem;
    box-shadow: 0 14px 28px -10px rgba(30, 106, 168, 0.55),
                0 4px 10px -4px rgba(30, 106, 168, 0.35);
    transition: background 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}
.overhang-contact:hover {
    background: var(--blue-dark, #163d6b);
    transform: translateY(-2px);
    box-shadow: 0 20px 36px -10px rgba(30, 106, 168, 0.6),
                0 6px 12px -4px rgba(30, 106, 168, 0.4);
}

/* === Réseaux sociaux : tout petits cercles outline, discrets === */
.header-socials {
    display: flex;
    gap: 0.25rem;
    align-items: center;
}
.header-social-icon {
    display: inline-flex;
    align-items: center; justify-content: center;
    width: 30px; height: 30px;
    border-radius: 50%;
    background: transparent;
    color: var(--blue-dark, #163d6b);
    border: 1px solid rgba(15, 30, 60, 0.15);
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.header-social-icon:hover {
    background: var(--blue-dark, #163d6b);
    color: #fff;
    border-color: var(--blue-dark, #163d6b);
    transform: translateY(-1px);
}
.header-social-icon svg { width: 14px; height: 14px; }
/* Variante CityKomi : logo officiel orange (image), pas de fond */
.header-social-icon--citykomi {
    background: transparent;
    border: 0;
    overflow: hidden;
    padding: 0;
}
.header-social-icon--citykomi img {
    width: 100%; height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}
.header-social-icon--citykomi:hover {
    background: transparent;
    border: 0;
    transform: translateY(-1px) scale(1.05);
}

/* === Compte : pilule subtile avec avatar coloré === */
.header-account-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.25rem 0.9rem 0.25rem 0.25rem;
    border-radius: 999px;
    background: rgba(15, 30, 60, 0.05);
    color: var(--blue-dark, #163d6b);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.88rem;
    line-height: 1;
    transition: background 0.15s, color 0.15s;
}
.header-account-pill:hover { background: var(--blue-dark, #163d6b); color: #fff; }
.header-account-avatar {
    width: 26px; height: 26px;
    border-radius: 50%;
    background: var(--green, #7BB942);
    color: #fff;
    display: grid; place-items: center;
    font-size: 0.8rem; font-weight: 700;
    flex-shrink: 0;
}
.header-account-avatar--guest { background: var(--blue, #1e6aa8); }
.header-account-avatar--guest svg { display: block; }

/* Badge admin (staff connecté) */
.header-staff-badge {
    display: inline-flex; align-items: center;
    padding: 0.3rem 0.65rem;
    border-radius: 999px;
    background: transparent;
    color: var(--blue-dark, #163d6b);
    border: 1.5px solid var(--blue-dark, #163d6b);
    text-decoration: none;
    font-size: 0.7rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.06em;
    transition: background 0.15s, color 0.15s;
}
.header-staff-badge:hover { background: var(--blue-dark, #163d6b); color: #fff; }

/* =========================================================
   MOBILE — bloc à droite (phone quick-action + burger)
   Visible uniquement < 1001px (cf. .main-nav-desktop hide).
   ========================================================= */
.header-mobile-actions {
    display: none;
    align-items: center;
    gap: 0.4rem;
    flex-shrink: 0;
}
.mobile-phone-btn {
    display: inline-grid;
    place-items: center;
    width: 44px; height: 44px;
    border-radius: 50%;
    background: var(--green, #7BB942);
    color: #fff;
    text-decoration: none;
    box-shadow: 0 4px 12px -4px rgba(123, 185, 66, 0.4);
    transition: background 0.15s ease, transform 0.15s ease;
}
.mobile-phone-btn:hover,
.mobile-phone-btn:active { background: var(--green-dark, #5a9a2e); transform: scale(0.95); }

/* =========================================================
   RESPONSIVE — masque par ordre d'importance décroissante
   ========================================================= */
@media (max-width: 1400px) {
    .overhang-phone-text { display: none; }
    .overhang-phone { padding: 0.55rem 0.45rem; }
}
@media (max-width: 1150px) {
    .header-socials { display: none; }
}
@media (max-width: 1000px) {
    .header-overhang { display: none; }
    .header-actions { display: none; } /* tout passe dans le drawer */
    .header-mobile-actions { display: flex; }
    .header-inner { gap: 0.5rem; padding: 0.6rem 1.25rem; }
}
@media (max-width: 500px) {
    .header-inner { padding: 0.5rem 1rem; }
    .header-mobile-actions { gap: 0.3rem; }
    .mobile-phone-btn { width: 40px; height: 40px; }
}

/* =========================================================
   DRAWER MOBILE — enrichi (compte, contact CTA, sociaux)
   ========================================================= */
.drawer-account {
    padding: 1rem 1.25rem;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid rgba(15, 30, 60, 0.08);
}
.drawer-account-card {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.65rem 0.85rem;
    border-radius: 12px;
    background: var(--green-soft, #f4f9ee);
    color: var(--blue-dark, #163d6b);
    text-decoration: none;
    transition: background 0.15s ease;
}
.drawer-account-card:hover { background: var(--green, #7BB942); color: #fff; }
.drawer-account-card--guest { background: rgba(15, 30, 60, 0.05); }
.drawer-account-card--guest:hover { background: var(--blue-dark, #163d6b); color: #fff; }
.drawer-account-card strong { display: block; font-size: 1rem; line-height: 1.2; }
.drawer-account-card small { display: block; font-size: 0.82rem; opacity: 0.7; margin-top: 0.15rem; }
.drawer-account-avatar {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: var(--green, #7BB942);
    color: #fff;
    display: grid; place-items: center;
    font-size: 1.05rem; font-weight: 700;
    flex-shrink: 0;
}
.drawer-account-avatar--guest {
    background: var(--blue-dark, #1E5C8B);
    color: #fff;
    display: grid; place-items: center;
}
.drawer-account-avatar--guest svg { display: block; }
.drawer-staff-link {
    display: block;
    margin-top: 0.5rem;
    padding: 0.55rem 0.85rem;
    background: transparent;
    border: 1px solid rgba(15, 30, 60, 0.18);
    border-radius: 10px;
    color: var(--blue-dark, #163d6b);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 600;
    text-align: center;
    transition: background 0.15s ease, color 0.15s ease;
}
.drawer-staff-link:hover { background: var(--blue-dark, #163d6b); color: #fff; }

.drawer-footer {
    margin-top: auto;
    padding: 1.25rem;
    border-top: 1px solid rgba(15, 30, 60, 0.08);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.drawer-contact-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.9rem 1.2rem;
    border-radius: 999px;
    background: var(--blue, #1e6aa8);
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    font-size: 1rem;
    transition: background 0.15s ease;
}
.drawer-contact-cta:hover { background: var(--blue-dark, #163d6b); }
.drawer-info {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.55rem;
    color: var(--blue-dark, #163d6b);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 8px;
    transition: background 0.15s ease;
}
.drawer-info:hover { background: rgba(123, 185, 66, 0.08); color: var(--green-dark, #5a9a2e); }
.drawer-socials {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.25rem;
}
.drawer-socials a svg { width: 18px; height: 18px; }
.drawer-socials a {
    display: inline-grid;
    place-items: center;
    width: 38px; height: 38px;
    border-radius: 50%;
    background: rgba(15, 30, 60, 0.05);
    color: var(--blue-dark, #163d6b);
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease;
}
.drawer-socials a:hover { background: var(--blue-dark, #163d6b); color: #fff; }
.drawer-socials a.drawer-social--citykomi { background: transparent; padding: 0; overflow: hidden; }
.drawer-socials a.drawer-social--citykomi img {
    width: 100%; height: 100%;
    object-fit: cover;
    border-radius: 50%;
}
.drawer-socials a.drawer-social--citykomi:hover { background: transparent; transform: scale(1.05); }
/* (.header-account-* — anciennes règles retirées : la pilule Connexion est
   désormais dans le bandeau utilitaire .utility-account) */

.main-nav { position: relative; display: flex; align-items: center; gap: 0.5rem; }
.nav-toggle {
    display: none; background: none;
    border: 1px solid var(--border); border-radius: 0.5rem;
    padding: 0.5rem; width: 42px; height: 42px;
    flex-direction: column; justify-content: space-around; cursor: pointer;
}
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--blue-dark); border-radius: 2px; }

.nav-list { display: flex; list-style: none; margin: 0; padding: 0; gap: 0.2rem; align-items: center; }
.nav-list > li { position: static; }
.nav-link {
    display: inline-block; padding: 0.55rem 0.9rem;
    color: var(--blue-dark); text-decoration: none;
    font-weight: 600; font-size: 1rem;
    letter-spacing: -0.005em;
    border: 1.5px solid transparent;
    border-radius: 999px;
    white-space: nowrap;
    transition: border-color 0.18s ease, color 0.18s ease, background 0.18s ease;
}
/* Items NON-vedette : aucun changement visuel sur la pilule au survol.
   Seul le chevron pivote (géré plus bas par la règle dédiée). */

/* === Item "vedette" (Démarches) — contour navy permanent au repos === */
.nav-list > li.is-featured > .nav-link {
    border-color: var(--blue-dark);
}
/* Démarches au survol / ouvert : pilule PLEINE navy + texte blanc */
.nav-list > li.is-featured.is-open > .nav-link,
.nav-list > li.is-featured:hover > .nav-link,
.nav-list > li.is-featured:focus-within > .nav-link {
    background: var(--blue-dark);
    color: #fff;
    border-color: var(--blue-dark);
}
.nav-list > li.is-featured.is-open > .nav-link::after,
.nav-list > li.is-featured:hover > .nav-link::after,
.nav-list > li.is-featured:focus-within > .nav-link::after {
    color: #fff;
}

/* ================================================
   MEGA-MENU (style maquette institutionnelle)
   ================================================ */
.main-nav { position: static; }
.site-header { position: sticky; top: 0; z-index: 100; }
.header-inner { position: relative; }

.nav-sub {
    position: absolute;
    top: 100%; left: 50%;
    transform: translateX(-50%) translateY(8px);
    list-style: none; margin: 0;
    padding: 3rem 3.5rem 2.5rem;
    background: #ffffff;
    color: var(--blue-dark);
    border-radius: 0 0 1.8rem 1.8rem;
    box-shadow: 0 25px 60px rgba(15, 30, 60, 0.15), 0 6px 16px rgba(15, 30, 60, 0.06);
    border: 1px solid rgba(15, 30, 60, 0.04);
    border-top: none;

    column-count: 4;
    column-gap: 3.5rem;
    column-fill: balance;

    width: min(1320px, 94vw);

    opacity: 0; visibility: hidden;
    transition: opacity 0.22s, transform 0.22s, visibility 0s 0.22s;
    z-index: 10;
}

/* === Variante NAVY (uniquement pour Démarches) ===
   Tout ce qui est sous .is-featured passe au thème sombre comme la maquette. */
.nav-list > li.is-featured > .nav-sub {
    background: var(--blue-dark, #0e2548);
    color: #fff;
    border: 0;
    box-shadow: 0 25px 60px rgba(8, 18, 32, 0.4), 0 6px 16px rgba(8, 18, 32, 0.18);
}
/* L'ouverture du sous-menu est gérée par JS (hover-intent avec délai de
   fermeture 250ms) — fini les flickers quand la souris traverse le gap.
   Le `:hover` reste actif en CSS comme défense en profondeur et pour les
   navigateurs/contextes sans JS ; le `:focus-within` couvre le clavier. */
@media (min-width: 1001px) {
    .nav-list > li.is-open > .nav-sub,
    .nav-list > li:hover > .nav-sub,
    .nav-list > li:focus-within > .nav-sub {
        opacity: 1; visibility: visible;
        transform: translateX(-50%) translateY(0);
        transition-delay: 0s;
    }
}

/* Quand un sous-menu n'a AUCUNE section (que des liens directs),
   on bascule sur une grille compacte façon "cartes" plutôt qu'un mega-menu
   à colonnes — beaucoup plus lisible (cf. menu Démarches). */
.nav-sub:not(:has(.is-section)) {
    column-count: auto;
    display: grid;
    grid-template-columns: repeat(3, minmax(220px, 1fr));
    gap: 0.9rem;
    width: min(880px, 80vw);
    padding: 1.5rem;
    border-radius: 1.4rem;
}
@media (max-width: 1100px) {
    .nav-sub:not(:has(.is-section)) {
        grid-template-columns: repeat(2, 1fr);
        width: min(640px, 90vw);
    }
}
/* === Cellules de mega-menu (section ou lien direct) === */
.nav-sub > li {
    position: relative;
    break-inside: avoid;
    page-break-inside: avoid;
    -webkit-column-break-inside: avoid;
    margin-bottom: 2rem;
    padding: 0.2rem 0;
    display: block;
}
.nav-sub > li:last-child { margin-bottom: 0; }

/* === Titre de section (thème clair par défaut : barre verte à gauche) === */
.nav-sub .nav-section {
    display: block;
    padding: 0.15rem 0 0.15rem 1rem;
    border-left: 4px solid var(--green);
    margin: 0 0 1rem;
    font-size: 1.45rem;
    font-weight: 800;
    color: #0f1729;
    letter-spacing: -0.025em;
    line-height: 1.15;
    cursor: default;
    white-space: normal;
}

/* === Liens secondaires (thème clair) ===
   Transformation point → tiret au hover via transform: scale() (et pas via
   width/height) pour ne pas reflow le texte sur les libellés qui wrappent. */
.nav-sub .nav-link {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 0.45rem 0;
    color: #374151;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.45;
    white-space: normal;
    border-radius: 0;
    transition: color 0.18s, transform 0.18s;
}
.nav-sub .nav-link::before {
    content: "";
    flex-shrink: 0;
    display: block;
    margin-top: 0.55em;
    width: 5px; height: 5px;
    background: #9ca3af;
    border-radius: 50%;
    transform-origin: center;
    transition: background 0.18s, transform 0.18s, border-radius 0.18s;
}
.nav-sub .nav-link:hover {
    color: var(--green-dark);
    transform: translateX(2px);
}
.nav-sub .nav-link:hover::before {
    background: var(--green);
    transform: scaleX(2.4) scaleY(0.5);
    border-radius: 2px;
}

/* === Overrides thème NAVY (uniquement pour Démarches via .is-featured) === */
.nav-list > li.is-featured .nav-sub .nav-section {
    padding: 0 0 0.7rem;
    border-left: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.18);
    color: #ffffff;
}
.nav-list > li.is-featured .nav-sub .nav-link {
    color: rgba(255, 255, 255, 0.85);
}
/* Bullets blancs (mêmes formes que Ma commune, juste recolorés pour le navy) */
.nav-list > li.is-featured .nav-sub .nav-link::before {
    background: rgba(255, 255, 255, 0.45);
}
.nav-list > li.is-featured .nav-sub .nav-link:hover {
    color: #ffffff;
}
.nav-list > li.is-featured .nav-sub .nav-link:hover::before {
    background: var(--green);
}

/* === Lien direct dans un sous-menu (orphan : pas de section parente) ===
   Carte "premium" avec accent vert à gauche, flèche à droite, hover lift */
.nav-sub > li:not(.is-section) {
    margin-bottom: 0;
    padding: 0;
}
.nav-sub > li:not(.is-section) > .nav-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    padding: 1rem 1.2rem 1rem 1.25rem;
    background: #ffffff;
    border: 1px solid rgba(15, 30, 60, 0.08);
    border-left: 4px solid var(--green);
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    color: var(--blue-dark);
    line-height: 1.3;
    box-shadow: 0 1px 0 rgba(15,23,41,0.03);
    transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease,
                box-shadow 0.18s ease, border-color 0.18s ease;
    width: 100%;
}
/* Variante navy pour les cartes orphelines de Démarches */
.nav-list > li.is-featured .nav-sub > li:not(.is-section) > .nav-link {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-left: 4px solid var(--green);
    color: #ffffff;
    box-shadow: none;
}
.nav-sub > li:not(.is-section) > .nav-link::before {
    display: none; content: none; width: 0; margin: 0;
}
.nav-sub > li:not(.is-section) > .nav-link::after {
    content: "→";
    color: var(--green);
    font-weight: 700;
    font-size: 1.05em;
    transition: transform 0.2s ease, color 0.2s ease;
    flex-shrink: 0;
}
.nav-sub > li:not(.is-section) > .nav-link:hover {
    background: var(--green);
    color: white;
    border-color: var(--green);
    transform: translateY(-2px);
    box-shadow: 0 10px 22px -10px rgba(123,185,66,0.5);
}
.nav-sub > li:not(.is-section) > .nav-link:hover::after {
    color: white;
    transform: translateX(4px);
}

/* Sous-liste (niveau 3) */
.nav-deep {
    list-style: none;
    margin: 0;
    padding: 0;
}
.nav-deep .nav-link {
    padding: 0.3rem 0;
    font-size: 0.92rem;
    color: #374151;
}
.nav-list > li.is-featured .nav-deep .nav-link {
    color: rgba(255, 255, 255, 0.78);
}

/* Pointer (chevron) sur les items qui ouvrent un mega-menu */
.nav-list > li.has-children > .nav-link::after {
    content: ' ⌄';
    color: var(--green);
    font-weight: 700;
    margin-left: 0.3rem;
    font-size: 0.8em;
    transition: transform 0.15s;
    display: inline-block;
}
.nav-list > li.has-children.is-open > .nav-link::after,
.nav-list > li.has-children:hover > .nav-link::after,
.nav-list > li.has-children:focus-within > .nav-link::after {
    transform: rotate(180deg);
}

/* (Hover top-nav géré plus haut avec border-pill) */

/* Search header */
.header-search {
    display: flex; align-items: center; gap: 0;
    margin-left: 0.4rem;
    background: var(--bg);
    border: 1px solid transparent;
    border-radius: 999px;
    padding: 0.2rem 0.2rem 0.2rem 0.85rem;
    transition: all 0.15s;
}
.header-search:focus-within { background: white; border-color: var(--green); box-shadow: 0 0 0 3px rgba(123,185,66,0.15); }
.header-search input {
    width: 160px; border: none; background: transparent;
    padding: 0.4rem 0; font-family: inherit; font-size: 0.85rem;
    color: var(--blue-dark);
}
.header-search input:focus { outline: none; }
.header-search button {
    background: var(--green); color: white;
    width: 32px; height: 32px;
    border: none; border-radius: 50%;
    display: grid; place-items: center;
    cursor: pointer; font-size: 0.85rem;
    transition: background 0.15s;
}
.header-search button:hover { background: var(--green-dark); }

/* ========================================
   Drawer mobile (sibling du header, hors de tout containing block)
   ======================================== */
.nav-drawer {
    /* Caché par défaut ; styles drawer activés sur mobile uniquement */
    display: none;
}
.nav-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 30, 60, 0.5);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s;
    z-index: 199;
    display: none;
}
@media (max-width: 1000px) {
    .nav-backdrop { display: block; }
}
.nav-backdrop.is-open { opacity: 1; pointer-events: auto; }

.nav-close {
    position: absolute;
    top: 0.8rem; right: 0.8rem;
    width: 40px; height: 40px;
    border: none; background: transparent;
    font-size: 2rem; line-height: 1;
    color: var(--blue-dark);
    cursor: pointer;
    border-radius: 50%;
    display: grid; place-items: center;
}
.nav-close:hover { background: var(--bg); }

@media (max-width: 1000px) {
    .header-inner { padding: 0.85rem 1rem; }

    /* Hamburger : 3 lignes qui animent en croix.
       z-index > backdrop (199) pour rester cliquable même drawer ouvert
       et éviter le bug « ouvre → backdrop apparaît dessus → referme ». */
    .nav-toggle {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 5px;
        background: transparent;
        border: none;
        padding: 0;
        width: 44px; height: 44px;
        cursor: pointer;
        position: relative;
        z-index: 1100; /* au-dessus du backdrop (199) ET du drawer (1000) */
    }
    .nav-toggle span {
        display: block;
        width: 26px; height: 3px;
        background: var(--blue-dark);
        border-radius: 3px;
        transition: transform 0.25s, opacity 0.25s;
    }
    .nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
    .nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
    .nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

    /* Drawer mobile : sibling du <header>, donc pas piégé par un containing block */
    .nav-drawer {
        display: flex;
        flex-direction: column;
        position: fixed;
        top: 0; right: 0; bottom: 0;
        width: min(360px, 88vw);
        background: white;
        padding: 3.5rem 0 0;
        overflow-y: auto;
        transform: translateX(100%);
        transition: transform 0.3s ease;
        z-index: 1000;
        box-shadow: -10px 0 30px rgba(15, 30, 60, 0.15);
    }
    .nav-drawer > nav { flex: 1; padding: 0 0.5rem; }
    .nav-drawer.is-open { transform: translateX(0); }

    /* Cacher la nav desktop quand on est en mobile */
    .main-nav-desktop { display: none; }

    body.nav-open { overflow: hidden; }

    /* Liste verticale dans le drawer (scope ciblé) */
    .nav-drawer .nav-list {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
    }
    .nav-drawer .nav-list > li {
        position: static;
        width: 100%;
        border-bottom: 1px solid #e5e7eb;
    }
    .nav-drawer .nav-list > li:last-child { border-bottom: none; }

    .nav-drawer .nav-list > li > .nav-link {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 1rem 1rem;
        font-size: 1.05rem;
        font-weight: 700;
        color: var(--blue-dark);
        border-radius: 0;
    }
    .nav-drawer .nav-list > li:hover > .nav-link,
    .nav-drawer .nav-list > li:focus-within > .nav-link {
        background: var(--bg);
    }

    /* === Chevron qui pivote en × pour TOUS les niveaux qui ont des enfants === */
    .nav-drawer li.has-children > .nav-link::after,
    .nav-drawer li.has-children > .nav-section::after {
        content: '+';
        color: var(--green-dark);
        font-size: 1.4rem;
        font-weight: 400;
        margin-left: 0.5rem;
        transition: transform 0.2s ease;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 1.4rem; height: 1.4rem;
        flex-shrink: 0;
    }
    .nav-drawer li.has-children.is-expanded > .nav-link::after,
    .nav-drawer li.has-children.is-expanded > .nav-section::after {
        transform: rotate(45deg);
    }

    /* === Sous-menus (tous niveaux) : collapsed par défaut, expand sur is-expanded === */
    .nav-drawer .nav-sub,
    .nav-drawer .nav-deep,
    /* Override agressif du theme navy de .is-featured > .nav-sub qui s'applique
       autrement aussi dans le drawer mobile et rend le texte invisible. */
    .nav-drawer .nav-list > li.is-featured > .nav-sub {
        position: static !important;
        opacity: 1 !important; visibility: visible !important; transform: none !important;
        box-shadow: none !important;
        border: none !important;
        padding: 0 !important; margin: 0 !important;
        column-count: 1 !important;
        width: 100% !important; max-width: 100% !important;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
        background: var(--bg, #f7fbf3) !important; /* override navy de is-featured */
        color: var(--blue-dark) !important;
        border-radius: 0;
        display: block !important; /* override grid de .nav-sub:not(:has(.is-section)) */
    }
    /* Réinitialise le styling « cellules de mega-menu » dans le drawer */
    .nav-drawer .nav-sub:not(:has(.is-section)) {
        display: block !important;
        grid-template-columns: none !important;
    }
    /* Override texte navy pour les sous-items de Démarches dans le drawer */
    .nav-drawer .nav-list > li.is-featured .nav-sub .nav-section,
    .nav-drawer .nav-list > li.is-featured .nav-sub .nav-link,
    .nav-drawer .nav-list > li.is-featured .nav-deep .nav-link {
        color: var(--blue-dark) !important;
    }
    .nav-drawer .nav-list > li.is-featured .nav-sub .nav-link::before,
    .nav-drawer .nav-list > li.is-featured .nav-sub > li:not(.is-section) > .nav-link::before,
    .nav-drawer .nav-list > li.is-featured .nav-sub > li:not(.is-section) > .nav-link::after {
        display: none !important; /* puces décoratives du mega-menu retirées en drawer */
    }
    /* Le bouton "Démarches" lui-même : pas de couleur de fond bleue dans le drawer */
    .nav-drawer .nav-list > li.is-featured > .nav-link {
        background: transparent !important;
        color: var(--blue-dark) !important;
    }
    .nav-drawer li.is-expanded > .nav-sub,
    .nav-drawer li.is-expanded > .nav-deep,
    .nav-drawer .nav-list > li.is-featured.is-expanded > .nav-sub {
        max-height: 2500px !important;
        padding: 0.5rem 0.75rem 0.75rem 1.25rem !important;
    }

    /* Layouts internes - propre quel que soit le niveau */
    .nav-drawer .nav-sub > li,
    .nav-drawer .nav-deep > li {
        margin-bottom: 0.4rem;
        display: block;
    }
    .nav-drawer .nav-sub > li:last-child,
    .nav-drawer .nav-deep > li:last-child { margin-bottom: 0; }

    .nav-drawer .nav-sub .nav-section {
        display: flex;
        align-items: center;
        justify-content: space-between;
        font-size: 0.95rem;
        padding: 0.55rem 0.5rem;
        margin: 0.3rem 0;
        border-bottom: 1px solid #e5e7eb;
        color: var(--blue-dark);
        cursor: pointer;
        font-weight: 700;
    }
    .nav-drawer .nav-sub .nav-link {
        display: flex;
        align-items: center;
        justify-content: space-between;
        font-size: 0.95rem;
        padding: 0.55rem 0.5rem;
        color: var(--blue-dark);
        border-radius: 6px;
    }
    .nav-drawer .nav-sub .nav-link:hover,
    .nav-drawer .nav-sub .nav-link:focus { background: rgba(123, 185, 66, 0.12); }
    .nav-drawer .nav-sub > li:not(.is-section) > .nav-link {
        font-size: 0.98rem; font-weight: 600;
    }

    /* Niveau 3 (.nav-deep) : indenté + plus léger */
    .nav-drawer .nav-deep .nav-link {
        font-size: 0.92rem; font-weight: 500;
        padding: 0.45rem 0.5rem;
        color: #374151;
    }
}

@media (max-width: 500px) {
    .nav-wrap { width: 90vw; }
}

/* === HERO INSTITUTIONNEL — carrousel photo plein écran === */
.hero {
    position: relative;
    overflow: hidden;
    min-height: 78vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4rem 1.5rem 8rem;
    color: white;
    background-color: #1E5C8B;
    text-align: center;
}
.hero-no-image {
    background: linear-gradient(135deg, #1E5C8B 0%, #5A9CB8 60%, #7BB942 130%);
}

/* Carrousel de slides en crossfade */
.hero-slides {
    position: absolute; inset: 0;
    z-index: 0;
}
.hero-slide {
    position: absolute; inset: 0;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 1.6s ease-in-out;
    transform: scale(1.04);
}
.hero-slide.is-active {
    opacity: 1;
    animation: ken-burns 12s ease-in-out forwards;
}
@keyframes ken-burns {
    from { transform: scale(1.04); }
    to   { transform: scale(1.12); }
}

/* Overlay sobre — assez sombre pour lisibilité texte blanc, pas plus */
.hero-overlay {
    position: absolute; inset: 0;
    z-index: 1;
    background:
        linear-gradient(180deg, rgba(0, 0, 0, 0.15) 0%, rgba(0, 0, 0, 0.35) 60%, rgba(0, 0, 0, 0.55) 100%),
        radial-gradient(ellipse at 50% 60%, rgba(30, 92, 139, 0.2) 0%, rgba(30, 92, 139, 0.4) 100%);
    pointer-events: none;
}
.hero-no-image .hero-overlay { background: radial-gradient(ellipse at center, rgba(0,0,0,0.1), rgba(0,0,0,0.3)); }

.hero-inner {
    position: relative;
    z-index: 3;
    max-width: 760px;
    width: 100%;
    margin: 0 auto;
}
@keyframes fade-up {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

.hero h1 {
    font-size: clamp(2.4rem, 5.2vw, 4rem);
    font-weight: 700;
    line-height: 1.08;
    letter-spacing: -0.025em;
    color: white;
    margin: 0 auto 1.25rem;
    text-shadow: 0 2px 30px rgba(0, 0, 0, 0.4);
    max-width: 760px;
    animation: fade-up 1s 0.1s cubic-bezier(0.22, 1, 0.36, 1) backwards;
}
.hero-lead {
    font-size: 1.15rem;
    color: rgba(255, 255, 255, 0.92);
    margin: 0 auto 2.5rem;
    max-width: 560px;
    line-height: 1.55;
    font-weight: 400;
    text-shadow: 0 1px 14px rgba(0, 0, 0, 0.3);
    animation: fade-up 1s 0.25s cubic-bezier(0.22, 1, 0.36, 1) backwards;
}

/* Barre de recherche centrale — élément hero principal */
.hero-search {
    display: flex; align-items: center;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 999px;
    padding: 0.5rem 0.5rem 0.5rem 1.6rem;
    box-shadow: 0 22px 60px rgba(0, 0, 0, 0.28), 0 0 0 1px rgba(255, 255, 255, 0.15) inset;
    margin: 0 auto 1.5rem;
    max-width: 580px;
    transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
    animation: fade-up 1s 0.4s cubic-bezier(0.22, 1, 0.36, 1) backwards;
}
.hero-search:focus-within {
    box-shadow: 0 26px 70px rgba(0, 0, 0, 0.34), 0 0 0 3px rgba(123, 185, 66, 0.5);
    transform: translateY(-1px);
}
.hero-search-icon { color: var(--grey-2); flex-shrink: 0; display: grid; place-items: center; }
.hero-search-icon svg { width: 20px; height: 20px; }
.hero-search input {
    flex: 1; min-width: 0;
    padding: 0.95rem 1rem;
    border: none; background: transparent;
    font-family: inherit; font-size: 1rem;
    color: var(--blue-dark);
}
.hero-search input::placeholder { color: var(--grey-2); }
.hero-search input:focus { outline: none; }
.hero-search button {
    /* Bouton circulaire — verrouillage strict des dimensions pour éviter
       toute déformation iOS Safari (rendu natif, flex stretch, baseline…). */
    width: 48px; height: 48px;
    min-width: 48px; min-height: 48px;
    max-width: 48px; max-height: 48px;
    flex: 0 0 48px;
    aspect-ratio: 1 / 1;
    padding: 0;
    background: var(--blue-dark);
    color: white;
    border: 0;
    border-radius: 50%;
    display: inline-grid; place-items: center;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
    -webkit-appearance: none;
    appearance: none;
    -webkit-tap-highlight-color: transparent;
    box-sizing: border-box;
    line-height: 0;
    font-size: 0; /* évite l'espace baseline issu d'un éventuel text-content */
    align-self: center; /* défensif contre un parent en align-items: stretch */
}
.hero-search button:hover { background: var(--green); transform: rotate(-12deg) scale(1.08); }
.hero-search button svg { width: 18px; height: 18px; }

/* CTA secondaire — sobre, underline minimaliste */
.hero-cta {
    display: inline-flex; align-items: center; gap: 0.5rem;
    color: rgba(255, 255, 255, 0.92);
    text-decoration: none;
    padding: 0.5rem 0.5rem 0.65rem;
    font-weight: 500; font-size: 0.95rem;
    letter-spacing: 0.01em;
    position: relative;
    transition: all 0.25s;
    animation: fade-up 1s 0.55s cubic-bezier(0.22, 1, 0.36, 1) backwards;
}
.hero-cta::after {
    content: '';
    position: absolute;
    bottom: 0.3rem; left: 0.5rem; right: 2rem;
    height: 1px;
    background: rgba(255, 255, 255, 0.55);
    transition: all 0.25s;
}
.hero-cta:hover { color: white; }
.hero-cta:hover::after { background: white; right: 0.5rem; }
.hero-cta svg { width: 16px; height: 16px; transition: transform 0.25s; }
.hero-cta:hover svg { transform: translateX(3px); }

/* Alerte intégrée — pill verte flottante en bas à gauche */
.hero-alert {
    position: absolute;
    left: 2rem;
    bottom: 6rem;
    z-index: 3;
    display: flex; align-items: center; gap: 0.85rem;
    max-width: 380px;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, var(--green-light) 0%, var(--green) 100%);
    color: white;
    border-radius: 999px 1.5rem 1.5rem 999px;
    box-shadow: 0 16px 40px rgba(123, 185, 66, 0.35);
    text-align: left;
    animation: fade-up 0.9s 0.3s cubic-bezier(0.22, 1, 0.36, 1) backwards;
}
.hero-alert-icon {
    flex-shrink: 0;
    width: 36px; height: 36px;
    background: rgba(255, 255, 255, 0.22);
    border-radius: 50%;
    display: grid; place-items: center;
    color: white;
}
.hero-alert-icon svg { width: 20px; height: 20px; }
.hero-alert-text strong {
    display: block;
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.1rem;
}
.hero-alert-text p {
    margin: 0;
    font-size: 0.85rem;
    line-height: 1.35;
    color: rgba(255, 255, 255, 0.95);
}

/* Contrôles du carrousel (flèches + dots) */
.hero-controls {
    position: absolute;
    bottom: 5.5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 4;
    display: flex; align-items: center; gap: 1.25rem;
}
.hero-arrow {
    width: 42px; height: 42px;
    display: grid; place-items: center;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: white;
    cursor: pointer;
    transition: all 0.2s;
}
.hero-arrow:hover { background: rgba(255, 255, 255, 0.22); border-color: rgba(255, 255, 255, 0.4); }
.hero-arrow svg { width: 18px; height: 18px; }

.hero-dots { display: flex; gap: 0.6rem; align-items: center; }
.hero-dot {
    width: 8px; height: 8px;
    background: rgba(255, 255, 255, 0.4);
    border: none; padding: 0;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s;
}
.hero-dot:hover { background: rgba(255, 255, 255, 0.7); }
.hero-dot.is-active {
    background: white;
    width: 28px;
    border-radius: 4px;
}

/* Indicateur scroll */
.hero-scroll {
    position: absolute;
    bottom: 6.5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    width: 44px; height: 44px;
    display: grid; place-items: center;
    color: white;
    background: rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    text-decoration: none;
    animation: scroll-bounce 2s ease-in-out infinite;
    transition: background 0.2s;
}
.hero-scroll:hover { background: rgba(255, 255, 255, 0.3); }
.hero-scroll svg { width: 20px; height: 20px; }
@keyframes scroll-bounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50%      { transform: translateX(-50%) translateY(8px); }
}

/* Vague SVG en double couche (verte + blanche) au bas du hero */
.hero-wave {
    position: absolute;
    bottom: -1px; left: 0; right: 0;
    width: 100%; height: 100px;
    z-index: 2;
    pointer-events: none;
}

@media (max-width: 900px) {
    .hero { min-height: 70vh; padding: 3rem 1.25rem 8rem; }
    .hero h1 { font-size: clamp(2rem, 7vw, 2.6rem); }
    .hero-lead { font-size: 1.05rem; }
    .hero-alert { left: 1rem; right: 1rem; max-width: none; bottom: 8rem; }
    .hero-scroll { display: none; }
    .hero-controls { bottom: 6rem; }
}
@media (max-width: 600px) {
    .hero-alert { font-size: 0.85rem; padding: 0.85rem 1rem; border-radius: 1rem; }
    .hero-search { padding: 0.4rem 0.4rem 0.4rem 1.25rem; }
    .hero-search input { padding: 0.75rem 0.5rem; font-size: 0.95rem; }
    .hero-search button {
        width: 44px !important;
        height: 44px !important;
        min-width: 44px;
        min-height: 44px;
        max-width: 44px;
        max-height: 44px;
        flex: 0 0 44px;
        aspect-ratio: 1 / 1;
    }
    .hero-arrow { display: none; }
}

/* === Sections génériques === */
.home-section { padding: 5rem 1.5rem; }
.section-alt { background: linear-gradient(180deg, #fff 0%, #f8fbf6 100%); }
.section-inner { max-width: 1320px; margin: 0 auto; }
.section-head {
    display: flex; align-items: flex-end; justify-content: space-between;
    gap: 2rem; margin-bottom: 2.5rem; flex-wrap: wrap;
}
.section-head h2 {
    margin: 0;
    font-size: clamp(1.8rem, 3.5vw, 2.4rem);
    font-weight: 800;
    color: var(--blue-dark);
    letter-spacing: -0.025em;
    line-height: 1.1;
}
.section-head h2 em {
    font-style: normal;
    background: linear-gradient(120deg, var(--green) 0%, var(--blue) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.eyebrow {
    display: inline-block;
    font-size: 0.78rem; font-weight: 700;
    color: var(--green-dark);
    text-transform: uppercase; letter-spacing: 0.12em;
    margin-bottom: 0.6rem;
}
.link-arrow {
    display: inline-flex; align-items: center; gap: 0.4rem;
    color: var(--green-dark);
    text-decoration: none;
    font-weight: 600; font-size: 0.92rem;
    transition: gap 0.2s;
}
.link-arrow:hover { gap: 0.7rem; color: var(--green); }
.link-arrow svg { width: 16px; height: 16px; }

/* === Quick links section === */
.quick-links-section {
    position: relative;
    z-index: 5;
    padding: 2rem 1.5rem 3rem;
    background: white;
}
.quick-links {
    max-width: 1320px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}
.ql-card {
    display: flex; align-items: center; gap: 1rem;
    padding: 1.1rem 1.2rem;
    background: white;
    border: 1px solid rgba(30, 92, 139, 0.06);
    border-radius: 1rem;
    text-decoration: none;
    color: inherit;
    box-shadow: var(--shadow-sm);
    transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}
.ql-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(123, 185, 66, 0.3);
}
.ql-icon {
    flex-shrink: 0;
    width: 48px; height: 48px;
    border-radius: 0.85rem;
    display: grid; place-items: center;
    transition: transform 0.25s;
}
.ql-card:hover .ql-icon { transform: scale(1.08) rotate(-3deg); }
.ql-icon svg { width: 24px; height: 24px; }
.ql-icon-green  { background: linear-gradient(135deg, rgba(123,185,66,0.15), rgba(123,185,66,0.25)); color: var(--green-dark); }
.ql-icon-blue   { background: linear-gradient(135deg, rgba(90,156,184,0.15), rgba(90,156,184,0.25)); color: var(--blue-dark); }
.ql-icon-orange { background: linear-gradient(135deg, rgba(232,90,44,0.13), rgba(232,90,44,0.22)); color: var(--orange); }
.ql-icon-teal   { background: linear-gradient(135deg, rgba(123,185,66,0.13), rgba(90,156,184,0.18)); color: var(--blue-dark); }

.ql-text { flex: 1; min-width: 0; }
.ql-text strong { display: block; font-size: 1.02rem; color: var(--blue-dark); font-weight: 700; line-height: 1.2; }
.ql-text small { display: block; color: var(--grey); font-size: 0.82rem; margin-top: 0.2rem; }
.ql-arrow {
    flex-shrink: 0;
    width: 32px; height: 32px;
    border-radius: 50%;
    display: grid; place-items: center;
    color: var(--grey-2);
    transition: all 0.25s;
}
.ql-card:hover .ql-arrow { background: var(--green); color: white; transform: translateX(2px); }
.ql-arrow svg { width: 16px; height: 16px; }

@media (max-width: 600px) {
    .quick-links-section { padding: 1.5rem 1rem 2.5rem; }
    .ql-card { padding: 0.85rem 1rem; gap: 0.75rem; }
    .ql-icon { width: 40px; height: 40px; }
    .ql-icon svg { width: 20px; height: 20px; }
}

/* === Pages génériques === */
.page h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 800; letter-spacing: -0.02em; margin: 1rem 0 1rem; color: var(--blue-dark); }
.page .lead { font-size: 1.1rem; color: var(--grey); margin: 0 0 1.5rem; line-height: 1.55; }
.page-content { font-size: 1rem; line-height: 1.75; color: #2a3a4d; }
.page-content p { margin: 0 0 1rem; }
.page-content h2 { font-size: 1.5rem; margin: 2.25rem 0 0.85rem; color: var(--blue-dark); font-weight: 700; }
.page-content h3 { font-size: 1.2rem; margin: 1.6rem 0 0.6rem; color: var(--blue-dark); font-weight: 600; }
.page-content a { color: var(--blue-dark); text-decoration: underline; text-decoration-color: rgba(30, 92, 139, 0.3); text-underline-offset: 3px; }
.page-content a:hover { text-decoration-color: var(--blue-dark); }
.page-content ul, .page-content ol { padding-left: 1.5rem; margin: 0 0 1rem; }
.page-content li { margin-bottom: 0.4rem; }
.page-content img { max-width: 100%; height: auto; border-radius: 0.6rem; margin: 1rem 0; }
.page-content blockquote { border-left: 4px solid var(--green); padding: 0.5rem 0 0.5rem 1.25rem; color: var(--grey); font-style: italic; margin: 1.5rem 0; }

.breadcrumb { font-size: 0.85rem; color: var(--grey); margin-bottom: 0.5rem; display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; }
.breadcrumb a { color: var(--grey); text-decoration: none; }
.breadcrumb a:hover { color: var(--blue-dark); text-decoration: underline; }
.breadcrumb .sep { color: rgba(0, 0, 0, 0.2); }
.breadcrumb [aria-current="page"] { color: var(--blue-dark); font-weight: 500; }

.children-list { margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--border); }
.children-list h2 { font-size: 0.9rem; color: var(--grey); text-transform: uppercase; letter-spacing: 0.1em; font-weight: 700; margin-bottom: 1rem; }
.children-list ul { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; }
.children-list li { background: white; padding: 1rem 1.25rem; border-radius: 0.7rem; border: 1px solid var(--border); transition: all 0.2s; }
.children-list li:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--green); }
.children-list a { color: var(--blue-dark); font-weight: 600; text-decoration: none; }
.children-list p { margin: 0.4rem 0 0; color: var(--grey); font-size: 0.88rem; }

/* === Actualités === */
.news-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1.5rem; }
.news-card {
    background: white;
    border-radius: 1rem; overflow: hidden;
    border: 1px solid rgba(30, 92, 139, 0.06);
    transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
.news-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.news-card-link { display: block; text-decoration: none; color: inherit; }
.news-cover { aspect-ratio: 16/9; overflow: hidden; background: var(--bg); }
.news-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s; }
.news-card:hover .news-cover img { transform: scale(1.04); }
.news-body { padding: 1.4rem 1.5rem 1.5rem; }
.news-date {
    display: inline-block;
    font-size: 0.72rem; font-weight: 700;
    color: var(--green-dark);
    text-transform: uppercase; letter-spacing: 0.1em;
    margin-bottom: 0.75rem;
    padding: 0.2rem 0.65rem;
    background: rgba(123, 185, 66, 0.12);
    border-radius: 999px;
}
.news-card h2, .news-card h3 {
    margin: 0 0 0.6rem;
    font-size: 1.2rem;
    color: var(--blue-dark);
    font-weight: 700; line-height: 1.3;
}
.news-card p { margin: 0 0 1rem; color: var(--grey); font-size: 0.92rem; line-height: 1.5; }
.news-readmore {
    display: inline-flex; align-items: center; gap: 0.3rem;
    color: var(--green-dark);
    font-weight: 600; font-size: 0.85rem;
    transition: gap 0.2s;
}
.news-card:hover .news-readmore { gap: 0.5rem; }
.news-readmore svg { width: 14px; height: 14px; }

/* === Agenda === */
.events-list { display: flex; flex-direction: column; gap: 0.85rem; }
.events-past { opacity: 0.7; }
.event-card {
    background: white;
    border-radius: 0.85rem;
    border: 1px solid rgba(30, 92, 139, 0.06);
    transition: all 0.2s;
    box-shadow: var(--shadow-sm);
}
.event-card:hover { border-color: var(--green); box-shadow: var(--shadow-md); transform: translateX(4px); }
.event-link {
    display: flex; align-items: stretch;
    text-decoration: none; color: inherit;
}
.event-date {
    flex-shrink: 0;
    width: 90px;
    background: linear-gradient(135deg, rgba(123, 185, 66, 0.08), rgba(90, 156, 184, 0.1));
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    border-right: 1px solid rgba(30, 92, 139, 0.06);
    padding: 1rem;
}
.event-day { font-size: 1.8rem; font-weight: 800; color: var(--blue-dark); line-height: 1; letter-spacing: -0.03em; }
.event-month { font-size: 0.72rem; font-weight: 700; color: var(--green-dark); letter-spacing: 0.1em; margin-top: 0.25rem; }
.event-info { padding: 1rem 1.25rem; flex: 1; }
.event-info h3 { margin: 0 0 0.3rem; font-size: 1.05rem; color: var(--blue-dark); font-weight: 700; }
.event-meta { margin: 0; color: var(--grey); font-size: 0.88rem; }
.event-arrow {
    align-self: center; padding-right: 1.25rem;
    color: var(--grey-2);
    transition: all 0.2s;
}
.event-card:hover .event-arrow { color: var(--green); transform: translateX(4px); }
.event-arrow svg { width: 18px; height: 18px; }
.event-detail-meta {
    background: linear-gradient(135deg, rgba(123, 185, 66, 0.06), rgba(90, 156, 184, 0.08));
    padding: 1rem 1.25rem; border-radius: 0.7rem;
    margin: 1rem 0 1.5rem;
    border-left: 3px solid var(--green);
}
.event-detail-meta p { margin: 0.25rem 0; }

/* === Contact / Form === */
.contact-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 2.5rem; margin-top: 2rem; }
.contact-form .form-row { margin-bottom: 1.1rem; }
.contact-form label { display: block; font-weight: 600; font-size: 0.9rem; color: var(--blue-dark); margin-bottom: 0.4rem; }
.contact-form .required { color: var(--red); }
.contact-form .muted { color: var(--grey); font-weight: 400; }
.contact-form input, .contact-form textarea {
    width: 100%; padding: 0.75rem 1rem;
    border: 1px solid var(--border); border-radius: 0.6rem;
    font-family: inherit; font-size: 0.95rem;
    background: white;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.contact-form input:focus, .contact-form textarea:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(123, 185, 66, 0.15); }
.contact-form textarea { resize: vertical; min-height: 120px; line-height: 1.55; }
.btn-submit {
    display: inline-flex; align-items: center; gap: 0.5rem;
    background: var(--green); color: white; border: none;
    padding: 0.85rem 1.75rem; border-radius: 999px;
    font-family: inherit; font-size: 1rem; font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 8px 22px rgba(123, 185, 66, 0.28);
}
.btn-submit:hover { background: var(--green-dark); transform: translateY(-1px); box-shadow: 0 12px 30px rgba(123, 185, 66, 0.4); }
.legal-note { font-size: 0.78rem; color: var(--grey); margin-top: 0.85rem; line-height: 1.4; }

.alert-success { background: linear-gradient(135deg, rgba(123, 185, 66, 0.12), rgba(123, 185, 66, 0.18)); border: 1px solid rgba(123, 185, 66, 0.3); color: var(--green-dark); padding: 1rem 1.25rem; border-radius: 0.6rem; margin-bottom: 1.5rem; }
.alert-error { background: rgba(233, 75, 75, 0.08); border: 1px solid rgba(233, 75, 75, 0.3); color: var(--red); padding: 1rem 1.25rem; border-radius: 0.6rem; margin-bottom: 1.5rem; }
.alert-error ul { margin: 0.5rem 0 0; padding-left: 1.25rem; }

.contact-info { background: linear-gradient(180deg, var(--bg), #f0f7ec); border-radius: 1rem; padding: 1.75rem; align-self: start; }
.contact-info h2 { margin: 0 0 1rem; font-size: 1.15rem; color: var(--blue-dark); }
.contact-info p { margin: 0 0 1rem; line-height: 1.5; font-size: 0.92rem; }
.contact-info p strong { color: var(--green-dark); display: block; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 0.25rem; }

@media (max-width: 800px) { .contact-grid { grid-template-columns: 1fr; gap: 1.5rem; } }

/* === Plan du site === */
.sitemap-tree ul { list-style: none; padding-left: 1rem; border-left: 2px solid var(--border); margin: 0.5rem 0; }
.sitemap-tree > ul { padding-left: 0; border: none; }
.sitemap-tree li { padding: 0.25rem 0; }
.sitemap-tree a { color: var(--blue-dark); }

/* === Annuaires === */
.directory-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.25rem; margin-top: 2rem; }
.dir-card { background: white; border: 1px solid rgba(30, 92, 139, 0.06); border-radius: 1rem; overflow: hidden; transition: all 0.25s; box-shadow: var(--shadow-sm); }
.dir-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.dir-photo { aspect-ratio: 16/10; overflow: hidden; background: var(--bg); }
.dir-photo img { width: 100%; height: 100%; object-fit: cover; }
.dir-body { padding: 1.25rem 1.5rem; }
.dir-card h3 { margin: 0 0 0.5rem; font-size: 1.1rem; color: var(--blue-dark); font-weight: 700; }
.dir-desc { margin: 0 0 0.85rem; color: var(--grey); font-size: 0.9rem; line-height: 1.5; }
.dir-info { list-style: none; padding: 0; margin: 0; font-size: 0.88rem; }
.dir-info li { margin-bottom: 0.4rem; line-height: 1.4; color: #2a3a4d; }
.dir-info a { color: var(--blue-dark); }

/* === Élus ===
   La page « Vos élus » est désormais entièrement stylée en interne
   (src/Views/public/elus.php). Plus de styles globaux ici pour éviter les conflits
   (ex. role forcé en majuscules, grille à 280px) avec le nouveau trombinoscope. */

/* === Salles communales === */
.rooms-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1.5rem; margin-top: 2rem; }
.room-card { background: white; border: 1px solid var(--border); border-radius: 1rem; overflow: hidden; transition: all 0.25s; }
.room-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.room-link { display: block; text-decoration: none; color: inherit; }
.room-photo { aspect-ratio: 16/10; background: var(--bg); overflow: hidden; }
.room-photo img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s; }
.room-card:hover .room-photo img { transform: scale(1.05); }
.room-photo-empty { display: grid; place-items: center; font-size: 3.5rem; opacity: 0.4; }
.room-body { padding: 1.4rem 1.5rem; }
.room-card h2 { margin: 0 0 0.5rem; font-size: 1.25rem; color: var(--blue-dark); font-weight: 700; }
.room-desc { color: var(--grey); font-size: 0.92rem; line-height: 1.5; margin: 0 0 1rem; }
.room-features { list-style: none; padding: 0; margin: 0 0 1rem; display: flex; flex-wrap: wrap; gap: 0.85rem; font-size: 0.85rem; color: var(--blue-dark); }
.room-features li { background: var(--bg); padding: 0.25rem 0.7rem; border-radius: 999px; }
.room-cta { display: inline-flex; align-items: center; gap: 0.3rem; color: var(--green-dark); font-weight: 600; font-size: 0.92rem; }
.room-card:hover .room-cta { color: var(--green); }

/* Détail salle */
.room-detail { display: grid; grid-template-columns: 1fr 280px; gap: 2rem; margin: 1.5rem 0 3rem; align-items: start; }
.room-detail h2 { font-size: 1.3rem; margin-top: 1.75rem; color: var(--blue-dark); }
.room-hero { aspect-ratio: 16/9; border-radius: 1rem; overflow: hidden; margin-bottom: 1.5rem; }
.room-hero img { width: 100%; height: 100%; object-fit: cover; }
.room-detail-side { position: sticky; top: 5rem; }
.room-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin-bottom: 1rem; }
.room-stats > div {
    background: linear-gradient(135deg, var(--bg), #f0f7ec);
    padding: 1rem; border-radius: 0.7rem; text-align: center;
}
.room-stats strong { display: block; font-size: 1.4rem; color: var(--blue-dark); font-weight: 800; }
.room-stats span { display: block; font-size: 0.78rem; color: var(--grey); margin-top: 0.2rem; }
.room-detail-side p { background: var(--bg); padding: 0.85rem 1rem; border-radius: 0.6rem; margin: 0.5rem 0; font-size: 0.9rem; }
.room-detail-side p strong { display: block; color: var(--green-dark); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 0.25rem; }

/* Formulaire de réservation */
.room-booking { background: linear-gradient(180deg, #fff, var(--bg)); border-radius: 1rem; padding: 2rem 2.25rem; border: 1px solid var(--border); }
.room-booking h2 { margin-top: 0; font-size: 1.4rem; }
.booking-form .form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 700px) {
    .room-detail { grid-template-columns: 1fr; }
    .room-detail-side { position: static; }
    .booking-form .form-grid-2 { grid-template-columns: 1fr; }
    .room-booking { padding: 1.5rem; }
}

/* === Documents === */
.docs-list { list-style: none; padding: 0; margin: 0 0 1.5rem; display: grid; gap: 0.5rem; }
.docs-list li a {
    display: flex; align-items: center; gap: 0.85rem;
    padding: 0.95rem 1.2rem;
    background: white;
    border: 1px solid rgba(30, 92, 139, 0.06);
    border-radius: 0.7rem;
    text-decoration: none;
    color: var(--blue-dark);
    transition: all 0.2s;
}
.docs-list li a:hover { border-color: var(--green); background: var(--bg); transform: translateX(4px); }
.doc-icon { font-size: 1.5rem; flex-shrink: 0; }
.doc-info { display: flex; flex-direction: column; gap: 0.15rem; }
.doc-info strong { font-weight: 700; }
.doc-info small { color: var(--grey); font-size: 0.78rem; }

/* === Pagination === */
.pagination { display: flex; justify-content: center; align-items: center; gap: 0.4rem; margin: 3rem 0 1rem; flex-wrap: wrap; }
.pagination a, .pagination .current {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 40px; height: 40px; padding: 0 0.85rem;
    background: white; border: 1px solid var(--border); border-radius: 0.5rem;
    color: var(--blue-dark); text-decoration: none; font-weight: 600; font-size: 0.9rem;
    transition: all 0.15s;
}
.pagination a:hover { background: var(--bg); border-color: var(--green); color: var(--green-dark); }
.pagination .current { background: var(--green); color: white; border-color: var(--green); box-shadow: 0 4px 12px rgba(123,185,66,0.3); }

/* === Recherche === */
.search-list { list-style: none; padding: 0; margin: 0 0 2rem; }
.search-list li { padding: 1rem 0; border-bottom: 1px solid var(--border); }
.search-list a { color: var(--blue-dark); text-decoration: none; font-size: 1.05rem; font-weight: 600; }
.search-list a:hover { color: var(--green-dark); text-decoration: underline; }
.search-list p { margin: 0.25rem 0 0; color: var(--grey); font-size: 0.9rem; }

/* === Footer === */
.site-footer {
    background: linear-gradient(180deg, #f9fbf6 0%, #f0f7ec 100%);
    border-top: 4px solid var(--green-light);
    margin-top: 4rem;
}
.footer-grid {
    display: grid;
    grid-template-columns: 1.8fr 1fr 1fr 1fr 1fr 1fr;
    gap: 2rem;
    max-width: 1320px; margin: 0 auto;
    padding: 3.5rem 2rem 2.5rem;
}
.footer-col h3 { font-size: 0.72rem; color: var(--green-dark); text-transform: uppercase; letter-spacing: 0.12em; font-weight: 700; margin: 0 0 1.25rem; }
.footer-col p { margin: 0 0 0.75rem; color: var(--grey); font-size: 0.9rem; line-height: 1.55; }
.footer-col p a { color: var(--blue-dark); text-decoration: none; font-weight: 500; }
.footer-col p a:hover { color: var(--green); }
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col ul li { margin-bottom: 0.55rem; }
.footer-col ul a { color: var(--grey); text-decoration: none; font-size: 0.9rem; transition: color 0.15s; }
.footer-col ul a:hover { color: var(--green); }
.footer-cta { color: var(--green-dark) !important; font-weight: 600 !important; }

.footer-brand-name { font-size: 1.4rem; font-weight: 800; color: var(--blue-dark); letter-spacing: -0.02em; margin: 0 0 0.25rem; text-transform: none; }
.footer-brand-tag { color: var(--grey); font-size: 0.7rem; letter-spacing: 0.18em; text-transform: uppercase; margin-bottom: 1.5rem; }
.footer-social { display: flex; gap: 0.5rem; }
.footer-social a {
    width: 42px; height: 42px;
    display: grid; place-items: center;
    background: white;
    border: 1px solid var(--border);
    border-radius: 50%;
    color: var(--blue-dark);
    transition: all 0.25s;
}
.footer-social a:hover { background: var(--green); color: white; border-color: var(--green); transform: translateY(-3px); box-shadow: 0 8px 18px rgba(123,185,66,0.35); }
.footer-social a.footer-social--citykomi { background: transparent; border: 0; padding: 0; overflow: hidden; }
.footer-social a.footer-social--citykomi img {
    width: 100%; height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}
.footer-social a.footer-social--citykomi:hover { background: transparent; border: 0; transform: translateY(-3px) scale(1.05); box-shadow: 0 8px 18px rgba(240, 108, 0, 0.35); }

.footer-bottom { border-top: 1px solid var(--border); padding: 1.25rem 2rem; text-align: center; color: var(--grey); font-size: 0.82rem; }
.footer-bottom p { margin: 0; }

@media (max-width: 1100px) {
    .footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr; }
    .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 800px) {
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 2rem; padding: 2.5rem 1.25rem 1.5rem; }
    .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 500px) { .footer-grid { grid-template-columns: 1fr; } }

/* === Services en ligne === */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}
.service-card {
    display: flex; align-items: flex-start; gap: 1rem;
    padding: 1.1rem 1.2rem;
    background: white;
    border: 1px solid var(--border);
    border-radius: 0.9rem;
    color: var(--blue-dark);
    text-decoration: none;
    transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
}
.service-card:hover {
    transform: translateY(-3px);
    border-color: var(--green-light);
    box-shadow: 0 12px 28px rgba(0,0,0,0.07);
}
.service-card .service-icon {
    flex-shrink: 0;
    width: 44px; height: 44px;
    display: grid; place-items: center;
    background: linear-gradient(135deg, rgba(123,185,66,0.15), rgba(90,156,184,0.18));
    color: var(--green-dark);
    border-radius: 0.7rem;
    transition: transform 0.2s;
}
.service-card:hover .service-icon { transform: scale(1.08) rotate(-3deg); }
.service-card .service-icon svg { width: 22px; height: 22px; }
.service-card strong { display: block; font-size: 0.98rem; margin-bottom: 0.2rem; }
.service-card p { margin: 0; font-size: 0.85rem; color: var(--grey); line-height: 1.4; }
@media (max-width: 600px) {
    .services-grid { grid-template-columns: 1fr; }
    .service-card { padding: 0.9rem 1rem; }
}

/* ============================================
   SHARED COMPONENTS — Public design system
   ============================================ */

/* Page wrapper */
.page-wrap { max-width: 1100px; margin: 2.5rem auto; padding: 0 1.5rem; }
.page-wrap--narrow { max-width: 900px; }
.page-wrap--wide   { max-width: 1320px; }
.page-wrap > h1:first-child,
.page-wrap > header h1 { margin: 0 0 0.5rem; font-size: clamp(1.6rem, 3vw, 2.2rem); letter-spacing: -0.02em; }
.page-wrap .lead { color: var(--grey); font-size: 1.05rem; line-height: 1.55; margin: 0 0 1.5rem; }
.page-wrap > h2,
.page-wrap section > h2 { margin-top: 2.5rem; font-size: 1.4rem; }

/* Typo utilities */
.muted { color: var(--grey); }
.required { color: var(--red); }

/* Cards */
.card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 0.9rem;
    padding: 1.4rem 1.6rem;
}
.card + .card { margin-top: 1rem; }
.card-title {
    margin: 0 0 1rem;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--blue-dark);
}
.card-compact { padding: 1.1rem 1.2rem; }

/* Form rows */
.form-row { margin-bottom: 1rem; }
.form-row label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 500;
    font-size: 0.92rem;
    color: var(--blue-dark);
}
.form-row input,
.form-row textarea,
.form-row select {
    width: 100%;
    padding: 0.7rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    font-family: inherit;
    font-size: 0.95rem;
    background: white;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.form-row input:focus,
.form-row textarea:focus,
.form-row select:focus {
    outline: none;
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(90, 156, 184, 0.15);
}
.form-row input:disabled { background: var(--bg, #f4f6f8); color: var(--grey); }
.form-row textarea { resize: vertical; min-height: 70px; line-height: 1.5; }
.form-row small.muted { display: block; margin-top: 0.3rem; font-size: 0.83rem; }

/* Form grid 2 cols */
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 640px) { .form-grid-2 { grid-template-columns: 1fr; } }

/* Fieldset standard */
fieldset.section {
    border: 1px solid var(--border);
    border-radius: 0.6rem;
    padding: 1rem 1.5rem 0.5rem;
    margin-bottom: 1.5rem;
}
fieldset.section > legend {
    padding: 0 0.5rem;
    font-weight: 600;
    color: var(--blue-dark);
}

/* Buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
    padding: 0.7rem 1.3rem;
    border-radius: 0.5rem;
    border: 1px solid transparent;
    font-family: inherit; font-size: 0.95rem; font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s, transform 0.15s, box-shadow 0.15s;
}
.btn-primary {
    background: var(--blue, #1e6aa8); color: white;
}
.btn-primary:hover { background: var(--blue-dark, #163d6b); transform: translateY(-1px); }
.btn-ghost {
    background: white; color: var(--blue-dark);
    border-color: var(--border);
}
.btn-ghost:hover { background: var(--bg); border-color: var(--blue); }
.btn-danger {
    background: white; color: var(--red);
    border-color: var(--border);
}
.btn-danger:hover { background: var(--red); color: white; border-color: var(--red); }
.btn-block { width: 100%; }
.btn-sm { padding: 0.5rem 0.9rem; font-size: 0.85rem; }

/* Badges (statuts) */
.badge-status {
    display: inline-block;
    padding: 0.25rem 0.7rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
}
.badge-status-pending,
.badge-status-nouveau,
.badge-status-new,
.badge-status-incomplete { background: #fef3c7; color: #92400e; }
.badge-status-in_progress,
.badge-status-en_cours,
.badge-status-info { background: #dbeafe; color: #1e40af; }
.badge-status-approved,
.badge-status-resolu,
.badge-status-published { background: #d1fae5; color: #065f46; }
.badge-status-rejected,
.badge-status-rejete,
.badge-status-cancelled { background: #fee2e2; color: #991b1b; }
.badge-status-draft { background: #f3f4f6; color: #6b7280; }

/* Page layout 2 cols (main + side) */
.layout-2col {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 1.5rem;
    align-items: flex-start;
}
.layout-2col-main { min-width: 0; display: flex; flex-direction: column; gap: 1rem; }
.layout-2col-side { position: sticky; top: 1rem; display: flex; flex-direction: column; gap: 1rem; }
@media (max-width: 880px) {
    .layout-2col { grid-template-columns: 1fr; }
    .layout-2col-side { position: static; }
}

/* Info panel (notice in colored block) */
.info-panel {
    background: linear-gradient(135deg, rgba(90,156,184,0.08), rgba(123,185,66,0.06));
    border-left: 4px solid var(--blue, #1e6aa8);
    border-radius: 0.5rem;
    padding: 1rem 1.2rem;
    margin: 1rem 0;
    font-size: 0.92rem;
}
.info-panel h3 { margin: 0 0 0.4rem; font-size: 0.95rem; }
.info-panel p { margin: 0.3rem 0; }
.info-panel.is-success { background: linear-gradient(135deg, rgba(123,185,66,0.1), rgba(90,156,184,0.05)); border-left-color: var(--green, #7bb942); }

/* ============================================
   AUTH PAGES (login, register, forgot, reset)
   ============================================ */
.auth-page { max-width: 520px; margin: 3rem auto; padding: 0 1.5rem; }
.auth-page--wide { max-width: 580px; }
.auth-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 2.5rem 2rem;
    box-shadow: 0 6px 20px rgba(0,0,0,0.04);
}
.auth-card h1 { margin: 0 0 0.5rem; font-size: 1.6rem; }
.auth-card .lead { margin: 0 0 1.5rem; color: var(--grey); font-size: 0.95rem; }
.auth-card .form-row { margin-bottom: 1rem; }
.auth-card .btn-submit { width: 100%; padding: 0.85rem; background: var(--blue, #1e6aa8); color: white; border: none; border-radius: 0.5rem; font-size: 1rem; font-weight: 600; cursor: pointer; transition: background 0.15s; }
.auth-card .btn-submit:hover { background: var(--blue-dark, #163d6b); }
.auth-card-links { text-align: center; margin: 1rem 0 0; font-size: 0.88rem; }
.auth-card-links a { color: var(--blue, #1e6aa8); text-decoration: none; }
.auth-card-links a:hover { text-decoration: underline; }
.auth-separator { display: flex; align-items: center; gap: 0.8rem; margin: 1.5rem 0; color: var(--grey); font-size: 0.85rem; }
.auth-separator::before, .auth-separator::after { content: ''; flex: 1; height: 1px; background: var(--border); }

@media (max-width: 600px) {
    .auth-page { margin: 1.25rem auto 3rem; padding: 0 1rem; }
    .auth-card { padding: 1.5rem 1.25rem; border-radius: 0.85rem; }
    .auth-card h1 { font-size: 1.4rem; }
    .auth-card .lead { font-size: 0.9rem; }
}

/* ============================================
   MON ESPACE (citizen dashboard)
   ============================================ */
.account-page { max-width: 1200px; margin: 2rem auto 4rem; padding: 0 1.5rem; }
.account-layout { display: grid; grid-template-columns: 260px 1fr; gap: 2rem; align-items: flex-start; }
.account-nav {
    position: sticky; top: 1rem;
    background: white; border: 1px solid var(--border); border-radius: 0.9rem; padding: 1.5rem 1.2rem;
}
.account-nav nav { display: flex; flex-direction: column; gap: 0.2rem; }
.account-nav nav a {
    padding: 0.6rem 0.8rem; border-radius: 0.5rem;
    color: var(--blue-dark); text-decoration: none; font-size: 0.92rem;
    transition: background 0.15s, color 0.15s;
}
.account-nav nav a:hover { background: var(--bg, #f4f6f8); }
.account-nav nav a.is-active { background: var(--blue, #1e6aa8); color: white; font-weight: 600; }
.account-staff-back {
    display: block;
    margin-top: 1.5rem;
    padding: 0.6rem 0.8rem;
    background: rgba(15, 30, 60, 0.04);
    border: 1px solid rgba(15, 30, 60, 0.1);
    border-radius: 0.5rem;
    color: var(--blue-dark);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 600;
    text-align: center;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.account-staff-back:hover { background: var(--blue-dark); color: white; border-color: var(--blue-dark); }

.account-greet {
    display: flex; gap: 0.8rem; align-items: center;
    padding-bottom: 1.2rem; margin-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}
.account-greet strong { display: block; font-size: 0.95rem; color: var(--blue-dark); }
.account-greet small { color: var(--grey); font-size: 0.8rem; }
.account-avatar {
    width: 42px; height: 42px; flex-shrink: 0;
    display: grid; place-items: center;
    background: linear-gradient(135deg, var(--blue, #1e6aa8), var(--green-dark, #4d7d33));
    color: white; font-weight: 700; font-size: 1.1rem;
    border-radius: 50%;
}
.btn-logout {
    width: 100%; padding: 0.6rem;
    background: white; color: var(--red, #c0392b);
    border: 1px solid var(--border); border-radius: 0.5rem;
    font-size: 0.88rem; cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.btn-logout:hover { background: var(--red, #c0392b); color: white; border-color: var(--red, #c0392b); }

.account-main h1 { margin: 0 0 0.5rem; font-size: 1.7rem; }
.account-main .lead { margin: 0 0 2rem; color: var(--grey); }

.account-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; margin-bottom: 2.5rem; }
.account-stat {
    display: flex; align-items: center; gap: 0.9rem;
    padding: 1rem 1.2rem; background: white;
    border: 1px solid var(--border); border-radius: 0.8rem;
    color: inherit; text-decoration: none;
    transition: transform 0.15s, box-shadow 0.15s;
}
.account-stat:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(0,0,0,0.06); }
.account-stat-icon { font-size: 1.6rem; }
.account-stat strong { display: block; font-size: 1.5rem; font-weight: 700; color: var(--blue-dark, #163d6b); }
.account-stat small { color: var(--grey); font-size: 0.85rem; }

.account-block { background: white; border: 1px solid var(--border); border-radius: 0.9rem; padding: 1.4rem 1.6rem; margin-bottom: 1.5rem; }
.account-block header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 1rem; padding-bottom: 0.8rem;
    border-bottom: 1px solid var(--border);
}
.account-block header h2 { margin: 0; font-size: 1.05rem; }
.account-block header a { color: var(--blue, #1e6aa8); font-size: 0.88rem; text-decoration: none; }
.account-block header a:hover { text-decoration: underline; }

.account-list { list-style: none; padding: 0; margin: 0; }
.account-list li {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    padding: 0.8rem 0; border-bottom: 1px solid var(--border);
}
.account-list li:last-child { border-bottom: none; }
.account-list li a, .account-list li > div:first-child { color: inherit; text-decoration: none; flex: 1; }
.account-list li strong { display: block; font-size: 0.95rem; color: var(--blue-dark); }
.account-list li small { color: var(--grey); font-size: 0.82rem; }

.account-empty {
    text-align: center; padding: 3rem 1rem;
    background: var(--bg, #f9fbf6); border-radius: 0.9rem;
}
.account-empty p { margin-bottom: 1.5rem; color: var(--grey); }
.account-empty-actions { display: flex; gap: 0.8rem; justify-content: center; flex-wrap: wrap; }

/* Par défaut (desktop) : label long visible, label court caché */
.account-nav-label--short { display: none; }

/* (Le responsive de l'espace habitant est placé tout à la fin du fichier
   pour passer APRÈS la refonte premium et la messagerie — voir le bloc
   « MON ESPACE — responsive (override final) » plus bas.) */

/* ============================================
   SIGNALEMENT — Form (map) + Show (timeline + conv)
   ============================================ */

/* How it works steps */
.how-it-works {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem; margin: 1.5rem 0;
}
.how-it-works .step {
    display: flex; gap: 0.8rem; align-items: center;
    padding: 0.9rem 1.1rem; background: white;
    border: 1px solid var(--border); border-radius: 0.7rem;
}
.how-it-works .step span {
    display: grid; place-items: center;
    width: 36px; height: 36px;
    background: var(--blue, #1e6aa8); color: white;
    border-radius: 50%; font-weight: 700; flex-shrink: 0;
}
.how-it-works .step strong { display: block; font-size: 0.95rem; color: var(--blue-dark); }
.how-it-works .step small { color: var(--grey); font-size: 0.83rem; }

/* Signaler form grid (form + map side) */
.signaler-grid {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 2rem; align-items: flex-start; margin-top: 2rem;
}
.signaler-form-col, .signaler-map-col {
    background: white; border: 1px solid var(--border);
    border-radius: 0.9rem; padding: 1.5rem;
}
.signaler-map-col { position: sticky; top: 1rem; padding: 1.2rem; }
.signaler-map-col > label { display: block; font-weight: 600; font-size: 0.92rem; color: var(--blue-dark); }
/* z-index: 0 + isolation: isolate → confine les z-index internes de Leaflet
   (panes 200-700) à l'intérieur de .report-map. Le header sticky (z-index:100)
   reste au-dessus de la carte au scroll, plus de chevauchement. */
.report-map {
    height: 420px;
    border-radius: 0.6rem;
    margin-top: 0.5rem;
    position: relative;
    z-index: 0;
    isolation: isolate;
}
.btn-geo {
    padding: 0.5rem 0.9rem;
    background: var(--bg, #f4f6f8);
    border: 1px solid var(--border);
    border-radius: 0.4rem; cursor: pointer; font-size: 0.88rem;
    margin-top: 0.6rem;
    transition: background 0.15s;
}
.btn-geo:hover { background: rgba(90, 156, 184, 0.15); }

/* Signalement detail */
.report-detail { display: grid; grid-template-columns: 1fr 360px; gap: 1.5rem; align-items: flex-start; }
.report-detail-main { display: flex; flex-direction: column; gap: 1rem; min-width: 0; }
.report-detail-side { display: flex; flex-direction: column; gap: 1rem; }

/* Photo gallery */
.photo-gallery {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.5rem; margin-top: 1rem;
}
.photo-gallery img { width: 100%; aspect-ratio: 1/1; object-fit: cover; border-radius: 0.4rem; transition: transform 0.15s; }
.photo-gallery a:hover img { transform: scale(1.03); }

/* Timeline */
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li {
    padding: 0.6rem 0 0.6rem 1.2rem;
    border-left: 2px solid var(--border);
    position: relative;
}
.timeline li::before {
    content: ''; position: absolute;
    left: -7px; top: 0.9rem;
    width: 12px; height: 12px;
    background: var(--blue, #1e6aa8);
    border-radius: 50%;
}
.timeline-date { font-size: 0.82rem; color: var(--grey); }
.timeline-content { margin-top: 0.2rem; }

/* Conversation */
.conversation { display: flex; flex-direction: column; gap: 0.7rem; }
.conv-msg {
    padding: 0.85rem 1.05rem;
    border-radius: 0.7rem;
    max-width: 85%;
}
.conv-citizen { background: var(--bg, #f4f6f8); align-self: flex-start; border-top-left-radius: 0.25rem; }
.conv-admin   { background: rgba(90, 156, 184, 0.12); align-self: flex-end; border-top-right-radius: 0.25rem; }
.conv-meta {
    display: flex; gap: 0.6rem; align-items: baseline;
    font-size: 0.8rem; margin-bottom: 0.3rem;
}
.conv-meta strong { color: var(--blue-dark); }
.conv-body { white-space: pre-wrap; font-size: 0.93rem; line-height: 1.5; color: var(--blue-dark); }

@media (max-width: 880px) {
    .signaler-grid, .report-detail { grid-template-columns: 1fr; }
    .signaler-map-col { position: static; order: -1; }
    .report-map { height: 320px; }
}

/* ============================================
   ASSOCIATIONS
   ============================================ */
.asso-filters {
    display: flex; gap: 0.5rem;
    flex-wrap: wrap; margin: 1.5rem 0 2rem;
}
.asso-filter {
    display: inline-flex; align-items: center; gap: 0.4rem;
    padding: 0.4rem 0.9rem; border-radius: 999px;
    background: var(--bg, #f4f6f8); color: var(--blue-dark);
    text-decoration: none; font-size: 0.9rem;
    transition: background 0.15s, color 0.15s;
}
.asso-filter:hover { background: rgba(90, 156, 184, 0.15); }
.asso-filter.is-active { background: var(--blue, #1e6aa8); color: white; }
.asso-filter-count { font-size: 0.78rem; opacity: 0.7; }

.asso-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}
.asso-card {
    background: white; border: 1px solid var(--border);
    border-radius: 0.8rem; overflow: hidden;
    transition: transform 0.15s, box-shadow 0.15s;
}
.asso-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,0.08); }
.asso-photo {
    display: block; aspect-ratio: 16/10;
    background: linear-gradient(135deg, rgba(90,156,184,0.2), rgba(123,185,66,0.15));
    overflow: hidden;
}
.asso-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.asso-avatar-fallback {
    display: flex; align-items: center; justify-content: center;
    width: 100%; height: 100%; font-size: 3rem; font-weight: 700;
    color: rgba(255, 255, 255, 0.85);
}
.asso-info { padding: 1rem 1.2rem 1.2rem; }
.asso-info h3 { margin: 0.3rem 0 0.4rem; font-size: 1.1rem; }
.asso-info h3 a { color: var(--blue-dark); text-decoration: none; }
.asso-info h3 a:hover { text-decoration: underline; }
.asso-cat {
    display: inline-block; font-size: 0.75rem; text-transform: uppercase;
    letter-spacing: 0.06em; color: var(--blue, #1e6aa8); font-weight: 600;
}
.asso-pres { font-size: 0.85rem; margin: 0.5rem 0 0; }

/* ============================================
   CONSEIL MUNICIPAL
   ============================================ */
.council-upcoming-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem; margin-top: 1rem;
}
.council-upcoming {
    display: flex; gap: 1.2rem; align-items: flex-start;
    padding: 1.2rem; background: white;
    border: 1px solid var(--border); border-radius: 0.8rem;
}
.council-date {
    display: flex; flex-direction: column; align-items: center;
    padding: 0.6rem 0.9rem;
    background: var(--blue, #1e6aa8); color: white;
    border-radius: 0.6rem; min-width: 4rem;
}
.council-day { font-size: 1.6rem; font-weight: 700; line-height: 1; }
.council-month { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; margin-top: 0.2rem; }


/* Association show page */
.asso-show-header { display: flex; gap: 1.5rem; align-items: flex-start; flex-wrap: wrap; margin-bottom: 2rem; }
.asso-show-photo { width: 180px; height: 180px; object-fit: cover; border-radius: 0.8rem; flex-shrink: 0; }
.asso-show-intro { flex: 1; min-width: 240px; }
.asso-show-intro h1 { margin: 0.3rem 0 0.5rem; }
.asso-founding { margin: 0.6rem 0 0; font-size: 0.9rem; }

/* Small utilities */
.prewrap { white-space: pre-wrap; }
.muted.small, small.muted { font-size: 0.85rem; }
.card-subtitle {
    font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.06em;
    color: var(--grey); margin: 1.2rem 0 0.5rem;
}
.legal-note {
    font-size: 0.85rem; color: var(--grey);
    margin-top: 1rem; line-height: 1.5;
}

/* Content prose (HTML sanitisé) */
.content-prose { line-height: 1.7; color: var(--blue-dark); }
.content-prose h2 { margin: 2rem 0 0.8rem; font-size: 1.3rem; }
.content-prose h3 { margin: 1.5rem 0 0.6rem; font-size: 1.1rem; }
.content-prose p { margin: 0 0 1rem; }
.content-prose ul, .content-prose ol { margin: 0 0 1rem 1.5rem; padding: 0; }
.content-prose li { margin-bottom: 0.4rem; }
.content-prose a { color: var(--blue, #1e6aa8); text-decoration: underline; text-underline-offset: 2px; }
.content-prose img { max-width: 100%; border-radius: 0.6rem; margin: 1rem 0; }
.content-prose blockquote {
    border-left: 4px solid var(--green);
    padding: 0.6rem 1rem;
    color: var(--grey);
    font-style: italic;
    margin: 1rem 0;
}

/* Council additional */
.council-upcoming-title { margin: 0; font-size: 1.05rem; color: var(--blue-dark); }
.council-upcoming-meta { margin: 0.3rem 0 0; font-size: 0.9rem; }
.council-upcoming-link { margin: 0.6rem 0 0; font-size: 0.9rem; }
.council-upcoming-link a { color: var(--blue, #1e6aa8); text-decoration: none; }
.council-upcoming-link a:hover { text-decoration: underline; }

.council-past-list {
    display: flex; flex-direction: column;
    background: white; border: 1px solid var(--border); border-radius: 0.9rem;
    overflow: hidden; margin-top: 1rem;
}
.council-past-row {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    padding: 0.9rem 1.2rem;
    border-bottom: 1px solid var(--border);
}
.council-past-row:last-child { border-bottom: none; }
.council-past-row:hover { background: var(--bg, #f9fbf6); }
.council-past-info { flex: 1; min-width: 0; }
.council-past-title {
    display: block;
    font-weight: 600; color: var(--blue-dark); text-decoration: none;
    font-size: 0.98rem;
}
.council-past-title:hover { color: var(--green-dark); }
.council-past-actions { display: flex; gap: 0.4rem; flex-shrink: 0; }

/* Council show */
.council-show-header { margin-bottom: 2rem; }
.council-show-header h1 { margin: 0.5rem 0 0.6rem; }
.council-show-header .lead { margin: 0; }
.card-action { margin-top: 1rem; }

/* Fieldset legend hint (e.g. "(optionnel)") */
.legend-hint { color: var(--grey); font-weight: 400; font-size: 0.88em; }

/* Form grid spacing variant */
.form-grid-row { margin-bottom: 0.5rem; }

/* Checkbox cards grid (services in enrollment) */
.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 0.6rem;
    margin-top: 0.5rem;
}
.checkbox-card {
    display: flex; gap: 0.6rem; align-items: flex-start;
    padding: 0.7rem 0.9rem;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    font-size: 0.92rem;
}
.checkbox-card:hover { background: rgba(123, 185, 66, 0.06); border-color: var(--green-light); }
.checkbox-card input {
    margin-top: 0.2rem;
    width: 16px; height: 16px;
    accent-color: var(--green);
    flex-shrink: 0;
}
.checkbox-card:has(input:checked) { background: rgba(123, 185, 66, 0.1); border-color: var(--green); }

/* Auth helpers */
.auth-card-links a { font-weight: 600; color: var(--blue, #1e6aa8); }
.form-hint-line { display: block; margin-top: 0.3rem; }
.checkbox-inline-label {
    display: flex; gap: 0.5rem; align-items: flex-start;
    font-weight: 400; font-size: 0.9rem; cursor: pointer;
}
.checkbox-inline-label input {
    margin-top: 0.25rem;
    width: 16px; height: 16px;
    accent-color: var(--green);
}

/* Banner email non vérifié */
.verify-banner {
    display: flex; align-items: center; justify-content: space-between;
    gap: 1rem; flex-wrap: wrap;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.08), rgba(245, 158, 11, 0.04));
    border-left-color: #f59e0b;
    margin-bottom: 1.5rem;
}
.verify-banner strong { display: block; margin-bottom: 0.2rem; color: #92400e; }
.verify-banner p { margin: 0; font-size: 0.92rem; color: var(--blue-dark); }
.verify-banner form { flex-shrink: 0; }

/* 404 */
.page-404 {
    max-width: 720px; margin: 5rem auto;
    padding: 2rem 1.5rem; text-align: center;
}
.page-404 h1 {
    font-size: 5rem; font-weight: 800;
    color: var(--green); margin: 0; letter-spacing: -0.04em;
}
.page-404 h2 { margin: 0.5rem 0 1.25rem; font-size: 1.5rem; color: var(--blue-dark); }
.page-404 p { margin-bottom: 2rem; }
.page-404-actions { display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; }

/* =================================================================
   ESPACE HABITANT — refonte premium
   ================================================================= */
.account-page {
    max-width: 1200px;
    margin: 2.5rem auto 5rem;
    padding: 0 1.5rem;
    position: relative;
}
.account-page::before {
    /* Halo coloré subtil en haut */
    content: ''; position: absolute;
    top: -120px; left: 50%; transform: translateX(-50%);
    width: 600px; height: 300px;
    background: radial-gradient(ellipse, rgba(123, 185, 66, 0.12) 0%, transparent 70%);
    pointer-events: none; z-index: -1;
}
.account-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 2.5rem;
    align-items: flex-start;
}

/* === Sidebar premium === */
.account-nav {
    position: sticky; top: 1.5rem;
    background: linear-gradient(180deg, #ffffff 0%, #fafcf8 100%);
    border: 1px solid rgba(15, 30, 60, 0.07);
    border-radius: 18px;
    padding: 1.5rem 1.1rem 1.3rem;
    box-shadow:
        0 12px 32px -16px rgba(15, 30, 60, 0.15),
        0 0 0 1px rgba(15, 30, 60, 0.02);
}
.account-greet {
    display: flex; gap: 0.85rem; align-items: center;
    padding: 0.4rem 0.4rem 1.25rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid rgba(15, 30, 60, 0.06);
}
.account-greet strong { display: block; font-size: 0.98rem; color: var(--blue-dark); font-weight: 700; line-height: 1.2; }
.account-greet small {
    color: var(--grey);
    font-size: 0.78rem;
    display: block; margin-top: 0.15rem;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    max-width: 180px;
}
.account-avatar {
    width: 46px; height: 46px; flex-shrink: 0;
    display: grid; place-items: center;
    background: linear-gradient(135deg, var(--green, #7BB942) 0%, var(--blue-dark, #1E5C8B) 100%);
    color: white; font-weight: 700; font-size: 1.15rem;
    border-radius: 50%;
    box-shadow: 0 6px 14px -4px rgba(30, 92, 139, 0.3);
}
.account-nav nav { display: flex; flex-direction: column; gap: 0.15rem; }
.account-nav nav a {
    position: relative;
    display: flex; align-items: center; gap: 0.65rem;
    padding: 0.65rem 0.85rem;
    border-radius: 10px;
    color: var(--grey, #4a5468);
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 500;
    transition: background 0.15s, color 0.15s;
}
.account-nav nav a:hover {
    background: rgba(15, 30, 60, 0.04);
    color: var(--blue-dark);
}
.account-nav nav a.is-active {
    background: linear-gradient(90deg, rgba(123, 185, 66, 0.14) 0%, rgba(123, 185, 66, 0.04) 100%);
    color: var(--blue-dark);
    font-weight: 600;
}
.account-nav nav a.is-active::before {
    content: ''; position: absolute;
    left: -1.1rem; top: 7px; bottom: 7px;
    width: 3px; background: var(--green); border-radius: 0 3px 3px 0;
}
.account-nav-icon {
    display: inline-grid; place-items: center;
    width: 24px; font-size: 1rem;
    opacity: 0.85;
}
.account-nav nav a.is-active .account-nav-icon { opacity: 1; }
.account-nav-badge {
    display: inline-grid; place-items: center;
    min-width: 20px; height: 20px; padding: 0 0.4rem;
    background: var(--green);
    color: #fff; border-radius: 999px;
    font-size: 0.72rem; font-weight: 700;
    margin-left: auto;
}
.account-staff-back {
    display: flex; align-items: center; justify-content: center; gap: 0.4rem;
    margin-top: 1.25rem;
    padding: 0.6rem 0.8rem;
    background: rgba(30, 92, 139, 0.06);
    border: 1px solid transparent;
    border-radius: 10px;
    color: var(--blue-dark);
    text-decoration: none;
    font-size: 0.84rem;
    font-weight: 600;
    transition: all 0.15s;
}
.account-staff-back:hover { background: var(--blue-dark); color: white; }
.btn-logout {
    width: 100%; padding: 0.6rem;
    background: transparent;
    color: var(--grey);
    border: 1px solid rgba(15, 30, 60, 0.12);
    border-radius: 10px;
    font-size: 0.86rem; font-weight: 500;
    cursor: pointer;
    margin-top: 0.85rem;
    transition: all 0.15s;
    font-family: inherit;
}
.btn-logout:hover { background: var(--red, #E94B4B); color: white; border-color: var(--red, #E94B4B); }

/* === Main premium === */
.account-main h1 {
    margin: 0 0 0.5rem;
    font-size: 1.85rem;
    font-weight: 700;
    color: var(--blue-dark);
    letter-spacing: -0.015em;
}
.account-main .lead { margin: 0 0 2rem; color: var(--grey); font-size: 1rem; }

/* === Cartes statistiques premium === */
.account-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 2.5rem;
}
.account-stat {
    display: flex; align-items: center; gap: 1rem;
    padding: 1.15rem 1.3rem;
    background: #fff;
    border: 1px solid rgba(15, 30, 60, 0.07);
    border-radius: 14px;
    color: inherit; text-decoration: none;
    transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
    box-shadow: 0 4px 14px -8px rgba(15, 30, 60, 0.08);
}
.account-stat:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 32px -12px rgba(15, 30, 60, 0.15);
    border-color: rgba(123, 185, 66, 0.3);
}
.account-stat-icon {
    display: grid; place-items: center;
    width: 48px; height: 48px;
    background: linear-gradient(135deg, var(--green-soft, #f4f9ee) 0%, rgba(123, 185, 66, 0.15) 100%);
    border-radius: 12px;
    font-size: 1.5rem;
}
.account-stat strong {
    display: block;
    font-size: 1.65rem;
    font-weight: 700;
    color: var(--blue-dark);
    line-height: 1;
}
.account-stat small { color: var(--grey); font-size: 0.85rem; }

/* === Blocs (listes récentes) premium === */
.account-block {
    background: #fff;
    border: 1px solid rgba(15, 30, 60, 0.07);
    border-radius: 14px;
    padding: 1.4rem 1.5rem;
    margin-bottom: 1.25rem;
    box-shadow: 0 4px 14px -8px rgba(15, 30, 60, 0.08);
}
.account-block header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 1rem; padding-bottom: 0.85rem;
    border-bottom: 1px solid rgba(15, 30, 60, 0.06);
}
.account-block header h2 {
    margin: 0; font-size: 1rem; font-weight: 700;
    color: var(--blue-dark);
}
.account-block header a {
    color: var(--green-dark, #5a9c2c);
    font-size: 0.86rem;
    text-decoration: none; font-weight: 600;
}
.account-block header a:hover { text-decoration: underline; }

/* === Bandeau "vérifier email" premium === */
.verify-banner {
    background: linear-gradient(135deg, rgba(232, 90, 44, 0.08) 0%, rgba(232, 90, 44, 0.02) 100%);
    border-left: 4px solid var(--orange, #E85A2C);
    border-radius: 0 12px 12px 0;
    padding: 1rem 1.3rem;
    margin-bottom: 1.5rem;
    display: flex; align-items: center; justify-content: space-between;
    gap: 1rem; flex-wrap: wrap;
}
.verify-banner strong { color: var(--blue-dark); display: block; margin-bottom: 0.25rem; }
.verify-banner p { margin: 0; color: var(--grey); font-size: 0.9rem; }

/* =================================================================
   MESSAGERIE — liste + thread
   ================================================================= */
.msg-page-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 1rem; flex-wrap: wrap;
    margin-bottom: 1.5rem;
}
.msg-page-head h1 { margin: 0 0 0.25rem; }
.msg-page-head .lead { margin: 0; color: var(--grey); }

.msg-new-form { margin-bottom: 1.5rem; }
.msg-new-card {
    background: #fff;
    border: 1px solid rgba(15, 30, 60, 0.07);
    border-radius: 14px;
    padding: 1.4rem 1.5rem;
    box-shadow: 0 10px 30px -12px rgba(15, 30, 60, 0.15);
    animation: msg-new-pop 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes msg-new-pop { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
.msg-new-card h3 { margin: 0 0 1rem; color: var(--blue-dark); font-size: 1.05rem; }
.msg-new-card .field { margin-bottom: 1rem; }
.msg-new-card label {
    display: block; font-size: 0.86rem; font-weight: 600;
    color: var(--blue-dark); margin-bottom: 0.4rem;
}
.msg-new-card input[type="text"], .msg-new-card textarea {
    width: 100%;
    padding: 0.7rem 0.9rem;
    border: 1.5px solid rgba(15, 30, 60, 0.1);
    border-radius: 10px;
    font: inherit; font-size: 0.95rem;
    color: var(--blue-dark);
    transition: border-color 0.18s, box-shadow 0.18s;
    box-sizing: border-box;
}
.msg-new-card input:focus, .msg-new-card textarea:focus {
    outline: 0;
    border-color: var(--green);
    box-shadow: 0 0 0 4px rgba(123, 185, 66, 0.15);
}
.msg-new-card textarea { resize: vertical; min-height: 100px; }
.msg-new-actions { display: flex; gap: 0.6rem; justify-content: flex-end; }

/* === Liste des conversations === */
.msg-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.6rem; }
.msg-conv {
    background: #fff;
    border: 1px solid rgba(15, 30, 60, 0.07);
    border-radius: 12px;
    transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
}
.msg-conv:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 24px -14px rgba(15, 30, 60, 0.18);
    border-color: rgba(123, 185, 66, 0.3);
}
.msg-conv.is-unread {
    border-left: 3px solid var(--green);
    background: linear-gradient(90deg, rgba(123, 185, 66, 0.04) 0%, #fff 50%);
}
.msg-conv-link {
    display: flex; align-items: center; gap: 1rem;
    padding: 1rem 1.25rem;
    color: inherit; text-decoration: none;
}
.msg-conv-main { flex: 1; min-width: 0; }
.msg-conv-head { display: flex; align-items: baseline; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.35rem; }
.msg-conv-head h3 {
    margin: 0; font-size: 1rem; font-weight: 600;
    color: var(--blue-dark);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.msg-conv.is-unread .msg-conv-head h3 { font-weight: 700; }
.msg-conv-date { color: var(--grey-2); font-size: 0.78rem; white-space: nowrap; }
.msg-conv-meta { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.msg-status {
    display: inline-block;
    padding: 0.15rem 0.6rem;
    border-radius: 999px;
    font-size: 0.72rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.04em;
}
.msg-status.is-open     { background: rgba(123, 185, 66, 0.15); color: var(--green-dark); }
.msg-status.is-pending  { background: rgba(232, 90, 44, 0.15);  color: var(--orange); }
.msg-status.is-closed   { background: rgba(107, 114, 128, 0.15); color: var(--grey); }
.msg-status.is-archived { background: rgba(15, 30, 60, 0.06); color: var(--grey-2); }
.msg-unread-dot {
    display: inline-block; width: 8px; height: 8px;
    border-radius: 50%; background: var(--green);
    box-shadow: 0 0 0 3px rgba(123, 185, 66, 0.2);
    animation: msg-pulse 2s infinite;
}
@keyframes msg-pulse {
    0%, 100% { box-shadow: 0 0 0 3px rgba(123, 185, 66, 0.2); }
    50%      { box-shadow: 0 0 0 6px rgba(123, 185, 66, 0.1); }
}
.msg-unread-text { color: var(--green-dark); font-size: 0.78rem; font-weight: 600; }
.msg-conv-arrow {
    color: var(--grey-2);
    font-size: 1.5rem; flex-shrink: 0;
    transition: transform 0.18s, color 0.18s;
}
.msg-conv:hover .msg-conv-arrow { color: var(--green-dark); transform: translateX(3px); }

/* === État vide messagerie === */
.msg-empty {
    background: linear-gradient(135deg, rgba(123, 185, 66, 0.03) 0%, rgba(30, 92, 139, 0.03) 100%);
    border: 1px dashed rgba(15, 30, 60, 0.15);
    border-radius: 14px;
    padding: 3rem 2rem;
    text-align: center;
}
.msg-empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.6;
}
.msg-empty h2 { margin: 0 0 0.5rem; font-size: 1.2rem; color: var(--blue-dark); }
.msg-empty p { margin: 0; color: var(--grey); }

/* === Conversation détail (thread) === */
.msg-conv-header {
    background: #fff;
    border: 1px solid rgba(15, 30, 60, 0.07);
    border-radius: 14px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
}
.msg-conv-header h1 {
    margin: 0 0 0.5rem;
    font-size: 1.35rem;
    color: var(--blue-dark);
}
.msg-conv-header .msg-conv-meta { font-size: 0.85rem; }
.msg-conv-header .msg-conv-date { font-size: 0.85rem; }

.msg-thread {
    display: flex; flex-direction: column; gap: 0.85rem;
    margin-bottom: 1.5rem;
}
.msg-bubble {
    max-width: 78%;
    padding: 0.95rem 1.2rem;
    border-radius: 16px;
    background: #fff;
    border: 1px solid rgba(15, 30, 60, 0.07);
    box-shadow: 0 4px 12px -8px rgba(15, 30, 60, 0.1);
}
.msg-bubble.is-mine {
    align-self: flex-end;
    background: linear-gradient(135deg, var(--blue-dark, #1E5C8B) 0%, #2c6ea1 100%);
    color: #fff;
    border: none;
    border-bottom-right-radius: 4px;
    box-shadow: 0 8px 22px -12px rgba(30, 92, 139, 0.5);
}
.msg-bubble.is-staff {
    align-self: flex-start;
    background: linear-gradient(135deg, rgba(123, 185, 66, 0.10) 0%, rgba(123, 185, 66, 0.02) 100%);
    border-color: rgba(123, 185, 66, 0.3);
    border-bottom-left-radius: 4px;
}
.msg-bubble-head {
    display: flex; align-items: baseline; justify-content: space-between;
    gap: 0.6rem; margin-bottom: 0.45rem;
    font-size: 0.78rem;
}
.msg-bubble.is-mine .msg-bubble-author { color: rgba(255, 255, 255, 0.85); font-weight: 600; }
.msg-bubble.is-mine .msg-bubble-date { color: rgba(255, 255, 255, 0.7); }
.msg-bubble.is-staff .msg-bubble-author { color: var(--green-dark); font-weight: 700; }
.msg-bubble.is-staff .msg-bubble-date { color: var(--grey-2); }
.msg-bubble-body { line-height: 1.55; }

/* === Form réponse === */
.msg-reply {
    background: #fff;
    border: 1px solid rgba(15, 30, 60, 0.07);
    border-radius: 14px;
    padding: 1.25rem 1.5rem;
    display: flex; flex-direction: column; gap: 0.65rem;
}
.msg-reply-label {
    font-weight: 600;
    color: var(--blue-dark);
    font-size: 0.92rem;
}
.msg-reply textarea {
    width: 100%; padding: 0.75rem 1rem;
    border: 1.5px solid rgba(15, 30, 60, 0.1);
    border-radius: 10px;
    font: inherit; font-size: 0.95rem;
    color: var(--blue-dark);
    resize: vertical; min-height: 100px;
    transition: border-color 0.18s, box-shadow 0.18s;
    box-sizing: border-box;
}
.msg-reply textarea:focus {
    outline: 0;
    border-color: var(--green);
    box-shadow: 0 0 0 4px rgba(123, 185, 66, 0.15);
}
.msg-reply-actions { display: flex; justify-content: flex-end; }
.msg-archived-notice {
    background: rgba(15, 30, 60, 0.04);
    padding: 1rem 1.25rem;
    border-radius: 10px;
    color: var(--grey); text-align: center;
}

/* =================================================================
   PIÈCES JOINTES (messagerie citoyen)
   ================================================================= */
.msg-attachments {
    display: flex; flex-wrap: wrap; gap: 0.5rem;
    margin-top: 0.6rem;
}
.msg-attach {
    display: inline-flex; align-items: center; gap: 0.5rem;
    padding: 0.45rem 0.75rem;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 8px;
    color: inherit;
    text-decoration: none;
    font-size: 0.85rem;
    transition: background 0.15s;
    max-width: 100%;
}
.msg-bubble.is-staff .msg-attach {
    background: rgba(123, 185, 66, 0.08);
    border-color: rgba(123, 185, 66, 0.25);
    color: var(--blue-dark);
}
.msg-attach:hover { background: rgba(255, 255, 255, 0.3); }
.msg-bubble.is-staff .msg-attach:hover { background: rgba(123, 185, 66, 0.18); }
.msg-attach-icon { font-size: 1rem; flex-shrink: 0; }
.msg-attach-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 200px; }
.msg-attach-size { opacity: 0.7; font-size: 0.75rem; flex-shrink: 0; }

/* Aperçu image */
.msg-attach.is-image {
    padding: 0;
    overflow: hidden;
    width: 200px;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
}
.msg-attach.is-image img {
    width: 100%; max-height: 200px;
    object-fit: cover; display: block;
}
.msg-attach-caption {
    padding: 0.4rem 0.7rem;
    font-size: 0.78rem;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* Bouton "Ajouter PJ" dans les formulaires */
.msg-attach-btn {
    display: inline-flex; align-items: center; gap: 0.4rem;
    padding: 0.55rem 0.9rem;
    background: rgba(15, 30, 60, 0.04);
    border: 1.5px dashed rgba(15, 30, 60, 0.15);
    border-radius: 10px;
    color: var(--blue-dark);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, border-style 0.15s;
}
.msg-attach-btn:hover {
    background: rgba(123, 185, 66, 0.08);
    border-style: solid;
    border-color: rgba(123, 185, 66, 0.4);
}
.msg-attach-files-list {
    display: inline-block;
    margin-left: 0.6rem;
    color: var(--green-dark);
    font-size: 0.82rem;
    font-weight: 500;
}
.msg-reply-files { margin-top: 0.3rem; }
.msg-reply-hint { color: var(--grey-2); font-size: 0.78rem; }

/* =================================================================
   MON ESPACE — responsive (override final, après refonte premium)
   Doit rester EN BAS du fichier pour gagner la cascade CSS face aux
   définitions premium (.account-* ) qui sont ré-écrites plus haut.
   Breakpoint à 1000px pour matcher le passage en mode mobile du header.
   ================================================================= */
@media (max-width: 1000px) {
    /* Garde-fou : pas de scroll horizontal possible sur la page habitant */
    body { overflow-x: hidden; }

    .account-page {
        margin: 1.25rem auto 3rem;
        padding: 0 1rem;
        max-width: 100%;
        overflow: hidden; /* évite que le margin négatif du nav ne déborde */
    }
    .account-page::before { display: none; } /* halo coloré désactivé sur mobile */

    .account-layout {
        grid-template-columns: 1fr !important;
        gap: 1rem;
    }

    /* Sidebar devient une carte d'en-tête avec navigation en pills */
    .account-nav {
        position: static !important;
        padding: 0.85rem 0.9rem !important;
        border-radius: 12px !important;
        background: #fff;
        box-shadow: 0 4px 14px -8px rgba(15, 30, 60, 0.1) !important;
    }

    /* Greet compact */
    .account-greet {
        padding: 0.25rem 0.25rem 0.75rem;
        margin-bottom: 0.75rem;
    }
    .account-greet > div { min-width: 0; flex: 1; } /* permet la troncature email */
    .account-greet strong { font-size: 0.95rem; }
    .account-greet small {
        font-size: 0.76rem;
        max-width: 100%;
        overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
        display: block;
    }
    .account-avatar { width: 38px !important; height: 38px !important; font-size: 1rem !important; }

    /* Nav en grille de 3 colonnes : 2 rangées de pills, tout visible sans scroll */
    .account-nav nav {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 0.4rem !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    .account-nav nav a {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 0.2rem !important;
        padding: 0.55rem 0.4rem !important;
        font-size: 0.75rem !important;
        border-radius: 10px !important;
        background: rgba(15, 30, 60, 0.05) !important;
        font-weight: 600 !important;
        color: var(--blue-dark) !important;
        text-align: center;
        position: relative;
        min-height: 56px;
    }
    .account-nav nav a.is-active {
        background: linear-gradient(135deg, var(--green, #7BB942) 0%, var(--green-dark, #5a9a2e) 100%) !important;
        color: #fff !important;
    }
    .account-nav nav a.is-active::before { display: none; }
    .account-nav-icon { font-size: 1.2rem !important; width: auto !important; opacity: 1 !important; line-height: 1; }

    /* Bascule label long/court : on cache le long sur mobile */
    .account-nav nav .account-nav-label { display: none; }
    .account-nav nav .account-nav-label--short { display: inline; line-height: 1.15; }

    /* Badge non-lu : en haut à droite de la pill */
    .account-nav-badge {
        position: absolute !important;
        top: 4px !important; right: 4px !important;
        margin-left: 0 !important;
        background: var(--red, #c0392b) !important;
        color: #fff !important;
        font-size: 0.68rem !important;
        min-width: 18px; height: 18px;
        padding: 0 5px !important;
        line-height: 18px;
        border-radius: 999px;
    }

    .account-staff-back { margin-top: 0.85rem; padding: 0.5rem 0.7rem; font-size: 0.82rem; }
    .btn-logout { margin-top: 0.8rem; padding: 0.55rem; font-size: 0.84rem; }

    /* Typographie : à cette taille, les titres restent un peu grands → ajuster */
    .account-main h1 { font-size: 1.5rem !important; line-height: 1.25; }
    .account-main .lead { font-size: 0.92rem !important; margin-bottom: 1.3rem !important; }

    /* Stats : 2 colonnes ici, 1 sous 600px */
    .account-stats {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)) !important;
        gap: 0.7rem !important;
        margin-bottom: 1.5rem !important;
    }
    .account-stat { padding: 0.9rem 1rem !important; gap: 0.7rem !important; }
    .account-stat-icon { width: 40px !important; height: 40px !important; font-size: 1.25rem !important; }
    .account-stat strong { font-size: 1.35rem !important; }
    .account-stat small { font-size: 0.8rem; }

    .account-block {
        padding: 1rem 1.1rem !important;
        border-radius: 12px !important;
        margin-bottom: 0.85rem !important;
    }
    .account-block header {
        flex-wrap: wrap;
        gap: 0.35rem;
        margin-bottom: 0.7rem;
        padding-bottom: 0.6rem;
    }
    .account-block header h2 { font-size: 0.95rem !important; }
    .account-block header a { font-size: 0.82rem; }

    .account-list li {
        flex-wrap: wrap;
        gap: 0.35rem 0.7rem;
        padding: 0.75rem 0;
    }
    .account-list li strong { font-size: 0.92rem; }
    .account-list li small { font-size: 0.78rem; line-height: 1.4; }

    .account-empty { padding: 2rem 1rem; }
    .account-empty-actions .btn { flex: 1 1 100%; }

    /* === Messagerie === */
    .msg-page-head { gap: 0.7rem; margin-bottom: 1.2rem; }
    .msg-page-head h1 { font-size: 1.4rem; }
    .msg-page-head .lead { font-size: 0.88rem; }
    .msg-page-head > .btn { width: 100%; }

    .msg-new-card { padding: 1.1rem 1.15rem; border-radius: 12px; }
    .msg-new-card h3 { font-size: 0.98rem; }
    .msg-new-actions { flex-direction: column-reverse; gap: 0.5rem; }
    .msg-new-actions .btn { width: 100%; }

    .msg-conv-link { padding: 0.85rem 1rem; gap: 0.7rem; }
    .msg-conv-head { flex-wrap: wrap; gap: 0.2rem 0.4rem; }
    .msg-conv-head h3 { font-size: 0.94rem; }
    .msg-conv-date { font-size: 0.74rem; }
    .msg-conv-arrow { display: none; }

    .msg-conv-header { padding: 1rem 1.1rem; border-radius: 12px; }
    .msg-conv-header h1 { font-size: 1.15rem; }
    .msg-conv-header .msg-conv-meta { font-size: 0.78rem; }

    .msg-bubble {
        max-width: 92% !important;
        padding: 0.7rem 0.9rem !important;
        border-radius: 14px !important;
    }
    .msg-bubble-head { flex-wrap: wrap; gap: 0.25rem; font-size: 0.72rem; margin-bottom: 0.3rem; }
    .msg-bubble-body { font-size: 0.92rem; line-height: 1.5; }

    .msg-reply { padding: 1rem 1.1rem; border-radius: 12px; gap: 0.5rem; }
    .msg-reply textarea { font-size: 16px; /* évite zoom auto iOS */ }
    .msg-reply-actions { display: flex; }
    .msg-reply-actions .btn { width: 100%; }

    .msg-attach { font-size: 0.82rem; }
    .msg-attach-name { max-width: 130px; }
    .msg-attach.is-image { width: 100%; max-width: 220px; }

    .msg-empty { padding: 2rem 1rem; }
    .msg-empty-icon { font-size: 2.4rem; }
    .msg-empty h2 { font-size: 1.05rem; }

    .verify-banner {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.6rem;
    }
    .verify-banner form .btn { width: 100%; }
}

@media (max-width: 600px) {
    /* Stat cards : 1 colonne empilée sur petit mobile */
    .account-stats { grid-template-columns: 1fr !important; }
}

/* Très petits écrans (≤ 380px) — 2 colonnes au lieu de 3 pour les pills */
@media (max-width: 380px) {
    .account-main h1 { font-size: 1.3rem !important; }
    .account-nav nav { grid-template-columns: repeat(2, 1fr) !important; }
    .account-nav nav a { font-size: 0.78rem !important; padding: 0.5rem 0.4rem !important; min-height: 52px; }
    .account-stat { padding: 0.75rem 0.85rem !important; }
    .account-stat strong { font-size: 1.2rem !important; }
    .account-greet { padding: 0.2rem 0.2rem 0.65rem; }
    .account-greet strong { font-size: 0.9rem; }
    .account-greet small { font-size: 0.72rem; }
}

/* =================================================================
   ANTI-OVERFLOW global — empêche le scroll horizontal causé par
   des chaînes longues (références « SIG-… », adresses, etc.) et les
   enfants flex qui n'ont pas min-width: 0.
   IMPORTANT : on ne met PAS `overflow-x: hidden` sur html/body car
   ça casse `position: sticky` du header. On contraint plutôt les
   conteneurs spécifiques + on force la coupure des chaînes longues.
   ================================================================= */

@media (max-width: 1000px) {
    /* Tous les conteneurs principaux de l'espace habitant restent dans la viewport */
    .account-page,
    .account-layout,
    .account-main,
    .account-nav,
    .account-block,
    .account-stats,
    .account-list,
    .msg-thread,
    .msg-bubble,
    .msg-conv-link {
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
    }

    /* Enfants flex : reset min-width pour qu'ils respectent leur container */
    .account-greet > *,
    .account-list li > *,
    .account-list li a,
    .msg-conv-link > *,
    .msg-conv-main {
        min-width: 0;
    }

    /* Coupure des chaînes longues (références, emails, URLs) */
    .account-list li,
    .account-list li small,
    .account-list li strong,
    .account-greet small,
    .msg-conv-head h3,
    .msg-conv-meta,
    .msg-bubble-body,
    .msg-attach-name,
    .account-main p,
    .account-main .lead {
        overflow-wrap: anywhere;
        word-wrap: break-word;
        word-break: break-word;
    }

    /* Le badge à droite des items list ne pousse plus le contenu */
    .account-list li .badge-status {
        flex-shrink: 0;
        white-space: nowrap;
        margin-left: auto;
    }
    .account-list li { align-items: flex-start; }
    .account-list li a { display: block; }
    .account-list li a strong { display: block; }
    .account-list li a small { display: block; margin-top: 0.15rem; line-height: 1.4; }
}

/* =================================================================
   MENU MOBILE v4 — premium, basé sur <details>/<summary> natifs
   Aucune dépendance JS pour l'accordéon, le navigateur gère tout.
   ================================================================= */
.mnav { padding: 0.3rem 0.4rem 1rem; }
.mnav ul.mnav-list { list-style: none; margin: 0; padding: 0; }

/* Item top-level : carte légère + ombre subtile */
.mnav-list-0 > .mnav-item {
    background: #fff;
    border-radius: 12px;
    margin-bottom: 0.4rem;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(15, 30, 60, 0.04);
    transition: box-shadow 0.18s, transform 0.18s;
}
.mnav-list-0 > .mnav-item:hover { box-shadow: 0 4px 12px -4px rgba(15, 30, 60, 0.1); }
.mnav-list-0 > .mnav-item:last-child { margin-bottom: 0; }

/* Liens simples (sans enfants) */
.mnav .mnav-link {
    display: flex;
    align-items: center;
    padding: 1rem 1.1rem;
    color: var(--blue-dark, #1E5C8B);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 600;
    transition: background 0.15s, color 0.15s;
    -webkit-tap-highlight-color: transparent;
}
.mnav .mnav-link:hover,
.mnav .mnav-link:focus { background: rgba(123, 185, 66, 0.08); color: var(--green-dark, #5a9a2e); outline: none; }
.mnav .mnav-link:active { background: rgba(123, 185, 66, 0.18); }

/* Summary : ligne cliquable du <details> */
.mnav .mnav-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 1rem 1.1rem;
    cursor: pointer;
    list-style: none;
    color: var(--blue-dark, #1E5C8B);
    font-size: 1rem;
    font-weight: 600;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.15s, color 0.15s;
}
.mnav .mnav-summary::-webkit-details-marker { display: none; }
.mnav .mnav-summary::marker { content: ''; }
.mnav .mnav-summary:hover,
.mnav .mnav-summary:focus { background: rgba(123, 185, 66, 0.08); color: var(--green-dark, #5a9a2e); outline: none; }
.mnav .mnav-summary:active { background: rgba(123, 185, 66, 0.18); }

.mnav .mnav-label { flex: 1; min-width: 0; letter-spacing: -0.005em; }

/* Chevron + qui pivote en × quand ouvert */
.mnav .mnav-chevron {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px; height: 26px;
    font-size: 1.5rem; line-height: 1;
    color: var(--green, #7BB942);
    font-weight: 300;
    background: var(--green-soft, #f4f9ee);
    border-radius: 50%;
    transition: transform 0.25s ease, background 0.18s, color 0.18s;
}
.mnav .mnav-details[open] > .mnav-summary .mnav-chevron {
    transform: rotate(45deg);
    background: var(--green, #7BB942);
    color: #fff;
}
.mnav .mnav-details[open] > .mnav-summary {
    color: var(--green-dark, #5a9a2e);
    background: linear-gradient(180deg, rgba(123, 185, 66, 0.10) 0%, rgba(123, 185, 66, 0.02) 100%);
    border-bottom: 1px solid rgba(123, 185, 66, 0.18);
}

/* ===== ITEM VEDETTE : DÉMARCHES (mis en avant) ===== */
.mnav-list-0 > .mnav-item.is-featured {
    background: linear-gradient(135deg, var(--blue-dark, #1E5C8B) 0%, #2c6ea1 100%);
    border-radius: 14px;
    box-shadow: 0 6px 18px -8px rgba(30, 92, 139, 0.5);
    position: relative;
}
.mnav-list-0 > .mnav-item.is-featured > .mnav-details > .mnav-summary,
.mnav-list-0 > .mnav-item.is-featured > .mnav-link {
    color: #fff;
    font-weight: 700;
    font-size: 1.05rem;
}
.mnav-list-0 > .mnav-item.is-featured > .mnav-details > .mnav-summary:hover,
.mnav-list-0 > .mnav-item.is-featured > .mnav-link:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}
.mnav-list-0 > .mnav-item.is-featured .mnav-chevron {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}
.mnav-list-0 > .mnav-item.is-featured .mnav-details[open] > .mnav-summary {
    background: rgba(0, 0, 0, 0.15);
    color: #fff;
    border-bottom-color: rgba(255, 255, 255, 0.15);
}
.mnav-list-0 > .mnav-item.is-featured .mnav-details[open] > .mnav-summary .mnav-chevron {
    background: var(--green, #7BB942);
    color: #fff;
}
/* Sous-items Démarches : fond légèrement plus clair pour le contraste */
.mnav-list-0 > .mnav-item.is-featured .mnav-list-1 {
    background: rgba(0, 0, 0, 0.12);
}
.mnav-list-0 > .mnav-item.is-featured .mnav-list-1 .mnav-summary,
.mnav-list-0 > .mnav-item.is-featured .mnav-list-1 .mnav-link {
    color: rgba(255, 255, 255, 0.92);
    font-weight: 500;
}
.mnav-list-0 > .mnav-item.is-featured .mnav-list-1 .mnav-summary:hover,
.mnav-list-0 > .mnav-item.is-featured .mnav-list-1 .mnav-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

/* ===== Sous-listes (niveau 1+) ===== */
.mnav .mnav-list-1 {
    background: rgba(15, 30, 60, 0.02);
    padding: 0.2rem 0 0.4rem;
}
.mnav .mnav-list-1 > .mnav-item {
    border-top: 1px solid rgba(15, 30, 60, 0.04);
}
.mnav .mnav-list-1 > .mnav-item:first-child { border-top: 0; }
.mnav .mnav-list-1 .mnav-link,
.mnav .mnav-list-1 .mnav-summary {
    padding: 0.7rem 1.1rem 0.7rem 2rem;
    font-size: 0.94rem;
    font-weight: 500;
    position: relative;
}
.mnav .mnav-list-1 .mnav-link::before,
.mnav .mnav-list-1 .mnav-summary::before {
    content: '';
    position: absolute;
    left: 1.1rem;
    top: 50%;
    width: 4px; height: 4px;
    background: var(--green, #7BB942);
    border-radius: 50%;
    transform: translateY(-50%);
}
.mnav .mnav-list-1 .mnav-chevron {
    width: 22px; height: 22px;
    font-size: 1.2rem;
}

/* ===== Niveau 2 (sous-sous-menu) ===== */
.mnav .mnav-list-2 {
    background: transparent;
    padding: 0;
}
.mnav .mnav-list-2 > .mnav-item { border-top: none; }
.mnav .mnav-list-2 .mnav-link,
.mnav .mnav-list-2 .mnav-summary {
    padding: 0.55rem 1.1rem 0.55rem 2.8rem;
    font-size: 0.88rem;
    font-weight: 400;
    color: #374151;
}
.mnav .mnav-list-2 .mnav-link::before,
.mnav .mnav-list-2 .mnav-summary::before {
    left: 2rem;
    background: var(--grey-2, #9ca3af);
}

/* On masque l'ancienne nav HTML qui sert au desktop pour ne pas la voir
   en mode mobile (au cas où elle traînerait dans le drawer) */
.nav-drawer .nav-list { display: none !important; }
