/*
Theme Name: Formation Sécurité
Theme URI: https://lebcommunication.fr
Author: LEB Communication
Author URI: https://lebcommunication.fr
Description: Plateforme de formation en ligne pour les métiers de la sécurité (Pompiers, Police, Gendarmerie, Sécurité Civile). Inclut un générateur de scénarios visuels, un LMS complet avec quiz et suivi de progression.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.4
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: formation-securite
Tags: education, lms, custom-colors, custom-logo, featured-images
*/

/* ============================================
   VARIABLES CSS
============================================ */
:root {
    /* Couleurs principales */
    --primary-color: #1e3a5f;
    --primary-light: #2d5a8a;
    --primary-dark: #0f1f33;
    --secondary-color: #c9302c;
    --secondary-light: #e74c3c;
    --accent-color: #f39c12;
    
    /* Couleurs par métier */
    --pompiers-color: #c9302c;
    --police-color: #1e3a5f;
    --gendarmerie-color: #003366;
    --securite-civile-color: #ff6600;
    
    /* Couleurs neutres */
    --white: #ffffff;
    --light-gray: #f8f9fa;
    --gray: #6c757d;
    --dark-gray: #343a40;
    --black: #212529;
    
    /* Couleurs de statut */
    --success: #28a745;
    --warning: #ffc107;
    --danger: #dc3545;
    --info: #17a2b8;
    
    /* Typography */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-heading: 'Poppins', var(--font-primary);
    
    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-xxl: 3rem;
    
    /* Border radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 20px;
    --radius-full: 1000px;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1);
    --shadow-xl: 0 20px 25px rgba(0,0,0,0.15);
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 300ms ease;
    --transition-slow: 500ms ease;

    /* ============================
       DESIGN SYSTEM (refonte 2026)
    ============================ */
    /* Helmet arcs (signature visuelle - rouge translucide) */
    --ds-helmet-red-soft: rgba(201, 48, 44, 0.05);
    --ds-helmet-red: rgba(201, 48, 44, 0.08);
    --ds-helmet-red-strong: rgba(201, 48, 44, 0.14);
    --ds-helmet-navy-soft: rgba(30, 58, 95, 0.04);

    /* Surfaces */
    --ds-surface-page: #f5f6f8;
    --ds-surface-card: #ffffff;
    --ds-surface-muted: #eef0f4;
    --ds-border-subtle: rgba(15, 31, 51, 0.08);
    --ds-border: rgba(15, 31, 51, 0.12);

    /* Texte */
    --ds-text-eyebrow: #6c757d;
    --ds-text-strong: #0f1f33;
    --ds-text-on-emergency: #ffffff;

    /* Couleur signature (alias rouge intervention) */
    --ds-emergency: #c9302c;
    --ds-emergency-bright: #e63946;
    --ds-emergency-dark: #8b1a1a;

    /* Shadows raffinées */
    --ds-shadow-xs: 0 1px 2px rgba(15, 31, 51, 0.04), 0 1px 1px rgba(15, 31, 51, 0.06);
    --ds-shadow-sm: 0 2px 4px rgba(15, 31, 51, 0.04), 0 4px 8px rgba(15, 31, 51, 0.05);
    --ds-shadow-md: 0 6px 12px -2px rgba(15, 31, 51, 0.08), 0 4px 8px -2px rgba(15, 31, 51, 0.06);
    --ds-shadow-lg: 0 16px 28px -8px rgba(15, 31, 51, 0.14), 0 8px 16px -8px rgba(15, 31, 51, 0.08);
    --ds-shadow-emergency: 0 8px 20px -6px rgba(201, 48, 44, 0.35);

    /* Typographie display */
    --ds-text-display: clamp(2.25rem, 4vw, 3rem);
    --ds-text-h1: clamp(1.75rem, 3vw, 2.25rem);
    --ds-text-h2: clamp(1.375rem, 2vw, 1.75rem);
    --ds-text-eyebrow-size: 0.75rem;

    /* Motion */
    --ds-ease-spring: cubic-bezier(0.22, 1, 0.36, 1);
    --ds-ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ds-duration-fast: 180ms;
    --ds-duration-base: 280ms;
    --ds-duration-slow: 480ms;
}

/* ============================================
   RESET & BASE
============================================ */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--dark-gray);
    background-color: var(--light-gray);
    margin: 0;
    padding: 0;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    line-height: 1.3;
    color: var(--primary-dark);
    margin-top: 0;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-light);
}

img {
    max-width: 100%;
    height: auto;
}

/* ============================================
   LAYOUT CONTAINERS
============================================ */
.site-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.site-content,
.site-main {
    flex: 1;
}

/* Les pages avec hero doivent coller à la nav */
.single-formation,
.hero-section,
.archive-hero {
    margin-top: 0;
}

/* Pages sans hero - ajouter padding en haut */
.site-main > .container:first-child,
.site-content > .container:first-child {
    padding-top: var(--spacing-xl);
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

.container-narrow {
    max-width: 800px;
}

.container-wide {
    max-width: 1400px;
}

/* ============================================
   HEADER - SAAS NAV (refonte 2026)
   Esprit Linear / Stripe / Vercel : sobre, aéré,
   sentence case, hover pill discret, active pill teintée.
============================================ */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    backdrop-filter: saturate(180%) blur(28px);
    -webkit-backdrop-filter: saturate(180%) blur(28px);
    border-bottom: 0;
    box-shadow: none;
    transition: background var(--ds-duration-base) var(--ds-ease-out);
}

.site-header.scrolled {
    background: rgba(255, 255, 255, 0.78);
    border-bottom: 0;
    box-shadow: none;
}

/* Container plus large pour la nav (style SaaS) */
.site-header > .container {
    max-width: 1360px;
}

/* Compenser le header fixed */
.site-main {
    padding-top: 72px;
}

.site-header .header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-xl);
    padding: 22px 0;
    transition: padding var(--ds-duration-base) var(--ds-ease-out);
}

.site-header.scrolled .header-inner {
    padding: 22px 0;
}

/* ---- Logo ---- */
.site-header .site-logo {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.site-header .site-logo img {
    height: 56px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    transition: height var(--ds-duration-base) var(--ds-ease-out);
}

.site-header.scrolled .site-logo img {
    height: 48px;
}

.site-header .site-logo .logo-text {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-heading);
    font-size: 1.0625rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--ds-text-strong);
}

.site-header .site-logo .logo-text i {
    color: var(--ds-emergency);
    font-size: 1.125rem;
}

@media (max-width: 768px) {
    .site-header .site-logo img {
        height: 44px;
    }
    .site-header .site-logo .logo-text {
        font-size: 1.0625rem;
    }
}

/* ---- Nav principale (SaaS pill) ---- */
.site-header .main-navigation {
    flex: 1;
    display: flex;
    justify-content: center;
}

.site-header .main-navigation ul,
.site-header .main-navigation .nav-menu {
    display: flex;
    align-items: center;
    gap: 2px;
    list-style: none;
    margin: 0;
    padding: 6px;
    background: rgba(15, 31, 51, 0.025);
    border: 1px solid rgba(15, 31, 51, 0.04);
    border-radius: 999px;
}

.site-header .main-navigation li {
    margin: 0;
    padding: 0;
}

.site-header .main-navigation a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    font-family: var(--font-primary);
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.2;
    letter-spacing: 0;
    text-transform: none;
    color: #4a5568;
    border-radius: 999px;
    background: transparent;
    transition: color var(--ds-duration-fast) var(--ds-ease-out),
                background-color var(--ds-duration-fast) var(--ds-ease-out);
    position: relative;
}

.site-header .main-navigation a::after,
.site-header .main-navigation a::before {
    display: none;
}

.site-header .main-navigation a:hover {
    color: var(--ds-text-strong);
    background: rgba(15, 31, 51, 0.055);
}

.site-header .main-navigation a:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.site-header .main-navigation .current-menu-item > a,
.site-header .main-navigation .current-menu-parent > a,
.site-header .main-navigation .current-menu-ancestor > a,
.site-header .main-navigation .current_page_item > a {
    color: #fff;
    background: var(--ds-text-strong);
    box-shadow: none;
}

.site-header .main-navigation .current-menu-item > a:hover,
.site-header .main-navigation .current-menu-parent > a:hover,
.site-header .main-navigation .current-menu-ancestor > a:hover,
.site-header .main-navigation .current_page_item > a:hover {
    background: var(--ds-text-strong);
    color: #fff;
}

/* ---- Actions header ---- */
.site-header .header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.site-header .user-menu {
    position: relative;
}

.site-header .user-avatar {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    cursor: pointer;
    border: none;
    box-shadow: 0 0 0 1px rgba(15, 31, 51, 0.08);
}

/* User Menu Toggle (pill style SaaS) */
.site-header .user-menu-toggle {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 5px 12px 5px 5px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 999px;
    cursor: pointer;
    transition: background-color var(--ds-duration-fast) var(--ds-ease-out),
                border-color var(--ds-duration-fast) var(--ds-ease-out);
    font-family: var(--font-primary);
}

.site-header .user-menu-toggle:hover {
    background: rgba(15, 31, 51, 0.045);
    border-color: rgba(15, 31, 51, 0.06);
}

.site-header .user-menu.active .user-menu-toggle {
    background: rgba(15, 31, 51, 0.05);
    border-color: rgba(15, 31, 51, 0.08);
}

.site-header .user-menu-toggle img,
.site-header .user-menu-toggle .user-avatar,
.site-header .user-menu-toggle img.user-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    overflow: hidden;
    object-fit: cover;
    box-shadow: 0 0 0 1px rgba(15, 31, 51, 0.08);
    border: none;
}

.site-header .user-menu-toggle .user-name {
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--ds-text-strong);
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-transform: none;
    letter-spacing: 0;
}

.site-header .user-menu-toggle i {
    font-size: 0.7rem;
    color: var(--gray);
    transition: transform var(--ds-duration-fast) var(--ds-ease-out);
}

.site-header .user-menu.active .user-menu-toggle i {
    transform: rotate(180deg);
    color: var(--ds-text-strong);
}

/* User Dropdown */
.site-header .user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 240px;
    background: var(--white);
    border: 1px solid rgba(15, 31, 51, 0.08);
    border-radius: 14px;
    box-shadow: 0 8px 24px -4px rgba(15, 31, 51, 0.12),
                0 16px 40px -8px rgba(15, 31, 51, 0.08);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity var(--ds-duration-fast) var(--ds-ease-out),
                transform var(--ds-duration-fast) var(--ds-ease-out),
                visibility var(--ds-duration-fast) var(--ds-ease-out);
    z-index: 1001;
    overflow: hidden;
    padding: 6px;
}

.site-header .user-menu.active .user-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.site-header .user-dropdown a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    color: var(--ds-text-strong);
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 8px;
    transition: background-color var(--ds-duration-fast) var(--ds-ease-out),
                color var(--ds-duration-fast) var(--ds-ease-out);
}

.site-header .user-dropdown a:hover {
    background: rgba(15, 31, 51, 0.05);
    color: var(--ds-text-strong);
}

.site-header .user-dropdown a i {
    width: 16px;
    text-align: center;
    color: var(--gray);
    font-size: 0.875rem;
    transition: color var(--ds-duration-fast) var(--ds-ease-out);
}

.site-header .user-dropdown a:hover i {
    color: var(--primary-color);
}

.site-header .user-dropdown .dropdown-divider {
    height: 1px;
    background: rgba(15, 31, 51, 0.08);
    margin: 6px 4px;
}

.site-header .user-dropdown .logout-link {
    color: var(--danger);
}

.site-header .user-dropdown .logout-link i {
    color: var(--danger);
}

.site-header .user-dropdown .logout-link:hover {
    background: rgba(220, 53, 69, 0.06);
    color: var(--danger);
}

.site-header .user-dropdown .logout-link:hover i {
    color: var(--danger);
}

/* Header Buttons (utilisateur non connecté) */
.site-header .header-buttons {
    display: flex;
    gap: 8px;
}

/* Mobile Menu Toggle (Hamburger) */
.site-header .mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 38px;
    height: 38px;
    padding: 8px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    z-index: 1002;
    transition: background-color var(--ds-duration-fast) var(--ds-ease-out),
                border-color var(--ds-duration-fast) var(--ds-ease-out);
}

.site-header .mobile-menu-toggle:hover {
    background: rgba(15, 31, 51, 0.04);
    border-color: rgba(15, 31, 51, 0.06);
}

.site-header .hamburger-line {
    display: block;
    width: 20px;
    height: 1.5px;
    background: var(--ds-text-strong);
    border-radius: 2px;
    transition: all var(--ds-duration-fast) var(--ds-ease-out);
}

.site-header .mobile-menu-toggle.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(4px, 4px);
}

