/* =====================================================================
   programspikto.com — Design system
   Charte : chaleureux, magenta profond, fond beige, Inter, accessible
   ===================================================================== */

/* ----- Tokens ------------------------------------------------------- */
:root {
    /* Couleurs - palette magenta (fuchsia Tailwind) */
    --c-primary-50:  #fdf4ff;
    --c-primary-100: #fae8ff;
    --c-primary-200: #f5d0fe;
    --c-primary-300: #f0abfc;
    --c-primary-400: #e879f9;
    --c-primary-500: #d946ef;
    --c-primary-600: #c026d3;
    --c-primary-700: #a21caf;
    --c-primary-800: #86198f;
    --c-primary-900: #701a75;

    --c-mint-100:    #ccfbf1;
    --c-mint-500:    #14b8a6;
    --c-mint-600:    #0d9488;

    --c-amber-100:   #fef3c7;
    --c-amber-500:   #f59e0b;
    --c-amber-700:   #b45309;

    --c-rose-100:    #ffe4e6;
    --c-rose-500:    #f43f5e;
    --c-rose-700:    #be123c;

    /* Neutres - palette chaleureuse beige */
    --c-white:       #ffffff;
    --c-bg:          #faf5ec;
    --c-surface:     #ffffff;
    --c-surface-2:   #f3ecdc;
    --c-border:      #eadfc5;
    --c-border-2:    #d6c8a9;
    --c-text:        #1c1810;
    --c-text-2:      #3b342a;
    --c-text-muted:  #6b5d4e;
    --c-text-soft:   #9a8a78;

    /* Couleurs sémantiques */
    --c-link:        var(--c-primary-700);
    --c-link-hover:  var(--c-primary-900);

    /* Rayons */
    --r-xs: 4px;
    --r-sm: 6px;
    --r:    10px;
    --r-lg: 14px;
    --r-xl: 20px;
    --r-pill: 9999px;

    /* Ombres */
    --sh-xs:  0 1px 2px rgba(15, 23, 42, 0.04);
    --sh-sm:  0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
    --sh:     0 4px 12px rgba(15, 23, 42, 0.06), 0 2px 4px rgba(15, 23, 42, 0.04);
    --sh-lg:  0 12px 28px rgba(15, 23, 42, 0.10), 0 4px 8px rgba(15, 23, 42, 0.06);
    --sh-glow:0 0 0 4px rgba(192, 38, 211, 0.18);

    /* Typo */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

    /* Espacement (échelle 4px) */
    --s-1:  4px;
    --s-2:  8px;
    --s-3:  12px;
    --s-4:  16px;
    --s-5:  20px;
    --s-6:  24px;
    --s-8:  32px;
    --s-10: 40px;
    --s-12: 48px;
    --s-16: 64px;
    --s-20: 80px;

    /* Layout */
    --container:        1140px;
    --container-narrow: 560px;
    --header-h:         72px;

    /* Transitions */
    --t-fast: 120ms cubic-bezier(.4,0,.2,1);
    --t:      200ms cubic-bezier(.4,0,.2,1);
}

/* ----- Reset & base ------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--c-bg);
    color: var(--c-text-2);
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.6;
    font-feature-settings: 'cv02','cv03','cv04','cv11';
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

img, svg, video { max-width: 100%; display: block; }
svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

a {
    color: var(--c-link);
    text-decoration: none;
    transition: color var(--t-fast);
}
a:hover { color: var(--c-link-hover); text-decoration: underline; text-underline-offset: 3px; }

::selection { background: var(--c-primary-100); color: var(--c-primary-900); }

/* ----- Typographie -------------------------------------------------- */
h1, h2, h3, h4, h5 {
    margin: 0 0 var(--s-4);
    color: var(--c-text);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.01em;
}
h1 { font-size: clamp(1.875rem, 1.4rem + 1.5vw, 2.5rem); letter-spacing: -0.025em; }
h2 { font-size: clamp(1.375rem, 1.1rem + 0.9vw, 1.75rem); margin-top: var(--s-8); }
h3 { font-size: 1.15rem; }
h4 { font-size: 1rem; color: var(--c-text-2); }

p, ul, ol { margin: 0 0 var(--s-4); }
ul, ol { padding-left: 1.4em; }
li { margin-bottom: var(--s-1); }
strong { color: var(--c-text); font-weight: 600; }

.lead {
    font-size: 1.125rem;
    color: var(--c-text-muted);
    line-height: 1.6;
    max-width: 65ch;
}

hr {
    border: 0;
    border-top: 1px solid var(--c-border);
    margin: var(--s-8) 0;
}

/* ----- Layout ------------------------------------------------------- */
.container {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 var(--s-6);
}
.container--narrow { max-width: var(--container-narrow); }

.site-main {
    flex: 1 0 auto;
    padding: var(--s-10) 0 var(--s-16);
}

/* ----- Header / Navigation ----------------------------------------- */
.site-header {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--c-border);
    position: sticky;
    top: 0;
    z-index: 50;
}
.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--s-6);
    min-height: var(--header-h);
}
.brand {
    display: inline-flex;
    align-items: center;
    gap: var(--s-2);
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--c-text);
    letter-spacing: -0.02em;
}
.brand:hover { color: var(--c-primary-700); text-decoration: none; }
.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px; height: 32px;
    border-radius: var(--r-sm);
    background: linear-gradient(135deg, var(--c-primary-600), var(--c-primary-800));
    color: var(--c-white);
    box-shadow: var(--sh-sm), inset 0 1px 0 rgba(255,255,255,0.2);
}
.brand-mark svg { width: 18px; height: 18px; stroke: currentColor; }

.main-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: nowrap;
}
.nav-link {
    color: var(--c-text-2);
    font-weight: 500;
    font-size: .92rem;
    padding: 6px 10px;
    border-radius: var(--r-sm);
    white-space: nowrap;
    transition: background var(--t-fast), color var(--t-fast);
}
.nav-link:hover {
    color: var(--c-primary-700);
    background: var(--c-primary-50);
    text-decoration: none;
}
.nav-link.is-active {
    color: var(--c-primary-700);
    background: var(--c-primary-50);
}
.nav-divider {
    width: 1px;
    height: 22px;
    background: var(--c-border);
    margin: 0 4px;
}
.nav-user {
    display: inline-flex;
    align-items: center;
    gap: var(--s-2);
    padding: 6px var(--s-3) 6px 6px;
    border-radius: var(--r-pill);
    background: var(--c-surface-2);
    color: var(--c-text);
    font-weight: 500;
    font-size: .9rem;
    transition: background var(--t-fast);
}
.nav-user:hover { background: var(--c-primary-50); color: var(--c-primary-700); text-decoration: none; }
.nav-user-avatar {
    width: 28px; height: 28px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--c-primary-500), var(--c-primary-700));
    color: white;
    font-size: .75rem;
    font-weight: 700;
}

.logout-form { margin: 0; display: inline; }
.btn-link {
    background: none;
    border: 0;
    color: var(--c-text-muted);
    font: inherit;
    cursor: pointer;
    padding: var(--s-2) var(--s-3);
    font-weight: 500;
    font-size: .9rem;
    border-radius: var(--r-sm);
    transition: color var(--t-fast), background var(--t-fast);
}
.btn-link:hover { color: var(--c-rose-700); background: var(--c-rose-100); }

