:root {
    --primary: #1e3a8a;
    --primary-hover: #1d4ed8;
    --secondary: #0f172a;
    --accent: #2563eb;
    --success: #16a34a;
    --danger: #dc2626;
    --warning: #d97706;
    --brand-orange: #ff8400;     /* Couleur officielle En-tête & Pied de page */
    --brand-orange-dark: #e07400;
    --bg-body: #949494;          /* Couleur de fond du corps de page (Gris) */
    --surface: #ffffff;          /* Cartes et conteneurs blancs haute lisibilité */
    --border: #7a7a7a;
    --border-light: #e2e8f0;
    --text-main: #0b1017;        /* Noir profond ultra-net */
    --text-body: #0b1017;
    --text-muted: #334155;
    --radius: 8px;
    --shadow: 0 4px 16px rgba(0, 0, 0, 0.16);
    --shadow-hover: 0 8px 22px rgba(0, 0, 0, 0.22);
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }

/* 1. FOND DE PAGE GLOBAL (BODY #949494) */
body {
    background-color: var(--bg-body) !important;
    color: var(--text-body);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-size: 0.92rem;
    line-height: 1.5;
}

/* 2. EN-TÊTE GLOBAL STICKY (#ff8400) */
.header {
    background-color: var(--brand-orange) !important;
    border-bottom: 2px solid var(--brand-orange-dark);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.15);
}
.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.5rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.brand-container { display: flex; align-items: center; text-decoration: none; }
.brand-logo { height: 40px; max-width: 190px; object-fit: contain; }
.brand-title { font-size: 1.15rem; font-weight: 700; color: #0b1017; }

/* Liens de navigation avec contraste élevé sur fond orange */
.nav-links { display: flex; gap: 0.4rem; align-items: center; }
.nav-link {
    text-decoration: none;
    color: #0b1017;
    font-weight: 600;
    font-size: 0.90rem;
    padding: 0.45rem 0.75rem;
    border-radius: 6px;
    transition: all 0.2s ease;
}
.nav-link:hover:not(.active) {
    color: #0b1017;
    background: rgba(11, 16, 23, 0.12);
}
.nav-link.active {
    color: #ffffff !important;
    background: #0b1017 !important;
}
.nav-link.btn-cta {
    background: #0b1017;
    color: #ffffff !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}
.nav-link.btn-cta:hover {
    background: #1e293b;
}
.nav-link.btn-admin {
    background: var(--secondary);
    color: #ffffff !important;
}
.nav-link.btn-logout {
    color: var(--danger);
    background: rgba(220, 38, 38, 0.12);
}

/* Bouton Hamburger Mobile */
.hamburger-btn {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 26px;
    height: 19px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1100;
}
.hamburger-bar {
    width: 100%;
    height: 2.5px;
    background-color: #0b1017;
    border-radius: 3px;
    transition: all 0.3s ease;
}
.hamburger-btn.open .hamburger-bar:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.hamburger-btn.open .hamburger-bar:nth-child(2) { opacity: 0; }
.hamburger-btn.open .hamburger-bar:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* 3. CONTENEURS ET CARTES */
.main-wrapper { flex: 1; max-width: 1180px; margin: 1.25rem auto; padding: 0 1rem; width: 100%; }
.card {
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    margin-bottom: 1.25rem;
}

/* Bannière d'accueil */
.hero-box {
    text-align: center;
    padding: 2.25rem 1.25rem;
    background: #ffffff;
    border-radius: var(--radius);
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
}
.hero-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.75rem;
    line-height: 1.25;
}
.hero-desc {
    font-size: 0.95rem;
    color: var(--text-body);
    font-weight: 400;
    max-width: 760px;
    margin: 0 auto 1.5rem;
    line-height: 1.55;
}

/* Grille de fonctionnalités */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.15rem;
    margin-top: 1.25rem;
}
.feature-card {
    background: var(--surface);
    border: 1px solid #e2e8f0;
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
    transition: all 0.2s ease-in-out;
}
.feature-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
    border-color: #cbd5e1;
}
.feature-icon { font-size: 1.6rem; margin-bottom: 0.5rem; }
.feature-card h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 0.45rem;
    line-height: 1.35;
}
.feature-card p {
    font-size: 0.86rem;
    color: var(--text-body);
    font-weight: 400;
    line-height: 1.5;
}

