/* =====================================================
   STYLES CSS - Marine Nationale
   Formation aux Cours d'Armes
   Sommaire :
     1. Variables & reset
     2. Header & navigation
     3. Hero
     4. Sections génériques
     5. Onglets Cours / QCM (page d'accueil)
     6. Cartes de formation (training-card)
     7. Statistiques (page d'accueil)
     8. Page de cours (en-tête, fil d'Ariane, sommaire)
     9. Tableaux de données
    10. Boîtes d'info / alerte
    11. Grille de spécifications
    12. Modèle 3D
    13. Vidéo
    14. QCM / Quiz
    15. Footer
    16. Animations
    17. Utilitaires
    18. Responsive
   ===================================================== */

/* ===== 1. Variables & reset ===== */
:root {
    --primary: #0056b3;
    --primary-dark: #003d7a;
    --secondary: #ffd700;
    --accent: #C41E3A;
    --success: #2e7d32;
    --danger: #c62828;
    --warning: #ff8f00;
    --info: #1976d2;
    --light: #f8f9fa;
    --dark: #343a40;
    --text-secondary: #666;
}

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

html {
    overflow-x: hidden;
}

/* Empêche les mots trop longs ou les éléments larges de se faire couper
   silencieusement à droite (l'overflow-x: hidden ci-dessus masque tout
   débordement au lieu de le laisser défiler ou passer à la ligne) */
img, svg, video, iframe, canvas {
    max-width: 100%;
    height: auto;
}

body {
    font-family: 'Montserrat', 'Segoe UI', sans-serif;
    line-height: 1.6;
    color: var(--dark);
    background-color: var(--light);
    min-height: 100vh;
    max-width: 100vw;
    overflow-x: hidden;
    overflow-wrap: break-word;
    word-break: break-word;
    display: flex;
    flex-direction: column;
}

/* Les enfants directs de <body> (flex en colonne) refusent par défaut
   de rétrécir sous la largeur de leur contenu (min-width: auto implicite
   du flexbox), ce qui forçait certaines pages à déborder sur mobile et
   à se faire couper à droite par le overflow-x: hidden ci-dessus. */
body > * {
    min-width: 0;
}

/* ===== 2. Header & navigation ===== */
header {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 1rem 0;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
    color: white;
    min-width: 0;
}

.logo-icon {
    font-size: 2.5rem;
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    animation: float 3s ease-in-out infinite;
}

.logo-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.logo-text h1 {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 2px;
}

.logo-text span {
    font-size: 0.7rem;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 3px;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 0.5rem;
    flex-wrap: wrap;
}

nav ul li a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    padding: 0.6rem 1rem;
    border-radius: 6px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

nav ul li a:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

nav ul li a.active {
    background: var(--accent);
}

/* ----- Menu déroulant "Cours" ----- */
.nav-dropdown {
    position: relative;
}

.nav-dropdown-toggle {
    cursor: pointer;
    user-select: none;
}

.nav-dropdown-toggle i {
    font-size: 0.7rem;
    transition: transform 0.2s ease;
}

.nav-dropdown.open .nav-dropdown-toggle i {
    transform: rotate(180deg);
}

.nav-dropdown-menu {
    list-style: none;
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    padding: 1.2rem;
    width: max-content;
    max-width: min(760px, 90vw);
    display: grid;
    grid-template-columns: repeat(3, minmax(170px, 1fr));
    gap: 0.4rem 1.6rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
}

.nav-dropdown.open .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-dropdown-col {
    min-width: 0;
}

.nav-dropdown-col h4 {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--primary);
    padding: 0.5rem 0.6rem 0.35rem;
    margin: 0;
    border-bottom: 2px solid var(--light);
    margin-bottom: 0.3rem;
}

.nav-dropdown-col ul {
    list-style: none;
}

.nav-dropdown-menu li a {
    color: var(--dark);
    padding: 0.45rem 0.6rem;
    border-radius: 6px;
    font-size: 0.87rem;
    display: block;
}

.nav-dropdown-menu li a:hover {
    background: var(--light);
    transform: none;
}

.nav-dropdown-menu li a.active {
    background: var(--light);
    color: var(--primary);
    font-weight: 700;
}

@media (min-width: 900px) {
    .nav-dropdown:hover .nav-dropdown-menu {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }
}

@media (max-width: 960px) {
    .nav-dropdown-menu {
        grid-template-columns: repeat(2, minmax(150px, 1fr));
    }
}

/* ----- Groupe de droite : navigation + bouton de déconnexion ----- */
.nav-right {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 1.2rem;
    flex-wrap: wrap;
}

.logout-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: white;
    background: rgba(255, 255, 255, 0.12);
    border: 1.5px solid rgba(255, 255, 255, 0.4);
    padding: 0.55rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.logout-btn:hover {
    background: var(--danger);
    border-color: var(--danger);
    transform: translateY(-2px);
}

/* ----- Bouton mode sombre / mode clair ----- */
.theme-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    color: white;
    background: rgba(255, 255, 255, 0.12);
    border: 1.5px solid rgba(255, 255, 255, 0.4);
    border-radius: 8px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.theme-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
}

/* ===== 3. Hero ===== */
.hero {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 4rem 2rem;
    text-align: center;
}

.hero-content {
    max-width: 1200px;
    margin: 0 auto;
}

.hero-title {
    font-family: 'Playfair Display', serif;
    font-size: 3rem;
    margin-bottom: 1rem;
    animation: fadeInDown 1s ease-out;
}

.hero-subtitle {
    font-size: 1.3rem;
    opacity: 0.95;
    max-width: 700px;
    margin: 0 auto 2rem;
    animation: fadeInUp 1s ease-out 0.3s both;
}

/* ===== 4. Sections génériques ===== */
.section {
    padding: 4rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.section-title {
    text-align: center;
    margin-bottom: 3rem;
}

.section-title h2 {
    font-family: 'Playfair Display', serif;
    font-size: 2.5rem;
    color: var(--primary);
    position: relative;
    display: inline-block;
}

.section-title h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--accent);
    border-radius: 2px;
}

