/* ------------------------------------------------------------------
 * CSS Variables
 * ------------------------------------------------------------------ */
:root {
    --bg: #f8fafc;
    --fg: #0f172a;
    --card: #ffffff;
    --stroke: #e2e8f0;
    --brand: #2f8e28;
    --brand-2: #5fea81;
    --err: #b91c1c;
    --warn: #f59e0b;
    --success: #16a34a;
    --ok: #11c26d;
    --danger: #9f0c0c;
    --primary: #BD32D3;
    --primary-2: #6a49ff;
    --violet: #7c3aed;
    --pink: #ec4899;
    --blue: rgb(110, 193, 228);
    --ink: #0f172a;
    --muted: #9aa3b2;
    --text: #5d5d5f;
    --line: rgba(255, 255, 255, 0.08);
    --ring: rgba(124, 58, 237, 0.25);
    --focus: 0 0 0 3px rgba(124, 92, 255, 0.35);
    --border: 1px solid rgba(124, 92, 255, 0.35);
}

/* ------------------------------------------------------------------
 * Reset & base styles
 * ------------------------------------------------------------------ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}


/* Tous les liens du site sans soulignement */
a {
    text-decoration: none;
}

/* Même au hover / focus */
a:hover,
a:focus,
a:active {
    text-decoration: none;
}

.btn,
.nav-link,
.dropdown-menu a {
    text-decoration: none !important;
}

body {
    font-family: "Barlow", sans-serif;
    color: var(--ink);
    background: var(--bg);
    line-height: 1.6;
    margin: 0 !important;
}

/* ------------------------------------------------------------------
 * Header & navigation
 * ------------------------------------------------------------------ */
header.nav,
.header {
    position: sticky;
    top: 0;
    z-index: 9999;
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(8px);
    border-bottom: var(--border);
}

.nav,
.nav-row,
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    /* padding: 14px 0; */
}

.nav {
    background: #fff;
    border-bottom: var(--border);
}

.nav-toggle {
    display: none;
    font-size: 1.5rem;
    background: none;
    border: none;
    cursor: pointer;
}

.nav-actions,
.actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

/* ------------------------------------------------------------------
 * Responsive design
 * ------------------------------------------------------------------ */

/* Large screens (980px and below) */
@media (max-width: 980px) {
    .hero-grid {
        grid-template-columns: 1fr;
    }

    .brand img {
        width: 180px;
        height: auto;
    }
}

/* Medium screens (960px and below) */
@media (max-width: 960px) {

    .form-grid,
    .form-grid--3,
    .grid-3,
    .grid-2,
    .field-grid,
    .field-grid--thirds {
        grid-template-columns: 1fr;
    }

    .map-hero {
        padding: 20px;
    }

    #map {
        height: 300px;
    }
}

/* Tablets (900px and below) */
@media (max-width: 900px) {

    .media-grid,
    .kv,
    .form-grid {
        grid-template-columns: 1fr;
    }
}

/* Small tablets (768px and below) */
@media (max-width: 768px) {
    .nav-row {
        flex-wrap: wrap;
    }

    .nav-actions {
        display: none;
        flex-direction: column;
        width: 100%;
        margin-top: 1rem;
        gap: 0.5rem;
    }

    .nav-actions.active {
        display: flex;
    }

    .nav-toggle {
        display: block;
    }
}

/* Mobile (640px and below) */
@media (max-width: 640px) {

    .actions,
    .cta {
        gap: 8px;
    }

    .btn {
        padding: 10px 16px;
    }

    .brand img {
        width: 48px;
        height: 48px;
    }

    .profile-card,
    .form-card,
    .map-hero,
    .hero {
        padding: 20px;
    }

    .btn,
    .form-actions .btn {
        width: 100%;
        justify-content: center;
    }

    /* nav container */
    .main-nav {
        display: flex;
        align-items: center;
        gap: 1rem;
    }

    /* each top-level item */
    .main-nav>li {
        position: relative;
        list-style: none;
    }

    /* clickable top label */
    .main-nav>li>a,
    .main-nav>li>button {
        display: flex;
        align-items: center;
        gap: .4rem;
        padding: .5rem .75rem;
        border-radius: 6px;
        white-space: nowrap;
    }

    /* submenu container (hidden by default) */
    .main-nav .submenu {
        position: absolute;
        top: 100%;
        left: 0;
        min-width: 200px;
        background: #0f111a;
        border: 1px solid #2a2f3d;
        border-radius: 8px;
        box-shadow: 0 20px 40px rgba(0, 0, 0, .6);
        padding: .5rem 0;
        display: none;
        /* hidden until hover */
        z-index: 9999;
    }

    /* submenu items */
    .main-nav .submenu li {
        list-style: none;
    }

    .main-nav .submenu a {
        display: block;
        padding: .5rem .75rem;
        color: #fff;
        font-size: .9rem;
        line-height: 1.2rem;
        text-decoration: none;
        white-space: nowrap;
    }

    .main-nav .submenu a:hover {
        background: #1a1f2d;
    }

    /* show submenu on hover */
    .main-nav li.has-submenu:hover>.submenu {
        display: block;
    }

    /* caret */
    .caret {
        font-size: .7rem;
        opacity: .7;
    }




}