.site-header .mobile-menu-toggle.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.site-header .mobile-menu-toggle.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile Menu */
.site-header .mobile-menu {
    display: none;
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    background: #ffffff;
    border-top: 1px solid rgba(15, 31, 51, 0.06);
    box-shadow: 0 10px 30px -8px rgba(15, 31, 51, 0.15);
    padding: 16px;
    z-index: 9999;
    max-height: calc(100vh - 64px);
    overflow-y: auto;
}

.site-header .mobile-menu.active {
    display: block;
}

.site-header .mobile-nav-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.site-header .mobile-nav-menu li {
    border: none;
    background: transparent;
}

.site-header .mobile-nav-menu li:last-child {
    border-bottom: none;
}

.site-header .mobile-nav-menu a {
    display: block;
    padding: 12px 14px;
    font-weight: 500;
    font-size: 0.9375rem;
    color: var(--ds-text-strong);
    text-decoration: none;
    text-transform: none;
    letter-spacing: 0;
    border-radius: 10px;
    transition: background-color var(--ds-duration-fast) var(--ds-ease-out);
}

.site-header .mobile-nav-menu a:hover {
    background: rgba(15, 31, 51, 0.05);
    color: var(--ds-text-strong);
}

.site-header .mobile-nav-menu .current-menu-item > a,
.site-header .mobile-nav-menu .current_page_item > a {
    background: rgba(30, 58, 95, 0.08);
    color: var(--primary-color);
}

.site-header .mobile-menu-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(15, 31, 51, 0.08);
}

/* Responsive Header - Mobile */
@media (max-width: 1024px) {
    .site-header .main-navigation {
        display: none;
    }

    .site-header .header-inner {
        display: grid;
        grid-template-columns: auto 1fr auto;
        align-items: center;
        width: 100%;
        gap: 12px;
    }

    .site-header .site-logo {
        grid-column: 1;
    }

    .site-header .header-actions {
        grid-column: 2 / 4;
        display: grid;
        grid-template-columns: 1fr auto;
        align-items: center;
        width: 100%;
    }

    .site-header .user-menu,
    .site-header .header-buttons {
        justify-self: end;
        margin-right: 4px;
    }

    .site-header .mobile-menu-toggle {
        display: flex;
        flex-direction: column;
        justify-self: end;
    }

    .site-header .user-menu-toggle .user-name,
    .site-header .user-menu-toggle i.fa-chevron-down {
        display: none;
    }

    .site-header .user-menu-toggle img,
    .site-header .user-menu-toggle .user-avatar {
        width: 30px;
        height: 30px;
    }

    .site-header .user-menu-toggle {
        padding: 3px;
        border: none;
        background: transparent;
    }
}

@media (max-width: 576px) {
    .site-header .header-buttons {
        display: none;
    }

    .site-header .site-logo img {
        height: 30px;
    }

    .site-main {
        padding-top: 64px;
    }
}

/* ============================================
   BUTTONS
============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-lg);
    font-family: var(--font-primary);
    font-size: 1rem;
    font-weight: 500;
    text-align: center;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
}

.btn-primary {
    background: var(--primary-color);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--primary-light);
    color: var(--white);
}

.btn-secondary {
    background: var(--secondary-color);
    color: var(--white);
}

.btn-secondary:hover {
    background: var(--secondary-light);
    color: var(--white);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: var(--white);
}

.btn-success {
    background: var(--success);
    color: var(--white);
}

.btn-danger {
    background: var(--danger);
    color: var(--white);
}

.btn-lg {
    padding: var(--spacing-md) var(--spacing-xl);
    font-size: 1.125rem;
}

.btn-sm {
    padding: var(--spacing-xs) var(--spacing-md);
    font-size: 0.875rem;
}

.btn-block {
    width: 100%;
}

/* ============================================
   CARDS
============================================ */
.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    transition: all var(--transition-normal);
}

.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.card-image {
    position: relative;
    aspect-ratio: 16/9;
    overflow: hidden;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-badge {
    position: absolute;
    top: var(--spacing-md);
    left: var(--spacing-md);
    padding: var(--spacing-xs) var(--spacing-sm);
    background: var(--primary-color);
    color: var(--white);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    border-radius: var(--radius-sm);
}

.card-badge.pompiers { background: var(--pompiers-color); }
.card-badge.police { background: var(--police-color); }
.card-badge.gendarmerie { background: var(--gendarmerie-color); }
.card-badge.securite-civile { background: var(--securite-civile-color); }

.card-content {
    padding: var(--spacing-lg);
}

.card-title {
    font-size: 1.25rem;
    margin-bottom: var(--spacing-sm);
}

.card-excerpt {
    color: var(--gray);
    margin-bottom: var(--spacing-md);
}

.card-meta {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    font-size: 0.875rem;
    color: var(--gray);
}

.card-footer {
    padding: var(--spacing-md) var(--spacing-lg);
    border-top: 1px solid var(--light-gray);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Card horizontal (for formations in progress) */
.card-horizontal {
    display: flex;
    flex-direction: row;
}

.card-horizontal .card-image {
    width: 180px;
    min-width: 180px;
    aspect-ratio: auto;
}

.card-horizontal .card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.card-horizontal .card-badge {
    position: static;
    display: inline-block;
    margin-bottom: var(--spacing-xs);
    width: fit-content;
}

/* ============================================
   GRID SYSTEM
============================================ */
.grid {
    display: grid;
    gap: var(--spacing-lg);
}

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

/* Tablet Landscape (1024-1366px) */
@media (min-width: 1024px) and (max-width: 1366px) {
    .grid-4 { grid-template-columns: repeat(4, 1fr); gap: var(--spacing-md); }
    .grid-3 { grid-template-columns: repeat(3, 1fr); gap: var(--spacing-md); }
    .grid-2 { grid-template-columns: repeat(2, 1fr); gap: var(--spacing-md); }

    .card-content {
        padding: var(--spacing-md);
    }

    .card-title {
        font-size: 1rem;
        line-height: 1.3;
        margin-bottom: var(--spacing-xs);
        /* Truncate long titles */
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .card-excerpt {
        font-size: 0.8rem;
        margin-bottom: var(--spacing-sm);
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .card-meta {
        font-size: 0.75rem;
        gap: var(--spacing-sm);
        flex-wrap: wrap;
    }

    .card-footer {
        padding: var(--spacing-sm) var(--spacing-md);
    }

    .card-footer .btn {
        font-size: 0.8rem;
        padding: 6px 12px;
    }

    .card-badge {
        font-size: 0.65rem;
        padding: 3px 6px;
        top: var(--spacing-sm);
        left: var(--spacing-sm);
    }

    .card-image {
        aspect-ratio: 16/10;
    }
}

/* Tablet Portrait / Small Tablet (768-1024px) */
@media (min-width: 768px) and (max-width: 1024px) {
    .grid-4 { grid-template-columns: repeat(3, 1fr); gap: var(--spacing-md); }
    .grid-3 { grid-template-columns: repeat(2, 1fr); gap: var(--spacing-md); }
    .grid-2 { grid-template-columns: repeat(2, 1fr); gap: var(--spacing-md); }

    .card-content {
        padding: var(--spacing-sm);
    }

    .card-title {
        font-size: 0.95rem;
        line-height: 1.3;
        margin-bottom: var(--spacing-xs);
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .card-excerpt {
        font-size: 0.8rem;
        margin-bottom: var(--spacing-xs);
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .card-meta {
        font-size: 0.75rem;
        gap: var(--spacing-xs);
        flex-wrap: wrap;
    }

    .card-footer {
        padding: var(--spacing-xs) var(--spacing-sm);
    }

    .card-footer .btn {
        font-size: 0.75rem;
        padding: 5px 10px;
    }

    .card-badge {
        font-size: 0.6rem;
        padding: 2px 5px;
        top: var(--spacing-xs);
        left: var(--spacing-xs);
    }

    .card-image {
        aspect-ratio: 16/10;
    }
}

@media (max-width: 768px) {
    .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }

    .card-title {
        font-size: 1.1rem;
    }

    .card-content {
        padding: var(--spacing-md);
    }
}
.scenarios-grid {
    margin-top: 2%;
    margin-bottom: 3rem;
}
/* ============================================
   DASHBOARD
============================================ */
.dashboard-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: var(--spacing-xl);
    min-height: calc(100vh - 80px);
}

.dashboard-sidebar {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    height: fit-content;
    position: sticky;
    top: 100px;
}
.dashboard-section h2 {
    margin-top: 2%;
}
.dashboard-section .grid {
    margin-top: 2%;
}
.dashboard-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}
.dashboard-menu ul {
    list-style: none;
}
.dashboard-menu li {
    margin-bottom: var(--spacing-xs);
}

.dashboard-menu a {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    color: var(--dark-gray);
    transition: all var(--transition-fast);
}


.dashboard-menu a:hover,
.dashboard-menu a.active {
    background: var(--primary-color);
    color: var(--white);
}

.dashboard-menu .icon {
    width: 20px;
    height: 20px;
}

.dashboard-menu .menu-divider {
    margin: var(--spacing-md) 0;
    padding: 0 var(--spacing-md);
}

.dashboard-menu .menu-divider span {
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray);
    padding-top: var(--spacing-sm);
    border-top: 1px solid var(--light-gray);
}

.dashboard-menu .menu-highlight a {
    background: var(--warning);
    color: var(--dark-gray);
    font-weight: 500;
}

.dashboard-menu .menu-highlight a:hover {
    background: #e0a800;
    color: var(--dark-gray);
}

.badge-warning {
    background: var(--warning);
    color: var(--dark-gray);
}

.dashboard-main {
    padding: var(--spacing-lg);
}

.dashboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--spacing-xl);
}

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
}

.stat-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-xs);
}

.stat-card .stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    margin-bottom: var(--spacing-xs);
}

.stat-card .stat-icon i {
    color: white;
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1.2;
}

.stat-card .stat-label {
    color: var(--gray);
    font-size: 0.8rem;
    line-height: 1.3;
}

/* Tablet Landscape (1024-1366px) */
@media (min-width: 1024px) and (max-width: 1366px) {
    .dashboard-layout {
        grid-template-columns: 240px 1fr;
        gap: var(--spacing-lg);
    }

    .dashboard-sidebar {
        padding: var(--spacing-md);
    }

    .user-profile-card {
        padding: var(--spacing-sm);
    }

    .user-profile-card h3 {
        font-size: 1rem;
    }

    .dashboard-menu ul li a {
        padding: 10px var(--spacing-sm);
        font-size: 0.85rem;
    }

    .dashboard-menu ul li a i {
        font-size: 1rem;
        width: 20px;
    }

    .dashboard-main {
        padding: var(--spacing-md);
    }

    .dashboard-header h1 {
        font-size: 1.4rem;
    }

    .dashboard-stats {
        grid-template-columns: repeat(4, 1fr);
        gap: var(--spacing-sm);
    }

    .stat-card {
        padding: var(--spacing-sm);
    }

    .stat-card .stat-icon {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .stat-card .stat-value {
        font-size: 1.3rem;
    }

    .stat-card .stat-label {
        font-size: 0.75rem;
    }

    .dashboard-section {
        padding: var(--spacing-md);
        margin-bottom: var(--spacing-md);
    }

    .dashboard-section h2 {
        font-size: 1.1rem;
    }

    .section-header {
        margin-bottom: var(--spacing-md);
    }

    /* Card horizontal compact */
    .card-horizontal {
        flex-direction: row;
    }

    .card-horizontal .card-image {
        width: 120px;
        min-width: 120px;
    }

    .card-horizontal .card-content {
        padding: var(--spacing-sm);
    }

    .card-horizontal .card-title {
        font-size: 0.95rem;
    }

    .progress-label {
        font-size: 0.75rem;
    }

    .progress-bar {
        height: 6px;
    }
}

/* Tablet Portrait (768-1024px) */
@media (min-width: 768px) and (max-width: 1024px) {
    .dashboard-layout {
        grid-template-columns: 1fr;
    }

    .dashboard-sidebar {
        position: static;
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: var(--spacing-md);
        padding: var(--spacing-md);
    }

    .user-profile-card {
        display: flex;
        align-items: center;
        gap: var(--spacing-sm);
        flex-shrink: 0;
    }

    .user-profile-card img {
        width: 50px !important;
        height: 50px !important;
    }

    .user-profile-card h3 {
        font-size: 1rem;
        margin: 0;
    }

    .user-profile-card .user-role {
        margin: 0;
    }

    .dashboard-menu {
        flex: 1;
    }

    .dashboard-menu ul {
        display: flex;
        flex-wrap: wrap;
        gap: var(--spacing-xs);
    }

    .dashboard-menu ul li {
        flex: 0 0 auto;
    }

    .dashboard-menu ul li a {
        padding: 8px 12px;
        font-size: 0.8rem;
        white-space: nowrap;
    }

    .dashboard-menu ul li a span {
        display: inline;
    }

    .dashboard-menu .menu-divider {
        display: none;
    }

    .dashboard-stats {
        grid-template-columns: repeat(4, 1fr);
        gap: var(--spacing-sm);
    }

    .stat-card {
        padding: var(--spacing-sm);
    }

    .stat-card .stat-value {
        font-size: 1.2rem;
    }

    .stat-card .stat-label {
        font-size: 0.7rem;
    }
}

@media (max-width: 768px) {
    .dashboard-layout {
        grid-template-columns: 1fr;
    }

    .dashboard-sidebar {
        position: static;
    }

    .dashboard-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 768px) {
    .dashboard-layout {
        grid-template-columns: 1fr !important;
        max-width: 100%;
        overflow-x: hidden;
    }

    .dashboard-sidebar {
        order: -1;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box;
        padding: var(--spacing-md) !important;
    }

    .dashboard-main {
        order: 1;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box;
        padding: var(--spacing-md) !important;
        overflow-x: hidden;
    }

    .dashboard-menu ul {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
        width: 100%;
    }

    .dashboard-menu ul li {
        width: 100%;
    }

    .dashboard-menu ul li a {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 15px 5px;
        font-size: 0.75rem;
        gap: 8px;
        background: var(--light-gray);
        border-radius: var(--radius-md);
    }

    .dashboard-menu ul li a i {
        font-size: 1.2rem;
    }

    .dashboard-menu ul li a span {
        display: block;
        white-space: normal;
        line-height: 1.2;
    }

    .dashboard-menu .menu-divider {
        display: none;
    }

    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: 1fr !important;
    }

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

    .quick-actions {
        grid-template-columns: 1fr;
    }

    .quick-action-card {
        padding: var(--spacing-sm);
    }

    .quick-action-icon {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start !important;
        gap: var(--spacing-sm);
    }
}