/* ----- Burger button (mobile only) --------------------------------- */
.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 40px;
    height: 36px;
    padding: 9px 8px;
    background: transparent;
    border: 1px solid var(--c-border);
    border-radius: var(--r-sm);
    cursor: pointer;
    transition: background var(--t-fast), border-color var(--t-fast);
}
.nav-toggle:hover { background: var(--c-surface-2); border-color: var(--c-border-2); }
.nav-toggle-bar {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--c-text);
    border-radius: 2px;
    transition: transform var(--t), opacity var(--t-fast);
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) {
    opacity: 0;
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ----- Footer ------------------------------------------------------- */
.site-footer {
    background: var(--c-text);
    color: #cbd5e1;
    padding: var(--s-10) 0;
    margin-top: auto;
    font-size: .9rem;
    text-align: center;
}
.site-footer a { color: #e2e8f0; }
.site-footer a:hover { color: var(--c-white); }
.site-footer p { margin: 0; }

/* ----- Boutons ------------------------------------------------------ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--s-2);
    padding: 11px 20px;
    border-radius: var(--r-sm);
    font-family: inherit;
    font-weight: 600;
    font-size: .95rem;
    line-height: 1.2;
    cursor: pointer;
    border: 1px solid transparent;
    text-decoration: none;
    transition: background var(--t-fast), border-color var(--t-fast),
                color var(--t-fast), box-shadow var(--t-fast),
                transform 80ms ease;
    white-space: nowrap;
    user-select: none;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible {
    outline: none;
    box-shadow: var(--sh-glow);
}
.btn svg { width: 16px; height: 16px; }
.btn + .btn { margin-left: var(--s-2); }

.btn-primary {
    background: var(--c-primary-700);
    color: var(--c-white);
    box-shadow: var(--sh-sm), inset 0 1px 0 rgba(255,255,255,0.12);
}
.btn-primary:hover { background: var(--c-primary-800); color: var(--c-white); }

.btn-secondary {
    background: var(--c-surface);
    color: var(--c-primary-700);
    border-color: var(--c-border-2);
    box-shadow: var(--sh-xs);
}
.btn-secondary:hover {
    background: var(--c-primary-50);
    border-color: var(--c-primary-200);
    color: var(--c-primary-800);
}

.btn-ghost {
    background: transparent;
    color: var(--c-text-2);
    border-color: transparent;
}
.btn-ghost:hover { background: var(--c-surface-2); color: var(--c-text); }

.btn-sm { padding: 7px 14px; font-size: .85rem; }
.btn-lg { padding: 14px 26px; font-size: 1rem; }

/* ----- Formulaires -------------------------------------------------- */
.form-group { margin-bottom: var(--s-5); }
.form-group label {
    display: block;
    margin-bottom: var(--s-2);
    font-weight: 500;
    color: var(--c-text);
    font-size: .9rem;
}
.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="tel"],
.form-group input[type="url"],
.form-group input[type="number"],
.form-group input[type="search"],
.form-group input[type="date"],
.form-group input[type="datetime-local"],
.form-group input[type="time"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--c-border-2);
    border-radius: var(--r-sm);
    background: var(--c-surface);
    color: var(--c-text);
    font: inherit;
    font-size: .95rem;
    transition: border-color var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
}
.form-group input::placeholder,
.form-group textarea::placeholder { color: var(--c-text-soft); }

.form-group input:hover,
.form-group textarea:hover,
.form-group select:hover { border-color: var(--c-text-soft); }

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--c-primary-500);
    box-shadow: var(--sh-glow);
}
.form-group textarea { resize: vertical; min-height: 140px; line-height: 1.5; }

.form-group .help {
    display: block;
    margin-top: 6px;
    font-size: .8rem;
    color: var(--c-text-muted);
}

.form-check {
    display: flex;
    align-items: center;
    gap: var(--s-2);
    margin-bottom: var(--s-5);
}
.form-check input[type="checkbox"] {
    width: 18px; height: 18px;
    accent-color: var(--c-primary-600);
}
.form-check label { margin: 0; font-weight: 400; color: var(--c-text-2); }

.honeypot { position: absolute !important; left: -9999px !important; }

/* ----- Alerts ------------------------------------------------------- */
.flash-stack {
    margin-top: var(--s-6);
    display: flex;
    flex-direction: column;
    gap: var(--s-3);
}
.alert {
    padding: var(--s-3) var(--s-4);
    border-radius: var(--r-sm);
    border: 1px solid transparent;
    border-left-width: 3px;
    font-size: .92rem;
    line-height: 1.5;
    display: flex;
    align-items: flex-start;
    gap: var(--s-2);
}
.alert ul { margin: 0; padding-left: 1.2em; }
.alert-success {
    background: var(--c-mint-100);
    color: #115e59;
    border-color: rgba(13, 148, 136, 0.25);
    border-left-color: var(--c-mint-600);
}
.alert-error {
    background: var(--c-rose-100);
    color: var(--c-rose-700);
    border-color: rgba(244, 63, 94, 0.18);
    border-left-color: var(--c-rose-500);
}
.alert-warning {
    background: var(--c-amber-100);
    color: var(--c-amber-700);
    border-color: rgba(245, 158, 11, 0.2);
    border-left-color: var(--c-amber-500);
}
.alert-info {
    background: var(--c-primary-50);
    color: var(--c-primary-800);
    border-color: var(--c-primary-200);
    border-left-color: var(--c-primary-500);
}

/* ----- Cards / Sections génériques --------------------------------- */
.surface {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r-lg);
    padding: var(--s-8);
    box-shadow: var(--sh-sm);
}

.content-page,
.contact-page,
.contact-success,
.profile-page {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r-lg);
    padding: var(--s-8);
    box-shadow: var(--sh-sm);
}

.auth-page {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r-lg);
    padding: var(--s-10);
    box-shadow: var(--sh);
    max-width: 460px;
    margin: var(--s-8) auto 0;
}
.auth-page h1 {
    text-align: center;
    margin-bottom: var(--s-6);
    font-size: 1.5rem;
}
.auth-link {
    text-align: center;
    margin-top: var(--s-4);
    font-size: .9rem;
    color: var(--c-text-muted);
}
.auth-link a { font-weight: 500; }

/* ----- Hero (home) -------------------------------------------------- */
.hero {
    position: relative;
    padding: var(--s-16) var(--s-8);
    border-radius: var(--r-xl);
    text-align: center;
    margin-bottom: var(--s-12);
    background:
        radial-gradient(ellipse 80% 60% at 50% 0%,
            rgba(232, 121, 249, 0.25) 0%,
            transparent 70%),
        linear-gradient(180deg, var(--c-primary-50) 0%, var(--c-surface) 100%);
    border: 1px solid var(--c-primary-100);
    overflow: hidden;
}
.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 1px 1px, rgba(134, 25, 143, 0.08) 1px, transparent 0);
    background-size: 24px 24px;
    mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, #000 30%, transparent 80%);
    -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, #000 30%, transparent 80%);
    pointer-events: none;
}
.hero > * { position: relative; }

.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: var(--s-2);
    padding: 6px 14px;
    border-radius: var(--r-pill);
    background: var(--c-surface);
    border: 1px solid var(--c-primary-200);
    color: var(--c-primary-800);
    font-size: .82rem;
    font-weight: 500;
    margin-bottom: var(--s-5);
    box-shadow: var(--sh-xs);
}
.hero-eyebrow svg { width: 14px; height: 14px; color: var(--c-mint-600); }

.hero h1 {
    font-size: clamp(2rem, 1.4rem + 2.5vw, 3.25rem);
    line-height: 1.1;
    margin-bottom: var(--s-4);
    color: var(--c-text);
    letter-spacing: -0.03em;
}
.hero h1 em {
    font-style: normal;
    background: linear-gradient(135deg, var(--c-primary-700), var(--c-primary-500));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.hero .lead {
    margin: 0 auto var(--s-8);
    font-size: 1.18rem;
    color: var(--c-text-muted);
}
.hero-actions {
    display: flex;
    justify-content: center;
    gap: var(--s-3);
    flex-wrap: wrap;
}

/* ----- Features grid ------------------------------------------------ */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--s-5);
}
.feature-card {
    position: relative;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r-lg);
    padding: var(--s-6);
    box-shadow: var(--sh-xs);
    transition: transform var(--t), box-shadow var(--t), border-color var(--t);
}
.feature-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--sh);
    border-color: var(--c-primary-200);
}
.feature-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px; height: 44px;
    border-radius: var(--r-sm);
    background: var(--c-primary-50);
    color: var(--c-primary-700);
    margin-bottom: var(--s-4);
}
.feature-icon svg { width: 22px; height: 22px; }
.feature-card h2 {
    margin: 0 0 var(--s-2);
    font-size: 1.1rem;
    color: var(--c-text);
}
.feature-card p {
    color: var(--c-text-muted);
    font-size: .94rem;
    margin-bottom: var(--s-4);
}
.feature-card .feature-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
    font-size: .9rem;
    color: var(--c-primary-700);
}
.feature-card .feature-link svg {
    width: 14px; height: 14px;
    transition: transform var(--t-fast);
}
.feature-card .feature-link:hover { text-decoration: none; }
.feature-card:hover .feature-link svg { transform: translateX(3px); }

/* ----- Profile dl --------------------------------------------------- */
.profile-info {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: var(--s-3) var(--s-5);
    margin: var(--s-5) 0 var(--s-6);
    padding: var(--s-5);
    background: var(--c-surface-2);
    border-radius: var(--r);
}
.profile-info dt {
    font-weight: 500;
    color: var(--c-text-muted);
    font-size: .85rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.profile-info dd { margin: 0; color: var(--c-text); font-weight: 500; }

/* ----- Pages d'erreur ---------------------------------------------- */
.page-error {
    margin: 0;
    background: var(--c-bg);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--s-6);
    font-family: var(--font-sans);
    color: var(--c-text);
}
.error-container {
    background: var(--c-surface);
    padding: var(--s-12);
    border-radius: var(--r-xl);
    box-shadow: var(--sh-lg);
    text-align: center;
    max-width: 480px;
    width: 100%;
    border: 1px solid var(--c-border);
}
.error-container h1 {
    font-size: 5rem;
    background: linear-gradient(135deg, var(--c-primary-600), var(--c-primary-800));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin: 0 0 var(--s-2);
    letter-spacing: -0.05em;
    line-height: 1;
}
.error-container p { color: var(--c-text-muted); margin-bottom: var(--s-6); }
.error-detail {
    font-size: .85rem;
    color: var(--c-text-muted);
    background: var(--c-surface-2);
    padding: var(--s-2) var(--s-3);
    border-radius: var(--r-sm);
    border: 1px solid var(--c-border);
    font-family: var(--font-mono);
    margin-bottom: var(--s-6);
}

