/* VARIABLES */
:root {
    --swiss-red: #D52B1E;
    --black: #111;
    --dark-grey: #333;
    --light-grey: #F4F4F4;
    --border: #DDD;
}

body {
    font-family: 'Roboto', Helvetica, Arial, sans-serif;
    margin: 0; padding: 0;
    color: var(--black);
    background-color: #fff;
    line-height: 1.6;
    padding-top: 70px; 
}

/* HEADER FIX */
header {
    background: white; 
    border-bottom: 4px solid var(--swiss-red);
    position: fixed; /* C'est ce qui le garde collé en haut */
    top: 0; 
    left: 0;
    width: 100%; /* Prend toute la largeur */
    z-index: 9999; /* Très haut pour passer au-dessus de tout (carte, pdf, modals) */
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    height: 70px; /* On fixe une hauteur précise pour calculer le décalage */
    box-sizing: border-box; /* Pour inclure les bordures dans la hauteur */
    display: flex;
    align-items: center; /* Centre verticalement le contenu */
}


/* AJUSTEMENT DU CONTENU DU HEADER */
.header-inner {
    width: 100%;
    max-width: 1200px; 
    margin: 0 auto; 
    padding: 0 20px;
    display: flex; 
    justify-content: space-between; 
    align-items: center;
}

.logo-container { 
    display: flex; 
    align-items: center; 
    cursor: pointer; 
    height: 100%; /* Prend toute la hauteur du header */
}

.logo-img {
    height: 50px; /* Ajustez cette valeur selon la hauteur de votre header (qui fait 70px) */
    width: auto;  /* Garde les proportions de l'image */
    object-fit: contain; /* S'assure que l'image ne soit pas déformée */
    display: block;
}


nav { display: flex; align-items: center; }
nav a { text-decoration: none; color: var(--dark-grey); margin-left: 25px; font-size: 14px; font-weight: 700; text-transform: uppercase; transition: color 0.2s; }
nav a:hover { color: var(--swiss-red); }