@media (max-width: 576px) {
    .stats-grid {
        grid-template-columns: 1fr !important;
    }
    
    .card-footer {
        flex-direction: column;
        gap: var(--spacing-xs);
    }
    
    .card-footer .btn {
        width: 100%;
        text-align: center;
    }
}
@media (max-width: 768px) {
    .dashboard-hero {
        flex-direction: column;
        text-align: center;
    }
    
    .dashboard-hero-content {
        margin-bottom: var(--spacing-md);
    }
    
    .dashboard-hero-actions {
        flex-direction: column;
        width: 100%;
        gap: var(--spacing-sm);
    }
    
    .dashboard-hero-actions .btn {
        width: 100%;
    }
}
@media (max-width: 768px) {
    .dashboard-header {
        flex-direction: column;
        text-align: center;
        gap: var(--spacing-md);
    }

    .dashboard-header .header-actions {
        flex-direction: column;
        width: 100%;
        gap: var(--spacing-sm);
    }

    .dashboard-header .header-actions .btn {
        width: 100%;
    }
}
/* ============================================
   PROGRESS BAR
============================================ */
.progress-bar {
    height: 8px;
    background: var(--light-gray);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-bar .progress {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
    border-radius: var(--radius-full);
    transition: width var(--transition-normal);
}

.progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
    margin-bottom: var(--spacing-xs);
}

/* ============================================
   ARCHIVE HERO (Formations, Scénarios)
============================================ */
.archive-hero {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: var(--white);
    padding: var(--spacing-xxl) 0;
    text-align: center;
}

.archive-hero h1 {
    color: var(--white);
    margin-bottom: var(--spacing-sm);
}

.archive-hero h1 i {
    margin-right: var(--spacing-sm);
}

.archive-hero p {
    font-size: 1.125rem;
    opacity: 0.9;
    margin: 0;
}

.archive-hero-scenarios {
    background: linear-gradient(135deg, var(--pompiers-color), #8b1a1a);
}

/* Message informatif filtrage par métier */
.metier-filter-notice {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border-left: 4px solid var(--primary-color);
    padding: var(--spacing-md) var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: 0.9rem;
    color: var(--dark-gray);
}

.metier-filter-notice i {
    color: var(--primary-color);
    font-size: 1.2rem;
}

.metier-filter-notice strong {
    color: var(--primary-color);
}

/* Notice scénarios liés */
.linked-scenarios-notice,
.section-notice {
    background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
    border-left: 4px solid #ff9800;
    padding: var(--spacing-sm) var(--spacing-md);
    margin-bottom: var(--spacing-lg);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: 0.85rem;
    color: var(--dark-gray);
}

.linked-scenarios-notice i,
.section-notice i {
    color: #ff9800;
    font-size: 1rem;
}

.archive-filters {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
    box-shadow: var(--shadow-md);
}

.spec-scenar{
    margin: 2%;
}
#ctascenar {
    margin-top: 2%
}
/* ============================================
   FORMATION / COURS
============================================ */
.formation-hero {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: var(--white);
    padding: var(--spacing-xl) 0 var(--spacing-xxl);
}

/* Breadcrumb dans le hero - en blanc */
.formation-hero .breadcrumb {
    margin-bottom: var(--spacing-lg);
}

.formation-hero .breadcrumb,
.formation-hero .breadcrumb a,
.formation-hero .breadcrumb .separator {
    color: rgba(255,255,255,0.7);
}

.formation-hero .breadcrumb a:hover {
    color: var(--white);
}

.formation-hero .breadcrumb .current {
    color: var(--white);
}

/* Layout hero avec image */
.formation-hero-content {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: var(--spacing-xl);
    align-items: center;
}

.formation-hero-text {
    flex: 1;
}

.formation-hero h1 {
    color: var(--white);
    margin-bottom: var(--spacing-md);
    font-size: 2.25rem;
}

.formation-excerpt {
    font-size: 1.125rem;
    opacity: 0.9;
    margin-bottom: var(--spacing-lg);
}

.formation-badges {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
}

.formation-badges .badge {
    padding: var(--spacing-xs) var(--spacing-md);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    background: rgba(255,255,255,0.2);
    color: var(--white);
}

.formation-badges .badge-pompiers {
    background: var(--pompiers-color);
}

.formation-badges .badge-police {
    background: var(--police-color);
}

.formation-badges .badge-gendarmerie {
    background: var(--gendarmerie-color);
}

.formation-badges .badge-securite-civile {
    background: var(--securite-civile-color);
}

.formation-meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    color: rgba(255,255,255,0.9);
}

.formation-meta-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.formation-meta-item i {
    opacity: 0.8;
}

/* Image du hero */
.formation-hero-image {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-xl);
}

.formation-hero-image img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
}

/* Responsive */
@media (max-width: 992px) {
    .formation-hero-content {
        grid-template-columns: 1fr;
    }
    
    .formation-hero-image {
        display: none;
    }
}

/* ============================================
   COURS LIST
============================================ */

.cours-list {
    background: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.cours-item {
    display: flex;
    align-items: center;
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--light-gray);
    transition: background var(--transition-fast);
}

.cours-item:last-child {
    border-bottom: none;
}

.cours-item:hover {
    background: var(--light-gray);
}

.cours-number {
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    color: var(--white);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    margin-right: var(--spacing-lg);
    flex-shrink: 0;
}

.cours-item.completed .cours-number {
    background: var(--success);
}

.cours-info {
    flex: 1;
}

.cours-title {
    font-weight: 600;
    margin-bottom: var(--spacing-xs);
}

.cours-duration {
    font-size: 0.875rem;
    color: var(--gray);
}

.cours-status {
    margin-left: var(--spacing-lg);
}

/* ============================================
   QUIZ
============================================ */
.quiz-container {
    max-width: 800px;
    margin: 0 auto;
}

.quiz-progress {
    margin-bottom: var(--spacing-xl);
}

.quiz-question {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    margin-bottom: var(--spacing-lg);
}

.question-number {
    font-size: 0.875rem;
    color: var(--gray);
    margin-bottom: var(--spacing-sm);
}

.question-text {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: var(--spacing-lg);
}

.answers-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.answer-item {
    margin-bottom: var(--spacing-md);
}

.answer-label {
    display: flex;
    align-items: center;
    padding: var(--spacing-md) var(--spacing-lg);
    border: 2px solid var(--light-gray);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.answer-label:hover {
    border-color: var(--primary-color);
    background: rgba(30, 58, 95, 0.05);
}

.answer-item input:checked + .answer-label {
    border-color: var(--primary-color);
    background: rgba(30, 58, 95, 0.1);
}

.answer-item input {
    display: none;
}

.answer-marker {
    width: 24px;
    height: 24px;
    border: 2px solid var(--gray);
    border-radius: var(--radius-full);
    margin-right: var(--spacing-md);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.answer-item input:checked + .answer-label .answer-marker {
    border-color: var(--primary-color);
    background: var(--primary-color);
}

.answer-item input:checked + .answer-label .answer-marker::after {
    content: '✓';
    color: var(--white);
    font-size: 14px;
}

.answer-correct .answer-label {
    border-color: var(--success);
    background: rgba(40, 167, 69, 0.1);
}

.answer-incorrect .answer-label {
    border-color: var(--danger);
    background: rgba(220, 53, 69, 0.1);
}

.quiz-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: var(--spacing-xl);
}

.quiz-results {
    text-align: center;
    padding: var(--spacing-xxl);
}

.quiz-score {
    font-size: 4rem;
    font-weight: 700;
    color: var(--primary-color);
}

.quiz-score.passed {
    color: var(--success);
}

.quiz-score.failed {
    color: var(--danger);
}

/* ============================================
   SCENARIO EDITOR
============================================ */
.scenario-editor {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: var(--spacing-lg);
    height: calc(100vh - 150px);
}

.scenario-sidebar {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    overflow-y: auto;
}

.scenario-sidebar h3 {
    font-size: 1rem;
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-sm);
    border-bottom: 1px solid var(--light-gray);
}

.composants-category {
    margin-bottom: var(--spacing-lg);
}

.composants-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-sm);
}

.composant-item {
    aspect-ratio: 1;
    border: 2px solid var(--light-gray);
    border-radius: var(--radius-md);
    padding: var(--spacing-xs);
    cursor: grab;
    transition: all var(--transition-fast);
    background: var(--white);
}

.composant-item:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
}

.composant-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.scenario-canvas-container {
    background: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    position: relative;
}

.scenario-toolbar {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    background: var(--dark-gray);
    color: var(--white);
}

.scenario-toolbar .btn {
    background: rgba(255,255,255,0.1);
    color: var(--white);
    border: 1px solid rgba(255,255,255,0.2);
}

.scenario-toolbar .btn:hover {
    background: rgba(255,255,255,0.2);
}

.scenario-canvas {
    width: 100%;
    height: calc(100% - 60px);
    background: #1a1a1a;
    background-image: 
        linear-gradient(rgba(255,255,255,0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.05) 1px, transparent 1px);
    background-size: 20px 20px;
}

.canvas-element {
    position: absolute;
    cursor: move;
    user-select: none;
}

.canvas-element.selected {
    outline: 2px dashed var(--primary-color);
    outline-offset: 4px;
}

.canvas-element .resize-handle {
    position: absolute;
    width: 10px;
    height: 10px;
    background: var(--primary-color);
    border-radius: 2px;
    display: none;
}

.canvas-element.selected .resize-handle {
    display: block;
}

.resize-handle.nw { top: -5px; left: -5px; cursor: nw-resize; }
.resize-handle.ne { top: -5px; right: -5px; cursor: ne-resize; }
.resize-handle.sw { bottom: -5px; left: -5px; cursor: sw-resize; }
.resize-handle.se { bottom: -5px; right: -5px; cursor: se-resize; }

/* Handle de rotation */
.canvas-element .rotate-handle {
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    width: 18px;
    height: 18px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: grab;
    display: none;
    z-index: 10;
}