/* ----- Responsive --------------------------------------------------- */
/* Nav : on bascule en burger à 1280px parce que la nav peut comporter
   13 items (admin + premium + notifs + déconnexion) et qu'au-dessous
   de cette largeur le contenu déborde le container max-width 1140. */
@media (max-width: 1280px) {
    .nav-container {
        flex-wrap: nowrap;
        padding: 0;
        min-height: var(--header-h);
    }
    .nav-toggle { display: flex; }
    .main-nav {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: var(--s-3);
        background: var(--c-surface);
        border-bottom: 1px solid var(--c-border);
        box-shadow: var(--sh);
        max-height: 0;
        opacity: 0;
        overflow: hidden;
        transform: translateY(-8px);
        transition: max-height var(--t), opacity var(--t-fast), transform var(--t-fast);
        pointer-events: none;
    }
    .main-nav.is-open {
        max-height: 90vh;
        opacity: 1;
        transform: translateY(0);
        pointer-events: auto;
        overflow-y: auto;
    }
    .main-nav .nav-link,
    .main-nav .nav-user {
        width: 100%;
        padding: var(--s-3);
        font-size: 1rem;
        border-radius: var(--r-sm);
    }
    .main-nav .btn { width: 100%; justify-content: center; margin-top: var(--s-2); }
    .main-nav .logout-form { width: 100%; }
    .main-nav .logout-form .btn-link {
        width: 100%;
        text-align: left;
        padding: var(--s-3);
        font-size: 1rem;
    }
    .nav-divider {
        display: block;
        width: 100%;
        height: 1px;
        margin: var(--s-2) 0;
    }
}

/* Mobile : padding/typographie compacts pour les pages */
@media (max-width: 760px) {
    .site-main { padding: var(--s-6) 0 var(--s-12); }

    .hero { padding: var(--s-10) var(--s-5); margin-bottom: var(--s-8); }
    .hero h1 { font-size: 2rem; }
    .hero .lead { font-size: 1.05rem; }

    .surface,
    .content-page,
    .contact-page,
    .profile-page { padding: var(--s-6); }
    .auth-page { padding: var(--s-6); }

    .profile-info { grid-template-columns: 1fr; gap: var(--s-1); }
    .profile-info dt { margin-top: var(--s-3); }
}

/* ----- Accessibilité ------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

:focus-visible {
    outline: 2px solid var(--c-primary-600);
    outline-offset: 2px;
    border-radius: var(--r-xs);
}

/* =====================================================================
   Classroom (cours, programmes, leçons)
   ===================================================================== */

.classroom-header {
    margin-bottom: var(--s-10);
    text-align: center;
}
.classroom-header h1 { margin: var(--s-3) 0 var(--s-3); }
.classroom-header .lead { margin: 0 auto; }

.breadcrumbs {
    display: flex;
    align-items: center;
    gap: var(--s-2);
    font-size: .88rem;
    color: var(--c-text-muted);
    margin-bottom: var(--s-5);
    flex-wrap: wrap;
}
.breadcrumbs a { color: var(--c-text-muted); }
.breadcrumbs a:hover { color: var(--c-primary-700); }
.breadcrumbs > span[aria-hidden] { color: var(--c-text-soft); }

/* ----- Grille des programmes ---------------------------------------- */
.program-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: var(--s-6);
}
.program-card {
    display: flex;
    flex-direction: column;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r-lg);
    overflow: hidden;
    box-shadow: var(--sh-xs);
    transition: transform var(--t), box-shadow var(--t), border-color var(--t);
}
.program-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--sh);
    border-color: var(--c-primary-200);
}
.program-card-cover {
    aspect-ratio: 16 / 9;
    background:
        radial-gradient(circle at 30% 30%, rgba(255,255,255,0.18), transparent 50%),
        linear-gradient(135deg, var(--c-primary-700), var(--c-primary-900));
    color: rgba(255,255,255,0.85);
    display: flex;
    align-items: center;
    justify-content: center;
}
.program-card-cover svg { width: 56px; height: 56px; stroke-width: 1.5; }

.program-card-body {
    display: flex;
    flex-direction: column;
    gap: var(--s-3);
    padding: var(--s-5) var(--s-5) var(--s-6);
    flex: 1;
}
.program-card h2 {
    margin: 0;
    font-size: 1.15rem;
    color: var(--c-text);
}
.program-subtitle {
    margin: 0;
    color: var(--c-text-muted);
    font-size: .92rem;
}
.program-meta {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: .88rem;
    color: var(--c-text-2);
}
.program-meta li {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}
.program-meta svg { width: 16px; height: 16px; color: var(--c-primary-700); }
.program-meta-soft { color: var(--c-text-muted); font-weight: 400; }
.program-meta--lg li { font-size: .94rem; }

.program-card .btn { align-self: flex-start; margin-top: var(--s-2); }

/* ----- Barre de progression ----------------------------------------- */
.progress {
    width: 100%;
    height: 8px;
    background: var(--c-surface-2);
    border-radius: var(--r-pill);
    overflow: hidden;
}
.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--c-primary-500), var(--c-primary-700));
    border-radius: var(--r-pill);
    transition: width var(--t);
}
.progress-label {
    margin: 6px 0 0;
    font-size: .82rem;
    color: var(--c-text-muted);
}

/* ----- Page programme ----------------------------------------------- */
.program-hero {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r-lg);
    padding: var(--s-8);
    margin-bottom: var(--s-8);
    box-shadow: var(--sh-xs);
}
.program-hero .lead { margin-top: 0; }

/* ----- Liste des modules / leçons ----------------------------------- */
.modules-list {
    display: flex;
    flex-direction: column;
    gap: var(--s-5);
}
.module-card {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r-lg);
    padding: var(--s-6);
    box-shadow: var(--sh-xs);
}
.module-header { margin-bottom: var(--s-4); }
.module-index {
    display: inline-block;
    font-size: .75rem;
    color: var(--c-primary-700);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 4px;
}
.module-card h2 {
    margin: 0;
    font-size: 1.2rem;
    color: var(--c-text);
}
.module-description {
    margin: 6px 0 0;
    color: var(--c-text-muted);
    font-size: .94rem;
}

.lesson-list {
    list-style: none;
    padding: 0;
    margin: 0;
    border-top: 1px solid var(--c-border);
}
.lesson-row {
    border-bottom: 1px solid var(--c-border);
    margin: 0;
}
.lesson-link {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: var(--s-4);
    align-items: center;
    padding: var(--s-3) 0;
    color: var(--c-text);
    transition: background var(--t-fast);
}
.lesson-link:hover {
    background: var(--c-primary-50);
    text-decoration: none;
    margin: 0 calc(-1 * var(--s-3));
    padding-left: var(--s-3);
    padding-right: var(--s-3);
    border-radius: var(--r-sm);
}
.lesson-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px; height: 32px;
    border-radius: 50%;
    background: var(--c-surface-2);
    color: var(--c-text-muted);
}
.lesson-status svg { width: 14px; height: 14px; }
.lesson-row.is-done .lesson-status {
    background: var(--c-mint-100);
    color: var(--c-mint-600);
}
.lesson-row.is-locked .lesson-status {
    background: var(--c-amber-100);
    color: var(--c-amber-700);
}
.lesson-row.is-locked .lesson-title { color: var(--c-text-muted); }
.lesson-title {
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: var(--s-2);
    flex-wrap: wrap;
}
.lesson-duration {
    color: var(--c-text-muted);
    font-size: .85rem;
    font-variant-numeric: tabular-nums;
}

/* ----- Badges -------------------------------------------------------- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 9px;
    border-radius: var(--r-pill);
    font-size: .72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border: 1px solid transparent;
}
.badge-mint  { background: var(--c-mint-100);    color: #115e59;    border-color: rgba(13,148,136,0.25); }
.badge-amber { background: var(--c-amber-100);   color: var(--c-amber-700); border-color: rgba(245,158,11,0.25); }
.badge-blue  { background: var(--c-primary-50);  color: var(--c-primary-800); border-color: var(--c-primary-200); }

/* ----- Upsell premium ----------------------------------------------- */
.upsell {
    margin-top: var(--s-8);
    padding: var(--s-6);
    border-radius: var(--r-lg);
    background: linear-gradient(135deg, var(--c-primary-50), #ffffff 60%);
    border: 1px solid var(--c-primary-200);
    box-shadow: var(--sh-xs);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--s-4);
    flex-wrap: wrap;
}
.upsell h3 { margin: 0 0 4px; font-size: 1.1rem; color: var(--c-primary-900); }
.upsell p { margin: 0; color: var(--c-text-2); font-size: .94rem; }