/* nav container */
.main-nav {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* each top-level item */
.main-nav>li {
    position: relative;
    list-style: none;
}

/* clickable top label */
.main-nav>li>a,
.main-nav>li>button {
    display: flex;
    align-items: center;
    gap: .4rem;
    padding: .5rem .75rem;
    border-radius: 6px;
    white-space: nowrap;
}

/* submenu container (hidden by default) */
.main-nav .submenu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    background: #0f111a;
    border: 1px solid #2a2f3d;
    border-radius: 8px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, .6);
    padding: .5rem 0;
    display: none;
    /* hidden until hover */
    z-index: 9999;
}

/* submenu items */
.main-nav .submenu li {
    list-style: none;
}

.main-nav .submenu a {
    display: block;
    padding: .5rem .75rem;
    color: #fff;
    font-size: .9rem;
    line-height: 1.2rem;
    text-decoration: none;
    white-space: nowrap;
}

.main-nav .submenu a:hover {
    background: #1a1f2d;
}

/* show submenu on hover */
.main-nav li.has-submenu:hover>.submenu {
    display: block;
}

/* caret */
.caret {
    font-size: .7rem;
    opacity: .7;
}


/* -------- Header de base (desktop) -------- */
.nav-toggle {
    display: none;
    /* checkbox caché */
}

.nav-burger {
    display: none;
    /* on ne voit pas le burger sur desktop */
    cursor: pointer;
}

/* -------- Mobile -------- */
/* ----- NAV GLOBAL ----- */

.nav-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    position: relative;
}

.nav-main {
    display: flex;
    align-items: center;
    gap: 16px;
}

.nav-left,
.nav-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Tous les "boutons" du header deviennent visuellement des liens */
.nav a.btn,
.nav button.btn,
.nav .nav-link {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    border-radius: 0;
    padding: 0;
    margin: 0;
    font: inherit;
    color: #4b5563;
    cursor: pointer;
    text-decoration: none;
    text-align: left;
}

.nav .nav-link:hover,
.nav a.btn:hover,
.nav button.btn:hover {
    color: #7c3aed;
    text-decoration: underline;
}

/* Dropdowns */
.dropdown-menu {
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 6px;
    min-width: 200px;
    background: #ffffff;
    border: 1px solid #1f2430;
    border-radius: 10px;
    padding: 8px;
    z-index: 900;
    display: none;
}

.dropdown.open .dropdown-menu {
    display: block;
}

/* Badge rouge admin */
.badge {
    background: #dc2626;
    color: #fff;
    border-radius: 9999px;
    padding: 2px 10px;
    font-size: .75rem;
    margin-left: 6px;
}

/* ----- BURGER ----- */

.nav-toggle {
    display: none;
}

.nav-burger {
    display: none;
    /* caché sur desktop */
    width: 32px;
    height: 32px;
    border-radius: 999px;
    border: 1px solid #e5e7eb;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 4px;
    cursor: pointer;
}

.nav-burger span {
    display: block;
    width: 18px;
    height: 2px;
    background: #111827;
    border-radius: 999px;
}

/* ----- RESPONSIVE ----- */

@media (max-width: 768px) {
    .nav-main {
        /* menu caché tant que le burger n’est pas coché */
        display: none;
        position: absolute;
        top: 56px;
        left: 0;
        right: 0;
        background: #ffffff;
        border-top: 1px solid #e5e7eb;
        box-shadow: 0 10px 30px rgba(15, 23, 42, 0.18);
        padding: 12px 16px;
        z-index: 900;
        flex-direction: column;
        gap: 8px;
    }

    .nav-left,
    .nav-right {
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
        gap: 4px;
    }

    /* liens les uns sous les autres */
    .nav-main .nav-link,
    .nav-main a.btn,
    .nav-main button.btn {
        width: 100%;
        text-align: left;
        padding: 6px 0;
    }

    .nav-burger {
        display: flex;
    }

    /* Quand la checkbox est cochée → affiche le menu */
    .nav-toggle:checked~.nav-burger+.nav-main {
        display: flex;
    }

    /* =========================
    Mobile
    ========================= */
    @media (max-width: 768px) {

        /* Le conteneur de menu (le bloc qui s’ouvre après le burger) 
        doit être vertical */
        .nav .dropdown,
        .nav nav a,
        .nav .dropdown-toggle {
            display: block;
            width: 100%;
        }

        /* On ne fait plus de "flyout" latéral pour les sous-menus :
        ils s’affichent juste en dessous du parent, légèrement indentés. */
        .dropdown-menu {
            position: static;
            /* rentre dans le flux normal */
            left: auto;
            top: auto;
            margin: 6px 0 0 14px;
            /* léger retrait à droite */
            box-shadow: 0 12px 30px rgba(15, 23, 42, 0.10);
            border-radius: 16px;
        }

        /* pour que chaque lien reste bien sur sa propre ligne */
        .dropdown-menu a {
            width: 100%;
            padding: 10px 2px;
            font-size: 1rem;
        }
    }
}