.canvas-element .rotate-handle::before {
    content: '\f2f1';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 10px;
    color: white;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.canvas-element .rotate-handle:active {
    cursor: grabbing;
}

.canvas-element.selected .rotate-handle {
    display: block;
}

/* Ligne de connexion entre l'élément et le handle de rotation */
.canvas-element .rotate-line {
    position: absolute;
    top: -25px;
    left: 50%;
    width: 1px;
    height: 20px;
    background: var(--primary-color);
    display: none;
}

.canvas-element.selected .rotate-line {
    display: block;
}

/* Contrôles de transformation */
.transform-controls {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 0 10px;
    border-left: 1px solid var(--border-color);
    margin-left: 10px;
}

.transform-control {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 0 8px;
    border-right: 1px solid rgba(255,255,255,0.2);
}

.transform-control:last-child {
    border-right: none;
}

.transform-control label {
    color: var(--text-muted);
    cursor: help;
    font-size: 0.85rem;
}

.transform-control input[type="range"] {
    width: 60px;
    height: 2px;
    -webkit-appearance: none;
    appearance: none;
    background: white;
    border-radius: 15px;
    cursor: pointer;
}

/* Track - Webkit (Chrome, Safari, Edge) */
.transform-control input[type="range"]::-webkit-slider-runnable-track {
    height: 2px;
    background: white;
    border-radius: 15px;
}

/* Track - Firefox */
.transform-control input[type="range"]::-moz-range-track {
    height: 2px;
    background: white;
    border-radius: 15px;
    border: none;
}

/* Track - IE/Edge Legacy */
.transform-control input[type="range"]::-ms-track {
    height: 2px;
    background: white;
    border-radius: 15px;
    border: none;
    color: transparent;
}

/* Thumb - Webkit (Chrome, Safari, Edge) */
.transform-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    background: #ffffff;
    border-radius: 50%;
    cursor: pointer;
    margin-top: -6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

/* Thumb - Firefox */
.transform-control input[type="range"]::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: #ffffff;
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

/* Thumb - IE/Edge Legacy */
.transform-control input[type="range"]::-ms-thumb {
    width: 14px;
    height: 14px;
    background: #ffffff;
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.transform-control span {
    font-size: 0.75rem;
    color: var(--text-muted);
    min-width: 35px;
}

/* Boutons z-index */
.zindex-controls {
    gap: 3px !important;
}

.zindex-controls .btn-sm {
    padding: 4px 6px;
    font-size: 0.75rem;
    background: rgba(255,255,255,0.15);
    border: none;
    color: white;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}

.zindex-controls .btn-sm:hover {
    background: rgba(255,255,255,0.3);
}

.zindex-controls .btn-sm:active {
    background: rgba(255,255,255,0.4);
}

@media (max-width: 992px) {
    .scenario-editor {
        grid-template-columns: 1fr;
        height: auto;
    }
    
    .scenario-sidebar {
        order: 2;
    }
    
    .scenario-canvas-container {
        max-height: 80vh;
        overflow: auto;
    }
}

/* ============================================
   FORMS
============================================ */
.form-group {
    margin-bottom: var(--spacing-lg);
}

.form-label {
    display: block;
    font-weight: 500;
    margin-bottom: var(--spacing-sm);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: var(--spacing-md);
    font-family: var(--font-primary);
    font-size: 1rem;
    border: 2px solid var(--light-gray);
    border-radius: var(--radius-md);
    transition: border-color var(--transition-fast);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-textarea {
    resize: vertical;
    min-height: 120px;
}

.form-checkbox-group {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.form-error {
    color: var(--danger);
    font-size: 0.875rem;
    margin-top: var(--spacing-xs);
}

/* ============================================
   AUTH PAGES
============================================ */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    padding: var(--spacing-lg);
}

.auth-container {
    width: 100%;
    max-width: 450px;
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: var(--spacing-xxl);
    box-shadow: var(--shadow-xl);
}

.auth-logo {
    text-align: center;
    margin-bottom: var(--spacing-xl);
}

.auth-logo img {
    max-height: 80px;
    width: auto;
    object-fit: contain;
}

.auth-logo .custom-logo-link img {
    max-height: 80px;
    width: auto;
    object-fit: contain;
}

.auth-title {
    text-align: center;
    margin-bottom: var(--spacing-xl);
}

.auth-tabs {
    display: flex;
    margin-bottom: var(--spacing-xl);
    border-bottom: 2px solid var(--light-gray);
}

.auth-tab {
    flex: 1;
    padding: var(--spacing-md);
    text-align: center;
    font-weight: 500;
    color: var(--gray);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.auth-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.role-selector {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.role-option {
    padding: var(--spacing-lg);
    border: 2px solid var(--light-gray);
    border-radius: var(--radius-md);
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.role-option:hover {
    border-color: var(--primary-color);
}

.role-option.selected {
    border-color: var(--primary-color);
    background: rgba(30, 58, 95, 0.05);
}

.role-option .icon {
    font-size: 2rem;
    margin-bottom: var(--spacing-sm);
}

.metier-selector {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.metier-option {
    padding: var(--spacing-md);
    border: 2px solid var(--light-gray);
    border-radius: var(--radius-md);
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.metier-option.pompiers { --metier-color: var(--pompiers-color); }
.metier-option.police { --metier-color: var(--police-color); }
.metier-option.gendarmerie { --metier-color: var(--gendarmerie-color); }
.metier-option.securite-civile { --metier-color: var(--securite-civile-color); }

.metier-option:hover,
.metier-option.selected {
    border-color: var(--metier-color);
    background: rgba(var(--metier-color), 0.05);
}

.metier-option .icon {
    font-size: 1.5rem;
    margin-bottom: var(--spacing-xs);
}

/* ============================================
   ALERTS & NOTIFICATIONS
============================================ */
.alert {
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-lg);
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.alert-success {
    background: rgba(40, 167, 69, 0.1);
    border: 1px solid var(--success);
    color: var(--success);
}

.alert-warning {
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid var(--warning);
    color: #856404;
}

.alert-danger {
    background: rgba(220, 53, 69, 0.1);
    border: 1px solid var(--danger);
    color: var(--danger);
}

.alert-info {
    background: rgba(23, 162, 184, 0.1);
    border: 1px solid var(--info);
    color: var(--info);
}

.alert-error {
    background: rgba(220, 53, 69, 0.1);
    border: 1px solid var(--danger);
    color: var(--danger);
}

/* ============================================
   AUTH FORMS (compléments)
============================================ */
.auth-container-wide {
    max-width: 550px;
}

.auth-form {
    margin-bottom: var(--spacing-lg);
}

.auth-form .form-group {
    margin-bottom: var(--spacing-lg);
}

.auth-form .form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: var(--spacing-sm);
    color: var(--dark-gray);
}

.auth-form .form-control {
    width: 100%;
    padding: var(--spacing-md);
    border: 2px solid var(--light-gray);
    border-radius: var(--radius-md);
    font-size: 1rem;
    transition: border-color var(--transition-fast);
}

.auth-form .form-control:focus {
    outline: none;
    border-color: var(--primary-color);
}

.auth-form .form-hint {
    display: block;
    font-size: 0.75rem;
    color: var(--gray);
    margin-top: var(--spacing-xs);
}

.form-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-md);
}

@media (max-width: 576px) {
    .form-row-2 {
        grid-template-columns: 1fr;
    }
}

.form-divider {
    border: none;
    border-top: 1px solid var(--light-gray);
    margin: var(--spacing-lg) 0;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    cursor: pointer;
    font-size: 0.875rem;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    min-width: 18px;
    min-height: 18px;
    accent-color: var(--primary-color);
    border-radius: 3px;
    flex-shrink: 0;
}

/* Fix global pour les checkboxes - empêcher la forme ovale */
input[type="checkbox"] {
    width: 16px;
    height: 16px;
    min-width: 16px;
    min-height: 16px;
    border-radius: 3px;
    flex-shrink: 0;
    aspect-ratio: 1 / 1;
}

.field-hint {
    font-size: 0.75rem;
    color: var(--gray);
    margin-top: var(--spacing-xs);
    margin-bottom: 0;
}

.linked-scenario-option {
    padding: var(--spacing-md);
    background: var(--light-bg);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.linked-scenario-option .checkbox-label {
    font-size: 0.9375rem;
    font-weight: 500;
}

.forgot-password {
    font-size: 0.875rem;
    color: var(--primary-color);
}

.auth-footer {
    text-align: center;
    padding-top: var(--spacing-lg);
    border-top: 1px solid var(--light-gray);
    color: var(--gray);
}

.auth-footer a {
    color: var(--primary-color);
    font-weight: 500;
}

.auth-footer a:hover {
    text-decoration: underline;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
}

/* ============================================
   FOOTER — version compacte (Luc 25/05/2026)
============================================ */
.site-footer {
    background: linear-gradient(135deg, #1b263b 0%, #0d1b2a 100%);
    color: var(--white);
    padding: 1.5rem 0 1rem;
}

/* Top footer en ligne : brand a gauche, contact a droite */
.footer-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    flex-wrap: wrap;
    padding-bottom: 1rem;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    min-width: 0;
}
.footer-brand .footer-logo {
    display: inline-block;
    line-height: 0;
    flex-shrink: 0;
}
.footer-brand .footer-logo img {
    width: 120px;
    height: auto;
    display: block;
}
.footer-tagline {
    color: rgba(255,255,255,0.65);
    font-size: 0.8125rem;
    margin: 0;
    max-width: 340px;
    line-height: 1.4;
}

/* Contact en ligne */
.footer-contact {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    font-size: 0.8125rem;
}
.footer-contact li {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: rgba(255,255,255,0.75);
}
.footer-contact li i {
    color: rgba(255,255,255,0.5);
    font-size: 0.75rem;
}
.footer-contact a {
    color: rgba(255,255,255,0.75);
    text-decoration: none;
    transition: color var(--transition-fast);
}
.footer-contact a:hover { color: var(--white); }

.footer-bottom {
    padding-top: 0.875rem;
    border-top: 1px solid rgba(255,255,255,0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: rgba(255,255,255,0.45);
    flex-wrap: wrap;
    gap: 0.75rem;
}
.footer-bottom p { margin: 0; }
/* Liens credits (Julien LE TIEC / Leb Communication) — blancs, soulignes, italiques */
.footer-bottom p a {
    color: #fff;
    text-decoration: underline;
    font-style: italic;
    transition: opacity var(--transition-fast);
}
.footer-bottom p a:hover {
    opacity: 0.85;
    color: #fff;
}
.footer-nav {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}
.footer-nav a {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    transition: color var(--transition-fast);
}
.footer-nav a:hover { color: var(--white); }
.footer-nav i { margin-right: 0.25rem; }

@media (max-width: 768px) {
    .footer-top { flex-direction: column; align-items: flex-start; gap: 1rem; }
    .footer-bottom { flex-direction: column; align-items: flex-start; }
    .footer-contact { gap: 0.75rem 1rem; }
}


/* ============================================
   UTILITIES
============================================ */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: var(--spacing-sm); }
.mt-2 { margin-top: var(--spacing-md); }
.mt-3 { margin-top: var(--spacing-lg); }
.mt-4 { margin-top: var(--spacing-xl); }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: var(--spacing-sm); }
.mb-2 { margin-bottom: var(--spacing-md); }
.mb-3 { margin-bottom: var(--spacing-lg); }
.mb-4 { margin-bottom: var(--spacing-xl); }

.py-1 { padding-top: var(--spacing-sm); padding-bottom: var(--spacing-sm); }
.py-2 { padding-top: var(--spacing-md); padding-bottom: var(--spacing-md); }
.py-3 { padding-top: var(--spacing-lg); padding-bottom: var(--spacing-lg); }
.py-4 { padding-top: var(--spacing-xl); padding-bottom: var(--spacing-xl); }

.d-none { display: none; }
.d-block { display: block; }
.d-flex { display: flex; }
.d-grid { display: grid; }

.align-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }

.gap-1 { gap: var(--spacing-sm); }
.gap-2 { gap: var(--spacing-md); }
.gap-3 { gap: var(--spacing-lg); }

.w-100 { width: 100%; }
.h-100 { height: 100%; }

.rounded { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-full { border-radius: var(--radius-full); }

.shadow { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }

.bg-white { background: var(--white); }
.bg-light { background: var(--light-gray); }
.bg-primary { background: var(--primary-color); }

.text-white { color: var(--white); }
.text-muted { color: var(--gray); }
.text-primary { color: var(--primary-color); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }

/* Animation for loading states */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.loading {
    animation: pulse 2s infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.spinner {
    animation: spin 1s linear infinite;
}

/* ============================================
   BREADCRUMB
============================================ */
.breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
    padding: var(--spacing-md) 0;
    font-size: 0.875rem;
    color: var(--gray);
}

.breadcrumb a {
    color: var(--gray);
    transition: color var(--transition-fast);
}

.breadcrumb a:hover {
    color: var(--primary-color);
}

.breadcrumb .separator {
    color: var(--gray);
    opacity: 0.5;
}

.breadcrumb .current {
    color: var(--dark-gray);
    font-weight: 500;
}

/* ============================================
   COURS LIST (Formation single)
============================================ */
.cours-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.cours-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    background: var(--light-gray);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.cours-item:hover {
    background: var(--white);
    box-shadow: var(--shadow-md);
}

.cours-item.completed {
    background: rgba(40, 167, 69, 0.1);
}

.cours-item.locked {
    opacity: 0.6;
}

.cours-number {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-color);
    color: var(--white);
    border-radius: var(--radius-full);
    font-weight: 600;
    flex-shrink: 0;
}

.cours-item.completed .cours-number {
    background: var(--success);
}

.cours-item.locked .cours-number {
    background: var(--gray);
}

.cours-info {
    flex: 1;
}

.cours-title {
    font-weight: 500;
    margin-bottom: var(--spacing-xs);
}

.cours-title a {
    color: var(--dark-gray);
}

.cours-title a:hover {
    color: var(--primary-color);
}

.cours-duration {
    font-size: 0.875rem;
    color: var(--gray);
}

.cours-status {
    flex-shrink: 0;
}

/* ============================================
   SIDEBAR COURS LIST
============================================ */
.sidebar-cours-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-cours-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) 0;
    border-bottom: 1px solid var(--light-gray);
}

.sidebar-cours-item:last-child {
    border-bottom: none;
}

.sidebar-cours-item .cours-check {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--light-gray);
    color: var(--gray);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    flex-shrink: 0;
}

.sidebar-cours-item.completed .cours-check {
    background: var(--success);
    color: var(--white);
}

.sidebar-cours-item.current {
    background: var(--primary-color);
    color: var(--white);
    margin: 0 calc(var(--spacing-md) * -1);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-md);
}