/* ----- Page leçon ---------------------------------------------------- */
.lesson-page-header { margin-bottom: var(--s-5); }
.lesson-page-header h1 { margin: 0 0 var(--s-3); }
.lesson-meta {
    display: flex;
    align-items: center;
    gap: var(--s-3);
    flex-wrap: wrap;
    font-size: .88rem;
}
.lesson-meta-soft {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--c-text-muted);
}
.lesson-meta-soft svg { width: 14px; height: 14px; }

.player-wrapper {
    margin: 0 0 var(--s-6);
    border-radius: var(--r-lg);
    overflow: hidden;
    background: #0b1020;
    box-shadow: var(--sh);
}
.player-frame {
    position: relative;
    aspect-ratio: 16 / 9;
    width: 100%;
    background: #000;
}
.player-frame iframe,
.player-frame video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

.player-locked {
    aspect-ratio: 16 / 9;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: var(--s-6);
    background:
        radial-gradient(ellipse at 50% 40%, rgba(232,121,249,0.22) 0%, transparent 60%),
        linear-gradient(180deg, #1c0a24 0%, #2d1638 100%);
    color: #e2e8f0;
    gap: var(--s-3);
}
.player-locked svg {
    width: 48px; height: 48px;
    color: var(--c-amber-500);
    margin-bottom: var(--s-2);
}
.player-locked h2 { color: white; margin: 0; font-size: 1.25rem; }
.player-locked p { color: #cbd5e1; max-width: 480px; margin: 0; }

.lesson-description,
.lesson-resource,
.lesson-actions { margin-top: var(--s-6); }
.lesson-description h2,
.lesson-resource h2 { font-size: 1.05rem; margin-bottom: var(--s-3); }

/* ----- Pager entre leçons ------------------------------------------- */
.lesson-pager {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--s-4);
    margin-top: var(--s-10);
    padding-top: var(--s-6);
    border-top: 1px solid var(--c-border);
}
.pager-link {
    display: inline-flex;
    align-items: center;
    gap: var(--s-3);
    padding: var(--s-4);
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r);
    color: var(--c-text);
    font-weight: 500;
    transition: border-color var(--t), background var(--t), transform var(--t);
}
.pager-link:hover {
    border-color: var(--c-primary-200);
    background: var(--c-primary-50);
    text-decoration: none;
    transform: translateY(-1px);
}
.pager-link small {
    display: block;
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--c-text-muted);
    font-weight: 600;
    margin-bottom: 2px;
}
.pager-link svg { width: 18px; height: 18px; color: var(--c-primary-700); flex-shrink: 0; }
.pager-prev { justify-content: flex-start; }
.pager-next { justify-content: flex-end; text-align: right; }

/* =====================================================================
   Pricing (tarifs)
   ===================================================================== */
.pricing-header {
    text-align: center;
    margin-bottom: var(--s-10);
}
.pricing-header h1 { margin: var(--s-3) 0 var(--s-3); }
.pricing-header .lead { margin: 0 auto; }

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: var(--s-5);
    max-width: 920px;
    margin: 0 auto var(--s-12);
}
.pricing-card {
    position: relative;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r-lg);
    padding: var(--s-8);
    box-shadow: var(--sh-xs);
    display: flex;
    flex-direction: column;
    gap: var(--s-5);
    transition: transform var(--t), box-shadow var(--t);
}
.pricing-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--sh);
}
.pricing-card--featured {
    border-color: var(--c-primary-500);
    box-shadow: 0 0 0 3px var(--c-primary-50), var(--sh);
}
.pricing-badge {
    position: absolute;
    top: -12px; left: 50%;
    transform: translateX(-50%);
    background: var(--c-primary-700);
    color: white;
    padding: 4px 14px;
    border-radius: var(--r-pill);
    font-size: .72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    box-shadow: var(--sh-sm);
}
.pricing-card header h2 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--c-text-2);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
}
.pricing-price {
    margin: var(--s-3) 0 4px;
    line-height: 1;
}
.pricing-price .amount {
    font-size: 2.75rem;
    font-weight: 700;
    color: var(--c-primary-800);
    letter-spacing: -0.02em;
}
.pricing-price .period {
    color: var(--c-text-muted);
    font-size: 1rem;
    margin-left: 4px;
}
.pricing-tagline {
    margin: 0;
    color: var(--c-text-muted);
    font-size: .92rem;
}
.pricing-features {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: var(--s-2);
    flex: 1;
}
.pricing-features li {
    position: relative;
    padding-left: 24px;
    color: var(--c-text);
    font-size: .94rem;
    margin: 0;
}
.pricing-features li::before {
    content: '';
    position: absolute;
    left: 0; top: 6px;
    width: 16px; height: 16px;
    background: var(--c-mint-100);
    border-radius: 50%;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2314b8a6' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'/></svg>");
    background-size: 11px 11px;
    background-position: center;
    background-repeat: no-repeat;
}
.pricing-card .btn { width: 100%; }
.pricing-card form { margin: 0; }
.pricing-card button[disabled] { opacity: .6; cursor: not-allowed; }

.pricing-faq {
    max-width: 720px;
    margin: var(--s-10) auto 0;
}
.pricing-faq h2 {
    text-align: center;
    margin-bottom: var(--s-5);
}
.pricing-faq details {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r);
    padding: var(--s-3) var(--s-4);
    margin-bottom: var(--s-2);
}
.pricing-faq summary {
    cursor: pointer;
    font-weight: 500;
    color: var(--c-text);
}
.pricing-faq details[open] summary { color: var(--c-primary-700); }
.pricing-faq details p { margin: var(--s-3) 0 0; color: var(--c-text-muted); font-size: .92rem; }

/* =====================================================================
   Admin (réglages)
   ===================================================================== */
.admin-page { max-width: 760px; margin: 0 auto; }
.admin-header { margin-bottom: var(--s-6); }
.admin-header h1 { margin-bottom: var(--s-3); }

.settings-form fieldset {
    border: 1px solid var(--c-border);
    border-radius: var(--r-lg);
    padding: var(--s-6);
    background: var(--c-surface);
    margin: 0;
}
.settings-form legend {
    padding: 0 var(--s-3);
    font-weight: 600;
    color: var(--c-primary-700);
    font-size: 1rem;
}
.settings-form .form-group { margin-bottom: var(--s-5); }
.settings-form .form-group:last-child { margin-bottom: 0; }
.settings-form input { font-family: var(--font-mono); font-size: .88rem; }

.code-block {
    display: block;
    padding: var(--s-3) var(--s-4);
    background: var(--c-text);
    color: var(--c-primary-300);
    border-radius: var(--r-sm);
    font-family: var(--font-mono);
    font-size: .85rem;
    word-break: break-all;
    user-select: all;
}

.profile-status { margin-bottom: var(--s-4); }

/* =====================================================================
   Communauté (feed, posts, commentaires)
   ===================================================================== */
.community-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--s-5);
    margin-bottom: var(--s-6);
}
.community-header h1 { margin: 0 0 var(--s-2); }
.community-header .lead { margin: 0; }

.community-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--s-4);
    margin-bottom: var(--s-5);
    flex-wrap: wrap;
}
.cat-pills {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s-2);
}
.cat-pill {
    padding: 6px 14px;
    border-radius: var(--r-pill);
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    color: var(--c-text-2);
    font-size: .88rem;
    font-weight: 500;
    transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast);
}
.cat-pill:hover { border-color: var(--c-primary-200); color: var(--c-primary-700); text-decoration: none; }
.cat-pill.is-active {
    background: var(--c-primary-700);
    border-color: var(--c-primary-700);
    color: white;
}
.cat-pill.is-active:hover { color: white; }

.sort-switch {
    display: inline-flex;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r-pill);
    padding: 3px;
}
.sort-link {
    padding: 6px 14px;
    border-radius: var(--r-pill);
    color: var(--c-text-muted);
    font-size: .85rem;
    font-weight: 500;
}
.sort-link:hover { color: var(--c-primary-700); text-decoration: none; }
.sort-link.is-active {
    background: var(--c-primary-700);
    color: white;
}

/* ----- Avatar (circle initials) ------------------------------------- */
.avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px; height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--c-primary-500), var(--c-primary-700));
    color: white;
    font-size: .78rem;
    font-weight: 700;
    flex-shrink: 0;
}
.avatar-sm { width: 26px; height: 26px; font-size: .68rem; }
.avatar-lg { width: 44px; height: 44px; font-size: 1rem; }

