/* ============================================================
   LEARNEO — SYSTÈME DE DESIGN
   Glassmorphism — fond ardoise bleu-gris, glass cards, blobs, glow
   ============================================================ */

:root {
    /* Couleurs — slate glass theme */
    --ink: #eef0f6;
    --ink-soft: rgba(238, 240, 246, 0.85);
    --ink-line: rgba(255, 255, 255, 0.1);
    --paper: rgba(255, 255, 255, 0.08);
    --paper-raised: var(--glass-bg-card);
    --paper-line: var(--glass-border);
    --crimson: #D7263D;
    --crimson-dark: #B01F32;
    --teal: #12B8A9;
    --teal-dark: #0E9488;
    --gold: #F5A623;
    --text: #eef0f6;
    --royal: #2563EB;
    --royal-dark: #1D4ED8;
    /* Texte secondaire : 78 % d'opacite. A 55 %, il tombait sous le contraste AA
       (4.5) dans la plupart des themes, jusqu'a 1.6 sur les cartes claires. */
    --text-muted: rgba(238, 240, 246, 0.78);
    /* Accents utilises comme couleur de TEXTE : derives de la teinte du theme,
       eclaircis ici (fonds sombres), assombris dans les themes clairs.
       --royal et --crimson restent reserves aux fonds, bordures et decors. */
    --accent-text: color-mix(in srgb, var(--royal) 40%, #fff);
    --crimson-text: color-mix(in srgb, var(--crimson) 35%, #fff);
    /* Boutons d'appel : degrade assombri pour que le texte blanc reste lisible */
    --cta-bg: linear-gradient(90deg, color-mix(in srgb, var(--crimson) 82%, #000), color-mix(in srgb, var(--gold) 50%, #000));
    --on-cta: #fff;
    /* Couleurs de statut utilisees comme TEXTE : vives sur fond sombre,
       foncees dans les themes clairs (ou les teintes vives tombaient a 1.0). */
    --success-text: #a6f5ec;
    --warning-text: #ffebbd;
    --info-text: #b0d0ff;
    --danger-text: #ffb8c0;
    /* Fond plein en --crimson et son texte : accent assombri de 15 % sous du
       blanc ; les themes a accent clair gardent l'accent vif sous du texte fonce. */
    --crimson-fill: color-mix(in srgb, var(--crimson) 85%, #000);
    --on-crimson: #fff;

    /* Couleurs formulaires */
    --form-pink: #E91E63;
    --form-pink-dark: #C2185B;
    --form-pink-light: #FF5C8D;
    --form-violet: #8B5CF6;
    --form-violet-dark: #6D28D9;
    --form-gold: #FFB81C;
    --form-transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    /* Typo */
    --font-display: "Unbounded", sans-serif;
    --font-body: "Inter", system-ui, sans-serif;
    --font-mono: "JetBrains Mono", monospace;

    /* Echelle */
    --radius-s: 8px;
    --radius-m: 14px;
    --radius-l: 22px;
    --shadow-card: var(--glass-shadow);
    --shadow-card-hover: 0 4px 10px rgba(0,0,0,0.12), 0 16px 40px rgba(0,0,0,0.18);
    --container: 1160px;

    /* Glass — slate */
    --glass-bg: rgba(8, 12, 24, 0.16);
    --glass-bg-strong: rgba(255, 255, 255, 0.18);
    --glass-bg-card: rgba(8, 12, 24, 0.24);
    --glass-border: rgba(255, 255, 255, 0.18);
    --glass-border-strong: rgba(255, 255, 255, 0.3);
    --glass-blur: 20px;
    --glass-blur-strong: 32px;
    --glass-glow: 0 0 30px rgba(215, 38, 61, 0.12);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);

    /* Surfaces dropdown / calendrier — contraste garanti */
    --dropdown-bg: rgba(18, 22, 36, 0.94);
    --dropdown-text: #eef0f6;
    --dropdown-text-muted: rgba(238, 240, 246, 0.55);
    --dropdown-border: rgba(255, 255, 255, 0.12);
    --dropdown-hover: rgba(255, 255, 255, 0.08);

    /* Theme base (= Aurore) */
    --body-g1: #2b3547;
    --body-g2: #34405a;
    --body-g3: #3c4a63;
    --body-g4: #333f55;
    --body-g5: #2e384b;
    --blob1-color: rgba(215,38,61,0.25);
    --blob2-color: rgba(37,99,235,0.2);
    --blob3-color: rgba(245,166,35,0.2);
    --header-bg: rgba(30,38,52,0.7);
    --footer-bg: rgba(28,36,50,0.6);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--font-body);
    color: var(--text);
    background: linear-gradient(135deg, var(--body-g1) 0%, var(--body-g2) 25%, var(--body-g3) 50%, var(--body-g4) 75%, var(--body-g5) 100%);
    background-size: 100% 100%;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

h1, h2, h3, .display {
    font-family: var(--font-display);
    line-height: 1.08;
    letter-spacing: -0.01em;
    margin: 0;
}

.mono { font-family: var(--font-mono); }

a { color: inherit; }

/* Contraste garanti pour toutes les options de select */
select option {
    background: var(--dropdown-bg);
    color: var(--dropdown-text);
}

::selection { background: var(--crimson); color: white; }

:focus-visible {
    outline: 3px solid var(--gold);
    outline-offset: 2px;
    border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}

/* ============================================================
   GLASS BLOBS — decorative background
   ============================================================ */

.glass-blobs {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}
.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.4;
    animation: blob-float 20s ease-in-out infinite;
    will-change: transform;
    contain: strict;
}
.blob-1 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--blob1-color), transparent 70%);
    top: -10%;
    left: -5%;
}
.blob-2 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, var(--blob2-color), transparent 70%);
    top: 40%;
    right: -8%;
    animation-delay: -7s;
}
.blob-3 {
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, var(--blob3-color), transparent 70%);
    bottom: -5%;
    left: 30%;
    animation-delay: -13s;
}

/* ============================================================
   LAYOUT
   ============================================================ */

.container { max-width: var(--container); margin: 0 auto; padding: 0 1.5rem; }
.container-etroit { max-width: 480px; }

.section { padding: 5rem 0; }
.section-tight { padding: 3rem 0; }

/* Page centrée (login, inscription) */
.page-center {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.5rem;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}
.page-center-card {
    width: 100%;
    max-width: 560px;
    background: var(--glass-bg-card);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-l);
    padding: 2.5rem;
    box-shadow: var(--glass-shadow);
    animation: cardFadeIn 0.5s ease;
}

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

.page-center-card .form-title {
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 0.3rem;
    display: flex;
    align-items: center;
    gap: 10px;
}
.page-center-card .form-title-gradient {
    background: linear-gradient(90deg, var(--form-pink), var(--gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.page-center-card .form-intro {
    color: var(--text-muted);
    font-size: 0.92rem;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}
.page-center-card .form-footer-link {
    text-align: center;
    margin-top: 1.5rem;
    color: var(--text-muted);
    font-size: 0.92rem;
}
.page-center-card .form-footer-link a {
    color: var(--accent-text);
    font-weight: 600;
    text-decoration: none;
}
.page-center-card .form-footer-link a:hover {
    text-decoration: underline;
}
.page-center-card .form-note {
    margin-top: 1.2rem;
    padding: 0.8rem 1rem;
    background: rgba(37, 99, 235, 0.1);
    border-left: 3px solid var(--royal);
    border-radius: 0 8px 8px 0;
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.5;
}
.page-center-card .password-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ============================================================
   HEADER (glassmorphism)
   ============================================================ */

.header {
    position: sticky;
    top: 0;
    z-index: 50;
    padding: 16px 48px;
    background: var(--header-bg);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border-bottom: 1px solid var(--glass-border);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.12);
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 32px;
    position: relative;
    z-index: 50;
}

.header-left {
    display: flex;
    align-items: center;
    justify-self: start;
}

.logo {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.25rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, var(--crimson), var(--gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.logo:hover { transform: scale(1.05); }

.logo .brand-mark {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: var(--cta-bg);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--on-cta);
    -webkit-text-fill-color: var(--on-cta);
}

/* Navigation centrale */
.header-nav {
    display: flex;
    align-items: center;
    gap: 28px;
    justify-self: center;
}

.header-nav a {
    color: var(--ink-soft);
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 600;
    position: relative;
    transition: color 0.2s ease;
    white-space: nowrap;
}

.header-nav a::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--crimson);
    border-radius: 2px;
    transition: width 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.header-nav a:hover { color: var(--ink); }
.header-nav a:hover::after { width: 100%; }

/* Actions a droite */
.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-self: end;
}

.btn-outline,
button.btn-outline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    border: 2px solid var(--glass-border);
    border-radius: 999px;
    background: transparent;
    color: var(--ink-soft);
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s ease;
    white-space: nowrap;
    cursor: pointer;
    font-family: var(--font-body);
}

.btn-outline:hover,
button.btn-outline:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--glass-border-strong);
    color: var(--ink);
    transform: translateY(-1px);
}

.btn-primary-nav {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 22px;
    border-radius: 999px;
    background: var(--cta-bg);
    color: var(--on-cta);
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(215, 38, 61, 0.3);
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease;
    white-space: nowrap;
}
.btn-primary-nav:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(215, 38, 61, 0.4);
}

/* --- Language Switcher --- */
.lang-switcher {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-right: 4px;
}
.lang-switcher .bi-globe2 {
    font-size: 14px;
    color: var(--text-muted);
}
.lang-select {
    appearance: auto;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--glass-border);
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.04em;
    padding: 4px 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}
.lang-select:hover {
    color: var(--ink);
    border-color: var(--glass-border-strong);
    background: rgba(255, 255, 255, 0.15);
}
.lang-select:focus {
    outline: none;
    border-color: var(--glass-border-strong);
}
.lang-select option {
    background: var(--dropdown-bg);
    color: var(--dropdown-text);
}

/* ============================================================
   USER MENU — Dropdown utilisateur connecte
   ============================================================ */

.user-menu {
    position: relative;
}

.user-menu-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.user-prenom {
    text-transform: capitalize;
}

.user-menu-chevron {
    font-size: 0.65rem;
    transition: transform 0.2s ease;
    margin-left: 2px;
}

.user-menu.open .user-menu-chevron {
    transform: rotate(180deg);
}

.user-menu-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 220px;
    background: var(--header-bg);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-m);
    box-shadow: var(--glass-shadow);
    padding: 6px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
    z-index: 100;
}

.user-menu.open .user-menu-dropdown,
.user-menu:focus-within .user-menu-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-menu.open .user-menu-chevron,
.user-menu:focus-within .user-menu-chevron {
    transform: rotate(180deg);
}

.user-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    color: var(--ink-soft);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 500;
    transition: background 0.15s ease, color 0.15s ease;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    font-family: var(--font-body);
    white-space: nowrap;
}

.user-menu-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--ink);
}

.user-menu-logout {
    color: var(--crimson-text);
}

.user-menu-logout:hover {
    background: rgba(215, 38, 61, 0.12);
    color: var(--crimson-text);
}

.user-menu-group-label {
    display: block;
    padding: 8px 20px 2px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    pointer-events: none;
    user-select: none;
}

/* Recap — chips niveaux */
.recap-niveau-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    background: var(--glass-bg);
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
    user-select: none;
}
.recap-niveau-chip:has(input:checked) {
    background: rgba(18, 184, 169, 0.18);
    border-color: var(--teal);
}
.recap-niveau-chip input[type="checkbox"] {
    accent-color: var(--teal);
    width: 14px;
    height: 14px;
    margin: 0;
}

/* Tous les boutons disabled : gris solide */
button[disabled],
button:disabled,
.bouton-principal[disabled],
.bouton-secondaire[disabled] {
    background: rgb(92, 92, 102) !important;
    color: #f4f4f6 !important;
    border-color: rgba(90, 90, 100, 0.5) !important;
    box-shadow: none !important;
    cursor: not-allowed !important;
    transform: none !important;
}
button[disabled]:hover,
button:disabled:hover,
.bouton-principal[disabled]:hover,
.bouton-secondaire[disabled]:hover {
    transform: none !important;
    box-shadow: none !important;
    background: rgb(92, 92, 102) !important;
    border-color: rgba(90, 90, 100, 0.5) !important;
}
button[disabled]::before,
button:disabled::before,
.bouton-principal[disabled]::before {
    display: none !important;
}

.user-menu-divider {
    height: 1px;
    background: var(--glass-border);
    margin: 4px 12px;
}

/* ============================================================
   TOGGLE SYSTEME ACADEMIQUE
   ============================================================ */

/* Barre d'onglets en verre : une pastille en degrade glisse sous l'onglet
   actif (positionnee par interactions.js). Largeur au contenu par defaut,
   plafonnee au conteneur : les intitules passent sur deux lignes plutot que
   d'etre coupes.
   Fond et texte reposent sur la paire --dropdown-bg / --dropdown-text, dont
   chaque theme garantit le contraste : sur un simple verre translucide, les
   onglets inactifs tombaient a un contraste de 1.4 sur le theme par defaut. */
.systeme-toggle {
    position: relative;
    isolation: isolate;
    display: flex;
    gap: 4px;
    width: fit-content;
    max-width: 100%;
    padding: 6px;
    border-radius: 18px;
    border: 1px solid var(--glass-border);
    background: var(--dropdown-bg);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0)),
        color-mix(in srgb, var(--dropdown-bg) 82%, transparent);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.14),
        0 12px 32px -14px rgba(0, 0, 0, 0.4);
}

.systeme-toggle-indicator {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 0;
    border-radius: 13px;
    overflow: hidden;
    pointer-events: none;
    opacity: 0;
    /* Teintes foncees : le blanc y garde un contraste AA (5.9 a 7.1) */
    background: linear-gradient(135deg, var(--form-pink-dark) 0%, var(--form-violet-dark) 100%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.35),
        0 8px 22px -6px rgba(233, 30, 99, 0.55),
        0 6px 20px -8px rgba(139, 92, 246, 0.6);
    transition:
        transform 0.5s cubic-bezier(0.34, 1.36, 0.64, 1),
        width 0.5s cubic-bezier(0.34, 1.36, 0.64, 1),
        height 0.5s cubic-bezier(0.34, 1.36, 0.64, 1),
        opacity 0.3s ease;
}

/* Reflet qui balaie la pastille a chaque changement d'onglet */
.systeme-toggle-indicator::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(110deg, transparent 35%, rgba(255, 255, 255, 0.45) 50%, transparent 65%);
    transform: translateX(-120%);
}

.systeme-toggle-indicator.reflet::after {
    animation: systeme-toggle-reflet 0.9s ease-out 0.15s;
}

@keyframes systeme-toggle-reflet {
    to { transform: translateX(120%); }
}

.systeme-toggle-btn {
    position: relative;
    z-index: 1;
    flex: 1 1 auto;
    min-width: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 0.75rem 1.15rem;
    border: none;
    border-radius: 13px;
    background: transparent;
    color: var(--dropdown-text);
    color: color-mix(in srgb, var(--dropdown-text) 85%, transparent);
    font-family: var(--font-body);
    font-size: 0.92rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    line-height: 1.25;
    text-align: center;
    text-wrap: balance;
    cursor: pointer;
    transition: color 0.3s ease, background-color 0.25s ease, transform 0.2s ease;
}

/* Drapeau rond. Dessine en CSS/SVG : Windows n'affiche pas les emojis drapeaux. */
.systeme-toggle-btn::before {
    content: "";
    flex: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--drapeau, var(--glass-bg-strong)) center / cover no-repeat;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.45), 0 2px 6px rgba(0, 0, 0, 0.25);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
}

