/* ============================================
   MIA — Multi IA Formations
   Design System v2.2 — Coloré / Ludique / Gamifié
   ============================================ */

/* === Variables CSS === */
:root {
    --primary: #6C5CE7;
    --primary-light: #A29BFE;
    --primary-dark: #5A4BD1;
    --secondary: #00B894;
    --secondary-light: #55EFC4;
    --accent: #FDCB6E;
    --accent-dark: #F39C12;
    --danger: #E17055;
    --danger-light: #FAB1A0;
    --info: #74B9FF;
    --info-light: #DFE6E9;
    --dark: #2D3436;
    --gray: #636E72;
    --light: #F8F9FA;
    --white: #FFFFFF;
    --bg-gradient: linear-gradient(135deg, #6C5CE7 0%, #A29BFE 50%, #74B9FF 100%);
    --shadow-sm: 0 2px 8px rgba(108, 92, 231, 0.1);
    --shadow-md: 0 4px 16px rgba(108, 92, 231, 0.15);
    --shadow-lg: 0 8px 32px rgba(108, 92, 231, 0.2);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --font-heading: 'Poppins', sans-serif;
    --font-body: 'Inter', sans-serif;
}

/* === Reset & Base === */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    color: var(--dark);
    background-color: #F0F2F5;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.3;
    margin-top: 0;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--primary-dark);
}

img {
    max-width: 100%;
    height: auto;
}

/* === Container === */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* === Header === */
.header {
    background: var(--bg-gradient);
    color: white;
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-md);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
}

.logo {
    text-decoration: none;
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1;
}

.logo:hover {
    color: white;
}

.logo-main {
    font-family: var(--font-heading);
    font-size: 2.8rem;
    font-weight: 800;
    letter-spacing: -1px;
}

.logo-sub {
    font-size: 0.65rem;
    opacity: 0.8;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-top: 1px;
}

.logo-sub-main {
    font-size: 0.85rem;
}

.logo-sub-formations {
    margin-top: 3px;
}

.nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-link {
    color: rgba(255,255,255,0.9);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
}

.nav-link:hover {
    background: #fd8c52;
    color: white;
}

/* === User Menu === */
.user-menu {
    position: relative;
}

.user-menu-toggle {
    background: #fd8c52;
    border: 1px solid #fd8c52;
    color: white;
    padding: 8px 16px;
    border-radius: var(--radius-xl);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
}

.user-menu-toggle:hover {
    background: #e87a3f;
}

.user-menu-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 0;
    padding-top: 8px;
    min-width: max-content;
    z-index: 1001;
}

.user-menu:hover .user-menu-dropdown,
.user-menu:focus-within .user-menu-dropdown {
    display: block;
}