.lang-switch { margin-left: 30px; padding-left: 20px; border-left: 2px solid #eee; display: flex; }
.lang-btn { cursor: pointer; margin: 0 5px; font-size: 13px; font-weight: bold; color: #999; }
.lang-btn.active { color: var(--swiss-red); text-decoration: underline; }

.btn-auth { background: var(--black); color: white; border: none; padding: 10px 18px; margin-left: 25px; font-weight: bold; cursor: pointer; font-size: 12px; }
.btn-auth:hover { background: var(--swiss-red); }

/* HERO */
.hero { background: var(--light-grey); padding: 60px 0; border-bottom: 1px solid var(--border); }
.hero-content { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
h1 { font-size: 36px; margin: 0 0 10px 0; text-transform: uppercase; letter-spacing: -1px; }
.subtitle { border-left: 4px solid var(--swiss-red); padding-left: 15px; color: #555; font-size: 16px; margin-bottom: 30px;}

.alert-box { background: white; border: 1px solid #ccc; padding: 20px; border-top: 3px solid var(--swiss-red); font-size: 14px; }
.alert-badge { background: var(--swiss-red); color: white; padding: 3px 6px; font-weight: bold; font-size: 11px; margin-right: 10px; }

/* LAYOUT */
.main-wrapper { max-width: 1000px; margin: 0 auto; padding: 40px 20px; }
.content-section { margin-bottom: 80px; scroll-margin-top: 100px; }
h2 { font-size: 24px; text-transform: uppercase; border-bottom: 2px solid #eee; padding-bottom: 10px; margin-bottom: 30px; color: var(--black); }

/* STATS */
.stats-row { display: flex; gap: 20px; margin-bottom: 60px; flex-wrap: wrap; }
.stat-box { background: white; padding: 25px; border: 1px solid var(--border); flex: 1; text-align: center; box-shadow: 0 2px 5px rgba(0,0,0,0.05); }
.stat-box.warning { border-bottom: 4px solid var(--swiss-red); }
.stat-label { display: block; font-size: 11px; text-transform: uppercase; color: #888; margin-bottom: 5px; }
.stat-value { font-size: 28px; font-weight: 900; color: var(--black); }

/* TIMELINE */
.timeline { border-left: 2px solid #ddd; padding-left: 25px; margin-left: 10px; }
.timeline-item { margin-bottom: 30px; }
.timeline-date { font-weight: bold; color: var(--swiss-red); font-size: 13px; display: block; margin-bottom: 5px; }

/* LEGAL */
.legal-box { background: #f9f9f9; padding: 20px; font-family: monospace; border-left: 3px solid #333; margin-bottom: 15px; }
.download-link { color: var(--swiss-red); font-weight: bold; font-size: 12px; text-decoration: none; }

/* MAP REAL LEAFLET */
.map-container-real {
    width: 100%;
    height: 450px; /* IMPORTANT: Leaflet a besoin d'une hauteur */
    background: #e5e5e5;
    border: 1px solid #999;
    z-index: 1;
}
.map-legend { margin-top: 10px; font-size: 12px; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; }
.dot.red { background: var(--swiss-red); } .dot.orange { background: orange; }

/* Styles pour les popups de la carte */
.leaflet-popup-content-wrapper { border-radius: 0; padding: 0; }
.leaflet-popup-content { margin: 10px; font-family: 'Roboto', sans-serif; font-size: 12px; }

/* FORM & DARK SECTION */
.bg-dark-section { background: #222; padding: 40px; border-radius: 4px; color: white; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.check-list li { list-style: none; margin-bottom: 10px; padding-left: 20px; border-left: 2px solid var(--swiss-red); color: #ccc; }

.form-group { margin-bottom: 15px; }
label { display: block; font-size: 12px; font-weight: bold; margin-bottom: 5px; color: #aaa; }
input, select, textarea { width: 100%; padding: 12px; border: 1px solid #444; background: #333; color: white; font-family: inherit; box-sizing: border-box; }
.btn-submit { width: 100%; background: var(--swiss-red); color: white; border: none; padding: 12px; font-weight: bold; cursor: pointer; margin-top: 10px;}
.btn-submit:hover { background: #b01b1b; }

/* FOOTER */
footer { background: #f0f0f0; padding: 40px 0; font-size: 12px; color: #666; text-align: center; border-top: 1px solid #ddd; }

/* MODAL */
.modal-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(255,255,255,0.95); z-index: 2000; align-items: center; justify-content: center; }
.modal-content { background: white; border: 2px solid var(--swiss-red); padding: 30px; width: 450px; font-family: monospace; box-shadow: 0 10px 30px rgba(0,0,0,0.1); }
.badge-red { background: var(--swiss-red); color: white; padding: 2px 5px; font-weight: bold; }
.terminal-log { background: #f4f4f4; padding: 15px; margin: 15px 0; font-size: 12px; border-left: 3px solid #333; }
.red-text { color: var(--swiss-red); font-weight: bold; }
.btn-dark { background: #333; color: white; border: none; padding: 10px; cursor: pointer; width: 100%; font-family: sans-serif; }

/* RESPONSIVE */
@media (max-width: 800px) {
    .header-inner { flex-direction: column; gap: 15px; }
    nav { flex-wrap: wrap; justify-content: center; }
    nav a { margin: 5px 10px; }
    .grid-2 { grid-template-columns: 1fr; }
    .btn-auth { margin-left: 0; margin-top: 10px; }
}
/* Style pour le texte d'intro qui remplace l'alerte */
.intro-block {
    margin-top: 30px;
    max-width: 800px;
    line-height: 1.6;
    color: #444;
    font-size: 16px;
    border-left: 4px solid #333; /* Barre noire sobre */
    padding-left: 20px;
}
/* =========================================
   RESPONSIVE MOBILE (Ajouter à la fin de style.css)
   ========================================= */

/* BOUTON BURGER (Caché sur PC, visible sur Mobile) */
.burger-menu {
    display: none;
    cursor: pointer;
    flex-direction: column;
    gap: 5px;
    padding: 5px;
}
.burger-menu span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--black);
    transition: 0.3s;
}

/* RÈGLES MOBILE (Écrans < 768px) */
@media (max-width: 768px) {

    /* --- 1. HEADER & MENU --- */
    .header-inner {
        flex-direction: column;
        align-items: stretch;
        padding: 10px 15px;
    }

    .header-top {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
    }

    .burger-menu { display: flex; }

    nav {
        display: none; /* Caché par défaut */
        flex-direction: column;
        width: 100%;
        background: white;
        padding-top: 20px;
        border-top: 1px solid #eee;
        margin-top: 15px;
    }
    
    /* Classe ajoutée par JS pour ouvrir le menu */
    nav.open { display: flex; animation: slideDown 0.3s ease-out; }

    nav a {
        margin: 10px 0;
        padding: 10px;
        border-left: 3px solid transparent;
    }
    nav a:hover { border-left-color: var(--swiss-red); background: #f9f9f9; }

    .lang-switch {
        margin: 15px 0;
        padding: 0;
        border: none;
        justify-content: center;
    }

    .btn-auth {
        margin: 0;
        text-align: center;
        width: 100%;
        box-sizing: border-box;
    }

    /* --- 2. GLOBAL LAYOUT --- */
    h1 { font-size: 26px; line-height: 1.2; }
    .subtitle { font-size: 14px; }
    
    .hero { padding: 40px 0; }
    .main-wrapper { padding: 20px; }
    
    .stats-row { flex-direction: column; gap: 10px; }
    
    /* Formulaire */
    .grid-2 { grid-template-columns: 1fr; gap: 20px; }
    .bg-dark-section { padding: 20px; }

    /* --- 3. PAGE CADRE LÉGAL (Complexe) --- */
    /* On passe de Sidebar gauche à Sidebar haut */
    .legal-interface { flex-direction: column; height: auto; overflow: visible; }
    html, body { height: auto; overflow: auto; } /* Désactive le blocage du scroll sur mobile */
    
    .legal-sidebar {
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 2px solid var(--swiss-red);
        max-height: 200px;
        overflow-y: auto; /* Scroll dans la liste */
    }
    
    .legal-viewer { padding: 20px 10px; min-height: 500px;}
    
    .doc-card {
        width: 100%;
        max-width: 100%;
        padding: 20px;
        box-sizing: border-box;
    }

    /* --- 4. MODALS & POPUPS --- */
    .modal-content {
        width: 90%;
        max-width: 90%;
        padding: 20px;
    }
    
    /* --- 5. INTRANET --- */
    .login-card {
        width: 90%;
        position: relative;
        top: auto; left: auto;
        transform: none;
        margin: 50px auto;
    }
    
    /* Tableau responsive (Intranet) */
    .background-content { overflow-x: auto; }
    table.data-table { min-width: 600px; } /* Force le scroll horizontal */
}

/* Animation Menu */
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}