/* ===== 5. Onglets Cours / QCM (page d'accueil) ===== */
.training-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px 40px;
}

.training-tabs {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
    border-bottom: 1px solid #ddd;
    flex-wrap: wrap;
}

.training-tab {
    padding: 15px 30px;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
    color: #555;
    font-weight: 500;
    background: transparent;
    border-radius: 5px 5px 0 0;
}

.training-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    background: rgba(0, 86, 179, 0.05);
}

.training-tab:hover {
    background: rgba(0, 86, 179, 0.03);
}

.training-content {
    display: none;
}

.training-content.active {
    display: block;
    animation: fadeIn 0.5s;
}

.category-section {
    margin-bottom: 40px;
}

.category-title {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary);
    color: var(--primary);
}

.category-title i {
    font-size: 2rem;
}

.category-title h2 {
    margin: 0;
    font-size: 1.8rem;
}

/* ===== 6. Cartes de formation (training-card) ===== */
.training-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.training-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s;
    text-decoration: none;
    color: var(--dark);
    display: block;
}

.training-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.15);
}

.card-header {
    padding: 20px;
    position: relative;
    color: white;
}

.card-header h3 {
    margin: 0;
    font-size: 1.2rem;
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 10px;
}

.card-header i {
    font-size: 1.5rem;
}

.card-body {
    padding: 20px;
}

.card-body p {
    color: #555;
    margin-bottom: 15px;
    font-size: 0.95rem;
    line-height: 1.5;
}

.card-tag {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-top: 10px;
}