/* ----- Liste des posts ---------------------------------------------- */
.post-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: var(--s-4);
}
.post-card {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r-lg);
    padding: var(--s-5);
    box-shadow: var(--sh-xs);
    transition: transform var(--t), box-shadow var(--t), border-color var(--t);
    margin: 0;
}
.post-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--sh);
    border-color: var(--c-primary-200);
}
.post-card.is-pinned {
    border-color: var(--c-amber-500);
    background: linear-gradient(135deg, #fffbeb 0%, var(--c-surface) 50%);
}
.post-card.is-hidden {
    opacity: 0.55;
    border-style: dashed;
}
.post-card-link {
    display: block;
    color: inherit;
}
.post-card-link:hover { text-decoration: none; }

.post-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--s-3);
    margin-bottom: var(--s-3);
    flex-wrap: wrap;
}
.post-author {
    display: flex;
    align-items: center;
    gap: var(--s-3);
    font-size: .9rem;
    color: var(--c-text-2);
}
.post-author strong { color: var(--c-text); margin-right: 6px; }
.post-card-time { color: var(--c-text-soft); font-size: .82rem; }
.cat-badge { font-size: .7rem; }

.post-card-title {
    margin: 0 0 var(--s-2);
    font-size: 1.15rem;
    color: var(--c-text);
    line-height: 1.3;
}
.post-card-excerpt {
    margin: 0;
    color: var(--c-text-muted);
    font-size: .94rem;
    line-height: 1.55;
}
.pin-icon { font-size: 0.9em; margin-right: 4px; vertical-align: middle; }

.post-card-actions {
    display: flex;
    align-items: center;
    gap: var(--s-3);
    margin-top: var(--s-4);
    padding-top: var(--s-3);
    border-top: 1px solid var(--c-border);
    font-size: .88rem;
}

/* ----- Like button --------------------------------------------------- */
.like-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: transparent;
    border: 1px solid var(--c-border);
    border-radius: var(--r-pill);
    cursor: pointer;
    color: var(--c-text-muted);
    font-size: .85rem;
    font-weight: 500;
    font-family: inherit;
    transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast);
}
.like-btn:hover { border-color: var(--c-primary-300); color: var(--c-primary-700); background: var(--c-primary-50); }
.like-btn.is-liked { background: var(--c-primary-50); border-color: var(--c-primary-500); color: var(--c-primary-800); }
.like-btn svg { width: 14px; height: 14px; stroke: currentColor; fill: none; }
.like-btn.is-liked svg { fill: var(--c-primary-700); stroke: var(--c-primary-800); }
.like-btn[aria-disabled="true"] { cursor: default; opacity: .6; }

.comment-count {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--c-text-muted);
    font-size: .85rem;
}
.comment-count svg { width: 14px; height: 14px; }

/* ----- Pager -------------------------------------------------------- */
.pager {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: var(--s-6);
    padding-top: var(--s-5);
    border-top: 1px solid var(--c-border);
}
.pager-info { color: var(--c-text-muted); font-size: .88rem; }

/* ----- Page détail post --------------------------------------------- */
.post-detail {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r-lg);
    padding: var(--s-8);
    box-shadow: var(--sh-xs);
    margin-bottom: var(--s-6);
}
.post-detail.is-hidden { opacity: 0.7; border-style: dashed; }
.post-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--s-4);
    margin-bottom: var(--s-5);
    flex-wrap: wrap;
}
.post-detail h1 { margin: var(--s-3) 0 var(--s-5); font-size: 1.6rem; line-height: 1.25; }
.post-body {
    line-height: 1.7;
    color: var(--c-text);
    font-size: 1rem;
}
.post-body a { word-break: break-all; }
.mention {
    color: var(--c-primary-700);
    font-weight: 500;
    background: var(--c-primary-50);
    padding: 0 4px;
    border-radius: 3px;
}
.post-detail-actions {
    display: flex;
    align-items: center;
    gap: var(--s-3);
    margin-top: var(--s-6);
    padding-top: var(--s-5);
    border-top: 1px solid var(--c-border);
    flex-wrap: wrap;
}

/* ----- Commentaires ------------------------------------------------- */
.comments-section h2 { font-size: 1.15rem; margin-bottom: var(--s-5); }

.comment-list {
    list-style: none;
    padding: 0;
    margin: 0 0 var(--s-6);
    display: flex;
    flex-direction: column;
    gap: var(--s-4);
}
.comment {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r);
    padding: var(--s-4);
    margin: 0;
}
.comment.depth-1 {
    margin-left: var(--s-8);
    background: var(--c-surface-2);
    border-left: 3px solid var(--c-primary-200);
}
.comment.is-hidden { opacity: 0.5; border-style: dashed; }
.comment-meta {
    display: flex;
    align-items: center;
    gap: var(--s-2);
    margin-bottom: var(--s-2);
    font-size: .9rem;
    flex-wrap: wrap;
}
.comment-meta strong { color: var(--c-text); }
.comment-body {
    color: var(--c-text);
    line-height: 1.6;
    font-size: .95rem;
}
.comment-actions {
    display: flex;
    gap: var(--s-3);
    margin-top: var(--s-2);
    font-size: .85rem;
}
.comment-actions .btn-link { padding: 0; }

.reply-form,
.comment-form {
    margin-top: var(--s-3);
    padding: var(--s-4);
    background: var(--c-surface-2);
    border: 1px solid var(--c-border);
    border-radius: var(--r);
    display: flex;
    flex-direction: column;
    gap: var(--s-3);
}
.reply-form[hidden],
.comment-form[hidden] { display: none; }
.comment-form { margin-top: var(--s-5); }
.comment-form h3 { margin: 0; font-size: 1rem; }
.reply-form textarea,
.comment-form textarea {
    width: 100%;
    padding: var(--s-3);
    border: 1px solid var(--c-border-2);
    border-radius: var(--r-sm);
    font-family: inherit;
    font-size: .95rem;
    resize: vertical;
    min-height: 80px;
}
.reply-form textarea:focus,
.comment-form textarea:focus {
    outline: none;
    border-color: var(--c-primary-500);
    box-shadow: var(--sh-glow);
}
.reply-form button,
.comment-form button { align-self: flex-start; }
.comment-empty { color: var(--c-text-muted); font-style: italic; }

/* ----- Responsive communauté --------------------------------------- */
@media (max-width: 760px) {
    .community-header { flex-direction: column; align-items: stretch; }
    .community-toolbar { flex-direction: column; align-items: stretch; gap: var(--s-3); }
    .sort-switch { align-self: flex-start; }
    .post-detail { padding: var(--s-5); }
    .comment.depth-1 { margin-left: var(--s-4); }
    .pager { flex-direction: column; gap: var(--s-3); }
}

/* =====================================================================
   Gamification (classement + badges + stats profil)
   ===================================================================== */
.leaderboard-header {
    text-align: center;
    margin-bottom: var(--s-8);
}
.leaderboard-header h1 { margin: var(--s-3) 0 var(--s-3); }

.my-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: var(--s-4);
    margin-bottom: var(--s-6);
}
.stat-card {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r-lg);
    padding: var(--s-4);
    box-shadow: var(--sh-xs);
    display: flex;
    flex-direction: column;
}
.stat-label {
    font-size: .78rem;
    color: var(--c-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
    margin-bottom: 4px;
}
.stat-value {
    font-size: 1.85rem;
    font-weight: 700;
    color: var(--c-primary-800);
    letter-spacing: -0.02em;
    line-height: 1;
}
.stat-hint { color: var(--c-text-muted); font-size: .78rem; margin-top: 4px; }

.period-tabs {
    display: inline-flex;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r-pill);
    padding: 3px;
    margin-bottom: var(--s-5);
}
.period-tab {
    padding: 8px 16px;
    border-radius: var(--r-pill);
    color: var(--c-text-muted);
    font-size: .9rem;
    font-weight: 500;
}
.period-tab:hover { color: var(--c-primary-700); text-decoration: none; }
.period-tab.is-active {
    background: var(--c-primary-700);
    color: white;
}

.leaderboard {
    list-style: none;
    padding: 0;
    margin: 0 0 var(--s-6);
    display: flex;
    flex-direction: column;
    gap: var(--s-2);
    counter-reset: lb;
}
.leaderboard-row {
    display: grid;
    grid-template-columns: 56px auto 1fr auto;
    align-items: center;
    gap: var(--s-3);
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r-lg);
    padding: var(--s-3) var(--s-4);
    box-shadow: var(--sh-xs);
    transition: transform var(--t), border-color var(--t);
    margin: 0;
}
.leaderboard-row:hover { transform: translateY(-1px); border-color: var(--c-primary-200); }
.leaderboard-row.is-me { border-color: var(--c-primary-500); background: var(--c-primary-50); }

.lb-rank {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--c-text-muted);
    text-align: center;
    line-height: 1;
}
.leaderboard-row:nth-child(1) .lb-rank,
.leaderboard-row:nth-child(2) .lb-rank,
.leaderboard-row:nth-child(3) .lb-rank { font-size: 1.8rem; }