.sidebar-cours-item.current a {
    color: var(--white);
}

.sidebar-cours-item.current .cours-check {
    background: var(--white);
    color: var(--primary-color);
}

.sidebar-cours-item a {
    color: var(--dark-gray);
    font-size: 0.875rem;
    flex: 1;
}

.sidebar-cours-item a:hover {
    color: var(--primary-color);
}

/* ============================================
   COURS NAVIGATION
============================================ */
.cours-navigation {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-lg);
    margin-top: var(--spacing-xl);
}

.cours-nav-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-lg);
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    text-decoration: none;
    transition: all var(--transition-fast);
}

.cours-nav-item:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.cours-nav-item.disabled {
    visibility: hidden;
}

.cours-nav-item.next {
    justify-content: flex-end;
    text-align: right;
}

.cours-nav-item i {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.cours-nav-label {
    display: block;
    font-size: 0.75rem;
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cours-nav-title {
    display: block;
    font-weight: 600;
    color: var(--dark-gray);
}

/* ============================================
   PAGE REMERCIEMENTS
============================================ */
.remerciements-page {
    padding: 4rem 0;
    min-height: calc(100vh - 300px);
    background: var(--light-gray);
}

.remerciements-header {
    text-align: center;
    margin-bottom: 3rem;
}

.remerciements-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.remerciements-intro {
    font-size: 1.1rem;
    color: var(--gray);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

.remerciements-content {
    background: var(--white);
    border-radius: 8px;
    padding: 2.5rem;
    max-width: 700px;
    margin: 0 auto;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.remerciements-content > p:first-child {
    color: var(--dark-gray);
    margin-bottom: 2rem;
    line-height: 1.6;
}

.remerciements-list {
    list-style: none;
    padding: 0;
    margin: 0 0 2rem 0;
}

.remerciements-list li {
    padding: 1rem 0;
    border-bottom: 1px solid var(--light-gray);
}

.remerciements-list li:last-child {
    border-bottom: none;
}

.remerciements-list li strong {
    display: block;
    font-size: 1.05rem;
    color: var(--primary-color);
    font-weight: 600;
}

.remerciements-list li span {
    display: block;
    font-size: 0.9rem;
    color: var(--gray);
    margin-top: 0.25rem;
}

.remerciements-corps {
    font-style: italic;
    color: var(--dark-gray);
    padding-top: 1rem;
    border-top: 1px solid var(--light-gray);
}

.remerciements-footer {
    text-align: center;
    margin-top: 2.5rem;
}

@media (max-width: 768px) {
    .remerciements-page {
        padding: 2rem 0;
    }

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

    .remerciements-content {
        padding: 1.5rem;
    }
}

/* ============================================
   MOBILE SMALL (480px) - Ajustements globaux
============================================ */
@media (max-width: 480px) {
    /* Titres réduits */
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.35rem; }
    h4 { font-size: 1.25rem; }

    /* Container padding réduit */
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }

    /* Cards plus compactes */
    .card {
        padding: 1rem;
    }

    /* Formulaires plus compacts */
    .form-group {
        margin-bottom: 1rem;
    }

    .form-input,
    .form-select,
    .form-textarea {
        padding: 0.75rem;
    }

    /* User name plus court dans header */
    .site-header .user-menu-toggle .user-name {
        max-width: 70px;
    }

    /* Card horizontal en colonne */
    .card-horizontal {
        flex-direction: column;
    }

    .card-horizontal .card-image {
        width: 100%;
        min-width: auto;
        height: 150px;
    }

    /* Boutons pleine largeur */
    .btn {
        padding: 0.75rem 1.25rem;
    }

    /* Stats grid en 1 colonne */
    .stats-grid {
        grid-template-columns: 1fr;
    }

    /* Section spacing réduit */
    section {
        padding-top: 2rem;
        padding-bottom: 2rem;
    }
}

/* ============================================================
   DESIGN SYSTEM — REFONTE 2026
   Composants signatures réutilisés sur les pages internes.
   Préfixe .ds-* pour ne pas écraser le legacy.
============================================================ */

/* ----- Helmet arc : forme signature rouge translucide ----- */
.ds-helmet-arc {
    position: absolute;
    pointer-events: none;
    background: var(--ds-helmet-red);
    border-radius: 50% 50% 0 0 / 100% 100% 0 0;
    filter: blur(0.4px);
    z-index: 0;
}
.ds-helmet-arc--soft { background: var(--ds-helmet-red-soft); }
.ds-helmet-arc--strong { background: var(--ds-helmet-red-strong); }
.ds-helmet-arc--navy { background: var(--ds-helmet-navy-soft); }

.ds-helmet-arc--xl { width: 920px; height: 460px; }
.ds-helmet-arc--lg { width: 640px; height: 320px; }
.ds-helmet-arc--md { width: 420px; height: 210px; }
.ds-helmet-arc--sm { width: 240px; height: 120px; }

/* Crête centrale optionnelle (rappelle l'arête du casque) */
.ds-helmet-arc--ridge::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 0;
    width: 6px;
    height: 65%;
    background: linear-gradient(to top, transparent, currentColor 35%, transparent);
    transform: translateX(-50%);
    color: var(--ds-helmet-red-strong);
    border-radius: 6px;
}

/* Inversion (casque pointé vers le bas) */
.ds-helmet-arc--down {
    border-radius: 0 0 50% 50% / 0 0 100% 100%;
}

/* ----- HERO unifié ----- */
.ds-hero {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    color: var(--white);
    padding: clamp(3rem, 7vw, 5rem) 0 clamp(3rem, 6vw, 4.5rem);
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 70%);
    margin-top: 0;
}

.ds-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(120% 80% at 110% 0%, rgba(201, 48, 44, 0.18), transparent 55%),
        radial-gradient(80% 80% at 0% 100%, rgba(45, 90, 138, 0.35), transparent 60%);
    z-index: 0;
}

.ds-hero--emergency {
    background: linear-gradient(135deg, var(--ds-emergency) 0%, var(--ds-emergency-dark) 75%);
}
.ds-hero--emergency::before {
    background:
        radial-gradient(120% 80% at 110% 0%, rgba(255, 255, 255, 0.10), transparent 55%),
        radial-gradient(80% 80% at 0% 100%, rgba(15, 31, 51, 0.35), transparent 60%);
}

.ds-hero--compact {
    padding: clamp(1.75rem, 3vw, 2.5rem) 0;
}

.ds-hero-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
}

/* Positions des arcs casque dans le hero */
.ds-hero-bg .ds-helmet-arc {
    background: rgba(255, 255, 255, 0.04);
}
.ds-hero-bg .ds-helmet-arc--top-right {
    top: -180px;
    right: -120px;
}
.ds-hero-bg .ds-helmet-arc--bottom-left {
    bottom: -160px;
    left: -100px;
}
.ds-hero-bg .ds-helmet-arc--center {
    top: -200px;
    left: 50%;
    transform: translateX(-50%);
}

.ds-hero-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: var(--spacing-md);
}
.ds-hero--align-start .ds-hero-content {
    align-items: flex-start;
    text-align: left;
}

.ds-hero h1,
.ds-hero .ds-hero-title {
    color: var(--white);
    font-family: var(--font-heading);
    font-size: var(--ds-text-display);
    line-height: 1.05;
    letter-spacing: -0.02em;
    margin: 0;
    font-weight: 700;
}

.ds-hero h1 i,
.ds-hero .ds-hero-title i {
    margin-right: var(--spacing-sm);
    opacity: 0.85;
}

.ds-hero .ds-hero-lead {
    color: rgba(255, 255, 255, 0.82);
    font-size: 1.0625rem;
    margin: 0;
    max-width: 56ch;
    line-height: 1.55;
}

/* Eyebrow (label avant le titre) */
.ds-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: var(--ds-text-eyebrow-size);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: rgba(255, 255, 255, 0.72);
    padding: 0.375rem 0.875rem 0.375rem 0.625rem;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}
.ds-eyebrow .ds-eyebrow-led {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--ds-emergency-bright);
    box-shadow: 0 0 0 0 rgba(230, 57, 70, 0.7);
    animation: ds-pulse 2.4s var(--ds-ease-out) infinite;
}
@keyframes ds-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(230, 57, 70, 0.55); }
    70%  { box-shadow: 0 0 0 10px rgba(230, 57, 70, 0);   }
    100% { box-shadow: 0 0 0 0 rgba(230, 57, 70, 0);     }
}

/* CTA bar dans le hero */
.ds-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
    justify-content: center;
    margin-top: var(--spacing-md);
}
.ds-hero--align-start .ds-hero-actions { justify-content: flex-start; }

/* ----- Section avec arcs en background ----- */
.ds-section {
    position: relative;
    overflow: hidden;
    padding: clamp(2.5rem, 5vw, 4rem) 0;
}
.ds-section--page {
    background: var(--ds-surface-page);
}
.ds-section-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}
.ds-section > .container { position: relative; z-index: 1; }

/* ----- Card listing harmonisée ----- */
.ds-card {
    position: relative;
    background: var(--ds-surface-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition:
        transform var(--ds-duration-base) var(--ds-ease-spring),
        box-shadow var(--ds-duration-base) var(--ds-ease-out);
    box-shadow: var(--ds-shadow-sm);
    border: 1px solid var(--ds-border-subtle);
    display: flex;
    flex-direction: column;
    height: 100%;
}
.ds-card::before {
    /* Ligne rouge top — accent intervention */
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--ds-emergency), var(--ds-emergency-bright));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--ds-duration-base) var(--ds-ease-spring);
    z-index: 2;
}
.ds-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--ds-shadow-lg);
}
.ds-card:hover::before {
    transform: scaleX(1);
}
.ds-card-media {
    position: relative;
    aspect-ratio: 16/10;
    overflow: hidden;
    background: var(--ds-surface-muted);
}
.ds-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--ds-duration-slow) var(--ds-ease-out);
}
.ds-card:hover .ds-card-media img {
    transform: scale(1.04);
}
.ds-card-media-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: var(--gray);
    font-size: 2.5rem;
    background:
        radial-gradient(circle at 30% 30%, var(--ds-helmet-red-soft) 0%, transparent 60%),
        var(--ds-surface-muted);
}
.ds-card-tag {
    position: absolute;
    top: var(--spacing-sm);
    left: var(--spacing-sm);
    padding: 0.25rem 0.625rem;
    background: rgba(15, 31, 51, 0.92);
    color: var(--white);
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border-radius: var(--radius-sm);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 1;
}
.ds-card-tag--pompiers,
.ds-card-tag.pompiers,
.ds-card-tag.inc { background: var(--ds-emergency); }
.ds-card-tag--police,
.ds-card-tag.police { background: #1e3a5f; }
.ds-card-tag--gendarmerie,
.ds-card-tag.gendarmerie { background: #003366; }
.ds-card-tag--securite-civile,
.ds-card-tag.securite-civile { background: #ff6600; }

.ds-card-body {
    padding: var(--spacing-lg);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    flex: 1;
}
.ds-card-title {
    font-family: var(--font-heading);
    font-size: 1.0625rem;
    line-height: 1.3;
    margin: 0;
    color: var(--ds-text-strong);
    font-weight: 600;
}
.ds-card-title a {
    color: inherit;
    text-decoration: none;
}
.ds-card-title a:hover { color: var(--ds-emergency); }

.ds-card-excerpt {
    font-size: 0.875rem;
    line-height: 1.55;
    color: var(--gray);
    margin: 0;
}

.ds-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-md);
    font-size: 0.8125rem;
    color: var(--gray);
    margin-top: auto;
    padding-top: var(--spacing-sm);
}
.ds-card-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}
.ds-card-meta-item i {
    font-size: 0.75rem;
    color: var(--ds-emergency);
    opacity: 0.75;
}

.ds-card-footer {
    padding: var(--spacing-md) var(--spacing-lg);
    border-top: 1px solid var(--ds-border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-sm);
    background: linear-gradient(to bottom, transparent, rgba(15, 31, 51, 0.015));
}

/* Progress bar in card (formations en cours) */
.ds-card-progress {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3px;
    background: rgba(255, 255, 255, 0.4);
    z-index: 1;
}
.ds-card-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--success), #4caf50);
    transition: width var(--ds-duration-slow) var(--ds-ease-out);
}