.systeme-toggle-btn[data-systeme="FR"] {
    --drapeau: linear-gradient(90deg, #0055a4 33.4%, #fff 33.4% 66.6%, #ef4135 66.6%);
}

.systeme-toggle-btn[data-systeme="CI"] {
    --drapeau: linear-gradient(90deg, #f77f00 33.4%, #fff 33.4% 66.6%, #009e60 66.6%);
}

.systeme-toggle-btn[data-systeme="UK"] {
    --drapeau: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 30'%3E%3CclipPath id='t'%3E%3Cpath d='M30,15h30v15zv15h-30zh-30v-15zv-15h30z'/%3E%3C/clipPath%3E%3Cpath d='M0,0v30h60v-30z' fill='%23012169'/%3E%3Cpath d='M0,0L60,30M60,0L0,30' stroke='%23fff' stroke-width='6'/%3E%3Cpath d='M0,0L60,30M60,0L0,30' clip-path='url(%23t)' stroke='%23C8102E' stroke-width='4'/%3E%3Cpath d='M30,0v30M0,15h60' stroke='%23fff' stroke-width='10'/%3E%3Cpath d='M30,0v30M0,15h60' stroke='%23C8102E' stroke-width='6'/%3E%3C/svg%3E");
}

.systeme-toggle-btn.active {
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

.systeme-toggle-btn.active::before {
    transform: scale(1.1);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.9), 0 3px 10px rgba(0, 0, 0, 0.3);
}

/* Sans JS, pas de pastille glissante : l'onglet actif porte le degrade. */
.systeme-toggle:not(.avec-indicateur) .systeme-toggle-btn.active {
    background: linear-gradient(135deg, var(--form-pink-dark), var(--form-violet-dark));
    box-shadow: 0 8px 22px -6px rgba(233, 30, 99, 0.55);
}

.systeme-toggle-btn:not(.active):not(.disabled):hover {
    color: var(--dropdown-text);
    background-color: var(--dropdown-hover);
}

.systeme-toggle-btn:not(.active):not(.disabled):hover::before {
    transform: scale(1.15) rotate(-10deg);
}

.systeme-toggle-btn:not(.disabled):active {
    transform: scale(0.97);
}

.systeme-toggle-btn:focus-visible {
    outline: 2px solid var(--form-pink-light);
    outline-offset: 2px;
}

.systeme-toggle-btn.disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.systeme-toggle-btn.disabled::before {
    filter: grayscale(1);
}

/* Sur telephone : drapeau au-dessus de l'intitule, pour que les trois
   systemes tiennent cote a cote sans qu'aucun ne soit coupe. */
@media (max-width: 560px) {
    .systeme-toggle {
        width: 100%;
        padding: 5px;
        border-radius: 16px;
    }

    .systeme-toggle-btn {
        flex: 1 1 0;
        flex-direction: column;
        gap: 0.35rem;
        padding: 0.6rem 0.4rem;
        font-size: 0.78rem;
    }

    .systeme-toggle-btn::before {
        width: 20px;
        height: 20px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .systeme-toggle-indicator,
    .systeme-toggle-btn,
    .systeme-toggle-btn::before {
        transition: none;
    }

    .systeme-toggle-indicator.reflet::after {
        animation: none;
    }
}

/* ============================================================
   MODALE DE CONFIRMATION
   ============================================================ */

.confirm-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.confirm-modal-overlay.open {
    opacity: 1;
    visibility: visible;
}

.confirm-modal {
    background: var(--header-bg);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-l);
    box-shadow: var(--glass-shadow);
    padding: 2rem 2.2rem;
    max-width: 380px;
    width: 90%;
    text-align: center;
    transform: scale(0.92);
    transition: transform 0.2s ease;
}

.confirm-modal-overlay.open .confirm-modal {
    transform: scale(1);
}

.confirm-modal-icon {
    font-size: 2.2rem;
    color: var(--gold);
    margin-bottom: 0.8rem;
}

.confirm-modal-text {
    font-size: 0.95rem;
    color: var(--ink);
    margin: 0 0 1.5rem 0;
    line-height: 1.5;
}

.confirm-modal-actions {
    display: flex;
    gap: 0.8rem;
    justify-content: center;
}

.confirm-modal-cancel,
.confirm-modal-ok {
    padding: 0.55rem 1.4rem;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 700;
    font-family: var(--font-body);
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.confirm-modal-cancel {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--glass-border);
    color: var(--ink-soft);
}

.confirm-modal-cancel:hover {
    background: rgba(255, 255, 255, 0.18);
    color: var(--ink);
}

.confirm-modal-ok {
    background: linear-gradient(135deg, var(--crimson), var(--crimson-dark));
    color: #fff;
    box-shadow: 0 4px 12px rgba(215, 38, 61, 0.3);
}

.confirm-modal-ok:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(215, 38, 61, 0.45);
}

/* ============================================================
   BOUTONS
   ============================================================ */

.bouton-principal, .bouton-secondaire {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.85rem 1.5rem;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 0.95rem;
    text-decoration: none;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease;
    position: relative;
    overflow: hidden;
}

.bouton-principal {
    background: var(--cta-bg);
    color: var(--on-cta);
    box-shadow: 0 4px 16px rgba(215, 38, 61, 0.3);
    letter-spacing: 0.03em;
}
.bouton-principal::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    transform: translate(-50%, -50%);
    transition: width 0.5s ease, height 0.5s ease;
}
.bouton-principal:active::before { width: 300px; height: 300px; }
.bouton-principal:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 12px 30px rgba(215, 38, 61, 0.4);
}
.bouton-principal:active { transform: translateY(0); }

.bouton-secondaire {
    background: transparent;
    color: var(--text);
    border: 1.5px solid var(--glass-border);
}
.bouton-secondaire:hover {
    border-color: var(--glass-border-strong);
    background: rgba(255, 255, 255, 0.08);
}

.bouton-jaune {
    background: #f5c518;
    color: #1a1a1a;
    border: 1.5px solid #e0b000;
}
.bouton-jaune:hover { background: #e0b000; border-color: #c99e00; transform: translateY(-1px); }

/* Accordéon solutions */
.accordeon-solution-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    margin: 0.8rem 0 0.4rem;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
    border: 1.5px solid var(--glass-border);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: background 0.15s ease, border-color 0.15s ease;
}
.accordeon-solution-toggle:hover { background: rgba(255, 255, 255, 0.15); border-color: var(--glass-border-strong); }
.accordeon-chevron {
    display: inline-block;
    font-size: 0.7rem;
    transition: transform 0.25s ease;
}
.accordeon-chevron-ouvert { transform: rotate(90deg); }
.accordeon-solution-contenu {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.35s ease, opacity 0.25s ease;
}
.accordeon-solution-contenu.accordeon-ouvert {
    max-height: 2000px;
    opacity: 1;
}

.bouton-secondaire.sur-fond-sombre {
    color: var(--ink);
    border-color: var(--glass-border);
}
.bouton-secondaire.sur-fond-sombre:hover { border-color: var(--glass-border-strong); }

/* ============================================================
   MODAL DE CONNEXION (glassmorphism)
   ============================================================ */

.login-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
}
.login-modal-overlay.show {
    display: flex;
    animation: loginFadeIn 0.25s ease;
}

@keyframes loginFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.login-modal {
    /* Fond quasi opaque du theme : un verre translucide pose sur le voile noir
       devenait gris moyen, illisible avec le texte fonce des themes clairs. */
    background: var(--dropdown-bg);
    backdrop-filter: blur(32px);
    -webkit-backdrop-filter: blur(32px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    width: 90%;
    max-width: 440px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    animation: loginSlideUp 0.3s ease;
}

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

.login-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.2rem 1.5rem;
    /* Teintes assombries : le titre blanc reste lisible quand --royal est clair (abyss) */
    background: linear-gradient(135deg, color-mix(in srgb, var(--royal) 80%, #000) 0%, var(--form-violet-dark) 100%);
    color: #fff;
}
.login-modal-header h5 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}
.login-modal-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.6rem;
    cursor: pointer;
    line-height: 1;
    opacity: 0.8;
    transition: opacity 0.2s;
}
.login-modal-close:hover { opacity: 1; }

.login-modal-body {
    padding: 1.8rem 1.5rem 1.5rem;
}

.login-modal-avatar {
    text-align: center;
    margin-bottom: 1.5rem;
}
.login-modal-avatar-circle {
    width: 60px;
    height: 60px;
    margin: 0 auto 12px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--royal), var(--form-pink));
    color: #fff;
    font-size: 28px;
}
.login-modal-avatar h6 {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
}

.login-field {
    margin-bottom: 1rem;
}
.login-field label {
    display: block;
    margin-bottom: 6px;
    color: var(--accent-text);
    font-weight: 600;
    font-size: 0.88rem;
}
.login-field label i {
    margin-right: 4px;
}
.login-field input {
    width: 100%;
    padding: 12px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    font-size: 0.95rem;
    font-family: var(--font-body);
    color: var(--ink);
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}
.login-field input:focus,
.login-field select:focus {
    outline: none;
    border-color: var(--crimson);
    box-shadow: 0 0 0 3px rgba(215, 38, 61, 0.2), 0 0 20px rgba(215, 38, 61, 0.1);
    background: rgba(255, 255, 255, 0.12);
}
.login-field select {
    width: 100%;
    padding: 12px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    font-size: 0.95rem;
    font-family: var(--font-body);
    color: var(--ink);
    transition: border-color 0.2s;
    box-sizing: border-box;
}
.login-field select option {
    background: var(--dropdown-bg);
    color: var(--dropdown-text);
}
.login-field input::placeholder {
    color: var(--text-muted);
}
.password-wrapper {
    position: relative;
}
.password-wrapper input {
    padding-right: 44px;
}
.password-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    font-size: 1.1rem;
    line-height: 1;
    transition: color 0.2s;
}
.password-toggle:hover {
    color: var(--ink);
}

.login-modal-submit {
    width: 100%;
    padding: 12px;
    margin-top: 0.5rem;
    background: var(--cta-bg);
    color: var(--on-cta);
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 700;
    font-family: var(--font-body);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: transform 0.2s, box-shadow 0.2s;
}
.login-modal-submit:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(233, 30, 99, 0.35);
}
.login-modal-submit:disabled {
    background: rgb(92, 92, 102) !important;
    color: #f4f4f6 !important;
    cursor: not-allowed;
}

.login-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: loginSpin 0.6s linear infinite;
    margin-right: 6px;
}

@keyframes loginSpin {
    to { transform: rotate(360deg); }
}

/* Separateur "ou" avec texte */
.login-divider-text {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 1.2rem 0;
    color: var(--text-muted);
    font-size: 0.82rem;
    text-transform: lowercase;
}
.login-divider-text::before,
.login-divider-text::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--glass-border);
}

/* Bouton Google OAuth2 */
.btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 11px 16px;
    border: 2px solid var(--glass-border);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-google:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
.btn-google svg {
    flex-shrink: 0;
}

.login-modal-divider {
    height: 1px;
    background: var(--glass-border);
    margin: 1.5rem 0;
}

.login-modal-register {
    text-align: center;
}
.login-modal-register p {
    margin: 0 0 8px;
    color: var(--text-muted);
    font-size: 0.88rem;
}
.login-modal-register-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: 2px solid var(--royal);
    border-radius: 10px;
    color: var(--accent-text);
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
}
.login-modal-register-link:hover {
    background: var(--royal);
    color: #fff; /* sur fond royal colore */
}

/* Alertes dans le modal */
.login-alert {
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.88rem;
    display: flex;
    align-items: center;
    gap: 8px;
}
.login-alert-danger {
    background: rgba(215, 38, 61, 0.15);
    color: var(--danger-text);
    border: 1px solid rgba(215, 38, 61, 0.3);
}
.login-alert-success {
    background: rgba(18, 184, 169, 0.15);
    color: var(--success-text);
    border: 1px solid rgba(18, 184, 169, 0.3);
}

/* ============================================================
   HERO — glassmorphism + effets speciaux
   ============================================================ */

.hero {
    position: relative;
    background: transparent;
    color: var(--text);
    overflow: hidden;
    z-index: 1;
}

/* --- Scene hero (image + effets) --- */
.hero-svg-scene {
    position: relative;
    width: 100%;
    z-index: 1;
    line-height: 0;
    perspective: 1000px;
}

.hero-svg-scene img {
    width: 100%;
    height: auto;
    max-height: 70vh;
    display: block;
    object-fit: contain;
    opacity: 0;
    animation: hero-entrance 1.4s cubic-bezier(0.16, 1, 0.3, 1) 0.2s forwards;
    transition: transform 0.3s ease;
}

/* --- Scene hero petit ecran (cachee par defaut) --- */
.hero-svg-scene-mobile {
    display: none;
    position: relative;
    width: 100%;
    z-index: 1;
    line-height: 0;
    perspective: 1000px;
}

.hero-svg-scene-mobile img {
    width: 100%;
    height: auto;
    max-height: 70vh;
    display: block;
    object-fit: contain;
    opacity: 0;
    animation: hero-entrance 1.4s cubic-bezier(0.16, 1, 0.3, 1) 0.2s forwards,
               hero-breathe 6s ease-in-out 1.6s infinite;
    transition: transform 0.3s ease;
}

/* --- Entree cinematique --- */
@keyframes hero-entrance {
    0%   { opacity: 0; transform: scale(1.08) translateY(30px); filter: blur(12px) brightness(1.3); }
    60%  { opacity: 0.5; filter: blur(2px) brightness(1.1); }
    100% { opacity: 0.6; transform: scale(1) translateY(0); filter: blur(0) brightness(1); }
}

/* --- Respiration continue (floating) --- */
.hero-svg-scene img {
    animation: hero-entrance 1.4s cubic-bezier(0.16, 1, 0.3, 1) 0.2s forwards,
               hero-breathe 6s ease-in-out 1.6s infinite;
}

@keyframes hero-breathe {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-10px); }
}

/* --- Aura lumineuse derriere l'image --- */
.hero-glow {
    position: absolute;
    inset: 10% 15%;
    z-index: 0;
    border-radius: 50%;
    background: radial-gradient(
        ellipse at center,
        rgba(215,38,61,0.12) 0%,
        rgba(37,99,235,0.08) 40%,
        transparent 70%
    );
    filter: blur(60px);
    opacity: 0;
    animation: hero-glow-in 2s ease 0.5s forwards,
               hero-glow-pulse 5s ease-in-out 2.5s infinite;
    pointer-events: none;
}

@keyframes hero-glow-in {
    from { opacity: 0; transform: scale(0.8); }
    to   { opacity: 1; transform: scale(1); }
}

@keyframes hero-glow-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: 0.7; transform: scale(1.06); }
}

/* --- Trainee lumineuse (shimmer streak) --- */
.hero-svg-scene::after,
.hero-svg-scene-mobile::after {
    content: "";
    position: absolute;
    top: 0;
    left: -120%;
    width: 60%;
    height: 100%;
    background: linear-gradient(
        105deg,
        transparent 30%,
        rgba(255,255,255,0.04) 42%,
        rgba(255,255,255,0.1) 48%,
        rgba(255,255,255,0.04) 54%,
        transparent 66%
    );
    pointer-events: none;
    z-index: 3;
    animation: hero-shimmer 8s ease-in-out 2s infinite;
}

@keyframes hero-shimmer {
    0%, 100% { left: -120%; }
    40%, 60% { left: 160%; }
}

/* --- Vignette (edges fade) --- */
.hero-vignette {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    background: radial-gradient(
        ellipse 80% 70% at 50% 50%,
        transparent 50%,
        rgba(var(--hero-vignette-rgb, 91,107,130), 0.4) 100%
    );
}

/* --- Reflet miroir sous l'image --- */
.hero-reflection-mobile {
    display: none;
}

.hero-reflection {
    position: relative;
    width: 100%;
    z-index: 1;
    line-height: 0;
    overflow: hidden;
    max-height: 80px;
    pointer-events: none;
}

.hero-reflection img {
    width: 100%;
    height: auto;
    max-height: 70vh;
    display: block;
    object-fit: contain;
    transform: scaleY(-1);
    opacity: 0.1;
    filter: blur(6px) saturate(1.2);
    -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,0.3), transparent 90%);
    mask-image: linear-gradient(to bottom, rgba(0,0,0,0.3), transparent 90%);
}

/* --- Particules lumineuses sur le hero --- */
.hero-sparkle {
    position: absolute;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: rgba(255,255,255,0.8);
    box-shadow: 0 0 6px rgba(255,255,255,0.6);
    z-index: 4;
    pointer-events: none;
    opacity: 0;
    animation: hero-sparkle-blink ease-in-out infinite;
}

.hero-sparkle:nth-child(1)  { left: 12%; top: 25%; animation-duration: 3s; animation-delay: 0s; }
.hero-sparkle:nth-child(2)  { left: 28%; top: 40%; animation-duration: 4s; animation-delay: 1.2s; }
.hero-sparkle:nth-child(3)  { left: 45%; top: 18%; animation-duration: 3.5s; animation-delay: 0.5s; }
.hero-sparkle:nth-child(4)  { left: 62%; top: 55%; animation-duration: 4.5s; animation-delay: 2s; }
.hero-sparkle:nth-child(5)  { left: 78%; top: 30%; animation-duration: 3s; animation-delay: 0.8s; }
.hero-sparkle:nth-child(6)  { left: 88%; top: 48%; animation-duration: 5s; animation-delay: 1.5s; }
.hero-sparkle:nth-child(7)  { left: 35%; top: 65%; animation-duration: 3.8s; animation-delay: 2.5s; }
.hero-sparkle:nth-child(8)  { left: 55%; top: 35%; animation-duration: 4.2s; animation-delay: 0.3s; }

@keyframes hero-sparkle-blink {
    0%, 100% { opacity: 0; transform: scale(0.5); }
    50%      { opacity: 1; transform: scale(1.5); }
}

/* --- Mouse parallax (set par JS) --- */
.hero-svg-scene.hero-parallax img {
    transition: transform 0.15s ease-out;
}

/* --- Theme overrides hero glow --- */
[data-theme="abyss"] .hero-glow {
    background: radial-gradient(
        ellipse at center,
        rgba(99,102,241,0.2) 0%,
        rgba(139,92,246,0.12) 40%,
        transparent 70%
    );
}

[data-theme="ocean"] .hero-glow {
    background: radial-gradient(ellipse at center, rgba(14,148,136,0.15) 0%, rgba(34,211,238,0.1) 40%, transparent 70%);
}

[data-theme="luxury"] .hero-glow {
    background: radial-gradient(ellipse at center, rgba(212,175,55,0.15) 0%, rgba(255,215,0,0.08) 40%, transparent 70%);
}

[data-theme="nuit"] .hero-glow {
    background: radial-gradient(ellipse at center, rgba(129,140,248,0.15) 0%, rgba(167,139,250,0.1) 40%, transparent 70%);
}

/* --- Responsive hero --- */
@media (max-width: 768px) {
    .hero-reflection { max-height: 50px; }
    .hero-glow { filter: blur(40px); }
}

@media (max-width: 560px) {
    .hero-svg-scene { display: none; }
    .hero-svg-scene-mobile { display: block; }
    .hero { min-height: 60px; }
    .hero-glow { filter: blur(30px); }
    .hero-reflection-desktop { display: none; }
    .hero-reflection-mobile { display: block; }
    .hero-reflection { max-height: 40px; }
}

/* --- prefers-reduced-motion --- */
@media (prefers-reduced-motion: reduce) {
    .hero-svg-scene img {
        opacity: 0.6;
        animation: none !important;
        filter: none;
        transform: none;
    }
    .hero-glow { animation: none !important; opacity: 0.5; }
    .hero-svg-scene::after { animation: none !important; display: none; }
    .hero-sparkle { animation: none !important; display: none; }
}

/* ============================================================
   REVEAL AU SCROLL
   ============================================================ */

[data-reveal] {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}
[data-reveal].in-view { opacity: 1; transform: translateY(0); }

/* ============================================================
   FEATURES (accueil — glass cards avec SVGs gradient + glow)
   ============================================================ */

.features-title {
    font-size: 2.2rem;
    margin-bottom: 0.6rem;
    text-align: center;
}
.features-subtitle {
    color: var(--text-muted);
    margin-bottom: 3rem;
    max-width: 40rem;
    font-size: 1.05rem;
    text-align: center;
    margin-left: auto;
    margin-right: auto;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.6rem;
}

/* Section glass pour accueil */
.section-glass {
    position: relative;
    z-index: 1;
}