.user-menu-dropdown-inner {
    background: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.user-menu-item {
    display: block;
    padding: 12px 16px;
    color: var(--dark);
    text-decoration: none;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.user-menu-item:hover {
    background: var(--light);
}

/* === Boutons === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 24px;
    border-radius: var(--radius-xl);
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    gap: 8px;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(108, 92, 231, 0.3);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(108, 92, 231, 0.4);
    color: white;
}

.btn-secondary {
    background: var(--gray);
    color: white;
}

.btn-secondary:hover {
    background: var(--dark);
    color: white;
}

/* Bouton VIP doré */
.btn-vip {
    background: linear-gradient(135deg, #f5d020, #f5ab20) !important;
    color: #1a1a2e !important;
    border: none !important;
    font-weight: bold !important;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-vip:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(245, 208, 32, 0.4);
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: white;
}

/* Bouton Relire (bleu/violet) */
.btn-relire {
    color: #667eea !important;
    border-color: #667eea !important;
}
.btn-relire:hover {
    background: #667eea !important;
    color: white !important;
    border-color: #667eea !important;
}

/* Bouton Réinitialiser (rouge) */
.btn-reinit {
    color: #dc3545 !important;
    border-color: #dc3545 !important;
}
.btn-reinit:hover {
    background: #dc3545 !important;
    color: white !important;
    border-color: #dc3545 !important;
}

.btn-success {
    background: var(--secondary);
    color: white;
}

.btn-success:hover {
    color: white;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    color: white;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* === Cards === */
.card {
    background: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: none;
    overflow: hidden;
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-body {
    padding: 20px;
}

/* === Progress Bar === */
.progress-bar {
    width: 100%;
    height: 8px;
    background-color: #E9ECEF;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--secondary), var(--secondary-light));
    border-radius: 4px;
    transition: width 0.5s ease;
}

/* === Alerts === */
.alert {
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    margin-bottom: 15px;
    font-size: 0.9rem;
}

.alert-success {
    background: #D4EDDA;
    color: #155724;
    border: 1px solid #C3E6CB;
}

.alert-danger {
    background: #F8D7DA;
    color: #721C24;
    border: 1px solid #F5C6CB;
}

.alert-warning {
    background: #FFF3CD;
    color: #856404;
    border: 1px solid #FFEEBA;
}

.alert-info {
    background: #D1ECF1;
    color: #0C5460;
    border: 1px solid #BEE5EB;
}

/* === Formulaires === */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--dark);
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #E9ECEF;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 1rem;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.1);
}

/* === Exercices === */
.exercise {
    background: white;
    border-radius: var(--radius-md);
    padding: 24px;
    border-left: 4px solid var(--primary);
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
}

.exercise.validated-success {
    border-left-color: var(--secondary);
    background: linear-gradient(135deg, #F0FFF4 0%, #FFFFFF 100%);
}

.exercise-title {
    font-family: var(--font-heading);
    color: var(--primary);
    font-size: 1.2rem;
    margin-bottom: 15px;
}

.exercise-question p {
    font-size: 1.05rem;
    line-height: 1.5;
    margin-bottom: 20px;
}

.exercise-choices {
    margin-bottom: 20px;
}

.choice-item {
    display: flex;
    align-items: center;
    padding: 14px 18px;
    margin-bottom: 10px;
    border: 2px solid #E9ECEF;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
    background: white;
}

.choice-item:hover {
    border-color: var(--primary-light);
    background: #F8F7FF;
}

.choice-item input[type="radio"],
.choice-item input[type="checkbox"] {
    margin-right: 12px;
    accent-color: var(--primary);
    width: 18px;
    height: 18px;
}

.choice-text {
    font-size: 0.95rem;
    line-height: 1.4;
}

.exercise-submit {
    background: var(--primary);
    color: white;
    border: none;
    padding: 12px 32px;
    border-radius: var(--radius-xl);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 15px;
}

.exercise-submit:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.exercise-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.exercise-feedback {
    padding: 15px 20px;
    border-radius: var(--radius-sm);
    margin-top: 15px;
    font-size: 0.95rem;
    line-height: 1.5;
}

.exercise-feedback.success {
    background: #D4EDDA;
    color: #155724;
    border: 1px solid #C3E6CB;
}

.exercise-feedback.warning {
    background: #FFF3CD;
    color: #856404;
    border: 1px solid #FFEEBA;
}

.exercise-feedback.danger {
    background: #F8D7DA;
    color: #721C24;
    border: 1px solid #F5C6CB;
}

/* === Tooltips (data-tooltip) === */
[data-tooltip] {
    position: relative;
    cursor: help;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    background: #fd8c52;
    color: white;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 400;
    line-height: 1.4;
    white-space: normal;
    width: max-content;
    max-width: 220px;
    text-align: center;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
    transform: translateX(-50%) translateY(5px);
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

[data-tooltip]::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 4px);
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #fd8c52;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 1000;
}

[data-tooltip]:hover::after,
[data-tooltip]:hover::before {
    opacity: 1;
}

[data-tooltip]:hover::after {
    transform: translateX(-50%) translateY(0);
}

/* === Footer === */
.footer {
    background: var(--dark);
    color: rgba(255,255,255,0.6);
    padding: 20px 0;
    margin-top: 0;
    text-align: center;
    font-size: 0.85rem;
}

.footer a {
    color: rgba(255,255,255,0.8);
}

/* === Utilitaires === */
.text-center { text-align: center; }
.text-muted { color: var(--gray); }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mt-2 { margin-top: 0.5rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 1rem; }
.d-flex { display: flex; }
.justify-content-between { justify-content: space-between; }
.align-items-center { align-items: center; }
.row { display: flex; flex-wrap: wrap; margin: 0 -10px; }
.col { flex: 1; padding: 0 10px; }
.col-12 { flex: 0 0 100%; max-width: 100%; padding: 0 10px; }
.col-6 { flex: 0 0 50%; max-width: 50%; padding: 0 10px; }

@media (min-width: 768px) {
    .col-md-3 { flex: 0 0 25%; max-width: 25%; }
    .col-md-4 { flex: 0 0 33.333%; max-width: 33.333%; }
    .col-md-6 { flex: 0 0 50%; max-width: 50%; }
}

.main {
    padding: 30px 0 0 0;
    min-height: calc(100vh - 200px);
}

/* === Mobile Responsive === */
@media (max-width: 768px) {
    .header-content {
        flex-wrap: wrap;
        gap: 8px;
        padding: 8px 0;
    }
    
    .logo-main {
        font-size: 1.5rem;
    }
    
    .nav {
        gap: 4px;
        flex-wrap: wrap;
        justify-content: center;
        width: 100%;
    }
    
    .nav-link {
        padding: 6px 10px;
        font-size: 0.8rem;
    }
    
    .user-menu-toggle {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
    
    .container {
        padding: 0 15px;
    }
    
    .main {
        padding: 15px 0;
    }
}

@media (max-width: 480px) {
    .nav-link {
        padding: 5px 8px;
        font-size: 0.75rem;
    }
    
    .user-menu-toggle {
        padding: 5px 10px;
        font-size: 0.75rem;
    }
    
    .mia-logo-header {
        height: 30px;
    }
}

/* === Drag & drop classement === */
.ranking-item {
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
}

.ranking-item.dragging {
    opacity: 0.5;
    background: #E8E5FF !important;
    border-color: var(--primary) !important;
    box-shadow: 0 4px 16px rgba(108, 92, 231, 0.3) !important;
}

.ranking-container {
    min-height: 50px;
}

/* ============================================
   STREAK "ON FIRE" — Badge flottant
   ============================================ */
   
   /* Panneau flottant sticky en bas à droite (streak + timer) */
   .floating-stats-panel {
       position: fixed;
       bottom: 20px;
       right: 20px;
       display: flex;
       flex-direction: column;
       align-items: flex-end;
       gap: 6px;
       z-index: 1000;
       pointer-events: none;
   }
   
   .floating-stats-panel > * {
       pointer-events: auto;
       background-color: #fff;
   }
   
   .streak-badge {
       display: inline-flex;
       align-items: center;
       gap: 2px;
       padding: 4px 12px;
       border-radius: 20px;
       font-weight: bold;
       font-size: 0.95rem;
       transition: all 0.3s ease;
       box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
   }

/* Niveaux de streak */
.streak-cold {
    opacity: 0.5;
    color: #999;
}

.streak-fire {
    color: #ff8c00;
    background: rgba(255, 140, 0, 0.1);
}

.streak-hot {
    color: #ff5500;
    background: rgba(255, 85, 0, 0.15);
    font-size: 1rem;
}

.streak-legendary {
    color: #ff2200;
    background: rgba(255, 34, 0, 0.15);
    font-size: 1.1rem;
    text-shadow: 0 0 8px rgba(255, 100, 0, 0.4);
}

/* Animation flamme pulse pour streak >= 5 */
.streak-hot .streak-flame,
.streak-legendary .streak-flame {
    animation: flamePulse 1.5s ease-in-out infinite;
}

.streak-legendary .streak-flame {
    animation-duration: 0.8s;
}

@keyframes flamePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

/* Animation bump quand le streak augmente */
.streak-bump {
    animation: streakBump 0.4s ease-out;
}

@keyframes streakBump {
    0% { transform: scale(1); }
    30% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

/* Apparition du badge */
.streak-visible {
    animation: streakAppear 0.3s ease-out;
}

@keyframes streakAppear {
    0% { opacity: 0; transform: scale(0.5); }
    100% { opacity: 1; transform: scale(1); }
}

/* ============================================
   STREAK — Message temporaire animé
   ============================================ */

.streak-message {
    text-align: center;
    padding: 8px 16px;
    font-weight: bold;
    font-size: 1rem;
    color: #ff8c00;
    background: linear-gradient(135deg, rgba(255, 140, 0, 0.08), rgba(255, 85, 0, 0.12));
    border-radius: 8px;
    margin: 0 auto 10px;
    max-width: 400px;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.streak-message-show {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================
   SCORE FINAL — Encart de fin de formation
   ============================================ */

.final-score-card {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    border: 2px solid #e2b714;
    border-radius: 16px;
    padding: 30px;
    text-align: center;
    margin: 30px auto;
    max-width: 400px;
    animation: scoreCardAppear 0.6s ease-out;
}

@keyframes scoreCardAppear {
    0% { opacity: 0; transform: scale(0.8) translateY(20px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

.final-score-header {
    font-size: 1.3rem;
    font-weight: bold;
    color: #e2b714;
    margin-bottom: 15px;
}

.final-score-value {
    font-size: 3rem;
    font-weight: 900;
    color: #fff;
    line-height: 1;
    margin-bottom: 8px;
}

.final-score-detail {
    font-size: 1rem;
    color: #aaa;
    margin-bottom: 20px;
}

.final-score-streak {
    font-size: 1.1rem;
    color: #ff8c00;
    margin-bottom: 5px;
}

.final-score-bonus {
    font-size: 1rem;
    color: #4ecdc4;
    font-weight: bold;
}

/* ============================================
   MODALE "BON RETOUR" — Consolidation du savoir
   ============================================ */

.welcome-back-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.welcome-back-modal {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    border-radius: 20px;
    padding: 35px;
    max-width: 420px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.4s ease;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.welcome-back-header {
    margin-bottom: 20px;
}

.welcome-back-emoji {
    font-size: 3rem;
    display: block;
    margin-bottom: 10px;
}

.welcome-back-header h2 {
    color: #fff;
    font-size: 1.5rem;
    margin: 0;
}

.welcome-back-body {
    margin-bottom: 25px;
}

.welcome-back-text {
    color: #ccc;
    font-size: 1rem;
    line-height: 1.5;
    margin-bottom: 15px;
}

.welcome-back-hint {
    color: #aaa;
    font-size: 0.9rem;
    font-style: italic;
    margin-bottom: 15px;
}

.welcome-back-reward {
    margin: 12px 0;
}

.reward-line {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 10px 15px;
    color: #4ecdc4;
    font-size: 1.05rem;
    margin-bottom: 8px;
}

.reward-line.bonus {
    color: #e2b714;
}

.welcome-back-balance {
    color: #fff;
    font-size: 1.1rem;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.welcome-back-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 14px 40px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    width: 100%;
}

.welcome-back-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

/* ============================================
   CHRONOMÈTRE DE SESSION
   ============================================ */

.timer-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.85rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.timer-active {
    color: #4ecdc4;
    background: rgba(78, 205, 196, 0.1);
}

.timer-paused {
    color: #e74c3c;
    background: rgba(231, 76, 60, 0.1);
    animation: timerPulse 1.5s ease-in-out infinite;
}

@keyframes timerPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.timer-icon {
    font-size: 0.9rem;
}

.timer-display {
    font-family: 'Courier New', monospace;
    letter-spacing: 1px;
}

/* === Quête complétée === */
.quest-completed {
    opacity: 0.7;
    background: rgba(46, 204, 113, 0.05) !important;
}

.quest-completed .quest-title {
    text-decoration: line-through;
    color: #888;
}

.quest-completed .quest-desc {
    text-decoration: line-through;
    color: #aaa;
}

.quest-obtained {
    color: #2ecc71;
    font-weight: bold;
    font-size: 0.95rem;
}

.quest-reward-obtained {
    color: #2ecc71 !important;
}

/* ============================================
   NOTIFICATIONS RÉCOMPENSES (badges/quêtes)
   ============================================ */

.reward-notification-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

/* Bouton croix de fermeture des modales */
.modal-close-btn {
    position: absolute;
    top: 10px;
    right: 14px;
    background: none;
    border: none;
    color: #888;
    font-size: 1.3rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 50%;
    transition: color 0.2s, background 0.2s;
    z-index: 10;
    line-height: 1;
}

.modal-close-btn:hover {
    color: #fff;
    background: rgba(255,255,255,0.15);
}

.reward-notification-modal {
    position: relative;
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    border: 2px solid #e2b714;
    border-radius: 20px;
    padding: 30px 40px;
    text-align: center;
    max-width: 350px;
    width: 85%;
    animation: rewardPop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes rewardPop {
    0% { opacity: 0; transform: scale(0.5); }
    70% { transform: scale(1.1); }
    100% { opacity: 1; transform: scale(1); }
}

.reward-notification-icon {
    font-size: 3.5rem;
    margin-bottom: 10px;
}

.reward-notification-title {
    color: #e2b714;
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 8px;
}

.reward-notification-name {
    color: #fff;
    font-size: 1.4rem;
    font-weight: 900;
    margin-bottom: 5px;
}

.reward-notification-desc {
    color: #4ecdc4;
    font-size: 1rem;
    margin-bottom: 20px;
}

.reward-notification-btn {
    background: linear-gradient(135deg, #e2b714, #f5d020);
    color: #1a1a2e;
    border: none;
    border-radius: 12px;
    padding: 12px 35px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s;
    margin-top: 15px;
}

.reward-notification-btn:hover {
    transform: translateY(-2px);
}

/* === Listes dans le contenu des formations === */
.step-content ul {
    margin: 8px 0;
    padding-left: 24px;
}

.step-content ul li {
    margin-bottom: 4px;
    line-height: 1.6;
}

.step-content p {
    margin: 8px 0;
    line-height: 1.7;
}

.step-content blockquote {
    margin: 12px 0;
    padding: 10px 16px;
    border-left: 3px solid var(--primary-light);
    background: rgba(108, 92, 231, 0.05);
    border-radius: 0 8px 8px 0;
    font-style: italic;
}

/* ============================================
   FORMATION HOME — Page de présentation
   Design moderne et épuré
   ============================================ */

.fh-page {
    padding-bottom: 60px;
}

/* Breadcrumb */
.fh-breadcrumb {
    padding: 16px 0;
}

.fh-breadcrumb a {
    color: var(--gray);
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.fh-breadcrumb a:hover {
    color: var(--primary);
}

/* Hero Section */
.fh-hero {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    margin-bottom: 30px;
    display: flex;
    align-items: stretch;
}

.fh-hero-visual {
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 0;
    flex-shrink: 0;
    max-width: 380px;
}

.fh-hero-img {
    display: block;
    max-width: 100%;
    height: auto;
    width: auto;
    object-fit: contain;
}

.fh-hero-content {
    padding: 32px 36px 36px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.fh-title {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 800;
    color: var(--dark);
    margin: 0 0 12px 0;
    line-height: 1.2;
}

.fh-description {
    font-size: 1.1rem;
    color: var(--gray);
    line-height: 1.6;
    margin: 0 0 24px 0;
    max-width: 600px;
}

.fh-hero-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.fh-btn-action {
    font-size: 1.05rem;
    padding: 14px 32px;
    border-radius: var(--radius-md);
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.fh-btn-action:hover {
    transform: translateY(-2px);
}

/* Infos clés — Cartes horizontales */
.fh-key-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px;
    margin-bottom: 30px;
}

.fh-info-card {
    background: var(--white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: 24px 16px;
    text-align: center;
    transition: all 0.3s ease;
}

.fh-info-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
}

.fh-info-icon {
    font-size: 1.8rem;
    margin-bottom: 8px;
}

.fh-info-value {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1.2;
}

.fh-info-label {
    font-size: 0.85rem;
    color: var(--gray);
    margin-top: 4px;
    font-weight: 500;
}

/* Section Progression */
.fh-progress-section {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 28px 32px;
    margin-bottom: 30px;
}

.fh-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.fh-section-title {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--dark);
    margin: 0;
}

.fh-progress-date {
    font-size: 0.85rem;
    color: var(--gray);
}

.fh-progress-bar-wrapper {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.fh-progress-bar {
    flex: 1;
    height: 14px;
    background: #e9ecef;
    border-radius: 7px;
    overflow: hidden;
}

.fh-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    border-radius: 7px;
    transition: width 0.6s ease;
    min-width: 2%;
}

.fh-progress-fill.fh-progress-complete {
    background: linear-gradient(90deg, var(--secondary), var(--secondary-light));
}

.fh-progress-percent {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--primary);
    min-width: 50px;
    text-align: right;
}

.fh-progress-complete + .fh-progress-percent,
.fh-progress-fill.fh-progress-complete ~ .fh-progress-percent {
    color: var(--secondary);
}

/* Stats grid */
.fh-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
}

.fh-stat-item {
    background: #f8f9fa;
    border-radius: var(--radius-sm);
    padding: 16px;
    text-align: center;
}

.fh-stat-value {
    display: block;
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 4px;
}

.fh-stat-label {
    display: block;
    font-size: 0.8rem;
    color: var(--gray);
    font-weight: 500;
}

/* Actions secondaires */
.fh-actions-section {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 30px;
}

.fh-reset-form {
    display: inline-block;
}

.fh-btn-reset {
    font-size: 0.9rem;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    color: var(--gray);
    border-color: var(--gray);
}

.fh-btn-reset:hover {
    background: var(--danger);
    border-color: var(--danger);
    color: white;
}

/* Section invitation */
.fh-invite-section {
    background: linear-gradient(135deg, rgba(108, 92, 231, 0.05), rgba(162, 155, 254, 0.08));
    border: 2px dashed var(--primary-light);
    border-radius: var(--radius-lg);
    padding: 40px 32px;
    text-align: center;
    margin-bottom: 30px;
}

.fh-invite-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
}

.fh-invite-title {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--dark);
    margin: 0 0 8px 0;
}

.fh-invite-text {
    font-size: 1rem;
    color: var(--gray);
    max-width: 500px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Responsive — Formation Home */
@media (max-width: 768px) {
    .fh-hero {
        flex-direction: column;
    }

    .fh-hero-visual {
        max-width: 100%;
    }

    .fh-hero-content {
        padding: 24px 20px 28px;
    }

    .fh-title {
        font-size: 1.5rem;
    }

    .fh-description {
        font-size: 1rem;
    }

    .fh-key-info {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .fh-info-card {
        padding: 18px 12px;
    }

    .fh-info-value {
        font-size: 1.3rem;
    }

    .fh-progress-section {
        padding: 20px;
    }

    .fh-progress-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .fh-progress-bar-wrapper {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .fh-progress-percent {
        text-align: center;
    }

    .fh-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .fh-actions-section {
        flex-direction: column;
        align-items: stretch;
    }

    .fh-btn-action {
        justify-content: center;
        width: 100%;
    }

    .fh-reset-form {
        display: block;
    }

    .fh-btn-reset {
        width: 100%;
        text-align: center;
    }

    .fh-invite-section {
        padding: 28px 20px;
    }
}

@media (max-width: 480px) {
    .fh-key-info {
        grid-template-columns: 1fr 1fr;
    }

    .fh-stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .fh-title {
        font-size: 1.3rem;
    }
}

/* === Logo MIA === */
.mia-logo-container {
    text-align: center;
    margin: 10px 0 5px;
}

.mia-logo {
    display: inline-block;
    width: 180px;
    max-width: 100%;
    height: auto;
}

/* Variante login — grande taille */
.mia-logo.mia-logo-login {
    width: 530px;
}

/* Logo header — remplace le logo texte */
.mia-logo-header {
    display: block;
    width: 340px;
    max-width: 100%;
    height: auto;
    object-fit: contain;
}

@media (max-width: 768px) {
    .mia-logo.mia-logo-login {
        width: 440px;
    }

    .mia-logo-header {
        width: 260px;
    }
}

@media (max-width: 480px) {
    .mia-logo {
        width: 140px;
    }

    .mia-logo.mia-logo-login {
        width: 400px;
    }

    .mia-logo-header {
        width: 190px;
    }
}

/* ============================================
   FORMATIONS EXPERT VERROUILLÉES
   ============================================ */

.formation-expert-locked {
    opacity: 0.65;
    filter: grayscale(60%);
    transition: opacity 0.3s ease, filter 0.3s ease;
    pointer-events: none;
}

.formation-expert-locked:hover {
    opacity: 0.75;
    filter: grayscale(40%);
}

.formation-expert-locked .formation-image-link {
    position: relative;
    overflow: hidden;
    pointer-events: none;
}

.formation-expert-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(45, 52, 54, 0.55);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    z-index: 2;
    border-radius: var(--radius-md);
}

.expert-lock-icon {
    font-size: 2.5rem;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
}

.expert-lock-label {
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: #fff;
    font-weight: 700;
    font-size: 0.85rem;
    padding: 4px 14px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(243, 156, 18, 0.4);
}

.expert-lock-message {
    font-size: 0.82rem;
    color: var(--gray);
    text-align: center;
    padding: 8px 12px;
    line-height: 1.4;
    font-weight: 500;
    background: rgba(243, 156, 18, 0.08);
    border-radius: var(--radius-sm);
    border: 1px dashed rgba(243, 156, 18, 0.3);
}

/* ==========================================================
   MODALES GLOBALES (.fav-confirm-* + MIAModal)
   Disponibles partout via le layout — voir public/modal.js
   ========================================================== */
.fav-confirm-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}
.fav-confirm-modal {
    background: #1e1e2e;
    border-radius: 16px;
    padding: 28px 32px;
    max-width: 340px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    animation: scaleIn 0.25s ease;
}
.fav-confirm-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
}
.fav-confirm-title {
    font-family: 'Poppins', sans-serif;
    font-size: 1.15rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 8px;
}
.fav-confirm-text {
    color: #aaa;
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 20px;
}
.fav-confirm-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}
.fav-confirm-actions button {
    flex: 1;
    padding: 10px 16px;
    border: none;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s, opacity 0.15s;
    font-family: inherit;
}
.fav-confirm-actions button:hover {
    transform: scale(1.03);
}
.fav-confirm-cancel {
    background: #333;
    color: #ccc;
}
.fav-confirm-delete {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: #fff;
}
/* Variante "primary" (violet) pour les confirms non destructifs */
.fav-confirm-actions .fav-confirm-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
}
@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.9); }
    to   { opacity: 1; transform: scale(1); }
}

/* Slot input pour MIAModal.prompt */
.mia-modal-input-wrap {
    margin: 4px 0 16px;
    text-align: left;
}
.mia-modal-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #444;
    border-radius: 8px;
    background: #2a2a3e;
    color: #fff;
    font-family: inherit;
    font-size: 0.95rem;
    box-sizing: border-box;
}
.mia-modal-input:focus {
    outline: none;
    border-color: var(--primary-light);
    background: #2f2f44;
}
.mia-modal-input::placeholder {
    color: #777;
}
.mia-modal-input-error {
    margin-top: 6px;
    color: #ff8a80;
    font-size: 0.82rem;
    text-align: left;
}