.lb-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.lb-info strong { color: var(--c-text); }
.lb-stats { color: var(--c-text-muted); font-size: .78rem; }

.lb-points {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--c-primary-800);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.01em;
}

/* ----- Badges grid (profile) ---------------------------------------- */
.badge-grid {
    list-style: none;
    padding: 0;
    margin: var(--s-3) 0 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: var(--s-3);
}
.badge-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: var(--s-4) var(--s-2);
    background: var(--c-surface-2);
    border: 1px solid var(--c-border);
    border-radius: var(--r);
    text-align: center;
    margin: 0;
}
.badge-icon { font-size: 2rem; line-height: 1; }
.badge-name { font-weight: 600; color: var(--c-text); font-size: .88rem; }
.badge-tile small { color: var(--c-text-muted); font-size: .72rem; }

@media (max-width: 760px) {
    .leaderboard-row { grid-template-columns: 40px auto 1fr; }
    .leaderboard-row .lb-points { grid-column: 1 / -1; text-align: right; padding-top: var(--s-1); border-top: 1px solid var(--c-border); margin-top: 4px; }
    .stat-card { padding: var(--s-3); }
    .stat-value { font-size: 1.4rem; }
}

/* =====================================================================
   Cloche notifications + dropdown + page liste
   ===================================================================== */
.notif-bell { position: relative; display: inline-flex; align-items: center; }
.notif-bell-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px; height: 36px;
    background: transparent;
    border: 1px solid var(--c-border);
    border-radius: var(--r-pill);
    color: var(--c-text-2);
    cursor: pointer;
    position: relative;
    transition: background var(--t-fast), border-color var(--t-fast);
}
.notif-bell-btn:hover { background: var(--c-primary-50); border-color: var(--c-primary-200); color: var(--c-primary-700); }
.notif-bell-btn svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; }
.notif-bell-dot {
    position: absolute;
    top: -4px; right: -4px;
    min-width: 18px; height: 18px;
    padding: 0 5px;
    background: var(--c-rose-500);
    color: white;
    font-size: .68rem;
    font-weight: 700;
    border-radius: var(--r-pill);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--c-surface);
}

.notif-dropdown {
    position: fixed;
    top: calc(var(--header-h) + 4px);
    right: var(--s-4);
    width: 360px;
    max-width: calc(100vw - var(--s-6));
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r-lg);
    box-shadow: var(--sh-lg);
    z-index: 60;
    overflow: hidden;
}
@media (max-width: 760px) {
    .notif-dropdown { top: calc(var(--header-h) + 60px); }
}
.notif-dropdown header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--s-3) var(--s-4);
    border-bottom: 1px solid var(--c-border);
    background: var(--c-surface-2);
}
.notif-dropdown .notif-link { font-size: .82rem; }
.notif-dropdown-list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 400px;
    overflow-y: auto;
}
.notif-dropdown-list li {
    padding: var(--s-3) var(--s-4);
    border-bottom: 1px solid var(--c-border);
    margin: 0;
    font-size: .9rem;
}
.notif-dropdown-list li:last-child { border-bottom: 0; }
.notif-dropdown-list li a { color: var(--c-text); display: block; }
.notif-dropdown-list li a:hover { color: var(--c-primary-700); text-decoration: none; }
.notif-dropdown-list li.is-unread { background: var(--c-primary-50); }
.notif-dropdown-list li small { display: block; color: var(--c-text-soft); font-size: .72rem; margin-top: 2px; }
.notif-dropdown-empty {
    text-align: center;
    color: var(--c-text-muted);
    padding: var(--s-5) !important;
    font-style: italic;
}

.notif-list { list-style: none; padding: 0; margin: 0; }
.notif-item {
    display: flex;
    align-items: flex-start;
    gap: var(--s-3);
    padding: var(--s-4);
    border-bottom: 1px solid var(--c-border);
    margin: 0;
}
.notif-item:last-child { border-bottom: 0; }
.notif-item.is-unread { background: var(--c-primary-50); }
.notif-icon { font-size: 1.4rem; flex-shrink: 0; }
.notif-body { flex: 1; min-width: 0; }
.notif-body strong { color: var(--c-text); display: block; }
.notif-body p { margin: 4px 0 0; color: var(--c-text-muted); font-size: .9rem; }
.notif-body small { color: var(--c-text-soft); font-size: .78rem; }

/* =====================================================================
   Embed YouTube/Vimeo dans posts/leçons (responsive 16:9)
   ===================================================================== */
.post-embed {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    margin: var(--s-4) 0;
    border-radius: var(--r-sm);
    overflow: hidden;
    background: #0b1020;
    box-shadow: var(--sh);
}
.post-embed iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

/* =====================================================================
   Pages légales + RGPD + Cookie banner + Footer enrichi
   ===================================================================== */
.legal-page h2 {
    margin-top: var(--s-8);
    padding-top: var(--s-3);
    border-top: 1px solid var(--c-border);
    font-size: 1.25rem;
}
.legal-page h2:first-of-type { border-top: 0; padding-top: 0; }
.legal-page ul { line-height: 1.7; }
.legal-page code {
    background: var(--c-surface-2);
    padding: 1px 6px;
    border-radius: 3px;
    font-size: .88em;
    color: var(--c-primary-800);
}

.cookie-banner {
    position: fixed;
    bottom: var(--s-4);
    left: var(--s-4);
    right: var(--s-4);
    z-index: 100;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r-lg);
    box-shadow: var(--sh-lg);
    max-width: 720px;
    margin: 0 auto;
}
.cookie-banner-inner {
    display: flex;
    align-items: center;
    gap: var(--s-4);
    padding: var(--s-4) var(--s-5);
    flex-wrap: wrap;
}
.cookie-banner p {
    margin: 0;
    flex: 1;
    min-width: 240px;
    font-size: .9rem;
    color: var(--c-text-2);
    line-height: 1.5;
}
.cookie-banner .btn { flex-shrink: 0; }

/* Footer enrichi (grid 3 colonnes) */
.site-footer { padding: var(--s-10) 0 var(--s-6); text-align: left; }
.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: var(--s-8);
    margin-bottom: var(--s-6);
}
.footer-grid h4 {
    color: white;
    font-size: .82rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 0 0 var(--s-3);
}
.footer-grid a {
    display: block;
    color: #cbd5e1;
    font-size: .9rem;
    margin-bottom: 6px;
}
.footer-grid a:hover { color: white; }
.footer-grid strong { color: white; font-size: 1rem; }
.footer-grid p { color: #94a3b8; font-size: .88rem; line-height: 1.5; }
.footer-copy {
    text-align: center;
    color: #64748b;
    font-size: .82rem;
    padding-top: var(--s-4);
    border-top: 1px solid #1e293b;
    margin: 0;
}

@media (max-width: 760px) {
    .footer-grid { grid-template-columns: 1fr; gap: var(--s-5); }
    .cookie-banner { left: var(--s-2); right: var(--s-2); bottom: var(--s-2); }
    .cookie-banner-inner { padding: var(--s-3); }
}

/* =====================================================================
   Admin dashboard
   ===================================================================== */
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: var(--s-4);
    margin-bottom: var(--s-6);
    flex-wrap: wrap;
    padding-bottom: var(--s-4);
    border-bottom: 1px solid var(--c-border);
}
.admin-subnav {
    display: flex;
    gap: var(--s-2);
    flex-wrap: wrap;
}
.admin-subnav a {
    padding: 8px 14px;
    border-radius: var(--r-pill);
    color: var(--c-text-2);
    font-weight: 500;
    font-size: .9rem;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
}
.admin-subnav a:hover { color: var(--c-primary-700); border-color: var(--c-primary-200); text-decoration: none; }
.admin-subnav a.is-active {
    background: var(--c-primary-700);
    color: white;
    border-color: var(--c-primary-700);
}

.admin-stats h2,
.admin-quick-actions h2 {
    font-size: 1rem;
    color: var(--c-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: var(--s-6) 0 var(--s-3);
    font-weight: 600;
}
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--s-3);
}
.stat-card.big .stat-value { font-size: 2.4rem; }

.admin-toolbar {
    display: flex;
    gap: var(--s-3);
    align-items: center;
    margin-bottom: var(--s-4);
    flex-wrap: wrap;
}

.actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: var(--s-3);
}
.action-tile {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: var(--s-5);
    text-decoration: none;
    color: var(--c-text);
    border-radius: var(--r);
    transition: transform var(--t), border-color var(--t);
}
.action-tile:hover { transform: translateY(-2px); border-color: var(--c-primary-200); text-decoration: none; }
.action-tile strong { color: var(--c-text); font-size: 1rem; }
.action-tile small { color: var(--c-text-muted); font-size: .85rem; }

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .9rem;
}
.admin-table thead th {
    text-align: left;
    padding: var(--s-3) var(--s-4);
    background: var(--c-surface-2);
    border-bottom: 1px solid var(--c-border);
    font-weight: 600;
    color: var(--c-text-muted);
    font-size: .82rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.admin-table tbody td {
    padding: var(--s-3) var(--s-4);
    border-bottom: 1px solid var(--c-border);
}
.admin-table tbody tr:hover { background: var(--c-primary-50); }
.admin-table tbody tr:last-child td { border-bottom: 0; }

/* ----- Sortable (drag-and-drop modules + leçons) -------------------- */
[data-sortable] [data-sortable-item] {
    transition: background var(--t-fast), opacity var(--t-fast), transform var(--t-fast);
}
[data-sortable] [data-sortable-item].is-dragging {
    opacity: .35;
    background: var(--c-primary-50);
}
[data-sortable] [data-sortable-handle] {
    cursor: grab;
    user-select: none;
    color: var(--c-text-soft);
    padding: 2px 6px;
    border-radius: var(--r-xs);
    line-height: 1;
}
[data-sortable] [data-sortable-handle]:hover {
    color: var(--c-text);
    background: var(--c-surface-2);
}
[data-sortable].is-saving { outline: 2px solid var(--c-amber-500); outline-offset: 2px; border-radius: var(--r-sm); }
[data-sortable].is-saved  { outline: 2px solid var(--c-mint-500); outline-offset: 2px; border-radius: var(--r-sm); }
[data-sortable].is-error  { outline: 2px solid var(--c-rose-500); outline-offset: 2px; border-radius: var(--r-sm); }

.admin-stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: var(--s-3);
    margin-bottom: var(--s-4);
}
.admin-stat {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r-sm);
    padding: var(--s-3) var(--s-4);
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.admin-stat-label {
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--c-text-muted);
    font-weight: 600;
}
.admin-stat-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--c-text);
    font-variant-numeric: tabular-nums;
}
.admin-stat-hint { font-size: .8rem; color: var(--c-text-soft); }

/* =====================================================================
   Bibliothèque PDF
   ===================================================================== */
.resources-header { text-align: center; margin-bottom: var(--s-6); }
.resources-header h1 { margin: var(--s-3) 0 var(--s-3); }

.resources-search {
    display: flex;
    gap: var(--s-2);
    max-width: 640px;
    margin: 0 auto var(--s-5);
}
.resources-search input {
    flex: 1;
    padding: 11px 14px;
    border: 1px solid var(--c-border-2);
    border-radius: var(--r-sm);
    font: inherit;
}
.resources-search input:focus {
    outline: none;
    border-color: var(--c-primary-500);
    box-shadow: var(--sh-glow);
}

.resources-toolbar {
    display: flex;
    flex-direction: column;
    gap: var(--s-3);
    margin-bottom: var(--s-5);
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r);
    padding: var(--s-4);
    box-shadow: var(--sh-xs);
}
.resources-toolbar > div { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.resources-toolbar strong {
    color: var(--c-text-muted);
    font-size: .82rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-right: var(--s-2);
}

.resources-grid {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: var(--s-4);
}
.resource-card {
    display: grid;
    grid-template-columns: 80px 1fr;
    gap: var(--s-4);
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r-lg);
    padding: var(--s-5);
    box-shadow: var(--sh-xs);
    transition: transform var(--t), border-color var(--t);
    margin: 0;
}
.resource-card:hover { transform: translateY(-2px); border-color: var(--c-primary-200); }
.resource-card.is-locked { background: linear-gradient(135deg, #fef3c7 0%, var(--c-surface) 50%); }

.resource-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--c-primary-700), var(--c-primary-900));
    color: white;
    border-radius: var(--r-sm);
    padding: var(--s-3);
    text-align: center;
}
.resource-icon svg { width: 32px; height: 32px; stroke: currentColor; fill: none; }
.resource-ext { font-size: .68rem; font-weight: 700; letter-spacing: 0.08em; margin-top: 4px; opacity: 0.85; }

.resource-body { display: flex; flex-direction: column; gap: var(--s-2); }
.resource-body h3 { margin: 0; font-size: 1.05rem; line-height: 1.3; }
.resource-body h3 a { color: var(--c-text); }
.resource-body h3 a:hover { color: var(--c-primary-700); }
.resource-meta { display: flex; gap: 6px; flex-wrap: wrap; }
.resource-excerpt { color: var(--c-text-muted); font-size: .9rem; line-height: 1.5; margin: 0; }
.resource-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: var(--s-2);
    gap: var(--s-2);
    flex-wrap: wrap;
}
.resource-footer small { color: var(--c-text-muted); font-size: .82rem; }

.resource-detail { padding: var(--s-8); }
.resource-detail h1 { margin: var(--s-3) 0 var(--s-4); }
.resource-description { line-height: 1.7; margin-bottom: var(--s-5); color: var(--c-text-2); }
.resource-stats {
    display: flex;
    gap: var(--s-5);
    padding: var(--s-3) 0;
    border-top: 1px solid var(--c-border);
    border-bottom: 1px solid var(--c-border);
    color: var(--c-text-muted);
    font-size: .9rem;
}

@media (max-width: 760px) {
    .resources-grid { grid-template-columns: 1fr; }
    .resource-card { grid-template-columns: 60px 1fr; padding: var(--s-4); }
    .resource-detail { padding: var(--s-5); }
}

/* =====================================================================
   Certifications + Cas clients
   ===================================================================== */
.certif-header,
.cases-header {
    text-align: center;
    margin-bottom: var(--s-8);
}
.certif-header h1, .cases-header h1 { margin: var(--s-3) 0 var(--s-3); }
.cases-header { display: flex; flex-direction: column; align-items: center; gap: var(--s-3); }
.cases-header .lead { max-width: 60ch; }

.directory-grid {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: var(--s-4);
}
.directory-card {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: var(--s-4);
    align-items: flex-start;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r-lg);
    padding: var(--s-5);
    box-shadow: var(--sh-xs);
    margin: 0;
}
.directory-card h3 { margin: 0 0 var(--s-2); font-size: 1.05rem; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.directory-city { color: var(--c-text-muted); font-size: .88rem; margin: 0 0 var(--s-2); }
.directory-bio { color: var(--c-text-2); font-size: .9rem; line-height: 1.5; margin: 0 0 var(--s-2); }
.directory-certs { color: var(--c-text-muted); font-size: .82rem; margin: 0; line-height: 1.5; }

.certif-list {
    list-style: none;
    padding: 0;
    margin: var(--s-3) 0 0;
    display: flex;
    flex-direction: column;
    gap: var(--s-2);
}
.certif-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--s-3);
    padding: var(--s-3);
    background: var(--c-surface-2);
    border-radius: var(--r-sm);
    border: 1px solid var(--c-border);
    margin: 0;
}
.certif-item small { display: block; color: var(--c-text-muted); font-size: .8rem; }

.cases-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: var(--s-3);
}
.case-card {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r-lg);
    padding: var(--s-5);
    box-shadow: var(--sh-xs);
    transition: transform var(--t), border-color var(--t);
    margin: 0;
}
.case-card:hover { transform: translateY(-1px); border-color: var(--c-amber-500); }
.case-card.is-hidden { opacity: 0.6; border-style: dashed; }
.case-card a { color: inherit; }
.case-card a:hover { text-decoration: none; }
.case-card h3 { margin: var(--s-2) 0 var(--s-2); font-size: 1.05rem; color: var(--c-text); }
.case-meta { display: flex; gap: var(--s-2); flex-wrap: wrap; }
.case-excerpt { color: var(--c-text-muted); font-size: .9rem; line-height: 1.5; margin: 0 0 var(--s-2); }
.case-author { color: var(--c-text-soft); font-size: .8rem; }

.case-detail { padding: var(--s-8); }
.case-detail-header { margin-bottom: var(--s-5); }
.case-body { line-height: 1.7; }

/* =====================================================================
   Chat / Messagerie premium
   ===================================================================== */
.nav-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    margin-left: 4px;
    border-radius: var(--r-pill);
    background: var(--c-rose-500);
    color: white;
    font-size: .7rem;
    font-weight: 700;
}

.chat-app {
    display: grid;
    grid-template-columns: 320px 1fr;
    height: calc(100vh - var(--header-h) - 80px);
    min-height: 540px;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r-lg);
    overflow: hidden;
    box-shadow: var(--sh-sm);
}

.chat-sidebar {
    border-right: 1px solid var(--c-border);
    display: flex;
    flex-direction: column;
    background: var(--c-surface-2);
    min-width: 0;
}
.chat-sidebar-header {
    padding: var(--s-4) var(--s-5);
    border-bottom: 1px solid var(--c-border);
    background: var(--c-surface);
}
.chat-sidebar-header h1 { margin: 0; font-size: 1.1rem; }