@media (min-width: 769px) {
    .nav-burger {
        display: none;
    }

    .nav-main {
        display: flex;
    }
}

/* Sous-menus : toujours en colonne, un lien par ligne */
/* ===== Sous-menus ===== */
/* =========================
   Dropdown + animation
   ========================= */

.dropdown {
    position: relative;
}

/* État "caché" par défaut */
.dropdown-menu {
    position: absolute;
    left: 100%;
    /* flyout à droite du parent */
    top: 0;
    /* aligné en haut du parent */
    margin-left: -80px;
    /* léger décalage vers la droite */

    /* min-width: 190px; */
    padding: 10px 12px;
    border-radius: 18px;
    background: #ffffff;

    box-shadow: 0 18px 35px rgba(15, 23, 42, 0.18);
    z-index: 9999;

    /* animation */
    opacity: 0;
    transform: translateY(6px);
    pointer-events: none;
    transition:
        opacity 0.18s ease-out,
        transform 0.18s ease-out;
}

/* Quand le parent a .open (géré par ton JS) */
.dropdown.open>.dropdown-menu {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* Liens de menu : toujours en colonne */
.dropdown-menu a {
    display: block;
    width: 100%;
    padding: 8px 4px;
    font-size: 0.98rem;
    color: #374151;
    text-decoration: none;
    /* pas de soulignement */
    white-space: normal;
    /* autorise les retours à la ligne */
}

.dropdown-menu a+a {
    margin-top: 4px;
}

/* Hover propre (pas de underline, juste fond léger) */
.dropdown-menu a:hover {
    background: #f3f4f6;
    border-radius: 8px;
    text-decoration: none;
}



/* --- Bottom nav bar --- */

.bottom-nav-wrapper {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1100;
    pointer-events: none;

}

.bottom-nav {
    max-width: 100%;
    margin: 0 auto;
    background: #fff;
    /* border-radius: 24px 24px 0 0; */
    box-shadow: 0 -4px 12px rgba(0, 0, 0, .12);
    padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
    display: flex;
    justify-content: space-around;
    align-items: center;
    pointer-events: auto;
}

.bottom-nav-item {
    flex: 1 1 0;
    min-width: 0;
    border: none;
    background: transparent;
    text-align: center;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-size: .8rem;
    color: #111827;
    text-decoration: none;
}

.bottom-nav-icon {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

/* Bouton "Plus d'information" */
.bottom-nav-info-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: absolute;
    left: 50%;
    transform: translateX(-50%) translateY(-50%);
    bottom: 65%;
    background: #1b7835;
    color: #fff;
    padding: 8px 22px;
    border-radius: 20px 20px 0 0;
    text-decoration: none;
    font-size: .95rem;
    pointer-events: auto;
}

.bottom-nav-info-chevron {
    font-size: 1.1rem;
}

/* --- Drawers --- */

.nav-drawer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    max-width: 640px;
    margin: 0 auto;
    transform: translateY(100%);
    transition: transform .25s ease-out;
    z-index: 50;
    pointer-events: none;
}

.nav-drawer-inner {
    background: #f6f7f7;
    border-radius: 24px 24px 0 0;
    padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
    box-shadow: 0 -8px 20px rgba(0, 0, 0, .2);
    pointer-events: auto;
}

.nav-drawer.is-open {
    transform: translateY(0);
}

.nav-drawer-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 16px;
    position: relative;
}

.nav-drawer-title {
    font-size: 1.4rem;
    font-weight: 500;
}

.nav-drawer-close {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border-radius: 999px;
    border: none;
    background: #e4e4e4;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
}

.nav-drawer-body {
    display: flex;
    justify-content: space-around;
    align-items: center;
    gap: 24px;
}

.nav-drawer-app {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #111827;
    font-size: .95rem;
}

.nav-drawer-app img {
    width: 64px;
    height: 64px;
    border-radius: 14px;
    object-fit: cover;
    margin-bottom: 8px;
}

@media (max-width: 480px) {
    .nav-drawer-app img {
        width: 56px;
        height: 56px;
    }
}