/* Formulaires et entrées */
.form-group { margin-bottom: 0.9rem; }
.form-label { display: block; margin-bottom: 0.35rem; font-size: 0.85rem; font-weight: 600; color: var(--secondary); }
.form-input, .form-select {
    width: 100%;
    padding: 0.55rem 0.8rem;
    border: 1.2px solid var(--border);
    border-radius: 6px;
    font-size: 0.88rem;
    color: var(--text-main);
    background: #ffffff;
    transition: all 0.2s;
}
.form-input:focus, .form-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

/* Boutons */
.btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: 0.6rem 1.25rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.88rem;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    text-decoration: none;
}
.btn-primary { background: var(--primary); color: #ffffff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: var(--secondary); color: #ffffff; }
.btn-secondary:hover { background: #1e293b; }
.btn-sm { padding: 0.38rem 0.75rem; font-size: 0.8rem; border-radius: 5px; }

/* Tableaux & Badges */
.table-responsive { width: 100%; overflow-x: auto; margin-top: 0.75rem; }
.data-table { width: 100%; border-collapse: collapse; text-align: left; font-size: 0.84rem; }
.data-table th { background: #f1f5f9; padding: 0.55rem 0.75rem; font-weight: 700; border-bottom: 2px solid var(--border); }
.data-table td { padding: 0.55rem 0.75rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.badge { display: inline-block; padding: 0.2rem 0.5rem; border-radius: 999px; font-size: 0.7rem; font-weight: 600; text-transform: uppercase; }
.badge-active { background: #dcfce7; color: var(--success); }
.badge-pending { background: #fef3c7; color: var(--warning); }
.badge-suspended { background: #fee2e2; color: var(--danger); }

/* Onglets */
.tabs-header { display: flex; border-bottom: 1.5px solid var(--border); gap: 0.35rem; margin-bottom: 1rem; flex-wrap: wrap; }
.tab-btn { padding: 0.5rem 0.9rem; font-weight: 600; font-size: 0.85rem; color: var(--text-muted); background: none; border: none; cursor: pointer; border-bottom: 2.5px solid transparent; margin-bottom: -1.5px; }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* FAQ (Module 76) */
.faq-section-title { color: var(--primary); font-size: 1.1rem; font-weight: 700; border-bottom: 1.5px solid var(--border); padding-bottom: 0.35rem; margin: 1.5rem 0 0.75rem; display: flex; align-items: center; gap: 0.4rem; }
.faq-item { border: 1px solid var(--border); border-radius: 6px; margin-bottom: 0.55rem; background: #fff; overflow: hidden; }
.faq-question { padding: 0.75rem 1rem; font-size: 0.88rem; font-weight: 600; color: var(--secondary); cursor: pointer; display: flex; justify-content: space-between; align-items: center; }
.faq-question:hover { background: #f8fafc; }
.faq-answer { padding: 0.75rem 1rem; font-size: 0.85rem; color: var(--text-body); line-height: 1.5; border-top: 1px solid var(--border); background: #fafafa; display: none; }
.faq-item.active .faq-answer { display: block; }
.faq-toggle { font-weight: bold; font-size: 1rem; color: var(--primary); transition: transform 0.2s; }
.faq-item.active .faq-toggle { transform: rotate(45deg); }

/* Tableau blanc et outils */
.wb-container { background: #ffffff; border: 1.5px solid var(--border); border-radius: 8px; overflow: hidden; margin: 1rem 0; }
.wb-toolbar { background: #f8fafc; border-bottom: 1.5px solid var(--border); padding: 0.5rem 0.75rem; display: flex; gap: 0.35rem; flex-wrap: wrap; align-items: center; }
.wb-tool-btn { padding: 0.35rem 0.65rem; background: white; border: 1px solid var(--border); border-radius: 5px; font-size: 0.78rem; font-weight: 600; cursor: pointer; }
.wb-tool-btn.active { background: var(--primary); color: white; border-color: var(--primary); }
.wb-canvas-wrapper { position: relative; width: 100%; height: 380px; background: #ffffff; cursor: crosshair; touch-action: none; }
.wb-canvas-wrapper.grid-pattern { background-image: linear-gradient(to right, #f1f5f9 1px, transparent 1px), linear-gradient(to bottom, #f1f5f9 1px, transparent 1px); background-size: 16px 16px; }
canvas.wb-board { width: 100%; height: 100%; display: block; }
.math-palette { display: flex; gap: 0.25rem; flex-wrap: wrap; background: #f1f5f9; padding: 0.4rem 0.6rem; border-radius: 6px; margin-top: 0.4rem; }
.math-sym-btn { padding: 0.25rem 0.5rem; background: white; border: 1px solid #cbd5e1; border-radius: 3px; font-size: 0.85rem; font-weight: bold; cursor: pointer; }

/* Moteur Modal JWSModal (Note 1) */
.jws-modal-backdrop {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(15, 23, 42, 0.75); backdrop-filter: blur(4px);
    display: none; justify-content: center; align-items: center; z-index: 9999;
    opacity: 0; transition: opacity 0.2s ease-in-out;
}
.jws-modal-backdrop.active { display: flex; opacity: 1; }
.jws-modal-box {
    background: var(--surface); border-radius: 10px; width: 88%; max-width: 420px;
    padding: 1.5rem; box-shadow: 0 15px 30px rgba(0,0,0,0.3); text-align: center;
    transform: scale(0.96); transition: transform 0.2s ease-in-out;
}
.jws-modal-backdrop.active .jws-modal-box { transform: scale(1); }
.jws-modal-icon { width: 46px; height: 46px; border-radius: 50%; margin: 0 auto 0.75rem; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; font-weight: bold; }
.jws-modal-icon.success { background: #dcfce7; color: var(--success); }
.jws-modal-icon.error { background: #fee2e2; color: var(--danger); }
.jws-modal-icon.warning { background: #fef3c7; color: var(--warning); }
.jws-modal-icon.info { background: #dbeafe; color: var(--accent); }
.jws-modal-title { font-size: 1.15rem; font-weight: 700; color: var(--secondary); margin-bottom: 0.5rem; }
.jws-modal-message { font-size: 0.9rem; color: var(--text-body); line-height: 1.45; margin-bottom: 1.25rem; font-weight: 400; }
.jws-modal-actions { display: flex; gap: 0.5rem; justify-content: center; }

/* 4. PIED DE PAGE GLOBAL (#ff8400) */
.footer {
    background-color: var(--brand-orange) !important;
    border-top: 2px solid var(--brand-orange-dark);
    padding: 1.25rem 1rem;
    text-align: center;
    font-size: 0.75rem;
    color: #0b1017;
    margin-top: auto;
    font-weight: 600;
}
.footer-desktop { display: block; }
.footer-mobile { display: none; }

/* Adaptations Mobiles */
@media (max-width: 860px) {
    body { font-size: 0.88rem; }
    .footer-desktop { display: none; }
    .footer-mobile { display: block; font-size: 0.7rem; }
    .hamburger-btn { display: flex; }
    .brand-logo { height: 34px; }
    
    .main-wrapper { margin: 0.85rem auto; padding: 0 0.75rem; }
    .card { padding: 1rem; margin-bottom: 0.85rem; }
    
    .hero-box { padding: 1.5rem 0.75rem; margin-bottom: 1rem; }
    .hero-title { font-size: 1.35rem; margin-bottom: 0.5rem; }
    .hero-desc { font-size: 0.86rem; margin-bottom: 1.15rem; line-height: 1.45; }
    
    .feature-grid { grid-template-columns: 1fr; gap: 0.75rem; margin-top: 0.85rem; }
    .feature-card { padding: 0.9rem 1rem; }
    .feature-icon { font-size: 1.4rem; margin-bottom: 0.35rem; }
    .feature-card h3 { font-size: 0.95rem; margin-bottom: 0.35rem; }
    .feature-card p { font-size: 0.82rem; line-height: 1.4; }

    .form-group { margin-bottom: 0.75rem; }
    .form-label { font-size: 0.82rem; margin-bottom: 0.25rem; }
    .form-input, .form-select { padding: 0.48rem 0.65rem; font-size: 0.85rem; }
    
    .btn { padding: 0.55rem 1rem; font-size: 0.84rem; }

    /* Menu Hamburger Mobile */
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: #ffffff;
        flex-direction: column;
        padding: 0.75rem 1rem;
        border-bottom: 3px solid var(--brand-orange);
        box-shadow: 0 8px 16px rgba(0,0,0,0.15);
        gap: 0.35rem;
    }
    .nav-links.nav-open { display: flex; }
    .nav-link { width: 100%; padding: 0.6rem 0.75rem; font-size: 0.90rem; color: #0b1017; }
    .nav-link.btn-cta { text-align: center; }
}