/* --- Carte feature (glass) --- */
.feature-card {
    background: var(--glass-bg-card);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 2.2rem 1.4rem 1.8rem;
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: var(--glass-shadow);
    transition: transform 0.45s cubic-bezier(0.25,0.46,0.45,0.94),
                box-shadow 0.45s cubic-bezier(0.25,0.46,0.45,0.94),
                background 0.3s ease,
                border-color 0.3s ease;
}
/* Shimmer accent en haut de carte */
.feature-card::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--fc-accent, linear-gradient(90deg, var(--crimson), var(--gold)));
    background-size: 200% 100%;
    animation: fi-shimmer 3s ease-in-out infinite;
}
.feature-card:nth-child(1) { --fc-accent: linear-gradient(90deg, #D7263D, #F5A623, #D7263D); }
.feature-card:nth-child(2) { --fc-accent: linear-gradient(90deg, #0E9488, #22D3EE, #0E9488); }
.feature-card:nth-child(3) { --fc-accent: linear-gradient(90deg, #2563EB, #818CF8, #2563EB); }
.feature-card:nth-child(4) { --fc-accent: linear-gradient(90deg, #F5A623, #D7263D, #F5A623); }

.feature-card:hover {
    transform: translateY(-10px) scale(1.02);
    background: var(--glass-bg-strong);
    border-color: var(--glass-border-strong);
    box-shadow: var(--glass-shadow), var(--glass-glow),
                0 20px 50px rgba(0,0,0,0.2),
                0 0 30px var(--fc-glow, rgba(215,38,61,0.08));
}
.feature-card:nth-child(1) { --fc-glow: rgba(215,38,61,0.15); }
.feature-card:nth-child(2) { --fc-glow: rgba(14,148,136,0.15); }
.feature-card:nth-child(3) { --fc-glow: rgba(37,99,235,0.15); }
.feature-card:nth-child(4) { --fc-glow: rgba(245,166,35,0.15); }

.feature-card h3 {
    font-size: 1.05rem;
    margin-bottom: 0.5rem;
}
.feature-card p {
    color: var(--text-muted);
    font-size: 0.88rem;
    line-height: 1.55;
    margin: 0;
}

/* --- Conteneur icone avec glow pulse --- */
.feature-icon {
    width: 96px;
    height: 96px;
    margin: 0 auto 1.4rem;
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: transform 0.4s cubic-bezier(0.34,1.56,0.64,1);
}
.feature-card:hover .feature-icon { transform: scale(1.12) rotate(-2deg); }

.feature-icon svg {
    width: 56px;
    height: 56px;
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 2px 8px var(--fi-shadow, rgba(0,0,0,0.1)));
}

/* Halo lumineux derriere l'icone */
.fi-glow {
    position: absolute;
    inset: -8px;
    border-radius: 28px;
    background: var(--fi-glow-bg, rgba(215,38,61,0.1));
    filter: blur(16px);
    opacity: 0.5;
    animation: fi-pulse 3s ease-in-out infinite;
    z-index: 0;
}
.feature-card:hover .fi-glow { opacity: 0.9; filter: blur(20px); }

.feature-icon--cours {
    background: linear-gradient(135deg, rgba(215,38,61,0.15), rgba(245,166,35,0.15));
    --fi-glow-bg: rgba(215,38,61,0.2);
    --fi-shadow: rgba(215,38,61,0.2);
}
.feature-icon--exercices {
    background: linear-gradient(135deg, rgba(14,148,136,0.15), rgba(34,211,238,0.15));
    --fi-glow-bg: rgba(14,148,136,0.2);
    --fi-shadow: rgba(14,148,136,0.2);
}
.feature-icon--progression {
    background: linear-gradient(135deg, rgba(37,99,235,0.15), rgba(129,140,248,0.15));
    --fi-glow-bg: rgba(37,99,235,0.2);
    --fi-shadow: rgba(37,99,235,0.2);
}
.feature-icon--niveaux {
    background: linear-gradient(135deg, rgba(245,166,35,0.15), rgba(215,38,61,0.15));
    --fi-glow-bg: rgba(245,166,35,0.2);
    --fi-shadow: rgba(245,166,35,0.2);
}

/* ===== COURS — texte qui s'ecrit ===== */
.fi-tl {
    stroke-dasharray: 20;
    stroke-dashoffset: 20;
}
.feature-card.in-view .fi-tl,
.feature-card:hover .fi-tl { stroke-dashoffset: 0; transition: stroke-dashoffset 0.5s ease; }
.fi-tl-2 { transition-delay: 0.08s !important; }
.fi-tl-3 { transition-delay: 0.16s !important; }
.fi-tl-4 { transition-delay: 0.06s !important; }
.fi-tl-5 { transition-delay: 0.14s !important; }
.fi-tl-6 { transition-delay: 0.22s !important; }

/* Particules flottantes continues */
.fi-particle { animation: fi-float 3s ease-in-out infinite; }
.fi-p1 { animation-delay: 0s; }
.fi-p2 { animation-delay: 0.8s; }
.fi-p3 { animation-delay: 1.5s; }
.fi-p4 { animation-delay: 2.2s; }

/* ===== EXERCICES — ring + check + eclairs ===== */
.fi-ring-fill {
    transition: stroke-dashoffset 1s cubic-bezier(0.4,0,0.2,1);
}
.feature-card.in-view .fi-ring-fill,
.feature-card:hover .fi-ring-fill { stroke-dashoffset: 0; }

.fi-check {
    stroke-dasharray: 50;
    stroke-dashoffset: 50;
    transition: stroke-dashoffset 0.6s cubic-bezier(0.34,1.56,0.64,1) 0.4s;
}
.feature-card.in-view .fi-check,
.feature-card:hover .fi-check { stroke-dashoffset: 0; }

.fi-ray {
    opacity: 0;
    transform-origin: center;
    transform: scale(0);
    transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.34,1.56,0.64,1);
}
.feature-card.in-view .fi-ray,
.feature-card:hover .fi-ray { opacity: 1; transform: scale(1); }
.fi-ray-1 { transition-delay: 0.7s !important; }
.fi-ray-2 { transition-delay: 0.8s !important; }
.fi-ray-3 { transition-delay: 0.9s !important; }
.fi-ray-4 { transition-delay: 1.0s !important; }
.fi-ray-5 { transition-delay: 0.75s !important; }
.fi-ray-6 { transition-delay: 0.85s !important; }

/* Eclairs : pulsation continue apres apparition */
.feature-card.in-view .fi-ray,
.feature-card:hover .fi-ray {
    animation: fi-ray-pulse 2s ease-in-out infinite 1.2s;
}

/* ===== PROGRESSION — barres + courbe + fusee ===== */
.fi-bar {
    transform-origin: bottom center;
    transform: scaleY(0);
    transition: transform 0.6s cubic-bezier(0.34,1.56,0.64,1);
}
.feature-card.in-view .fi-bar,
.feature-card:hover .fi-bar { transform: scaleY(1); }
.fi-bar-1 { transition-delay: 0s !important; }
.fi-bar-2 { transition-delay: 0.12s !important; }
.fi-bar-3 { transition-delay: 0.24s !important; }
.fi-bar-4 { transition-delay: 0.36s !important; }

.fi-curve {
    stroke-dasharray: 80;
    stroke-dashoffset: 80;
    transition: stroke-dashoffset 1s ease 0.4s;
}
.feature-card.in-view .fi-curve,
.feature-card:hover .fi-curve { stroke-dashoffset: 0; }

.fi-rocket {
    opacity: 0;
    transform: translate(-20px, 20px) scale(0.5);
    transition: opacity 0.5s ease 1s, transform 0.6s cubic-bezier(0.34,1.56,0.64,1) 1s;
}
.feature-card.in-view .fi-rocket,
.feature-card:hover .fi-rocket {
    opacity: 1;
    transform: translate(0, 0) scale(1);
}
/* Fusee flottante continue */
.feature-card.in-view .fi-rocket,
.feature-card:hover .fi-rocket {
    animation: fi-float 2.5s ease-in-out infinite 1.5s;
}

/* ===== NIVEAUX — marches + etoile + confettis ===== */
.fi-step {
    transform-origin: bottom center;
    transform: scaleY(0);
    transition: transform 0.5s cubic-bezier(0.34,1.56,0.64,1);
}
.feature-card.in-view .fi-step,
.feature-card:hover .fi-step { transform: scaleY(1); }
.fi-step-1 { transition-delay: 0s !important; }
.fi-step-2 { transition-delay: 0.15s !important; }
.fi-step-3 { transition-delay: 0.3s !important; }

.fi-trophy {
    opacity: 0;
    transform: translateY(12px) scale(0.6);
    transition: opacity 0.5s ease 0.45s, transform 0.6s cubic-bezier(0.34,1.56,0.64,1) 0.45s;
}
.feature-card.in-view .fi-trophy,
.feature-card:hover .fi-trophy {
    opacity: 1;
    transform: translateY(0) scale(1);
}
/* Etoile qui pulse */
.feature-card.in-view .fi-star,
.feature-card:hover .fi-star {
    animation: fi-star-pulse 2s ease-in-out infinite 1s;
}

.fi-confetti {
    opacity: 0;
    transform: scale(0);
    transition: opacity 0.3s ease, transform 0.4s cubic-bezier(0.34,1.56,0.64,1);
}
.feature-card.in-view .fi-confetti,
.feature-card:hover .fi-confetti { opacity: 1; transform: scale(1); }
.fi-c1 { transition-delay: 0.5s !important; }
.fi-c2 { transition-delay: 0.6s !important; }
.fi-c3 { transition-delay: 0.7s !important; }
.fi-c4 { transition-delay: 0.8s !important; }
/* Confettis flottants continus */
.feature-card.in-view .fi-confetti,
.feature-card:hover .fi-confetti { animation: fi-confetti-drift 3s ease-in-out infinite 1s; }
.fi-c1 { animation-delay: 1s !important; }
.fi-c2 { animation-delay: 1.4s !important; }
.fi-c3 { animation-delay: 1.8s !important; }
.fi-c4 { animation-delay: 2.2s !important; }

/* ===== KEYFRAMES (feature icons) ===== */
@keyframes fi-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
@keyframes fi-pulse {
    0%, 100% { opacity: 0.4; transform: scale(1); }
    50%      { opacity: 0.7; transform: scale(1.08); }
}
@keyframes fi-float {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-6px); }
}
@keyframes fi-ray-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: 0.4; transform: scale(0.7); }
}
@keyframes fi-star-pulse {
    0%, 100% { transform: scale(1); filter: drop-shadow(0 0 4px rgba(245,166,35,0.3)); }
    50%      { transform: scale(1.15); filter: drop-shadow(0 0 12px rgba(245,166,35,0.6)); }
}
@keyframes fi-confetti-drift {
    0%, 100% { transform: scale(1) translate(0, 0); }
    25%      { transform: scale(1.1) translate(3px, -4px); }
    50%      { transform: scale(0.9) translate(-2px, -6px); }
    75%      { transform: scale(1.1) translate(4px, -3px); }
}

/* ============================================================
   MATIÈRES (cartes glass)
   ============================================================ */

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

.carte-matiere {
    background: var(--glass-bg-card);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-m);
    padding: 2rem;
    box-shadow: var(--glass-shadow);
    border-top: 4px solid var(--glass-border);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.3s ease, border-color 0.3s ease;
}
.carte-matiere:hover {
    transform: translateY(-4px);
    background: var(--glass-bg-strong);
    border-color: var(--glass-border-strong);
    box-shadow: var(--glass-shadow), var(--glass-glow);
}
.carte-matiere.francais { border-top-color: var(--crimson); }
.carte-matiere.mathematiques { border-top-color: var(--teal); }
.carte-matiere.anglais { border-top-color: var(--royal); }

.carte-matiere .icone {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    display: inline-block;
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    font-weight: 700;
}
.carte-matiere.francais .icone { background: rgba(215,38,61,0.15); color: var(--danger-text); }
.carte-matiere.mathematiques .icone { background: rgba(18,184,169,0.15); color: var(--success-text); }
.carte-matiere.anglais .icone { background: rgba(37,99,235,0.15); color: var(--info-text); }

.carte-matiere h3 { font-size: 1.3rem; margin-bottom: 0.6rem; }
.carte-matiere p { color: var(--text-muted); margin-bottom: 1.3rem; font-size: 0.95rem; }
.carte-matiere .lien-matiere {
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}
.carte-matiere.francais .lien-matiere { color: var(--danger-text); }
.carte-matiere.mathematiques .lien-matiere { color: var(--success-text); }
.carte-matiere.anglais .lien-matiere { color: var(--info-text); }

/* ============================================================
   ÉTAPES (glassmorphism)
   ============================================================ */

.etapes {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1.25rem;
}

.etape {
    position: relative;
    padding: 1.2rem;
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-s);
}
.etape .numero {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--crimson-text);
    font-weight: 700;
    display: block;
    margin-bottom: 0.6rem;
}
.etape h4 { font-family: var(--font-body); font-size: 1rem; font-weight: 700; margin-bottom: 0.4rem; }
.etape p { font-size: 0.87rem; color: var(--text-muted); margin: 0; }

/* ============================================================
   FORMULAIRES (glassmorphism)
   ============================================================ */

.carte-formulaire {
    background: var(--glass-bg-card);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-l);
    padding: 2.5rem;
    box-shadow: var(--glass-shadow);
}

.formulaire { display: flex; flex-direction: column; }

/* --- Form group : wrapper label + input avec underline anime --- */
.form-group {
    position: relative;
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.3rem;
    font-size: 0.9rem;
    color: var(--text-muted);
    transition: color var(--form-transition);
}

.form-group:focus-within label {
    color: var(--text);
}

/* Underline anime au focus */
.form-group::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--form-pink), var(--form-gold));
    transition: all var(--form-transition);
    transform: translateX(-50%);
    border-radius: 1px;
}

.form-group:focus-within::after {
    width: 100%;
}

/* Form row : 2 colonnes cote-a-cote */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
.form-row .form-group { margin-bottom: 0; }

/* Labels dans .formulaire sans .form-group (compatibilite) */
.formulaire > label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.3rem;
    margin-top: 1.1rem;
}
.formulaire > label:first-of-type { margin-top: 0; }

/* --- Champs de saisie (glass) --- */
.formulaire input:not([type="radio"]):not([type="checkbox"]):not([type="file"]),
.formulaire select,
.formulaire textarea {
    width: 100%;
    padding: 0.7rem 0.85rem;
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    font-size: 0.95rem;
    font-family: var(--font-body);
    color: var(--text);
    background: rgba(255, 255, 255, 0.08);
    transition: all var(--form-transition);
    box-sizing: border-box;
}
.formulaire select option {
    background: var(--dropdown-bg);
    color: var(--dropdown-text);
}

.formulaire input:not([type="radio"]):not([type="checkbox"]):not([type="file"]):focus,
.formulaire select:focus,
.formulaire textarea:focus {
    outline: none;
    border-color: var(--crimson);
    box-shadow: 0 0 0 3px rgba(215, 38, 61, 0.2), 0 0 20px rgba(215, 38, 61, 0.1);
    background: rgba(255, 255, 255, 0.12);
}

.formulaire input::placeholder,
.formulaire textarea::placeholder {
    color: var(--text-muted);
}

/* File input */
.formulaire input[type="file"] {
    padding: 12px 14px;
    border: 2px dashed var(--glass-border);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-muted);
    transition: border-color 0.2s ease, background 0.2s ease;
}
.formulaire input[type="file"]:hover {
    border-color: var(--form-pink);
    background: rgba(233, 30, 99, 0.04);
}

/* --- Bouton submit : gradient pink→violet avec ripple --- */
.formulaire button[type="submit"] {
    margin-top: 1.5rem;
    padding: 0.75rem 1.4rem;
    background: linear-gradient(135deg, var(--form-pink), var(--form-violet));
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    border: 2px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    font-family: var(--font-body);
    text-align: center;
    box-shadow: 0 6px 20px rgba(233, 30, 99, 0.35);
    transition: all var(--form-transition);
    position: relative;
    overflow: hidden;
    width: 100%;
}

/* Shimmer au hover */
.formulaire button[type="submit"]::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.formulaire button[type="submit"]:hover::before {
    left: 100%;
}

.formulaire button[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(233, 30, 99, 0.5);
}

.formulaire button[type="submit"]:active {
    transform: translateY(0);
}

/* --- Hint text --- */
.password-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* --- Checkbox personnalise --- */
.checkbox-group {
    margin-bottom: 1.2rem;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.checkbox-group input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid var(--glass-border);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.08);
    cursor: pointer;
    transition: all var(--form-transition);
    flex-shrink: 0;
    position: relative;
}

.checkbox-group input[type="checkbox"]:checked {
    background: linear-gradient(135deg, var(--form-pink), var(--form-violet));
    border-color: var(--form-pink-light);
}

.checkbox-group input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 1px;
    width: 6px;
    height: 10px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-group input[type="checkbox"]:focus {
    box-shadow: 0 0 0 3px rgba(233, 30, 99, 0.25);
}

/* --- Alertes / Erreurs / Info --- */
.erreur {
    color: var(--danger-text);
    font-size: 0.85rem;
    margin: 0.3rem 0 0;
}
.info { color: var(--success-text); font-size: 0.9rem; }
.note { color: var(--text-muted); font-size: 0.87rem; margin-top: 1.2rem; }

/* ============================================================
   TABLEAUX (admin — glass)
   ============================================================ */

.panneau {
    background: var(--glass-bg-card);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-m);
    padding: 1.75rem;
    box-shadow: var(--glass-shadow);
    margin-bottom: 2rem;
}

.panneau h2 {
    font-family: var(--font-body);
    font-size: 1.1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1.2rem;
}

.table { width: 100%; border-collapse: collapse; }
.table th {
    text-align: left;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    padding: 0.6rem 0.8rem;
    border-bottom: 2px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.06);
}
.table td {
    padding: 0.8rem;
    border-bottom: 1px solid var(--ink-line);
    font-size: 0.92rem;
}
.table tr:last-child td { border-bottom: none; }

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.6rem;
    height: 1.6rem;
    padding: 0 0.5rem;
    background: var(--crimson-fill);
    color: var(--on-crimson);
    border-radius: 999px;
    font-family: var(--font-mono);
    font-size: 0.78rem;
}