/* Dégradés d'en-tête de carte, par catégorie */
.grad-primary { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); }
.grad-green   { background: linear-gradient(135deg, #2e7d32, #1b5e20); }
.grad-brown   { background: linear-gradient(135deg, #6d4c41, #4e342e); }
.grad-orange  { background: linear-gradient(135deg, #ff8f00, #ef6c00); }
.grad-blue    { background: linear-gradient(135deg, #1976d2, #0d47a1); }
.grad-teal    { background: linear-gradient(135deg, #00897b, #00695c); }
.grad-navy    { background: linear-gradient(135deg, #34495e, #1a252f); }
.grad-purple  { background: linear-gradient(135deg, #7b1fa2, #4a148c); }

/* Pastilles de catégorie (card-tag) */
.tag-blue   { background-color: #e3f2fd; color: #1976d2; }
.tag-purple { background-color: #f3e5f5; color: #7b1fa2; }
.tag-green  { background-color: #e8f5e9; color: #2e7d32; }
.tag-brown  { background-color: #f5f5f5; color: #6d4c41; }
.tag-orange { background-color: #fff3e0; color: #f57c00; }
.tag-pink   { background-color: #fce4ec; color: #c2185b; }
.tag-teal   { background-color: #e0f2f1; color: #00695c; }
.tag-navy   { background-color: #e8eaed; color: #2c3e50; }

/* ===== 7. Statistiques (page d'accueil) ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.stat-item {
    background: white;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s;
}

.stat-item:hover {
    transform: translateY(-3px);
}

.stat-icon {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 10px;
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary);
    margin-bottom: 5px;
}

.stat-label {
    color: #666;
    font-size: 0.9rem;
}

/* ===== 8. Page de cours ===== */
.course-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 3rem 2rem;
    text-align: center;
}

.course-header h1 {
    font-family: 'Playfair Display', serif;
    font-size: 2.8rem;
    margin-bottom: 1rem;
}

.course-header p {
    font-size: 1.1rem;
    opacity: 0.9;
    max-width: 800px;
    margin: 0 auto;
}

.breadcrumb {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    gap: 0.5rem;
    align-items: center;
    font-size: 0.9rem;
}

.breadcrumb a {
    color: var(--primary);
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.course-body {
    max-width: 1000px;
    width: 100%;
    min-width: 0;
    margin: 0 auto;
    padding: 2rem;
}

.toc {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.toc h2 {
    color: var(--primary);
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.toc ul {
    list-style: none;
}

.toc ul li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #eee;
}

.toc ul li:last-child {
    border-bottom: none;
}

.toc ul li a {
    color: var(--dark);
    text-decoration: none;
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 0.5rem;
}

.toc ul li a:hover {
    color: var(--primary);
}

/* Titre de section de cours (remplace les style="color:var(--primary);..." répétés) */
.section-heading {
    color: var(--primary);
    margin: 2rem 0 1rem;
    font-size: 1.8rem;
}

.unit-title {
    color: var(--primary);
    margin: 1rem 0 0.5rem;
}

/* ===== 9. Tableaux de données ===== */
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    margin: 1.5rem 0;
}

.data-table th {
    background: var(--primary);
    color: white;
    padding: 1rem;
    text-align: left;
    font-weight: 600;
}

.data-table td {
    padding: 1rem;
    border-bottom: 1px solid #eee;
}

.data-table tr:hover {
    background: #f8f9fa;
}

.data-table tr:last-child td {
    border-bottom: none;
}

.th-narrow {
    width: 1%;
    white-space: nowrap;
}

/* Permet aux tableaux larges de défiler horizontalement sur petit écran
   plutôt que de casser la mise en page */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    margin: 1.5rem 0;
}

.table-responsive .data-table {
    margin: 0;
    box-shadow: none;
    min-width: 480px;
}

.emblem-img {
    width: 80px;
    height: auto;
    display: block;
}

/* ===== 10. Boîtes d'info / alerte ===== */
.info-box {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    margin: 1.5rem 0;
    border-left: 4px solid var(--secondary);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.info-box.warning {
    border-left-color: var(--warning);
    background: #FFFBEB;
}

.info-box.danger {
    border-left-color: var(--danger);
    background: #FEF2F2;
}

.info-box h4 {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    color: var(--primary);
}

.info-box.warning h4 {
    color: #92400E;
}

.info-box.danger h4 {
    color: #991B1B;
}

.info-list {
    margin-left: 1.5rem;
    margin-top: 0.5rem;
}

.indent {
    margin-left: 1rem;
}

/* ===== 11. Grille de spécifications ===== */
.specs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.spec-item {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.spec-item i {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.spec-item h4 {
    color: var(--primary);
    margin-bottom: 0.3rem;
}

.spec-item p {
    color: var(--dark);
    opacity: 0.8;
    font-size: 0.9rem;
}

/* ===== 12. Modèle 3D ===== */
.full-img {
    width: 100%;
    height: auto;
    border-radius: 12px;
    margin-bottom: 1rem;
}

.centered-note {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 2rem;
    color: var(--text-secondary);
}

.model-3d-container {
    width: 100%;
    height: 500px;
    margin: 0 auto;
    border-radius: 12px;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* ===== 13. Vidéo ===== */
.illustration-container {
    max-width: 800px;
    margin: 0 auto 2rem;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    line-height: 0;
}

.illustration-container svg {
    display: block;
    width: 100%;
    height: auto;
}

.illustration-caption {
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: -1.5rem 0 2rem;
    font-style: italic;
}

/* ===== 13bis. Galeries de photos ===== */
.img-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.2rem;
    margin: 1.5rem 0 2rem;
    align-items: start;
}

.img-gallery figure {
    margin: 0;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(13, 43, 70, 0.07);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.img-gallery figure:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
}

.img-gallery img {
    width: 100%;
    height: 260px;
    object-fit: contain;
    background: var(--light);
    display: block;
    padding: 0.5rem;
}

/* Une seule image dans la galerie : on évite qu'elle s'étire sur toute la
   largeur du conteneur (ce qui créait un grand vide blanc disproportionné).
   On la recentre à une largeur raisonnable et on lui laisse plus de hauteur
   pour rester lisible (tableaux, schémas légendés, captures denses). */
.img-gallery figure:only-child {
    max-width: 620px;
    margin: 0 auto;
}

.img-gallery figure:only-child img {
    height: auto;
    max-height: 520px;
}

/* Logos, écussons, insignes : présentation "badge" dédiée — fond clair
   uniforme, image entière toujours visible, taille cohérente entre elles */
.img-gallery figure.gallery-logo {
    display: flex;
    flex-direction: column;
}

.img-gallery figure.gallery-logo img {
    object-fit: contain;
    background: #f4f6f9;
    padding: 1.4rem;
    height: 210px;
}

.img-gallery figure.gallery-logo:only-child img {
    height: 210px;
    max-height: 210px;
    min-height: 0;
}

.img-gallery figcaption {
    padding: 0.65rem 0.9rem;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--primary-dark);
    border-top: 2px solid var(--secondary);
    background: linear-gradient(180deg, rgba(255,215,0,0.06), transparent);
}

.video-container {
    max-width: 800px;
    margin: 0 auto 2rem;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* Conserve un ratio 16:9 à toutes les tailles d'écran, quelle que soit
   la largeur/hauteur fixées en HTML sur l'iframe */
.video-responsive {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 56.25%; /* 16:9 */
}

.video-responsive iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* ===== 14. QCM / Quiz ===== */
.quiz-container {
    max-width: 700px;
    margin: 3rem auto;
    padding: 0 2rem;
}

.question-card {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.question-card h3 {
    color: var(--primary);
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
}

#start-screen p {
    margin: 15px 0;
    color: var(--text-secondary);
}

.question-text {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.image-container {
    margin-bottom: 1.5rem;
}

.grade-image {
    max-width: 220px;
    width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.answers-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.answer-btn {
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 0.9rem 1.2rem;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.answer-btn:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.answer-btn:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

.answer-btn.correct {
    background: var(--success) !important;
}

.answer-btn.incorrect {
    background: var(--danger) !important;
}

.answer-btn.btn-secondary {
    background: var(--dark);
}

.quiz-progress {
    max-width: 700px;
    margin: 0 auto 1.5rem;
    padding: 0 2rem;
}

.progress-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.timer-display {
    color: var(--accent);
    font-weight: 700;
}

.progress-bar {
    height: 10px;
    background: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    width: 0;
    transition: width 0.3s ease;
}

.score-display {
    display: block;
    text-align: right;
    font-weight: 600;
    color: var(--primary);
}

.result-screen {
    max-width: 700px;
    margin: 3rem auto;
    padding: 3rem 2rem;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.result-score {
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--primary);
    margin: 1rem 0;
}

.result-max {
    font-size: 2rem;
    color: var(--text-secondary);
}

.result-message {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
}

.scores-list {
    list-style: none;
    padding: 0;
    max-width: 400px;
    margin: 0 auto;
}

.scores-list li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #eee;
    display: flex;
    min-width: 0;
    justify-content: space-between;
}

.feedback {
    margin-top: 20px;
    padding: 15px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 1.1rem;
    text-align: center;
}

.feedback-correct-bg   { background: #d4edda; color: #155724; }
.feedback-incorrect-bg { background: #f8d7da; color: #721c24; }

/* ===== 15. Footer ===== */
footer {
    background: var(--primary-dark);
    color: white;
    padding: 3rem 2rem;
    text-align: center;
    margin-top: auto;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-logo {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.footer-logo-icon {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
}

.footer-logo-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.footer-logo h3 {
    font-family: 'Playfair Display', serif;
}

.footer-text p {
    opacity: 0.8;
    margin-bottom: 0.5rem;
}

.footer-motto {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--warning);
    letter-spacing: 2px;
    margin-top: 1rem;
}

/* ===== 16. Animations ===== */
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== 17. Utilitaires ===== */
.hidden { display: none; }
.text-center { text-align: center; }
.section-white { background: white; }
.mt-lg { margin-top: 50px; }
.mb-md { margin-bottom: 1rem; }
.mt-sm { margin-top: 15px; }
.my-lg { margin: 30px 0; }

.grades-image {
    max-width: 100%;
    width: 900px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

/* ===== 18. Responsive ===== */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
    }

    .section-title h2 {
        font-size: 2rem;
    }

    .nav-container {
        flex-direction: column;
        gap: 1rem;
    }

    .nav-right {
        justify-content: center;
        width: 100%;
    }

    nav ul {
        flex-wrap: wrap;
        justify-content: center;
    }

    .nav-dropdown-menu {
        left: 50%;
        grid-template-columns: 1fr;
        max-width: min(320px, 90vw);
        max-height: 70vh;
        overflow-y: auto;
        transform: translateX(-50%) translateY(-8px);
    }

    .nav-dropdown.open .nav-dropdown-menu {
        transform: translateX(-50%) translateY(0);
    }

    .course-header h1 {
        font-size: 2rem;
    }

    .specs-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .training-tabs {
        flex-direction: column;
    }

    .training-tab {
        width: 100%;
        text-align: center;
    }

    .training-grid {
        grid-template-columns: 1fr;
    }

    .model-3d-container {
        height: 400px;
    }

    .answers-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 576px) {
    .data-table {
        font-size: 0.85rem;
    }

    .data-table th,
    .data-table td {
        padding: 0.7rem;
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 3rem 1.25rem;
    }

    .hero-title {
        font-size: 1.6rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .course-header {
        padding: 2rem 1.25rem;
    }

    .course-header h1 {
        font-size: 1.6rem;
    }

    .course-body {
        padding: 1.25rem;
    }

    .nav-container {
        padding: 0 1rem;
    }

    .logo-text h1 {
        font-size: 1.1rem;
    }

    nav ul li a {
        padding: 0.5rem 0.7rem;
        font-size: 0.8rem;
    }

    .specs-grid {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .answers-grid {
        grid-template-columns: 1fr;
    }

    .model-3d-container {
        height: 300px;
    }
}

/* ================================
   POPUP QCM EN DÉVELOPPEMENT
================================ */

.coming-soon-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    inset: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(5px);
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.coming-soon-modal.active {
    display: flex;
}

.coming-soon-content {
    position: relative;
    width: 100%;
    max-width: 450px;
    background: #ffffff;
    border-radius: 20px;
    padding: 40px 30px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
    animation: comingSoonAppear 0.3s ease;
}

@keyframes comingSoonAppear {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.coming-soon-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: #f1f1f1;
    color: #555;
    font-size: 18px;
    cursor: pointer;
    transition: 0.2s ease;
}

.coming-soon-close:hover {
    background: #e0e0e0;
    transform: rotate(90deg);
}

.coming-soon-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff9800, #ff5722);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 32px;
}

.coming-soon-content h2 {
    margin: 0 0 15px;
    font-size: 26px;
    color: #222;
}

.coming-soon-content p {
    margin: 0 auto 25px;
    max-width: 350px;
    color: #666;
    line-height: 1.6;
    font-size: 16px;
}

.coming-soon-button {
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    background: linear-gradient(135deg, #ff9800, #ff5722);
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s ease;
}

.coming-soon-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 87, 34, 0.3);
}
/* ===== 19. Lightbox (agrandissement des images au clic) ===== */
.full-img,
.img-gallery img,
.grades-image,
.emblem-img {
    cursor: zoom-in;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.full-img:hover,
.img-gallery img:hover,
.grades-image:hover {
    transform: scale(1.02);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
}

.emblem-img:hover {
    transform: scale(1.15);
}

.lightbox-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(5, 15, 25, 0.9);
    z-index: 3000;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.lightbox-overlay.active {
    display: flex;
}

.lightbox-overlay img {
    max-width: 100%;
    max-height: 85vh;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.lightbox-caption {
    position: absolute;
    bottom: 24px;
    left: 0;
    right: 0;
    text-align: center;
    color: #fff;
    font-size: 0.95rem;
    opacity: 0.9;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #fff;
    font-size: 2.2rem;
    line-height: 1;
    background: none;
    border: none;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.lightbox-close:hover {
    opacity: 1;
    transform: scale(1.1);
}

@media (max-width: 600px) {
    .lightbox-close {
        top: 10px;
        right: 15px;
        font-size: 1.8rem;
    }
}

/* ===== 20. Page Ressources (PDF) ===== */
.course-visual-intro {
    margin: 0 0 2rem;
    border-radius: 14px;
    overflow: hidden;
    background: #eaf1f7;
    box-shadow: 0 8px 22px rgba(13, 43, 70, 0.14);
}

.course-visual-intro img {
    display: block;
    width: 100%;
    height: clamp(180px, 30vw, 330px);
    object-fit: cover;
}

.course-visual-intro figcaption {
    padding: 0.65rem 0.9rem;
    color: var(--text-secondary);
    font-size: 0.83rem;
    background: #fff;
}

.pdf-embed-wrap {
    width: 100%;
    height: 80vh;
    min-height: 500px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    margin: 1.5rem 0;
}

.pdf-embed-wrap iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.resource-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin: 1.5rem 0;
}

.resource-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.85rem 1.6rem;
    border-radius: 10px;
    font-weight: 700;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.resource-btn.primary {
    background: var(--primary);
    color: #fff;
}

.resource-btn.secondary {
    background: #fff;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.resource-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15);
}

.resource-meta {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.resource-meta span {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

@media (max-width: 640px) {
    .pdf-embed-wrap {
        height: 65vh;
        min-height: 380px;
    }

    .resource-btn {
        width: 100%;
        justify-content: center;
    }
}



/* =====================================================
   THÈME CLAIR — VERSION FINALE
   Interface sobre, lumineuse et cohérente.
   ===================================================== */
:root {
    --primary: #0b5f8a;
    --primary-dark: #084665;
    --secondary: #d7a928;
    --accent: #b51f3a;
    --success: #237a4b;
    --danger: #b4232f;
    --warning: #b86a00;
    --info: #1769aa;
    --light: #f5f8fa;
    --dark: #173247;
    --text-secondary: #647784;
    --surface: #ffffff;
    --border: #d8e3e9;
}

body {
    background: #f5f8fa;
    color: #263844;
}

header {
    background: rgba(255,255,255,.98) !important;
    border-bottom: 1px solid #d8e3e9 !important;
    box-shadow: 0 2px 10px rgba(23,50,71,.06) !important;
    backdrop-filter: blur(10px);
}
.logo, .logo-text h1 { color: #173247 !important; }
.logo-text span { color: #6c818d !important; }
nav ul li a { color: #3f5968 !important; }
nav ul li a:hover { color: #0b5f8a !important; background:#eef6f9 !important; }
nav ul li a.active { color:#0b5f8a !important; background:#e8f3f7 !important; box-shadow:inset 0 -3px 0 #0b5f8a; }
.nav-dropdown-menu {
    background: #fff !important;
    border: 1px solid #d8e3e9 !important;
    box-shadow: 0 14px 30px rgba(23,50,71,.12) !important;
}
.nav-dropdown-menu a { color: #3b5564 !important; }
.nav-dropdown-menu a:hover { background: #eef6f9 !important; color: #0b5f8a !important; }
.nav-dropdown-menu a.active { background:#e8f3f7 !important; color:#0b5f8a !important; box-shadow:inset 3px 0 0 #0b5f8a; }
.logout-btn {
    color: #0b5f8a !important;
    background: #eef6f9 !important;
    border: 1.5px solid #c8dde6 !important;
}
.logout-btn:hover {
    background: var(--danger) !important;
    border-color: var(--danger) !important;
    color: #fff !important;
}
.theme-toggle-btn {
    color: #0b5f8a !important;
    background: #eef6f9 !important;
    border: 1.5px solid #c8dde6 !important;
}
.theme-toggle-btn:hover {
    background: #e0eff4 !important;
    border-color: #a8cad8 !important;
}

.hero {
    background: linear-gradient(135deg, #edf5f8 0%, #f9fbfc 60%, #eaf3f7 100%) !important;
    color: #173247 !important;
    border-bottom: 1px solid #d8e3e9 !important;
}
.hero-title { color: #173247 !important; text-shadow: none !important; }
.hero-subtitle { color: #607582 !important; }
.section { background: #f5f8fa; }
.section-title, .category-title { color: #173247 !important; }
.category-title { border-color: #d8e3e9 !important; }

/* Accueil : onglets Cours / QCM propres et légers */
.training-container { padding-top: 28px; }
.training-tabs {
    width: fit-content;
    max-width: 100%;
    margin: 0 auto 34px;
    padding: 4px;
    display: flex;
    gap: 4px;
    justify-content: center;
    background: #fff !important;
    border: 1px solid #d8e3e9 !important;
    border-radius: 12px;
    box-shadow: 0 4px 14px rgba(23,50,71,.06);
}
.training-tab {
    min-width: 190px;
    padding: 12px 22px;
    border: 0 !important;
    border-radius: 9px;
    background: transparent !important;
    color: #5b707c !important;
    font-weight: 600;
    text-align: center;
    transition: background .18s ease, color .18s ease, box-shadow .18s ease;
}
.training-tab:hover { background: #f1f6f8 !important; color: #0b5f8a !important; }
.training-tab.active {
    background: #0b5f8a !important;
    color: #fff !important;
    box-shadow: 0 3px 9px rgba(11,95,138,.18) !important;
}

.training-card {
    background: #fff !important;
    color: #263844 !important;
    border: 1px solid #d8e3e9 !important;
    box-shadow: 0 5px 18px rgba(23,50,71,.055) !important;
}
.training-card:hover {
    transform: translateY(-2px);
    border-color: #a8cad8 !important;
    box-shadow: 0 9px 24px rgba(23,50,71,.09) !important;
}
.card-body { background: #fff !important; }
.card-body h3 { color: #173247 !important; }
.card-body p { color: #687b86 !important; }

/* Cours et QCM */
.breadcrumb, .toc, .question-card, .result-screen, .info-box,
.spec-card, .course-content, .course-body, .resource-card {
    background: #fff !important;
    color: #263844 !important;
    border-color: #d8e3e9 !important;
    box-shadow: 0 5px 18px rgba(23,50,71,.05) !important;
}
.course-header { color: #173247 !important; }
.course-header h1 { color: #173247 !important; text-shadow: none !important; }
.course-header p, .course-meta { color: #657985 !important; }
.course-body p, .course-body li { color: #334955 !important; }
.course-body h2, .course-body h3, .course-body h4 { color: #173247 !important; }
.course-body a, .toc a { color: #0b5f8a !important; }
.toc a:hover, .toc a.active { color: #084665 !important; }

.data-table, table { background: #fff !important; color: #263844 !important; }
.data-table th, th { background: #eaf3f7 !important; color: #173247 !important; }
.data-table td, td { border-color: #d8e3e9 !important; }
.data-table tr:hover { background: #f5f9fb !important; }

.answers-grid .answer-btn, .answer-btn, .qcm-btn, .course-btn, .resource-btn {
    background: #fff !important;
    color: #263844 !important;
    border: 1px solid #cbdbe3 !important;
}
.answer-btn:hover, .qcm-btn:hover, .course-btn:hover, .resource-btn:hover {
    background: #eef7fa !important;
    border-color: #8dbdce !important;
    color: #0b5f8a !important;
}
.answer-btn.correct { background: #e8f6ed !important; border-color: #68ad83 !important; color: #1d6942 !important; }
.answer-btn.wrong { background: #fcebed !important; border-color: #d77a85 !important; color: #9c2534 !important; }
.progress-bar { background: #e4ebef !important; }
.progress-fill { background: #0b5f8a !important; }

/* Ressources : page volontairement simple, sans anciennes cartes/thèmes */
body:has(.resource-actions) { background: #f5f8fa !important; }
body:has(.resource-actions) .course-header {
    max-width: 1180px;
    margin: 34px auto 0;
    padding: 30px 28px 18px;
    background: transparent !important;
    box-shadow: none !important;
    border: 0 !important;
}
body:has(.resource-actions) .course-header h1 { margin-bottom: 8px; }
body:has(.resource-actions) .course-header p { margin: 0; }
body:has(.resource-actions) .breadcrumb {
    max-width: 1180px;
    margin: 0 auto 18px;
    background: transparent !important;
    box-shadow: none !important;
    border: 0 !important;
    padding: 0 28px;
}
body:has(.resource-actions) .course-body {
    max-width: 1180px;
    margin: 0 auto 40px;
    padding: 30px;
    border: 1px solid #d8e3e9 !important;
    border-radius: 16px;
}
.resource-meta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin: 18px 0;
}
.resource-meta span {
    padding: 7px 11px;
    border: 1px solid #d8e3e9;
    border-radius: 999px;
    background: #f7fafb;
    color: #5f7480 !important;
}
.resource-actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 20px 0; }
.resource-btn { text-decoration: none; display: inline-flex; align-items: center; gap: 8px; }
.resource-btn.primary { background: #0b5f8a !important; color: #fff !important; border-color: #0b5f8a !important; }
.resource-btn.primary:hover { background: #084665 !important; color: #fff !important; }
.resource-btn.secondary:hover { background: #eef7fa !important; }
.pdf-embed-wrap {
    overflow: hidden;
    border: 1px solid #d8e3e9;
    border-radius: 12px;
    background: #eef3f5;
}
.pdf-embed-wrap iframe { display: block; width: 100%; min-height: 760px; border: 0; }
.centered-note { color: #71838d !important; }

/* Pages Atlas / Encyclopédie */
.premium-page { background: #f5f8fa !important; color: #263844 !important; }
.premium-page .premium-hero {
    background: linear-gradient(135deg,#edf5f8,#fafcfd) !important;
    color: #173247 !important;
    border: 1px solid #d8e3e9 !important;
    box-shadow: 0 8px 24px rgba(23,50,71,.06) !important;
}
.premium-page .eyebrow { color: #0b5f8a !important; }
.premium-page .premium-hero p { color: #647784 !important; }
.premium-page .panel, .premium-page .ency-card {
    background: #fff !important;
    color: #263844 !important;
    border-color: #d8e3e9 !important;
    box-shadow: 0 5px 18px rgba(23,50,71,.05) !important;
}
.premium-page .ency-card h3, .premium-page .panel h3 { color: #173247 !important; }
.premium-page .ency-card p { color: #667985 !important; }
.premium-page .ency-search input { background: #fff !important; color: #263844 !important; border-color: #cbdbe3 !important; }

footer {
    background: #edf3f6 !important;
    color: #5b707c !important;
    border-top: 1px solid #d8e3e9 !important;
}
.footer-motto { color: #0b5f8a !important; }

@media (max-width: 700px) {
    .training-tabs { width: 100%; margin-bottom: 26px; }
    .training-tab { min-width: 0; flex: 1; padding: 11px 10px; font-size: .9rem; }
    body:has(.resource-actions) .course-header { padding: 22px 16px 12px; }
    body:has(.resource-actions) .breadcrumb { padding: 0 16px; }
    body:has(.resource-actions) .course-body { margin: 0 12px 28px; padding: 18px; }
    .pdf-embed-wrap iframe { min-height: 60vh; }
}

/* Accès rapides de l'accueil */
.learning-hub-grid {
    max-width: 1200px;
    margin: 24px auto 40px;
    padding: 0 20px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    justify-content: center;
}
.learning-hub-grid:has(.learning-hub-card:only-child) {
    grid-template-columns: minmax(0, 420px);
}
.learning-hub-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 17px 18px;
    background: #fff;
    border: 1px solid #d8e3e9;
    border-radius: 13px;
    color: #173247;
    text-decoration: none;
    box-shadow: 0 5px 18px rgba(23,50,71,.05);
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.learning-hub-card:hover {
    transform: translateY(-2px);
    border-color: #a8cad8;
    box-shadow: 0 9px 24px rgba(23,50,71,.08);
}
.learning-hub-card > i {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 11px;
    background: #eaf3f7;
    color: #0b5f8a;
    flex-shrink: 0;
}
.learning-hub-card strong, .learning-hub-card span { display: block; }
.learning-hub-card strong { font-size: .98rem; }
.learning-hub-card span { margin-top: 3px; font-size: .82rem; color: #6b7e89; }
@media (max-width: 650px) {
    .learning-hub-grid { grid-template-columns: 1fr; padding: 0 12px; }
}


/* ============================================================
   V26 — Accent couleur pour les pages de cours
   Thème clair conservé, avec touches Marine plus visibles.
   ============================================================ */
body:not(:has(.resource-actions)) .course-header {
    position: relative;
    background: linear-gradient(135deg, #0b5f8a 0%, #0b78a8 55%, #163f63 100%) !important;
    color: #fff !important;
    border-bottom: 4px solid #c41e3a;
    box-shadow: 0 8px 24px rgba(11,95,138,.16);
}
body:not(:has(.resource-actions)) .course-header h1,
body:not(:has(.resource-actions)) .course-header p,
body:not(:has(.resource-actions)) .course-header .breadcrumb,
body:not(:has(.resource-actions)) .course-header .breadcrumb a {
    color: #fff !important;
}
body:not(:has(.resource-actions)) .course-header .breadcrumb a { opacity: .88; }

body:not(:has(.resource-actions)) .course-body {
    border-top: 1px solid #d9e8ef;
}

body:not(:has(.resource-actions)) .course-body h2,
body:not(:has(.resource-actions)) .course-body h3 {
    position: relative;
    color: #0b5f8a !important;
    padding-left: 14px;
    border-left: 4px solid #c41e3a;
}

body:not(:has(.resource-actions)) .course-body h2::after {
    content: "";
    display: block;
    width: 48px;
    height: 3px;
    margin-top: 7px;
    border-radius: 99px;
    background: linear-gradient(90deg,#0b78a8,#45b7d1);
}

body:not(:has(.resource-actions)) .course-body .info-box {
    border-left: 4px solid #0b78a8 !important;
    background: linear-gradient(135deg,#eef8fc,#f8fbfd) !important;
    box-shadow: 0 4px 14px rgba(11,95,138,.06);
}

body:not(:has(.resource-actions)) .course-body .spec-card,
body:not(:has(.resource-actions)) .course-body .content-card {
    border-top: 3px solid #45b7d1;
    box-shadow: 0 5px 18px rgba(23,50,71,.07);
}

body:not(:has(.resource-actions)) .course-body strong {
    color: #173247 !important;
}

body:not(:has(.resource-actions)) .course-body a {
    color: #0b5f8a !important;
}

body:not(:has(.resource-actions)) .course-body blockquote {
    border-left: 4px solid #c41e3a;
    background: #fff5f7;
}

@media (max-width: 700px) {
    body:not(:has(.resource-actions)) .course-header { border-bottom-width: 3px; }
    body:not(:has(.resource-actions)) .course-body h2,
    body:not(:has(.resource-actions)) .course-body h3 { padding-left: 10px; }
}

/* =====================================================
   THÈME SOMBRE
   Activé via l'attribut data-theme="dark" sur <html>
   (basculé par le bouton lune/soleil du menu).
   Les sélecteurs préfixés par html[data-theme="dark"]
   ont une spécificité plus forte que les règles du thème
   clair ci-dessus : pas besoin de réordonner le fichier.
   ===================================================== */
html[data-theme="dark"] {
    --primary: #4fb3e0;
    --primary-dark: #2f86ac;
    --secondary: #d7a928;
    --accent: #e2495f;
    --success: #4fbf82;
    --danger: #e2707a;
    --warning: #e0a94a;
    --info: #5bc3e8;
    --light: #0d1b24;
    --dark: #dce8ee;
    --text-secondary: #93a8b3;
    --surface: #14242f;
    --border: #24404f;
}

html[data-theme="dark"] body { background: #0d1b24 !important; color: #dce8ee !important; }

html[data-theme="dark"] header {
    background: rgba(13,27,36,.98) !important;
    border-bottom: 1px solid #24404f !important;
    box-shadow: 0 2px 10px rgba(0,0,0,.35) !important;
}
html[data-theme="dark"] .logo, html[data-theme="dark"] .logo-text h1 { color: #eaf3f7 !important; }
html[data-theme="dark"] .logo-text span { color: #8ca2ae !important; }
html[data-theme="dark"] nav ul li a { color: #b7c8d0 !important; }
html[data-theme="dark"] nav ul li a:hover { color: #4fb3e0 !important; background: #17303e !important; }
html[data-theme="dark"] nav ul li a.active { color: #4fb3e0 !important; background: #17303e !important; box-shadow: inset 0 -3px 0 #4fb3e0; }
html[data-theme="dark"] .nav-dropdown-menu {
    background: #14242f !important;
    border: 1px solid #24404f !important;
    box-shadow: 0 14px 30px rgba(0,0,0,.4) !important;
}
html[data-theme="dark"] .nav-dropdown-menu a { color: #b7c8d0 !important; }
html[data-theme="dark"] .nav-dropdown-menu a:hover { background: #1b2f3b !important; color: #4fb3e0 !important; }
html[data-theme="dark"] .nav-dropdown-menu a.active { background: #17303e !important; color: #4fb3e0 !important; box-shadow: inset 3px 0 0 #4fb3e0; }
html[data-theme="dark"] .logout-btn {
    color: #4fb3e0 !important;
    background: #17303e !important;
    border: 1.5px solid #2c4b5b !important;
}
html[data-theme="dark"] .logout-btn:hover {
    background: var(--danger) !important;
    border-color: var(--danger) !important;
    color: #0d1b24 !important;
}
html[data-theme="dark"] .theme-toggle-btn {
    color: #e0a94a !important;
    background: #17303e !important;
    border: 1.5px solid #2c4b5b !important;
}
html[data-theme="dark"] .theme-toggle-btn:hover {
    background: #1e3d4d !important;
    border-color: #3c6478 !important;
}

html[data-theme="dark"] .hero {
    background: linear-gradient(135deg, #0f2129 0%, #0d1b24 60%, #112630 100%) !important;
    color: #eaf3f7 !important;
    border-bottom: 1px solid #24404f !important;
}
html[data-theme="dark"] .hero-title { color: #eaf3f7 !important; text-shadow: none !important; }
html[data-theme="dark"] .hero-subtitle { color: #93a8b3 !important; }
html[data-theme="dark"] .section { background: #0d1b24 !important; }
html[data-theme="dark"] .section-title, html[data-theme="dark"] .category-title { color: #eaf3f7 !important; }
html[data-theme="dark"] .category-title { border-color: #24404f !important; }

html[data-theme="dark"] .training-tabs {
    background: #14242f !important;
    border: 1px solid #24404f !important;
    box-shadow: 0 4px 14px rgba(0,0,0,.3);
}
html[data-theme="dark"] .training-tab { color: #93a8b3 !important; }
html[data-theme="dark"] .training-tab:hover { background: #1b2f3b !important; color: #4fb3e0 !important; }
html[data-theme="dark"] .training-tab.active {
    background: #4fb3e0 !important;
    color: #0d1b24 !important;
    box-shadow: 0 3px 9px rgba(79,179,224,.25) !important;
}

html[data-theme="dark"] .training-card {
    background: #14242f !important;
    color: #dce8ee !important;
    border: 1px solid #24404f !important;
    box-shadow: 0 5px 18px rgba(0,0,0,.3) !important;
}
html[data-theme="dark"] .training-card:hover {
    border-color: #3c6478 !important;
    box-shadow: 0 9px 24px rgba(0,0,0,.4) !important;
}
html[data-theme="dark"] .card-body { background: #14242f !important; }
html[data-theme="dark"] .card-body h3 { color: #eaf3f7 !important; }
html[data-theme="dark"] .card-body p { color: #93a8b3 !important; }

html[data-theme="dark"] .breadcrumb, html[data-theme="dark"] .toc, html[data-theme="dark"] .question-card,
html[data-theme="dark"] .result-screen, html[data-theme="dark"] .info-box,
html[data-theme="dark"] .spec-card, html[data-theme="dark"] .course-content,
html[data-theme="dark"] .course-body, html[data-theme="dark"] .resource-card {
    background: #14242f !important;
    color: #dce8ee !important;
    border-color: #24404f !important;
    box-shadow: 0 5px 18px rgba(0,0,0,.3) !important;
}
html[data-theme="dark"] .course-header p, html[data-theme="dark"] .course-meta { color: #93a8b3 !important; }
html[data-theme="dark"] .course-body p, html[data-theme="dark"] .course-body li { color: #c3d3da !important; }
html[data-theme="dark"] .course-body h2, html[data-theme="dark"] .course-body h3, html[data-theme="dark"] .course-body h4 { color: #eaf3f7 !important; }
html[data-theme="dark"] .course-body a, html[data-theme="dark"] .toc a { color: #4fb3e0 !important; }
html[data-theme="dark"] .toc a:hover, html[data-theme="dark"] .toc a.active { color: #7cc8ea !important; }

html[data-theme="dark"] .data-table, html[data-theme="dark"] table { background: #14242f !important; color: #dce8ee !important; }
html[data-theme="dark"] .data-table th, html[data-theme="dark"] th { background: #1b2f3b !important; color: #eaf3f7 !important; }
html[data-theme="dark"] .data-table td, html[data-theme="dark"] td { border-color: #24404f !important; }
html[data-theme="dark"] .data-table tr:hover { background: #1b2f3b !important; }

html[data-theme="dark"] .answers-grid .answer-btn, html[data-theme="dark"] .answer-btn,
html[data-theme="dark"] .qcm-btn, html[data-theme="dark"] .course-btn, html[data-theme="dark"] .resource-btn {
    background: #14242f !important;
    color: #dce8ee !important;
    border: 1px solid #2c4b5b !important;
}
html[data-theme="dark"] .answer-btn:hover, html[data-theme="dark"] .qcm-btn:hover,
html[data-theme="dark"] .course-btn:hover, html[data-theme="dark"] .resource-btn:hover {
    background: #1b2f3b !important;
    border-color: #3c6478 !important;
    color: #4fb3e0 !important;
}
html[data-theme="dark"] .answer-btn.correct { background: #113a26 !important; border-color: #2e8f5a !important; color: #7fe0ab !important; }
html[data-theme="dark"] .answer-btn.wrong { background: #3a1418 !important; border-color: #a4434f !important; color: #f0a4ab !important; }
html[data-theme="dark"] .progress-bar { background: #1b2f3b !important; }
html[data-theme="dark"] .progress-fill { background: #4fb3e0 !important; }

html[data-theme="dark"] body:has(.resource-actions) { background: #0d1b24 !important; }
html[data-theme="dark"] body:has(.resource-actions) .course-body { border-color: #24404f !important; }
html[data-theme="dark"] .resource-meta span {
    border-color: #24404f !important;
    background: #17303e !important;
    color: #a8bcc6 !important;
}
html[data-theme="dark"] .resource-btn.primary { background: #4fb3e0 !important; color: #0d1b24 !important; border-color: #4fb3e0 !important; }
html[data-theme="dark"] .resource-btn.primary:hover { background: #7cc8ea !important; color: #0d1b24 !important; }
html[data-theme="dark"] .resource-btn.secondary:hover { background: #1b2f3b !important; }
html[data-theme="dark"] .pdf-embed-wrap { border-color: #24404f !important; background: #101f28 !important; }
html[data-theme="dark"] .centered-note { color: #93a8b3 !important; }

html[data-theme="dark"] .premium-page { background: #0d1b24 !important; color: #dce8ee !important; }
html[data-theme="dark"] .premium-page .premium-hero {
    background: linear-gradient(135deg,#0f2129,#0d1b24) !important;
    color: #eaf3f7 !important;
    border: 1px solid #24404f !important;
    box-shadow: 0 8px 24px rgba(0,0,0,.35) !important;
}
html[data-theme="dark"] .premium-page .eyebrow { color: #4fb3e0 !important; }
html[data-theme="dark"] .premium-page .premium-hero p { color: #93a8b3 !important; }
html[data-theme="dark"] .premium-page .panel, html[data-theme="dark"] .premium-page .ency-card {
    background: #14242f !important;
    color: #dce8ee !important;
    border-color: #24404f !important;
    box-shadow: 0 5px 18px rgba(0,0,0,.3) !important;
}
html[data-theme="dark"] .premium-page .ency-card h3, html[data-theme="dark"] .premium-page .panel h3 { color: #eaf3f7 !important; }
html[data-theme="dark"] .premium-page .ency-card p { color: #93a8b3 !important; }
html[data-theme="dark"] .premium-page .ency-search input { background: #14242f !important; color: #dce8ee !important; border-color: #2c4b5b !important; }

html[data-theme="dark"] footer {
    background: #0b141c !important;
    color: #93a8b3 !important;
    border-top: 1px solid #24404f !important;
}
html[data-theme="dark"] .footer-motto { color: #4fb3e0 !important; }

html[data-theme="dark"] .learning-hub-card {
    background: #14242f !important;
    border-color: #24404f !important;
    color: #eaf3f7 !important;
    box-shadow: 0 5px 18px rgba(0,0,0,.3) !important;
}
html[data-theme="dark"] .learning-hub-card:hover { border-color: #3c6478 !important; }
html[data-theme="dark"] .learning-hub-card > i { background: #17303e !important; color: #4fb3e0 !important; }
html[data-theme="dark"] .learning-hub-card span { color: #93a8b3 !important; }

html[data-theme="dark"] body:not(:has(.resource-actions)) .course-header {
    background: linear-gradient(135deg, #0f2f42 0%, #123b53 55%, #0b1c28 100%) !important;
    border-bottom: 4px solid #b5314a;
}
html[data-theme="dark"] body:not(:has(.resource-actions)) .course-body { border-top-color: #24404f !important; }
html[data-theme="dark"] body:not(:has(.resource-actions)) .course-body h2,
html[data-theme="dark"] body:not(:has(.resource-actions)) .course-body h3 { color: #4fb3e0 !important; }
html[data-theme="dark"] body:not(:has(.resource-actions)) .course-body .info-box {
    border-left-color: #2f86ac !important;
    background: linear-gradient(135deg,#132c37,#14242f) !important;
}
html[data-theme="dark"] body:not(:has(.resource-actions)) .course-body strong { color: #eaf3f7 !important; }
html[data-theme="dark"] body:not(:has(.resource-actions)) .course-body a { color: #4fb3e0 !important; }
html[data-theme="dark"] body:not(:has(.resource-actions)) .course-body blockquote {
    background: #2a1519 !important;
}