/* ----- Filter bar améliorée ----- */
.ds-filter-bar {
    background: var(--ds-surface-card);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    box-shadow: var(--ds-shadow-sm);
    border: 1px solid var(--ds-border-subtle);
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-lg);
    align-items: flex-end;
    margin-bottom: var(--spacing-xl);
}
.ds-filter-bar form {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-lg);
    align-items: flex-end;
    width: 100%;
}
.ds-filter-group {
    flex: 1;
    min-width: 180px;
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}
.ds-filter-group label {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ds-text-eyebrow);
}
.ds-filter-group select,
.ds-filter-group input[type="text"] {
    width: 100%;
    padding: 0.625rem 0.875rem;
    background: var(--ds-surface-page);
    border: 1px solid var(--ds-border);
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    color: var(--ds-text-strong);
    font-family: var(--font-primary);
    transition: border-color var(--ds-duration-fast) ease, box-shadow var(--ds-duration-fast) ease;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8' fill='none'><path d='M1 1.5L6 6.5L11 1.5' stroke='%236c757d' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/></svg>");
    background-repeat: no-repeat;
    background-position: right 0.875rem center;
    background-size: 12px;
    padding-right: 2.25rem;
}
.ds-filter-group input[type="text"] {
    background-image: none;
    padding-right: 0.875rem;
}
.ds-filter-group select:focus,
.ds-filter-group input[type="text"]:focus {
    outline: none;
    border-color: var(--ds-emergency);
    box-shadow: 0 0 0 3px rgba(201, 48, 44, 0.12);
}
.ds-filter-actions {
    display: flex;
    gap: var(--spacing-sm);
    align-items: stretch;
}

/* ----- Empty state pattern ----- */
.ds-empty {
    position: relative;
    text-align: center;
    padding: clamp(3rem, 6vw, 5rem) var(--spacing-lg);
    background: var(--ds-surface-card);
    border-radius: var(--radius-lg);
    border: 1px dashed var(--ds-border);
    overflow: hidden;
    isolation: isolate;
}
.ds-empty::before {
    content: "";
    position: absolute;
    bottom: -160px;
    left: 50%;
    width: 480px;
    height: 240px;
    transform: translateX(-50%);
    background: var(--ds-helmet-red-soft);
    border-radius: 50% 50% 0 0 / 100% 100% 0 0;
    z-index: -1;
}
.ds-empty-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    background: var(--ds-helmet-red);
    color: var(--ds-emergency);
    font-size: 1.625rem;
    border-radius: 50%;
    margin-bottom: var(--spacing-md);
}
.ds-empty-title {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    color: var(--ds-text-strong);
    margin: 0 0 var(--spacing-sm);
    font-weight: 600;
}
.ds-empty-text {
    color: var(--gray);
    font-size: 0.9375rem;
    margin: 0 0 var(--spacing-lg);
    max-width: 42ch;
    margin-left: auto;
    margin-right: auto;
}

/* ----- Boutons : amélioration des classes existantes ----- */
.btn {
    position: relative;
    font-weight: 600;
    letter-spacing: 0.01em;
    border-radius: var(--radius-md);
    transition:
        transform var(--ds-duration-fast) var(--ds-ease-spring),
        box-shadow var(--ds-duration-fast) ease,
        background-color var(--ds-duration-fast) ease,
        color var(--ds-duration-fast) ease;
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(201, 48, 44, 0.25);
}

.btn-primary {
    background: linear-gradient(180deg, var(--primary-light), var(--primary-color));
    color: var(--white);
    box-shadow: 0 4px 10px -4px rgba(15, 31, 51, 0.4);
}
.btn-primary:hover {
    background: linear-gradient(180deg, var(--primary-color), var(--primary-dark));
    box-shadow: 0 8px 16px -6px rgba(15, 31, 51, 0.45);
}

.btn-secondary {
    background: linear-gradient(180deg, var(--ds-emergency-bright), var(--ds-emergency));
    color: var(--white);
    box-shadow: var(--ds-shadow-emergency);
}
.btn-secondary:hover {
    background: linear-gradient(180deg, var(--ds-emergency), var(--ds-emergency-dark));
}

.btn-outline {
    background: var(--white);
    border: 1.5px solid var(--ds-border);
    color: var(--ds-text-strong);
}
.btn-outline:hover {
    background: var(--ds-text-strong);
    border-color: var(--ds-text-strong);
    color: var(--white);
}

/* Variante ghost (lien-bouton tertiaire) */
.btn-ghost {
    background: transparent;
    color: var(--ds-text-strong);
    padding: var(--spacing-xs) var(--spacing-sm);
}
.btn-ghost:hover {
    color: var(--ds-emergency);
    background: var(--ds-helmet-red-soft);
}

/* ----- Bouton flottant (CTA hero) ----- */
.btn-emergency {
    background: linear-gradient(180deg, var(--ds-emergency-bright), var(--ds-emergency));
    color: var(--white);
    box-shadow: var(--ds-shadow-emergency);
    position: relative;
    overflow: hidden;
}
.btn-emergency::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, transparent 30%, rgba(255, 255, 255, 0.25) 50%, transparent 70%);
    transform: translateX(-100%);
    transition: transform var(--ds-duration-slow) var(--ds-ease-out);
}
.btn-emergency:hover {
    color: var(--white);
    background: linear-gradient(180deg, var(--ds-emergency), var(--ds-emergency-dark));
}
.btn-emergency:hover::after {
    transform: translateX(100%);
}

/* ----- Responsive ----- */
@media (max-width: 768px) {
    .ds-hero { padding: clamp(2.25rem, 6vw, 3rem) 0; }
    .ds-hero-content { gap: var(--spacing-sm); }
    .ds-hero h1 { font-size: clamp(1.75rem, 6vw, 2.25rem); }
    .ds-hero .ds-hero-lead { font-size: 0.9375rem; }
    .ds-helmet-arc--xl { width: 540px; height: 270px; }
    .ds-helmet-arc--lg { width: 380px; height: 190px; }
    .ds-filter-group { min-width: 100%; }
    .ds-filter-actions { width: 100%; }
    .ds-filter-actions .btn { flex: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .ds-eyebrow .ds-eyebrow-led { animation: none; }
    .ds-card,
    .ds-card-media img,
    .btn,
    .btn-emergency::after {
        transition: none !important;
    }
}

/* ============================================================================
   MODULE FORMATIONS — REFONTE ÉDITORIALE PREMIUM
   Inspiration : layout magazine / hub premium, fond crème, hero en card
   arrondie, navigation circulaire, titres bold sans-serif moderne.
   Préfixe .fm-* isolé du legacy.
============================================================================ */
.fm-page {
    --fm-bg: #fafafa;
    --fm-paper: #ffffff;
    --fm-surface: #f5f5f3;
    --fm-ink: #0a0a0a;
    --fm-ink-2: #1a1a1a;
    --fm-ink-soft: #4a4a4a;
    --fm-ink-mute: #8a8a85;
    --fm-line: #e8e6e1;
    --fm-line-strong: #c9c7c0;
    --fm-red: #c9302c;
    --fm-red-deep: #8b1a1a;
    --fm-red-soft: rgba(201, 48, 44, 0.06);
    --fm-red-tint: rgba(201, 48, 44, 0.12);
    --fm-amber: #f5b94a;
    --fm-amber-light: #fde6b2;
    --fm-navy: #1b263b;
    --fm-navy-2: #253148;

    --fm-display: 'Plus Jakarta Sans', system-ui, sans-serif;
    --fm-body: 'Inter', system-ui, sans-serif;

    --fm-radius-xl: 36px;
    --fm-radius-lg: 24px;
    --fm-radius-md: 16px;
    --fm-radius-sm: 10px;

    /* Retrait latéral commun (search bar + grille de cards) */
    --fm-edge-x: clamp(1.5rem, 4vw, 3.5rem);

    background: var(--fm-bg);
    color: var(--fm-ink);
    font-family: var(--fm-body);
    position: relative;
    isolation: isolate;
    padding-bottom: clamp(3rem, 6vw, 5rem);
}

/* Coller le wrapper au header */
.site-main:has(> .fm-page),
.site-content:has(> .fm-page) {
    padding-top: 0;
    background: var(--fm-bg);
}

/* Container utilitaire interne (large pour respirer) */
.fm-page .fm-container {
    width: 100%;
    max-width: 1560px;
    margin: 0 auto;
    padding: 0 clamp(1rem, 2.5vw, 2.5rem);
}

/* ----- HERO ----- */
.fm-hero {
    padding: clamp(2rem, 4vw, 3rem) 0 0;
    margin-top: 80px;
    margin-bottom: clamp(2rem, 3vw, 3rem);
    position: relative;
}
/* Override pour Dashboard : retire le padding-top dupliqué de .fs-dash */
.fs-dash.fm-page {
    padding-top: 0;
}
.fs-dash.fm-page .fm-hero {
    padding-top: clamp(1rem, 2vw, 2rem);
}

/* Couleur signature du module Formations (handoff design : coral) */
.fm-hero-card {
    --fm-hero-bg: #faeedd;
    --fm-hero-accent: #d88751;
    --fm-hero-dot: var(--fm-hero-accent);

    position: relative;
    border-radius: var(--fm-radius-xl);
    overflow: hidden;
    isolation: isolate;
    background: var(--fm-hero-bg);
    color: var(--fm-ink);
    min-height: 320px;
}

/* Palettes par page (handoff design) */
.fm-hero-card--formations {
    --fm-hero-bg: #faeedd;
    --fm-hero-accent: #d88751;
    --fm-hero-dot: var(--fm-hero-accent);
}
.fm-hero-card--scenarios {
    --fm-hero-bg: #dde7ee;
    --fm-hero-accent: #4a7fa0;
    --fm-hero-dot: var(--fm-hero-accent);
}
.fm-hero-card--interactif {
    --fm-hero-bg: #e8deef;
    --fm-hero-accent: #8b5bb8;
    --fm-hero-dot: var(--fm-hero-accent);
}
.fm-hero-card--dashboard {
    --fm-hero-bg: #deeae1;
    --fm-hero-accent: #5e9670;
    --fm-hero-dot: var(--fm-hero-accent);
}
.fm-hero-card--outils {
    --fm-hero-bg: #ccfbf1;
    --fm-hero-accent: #0d9488;
    --fm-hero-dot: var(--fm-hero-accent);
}
.fm-hero-card--qcm {
    --fm-hero-bg: #fae8ff;
    --fm-hero-accent: #a21caf;
    --fm-hero-dot: var(--fm-hero-accent);
}
.fm-hero-card--secretariat {
    --fm-hero-bg: #e0e7ff;
    --fm-hero-accent: #4338ca;
    --fm-hero-dot: var(--fm-hero-accent);
}

/* Variante v2 Interactif (étoile) — masquée, choix v1 (orbite) retenu.
   Code conservé pour comparaison future, à supprimer après nettoyage. */
.fm-hero-card--interactif-v2 {
    display: none;
}

/* Variante alerte pour le lien hero (clignote rouge) */
.fm-hero-link--alert {
    color: #c9302c;
    border-bottom-color: #c9302c;
}
.fm-hero-link--alert:hover {
    color: #8b1a1a;
    border-bottom-color: #8b1a1a;
}
.fm-hero-link--alert i {
    animation: fm-alert-pulse 1.8s ease-in-out infinite;
}
@keyframes fm-alert-pulse {
    0%, 100% { opacity: 0.6; }
    50%      { opacity: 1; }
}

/* Quand le hero n'a pas de search-bar qui chevauche en dessous */
.fm-hero-card--no-searchbar .fm-hero-card-content {
    padding-bottom: clamp(2rem, 3vw, 2.75rem);
}
.fm-hero-card--no-searchbar .fm-hero-illustration {
    margin-bottom: calc(-1 * clamp(2rem, 3vw, 2.75rem));
}

.fm-hero-card-content {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
    gap: clamp(1.5rem, 3vw, 2.5rem);
    align-items: stretch;
    min-height: 320px;
    padding:
        clamp(1.75rem, 3vw, 2.25rem)
        clamp(2rem, 3vw, 2.5rem)
        clamp(4.5rem, 7vw, 6rem);
}

.fm-hero-text {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 1.5rem;
    min-height: 240px;
}

/* Tag/badge top-left (handoff : JetBrains Mono 13px 500) */
.fm-hero-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    align-self: flex-start;
    padding: 0.375rem 0.75rem 0.375rem 0.5rem;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 999px;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
    color: var(--fm-ink);
}
.fm-hero-pill::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--fm-hero-dot);
}

/* Ancien eyebrow masqué (on garde la classe pour compat) */
.fm-hero-eyebrow { display: none; }

.fm-hero-title {
    font-family: 'DM Sans', system-ui, sans-serif;
    font-weight: 600;
    font-size: clamp(2rem, 3.4vw, 2.75rem);
    line-height: 1;
    letter-spacing: -0.02em;
    margin: 0;
    color: var(--fm-ink);
}
.fm-hero-title-em {
    font-style: normal;
    font-weight: 600;
    color: var(--fm-ink);
}
.fm-hero-title-em::after { display: none; }

.fm-hero-title-wrap {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
}
.fm-hero-lead {
    font-family: 'DM Sans', system-ui, sans-serif;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.45;
    color: var(--fm-ink-soft);
    margin: 0;
    max-width: 320px;
}