/* Badge systeme academique */
/* Badge de succes : turquoise assombri sous du blanc, lisible dans tous les themes */
.badge.badge-succes {
    background: color-mix(in srgb, var(--teal-dark) 65%, #000);
    color: #fff;
}
/* Badge neutre : teinte legere de la couleur du texte, contraste garanti par --ink */
.badge.badge-neutre {
    background: color-mix(in srgb, var(--ink) 16%, transparent);
    color: var(--ink);
}

.badge-systeme {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 700;
    font-family: var(--font-mono);
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    vertical-align: middle;
    margin-left: 0.3rem;
}
.badge-FR { background: rgba(37, 99, 235, 0.2); color: var(--info-text); }
.badge-UK { background: rgba(215, 38, 61, 0.2); color: var(--danger-text); }

/* ============================================================
   ADMIN — sous-nav & formulaires compacts (glass)
   ============================================================ */

.admin-subnav {
    background: var(--header-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--glass-border);
    padding: 0.8rem 1.5rem;
    display: flex;
    gap: 1.5rem;
    position: relative;
    z-index: 1;
}
.admin-subnav a {
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
}
.admin-subnav a:hover { color: var(--crimson-text); }

.fil-ariane {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1.2rem;
}
.fil-ariane a { color: var(--crimson-text); text-decoration: none; }

.grille-form {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.4rem 1.4rem;
}
.grille-form .pleine-largeur { grid-column: 1 / -1; }
.grille-form .form-group { margin-bottom: 0.4rem; }

.liste-items {
    list-style: none;
    margin: 0 0 1.5rem;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}
.item-ligne {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.9rem 1.1rem;
    background: rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-s);
    border: 1px solid var(--glass-border);
    text-decoration: none;
    color: var(--text);
}
.item-ligne:hover { border-color: var(--crimson); }
.item-ligne .meta { font-size: 0.8rem; color: var(--text-muted); }

.proposition-champ {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 0.6rem;
}
.proposition-champ input[type="text"] { flex: 1; margin-bottom: 0; }
.proposition-champ label {
    margin: 0;
    font-size: 0.82rem;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

/* Boutons d'action admin (dans tableaux) */
.table button[type="submit"],
.panneau form:not(.formulaire) button[type="submit"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1.1rem;
    border-radius: 10px;
    border: none;
    background: linear-gradient(135deg, var(--form-pink), var(--form-violet));
    color: #fff;
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 12px rgba(233, 30, 99, 0.25);
}
.table button[type="submit"]:hover,
.panneau form:not(.formulaire) button[type="submit"]:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(233, 30, 99, 0.4), 0 0 20px rgba(233, 30, 99, 0.15);
}

/* ============================================================
   QUIZ ÉLÈVE (glass)
   ============================================================ */

.quiz-progress {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}
.quiz-progress-bar {
    height: 6px;
    background: rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(8px);
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 2rem;
    border: 1px solid var(--ink-line);
}
.quiz-progress-bar > span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--crimson), var(--gold));
    border-radius: 999px;
    transition: width 0.4s ease;
    box-shadow: 0 0 12px rgba(215, 38, 61, 0.3);
}

/* Bouton quiz pleine largeur */
.carte-question-entree .formulaire button[type="submit"] {
    align-self: stretch;
    text-align: center;
}


.quiz-enonce {
    font-family: var(--font-display);
    font-size: 1.3rem;
    margin-bottom: 1.6rem;
}

.choix-liste { display: flex; flex-direction: column; gap: 0.7rem; margin-bottom: 1.6rem; }
.choix-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.9rem 1.1rem;
    border: 1.5px solid var(--glass-border);
    border-radius: var(--radius-s);
    cursor: pointer;
    background: rgba(255, 255, 255, 0.06);
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.choix-item:hover {
    border-color: var(--crimson);
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 15px rgba(215, 38, 61, 0.08);
}
.choix-item input { accent-color: var(--crimson); }

.choix-item.correcte {
    border-color: var(--teal);
    background: rgba(18,184,169,0.12);
    box-shadow: 0 0 20px rgba(18,184,169,0.1);
}
.choix-item.incorrecte {
    border-color: var(--crimson);
    background: rgba(215,38,61,0.1);
    box-shadow: 0 0 20px rgba(215,38,61,0.08);
}

.feedback {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 1rem 1.2rem;
    border-radius: var(--radius-s);
    font-weight: 600;
    margin-bottom: 1.2rem;
    animation: feedback-entree 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
    backdrop-filter: blur(12px);
    border: 1px solid transparent;
}
.feedback.correct {
    background: rgba(18,184,169,0.15);
    border-color: rgba(18,184,169,0.3);
    color: var(--success-text);
    box-shadow: 0 0 25px rgba(18,184,169,0.15);
    animation: feedback-entree 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both,
               feedback-glow-ok 1.5s ease 0.5s both;
}
.feedback.incorrect {
    background: rgba(215,38,61,0.12);
    border-color: rgba(215,38,61,0.3);
    color: var(--danger-text);
    box-shadow: 0 0 25px rgba(215,38,61,0.12);
    animation: feedback-entree 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both,
               feedback-shake 0.5s ease 0.5s both;
}
/* Reponse redigee (TEXTE_LIBRE) : hors bareme, ni juste ni fausse */
.feedback.hors-bareme {
    background: rgba(148, 163, 184, 0.15);
    border-color: rgba(148, 163, 184, 0.35);
    color: var(--text-muted);
}