.chat-list {
    list-style: none;
    padding: 0;
    margin: 0;
    overflow-y: auto;
    flex: 1;
}
.chat-list li { margin: 0; }
.chat-list-item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: var(--s-3);
    align-items: center;
    padding: var(--s-3) var(--s-4);
    border-bottom: 1px solid var(--c-border);
    color: var(--c-text);
    transition: background var(--t-fast);
}
.chat-list-item:hover { background: var(--c-primary-50); text-decoration: none; }
.chat-list-item.is-active {
    background: var(--c-primary-50);
    border-left: 3px solid var(--c-primary-700);
    padding-left: calc(var(--s-4) - 3px);
}
.chat-list-item.has-unread strong { color: var(--c-primary-800); }
.chat-list-meta { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.chat-list-meta strong {
    font-size: .92rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
}
.chat-list-preview {
    color: var(--c-text-muted);
    font-size: .82rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.chat-list-time { color: var(--c-text-soft); font-size: .72rem; }
.chat-unread-pill {
    background: var(--c-primary-700);
    color: white;
    font-size: .72rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: var(--r-pill);
    min-width: 22px;
    text-align: center;
}

.chat-thread {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.chat-thread-header {
    display: flex;
    align-items: center;
    gap: var(--s-3);
    padding: var(--s-4) var(--s-5);
    border-bottom: 1px solid var(--c-border);
    background: var(--c-surface);
}
.chat-thread-header strong { display: inline-flex; align-items: center; gap: 6px; }

.chat-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: var(--s-8);
    color: var(--c-text-muted);
}
.chat-empty h2 { color: var(--c-text); }
.chat-empty-hint { font-size: .9rem; }

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: var(--s-5);
    background: var(--c-bg);
    display: flex;
    flex-direction: column;
    gap: var(--s-3);
}

.msg {
    display: flex;
    align-items: flex-end;
    gap: var(--s-2);
    max-width: 75%;
}
.msg-them { align-self: flex-start; }
.msg-mine { align-self: flex-end; flex-direction: row-reverse; }

.msg-bubble {
    padding: 10px 14px;
    border-radius: 14px;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    box-shadow: var(--sh-xs);
}
.msg-mine .msg-bubble {
    background: var(--c-primary-700);
    color: white;
    border-color: var(--c-primary-700);
    border-bottom-right-radius: 4px;
}
.msg-them .msg-bubble { border-bottom-left-radius: 4px; }
.msg-body { line-height: 1.45; word-wrap: break-word; font-size: .94rem; }
.msg-time {
    font-size: .68rem;
    margin-top: 4px;
    opacity: 0.75;
    text-align: right;
}
.msg-mine .msg-time { color: rgba(255,255,255,0.85); }
.msg-them .msg-time { color: var(--c-text-muted); }

.chat-form {
    display: flex;
    gap: var(--s-2);
    padding: var(--s-3) var(--s-4);
    border-top: 1px solid var(--c-border);
    background: var(--c-surface);
}
.chat-form textarea {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid var(--c-border-2);
    border-radius: var(--r-sm);
    font-family: inherit;
    font-size: .95rem;
    resize: none;
    min-height: 44px;
    max-height: 160px;
    line-height: 1.4;
}
.chat-form textarea:focus {
    outline: none;
    border-color: var(--c-primary-500);
    box-shadow: var(--sh-glow);
}
.chat-form button { align-self: flex-end; }

@media (max-width: 760px) {
    .chat-app {
        grid-template-columns: 1fr;
        height: auto;
        min-height: auto;
    }
    .chat-sidebar {
        max-height: 240px;
        border-right: 0;
        border-bottom: 1px solid var(--c-border);
    }
    .msg { max-width: 90%; }
}

/* =====================================================================
   Agenda / Événements
   ===================================================================== */
.events-header {
    text-align: center;
    margin-bottom: var(--s-8);
}
.events-header h1 { margin: var(--s-3) 0 var(--s-3); }

.calendar-widget {
    margin-bottom: var(--s-8);
    padding: var(--s-5) var(--s-6);
}
.calendar-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--s-3);
    margin-bottom: var(--s-4);
}
.calendar-nav h2 { margin: 0; font-size: 1.15rem; }

.calendar { width: 100%; border-collapse: collapse; }
.calendar th {
    padding: 6px 4px;
    font-size: .72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--c-text-muted);
    text-align: center;
    border-bottom: 1px solid var(--c-border);
}
.calendar td {
    width: 14.28%;
    height: 80px;
    vertical-align: top;
    padding: 4px;
    border: 1px solid var(--c-border);
    background: var(--c-surface);
    position: relative;
}
.calendar td.empty { background: transparent; border-color: transparent; }
.calendar td.has-events { background: var(--c-primary-50); }
.calendar td.is-today {
    border-color: var(--c-primary-500);
    box-shadow: inset 0 0 0 1px var(--c-primary-500);
}
.day-num {
    display: block;
    font-size: .78rem;
    color: var(--c-text-muted);
    text-align: right;
    margin-bottom: 2px;
}
.calendar td.is-today .day-num {
    color: var(--c-primary-700);
    font-weight: 700;
}
.event-pill {
    display: block;
    padding: 2px 6px;
    margin-bottom: 2px;
    border-radius: 3px;
    font-size: .68rem;
    background: var(--c-primary-700);
    color: white;
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.event-pill:hover { background: var(--c-primary-800); color: white; text-decoration: none; }
.event-pill.premium { background: var(--c-amber-500); }
.event-pill.premium:hover { background: var(--c-amber-700); }
.event-more { font-size: .65rem; color: var(--c-text-muted); padding-left: 4px; }

.events-list-section { margin-top: var(--s-8); }
.events-list-section h2 { margin-bottom: var(--s-4); }

.events-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: var(--s-3);
}
.event-card {
    display: grid;
    grid-template-columns: 88px 1fr;
    gap: var(--s-4);
    align-items: center;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r-lg);
    padding: var(--s-4);
    box-shadow: var(--sh-xs);
    transition: transform var(--t), border-color var(--t);
    margin: 0;
}
.event-card:hover { transform: translateY(-1px); border-color: var(--c-primary-200); }
.event-card.is-past { opacity: 0.75; }
.event-card.is-locked { background: linear-gradient(135deg, #fef3c7 0%, var(--c-surface) 100%); }

.event-date {
    text-align: center;
    background: var(--c-primary-50);
    border: 1px solid var(--c-primary-200);
    border-radius: var(--r-sm);
    padding: var(--s-2);
    color: var(--c-primary-800);
}
.event-day { display: block; font-size: 1.5rem; font-weight: 700; line-height: 1; }
.event-month { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--c-text-muted); margin-top: 2px; }
.event-time { display: block; font-size: .82rem; color: var(--c-primary-700); margin-top: 4px; font-weight: 600; }

.event-body h3 { margin: 0 0 var(--s-2); font-size: 1.1rem; }
.event-body h3 a { color: var(--c-text); }
.event-body h3 a:hover { color: var(--c-primary-700); }
.event-meta { display: flex; gap: var(--s-2); flex-wrap: wrap; }

.event-detail { padding: var(--s-8); }
.event-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--s-4);
    margin-bottom: var(--s-5);
    flex-wrap: wrap;
}
.event-when { font-size: 1.05rem; color: var(--c-text-2); margin: 0; }
.event-when strong { color: var(--c-primary-800); display: block; }

.event-description { margin: var(--s-5) 0; line-height: 1.7; }

.event-rsvp {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--s-4);
    padding: var(--s-5);
    background: var(--c-primary-50);
    border: 1px solid var(--c-primary-200);
    border-radius: var(--r-lg);
    margin-top: var(--s-5);
    flex-wrap: wrap;
}
.event-location { margin: 8px 0 0; font-size: .92rem; }
.event-location small { color: var(--c-text-muted); display: block; margin-top: 2px; }
.event-replay { margin-top: var(--s-6); padding-top: var(--s-5); border-top: 1px solid var(--c-border); }
.event-replay h2 { font-size: 1.05rem; }

@media (max-width: 760px) {
    .calendar td { height: 60px; }
    .event-pill { font-size: .6rem; padding: 1px 4px; }
    .event-card { grid-template-columns: 70px 1fr; }
    .event-detail { padding: var(--s-5); }
    .event-detail-header { flex-direction: column; }
    .event-rsvp { flex-direction: column; align-items: stretch; }
}

/* ----- Responsive classroom ---------------------------------------- */
@media (max-width: 760px) {
    .classroom-header { margin-bottom: var(--s-6); }
    .program-grid { grid-template-columns: 1fr; gap: var(--s-4); }
    .program-hero { padding: var(--s-5); }
    .module-card { padding: var(--s-5); }
    .lesson-link { grid-template-columns: auto 1fr; gap: var(--s-3); }
    .lesson-duration { grid-column: 2; padding-left: 0; }
    .upsell { flex-direction: column; text-align: center; }
    .lesson-pager { grid-template-columns: 1fr; }
    .pager-next { justify-content: flex-start; text-align: left; }
}