/* Lien d'action en bas (handoff : DM Sans 15px 500 souligné 1.5px) */
.fm-hero-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    align-self: flex-start;
    text-decoration: none;
    color: var(--fm-ink);
    font-family: 'DM Sans', system-ui, sans-serif;
    font-size: 15px;
    font-weight: 500;
    padding-bottom: 0.25rem;
    border-bottom: 1.5px solid var(--fm-ink);
    transition: color 220ms ease, border-color 220ms ease, gap 220ms ease;
}
.fm-hero-link:hover {
    color: var(--fm-hero-accent);
    border-color: var(--fm-hero-accent);
    gap: 0.75rem;
}
.fm-hero-link svg {
    width: 16px;
    height: 12px;
    flex-shrink: 0;
}

/* ----- Forme graphique signature ----- */
/* Conteneur dans le flux (cellule grid droite). Margin-bottom négatif
   pour annuler le padding-bottom du parent et atteindre le bord bas
   du hero card. L'image est en absolute pour pouvoir déborder à droite. */
.fm-hero-illustration {
    position: relative;
    align-self: stretch;
    margin-bottom: calc(-1 * clamp(4.5rem, 7vw, 6rem));
    pointer-events: none;
}
/* Base : valeurs moyennes, overridées par page (cf. blocs spécifiques) */
.fm-hero-illustration img,
.fm-hero-illustration svg {
    position: absolute;
    right: -25%;
    bottom: -15%;
    width: 180%;
    height: 140%;
    display: block;
    object-fit: contain;
    object-position: right bottom;
}

/* Cas par cas — positionnement optimisé pour le contenu de chaque SVG */
.fm-hero-card--formations .fm-hero-illustration img {
    right: -22%;
    bottom: 0;
    width: 230%;
    height: 180%;
}
.fm-hero-card--scenarios .fm-hero-illustration img {
    right: 0;
    bottom: -8%;
    width: 145%;
    height: 130%;
}
.fm-hero-card--interactif .fm-hero-illustration img {
    right: -28%;
    bottom: -8%;
    width: 220%;
    height: 175%;
}
.fm-hero-card--dashboard .fm-hero-illustration img {
    right: -32%;
    bottom: -22%;
    width: 215%;
    height: 170%;
}
.fm-hero-card--outils .fm-hero-illustration img {
    right: -18%;
    bottom: -12%;
    width: 175%;
    height: 145%;
}
.fm-hero-card--qcm .fm-hero-illustration img {
    right: -8%;
    bottom: -10%;
    width: 130%;
    height: 130%;
}
.fm-hero-card--secretariat .fm-hero-illustration img {
    right: -12%;
    bottom: -8%;
    width: 160%;
    height: 140%;
}
/* Animations subtiles dans le SVG (anciennes, conservées si SVG inline réintroduit) */
.fm-hero-illustration .fm-illu-card-1 { animation: fm-illu-float-a 6s ease-in-out infinite; }
.fm-hero-illustration .fm-illu-card-2 { animation: fm-illu-float-b 7s ease-in-out infinite 0.5s; }
.fm-hero-illustration .fm-illu-card-3 { animation: fm-illu-float-c 8s ease-in-out infinite 1s; }
.fm-hero-illustration .fm-illu-spark {
    transform-origin: center;
    animation: fm-illu-spark 2.4s ease-out infinite;
}
.fm-hero-illustration .fm-illu-pulse {
    transform-origin: center;
    animation: fm-illu-pulse 2.6s ease-in-out infinite;
}
@keyframes fm-illu-float-a {
    0%, 100% { transform: translate(0, 0); }
    50%      { transform: translate(0, -8px); }
}
@keyframes fm-illu-float-b {
    0%, 100% { transform: translate(0, 0); }
    50%      { transform: translate(0, 6px); }
}
@keyframes fm-illu-float-c {
    0%, 100% { transform: translate(0, 0); }
    50%      { transform: translate(0, -5px); }
}
@keyframes fm-illu-spark {
    0%, 100% { opacity: 0.4; transform: scale(1); }
    50%      { opacity: 1;   transform: scale(1.15); }
}
@keyframes fm-illu-pulse {
    0%, 100% { transform: scale(1); opacity: 0.6; }
    50%      { transform: scale(1.08); opacity: 1; }
}

/* Bouton circulaire (signature visuelle) */
.fm-circle-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--fm-line-strong);
    background: transparent;
    color: var(--fm-ink);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 220ms ease, color 220ms ease, border-color 220ms ease, transform 220ms ease;
    text-decoration: none;
    font-size: 1rem;
    flex-shrink: 0;
}
.fm-circle-btn:hover {
    background: var(--fm-ink);
    color: #fff;
    border-color: var(--fm-ink);
}
.fm-circle-btn--filled {
    background: var(--fm-ink);
    border-color: var(--fm-ink);
    color: #fff;
}
.fm-circle-btn--filled:hover {
    background: var(--fm-red);
    border-color: var(--fm-red);
    color: #fff;
    transform: scale(1.04);
}
.fm-circle-btn--lg {
    width: 56px;
    height: 56px;
    font-size: 1.125rem;
}

/* ----- FILTER BAR FLOTTANTE ----- */
.fm-search-bar {
    position: relative;
    z-index: 3;
    margin: -2.75rem var(--fm-edge-x) 0;
    background: #fff;
    border-radius: var(--fm-radius-lg);
    box-shadow: 0 18px 40px -16px rgba(10, 10, 10, 0.2), 0 1px 3px rgba(10, 10, 10, 0.05);
    padding: clamp(1rem, 1.8vw, 1.375rem) clamp(1.25rem, 2.5vw, 2rem);
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: clamp(1rem, 2vw, 2rem);
}

/* Alignement du wrapper listing sur la même limite que la search bar */
.fm-listing > .fm-container > .fm-listing-header,
.fm-listing > .fm-container > .fm-grid,
.fm-listing > .fm-container > .fm-pagination,
.fm-listing > .fm-container > .fm-empty,
.fm-listing > .fm-container > .metier-filter-notice {
    margin-left: var(--fm-edge-x);
    margin-right: var(--fm-edge-x);
}
.fm-search-field {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    border-right: 1px solid var(--fm-line);
    padding-right: clamp(1rem, 2vw, 2rem);
}
.fm-search-field:last-of-type {
    border-right: 0;
}
.fm-search-field-label {
    font-family: var(--fm-display);
    font-size: 1rem;
    font-weight: 700;
    color: var(--fm-ink);
    letter-spacing: -0.01em;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}
.fm-search-field-control {
    position: relative;
    display: flex;
    align-items: center;
}
.fm-search-field-control select {
    flex: 1;
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
    border: 0;
    border-bottom: 1px solid var(--fm-line-strong);
    padding: 0.25rem 1.25rem 0.375rem 0;
    color: var(--fm-ink-soft);
    font-family: var(--fm-body);
    font-size: 0.9375rem;
    cursor: pointer;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8' fill='none'><path d='M1 1.5L6 6.5L11 1.5' stroke='%230a0a0a' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/></svg>");
    background-repeat: no-repeat;
    background-position: right 0.25rem center;
    background-size: 10px;
    transition: border-color 180ms ease, color 180ms ease;
}
.fm-search-field-control select:hover {
    border-color: var(--fm-ink);
    color: var(--fm-ink);
}
.fm-search-field-control select:focus {
    outline: none;
    border-color: var(--fm-red);
    color: var(--fm-ink);
}
.fm-search-field-icon {
    color: var(--fm-ink-mute);
    font-size: 0.8125rem;
    flex-shrink: 0;
}
.fm-search-submit {
    justify-self: end;
}

/* ----- SECTION LISTING ----- */
.fm-listing {
    margin-top: clamp(1rem, 2vw, 1.5rem);
}
/* Quand deux listings se succèdent (ex. Mes brouillons + Parcours
   disponibles sur la page Interactif), on les sépare nettement. */
.fm-listing + .fm-listing {
    margin-top: clamp(3rem, 6vw, 5rem);
}

.fm-listing-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-end;
    gap: 1.5rem;
    margin-bottom: clamp(1.5rem, 3vw, 2.5rem);
}
.fm-listing-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    color: var(--fm-ink-soft);
    margin-bottom: 0.5rem;
}
.fm-listing-eyebrow::before {
    content: "—";
    color: var(--fm-ink-soft);
}
.fm-listing-title {
    font-family: var(--fm-display);
    font-size: clamp(1.25rem, 2vw, 1.625rem);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.015em;
    margin: 0;
    color: var(--fm-ink);
}
.fm-listing-subtitle {
    color: var(--fm-ink-soft);
    font-size: 0.9375rem;
    margin: 0.5rem 0 0;
    max-width: 56ch;
}
.fm-listing-nav {
    display: flex;
    gap: 0.625rem;
}

/* ----- GRID ----- */
.fm-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: clamp(1.25rem, 2vw, 1.75rem);
}

/* ----- CARD FORMATION (style mockup hero) ----- */
.fm-card {
    position: relative;
    background: var(--fm-paper);
    border-radius: 22px;
    overflow: hidden;
    isolation: isolate;
    transition: transform 320ms cubic-bezier(0.22, 1, 0.36, 1), box-shadow 320ms cubic-bezier(0.22, 1, 0.36, 1);
    border: 1px solid var(--fm-line);
    display: flex;
    flex-direction: column;
    padding: 14px;
    gap: 14px;
}
.fm-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 26px 44px -22px rgba(10, 10, 10, 0.2);
    border-color: var(--fm-line-strong);
}

.fm-card-media {
    position: relative;
    aspect-ratio: 16 / 11;
    overflow: hidden;
    background:
        linear-gradient(135deg, #f3a847 0%, var(--fm-red) 55%, #6b1414 100%);
    border-radius: 14px;
    margin: 0;
}
/* Vagues décoratives sur le gradient (rappel SVG hero) */
.fm-card-media::before {
    /* Modelé sombre derrière l'image (utile surtout pour le placeholder) */
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 60% 40% at 20% 80%, rgba(10, 10, 10, 0.28), transparent 60%),
        radial-gradient(ellipse 50% 40% at 80% 100%, rgba(10, 10, 10, 0.22), transparent 60%);
    z-index: 0;
}
/* Voile coloré au-DESSUS de l'image — opacité très faible pour subtilité.
   La couleur change selon la page via les overrides .fm-page--<section>. */
.fm-card-media::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #f3a847 0%, var(--fm-red) 55%, #6b1414 100%);
    mix-blend-mode: multiply;
    opacity: 0.18;
    z-index: 2;
    pointer-events: none;
}
.fm-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: relative;
    z-index: 1;
    transition: transform 600ms cubic-bezier(0.22, 1, 0.36, 1);
    /* Image naturelle : l'identité couleur passe par un overlay très léger
       et par la couleur du tag, plus par un fort multiply. */
}
.fm-card:hover .fm-card-media img {
    transform: scale(1.04);
}
.fm-card-media-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: rgba(255, 255, 255, 0.92);
    font-size: 2.25rem;
    position: relative;
    z-index: 1;
    mix-blend-mode: normal;
    transition: transform 320ms cubic-bezier(0.22, 1, 0.36, 1);
}
.fm-card-media-placeholder i {
    color: inherit;
    mix-blend-mode: normal;
    filter: drop-shadow(0 2px 6px rgba(10, 10, 10, 0.2));
}
.fm-card:hover .fm-card-media-placeholder {
    transform: scale(1.04);
}
/* Petits points décoratifs (étincelles dans le SVG hero) */
.fm-card-spark {
    position: absolute;
    z-index: 2;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--fm-amber);
    box-shadow: 0 0 8px rgba(245, 185, 74, 0.7);
}
.fm-card-spark--1 { top: 22%; left: 18%; }
.fm-card-spark--2 { top: 30%; right: 22%; width: 4px; height: 4px; }
.fm-card-spark--3 { top: 50%; right: 38%; width: 3px; height: 3px; }

/* ----------------------------------------------------------------
   CARD MEDIA — Voile coloré subtil par page + tag signature
   Plutôt qu'un fort multiply qui dénature l'image, on applique
   un overlay très faible (opacity 0.18) avec la teinte de la page.
   Le tag métier (top-left) prend également la couleur signature.
----------------------------------------------------------------- */