@keyframes feedback-entree {
    from { opacity: 0; transform: translateY(-20px) scale(0.9); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes feedback-glow-ok {
    0%   { box-shadow: 0 0 0 0 rgba(18,184,169,0.4); }
    50%  { box-shadow: 0 0 30px 12px rgba(18,184,169,0.2); }
    100% { box-shadow: 0 0 25px rgba(18,184,169,0.15); }
}
@keyframes feedback-shake {
    0%, 100% { transform: translateX(0); }
    15%      { transform: translateX(-8px); }
    30%      { transform: translateX(7px); }
    45%      { transform: translateX(-5px); }
    60%      { transform: translateX(4px); }
    75%      { transform: translateX(-2px); }
}

/* Note dictée : entrée spectaculaire */
.note-dictee-hero {
    animation: note-pop 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) both 0.3s;
}
@keyframes note-pop {
    0%   { opacity: 0; transform: scale(0.3) rotate(-8deg); }
    60%  { transform: scale(1.1) rotate(2deg); }
    100% { opacity: 1; transform: scale(1) rotate(0); }
}

/* Encouragement qui pulse */
.encouragement {
    display: block;
    margin-top: 0.3rem;
    animation: encouragement-in 0.5s ease both 0.8s;
}
@keyframes encouragement-in {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Confetti canvas — plein écran fixe, derrière les interactions */
#confetti-canvas {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 100;
}

/* Carte question : entrée douce */
.carte-question-entree {
    animation: carte-slide-in 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes carte-slide-in {
    from { opacity: 0; transform: translateY(30px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* TTS buttons — style glass */
.tts-controls {
    display: flex;
    gap: 0.6rem;
    margin-bottom: 1.2rem;
}
.btn-tts {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.75rem 1.1rem;
    border: 1.5px solid var(--glass-border);
    border-radius: var(--radius-s);
    background: rgba(255, 255, 255, 0.08);
    cursor: pointer;
    font-family: var(--font-body);
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text);
    transition: all 0.2s ease;
}
.btn-tts:hover {
    border-color: var(--crimson);
    color: var(--danger-text);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(215,38,61,0.15);
    background: rgba(215, 38, 61, 0.08);
}
.btn-tts:active { transform: translateY(0); }
.btn-tts-normal svg { color: var(--crimson-text); }
.btn-tts-slow svg { color: var(--gold); }

/* Résultat : carte entrée spectaculaire */
.carte-resultat-entree {
    animation: resultat-entree 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes resultat-entree {
    from { opacity: 0; transform: translateY(40px) scale(0.92); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.resultat-label-entree {
    animation: encouragement-in 0.4s ease both 0.2s;
}

/* Score pop spectaculaire */
.resultat-score-pop {
    animation: note-pop 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) both 0.4s;
}

.resultat-note-chiffre {
    font-size: 3rem;
    font-weight: 700;
}

/* Detail panneau : slide in */
.detail-panneau-entree {
    animation: carte-slide-in 0.5s cubic-bezier(0.22, 1, 0.36, 1) both 0.3s;
}

/* Detail lignes : apparition échelonnée */
.detail-ligne-entree {
    opacity: 0;
    animation: detail-ligne-in 0.35s ease both;
    animation-delay: calc(0.5s + var(--delay, 0s));
}
@keyframes detail-ligne-in {
    from { opacity: 0; transform: translateX(-12px); }
    to   { opacity: 1; transform: translateX(0); }
}

.explication {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--ink-line);
    border-radius: var(--radius-s);
    padding: 1rem 1.2rem;
    font-size: 0.92rem;
    color: var(--text-muted);
    margin-bottom: 1.6rem;
}

/* ============================================================
   DIFF DICTÉE — affichage mot-à-mot coloré
   ============================================================ */

.dictee-diff {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.45rem;
    align-items: baseline;
    padding: 1.2rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--ink-line);
    border-radius: var(--radius-s);
    margin-bottom: 1.6rem;
    line-height: 2;
    font-size: 1.05rem;
}

.diff-mot {
    display: inline-flex;
    align-items: baseline;
    gap: 0.25rem;
}

.diff-correct {
    color: var(--text);
}

.diff-groupe-erreur {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    background: rgba(215, 38, 61, 0.1);
    border-radius: 4px;
    padding: 0.1rem 0.35rem;
}

.diff-erreur-soumis {
    color: var(--danger-text);
    text-decoration: line-through;
    font-size: 0.88em;
    opacity: 0.75;
}

.diff-erreur-attendu {
    color: var(--success-text);
    font-weight: 700;
}

.diff-manquant {
    color: var(--success-text);
    font-weight: 700;
    border-bottom: 2px dashed var(--teal);
    padding-bottom: 1px;
}

.diff-en-trop {
    color: var(--danger-text);
    text-decoration: line-through;
    opacity: 0.7;
}

/* ============================================================
   RÉSULTAT (glass glow)
   ============================================================ */

.resultat-score {
    font-family: var(--font-mono);
    font-size: 3.4rem;
    font-weight: 700;
    color: var(--crimson-text);
    text-align: center;
    margin: 1rem 0 0.3rem;
    text-shadow: 0 0 30px rgba(215, 38, 61, 0.3);
}
.resultat-score span { font-size: 1.4rem; color: var(--text-muted); font-weight: 500; }

/* ============================================================
   PROGRESSION (glass)
   ============================================================ */

.progression-ligne {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.1rem;
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(12px);
    border-radius: var(--radius-s);
    border: 1px solid var(--glass-border);
    margin-bottom: 0.6rem;
    text-decoration: none;
    color: var(--text);
}
.progression-ligne .infos { display: flex; flex-direction: column; gap: 0.15rem; }
.progression-ligne .matiere-label {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
}
.progression-ligne .chapitre-label { font-weight: 600; }
.progression-ligne .derniere-activite { font-size: 0.8rem; color: var(--text-muted); }

.taux-badge {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 0.9rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    white-space: nowrap;
}
.taux-bon { background: rgba(18,184,169,0.2); color: var(--success-text); }
.taux-moyen { background: rgba(245,166,35,0.2); color: var(--warning-text); }
.taux-faible { background: rgba(215,38,61,0.15); color: var(--danger-text); }

.historique-ligne {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1.1rem;
    border-bottom: 1px solid var(--ink-line);
    font-size: 0.92rem;
}
.historique-ligne:last-child { border-bottom: none; }
.historique-ligne .date { color: var(--text-muted); font-family: var(--font-mono); font-size: 0.82rem; }
.historique-ligne .score { font-family: var(--font-mono); font-weight: 700; }

.etat-vide {
    text-align: center;
    padding: 2.5rem 1rem;
    color: var(--text-muted);
}

/* ============================================================
   BOUTONS CHAPITRE (liste chapitres — Cours / Exercices)
   ============================================================ */

.btn-chapitre {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.45rem 0.9rem;
    border-radius: var(--radius-s);
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.82rem;
    text-decoration: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
    white-space: nowrap;
}
.btn-chapitre:hover { transform: translateY(-1px); }
.btn-chapitre:active { transform: translateY(1px); }

.btn-cours {
    background: color-mix(in srgb, var(--royal) 85%, #000);
    color: #fff;
    box-shadow: 0 2px 0 var(--royal-dark);
}
.btn-cours:hover { background: var(--royal-dark); }

.btn-exercices {
    background: var(--crimson-fill);
    color: var(--on-crimson);
    box-shadow: 0 2px 0 var(--crimson-dark);
}
.btn-exercices:hover { background: var(--crimson-dark); }

.btn-sujet {
    background: var(--gold);
    color: #fff;
    box-shadow: 0 2px 0 #c48c1a;
}
.btn-sujet:hover { background: #c48c1a; }

/* ============================================================
   COURS — contenu pédagogique (glass)
   ============================================================ */

.cours-contenu {
    line-height: 1.7;
    font-size: 1rem;
    counter-reset: cours-section;
}

/* — h3 : titres de section avec badge numéroté + slide-in — */
.cours-contenu h3 {
    font-family: var(--font-display);
    font-size: 1.25rem;
    margin: 2.2rem 0 0.8rem;
    color: var(--text);
    border-bottom: 2px solid var(--glass-border);
    padding-bottom: 0.5rem;
    padding-left: 2.6rem;
    position: relative;
    counter-increment: cours-section;
}
.cours-animated h3 {
    opacity: 0;
    transform: translateX(-24px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}
.cours-animated h3.cours-visible {
    opacity: 1;
    transform: translateX(0);
}
.cours-contenu h3:first-child { margin-top: 0; }

.cours-contenu h3::before {
    content: counter(cours-section);
    position: absolute;
    left: 0;
    top: 0.05rem;
    width: 2rem;
    height: 2rem;
    background: linear-gradient(135deg, var(--crimson), var(--gold));
    color: #fff;
    border-radius: 7px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    font-weight: 700;
}

.cours-contenu h4 {
    font-family: var(--font-body);
    font-size: 1.05rem;
    font-weight: 700;
    margin: 1.4rem 0 0.5rem;
    color: var(--ink-soft);
}

.cours-contenu p { margin: 0.6rem 0; }

.cours-contenu ul, .cours-contenu ol {
    margin: 0.6rem 0;
    padding-left: 1.5rem;
}
.cours-contenu li { margin-bottom: 0.3rem; }

/* — Tableaux enrichis (glass) — */
.cours-contenu table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    font-size: 0.92rem;
    border-radius: var(--radius-s);
    overflow: hidden;
}
.cours-animated table {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}
.cours-animated table.cours-visible {
    opacity: 1;
    transform: translateY(0);
}
.cours-contenu table th {
    background: var(--header-bg);
    backdrop-filter: blur(8px);
    color: var(--ink);
    text-align: left;
    padding: 0.7rem 0.9rem;
    font-weight: 600;
    font-size: 0.85rem;
    border-bottom: 1px solid var(--glass-border);
}
.cours-contenu table th:first-child { border-radius: var(--radius-s) 0 0 0; }
.cours-contenu table th:last-child { border-radius: 0 var(--radius-s) 0 0; }
.cours-contenu table td {
    padding: 0.6rem 0.9rem;
    border-bottom: 1px solid var(--ink-line);
    transition: background 0.15s ease;
}
.cours-contenu table tr:nth-child(even) td { background: rgba(255, 255, 255, 0.03); }
.cours-contenu table tr:hover td { background: rgba(37,99,235,0.08); }

/* — Encadré : Règle (glass bleu) — */
.cours-contenu .regle {
    background: rgba(37, 99, 235, 0.12);
    backdrop-filter: blur(12px);
    border-left: 4px solid var(--royal);
    border: 1px solid rgba(37, 99, 235, 0.2);
    border-left: 4px solid var(--royal);
    padding: 1rem 1.2rem 1rem 3rem;
    border-radius: 0 var(--radius-s) var(--radius-s) 0;
    margin: 1rem 0;
    position: relative;
}
.cours-animated .regle {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}
.cours-animated .regle.cours-visible { opacity: 1; transform: translateY(0); }
.cours-contenu .regle strong { color: var(--info-text); }
.cours-contenu .regle::before {
    content: "\1F4D0";
    position: absolute;
    left: 0.7rem;
    top: 0.9rem;
    font-size: 1.15rem;
}

/* — Encadré : Exemple (glass teal) — */
.cours-contenu .exemple {
    background: rgba(18, 184, 169, 0.12);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(18, 184, 169, 0.2);
    border-left: 4px solid var(--teal);
    padding: 0.9rem 1.2rem 0.9rem 3rem;
    border-radius: 0 var(--radius-s) var(--radius-s) 0;
    margin: 0.8rem 0;
    position: relative;
    box-shadow: 0 0 15px rgba(18,184,169,0.05);
}
.cours-animated .exemple {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}
.cours-animated .exemple.cours-visible { opacity: 1; transform: translateY(0); }
.cours-contenu .exemple strong { color: var(--success-text); }
.cours-contenu .exemple::before {
    content: "\1F4A1";
    position: absolute;
    left: 0.7rem;
    top: 0.75rem;
    font-size: 1.15rem;
}

/* — Encadré : Attention (glass gold) — */
.cours-contenu .attention {
    background: rgba(245, 166, 35, 0.12);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(245, 166, 35, 0.2);
    border-left: 4px solid var(--gold);
    padding: 0.9rem 1.2rem 0.9rem 3rem;
    border-radius: 0 var(--radius-s) var(--radius-s) 0;
    margin: 1rem 0;
    position: relative;
}
.cours-animated .attention {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}
.cours-animated .attention.cours-visible { opacity: 1; transform: translateY(0); }
.cours-contenu .attention strong { color: var(--warning-text); }
.cours-contenu .attention::before {
    content: "\26A0\FE0F";
    position: absolute;
    left: 0.7rem;
    top: 0.75rem;
    font-size: 1.15rem;
    animation: attention-pulse 2s ease-in-out infinite;
}
@keyframes attention-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

/* — Encadré : Définition (glass) — */
.cours-contenu .definition {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--glass-border);
    padding: 1rem 1.2rem 1rem 3rem;
    border-radius: var(--radius-s);
    margin: 1rem 0;
    position: relative;
}
.cours-animated .definition {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}
.cours-animated .definition.cours-visible { opacity: 1; transform: translateY(0); }
.cours-contenu .definition::before {
    content: "\1F4D6";
    position: absolute;
    left: 0.7rem;
    top: 0.85rem;
    font-size: 1.15rem;
}

/* — Nouveau bloc : Astuce (glass violet) — */
.cours-contenu .astuce {
    background: rgba(108, 92, 231, 0.12);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(108, 92, 231, 0.2);
    border-left: 4px solid #6C5CE7;
    padding: 0.9rem 1.2rem 0.9rem 3rem;
    border-radius: 0 var(--radius-s) var(--radius-s) 0;
    margin: 1rem 0;
    position: relative;
}
.cours-animated .astuce {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}
.cours-animated .astuce.cours-visible { opacity: 1; transform: translateY(0); }
.cours-contenu .astuce strong { color: #b8a4f8; }
.cours-contenu .astuce::before {
    content: "\2B50";
    position: absolute;
    left: 0.7rem;
    top: 0.75rem;
    font-size: 1.15rem;
}

.cours-contenu code {
    font-family: var(--font-mono);
    background: rgba(255, 255, 255, 0.1);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.9em;
}

/* ============================================================
   BILAN — Appréciations & Recommandations (glass)
   ============================================================ */

.bilan-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
    gap: 1rem;
}

/* Indicateurs synthétiques */
.bilan-indicateurs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.bilan-indicateur {
    flex: 1;
    min-width: 140px;
    background: var(--glass-bg-card);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-m);
    padding: 1.4rem 1.2rem;
    box-shadow: var(--glass-shadow);
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.bilan-indicateur-valeur {
    font-family: var(--font-mono);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text);
}

.bilan-indicateur-label {
    font-size: 0.82rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Couleurs contextuelles */
.couleur-bon { color: var(--success-text) !important; }
.couleur-moyen { color: var(--warning-text) !important; }
.couleur-faible { color: var(--danger-text) !important; }

/* Barres de progression par matière */
.bilan-barres { display: flex; flex-direction: column; gap: 1rem; }

.bilan-barre-ligne {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.bilan-barre-label {
    min-width: 120px;
    font-weight: 600;
    font-size: 0.92rem;
}

.bilan-barre-track {
    flex: 1;
    height: 12px;
    background: rgba(0, 0, 0, 0.1);
    border: 1px solid var(--ink-line);
    border-radius: 999px;
    overflow: hidden;
}

.bilan-barre-fill {
    height: 100%;
    border-radius: 999px;
    transition: width 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.barre-bon { background: linear-gradient(90deg, var(--teal), var(--teal-dark)); box-shadow: 0 0 10px rgba(18,184,169,0.3); }
.barre-moyen { background: linear-gradient(90deg, var(--gold), #d4911e); box-shadow: 0 0 10px rgba(245,166,35,0.3); }
.barre-faible { background: linear-gradient(90deg, var(--crimson), var(--crimson-dark)); box-shadow: 0 0 10px rgba(215,38,61,0.3); }

.bilan-barre-taux {
    min-width: 48px;
    text-align: right;
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 0.92rem;
}

/* Types d'exercice */
.bilan-types-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.8rem;
}

.bilan-type-card {
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(12px);
    border-radius: var(--radius-s);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    border: 1px solid var(--glass-border);
}

.bilan-type-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
}

.bilan-type-taux {
    font-family: var(--font-mono);
    font-size: 1.3rem;
    font-weight: 700;
}

.bilan-type-nb {
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* Appréciations (glass) */
.bilan-appreciation-groupe { margin-bottom: 1.2rem; }
.bilan-appreciation-groupe:last-child { margin-bottom: 0; }

.bilan-sous-titre {
    font-family: var(--font-body);
    font-size: 0.92rem;
    font-weight: 700;
    margin-bottom: 0.6rem;
    padding-left: 0.6rem;
    border-left: 3px solid var(--glass-border);
}

.bilan-sous-titre-force { border-left-color: var(--teal); color: var(--success-text); }
.bilan-sous-titre-faiblesse { border-left-color: var(--crimson); color: var(--danger-text); }
.bilan-sous-titre-tendance { border-left-color: var(--royal); color: var(--info-text); }
.bilan-sous-titre-regularite { border-left-color: var(--gold); color: var(--warning-text); }
.bilan-sous-titre-haute { border-left-color: var(--crimson); color: var(--danger-text); }
.bilan-sous-titre-moyenne { border-left-color: var(--gold); color: var(--warning-text); }
.bilan-sous-titre-basse { border-left-color: var(--teal); color: var(--success-text); }

.bilan-appreciation-liste {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.bilan-appreciation-item {
    padding: 0.7rem 1rem;
    border-radius: var(--radius-s);
    font-size: 0.92rem;
    line-height: 1.5;
    backdrop-filter: blur(12px);
}

.bilan-appreciation-item.force {
    background: rgba(18, 184, 169, 0.1);
    border: 1px solid rgba(18, 184, 169, 0.2);
    border-left: 3px solid var(--teal);
}

.bilan-appreciation-item.faiblesse {
    background: rgba(215, 38, 61, 0.08);
    border: 1px solid rgba(215, 38, 61, 0.2);
    border-left: 3px solid var(--crimson);
}

.bilan-appreciation-item.tendance {
    background: rgba(37, 99, 235, 0.08);
    border: 1px solid rgba(37, 99, 235, 0.2);
    border-left: 3px solid var(--royal);
}

.bilan-appreciation-item.regularite {
    background: rgba(245, 166, 35, 0.1);
    border: 1px solid rgba(245, 166, 35, 0.2);
    border-left: 3px solid var(--gold);
}

/* Recommandations (glass) */
.bilan-reco-groupe { margin-bottom: 1.5rem; }
.bilan-reco-groupe:last-child { margin-bottom: 0; }

.bilan-reco-card {
    padding: 1.1rem 1.3rem;
    border-radius: var(--radius-s);
    margin-bottom: 0.7rem;
    border-left: 4px solid var(--glass-border);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1.2rem;
    backdrop-filter: blur(12px);
}

.bilan-reco-card.reco-haute {
    background: rgba(215, 38, 61, 0.08);
    border: 1px solid rgba(215, 38, 61, 0.2);
    border-left: 4px solid var(--crimson);
}

.bilan-reco-card.reco-moyenne {
    background: rgba(245, 166, 35, 0.08);
    border: 1px solid rgba(245, 166, 35, 0.2);
    border-left: 4px solid var(--gold);
}

.bilan-reco-card.reco-basse {
    background: rgba(18, 184, 169, 0.08);
    border: 1px solid rgba(18, 184, 169, 0.2);
    border-left: 4px solid var(--teal);
}

.bilan-reco-contenu { flex: 1; }

.bilan-reco-description {
    font-weight: 600;
    font-size: 0.95rem;
    margin: 0 0 0.4rem;
}

.bilan-reco-conseil {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin: 0 0 0.4rem;
    line-height: 1.5;
}

.bilan-reco-objectif {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--info-text);
    margin: 0;
}

.bilan-reco-actions {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    flex-shrink: 0;
}

/* ============================================================
   BILAN — Hero Stats (jauge + métriques)
   ============================================================ */

.bilan-hero-stats {
    display: grid;
    grid-template-columns: auto repeat(auto-fit, minmax(130px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
    align-items: stretch;
}

.bilan-hero-gauge {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 2rem;
    grid-row: span 1;
}

.gauge-ring {
    position: relative;
    width: 140px;
    height: 140px;
    margin-bottom: 0.5rem;
}

.gauge-svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.gauge-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.08);
    stroke-width: 10;
}

.gauge-fill {
    fill: none;
    stroke-width: 10;
    stroke-linecap: round;
    stroke-dasharray: 326.73;
    stroke-dashoffset: 326.73;
}

.gauge-fill.gauge-bon {
    stroke: #5ce6d6;
    filter: drop-shadow(0 0 8px rgba(92, 230, 214, 0.4));
}

.gauge-fill.gauge-moyen {
    stroke: #ffc857;
    filter: drop-shadow(0 0 8px rgba(255, 200, 87, 0.4));
}

.gauge-fill.gauge-faible {
    stroke: #ff8a97;
    filter: drop-shadow(0 0 8px rgba(255, 138, 151, 0.4));
}

.gauge-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    display: flex;
    align-items: baseline;
    gap: 2px;
}

.gauge-value {
    font-family: var(--font-mono);
    font-size: 2.4rem;
    font-weight: 800;
    line-height: 1;
}

.gauge-unit {
    font-family: var(--font-mono);
    font-size: 1.1rem;
    font-weight: 700;
}

.bilan-hero-metric {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 1.2rem 0.8rem;
    gap: 0.4rem;
}

/* ============================================================
   BILAN — Graphiques (charts row)
   ============================================================ */

.bilan-charts-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.bilan-chart-panel {
    min-width: 0;
}

.bilan-chart-container {
    position: relative;
    height: 280px;
    max-height: 320px;
}

.bilan-chart-wide {
    height: 240px;
    max-height: 280px;
}

/* ============================================================
   BILAN — Appréciations grille
   ============================================================ */

.bilan-appreciation-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.bilan-appreciation-header {
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 0.7rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.bilan-appreciation-header i {
    font-size: 1.1rem;
}

/* ============================================================
   BILAN — Détail repliable
   ============================================================ */

.bilan-detail-toggle {
    background: none;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-s);
    color: var(--text);
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.8rem 1.2rem;
    cursor: pointer;
    width: 100%;
    text-align: left;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background 0.2s;
}

.bilan-detail-toggle:hover {
    background: rgba(255, 255, 255, 0.04);
}

.bilan-detail-toggle::after {
    content: "\276F";
    font-size: 0.85rem;
    transition: transform 0.3s ease;
    display: inline-block;
}

.bilan-detail-toggle.open::after {
    transform: rotate(90deg);
}

.bilan-detail-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.bilan-detail-content.open {
    max-height: 2000px;
    margin-top: 1rem;
}

/* ============================================================
   BILAN — Responsive
   ============================================================ */

@media (max-width: 768px) {
    .bilan-hero-stats {
        grid-template-columns: 1fr 1fr;
    }
    .bilan-hero-gauge {
        grid-column: span 2;
    }
    .bilan-charts-row {
        grid-template-columns: 1fr;
    }
    .bilan-appreciation-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .bilan-hero-metric {
        padding: 0.8rem 0.5rem;
    }
    .bilan-hero-metric .bilan-indicateur-valeur {
        font-size: 1.4rem;
    }
    .gauge-ring {
        width: 110px;
        height: 110px;
    }
    .gauge-value {
        font-size: 1.8rem;
    }
}

/* ============================================================
   BILAN — Accessibilité (prefers-reduced-motion)
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
    .gauge-fill {
        transition: none !important;
    }
    .bilan-detail-content {
        transition: none !important;
    }
    .bilan-detail-toggle::after {
        transition: none !important;
    }
}

/* ============================================================
   GLASS CARD — composant générique
   ============================================================ */

.glass-card {
    background: var(--glass-bg-card);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-l);
    padding: 2rem;
    box-shadow: var(--glass-shadow);
}

/* ============================================================
   FOOTER (glassmorphism)
   ============================================================ */

.footer {
    padding: 2.5rem 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    background: var(--footer-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--ink-line);
    position: relative;
    z-index: 1;
}

/* ============================================================
   KEYFRAMES — glass animations
   ============================================================ */

@keyframes gradient-shift {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes blob-float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25%      { transform: translate(30px, -40px) scale(1.05); }
    50%      { transform: translate(-20px, 20px) scale(0.95); }
    75%      { transform: translate(15px, -10px) scale(1.02); }
}

@keyframes glass-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

@keyframes glow-pulse {
    0%, 100% { box-shadow: 0 0 20px rgba(215,38,61,0.1); }
    50%      { box-shadow: 0 0 40px rgba(215,38,61,0.25); }
}

/* ============================================================
   THEMES — surcharges de variables par data-theme
   ============================================================ */

/* Aurore = defaut (pas de surcharge, c'est :root) */

[data-theme="ocean"] {
    --body-g1: #0f2027; --body-g2: #203a43; --body-g3: #2c5364; --body-g4: #1a3a4a; --body-g5: #0f2027;
    --blob1-color: rgba(14,148,136,0.5); --blob2-color: rgba(34,211,238,0.4); --blob3-color: rgba(37,99,235,0.35);
    --header-bg: rgba(15,32,39,0.6); --footer-bg: rgba(15,32,39,0.5);
    --glass-glow: 0 0 30px rgba(14,148,136,0.08);
}

[data-theme="foret"] {
    --body-g1: #16321f; --body-g2: #214a33; --body-g3: #2b5c40; --body-g4: #1f432f; --body-g5: #16321f;
    --blob1-color: rgba(46,139,87,0.5); --blob2-color: rgba(245,166,35,0.35); --blob3-color: rgba(34,139,34,0.4);
    --header-bg: rgba(26,60,42,0.6); --footer-bg: rgba(26,60,42,0.5);
    --glass-glow: 0 0 30px rgba(46,139,87,0.08);
}

[data-theme="crepuscule"] {
    --body-g1: #3a1434; --body-g2: #521c40; --body-g3: #6a2c4e; --body-g4: #46193a; --body-g5: #3a1434;
    --blob1-color: rgba(192,57,43,0.5); --blob2-color: rgba(230,126,34,0.4); --blob3-color: rgba(142,68,173,0.35);
    --header-bg: rgba(74,25,66,0.6); --footer-bg: rgba(74,25,66,0.5);
    --glass-glow: 0 0 30px rgba(192,57,43,0.08);
}

[data-theme="nuit"] {
    --body-g1: #0a0a1a; --body-g2: #12122e; --body-g3: #1a1a3e; --body-g4: #10102a; --body-g5: #0a0a1a;
    --blob1-color: rgba(129,140,248,0.5); --blob2-color: rgba(167,139,250,0.4); --blob3-color: rgba(99,102,241,0.35);
    --header-bg: rgba(10,10,26,0.7); --footer-bg: rgba(10,10,26,0.6);
    --glass-glow: 0 0 30px rgba(129,140,248,0.08);
}

[data-theme="roses"] {
    --body-g1: #f8d7e0; --body-g2: #f0c4d0; --body-g3: #e8b0c8; --body-g4: #f2ccd8; --body-g5: #f8d7e0;
    --blob1-color: rgba(215,38,61,0.2); --blob2-color: rgba(236,72,153,0.2); --blob3-color: rgba(244,114,182,0.15);
    --header-bg: rgba(248,215,224,0.7); --footer-bg: rgba(248,215,224,0.6);
    --text: #2d1f2f; --text-muted: rgba(45,31,47,0.85); --ink: #2d1f2f; --ink-soft: rgba(45, 31, 47, 0.85);
    --ink-line: rgba(0,0,0,0.1);
    --glass-bg: rgba(255,255,255,0.35); --glass-bg-card: rgba(255,255,255,0.4); --glass-bg-strong: rgba(255,255,255,0.5);
    --glass-border: rgba(255,255,255,0.5); --glass-border-strong: rgba(255,255,255,0.7);
    --glass-shadow: 0 8px 32px rgba(0,0,0,0.06);
    --glass-glow: 0 0 30px rgba(215,38,61,0.06);
    --dropdown-bg: rgba(255, 245, 248, 0.96);
    --dropdown-text: #2d1f2f;
    --dropdown-text-muted: rgba(45, 31, 47, 0.55);
    --dropdown-border: rgba(0, 0, 0, 0.1);
    --dropdown-hover: rgba(0, 0, 0, 0.06);
}

[data-theme="plage"] {
    --body-g1: #fde8d0; --body-g2: #f5d4b3; --body-g3: #ecc19e; --body-g4: #f7dcc0; --body-g5: #fde8d0;
    --blob1-color: rgba(234,88,12,0.18); --blob2-color: rgba(215,38,61,0.15); --blob3-color: rgba(245,166,35,0.15);
    --header-bg: rgba(253,232,208,0.7); --footer-bg: rgba(253,232,208,0.6);
    --text: #5c3a1a; --text-muted: rgba(92,58,26,0.85); --ink: #5c3a1a; --ink-soft: rgba(92, 58, 26, 0.85);
    --ink-line: rgba(0,0,0,0.1);
    --glass-bg: rgba(255,255,255,0.4); --glass-bg-card: rgba(255,255,255,0.45); --glass-bg-strong: rgba(255,255,255,0.55);
    --glass-border: rgba(255,255,255,0.5); --glass-border-strong: rgba(255,255,255,0.7);
    --glass-shadow: 0 8px 32px rgba(0,0,0,0.06);
    --glass-glow: 0 0 30px rgba(234,88,12,0.06);
    --dropdown-bg: rgba(253, 248, 240, 0.96);
    --dropdown-text: #5c3a1a;
    --dropdown-text-muted: rgba(92, 58, 26, 0.55);
    --dropdown-border: rgba(0, 0, 0, 0.1);
    --dropdown-hover: rgba(0, 0, 0, 0.06);
}

[data-theme="cupcake"] {
    --body-g1: #faf7f5; --body-g2: #f0e6e0; --body-g3: #e8d8d0; --body-g4: #f5ede8; --body-g5: #faf7f5;
    --blob1-color: rgba(239,134,162,0.2); --blob2-color: rgba(168,130,214,0.18); --blob3-color: rgba(101,196,190,0.15);
    --header-bg: rgba(250,247,245,0.8); --footer-bg: rgba(250,247,245,0.7);
    --text: #291334; --text-muted: rgba(41,19,52,0.85); --ink: #291334; --ink-soft: rgba(41, 19, 52, 0.85);
    --ink-line: rgba(0,0,0,0.08);
    --glass-bg: rgba(255,255,255,0.5); --glass-bg-card: rgba(255,255,255,0.55); --glass-bg-strong: rgba(255,255,255,0.65);
    --glass-border: rgba(255,255,255,0.6); --glass-border-strong: rgba(255,255,255,0.8);
    --glass-shadow: 0 8px 32px rgba(0,0,0,0.05);
    --glass-glow: 0 0 30px rgba(239,134,162,0.08);
    --crimson: #ef86a2; --crimson-dark: #d4698a; --gold: #65c4be; --teal: #a882d6; --teal-dark: #8b6ab8;
    --dropdown-bg: rgba(252, 248, 246, 0.96);
    --dropdown-text: #291334;
    --dropdown-text-muted: rgba(41, 19, 52, 0.55);
    --dropdown-border: rgba(0, 0, 0, 0.08);
    --dropdown-hover: rgba(0, 0, 0, 0.05);
}

[data-theme="garden"] {
    --body-g1: #e9e7e2; --body-g2: #d9d4cc; --body-g3: #ccc5ba; --body-g4: #e0dbd4; --body-g5: #e9e7e2;
    --blob1-color: rgba(216,76,76,0.18); --blob2-color: rgba(94,163,92,0.18); --blob3-color: rgba(245,166,35,0.12);
    --header-bg: rgba(233,231,226,0.8); --footer-bg: rgba(233,231,226,0.7);
    --text: #2a2520; --text-muted: rgba(42,37,32,0.85); --ink: #2a2520; --ink-soft: rgba(42, 37, 32, 0.85);
    --ink-line: rgba(0,0,0,0.08);
    --glass-bg: rgba(255,255,255,0.45); --glass-bg-card: rgba(255,255,255,0.5); --glass-bg-strong: rgba(255,255,255,0.6);
    --glass-border: rgba(255,255,255,0.55); --glass-border-strong: rgba(255,255,255,0.75);
    --glass-shadow: 0 8px 32px rgba(0,0,0,0.06);
    --glass-glow: 0 0 30px rgba(94,163,92,0.06);
    --crimson: #d84c4c; --crimson-dark: #b83a3a; --gold: #f5a623; --teal: #5ea35c; --teal-dark: #4a8a48;
    --dropdown-bg: rgba(245, 242, 235, 0.96);
    --dropdown-text: #2a2520;
    --dropdown-text-muted: rgba(42, 37, 32, 0.55);
    --dropdown-border: rgba(0, 0, 0, 0.08);
    --dropdown-hover: rgba(0, 0, 0, 0.05);
}

[data-theme="lemonade"] {
    --body-g1: #fdfce5; --body-g2: #f5f2c8; --body-g3: #ede9a8; --body-g4: #f9f6d8; --body-g5: #fdfce5;
    --blob1-color: rgba(74,170,20,0.2); --blob2-color: rgba(245,200,35,0.18); --blob3-color: rgba(120,190,50,0.15);
    --header-bg: rgba(253,252,229,0.8); --footer-bg: rgba(253,252,229,0.7);
    --text: #1a2e05; --text-muted: rgba(26,46,5,0.85); --ink: #1a2e05; --ink-soft: rgba(26, 46, 5, 0.85);
    --ink-line: rgba(0,0,0,0.08);
    --glass-bg: rgba(255,255,255,0.5); --glass-bg-card: rgba(255,255,255,0.55); --glass-bg-strong: rgba(255,255,255,0.65);
    --glass-border: rgba(255,255,255,0.6); --glass-border-strong: rgba(255,255,255,0.8);
    --glass-shadow: 0 8px 32px rgba(0,0,0,0.05);
    --glass-glow: 0 0 30px rgba(74,170,20,0.06);
    --crimson: #4aaa14; --crimson-dark: #3a8a10; --gold: #e9d500; --teal: #78be32; --teal-dark: #5fa028;
    --dropdown-bg: rgba(252, 252, 240, 0.96);
    --dropdown-text: #1a2e05;
    --dropdown-text-muted: rgba(26, 46, 5, 0.55);
    --dropdown-border: rgba(0, 0, 0, 0.08);
    --dropdown-hover: rgba(0, 0, 0, 0.05);
}

[data-theme="winter"] {
    --body-g1: #e8edf5; --body-g2: #d0d8e8; --body-g3: #b8c4db; --body-g4: #dce3ef; --body-g5: #e8edf5;
    --blob1-color: rgba(96,125,180,0.18); --blob2-color: rgba(140,170,220,0.15); --blob3-color: rgba(180,200,240,0.12);
    --header-bg: rgba(232,237,245,0.8); --footer-bg: rgba(232,237,245,0.7);
    --text: #1a2744; --text-muted: rgba(26,39,68,0.85); --ink: #1a2744; --ink-soft: rgba(26, 39, 68, 0.85);
    --ink-line: rgba(0,0,0,0.08);
    --glass-bg: rgba(255,255,255,0.5); --glass-bg-card: rgba(255,255,255,0.55); --glass-bg-strong: rgba(255,255,255,0.65);
    --glass-border: rgba(255,255,255,0.6); --glass-border-strong: rgba(255,255,255,0.8);
    --glass-shadow: 0 8px 32px rgba(0,0,0,0.05);
    --glass-glow: 0 0 30px rgba(96,125,180,0.06);
    --crimson: #607db4; --crimson-dark: #4a6494; --gold: #8caaDC; --teal: #5b8cc4; --teal-dark: #4870a0;
    --dropdown-bg: rgba(240, 243, 250, 0.96);
    --dropdown-text: #1a2744;
    --dropdown-text-muted: rgba(26, 39, 68, 0.55);
    --dropdown-border: rgba(0, 0, 0, 0.08);
    --dropdown-hover: rgba(0, 0, 0, 0.05);
}

[data-theme="corporate"] {
    --body-g1: #f0f0f0; --body-g2: #e2e2e2; --body-g3: #d4d4d4; --body-g4: #eaeaea; --body-g5: #f0f0f0;
    --blob1-color: rgba(49,96,172,0.15); --blob2-color: rgba(100,140,200,0.12); --blob3-color: rgba(60,60,60,0.08);
    --header-bg: rgba(240,240,240,0.85); --footer-bg: rgba(240,240,240,0.75);
    --text: #1c1c1c; --text-muted: rgba(28,28,28,0.85); --ink: #1c1c1c; --ink-soft: rgba(28, 28, 28, 0.85);
    --ink-line: rgba(0,0,0,0.1);
    --glass-bg: rgba(255,255,255,0.55); --glass-bg-card: rgba(255,255,255,0.6); --glass-bg-strong: rgba(255,255,255,0.7);
    --glass-border: rgba(0,0,0,0.08); --glass-border-strong: rgba(0,0,0,0.15);
    --glass-shadow: 0 4px 16px rgba(0,0,0,0.06);
    --glass-glow: 0 0 20px rgba(49,96,172,0.04);
    --crimson: #3160ac; --crimson-dark: #254a88; --gold: #e8a317; --teal: #2196f3; --teal-dark: #1976d2;
    --dropdown-bg: rgba(244, 244, 246, 0.96);
    --dropdown-text: #1c1c1c;
    --dropdown-text-muted: rgba(28, 28, 28, 0.55);
    --dropdown-border: rgba(0, 0, 0, 0.1);
    --dropdown-hover: rgba(0, 0, 0, 0.06);
}

[data-theme="nord"] {
    --body-g1: #2e3440; --body-g2: #3b4252; --body-g3: #434c5e; --body-g4: #353d4c; --body-g5: #2e3440;
    --blob1-color: rgba(136,192,208,0.2); --blob2-color: rgba(129,161,193,0.18); --blob3-color: rgba(94,129,172,0.15);
    --header-bg: rgba(46,52,64,0.7); --footer-bg: rgba(46,52,64,0.6);
    --glass-glow: 0 0 30px rgba(136,192,208,0.06);
    --crimson: #bf616a; --crimson-dark: #a3515a; --gold: #ebcb8b; --teal: #88c0d0; --teal-dark: #6aabb8;
}

[data-theme="night"] {
    --body-g1: #0f1117; --body-g2: #181a24; --body-g3: #1f222e; --body-g4: #14161e; --body-g5: #0f1117;
    --blob1-color: rgba(99,102,241,0.25); --blob2-color: rgba(139,92,246,0.2); --blob3-color: rgba(59,130,246,0.18);
    --header-bg: rgba(15,17,23,0.75); --footer-bg: rgba(15,17,23,0.65);
    --glass-glow: 0 0 30px rgba(99,102,241,0.08);
    --crimson: #6366f1; --crimson-dark: #4f46e5; --gold: #f59e0b; --teal: #8b5cf6; --teal-dark: #7c3aed;
}

[data-theme="luxury"] {
    --body-g1: #09090b; --body-g2: #141418; --body-g3: #1c1c22; --body-g4: #101014; --body-g5: #09090b;
    --blob1-color: rgba(212,175,55,0.2); --blob2-color: rgba(180,140,40,0.15); --blob3-color: rgba(255,215,0,0.1);
    --header-bg: rgba(9,9,11,0.8); --footer-bg: rgba(9,9,11,0.7);
    --glass-bg: rgba(255,255,255,0.05); --glass-bg-card: rgba(255,255,255,0.07); --glass-bg-strong: rgba(255,255,255,0.1);
    --glass-border: rgba(212,175,55,0.2); --glass-border-strong: rgba(212,175,55,0.35);
    --glass-shadow: 0 8px 32px rgba(0,0,0,0.3);
    --glass-glow: 0 0 30px rgba(212,175,55,0.08);
    --crimson: #d4af37; --crimson-dark: #b8962e; --gold: #ffd700; --teal: #d4af37; --teal-dark: #b8962e;
}

/* Themes clairs : accents de texte assombris */
[data-theme="roses"], [data-theme="plage"], [data-theme="cupcake"], [data-theme="garden"],
[data-theme="lemonade"], [data-theme="winter"], [data-theme="corporate"] {
    --accent-text: color-mix(in srgb, var(--royal) 70%, #000);
    --crimson-text: color-mix(in srgb, var(--crimson) 60%, #000);
    --success-text: #134e4a;
    --warning-text: #78350f;
    --info-text: #1e3a8a;
    --danger-text: #7f1d1d;
}

/* Accent --crimson clair (or, lavande, rose, vieux rose, indigo) : texte fonce dessus */
[data-theme="luxury"], [data-theme="abyss"], [data-theme="cupcake"], [data-theme="nord"],
[data-theme="lemonade"] {
    --crimson-fill: var(--crimson);
    --on-crimson: #14100a;
}

/* Accents clairs (or, lavande, rose) : texte fonce sur le degrade d'origine */
[data-theme="luxury"], [data-theme="abyss"], [data-theme="cupcake"] {
    --cta-bg: linear-gradient(90deg, var(--crimson), var(--gold));
    --on-cta: #14100a;
}

/* --- Abyss : sombre premium bleu/violet, glow, glassmorphism --- */
[data-theme="abyss"] {
    --body-g1: #05061a; --body-g2: #0e0b2e; --body-g3: #1a0a3e; --body-g4: #0a1628; --body-g5: #120640;
    --blob1-color: rgba(99,102,241,0.3); --blob2-color: rgba(139,92,246,0.25); --blob3-color: rgba(56,189,248,0.2);
    --header-bg: rgba(8,6,28,0.75); --footer-bg: rgba(8,6,28,0.65);
    --glass-bg: rgba(255,255,255,0.04); --glass-bg-card: rgba(255,255,255,0.06); --glass-bg-strong: rgba(255,255,255,0.1);
    --glass-border: rgba(139,92,246,0.18); --glass-border-strong: rgba(139,92,246,0.35);
    --glass-shadow: 0 8px 32px rgba(0,0,0,0.4);
    --glass-glow: 0 0 40px rgba(99,102,241,0.12);
    --glass-blur: 24px; --glass-blur-strong: 40px;
    --crimson: #818cf8; --crimson-dark: #6366f1;
    --gold: #38bdf8; --teal: #a78bfa; --teal-dark: #8b5cf6;
    --royal: #6366f1; --royal-dark: #4f46e5;
    --shadow-card-hover: 0 4px 12px rgba(99,102,241,0.15), 0 20px 60px rgba(0,0,0,0.35);
    --abyss-glow-1: rgba(99,102,241,0.4);
    --abyss-glow-2: rgba(139,92,246,0.35);
    --abyss-glow-3: rgba(56,189,248,0.3);
}

/* Abyss — cartes glassmorphism renforcees */
[data-theme="abyss"] .feature-card,
[data-theme="abyss"] .carte-matiere,
[data-theme="abyss"] .carte-formulaire,
[data-theme="abyss"] .panneau,
[data-theme="abyss"] .glass-card,
[data-theme="abyss"] .etape,
[data-theme="abyss"] .bilan-indicateur,
[data-theme="abyss"] .bilan-type-card {
    border-color: rgba(139,92,246,0.15);
    box-shadow: 0 8px 32px rgba(0,0,0,0.4),
                inset 0 1px 0 rgba(255,255,255,0.05);
}

/* Abyss — cartes hover glow lumineux */
[data-theme="abyss"] .feature-card:hover {
    border-color: rgba(139,92,246,0.4);
    box-shadow: 0 8px 32px rgba(0,0,0,0.4),
                0 0 40px rgba(99,102,241,0.2),
                0 0 80px rgba(139,92,246,0.1),
                inset 0 1px 0 rgba(255,255,255,0.08);
    transform: translateY(-12px) scale(1.03);
}

[data-theme="abyss"] .carte-matiere:hover,
[data-theme="abyss"] .etape:hover,
[data-theme="abyss"] .glass-card:hover {
    border-color: rgba(139,92,246,0.35);
    box-shadow: 0 8px 32px rgba(0,0,0,0.4),
                0 0 30px rgba(99,102,241,0.15),
                0 0 60px rgba(139,92,246,0.08);
    transform: translateY(-6px);
}

/* Abyss — shimmer accent bleu/violet */
[data-theme="abyss"] .feature-card::before {
    background: linear-gradient(90deg, #6366f1, #a78bfa, #38bdf8, #a78bfa, #6366f1);
    background-size: 200% 100%;
}
[data-theme="abyss"] .feature-card:nth-child(1) { --fc-accent: linear-gradient(90deg, #6366f1, #a78bfa, #6366f1); --fc-glow: rgba(99,102,241,0.25); }
[data-theme="abyss"] .feature-card:nth-child(2) { --fc-accent: linear-gradient(90deg, #8b5cf6, #c084fc, #8b5cf6); --fc-glow: rgba(139,92,246,0.25); }
[data-theme="abyss"] .feature-card:nth-child(3) { --fc-accent: linear-gradient(90deg, #38bdf8, #818cf8, #38bdf8); --fc-glow: rgba(56,189,248,0.25); }
[data-theme="abyss"] .feature-card:nth-child(4) { --fc-accent: linear-gradient(90deg, #a78bfa, #6366f1, #a78bfa); --fc-glow: rgba(167,139,250,0.25); }

/* Abyss — barres de progression glow */
[data-theme="abyss"] .quiz-progress-bar > span {
    background: linear-gradient(90deg, #6366f1, #a78bfa, #38bdf8);
    box-shadow: 0 0 16px rgba(99,102,241,0.5), 0 0 40px rgba(139,92,246,0.2);
    animation: abyss-bar-glow 2s ease-in-out infinite;
}
[data-theme="abyss"] .barre-bon {
    background: linear-gradient(90deg, #a78bfa, #8b5cf6);
    box-shadow: 0 0 14px rgba(139,92,246,0.5);
}
[data-theme="abyss"] .barre-moyen {
    background: linear-gradient(90deg, #38bdf8, #0ea5e9);
    box-shadow: 0 0 14px rgba(56,189,248,0.5);
}
[data-theme="abyss"] .barre-faible {
    background: linear-gradient(90deg, #818cf8, #6366f1);
    box-shadow: 0 0 14px rgba(99,102,241,0.5);
}

@keyframes abyss-bar-glow {
    0%, 100% { box-shadow: 0 0 16px rgba(99,102,241,0.5), 0 0 40px rgba(139,92,246,0.2); }
    50%      { box-shadow: 0 0 24px rgba(99,102,241,0.7), 0 0 60px rgba(139,92,246,0.35); }
}

/* Abyss — boutons glow */
[data-theme="abyss"] button[type="submit"],
[data-theme="abyss"] .btn-primaire {
    box-shadow: 0 0 20px rgba(99,102,241,0.3);
}
[data-theme="abyss"] button[type="submit"]:hover,
[data-theme="abyss"] .btn-primaire:hover {
    box-shadow: 0 0 30px rgba(99,102,241,0.5), 0 0 60px rgba(139,92,246,0.2);
}

/* Abyss — matiere top-border couleurs */
[data-theme="abyss"] .carte-matiere.mathematiques { border-top-color: #818cf8; }
[data-theme="abyss"] .carte-matiere.francais { border-top-color: #a78bfa; }
[data-theme="abyss"] .carte-matiere.anglais { border-top-color: #38bdf8; }
[data-theme="abyss"] .carte-matiere.physique_chimie { border-top-color: #c084fc; }
[data-theme="abyss"] .carte-matiere.svt { border-top-color: #67e8f9; }

/* Abyss — selection */
[data-theme="abyss"] ::selection { background: #6366f1; color: #fff; }

/* Abyss — header glow line */
[data-theme="abyss"] .header::after {
    content: "";
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(139,92,246,0.4), rgba(56,189,248,0.3), rgba(139,92,246,0.4), transparent);
}

/* Abyss — hero particles container */
[data-theme="abyss"] .hero { overflow: visible; }
.abyss-particles {
    display: none;
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}
[data-theme="abyss"] .abyss-particles { display: block; }

.abyss-particle {
    position: absolute;
    border-radius: 50%;
    opacity: 0;
    animation: abyss-float linear infinite;
}
.abyss-particle:nth-child(odd)  { background: rgba(99,102,241,0.5); box-shadow: 0 0 8px rgba(99,102,241,0.4); }
.abyss-particle:nth-child(even) { background: rgba(139,92,246,0.4); box-shadow: 0 0 8px rgba(139,92,246,0.3); }
.abyss-particle:nth-child(3n)   { background: rgba(56,189,248,0.35); box-shadow: 0 0 8px rgba(56,189,248,0.3); }

/* 12 particles with varied sizes, positions, speeds */
.abyss-particle:nth-child(1)  { width: 4px; height: 4px; left: 8%;  animation-duration: 14s; animation-delay: 0s; }
.abyss-particle:nth-child(2)  { width: 3px; height: 3px; left: 15%; animation-duration: 18s; animation-delay: 2s; }
.abyss-particle:nth-child(3)  { width: 5px; height: 5px; left: 22%; animation-duration: 12s; animation-delay: 4s; }
.abyss-particle:nth-child(4)  { width: 3px; height: 3px; left: 32%; animation-duration: 20s; animation-delay: 1s; }
.abyss-particle:nth-child(5)  { width: 4px; height: 4px; left: 42%; animation-duration: 16s; animation-delay: 3s; }
.abyss-particle:nth-child(6)  { width: 6px; height: 6px; left: 52%; animation-duration: 22s; animation-delay: 5s; }
.abyss-particle:nth-child(7)  { width: 3px; height: 3px; left: 60%; animation-duration: 15s; animation-delay: 0.5s; }
.abyss-particle:nth-child(8)  { width: 5px; height: 5px; left: 68%; animation-duration: 19s; animation-delay: 2.5s; }
.abyss-particle:nth-child(9)  { width: 4px; height: 4px; left: 75%; animation-duration: 13s; animation-delay: 4.5s; }
.abyss-particle:nth-child(10) { width: 3px; height: 3px; left: 83%; animation-duration: 17s; animation-delay: 1.5s; }
.abyss-particle:nth-child(11) { width: 5px; height: 5px; left: 90%; animation-duration: 21s; animation-delay: 3.5s; }
.abyss-particle:nth-child(12) { width: 4px; height: 4px; left: 95%; animation-duration: 14s; animation-delay: 6s; }

@keyframes abyss-float {
    0%   { transform: translateY(100%) translateX(0); opacity: 0; }
    10%  { opacity: 0.7; }
    50%  { transform: translateY(30%) translateX(20px); opacity: 0.5; }
    90%  { opacity: 0.3; }
    100% { transform: translateY(-20%) translateX(-10px); opacity: 0; }
}

/* Abyss — formes geometriques flottantes */
.abyss-shape {
    position: absolute;
    pointer-events: none;
    opacity: 0;
    border: 1px solid;
    animation: abyss-shape-drift linear infinite;
}
[data-theme="abyss"] .abyss-shape { opacity: 1; }

.abyss-shape:nth-child(13) {
    width: 30px; height: 30px; border-radius: 6px;
    border-color: rgba(99,102,241,0.15);
    left: 5%; top: 20%;
    animation-duration: 25s;
    transform: rotate(45deg);
}
.abyss-shape:nth-child(14) {
    width: 20px; height: 20px; border-radius: 50%;
    border-color: rgba(139,92,246,0.12);
    right: 10%; top: 35%;
    animation-duration: 30s;
    animation-delay: 3s;
}
.abyss-shape:nth-child(15) {
    width: 40px; height: 40px; border-radius: 8px;
    border-color: rgba(56,189,248,0.1);
    left: 70%; top: 15%;
    animation-duration: 28s;
    animation-delay: 6s;
    transform: rotate(30deg);
}
.abyss-shape:nth-child(16) {
    width: 24px; height: 24px; border-radius: 50%;
    border-color: rgba(99,102,241,0.12);
    left: 35%; top: 60%;
    animation-duration: 22s;
    animation-delay: 2s;
}

@keyframes abyss-shape-drift {
    0%   { transform: translateY(0) rotate(0deg); opacity: 0.15; }
    25%  { transform: translateY(-15px) rotate(90deg); opacity: 0.25; }
    50%  { transform: translateY(-5px) rotate(180deg); opacity: 0.15; }
    75%  { transform: translateY(-20px) rotate(270deg); opacity: 0.25; }
    100% { transform: translateY(0) rotate(360deg); opacity: 0.15; }
}

/* Abyss — respects prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
    .abyss-particle,
    .abyss-shape { animation: none !important; opacity: 0.15; }
    [data-theme="abyss"] .quiz-progress-bar > span { animation: none !important; }
}

/* ============================================================
   THEME SELECTOR — Mon compte
   ============================================================ */

.theme-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.8rem;
}

.theme-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem;
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 2px solid var(--glass-border);
    border-radius: var(--radius-m);
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text);
    font-family: var(--font-body);
    font-size: 0.85rem;
    width: 100%;
}
.theme-card:hover {
    border-color: var(--glass-border-strong);
    transform: translateY(-2px);
    box-shadow: var(--glass-shadow);
}
.theme-card.active {
    border-color: var(--crimson);
    box-shadow: 0 0 20px rgba(215,38,61,0.3);
}

.theme-preview {
    width: 100%;
    height: 60px;
    border-radius: 8px;
}
.theme-label {
    font-weight: 600;
    font-size: 0.82rem;
    text-align: center;
}

.theme-preview-aurore     { background: linear-gradient(135deg, #5b6b82, #7a8ba2, #5f7089); }
.theme-preview-ocean      { background: linear-gradient(135deg, #0f2027, #2c5364, #0f2027); }
.theme-preview-foret      { background: linear-gradient(135deg, #1a3c2a, #3e7a56, #1a3c2a); }
.theme-preview-crepuscule { background: linear-gradient(135deg, #4a1942, #8b3a62, #4a1942); }
.theme-preview-nuit       { background: linear-gradient(135deg, #0a0a1a, #1a1a3e, #0a0a1a); }
.theme-preview-roses      { background: linear-gradient(135deg, #f8d7e0, #e8b0c8, #f8d7e0); }
.theme-preview-plage      { background: linear-gradient(135deg, #fde8d0, #ecc19e, #fde8d0); }
.theme-preview-cupcake    { background: linear-gradient(135deg, #faf7f5, #e8d8d0, #faf7f5); }
.theme-preview-garden     { background: linear-gradient(135deg, #e9e7e2, #ccc5ba, #e9e7e2); }
.theme-preview-lemonade   { background: linear-gradient(135deg, #fdfce5, #ede9a8, #fdfce5); }
.theme-preview-winter     { background: linear-gradient(135deg, #e8edf5, #b8c4db, #e8edf5); }
.theme-preview-corporate  { background: linear-gradient(135deg, #f0f0f0, #d4d4d4, #f0f0f0); }
.theme-preview-nord       { background: linear-gradient(135deg, #2e3440, #434c5e, #2e3440); }
.theme-preview-night      { background: linear-gradient(135deg, #0f1117, #1f222e, #0f1117); }
.theme-preview-luxury     { background: linear-gradient(135deg, #09090b, #d4af37, #09090b); }
.theme-preview-abyss      { background: linear-gradient(135deg, #05061a, #1a0a3e, #0a1628, #120640); }

@media (max-width: 560px) {
    .theme-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================
   MON COMPTE — Layout moderne (profil + onglets + panneaux)
   ============================================================ */

.account-layout {
    max-width: 680px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* --- Profil header --- */
.account-profile {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    padding: 1.8rem 2rem;
    background: var(--glass-bg-card);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-l);
    box-shadow: var(--glass-shadow);
    margin-bottom: 0;
}

.account-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--cta-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--on-cta);
    flex-shrink: 0;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.account-info {
    flex: 1;
    min-width: 0;
}

.account-name {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 0.15rem;
}

.account-email {
    font-size: 0.88rem;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.account-badge {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.25rem 0.7rem;
    border-radius: 999px;
    background: rgba(255,255,255,0.08);
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
    flex-shrink: 0;
    align-self: flex-start;
    margin-top: 0.2rem;
}

/* --- Onglets --- */
.account-tabs {
    display: flex;
    gap: 0;
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-top: none;
    border-radius: 0 0 var(--radius-l) var(--radius-l);
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.account-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.85rem 0.5rem;
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: color 0.25s ease, border-color 0.25s ease, background 0.25s ease;
    position: relative;
}

.account-tab i {
    font-size: 1rem;
}

.account-tab:hover {
    color: var(--text);
    background: rgba(255,255,255,0.04);
}

.account-tab.active {
    color: var(--crimson-text);
    border-bottom-color: var(--crimson);
    background: rgba(255,255,255,0.03);
}

/* --- Panneaux --- */
.account-panel {
    display: none;
    animation: account-panel-in 0.3s ease;
}

.account-panel.active {
    display: block;
}

@keyframes account-panel-in {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* --- Section card dans un panneau --- */
.account-section {
    background: var(--glass-bg-card);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-l);
    padding: 1.8rem 2rem;
    box-shadow: var(--glass-shadow);
    margin-bottom: 1.2rem;
}

.account-section-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1.2rem;
}

.account-section-header i {
    font-size: 1.15rem;
    color: var(--crimson-text);
}

.account-section-header h3 {
    font-family: var(--font-body);
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0;
}

/* --- Niveau items --- */
.account-level-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.account-level-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 0;
    border-bottom: 1px solid var(--ink-line);
    gap: 0.8rem;
}

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

.account-level-name {
    font-weight: 600;
    font-size: 0.92rem;
}

.account-level-system {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-left: 0.3rem;
}

.account-level-date {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-left: 0.4rem;
}

.account-level-admin-badge {
    font-size: 0.7rem;
    color: var(--crimson-text);
    font-style: italic;
    margin-left: 0.4rem;
}

.account-level-item .btn-retirer-niveau,
.account-level-item .btn-reactiver-niveau {
    font-size: 0.78rem;
    padding: 0.3rem 0.7rem;
    flex-shrink: 0;
}

/* Divider legers entre sous-sections */
.account-divider {
    height: 1px;
    background: var(--ink-line);
    margin: 1.2rem 0;
    border: none;
}

/* --- Langue inline --- */
.account-lang-row {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.account-lang-row i {
    font-size: 1.1rem;
    color: var(--text-muted);
}

/* --- Responsive --- */
@media (max-width: 560px) {
    .account-profile { flex-wrap: wrap; padding: 1.3rem; gap: 0.8rem; }
    .account-avatar { width: 44px; height: 44px; font-size: 1rem; }
    .account-name { font-size: 1rem; }
    .account-badge { font-size: 0.68rem; }
    .account-tab { font-size: 0.78rem; padding: 0.7rem 0.3rem; gap: 0.3rem; }
    .account-tab i { font-size: 0.9rem; }
    .account-section { padding: 1.3rem; }
    .theme-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================
   WOW EFFECTS — animations premium et micro-interactions
   ============================================================ */

/* --- Scroll progress bar (top of page) --- */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, var(--crimson), var(--gold), var(--teal));
    z-index: 9999;
    transition: width 0.1s linear;
    box-shadow: 0 0 10px var(--crimson), 0 0 20px rgba(215,38,61,0.3);
}

/* --- Animated gradient text --- */
.gradient-text-wow {
    background: linear-gradient(270deg, var(--crimson), var(--gold), var(--teal), var(--royal), var(--crimson));
    background-size: 300% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: wow-gradient-text 6s ease infinite;
}

@keyframes wow-gradient-text {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* --- Card spotlight (radial glow follows cursor) --- */
.wow-spotlight {
    --spot-x: 50%;
    --spot-y: 50%;
    --spot-opacity: 0;
    position: relative;
}

.wow-spotlight::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(
        350px circle at var(--spot-x) var(--spot-y),
        rgba(255,255,255,0.08),
        transparent 70%
    );
    opacity: var(--spot-opacity);
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 1;
}

/* --- Card 3D tilt --- */
.wow-tilt {
    transform-style: preserve-3d;
    transition: transform 0.15s ease-out;
}

.wow-tilt > * {
    transform: translateZ(0);
}

/* --- Ripple click effect --- */
.wow-ripple {
    position: relative;
    overflow: hidden;
}

.wow-ripple-wave {
    position: absolute;
    border-radius: 50%;
    background: rgba(255,255,255,0.35);
    transform: scale(0);
    animation: wow-ripple-expand 0.6s ease-out forwards;
    pointer-events: none;
    z-index: 10;
}

@keyframes wow-ripple-expand {
    to { transform: scale(4); opacity: 0; }
}

/* --- Stagger cascade reveal --- */
[data-reveal-cascade] > * {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
    transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-reveal-cascade].in-view > *:nth-child(1) { transition-delay: 0s; }
[data-reveal-cascade].in-view > *:nth-child(2) { transition-delay: 0.08s; }
[data-reveal-cascade].in-view > *:nth-child(3) { transition-delay: 0.16s; }
[data-reveal-cascade].in-view > *:nth-child(4) { transition-delay: 0.24s; }
[data-reveal-cascade].in-view > *:nth-child(5) { transition-delay: 0.32s; }
[data-reveal-cascade].in-view > *:nth-child(6) { transition-delay: 0.40s; }
[data-reveal-cascade].in-view > *:nth-child(7) { transition-delay: 0.48s; }
[data-reveal-cascade].in-view > *:nth-child(8) { transition-delay: 0.56s; }

[data-reveal-cascade].in-view > * {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* --- Pulsing ring CTA --- */
.wow-pulse-ring {
    position: relative;
}

.wow-pulse-ring::before,
.wow-pulse-ring::after {
    content: "";
    position: absolute;
    inset: -4px;
    border-radius: inherit;
    border: 2px solid var(--crimson);
    opacity: 0;
    animation: wow-ring-ping 2.5s cubic-bezier(0, 0, 0.2, 1) infinite;
}

.wow-pulse-ring::after { animation-delay: 1.25s; }

@keyframes wow-ring-ping {
    0%   { transform: scale(1); opacity: 0.5; }
    100% { transform: scale(1.15); opacity: 0; }
}

/* --- Animated gradient border --- */
.wow-gradient-border {
    position: relative;
    background-clip: padding-box;
}

.wow-gradient-border::before {
    content: "";
    position: absolute;
    inset: -2px;
    border-radius: inherit;
    background: conic-gradient(
        from var(--wow-border-angle, 0deg),
        var(--crimson), var(--gold), var(--teal), var(--royal), var(--crimson)
    );
    z-index: -1;
    opacity: 0;
    transition: opacity 0.4s ease;
    animation: wow-border-rotate 4s linear infinite;
}

.wow-gradient-border:hover::before { opacity: 1; }

@keyframes wow-border-rotate {
    to { --wow-border-angle: 360deg; }
}

@property --wow-border-angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}

/* --- Magnetic button hover --- */
.wow-magnetic {
    transition: transform 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* --- Parallax-responsive blobs --- */
.blob.wow-parallax {
    transition: transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: transform;
}

/* --- Glow underline on nav --- */
.header-nav a::after {
    box-shadow: 0 2px 8px rgba(215,38,61,0);
    transition: width 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
}

.header-nav a:hover::after {
    box-shadow: 0 2px 12px rgba(215,38,61,0.4);
}

/* --- Enhanced feature card hover --- */
.feature-card {
    transform-style: preserve-3d;
    perspective: 800px;
}

/* --- Numero (etapes) — animated glow counter --- */
.etape .numero {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(215,38,61,0.1);
    border: 1px solid rgba(215,38,61,0.2);
    transition: all 0.3s ease;
}

.etape:hover .numero {
    background: rgba(215,38,61,0.2);
    border-color: var(--crimson);
    box-shadow: 0 0 16px rgba(215,38,61,0.3);
    transform: scale(1.1) rotate(-5deg);
}

/* --- Etape hover lift --- */
.etape {
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.etape:hover {
    transform: translateY(-6px);
    box-shadow: var(--glass-shadow), 0 0 20px rgba(215,38,61,0.1);
    border-color: var(--glass-border-strong);
}

/* --- carte-matiere enhanced hover with glow --- */
.carte-matiere {
    transition: transform 0.35s cubic-bezier(0.25,0.46,0.45,0.94),
                box-shadow 0.35s ease,
                background 0.3s ease,
                border-color 0.3s ease;
}

.carte-matiere:hover {
    transform: translateY(-8px) scale(1.01);
    box-shadow: var(--glass-shadow),
                var(--glass-glow),
                0 20px 50px rgba(0,0,0,0.15);
}

.carte-matiere .lien-matiere {
    transition: gap 0.3s ease, letter-spacing 0.3s ease;
}

.carte-matiere:hover .lien-matiere {
    gap: 0.6rem;
    letter-spacing: 0.02em;
}

/* --- Icone matiere bounce on hover --- */
.carte-matiere .icone {
    transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.3s ease;
}

.carte-matiere:hover .icone {
    transform: scale(1.15) rotate(-3deg);
}

.carte-matiere.francais:hover .icone { box-shadow: 0 0 12px rgba(215,38,61,0.3); }
.carte-matiere.mathematiques:hover .icone { box-shadow: 0 0 12px rgba(18,184,169,0.3); }
.carte-matiere.anglais:hover .icone { box-shadow: 0 0 12px rgba(37,99,235,0.3); }

/* --- Logo hover glow --- */
.logo {
    position: relative;
}

.logo::after {
    content: "";
    position: absolute;
    inset: -8px;
    border-radius: 12px;
    background: radial-gradient(circle, rgba(215,38,61,0.15), transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: -1;
}

.logo:hover::after { opacity: 1; }

/* --- brand-mark spin on hover --- */
.logo .brand-mark {
    transition: transform 0.5s cubic-bezier(0.34,1.56,0.64,1);
}

.logo:hover .brand-mark {
    transform: rotate(360deg) scale(1.1);
}

/* --- Account avatar glow --- */
.account-avatar {
    transition: box-shadow 0.3s ease, transform 0.3s ease;
    box-shadow: 0 0 0 3px rgba(215,38,61,0.2);
}

.account-profile:hover .account-avatar {
    box-shadow: 0 0 0 3px rgba(215,38,61,0.3),
                0 0 20px rgba(215,38,61,0.2);
    transform: scale(1.05);
}

/* --- Theme card enhanced hover --- */
.theme-card {
    transition: all 0.3s cubic-bezier(0.25,0.46,0.45,0.94);
}

.theme-card:hover {
    transform: translateY(-4px) scale(1.03);
    box-shadow: var(--glass-shadow), 0 0 20px rgba(255,255,255,0.05);
}

.theme-card:hover .theme-preview {
    transform: scale(1.05);
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}

.theme-preview {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* --- Form input focus glow --- */
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    box-shadow: 0 0 0 3px rgba(233,30,99,0.15), 0 0 16px rgba(233,30,99,0.1);
}

/* --- Quiz choix hover glow --- */
.choix-item {
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.choix-item:hover {
    transform: translateX(4px);
}

/* --- Footer subtle glow line --- */
.footer {
    position: relative;
}

.footer::before {
    content: "";
    position: absolute;
    top: 0; left: 10%; right: 10%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--glass-border-strong), transparent);
}

/* --- Login modal avatar pulse --- */
.login-modal-avatar-circle {
    transition: box-shadow 0.3s ease;
}

.login-modal-avatar-circle:hover {
    box-shadow: 0 0 24px rgba(233,30,99,0.3);
}

/* --- Page title entrance --- */
.section-tight > h2,
.section-tight > .container > h2 {
    animation: wow-title-in 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes wow-title-in {
    from { opacity: 0; transform: translateY(20px) scale(0.97); filter: blur(4px); }
    to   { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}

/* --- Fil d'ariane hover --- */
.fil-ariane a {
    transition: color 0.2s ease, text-shadow 0.2s ease;
}

.fil-ariane a:hover {
    text-shadow: 0 0 8px rgba(215,38,61,0.3);
}

/* --- Glass shimmer overlay on cards (subtle) --- */
.feature-card::after,
.account-section::after {
    content: "";
    position: absolute;
    top: 0; left: -100%; right: 0;
    width: 50%;
    height: 100%;
    background: linear-gradient(
        105deg,
        transparent 40%,
        rgba(255,255,255,0.03) 45%,
        rgba(255,255,255,0.06) 50%,
        rgba(255,255,255,0.03) 55%,
        transparent 60%
    );
    pointer-events: none;
    z-index: 2;
    border-radius: inherit;
}

.feature-card:hover::after {
    animation: wow-shimmer-slide 0.8s ease forwards;
}

.account-section {
    position: relative;
    overflow: hidden;
}

.account-section:hover::after {
    animation: wow-shimmer-slide 0.8s ease forwards;
}

@keyframes wow-shimmer-slide {
    from { left: -100%; }
    to   { left: 200%; }
}

/* --- Smooth number pop (for bilan indicators) --- */
.bilan-indicateur {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.bilan-indicateur:hover {
    transform: translateY(-4px) scale(1.03);
    box-shadow: var(--glass-shadow), 0 0 16px rgba(215,38,61,0.1);
}

/* --- Quiz nav item glow on hover --- */
.quiz-nav-item {
    transition: all 0.2s ease;
}

.quiz-nav-item:hover:not(.quiz-nav-locked) {
    box-shadow: 0 0 12px rgba(215,38,61,0.2);
    transform: scale(1.1);
}

/* --- All wow effects respect prefers-reduced-motion --- */
@media (prefers-reduced-motion: reduce) {
    .scroll-progress { display: none; }
    .gradient-text-wow { animation: none; }
    .wow-pulse-ring::before, .wow-pulse-ring::after { animation: none; }
    .wow-gradient-border::before { animation: none; }
    .feature-card::after, .account-section::after { animation: none !important; }
    .section-tight > h2, .section-tight > .container > h2 { animation: none; }
}

/* ============================================================
   @supports FALLBACK — navigateurs sans backdrop-filter
   ============================================================ */

@supports not (backdrop-filter: blur(1px)) {
    .header { background: rgba(50, 65, 85, 0.92); }
    .page-center-card,
    .carte-formulaire,
    .panneau,
    .carte-matiere,
    .feature-card,
    .login-modal {
        background: rgba(65, 80, 100, 0.88);
    }
    .footer { background: rgba(50, 65, 85, 0.92); }
    .admin-subnav { background: rgba(50, 65, 85, 0.88); }
    .bilan-indicateur { background: rgba(65, 80, 100, 0.85); }
    .etape { background: rgba(65, 80, 100, 0.82); }
    .glass-card { background: rgba(65, 80, 100, 0.88); }
    .user-menu-dropdown { background: rgba(50, 65, 85, 0.95); }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 1024px) {
    .header {
        grid-template-columns: 1fr;
        padding: 14px 28px;
        gap: 12px;
    }
    .header-left { justify-self: center; }
    .header-nav { justify-self: center; gap: 18px; }
    .header-actions { justify-self: center; }
}

@media (max-width: 900px) {
    .features-grid { grid-template-columns: repeat(2, 1fr); }
    .matieres-grid { grid-template-columns: 1fr; }
    .etapes { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
    .features-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    :root {
        --glass-blur: 12px;
        --glass-blur-strong: 20px;
    }
    .blob { filter: blur(60px); opacity: 0.3; }

    .header { padding: 12px 20px; gap: 10px; }
    .logo { font-size: 1.1rem; }
    .header-nav { gap: 14px; }
    .header-nav a { font-size: 0.85rem; }
    .header-actions { flex-wrap: wrap; justify-content: center; gap: 8px; }
    .btn-outline, button.btn-outline, .btn-primary-nav { font-size: 12px; padding: 8px 14px; }
}

@media (max-width: 560px) {
    :root {
        --glass-blur: 8px;
    }

    .header-nav { display: none; }
    .hero-svg-scene, .hero-reflection, .hero-glow, .hero-sparkle, .hero-vignette { display: none; }
    .hero-svg-scene-mobile { display: block; }
    .hero { min-height: 60px; }
    .etapes { grid-template-columns: 1fr; }
    .carte-formulaire { padding: 1.5rem; }
    .page-center-card { padding: 1.5rem; }
    .page-center-card .login-modal-header { margin: -1.5rem -1.5rem 1.5rem; }
    .grille-form { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr !important; }
    .bilan-header { flex-direction: column; }
    .bilan-indicateurs { gap: 0.6rem; }
    .bilan-indicateur { min-width: 100px; padding: 1rem 0.8rem; }
    .bilan-indicateur-valeur { font-size: 1.4rem; }
    .bilan-barre-label { min-width: 80px; font-size: 0.82rem; }
    .bilan-types-grid { grid-template-columns: repeat(2, 1fr); }
    .bilan-reco-card { flex-direction: column; }
    .bilan-reco-actions { flex-direction: row; }
}

/* ============================================================
   EVALUATION BANNER
   ============================================================ */

.evaluation-banner {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 1rem;
    background: linear-gradient(135deg, rgba(245, 166, 35, 0.2), rgba(245, 166, 35, 0.1));
    border: 1px solid rgba(245, 166, 35, 0.35);
    border-radius: var(--radius-s);
    color: var(--gold);
    font-size: 0.82rem;
    font-weight: 600;
    white-space: nowrap;
}

.evaluation-banner i {
    font-size: 1rem;
}

/* ============================================================
   QUIZ NAVIGATION — Barre numérotée et liens prev/next
   ============================================================ */

.quiz-nav {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 1.2rem;
}

.quiz-nav-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.85rem;
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 2px solid var(--glass-border);
    background: var(--glass-bg);
    color: var(--ink);
}

.quiz-nav-item.correct {
    background: rgba(16, 185, 129, 0.25);
    border-color: #10B981;
    color: var(--success-text);
}

.quiz-nav-item.incorrect {
    background: rgba(239, 68, 68, 0.25);
    border-color: #EF4444;
    color: var(--danger-text);
}

/* Reponse redigee (TEXTE_LIBRE) : hors bareme, ni juste ni fausse */
.quiz-nav-item.hors-bareme {
    background: rgba(148, 163, 184, 0.25);
    border-color: #94A3B8;
    color: var(--ink);
}

.quiz-nav-item.active {
    border-color: var(--form-violet);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.3);
    transform: scale(1.1);
}

.quiz-nav-item.locked {
    opacity: 0.35;
    cursor: default;
}

a.quiz-nav-item:hover {
    transform: scale(1.15);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

a.quiz-nav-item.active:hover {
    transform: scale(1.1);
}

.quiz-nav-links {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.2rem;
    gap: 1rem;
}

.btn-nav-secondary {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.btn-nav-secondary:hover {
    color: var(--ink);
}

/* --- Toggle de niveau (progression / bilan) --- */
.niveau-toggle {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.toggle-btn {
    display: inline-block;
    padding: 0.45rem 1.1rem;
    border-radius: 999px;
    font-size: 0.88rem;
    font-weight: 600;
    font-family: var(--font-body);
    text-decoration: none;
    color: var(--text-muted);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    transition: all 0.25s ease;
    cursor: pointer;
}

.toggle-btn:hover {
    color: var(--ink);
    background: var(--glass-bg-strong);
    border-color: rgba(255, 255, 255, 0.3);
}

.toggle-btn.actif {
    color: var(--on-crimson);
    background: var(--crimson-fill);
    border-color: var(--crimson-fill);
    box-shadow: 0 2px 10px rgba(215, 38, 61, 0.35);
}


/* --- Détails exercices/dictées dans progression --- */
.progression-detail {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
}


/* ===================================================================
   FLATPICKR — Premium Dark Glass Theme
   =================================================================== */

/* --- Input visible (altInput) --- */
.datepicker-alt {
    width: 100%;
    padding: 0.65rem 2.6rem 0.65rem 0.95rem;
    border-radius: 10px;
    border: 1.5px solid var(--glass-border);
    background: linear-gradient(135deg, rgba(255,255,255,0.07), rgba(255,255,255,0.03));
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-sizing: border-box;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none' stroke='rgba(238,240,246,0.4)' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 24 24'%3E%3Crect x='3' y='4' width='18' height='18' rx='3'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.8rem center;
    background-size: 17px;
}

.datepicker-alt::placeholder {
    color: var(--text-muted);
    font-weight: 400;
}

.datepicker-alt:hover {
    border-color: var(--glass-border-strong);
    background: linear-gradient(135deg, rgba(255,255,255,0.1), rgba(255,255,255,0.05));
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
}

.datepicker-alt:focus,
.datepicker-alt.active {
    outline: none;
    border-color: var(--crimson);
    background: linear-gradient(135deg, rgba(255,255,255,0.12), rgba(255,255,255,0.06));
    box-shadow: 0 0 0 3px rgba(215, 38, 61, 0.15), 0 4px 16px rgba(0, 0, 0, 0.15);
}

/* --- Calendrier dropdown --- */
.flatpickr-calendar {
    background: var(--dropdown-bg);
    backdrop-filter: blur(24px) saturate(1.6);
    -webkit-backdrop-filter: blur(24px) saturate(1.6);
    border: 1px solid var(--dropdown-border);
    border-radius: 16px;
    box-shadow:
        0 24px 80px rgba(0, 0, 0, 0.45),
        0 8px 24px rgba(0, 0, 0, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    font-family: var(--font-body);
    overflow: hidden;
    width: 320px !important;
    padding: 0;
}

.flatpickr-calendar.open {
    animation: fp-slide-in 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fp-slide-in {
    from { opacity: 0; transform: translateY(-8px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.flatpickr-calendar::before,
.flatpickr-calendar::after {
    display: none !important;
}

/* --- Header mois / navigation --- */
.flatpickr-months {
    background: transparent;
    border-bottom: none;
    padding: 16px 12px 8px;
    height: auto;
    position: relative;
}

.flatpickr-months::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 16px;
    right: 16px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--dropdown-border), transparent);
}

.flatpickr-months .flatpickr-month {
    color: var(--dropdown-text);
    fill: var(--dropdown-text);
    height: 34px;
}

.flatpickr-current-month {
    font-size: 1rem;
    font-weight: 700;
    color: var(--dropdown-text);
    padding-top: 5px;
    letter-spacing: -0.01em;
}

.flatpickr-current-month .flatpickr-monthDropdown-months {
    background: transparent;
    color: var(--dropdown-text);
    font-weight: 700;
    font-family: var(--font-body);
    font-size: 1rem;
    border: none;
    appearance: none;
    -webkit-appearance: none;
    padding: 0 2px;
    cursor: pointer;
}

.flatpickr-current-month .flatpickr-monthDropdown-months:hover {
    color: var(--crimson-text);
}

.flatpickr-current-month .flatpickr-monthDropdown-months option {
    background: var(--dropdown-bg);
    color: var(--dropdown-text);
    font-weight: 500;
    padding: 6px;
}

.flatpickr-current-month input.cur-year {
    color: var(--dropdown-text);
    font-weight: 700;
    font-family: var(--font-body);
    font-size: 1rem;
}

.flatpickr-months .flatpickr-prev-month,
.flatpickr-months .flatpickr-next-month {
    fill: var(--dropdown-text-muted);
    color: var(--dropdown-text-muted);
    padding: 6px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    top: 12px;
}

.flatpickr-months .flatpickr-prev-month:hover,
.flatpickr-months .flatpickr-next-month:hover {
    background: var(--dropdown-hover);
    transform: scale(1.08);
}

.flatpickr-months .flatpickr-prev-month svg,
.flatpickr-months .flatpickr-next-month svg {
    fill: var(--dropdown-text-muted);
    width: 12px;
    height: 12px;
    transition: fill 0.2s;
}

.flatpickr-months .flatpickr-prev-month:hover svg,
.flatpickr-months .flatpickr-next-month:hover svg {
    fill: var(--dropdown-text);
}

/* --- Jours de la semaine --- */
.flatpickr-weekdays {
    background: transparent;
    padding: 10px 8px 4px;
    height: auto;
}

span.flatpickr-weekday {
    color: var(--dropdown-text-muted);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    background: transparent;
}

/* --- Grille jours --- */
.flatpickr-innerContainer {
    padding: 4px 10px 12px;
}

.dayContainer {
    padding: 0;
    min-width: 294px;
    max-width: 294px;
}

/* --- Cellules jours --- */
.flatpickr-day {
    color: var(--dropdown-text);
    border-radius: 10px;
    border: 2px solid transparent;
    font-weight: 500;
    font-size: 0.85rem;
    line-height: 38px;
    height: 38px;
    max-width: 38px;
    margin: 1px;
    transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.flatpickr-day:hover,
.flatpickr-day:focus {
    background: var(--dropdown-hover);
    border-color: var(--dropdown-border);
    color: var(--dropdown-text);
    transform: scale(1.06);
}

/* Aujourd'hui — point discret + surbrillance subtile */
.flatpickr-day.today:not(.selected) {
    border-color: transparent;
    color: var(--teal);
    background: rgba(18, 184, 169, 0.1);
    font-weight: 700;
}

.flatpickr-day.today:not(.selected)::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--teal);
}

.flatpickr-day.today:not(.selected):hover {
    background: rgba(18, 184, 169, 0.18);
    border-color: rgba(18, 184, 169, 0.3);
}

/* Jour sélectionné — gradient + glow */
.flatpickr-day.selected,
.flatpickr-day.selected:hover,
.flatpickr-day.selected:focus {
    background: linear-gradient(135deg, var(--crimson), var(--crimson-dark));
    border-color: transparent;
    color: #fff;
    font-weight: 700;
    box-shadow: 0 4px 14px rgba(215, 38, 61, 0.4), 0 0 0 2px rgba(215, 38, 61, 0.15);
    transform: scale(1.08);
}

/* Mois précédent / suivant */
.flatpickr-day.prevMonthDay,
.flatpickr-day.nextMonthDay {
    color: var(--dropdown-text-muted);
    opacity: 0.3;
}

.flatpickr-day.prevMonthDay:hover,
.flatpickr-day.nextMonthDay:hover {
    background: var(--dropdown-hover);
    opacity: 0.5;
    color: var(--dropdown-text-muted);
}

/* Jours désactivés */
.flatpickr-day.flatpickr-disabled,
.flatpickr-day.flatpickr-disabled:hover {
    color: var(--dropdown-text-muted);
    opacity: 0.15;
    cursor: not-allowed;
    transform: none;
}

/* --- Année spin buttons --- */
.flatpickr-current-month .numInputWrapper {
    border-radius: 6px;
    transition: background 0.2s;
}

.flatpickr-current-month .numInputWrapper:hover {
    background: var(--dropdown-hover);
}

.flatpickr-current-month .numInputWrapper span {
    border: none;
    opacity: 0;
    transition: opacity 0.2s;
}

.flatpickr-current-month .numInputWrapper:hover span {
    opacity: 1;
}

.flatpickr-current-month .numInputWrapper span::after {
    border-top-color: var(--dropdown-text-muted);
    border-bottom-color: var(--dropdown-text-muted);
}

.numInputWrapper:hover {
    background: var(--dropdown-hover);
    border-radius: 6px;
}

/* --- Mobile --- */
@media (max-width: 480px) {
    .flatpickr-calendar {
        width: 290px !important;
    }
    .dayContainer {
        min-width: 264px;
        max-width: 264px;
    }
    .flatpickr-day {
        height: 34px;
        line-height: 34px;
        max-width: 34px;
        font-size: 0.82rem;
    }
}

/* ============================================================
   MATH PREVIEW (KaTeX)
   ============================================================ */
.math-preview {
    min-height: 1.5em;
    padding: 0.5rem 0.75rem;
    margin-top: 0.25rem;
    background: rgba(255,255,255,0.06);
    border-left: 3px solid var(--teal);
    border-radius: 4px;
    font-size: 0.95rem;
    display: none;
}
.math-preview:not(:empty) { display: block; }

/* ------------------------------------------------------------------
   Voyant de presence d'un eleve, cote parent.
   La couleur seule ne suffit pas : chaque voyant porte aussi un libelle
   lisible et une infobulle, pour rester comprehensible sans distinguer
   le vert du gris.
   ------------------------------------------------------------------ */
.voyant-presence { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.8rem;
                   color: var(--text-muted); white-space: nowrap; }
.voyant-presence .point { width: 0.6rem; height: 0.6rem; border-radius: 50%;
                          background: var(--paper-line, #cbd5e1);
                          border: 1px solid rgba(0, 0, 0, 0.15); flex: none; }
.voyant-presence.en-ligne { color: var(--teal, #14b8a6); }
.voyant-presence.en-ligne .point { background: var(--teal, #14b8a6); border-color: transparent;
                                   box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.2); }

/* Appeler reste visible quand l'enfant est absent, mais inerte : le masquer
   laisserait croire que la fonction n'existe pas. */
/* Pas d'opacite : le gris des boutons desactives signale deja l'etat, et a 45 %
   l'intitule devenait illisible sur les themes clairs (contraste 2). */
.bouton-appel[disabled] { cursor: not-allowed; }