/* Scénarios — bleu (#4a7fa0) */
.fm-page--scenarios .fm-card-media::after {
    background: linear-gradient(135deg, #7ba8c4 0%, #4a7fa0 55%, #1f3d52 100%);
}
.fm-page--scenarios .fm-card-tag,
.fm-page--scenarios .fm-card-tag.inc,
.fm-page--scenarios .fm-card-tag.pompiers,
.fm-page--scenarios .fm-card-tag.police,
.fm-page--scenarios .fm-card-tag.gendarmerie,
.fm-page--scenarios .fm-card-tag.securite-civile {
    background: #4a7fa0;
}

/* Interactif — violet (#8b5bb8) */
.fm-page--interactif .fm-card-media::after {
    background: linear-gradient(135deg, #b48cd6 0%, #8b5bb8 55%, #3f2360 100%);
}
.fm-page--interactif .fm-card-tag,
.fm-page--interactif .fm-card-tag.inc,
.fm-page--interactif .fm-card-tag.pompiers,
.fm-page--interactif .fm-card-tag.police,
.fm-page--interactif .fm-card-tag.gendarmerie,
.fm-page--interactif .fm-card-tag.securite-civile {
    background: #8b5bb8;
}
/* Brouillons : fond violet (le gradient orange/rouge par défaut de
   .fm-card-media est remplacé pour les cards .fm-card--draft). */
.fm-card.fm-card--draft .fm-card-media {
    background: linear-gradient(135deg, #b48cd6 0%, #8b5bb8 55%, #3f2360 100%);
}

/* Dashboard — sauge (#5e9670) */
.fm-page--dashboard .fm-card-media::after {
    background: linear-gradient(135deg, #8fbf9f 0%, #5e9670 55%, #1f4a30 100%);
}
.fm-page--dashboard .fm-card-tag,
.fm-page--dashboard .fm-card-tag.inc,
.fm-page--dashboard .fm-card-tag.pompiers,
.fm-page--dashboard .fm-card-tag.police,
.fm-page--dashboard .fm-card-tag.gendarmerie,
.fm-page--dashboard .fm-card-tag.securite-civile {
    background: #5e9670;
}

/* Formations — coral (#d88751) : tag aligné sur la palette */
.fm-page--formations .fm-card-tag,
.fm-page--formations .fm-card-tag.inc,
.fm-page--formations .fm-card-tag.pompiers,
.fm-page--formations .fm-card-tag.police,
.fm-page--formations .fm-card-tag.gendarmerie,
.fm-page--formations .fm-card-tag.securite-civile {
    background: #d88751;
}

/* Tag métier — top-left (style mockup) */
.fm-card-tag {
    position: absolute;
    top: 14px;
    left: 14px;
    z-index: 3;
    padding: 6px 12px;
    background: rgba(10, 10, 10, 0.85);
    color: #fff;
    border-radius: 8px;
    font-family: var(--fm-display);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.fm-card-tag.inc,
.fm-card-tag.pompiers { background: rgba(10, 10, 10, 0.92); }
.fm-card-tag.police { background: rgba(30, 58, 95, 0.92); }
.fm-card-tag.gendarmerie { background: rgba(0, 51, 102, 0.92); }
.fm-card-tag.securite-civile { background: rgba(255, 102, 0, 0.92); }

/* Pill niveau (avant le titre, full radius, couleur par niveau) */
.fm-card-level {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    padding: 2px 9px;
    border-radius: 999px;
    font-family: var(--fm-display);
    font-size: 0.625rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    line-height: 1.4;
    background: #f0eee8;
    color: var(--fm-ink);
    width: fit-content;
}
.fm-card-level--debutant {
    background: #dcefe1;
    color: #1f6f3a;
}
.fm-card-level--intermediaire {
    background: #fde6b2;
    color: #7a5310;
}
.fm-card-level--avance {
    background: #fbd2c4;
    color: #8b2c1d;
}
.fm-card-level--expert {
    background: var(--fm-ink);
    color: #fff;
}

.fm-card-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: rgba(255, 255, 255, 0.4);
    z-index: 3;
}
.fm-card-progress-bar {
    height: 100%;
    background: var(--fm-amber);
}

.fm-card-body {
    padding: 4px 8px 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
    flex: 1;
}

.fm-card-title {
    font-family: var(--fm-display);
    font-size: 1.0625rem;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.015em;
    margin: 0;
    color: var(--fm-ink);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.65em;
}
.fm-card-title a {
    color: inherit;
    text-decoration: none;
}
.fm-card:hover .fm-card-title a {
    color: var(--fm-red);
}
.fm-card-excerpt {
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--fm-ink-soft);
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Meta ligne avec dots colorés (rappel SVG hero) */
.fm-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    font-size: 0.8125rem;
    color: var(--fm-ink-soft);
    margin-top: auto;
}
.fm-card-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--fm-ink-soft);
}
.fm-card-meta-item::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--fm-line-strong);
    flex-shrink: 0;
}
.fm-card-meta-item--accent::before { background: var(--fm-red); }
.fm-card-meta-item--success::before { background: #4caf50; }
.fm-card-meta-item--warning::before { background: var(--fm-amber); }
.fm-card-meta-item i {
    color: var(--fm-ink-mute);
    font-size: 0.75rem;
}

/* CTA pill noir avec flèche (rappel SVG hero) */
.fm-card-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 3px 3px 3px 14px;
    background: var(--fm-ink);
    color: #fff;
    border-radius: 999px;
    text-decoration: none;
    font-family: var(--fm-display);
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0;
    transition: background-color 220ms ease, transform 220ms ease;
    margin-top: 2px;
    line-height: 1;
}
.fm-card-cta:hover {
    background: var(--fm-red);
    color: #fff;
}
.fm-card-cta-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.14);
    font-size: 0.6875rem;
    transform: rotate(0deg);
    transition: transform 320ms cubic-bezier(0.22, 1, 0.36, 1);
    will-change: transform;
}
.fm-card:hover .fm-card-cta-arrow,
.fm-card:focus-within .fm-card-cta-arrow,
.fm-card-cta:hover .fm-card-cta-arrow,
.fm-card-cta:focus-visible .fm-card-cta-arrow {
    transform: rotate(-45deg);
}

/* Ligne d'actions sous le titre : CTA principal + bouton(s) icon rond */
.fm-card-actions {
    display: flex;
    align-items: stretch;
    gap: 8px;
    margin-top: 2px;
}
.fm-card-actions .fm-card-cta {
    flex: 1;
    margin-top: 0;
}
.fm-card-icon-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: transparent;
    border: 1px solid var(--fm-line);
    color: var(--fm-ink);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    cursor: pointer;
    font-size: 0.75rem;
    text-decoration: none;
    align-self: center;
    padding: 0;
    transition: background-color 220ms ease, border-color 220ms ease, color 220ms ease;
}
.fm-card-icon-btn:hover {
    background: var(--fm-ink);
    color: #fff;
    border-color: var(--fm-ink);
}
.fm-card-icon-btn--danger:hover {
    background: var(--fm-red);
    border-color: var(--fm-red);
    color: #fff;
}

/* ----- NOTICE FILTRE MÉTIER (réutilisée) ----- */
.fm-page .metier-filter-notice {
    background: var(--fm-paper);
    border: 1px solid var(--fm-line);
    border-left: 4px solid var(--fm-red);
    border-radius: var(--fm-radius-sm);
    color: var(--fm-ink);
    box-shadow: none;
    font-size: 0.9375rem;
    margin-bottom: clamp(1.25rem, 2vw, 1.75rem);
}
.fm-page .metier-filter-notice i {
    color: var(--fm-red);
}
.fm-page .metier-filter-notice strong {
    color: var(--fm-ink);
}

/* ----- EMPTY STATE ----- */
.fm-empty {
    text-align: center;
    padding: clamp(3rem, 6vw, 5rem) 1.5rem;
    background: var(--fm-paper);
    border-radius: var(--fm-radius-lg);
    border: 1px solid var(--fm-line);
}
.fm-empty-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: #fff;
    color: var(--fm-red);
    font-size: 1.75rem;
    margin-bottom: 1.25rem;
}
.fm-empty-title {
    font-family: var(--fm-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--fm-ink);
    margin: 0 0 0.625rem;
    letter-spacing: -0.015em;
}
.fm-empty-text {
    color: var(--fm-ink-soft);
    font-size: 0.9375rem;
    margin: 0 0 1.5rem;
    max-width: 44ch;
    margin-left: auto;
    margin-right: auto;
}

/* ----- BUTTONS pages internes ----- */
.fm-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    font-family: var(--fm-display);
    font-size: 0.9375rem;
    font-weight: 600;
    letter-spacing: 0;
    border: 1px solid transparent;
    border-radius: var(--fm-radius-sm);
    background: transparent;
    color: inherit;
    cursor: pointer;
    text-decoration: none;
    transition: transform 180ms ease, background-color 220ms ease, color 220ms ease, border-color 220ms ease;
}
.fm-btn:active { transform: translateY(1px); }
.fm-btn--dark {
    background: var(--fm-ink);
    color: #fff;
}
.fm-btn--dark:hover {
    background: var(--fm-red);
    color: #fff;
}
.fm-btn--outline {
    border-color: var(--fm-line-strong);
    color: var(--fm-ink);
}
.fm-btn--outline:hover {
    background: var(--fm-ink);
    border-color: var(--fm-ink);
    color: #fff;
}

/* ----- PAGINATION ----- */
.fm-pagination {
    margin-top: clamp(2.5rem, 5vw, 4rem);
    display: flex;
    justify-content: center;
}
.fm-pagination .nav-links {
    display: flex;
    gap: 0.375rem;
}
.fm-pagination .page-numbers {
    min-width: 44px;
    height: 44px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.75rem;
    background: transparent;
    border: 1px solid var(--fm-line-strong);
    color: var(--fm-ink);
    font-family: var(--fm-display);
    font-size: 0.9375rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 180ms ease;
}
.fm-pagination .page-numbers:hover {
    background: var(--fm-ink);
    border-color: var(--fm-ink);
    color: #fff;
}
.fm-pagination .page-numbers.current {
    background: var(--fm-ink);
    border-color: var(--fm-ink);
    color: #fff;
}

/* ----- LOAD ANIMATIONS ----- */
.fm-grid > .fm-card {
    opacity: 0;
    transform: translateY(20px);
    animation: fm-card-in 600ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.fm-grid > .fm-card:nth-child(1) { animation-delay: 80ms; }
.fm-grid > .fm-card:nth-child(2) { animation-delay: 140ms; }
.fm-grid > .fm-card:nth-child(3) { animation-delay: 200ms; }
.fm-grid > .fm-card:nth-child(4) { animation-delay: 260ms; }
.fm-grid > .fm-card:nth-child(5) { animation-delay: 320ms; }
.fm-grid > .fm-card:nth-child(6) { animation-delay: 380ms; }
.fm-grid > .fm-card:nth-child(n+7) { animation-delay: 440ms; }
@keyframes fm-card-in {
    to { opacity: 1; transform: translateY(0); }
}

.fm-hero-title {
    opacity: 0;
    transform: translateY(12px);
    animation: fm-title-in 800ms cubic-bezier(0.22, 1, 0.36, 1) 100ms forwards;
}
.fm-hero-eyebrow {
    opacity: 0;
    animation: fm-fade-in 600ms ease 50ms forwards;
}
.fm-hero-meta {
    opacity: 0;
    transform: translateY(8px);
    animation: fm-title-in 700ms cubic-bezier(0.22, 1, 0.36, 1) 250ms forwards;
}
.fm-search-bar {
    opacity: 0;
    transform: translateY(16px);
    animation: fm-title-in 700ms cubic-bezier(0.22, 1, 0.36, 1) 380ms forwards;
}
@keyframes fm-title-in {
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fm-fade-in {
    to { opacity: 1; }
}

/* ----- RESPONSIVE ----- */
@media (max-width: 900px) {
    .fm-page {
        --fm-edge-x: clamp(1rem, 4vw, 2rem);
    }
    .fm-hero-card {
        min-height: unset;
    }
    .fm-hero-card-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        padding: 2rem;
    }
    .fm-hero-illustration {
        height: 220px;
    }
    .fm-hero-illustration img,
    .fm-hero-illustration svg {
        right: -10%;
        bottom: -15%;
        width: 80%;
        height: 130%;
    }
    .fm-search-bar {
        flex-wrap: wrap;
        margin: -2rem var(--fm-edge-x) 0;
    }
    .fm-search-field {
        flex: 1 1 100%;
        border-right: 0;
        border-bottom: 1px solid var(--fm-line);
        padding-right: 0;
        padding-bottom: 0.875rem;
    }
    .fm-search-field:last-of-type {
        border-bottom: 0;
        padding-bottom: 0;
    }
    .fm-search-submit {
        flex: 1 1 100%;
    }
    .fm-search-submit .fm-circle-btn--lg {
        width: 100%;
        height: 52px;
        border-radius: var(--fm-radius-sm);
    }
}
@media (max-width: 640px) {
    .fm-hero { margin-top: 70px; }
    .fm-hero-card-content {
        padding: 1.75rem 1.5rem 5rem;
    }
    .fm-hero-meta {
        flex-wrap: wrap;
        gap: 1rem;
    }
    .fm-listing-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .fm-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    .fm-grid > .fm-card,
    .fm-hero-title,
    .fm-hero-eyebrow,
    .fm-hero-meta,
    .fm-search-bar {
        opacity: 1;
        transform: none;
        animation: none !important;
    }
    .fm-card,
    .fm-card-media img,
    .fm-circle-btn {
        transition: none !important;
    }
}
