/* =====================================================================
   EDC Maroc — Site public
   Identité : cartes colorées par matière, motif géométrique marocain,
   typographie Plus Jakarta Sans + IBM Plex Sans Arabic.
   ===================================================================== */

:root {
    --primary: #4338CA;
    --primary-rgb: 67, 56, 202;
    --accent: var(--primary);
    --accent-rgb: var(--primary-rgb);

    --bg: #F5F6FA;
    --surface: #FFFFFF;
    --surface-2: #F4F5F9;
    --surface-3: #ECEEF5;
    --text: #0F172A;
    --text-2: #334155;
    --muted: #64748B;
    --border: #E5E8F0;
    --border-strong: #D3D8E3;

    --radius-sm: 8px;
    --radius: 14px;
    --radius-lg: 18px;
    --radius-xl: 26px;

    --shadow-xs: 0 1px 2px rgba(15, 23, 42, .05);
    --shadow-sm: 0 1px 3px rgba(15, 23, 42, .06), 0 1px 2px rgba(15, 23, 42, .04);
    --shadow: 0 6px 18px -6px rgba(15, 23, 42, .10), 0 2px 6px -2px rgba(15, 23, 42, .05);
    --shadow-lg: 0 22px 44px -16px rgba(15, 23, 42, .22), 0 8px 16px -8px rgba(15, 23, 42, .08);

    --font: 'Plus Jakarta Sans', 'IBM Plex Sans Arabic', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --font-ar: 'IBM Plex Sans Arabic', 'Plus Jakarta Sans', 'Segoe UI', Tahoma, sans-serif;

    --container: 1200px;
    --header-h: 72px;

    --pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64' viewBox='0 0 64 64'%3E%3Cg fill='none' stroke='%23fff' stroke-width='1.1'%3E%3Crect x='21' y='21' width='22' height='22'/%3E%3Crect x='21' y='21' width='22' height='22' transform='rotate(45 32 32)'/%3E%3Ccircle cx='32' cy='32' r='5'/%3E%3Cpath d='M0 0l10 10M64 0L54 10M0 64l10-10M64 64L54 54'/%3E%3C/g%3E%3C/svg%3E");
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
img, video { max-width: 100%; }
a { color: var(--primary); }
h1, h2, h3, h4 { line-height: 1.25; }
button, input, select, textarea { font: inherit; }
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 20px; }
.container-narrow { max-width: 900px; }
.ar { font-family: var(--font-ar); unicode-bidi: isolate; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: -9999px; top: 12px; z-index: 100; background: #fff; color: var(--text); padding: 10px 14px; border-radius: 10px; box-shadow: var(--shadow); }
.skip-link:focus { left: 16px; }
:focus-visible { outline: 3px solid rgba(var(--primary-rgb), .45); outline-offset: 2px; border-radius: 6px; }

/* ---------- Boutons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 10px 18px; border-radius: 12px; border: 1px solid transparent;
    font-weight: 600; font-size: 14.5px; line-height: 1.2; white-space: nowrap;
    text-decoration: none; cursor: pointer; transition: background .15s, box-shadow .15s, border-color .15s, transform .15s, filter .15s;
}
.btn:active { transform: translateY(1px); }
.btn-sm { padding: 7px 12px; font-size: 13.5px; border-radius: 10px; gap: 6px; }
.btn-block { width: 100%; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { filter: brightness(1.08); box-shadow: 0 8px 18px -8px rgba(var(--primary-rgb), .7); }
.btn-ghost { background: var(--surface); color: var(--text-2); border-color: var(--border); }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--border-strong); color: var(--text); }
.btn-pdf { background: #DC2626; color: #fff; }
.btn-pdf:hover { background: #B91C1C; box-shadow: 0 8px 18px -8px rgba(220, 38, 38, .6); }
.btn-success { background: #16A34A; color: #fff; }
.btn-success:hover { background: #15803D; box-shadow: 0 8px 18px -8px rgba(22, 163, 74, .6); }

/* ---------- En-tête ---------- */
.site-header {
    position: sticky; top: 0; z-index: 50;
    background: rgba(255, 255, 255, .88);
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid var(--border);
}
.header-inner { height: var(--header-h); display: flex; align-items: center; gap: 18px; }
.brand { display: flex; align-items: center; gap: 11px; color: var(--text); text-decoration: none; flex: none; }
.brand-mark { display: inline-flex; color: var(--primary); filter: drop-shadow(0 4px 8px rgba(var(--primary-rgb), .3)); }
.brand-text strong { display: block; font-size: 17px; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; }
.brand-text small { display: block; font-size: 11.5px; color: var(--muted); max-width: 210px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.main-nav { display: flex; align-items: center; gap: 2px; }
.nav-link {
    display: inline-flex; align-items: center; gap: 6px; padding: 9px 12px; border: 0; border-radius: 10px;
    background: none; color: var(--text-2); font-weight: 600; font-size: 14.5px; text-decoration: none; cursor: pointer;
}
.nav-link:hover, .nav-link.active { background: var(--surface-2); color: var(--text); }
.nav-caret { font-size: 12px; transition: transform .2s; }
.nav-item { position: relative; }
.mega-menu {
    position: absolute; top: calc(100% + 10px); left: -8px; z-index: 60; width: 580px;
    display: grid; grid-template-columns: 1fr 1fr; gap: 2px; padding: 10px;
    background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow-lg);
    opacity: 0; visibility: hidden; transform: translateY(6px); transition: opacity .18s, transform .18s, visibility .18s;
}
.mega-menu::before { content: ''; position: absolute; left: 0; right: 0; top: -14px; height: 14px; }
.has-menu:hover .mega-menu, .has-menu.open .mega-menu { opacity: 1; visibility: visible; transform: none; }
.has-menu:hover .nav-caret, .has-menu.open .nav-caret { transform: rotate(180deg); }
.mega-menu a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 11px; color: var(--text-2); font-weight: 600; font-size: 14px; text-decoration: none; }
.mega-menu a:hover { background: var(--surface-2); color: var(--text); }
.mm-icon { width: 34px; height: 34px; flex: none; display: grid; place-items: center; border-radius: 10px; color: var(--c); background: rgba(0, 0, 0, .04); background: color-mix(in srgb, var(--c) 13%, white); }

.header-search { position: relative; margin-left: auto; flex: 0 1 340px; }
.header-search input {
    width: 100%; height: 42px; padding: 0 14px 0 40px; border: 1px solid var(--border); border-radius: 12px;
    background: var(--surface-2); color: var(--text); font-size: 14px; transition: border-color .15s, box-shadow .15s, background .15s;
}
.header-search input:focus { outline: none; background: #fff; border-color: rgba(var(--primary-rgb), .5); box-shadow: 0 0 0 4px rgba(var(--primary-rgb), .12); }
.search-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.nav-toggle { display: none; }

/* Suggestions de recherche */
.suggest-box {
    position: absolute; top: calc(100% + 8px); left: 0; right: 0; z-index: 70; min-width: 300px; max-height: 440px; overflow: auto;
    padding: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); text-align: left;
}
.suggest-box a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; color: var(--text); text-decoration: none; }
.suggest-box a:hover, .suggest-box a.active { background: var(--surface-2); }
.s-icon { width: 32px; height: 32px; flex: none; display: grid; place-items: center; border-radius: 9px; color: var(--c); background: color-mix(in srgb, var(--c) 13%, white); }
.s-text { min-width: 0; }
.s-text strong { display: block; font-size: 14px; font-weight: 600; }
.s-text small { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.suggest-box .s-all { justify-content: center; color: var(--primary); font-weight: 600; font-size: 13.5px; }
.suggest-box .s-empty { padding: 12px; color: var(--muted); font-size: 14px; text-align: center; }

/* ---------- Motif marocain ---------- */
.hero-pattern {
    position: absolute; inset: 0; pointer-events: none;
    background-image: var(--pattern); background-size: 64px 64px; opacity: .11;
    -webkit-mask-image: linear-gradient(115deg, transparent 20%, #000 75%);
    mask-image: linear-gradient(115deg, transparent 20%, #000 75%);
}

/* ---------- Accueil ---------- */
.home-hero {
    position: relative; overflow: hidden; color: #fff; padding: 72px 0 88px;
    background: var(--primary);
    background:
        radial-gradient(900px 420px at 88% -10%, rgba(255, 255, 255, .16), transparent 60%),
        radial-gradient(700px 380px at -5% 110%, rgba(168, 85, 247, .35), transparent 60%),
        linear-gradient(135deg, var(--primary) 0%, color-mix(in srgb, var(--primary) 58%, #0B1020) 100%);
}
.home-hero-inner { position: relative; display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 48px; align-items: center; }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 999px; background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .24); font-size: 13px; font-weight: 600; }
.home-hero h1 { margin: 18px 0 16px; font-size: clamp(32px, 4.6vw, 54px); font-weight: 800; line-height: 1.07; letter-spacing: -.035em; }
.home-hero-text > p { margin: 0 0 28px; max-width: 600px; font-size: 18px; opacity: .9; }
.hero-search {
    position: relative; display: flex; align-items: center; gap: 8px; max-width: 640px;
    padding: 7px 7px 7px 16px; background: #fff; border-radius: 16px; box-shadow: 0 22px 44px -18px rgba(0, 0, 0, .45);
}
.hero-search > i { color: var(--muted); font-size: 18px; }
.hero-search input { flex: 1; min-width: 0; height: 44px; border: 0; outline: none; background: transparent; color: var(--text); font-size: 16px; }
.hero-search .btn { padding: 12px 20px; }
.quick-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.quick-links a { display: inline-flex; gap: 7px; align-items: center; padding: 8px 14px; border-radius: 10px; color: #fff; font-size: 14px; font-weight: 600; text-decoration: none; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .2); transition: background .15s; }
.quick-links a:hover { background: rgba(255, 255, 255, .22); }
.home-hero-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.stat-card { position: relative; overflow: hidden; padding: 24px 22px; border-radius: 20px; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .2); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.stat-card strong { display: block; font-size: 40px; font-weight: 800; line-height: 1; letter-spacing: -.03em; }
.stat-card span { display: block; margin-top: 8px; font-size: 14px; opacity: .85; }
.stat-card > i { position: absolute; top: 16px; right: 16px; font-size: 22px; opacity: .45; }

/* ---------- Sections ---------- */
.section { padding: 56px 0; }
.section-tight { padding: 28px 0 56px; }
.section-muted { background: #EDEFF6; }
.section-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 24px; margin-bottom: 26px; }
.section-head.center { justify-content: center; text-align: center; }
.section-head h2 { margin: 4px 0 0; font-size: clamp(22px, 2.6vw, 30px); letter-spacing: -.02em; }
.section-head-sm { margin-top: 8px; margin-bottom: 18px; }
.section-head-sm h2 { font-size: 22px; }
.section-lead { margin: 0; max-width: 460px; color: var(--muted); }
.eyebrow { margin: 0; color: var(--accent); font-size: 12.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.count-badge { display: inline-grid; place-items: center; min-width: 26px; height: 24px; padding: 0 8px; margin-left: 6px; border-radius: 999px; background: rgba(var(--accent-rgb), .1); color: var(--accent); font-size: 13px; font-weight: 700; vertical-align: middle; letter-spacing: 0; }

/* ---------- Cartes matières ---------- */
.subject-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 18px; }
.subject-card {
    position: relative; isolation: isolate; overflow: hidden; display: flex; flex-direction: column; gap: 14px;
    min-height: 184px; padding: 20px; border-radius: var(--radius-lg); color: #fff; text-decoration: none;
    background: var(--c);
    background: linear-gradient(150deg, var(--c) 0%, color-mix(in srgb, var(--c) 68%, #0B1020) 100%);
    box-shadow: 0 12px 26px -14px rgba(var(--c-rgb), .8);
    transition: transform .22s ease, box-shadow .22s ease;
}
.subject-card::after { content: ''; position: absolute; inset: 0; z-index: -1; background-image: var(--pattern); background-size: 64px 64px; opacity: .08; }
.subject-card:hover { transform: translateY(-5px); box-shadow: 0 22px 38px -16px rgba(var(--c-rgb), .85); }
.subject-card-bg { position: absolute; right: -16px; bottom: -30px; z-index: -1; font-size: 128px; line-height: 1; opacity: .13; transform: rotate(-12deg); transition: transform .3s; }
.subject-card:hover .subject-card-bg { transform: rotate(-4deg) scale(1.06); }
.subject-card-icon { width: 50px; height: 50px; display: grid; place-items: center; border-radius: 15px; font-size: 23px; background: rgba(255, 255, 255, .18); border: 1px solid rgba(255, 255, 255, .28); }
.subject-card-body strong { display: block; font-size: 18px; font-weight: 700; line-height: 1.25; }
.subject-card-body .ar { display: inline-block; margin-top: 4px; font-size: 15px; opacity: .88; }
.subject-card-foot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; font-size: 13px; font-weight: 600; opacity: .95; }
.subject-card-foot i { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: rgba(255, 255, 255, .2); transition: transform .2s, background .2s; }
.subject-card:hover .subject-card-foot i { transform: translateX(3px); background: #fff; color: var(--c); }

/* ---------- Parcours en 5 étapes (accueil) ---------- */
.path-steps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; margin: 0; padding: 0; list-style: none; }
.path-steps li { position: relative; padding: 24px 16px; text-align: center; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.path-steps li > span { width: 54px; height: 54px; margin: 0 auto 12px; display: grid; place-items: center; border-radius: 16px; font-size: 23px; color: var(--primary); background: rgba(var(--primary-rgb), .1); }
.path-steps strong { display: block; font-size: 16px; }
.path-steps small { display: block; margin-top: 4px; color: var(--muted); font-size: 13px; line-height: 1.45; }
.path-steps li:not(:last-child)::after {
    content: ''; position: absolute; top: 50%; right: -12px; z-index: 1; width: 9px; height: 9px;
    border-top: 2px solid var(--border-strong); border-right: 2px solid var(--border-strong); transform: translateY(-50%) rotate(45deg);
}

/* ---------- Cartes leçons (accueil) ---------- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.lesson-card {
    position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 8px; padding: 20px 20px 20px 24px;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
    color: inherit; text-decoration: none; transition: transform .2s, box-shadow .2s;
}
.lesson-card::before { content: ''; position: absolute; top: 0; bottom: 0; left: 0; width: 4px; background: var(--c); }
.lesson-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.lesson-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.lesson-card-top small { color: var(--muted); font-size: 12.5px; }
.lesson-card strong { font-size: 17px; line-height: 1.35; }
.lesson-card p { margin: 0; color: var(--muted); font-size: 14px; }
.lesson-card-meta { margin-top: auto; padding-top: 6px; color: var(--text-2); font-size: 13px; font-weight: 600; }
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; color: var(--c, var(--accent)); background: rgba(var(--c-rgb, var(--accent-rgb)), .1); white-space: nowrap; }

/* ---------- Bandeau de page ---------- */
.page-hero {
    position: relative; overflow: hidden; padding: 28px 0 46px; color: #fff;
    background: var(--c);
    background: linear-gradient(135deg, var(--c) 0%, color-mix(in srgb, var(--c) 66%, #0B1020) 100%);
}
.page-hero .container { position: relative; }
.page-hero .eyebrow { color: rgba(255, 255, 255, .8); display: flex; align-items: center; gap: 6px; }
.page-hero h1 { margin: 4px 0 0; font-size: clamp(26px, 3.6vw, 40px); font-weight: 800; line-height: 1.15; letter-spacing: -.03em; }
.hero-head { display: flex; align-items: center; gap: 18px; }
.hero-icon { width: 66px; height: 66px; flex: none; display: grid; place-items: center; border-radius: 19px; font-size: 30px; background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .26); }
.hero-ar { display: inline-block; margin: 6px 0 0; font-family: var(--font-ar); font-size: 18px; opacity: .92; }
.hero-desc { max-width: 740px; margin: 16px 0 0; font-size: 16px; opacity: .9; }
.hero-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.chip { display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 999px; color: #fff; font-size: 14px; font-weight: 600; text-decoration: none; background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .24); transition: background .15s; }
a.chip:hover { background: rgba(255, 255, 255, .25); }
.chip-active, a.chip-active:hover { background: #fff; color: var(--c); border-color: #fff; }

.breadcrumbs ol { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 22px; padding: 0; list-style: none; font-size: 13.5px; }
.breadcrumbs li { display: flex; align-items: center; gap: 6px; }
.breadcrumbs li + li::before { content: '›'; opacity: .55; font-size: 16px; }
.breadcrumbs a { color: rgba(255, 255, 255, .82); text-decoration: none; }
.breadcrumbs a:hover { color: #fff; text-decoration: underline; }
.breadcrumbs [aria-current] { color: #fff; font-weight: 600; }

.lesson-hero-grid { display: grid; grid-template-columns: 1fr; gap: 28px; align-items: center; }
.lesson-hero-grid.has-cover { grid-template-columns: minmax(0, 1fr) 300px; }
.lesson-cover { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 18px; border: 3px solid rgba(255, 255, 255, .3); box-shadow: 0 18px 40px -16px rgba(0, 0, 0, .5); }

/* ---------- Indicateur d'étapes ---------- */
.stepper {
    display: flex; gap: 6px; margin: 0 0 34px; padding: 8px; list-style: none; overflow-x: auto; scrollbar-width: none;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
}
.stepper::-webkit-scrollbar { display: none; }
.step { flex: 1 0 auto; display: flex; align-items: center; gap: 10px; min-width: 150px; padding: 8px 12px; border-radius: 12px; }
.step > a { display: flex; align-items: center; gap: 10px; width: 100%; color: inherit; text-decoration: none; }
.step-dot { width: 30px; height: 30px; flex: none; display: grid; place-items: center; border-radius: 50%; font-size: 13px; font-weight: 700; color: var(--muted); background: var(--surface-2); border: 1px solid var(--border); }
.step-text { display: flex; flex-direction: column; max-width: 200px; overflow: hidden; font-size: 14px; font-weight: 600; line-height: 1.25; white-space: nowrap; text-overflow: ellipsis; }
.step-text small { color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; }
.step-done .step-dot { color: #fff; background: var(--accent); border-color: transparent; }
.step-done a:hover .step-text { color: var(--accent); }
.step-current { background: rgba(var(--accent-rgb), .08); }
.step-current .step-dot { color: var(--accent); background: #fff; border: 2px solid var(--accent); }
.step-current .step-text { color: var(--accent); }
.step-todo { opacity: .55; }

/* ---------- Choix niveau / filière ---------- */
.choice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 16px; }
.choice-card {
    position: relative; overflow: hidden; display: flex; align-items: center; gap: 16px; padding: 18px 20px;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
    color: inherit; text-decoration: none; transition: transform .2s, box-shadow .2s, border-color .2s;
}
.choice-card::before { content: ''; position: absolute; top: 0; bottom: 0; left: 0; width: 4px; background: var(--accent); opacity: 0; transition: opacity .2s; }
.choice-card:hover { transform: translateY(-2px); border-color: rgba(var(--accent-rgb), .4); box-shadow: var(--shadow); }
.choice-card:hover::before { opacity: 1; }
.choice-badge { width: 58px; height: 58px; flex: none; display: grid; place-items: center; border-radius: 17px; font-size: 15px; font-weight: 800; letter-spacing: -.02em; color: var(--accent); background: rgba(var(--accent-rgb), .1); }
.choice-badge-icon { font-size: 23px; }
.choice-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.choice-body strong { font-size: 16.5px; line-height: 1.3; }
.choice-body .ar { font-size: 14px; color: var(--text-2); }
.choice-body small { margin-top: 4px; color: var(--muted); font-size: 13px; }
.choice-arrow { width: 38px; height: 38px; flex: none; display: grid; place-items: center; border-radius: 50%; color: var(--muted); background: var(--surface-2); transition: all .2s; }
.choice-card:hover .choice-arrow { color: #fff; background: var(--accent); transform: translateX(3px); }

/* ---------- Sessions / semestres ---------- */
.session-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 22px; }
.session-card {
    position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: center; gap: 6px;
    padding: 40px 28px 30px; text-align: center; color: inherit; text-decoration: none;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-xl); box-shadow: var(--shadow);
    transition: transform .22s, box-shadow .22s, border-color .22s;
}
.session-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 6px; background: linear-gradient(90deg, var(--accent), rgba(var(--accent-rgb), .35)); }
.session-card:hover { transform: translateY(-5px); border-color: rgba(var(--accent-rgb), .35); box-shadow: var(--shadow-lg); }
.session-number { position: absolute; top: 12px; right: 20px; font-size: 76px; font-weight: 800; line-height: 1; color: rgba(var(--accent-rgb), .08); }
.session-ar { font-family: var(--font-ar); font-size: 30px; font-weight: 700; color: var(--accent); line-height: 1.4; }
.session-name { font-size: 21px; }
.session-desc { color: var(--muted); font-size: 14px; }
.session-stats { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 14px 0 4px; }
.session-stats span { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; font-size: 13px; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--border); }
.session-cta { display: inline-flex; align-items: center; gap: 7px; margin-top: 12px; padding: 10px 18px; border-radius: 12px; font-weight: 700; color: var(--accent); background: rgba(var(--accent-rgb), .08); transition: all .2s; }
.session-card:hover .session-cta { color: #fff; background: var(--accent); }

/* ---------- Mise en page avec barre latérale ---------- */
.layout-sidebar { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 28px; align-items: start; }
.layout-main { min-width: 0; }
.aside-card { padding: 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.aside-card + .aside-card { margin-top: 16px; }
.aside-card.sticky { position: sticky; top: calc(var(--header-h) + 16px); }
.aside-card h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; font-size: 15px; }
.info-list { margin: 0; }
.info-list div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; font-size: 14px; border-bottom: 1px dashed var(--border); }
.info-list div:last-child { border-bottom: 0; }
.info-list dt { color: var(--muted); }
.info-list dd { margin: 0; font-weight: 600; text-align: right; }
.aside-links { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; }
.aside-links a { display: block; padding: 8px 10px; border-radius: 10px; color: var(--text-2); font-size: 14px; text-decoration: none; }
.aside-links a:hover { background: var(--surface-2); color: var(--text); }
.aside-lessons { max-height: 58vh; overflow: auto; margin: 0 0 14px; padding: 0; list-style: none; }
.aside-lessons a { display: flex; gap: 10px; padding: 8px 10px; border-radius: 10px; color: var(--text-2); font-size: 14px; line-height: 1.4; text-decoration: none; }
.aside-lessons a span { width: 24px; height: 24px; flex: none; display: grid; place-items: center; border-radius: 8px; font-size: 12px; font-weight: 700; color: var(--muted); background: var(--surface-2); }
.aside-lessons a:hover { background: var(--surface-2); }
.aside-lessons .current a { background: rgba(var(--accent-rgb), .08); color: var(--accent); font-weight: 600; }
.aside-lessons .current a span { color: #fff; background: var(--accent); }

/* ---------- Accordéons ---------- */
.accordion { overflow: hidden; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.accordion + .accordion { margin-top: 16px; }
.accordion > summary { display: flex; align-items: center; gap: 14px; padding: 16px 20px; cursor: pointer; list-style: none; user-select: none; transition: background .15s; }
.accordion > summary::-webkit-details-marker { display: none; }
.accordion > summary:hover { background: var(--surface-2); }
.accordion[open] > summary { border-bottom: 1px solid var(--border); }
.acc-icon { width: 42px; height: 42px; flex: none; display: grid; place-items: center; border-radius: 12px; font-size: 19px; color: var(--sc, var(--accent)); background: rgba(var(--sc-rgb, var(--accent-rgb)), .1); }
.acc-title { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 17px; font-weight: 700; line-height: 1.3; }
.acc-title small { font-size: 13px; font-weight: 500; color: var(--muted); }
.acc-title small.ar { align-self: flex-start; font-size: 14px; }
.chev { width: 32px; height: 32px; flex: none; display: grid; place-items: center; border-radius: 50%; font-size: 15px; color: var(--muted); background: var(--surface-2); transition: transform .25s; }
details[open] > summary .chev { transform: rotate(180deg); }
.acc-body { padding: 20px 22px 24px; }
.acc-body > * + * { margin-top: 16px; }
.lesson-section { scroll-margin-top: calc(var(--header-h) + 84px); }
.lesson-section .count-badge { color: var(--sc); background: rgba(var(--sc-rgb), .1); }

/* ---------- Liste des leçons ---------- */
.lesson-list { margin: 0; padding: 8px; list-style: none; }
.lesson-row { display: flex; align-items: center; gap: 16px; padding: 14px; border-radius: 14px; color: inherit; text-decoration: none; transition: background .15s; }
.lesson-row:hover { background: rgba(var(--accent-rgb), .06); }
.lesson-num { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 12px; font-weight: 800; color: var(--accent); background: rgba(var(--accent-rgb), .1); transition: all .15s; }
.lesson-row:hover .lesson-num { color: #fff; background: var(--accent); }
.lesson-row-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.lesson-row-body strong { font-size: 16px; }
.lesson-row-body small { color: var(--muted); font-size: 14px; }
.lesson-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.lesson-badges span { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 12px; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--border); }
.lesson-row-arrow { color: var(--muted); transition: transform .15s, color .15s; }
.lesson-row:hover .lesson-row-arrow { color: var(--accent); transform: translateX(3px); }

/* ---------- Page leçon ---------- */
.lesson-context { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 0 0 20px; }
.lesson-context > div { padding: 12px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-xs); }
.lesson-context dt { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 11.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.lesson-context dt i { color: var(--accent); }
.lesson-context dd { margin: 4px 0 0; font-size: 14.5px; font-weight: 700; line-height: 1.35; }
.lesson-context a { color: inherit; text-decoration: none; }
.lesson-context a:hover { color: var(--accent); }

.section-nav {
    position: sticky; top: calc(var(--header-h) + 10px); z-index: 5; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none;
    margin-bottom: 18px; padding: 8px; background: rgba(255, 255, 255, .9); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
    border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-sm);
}
.section-nav::-webkit-scrollbar { display: none; }
.section-nav a { flex: none; display: inline-flex; align-items: center; gap: 7px; padding: 8px 12px; border-radius: 10px; color: var(--text-2); font-size: 14px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.section-nav a i { color: var(--sc); }
.section-nav a:hover, .section-nav a.active { background: var(--surface-2); color: var(--text); }
.section-nav .count { padding: 1px 7px; border-radius: 999px; font-size: 11px; color: var(--muted); background: var(--surface-3); }

.prev-next { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 28px; }
.prev-next a { display: flex; align-items: center; gap: 12px; padding: 16px 18px; color: var(--text); font-weight: 700; text-decoration: none; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; transition: border-color .15s, box-shadow .15s; }
.prev-next a small { display: block; color: var(--muted); font-size: 12.5px; font-weight: 500; }
.prev-next a > i { color: var(--accent); font-size: 18px; }
.prev-next a:hover { border-color: rgba(var(--accent-rgb), .4); box-shadow: var(--shadow-sm); }
.prev-next .next { grid-column: 2; justify-content: flex-end; text-align: right; }

/* ---------- Contenu riche (cours, énoncés, corrections) ---------- */
.rich-content { color: var(--text-2); font-size: 16.5px; line-height: 1.75; overflow-wrap: break-word; }
.rich-content > :first-child { margin-top: 0; }
.rich-content > :last-child { margin-bottom: 0; }
.rich-content h1, .rich-content h2 { margin: 1.6em 0 .6em; padding-left: 12px; font-size: 21px; color: var(--text); border-left: 4px solid var(--accent); }
.rich-content h3 { margin: 1.4em 0 .5em; font-size: 18px; color: var(--text); }
.rich-content h4 { margin: 1.2em 0 .4em; font-size: 16.5px; color: var(--text); }
.rich-content p { margin: 0 0 1em; }
.rich-content ul, .rich-content ol { margin: 0 0 1em; padding-left: 1.5em; }
.rich-content li { margin: .3em 0; }
.rich-content li::marker { color: var(--accent); font-weight: 700; }
.rich-content blockquote { margin: 1.2em 0; padding: 14px 18px; color: var(--text); background: rgba(var(--accent-rgb), .06); border-left: 4px solid var(--accent); border-radius: 0 12px 12px 0; }
.rich-content blockquote p:last-child { margin: 0; }
.rich-content table { display: block; width: max-content; max-width: 100%; overflow-x: auto; margin: 1.2em 0; border-collapse: collapse; font-size: 15px; }
.rich-content th, .rich-content td { padding: 8px 14px; text-align: center; border: 1px solid var(--border-strong); }
.rich-content th { background: var(--surface-2); font-weight: 700; color: var(--text); }
.rich-content img { max-width: 100%; height: auto; border-radius: 12px; }
.rich-content figure { margin: 1.2em 0; }
.rich-content figcaption { color: var(--muted); font-size: 14px; text-align: center; margin-top: 6px; }
.rich-content a { color: var(--accent); }
.rich-content code { padding: 2px 6px; border-radius: 6px; font-size: .9em; background: var(--surface-2); }
.rich-content pre { overflow: auto; padding: 14px 16px; border-radius: 12px; font-size: 14px; color: #E2E8F0; background: #0F172A; }
.rich-content pre code { padding: 0; background: none; }
.rich-content mark { padding: 0 3px; border-radius: 4px; background: #FEF08A; }
.rich-content hr { margin: 1.6em 0; border: 0; border-top: 1px solid var(--border); }
.rich-content iframe { width: 100%; height: auto; aspect-ratio: 16 / 9; border: 0; border-radius: 12px; }
.rich-content [dir="rtl"] { font-family: var(--font-ar); text-align: right; }
.rich-content [dir="rtl"] h1, .rich-content [dir="rtl"] h2 { padding-left: 0; padding-right: 12px; border-left: 0; border-right: 4px solid var(--accent); }
.rich-content [dir="rtl"] ul, .rich-content [dir="rtl"] ol { padding-left: 0; padding-right: 1.5em; }
.rich-content [dir="rtl"] blockquote { border-left: 0; border-right: 4px solid var(--accent); border-radius: 12px 0 0 12px; }
.rich-content .katex-display { overflow-x: auto; overflow-y: hidden; padding: 4px 0; }
.rich-content .katex { font-size: 1.08em; }

/* ---------- Fichiers ---------- */
.file-list { display: grid; gap: 10px; }
.file-item { display: flex; align-items: center; gap: 14px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; transition: border-color .15s, box-shadow .15s; }
.file-item:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.file-icon { width: 46px; height: 46px; flex: none; display: grid; place-items: center; border-radius: 12px; font-size: 22px; color: #475569; background: #F1F5F9; }
.file-pdf { color: #DC2626; background: #FEF2F2; }
.file-doc, .file-docx, .file-odt { color: #2563EB; background: #EFF6FF; }
.file-ppt, .file-pptx { color: #EA580C; background: #FFF7ED; }
.file-xls, .file-xlsx { color: #16A34A; background: #F0FDF4; }
.file-zip, .file-rar { color: #CA8A04; background: #FEFCE8; }
.file-jpg, .file-jpeg, .file-png, .file-gif, .file-webp { color: #7C3AED; background: #F5F3FF; }
.file-mp4, .file-webm, .file-mp3 { color: #DB2777; background: #FDF2F8; }
.file-info { flex: 1; min-width: 0; }
.file-info strong { display: block; overflow: hidden; font-size: 15px; white-space: nowrap; text-overflow: ellipsis; }
.file-info small { color: var(--muted); font-size: 12.5px; }
.file-actions { display: flex; flex: none; gap: 8px; }

/* ---------- Vidéos ---------- */
.video-list { display: grid; gap: 16px; }
.video-frame { position: relative; margin: 0; overflow: hidden; aspect-ratio: 16 / 9; border-radius: 14px; background: #0F172A; }
.video-frame iframe, .video-frame video { display: block; width: 100%; height: 100%; border: 0; }
.video-native { aspect-ratio: auto; }
.video-native video { max-height: 540px; }
.video-native figcaption { padding: 10px 14px; color: #CBD5E1; font-size: 14px; }

/* ---------- Exercices ---------- */
.exercise-list { display: grid; gap: 16px; }
.exercise-card { padding: 18px 20px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-xs); scroll-margin-top: calc(var(--header-h) + 84px); }
.exercise-card + .btn { margin-top: 20px; }
.exercise-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; margin-bottom: 12px; }
.exercise-number { padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--sc, var(--accent)); background: rgba(var(--sc-rgb, var(--accent-rgb)), .1); }
.exercise-head h3 { flex: 1; min-width: 180px; margin: 0; font-size: 17px; }
.exercise-head h3 a { color: inherit; text-decoration: none; }
.exercise-head h3 a:hover { color: var(--accent); }
.difficulty { padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.difficulty-facile { color: #15803D; background: #DCFCE7; }
.difficulty-moyen { color: #B45309; background: #FEF3C7; }
.difficulty-difficile { color: #B91C1C; background: #FEE2E2; }
.exercise-figure { margin: 14px 0 0; }
.exercise-figure img { border-radius: 12px; border: 1px solid var(--border); }
.inline-files { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.correction { margin-top: 14px; background: #F0FDF4; border: 1px solid #BBF7D0; border-radius: 12px; }
.correction > summary { display: flex; align-items: center; gap: 8px; padding: 11px 14px; color: #15803D; font-weight: 700; cursor: pointer; list-style: none; }
.correction > summary::-webkit-details-marker { display: none; }
.correction > summary .chev { margin-left: auto; background: rgba(255, 255, 255, .8); color: #15803D; }
.correction .when-open { display: none; }
.correction[open] .when-open { display: inline; }
.correction[open] .when-closed { display: none; }
.correction-body { display: grid; gap: 12px; justify-items: start; padding: 4px 16px 16px; }
.correction-body .rich-content, .correction-body .file-list { width: 100%; }

/* ---------- Contrôles & examens ---------- */
.exam-list { display: grid; gap: 12px; }
.exam-item { --x: #7C3AED; display: flex; align-items: center; gap: 14px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-xs); }
.exam-controle { --x: #EA580C; }
.exam-devoir { --x: #D97706; }
.exam-examen { --x: #7C3AED; }
.exam-regional { --x: #0891B2; }
.exam-national { --x: #059669; }
.exam-badge { width: 46px; height: 46px; flex: none; display: grid; place-items: center; border-radius: 13px; font-size: 20px; color: var(--x); background: rgba(0, 0, 0, .04); background: color-mix(in srgb, var(--x) 12%, white); }
.exam-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.exam-type { color: var(--x); font-size: 11.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.exam-title { color: var(--text); font-size: 15.5px; font-weight: 700; text-decoration: none; }
.exam-title:hover { color: var(--accent); }
.exam-meta { margin: 0; color: var(--muted); font-size: 13px; }
.exam-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.mini-type { display: inline-block; margin-right: 6px; padding: 1px 7px; border-radius: 6px; font-size: 10.5px; font-weight: 700; text-transform: uppercase; color: var(--x); background: color-mix(in srgb, var(--x) 12%, white); }

/* ---------- Panneaux (page examen) ---------- */
.panel { margin-bottom: 18px; padding: 20px 22px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.panel-title { display: flex; align-items: center; gap: 8px; margin: 0 0 14px; font-size: 17px; }
.correction.panel { padding: 0; background: #F0FDF4; border-color: #BBF7D0; }
.correction.panel > summary { padding: 16px 20px; font-size: 16px; }
.back-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }

/* ---------- Filtres et recherche ---------- */
.filter-bar { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); align-items: end; gap: 12px; margin-bottom: 18px; padding: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.filter-bar label span { display: block; margin-bottom: 6px; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.filter-bar select { width: 100%; height: 42px; padding: 0 10px; border: 1px solid var(--border); border-radius: 11px; color: var(--text); background: var(--surface-2); font-size: 14px; }
.filter-bar select:focus { outline: none; border-color: rgba(var(--primary-rgb), .5); box-shadow: 0 0 0 4px rgba(var(--primary-rgb), .12); }
.filter-actions { display: flex; gap: 8px; }
.filter-actions .btn { flex: 1; }
.search-hero h1 { margin-bottom: 18px; }
.filter-bar-hero { margin: 16px 0 0; background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .2); box-shadow: none; }
.filter-bar-hero label span { color: rgba(255, 255, 255, .85); }
.filter-bar-hero select { background: #fff; border-color: transparent; }
.results-count { margin: 0 0 12px; color: var(--muted); }
.type-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 26px; }
.type-tabs a { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border: 1px solid var(--border); border-radius: 999px; color: var(--text-2); background: var(--surface); font-size: 14px; font-weight: 600; text-decoration: none; }
.type-tabs a span { padding: 1px 7px; border-radius: 999px; font-size: 12px; background: var(--surface-2); }
.type-tabs a:hover { border-color: var(--border-strong); }
.type-tabs a.active { color: #fff; background: var(--primary); border-color: transparent; }
.type-tabs a.active span { background: rgba(255, 255, 255, .22); }
.result-group { margin-bottom: 32px; }
.result-group h2 { display: flex; align-items: center; gap: 8px; margin: 0 0 14px; font-size: 19px; }
.result-list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.result-item { display: flex; align-items: flex-start; gap: 14px; padding: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; }
.result-icon { width: 42px; height: 42px; flex: none; display: grid; place-items: center; border-radius: 12px; font-size: 19px; color: var(--c); background: rgba(var(--c-rgb), .1); }
.result-body { flex: 1; min-width: 0; }
.result-title { color: var(--text); font-size: 16px; font-weight: 700; text-decoration: none; }
.result-title:hover { color: var(--c); }
.result-context { margin: 2px 0 0; color: var(--c); font-size: 13px; font-weight: 600; }
.result-excerpt { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
.result-side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }

/* ---------- Divers ---------- */
.pagination { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 28px; }
.pagination a, .pagination span { min-width: 40px; height: 40px; display: grid; place-items: center; padding: 0 10px; border: 1px solid var(--border); border-radius: 11px; color: var(--text-2); background: var(--surface); font-weight: 600; text-decoration: none; }
.pagination a:hover { border-color: var(--border-strong); }
.pagination .current { color: #fff; background: var(--primary); border-color: transparent; }
.pagination .dots { border: 0; background: none; }
.empty-state { padding: 48px 20px; text-align: center; color: var(--muted); background: var(--surface); border: 1px dashed var(--border-strong); border-radius: 20px; }
.empty-state > i { display: block; margin-bottom: 10px; font-size: 42px; color: var(--border-strong); }
.empty-state p { margin: 0 0 16px; }
.empty-state p:last-child { margin: 0; }
.error-card { display: grid; justify-items: center; gap: 14px; padding: 48px 28px; text-align: center; background: var(--surface); border: 1px solid var(--border); border-radius: 24px; box-shadow: var(--shadow); }
.error-card h1 { margin: 0; }
.error-card p { margin: 0; color: var(--muted); }
.error-code { font-size: 92px; font-weight: 800; line-height: 1; letter-spacing: -.04em; color: var(--primary); background: linear-gradient(135deg, var(--primary), #A855F7); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.error-card .hero-search { width: 100%; border: 1px solid var(--border); box-shadow: none; }

/* ---------- Pages d'information (à propos, contact, pages légales) ---------- */
.info-article { padding: 28px 32px; }
.info-article h2 { margin-top: 1.8em; }
.info-intro { font-size: 17.5px; color: var(--text); }
.info-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.rich-content a.btn { text-decoration: none; }
.rich-content a.btn-primary { color: #fff; }
.rich-content a.btn-ghost { color: var(--text-2); }
.info-nav a { display: flex; align-items: center; gap: 9px; }
.info-nav a i { color: var(--muted); }
.info-nav a.active { background: rgba(var(--primary-rgb), .08); color: var(--primary); font-weight: 700; }
.info-nav a.active i { color: var(--primary); }
.feature-grid, .contact-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin-bottom: 18px; }
.feature-card, .contact-card { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-xs); }
.feature-card strong, .contact-card strong { font-size: 15.5px; }
.feature-card p, .contact-card p { margin: 0; color: var(--muted); font-size: 14px; }
.contact-card > a { font-weight: 600; overflow-wrap: anywhere; }
.feature-icon { width: 42px; height: 42px; display: grid; place-items: center; margin-bottom: 4px; border-radius: 12px; font-size: 19px; color: var(--primary); background: rgba(var(--primary-rgb), .1); }
.contact-socials { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 14px; font-weight: 600; }
.contact-socials a { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }

.contact-form { padding: 24px 26px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.form-field { margin-bottom: 16px; }
.form-field label { display: block; margin-bottom: 6px; font-size: 14px; font-weight: 600; color: var(--text-2); }
.form-field .req { color: #DC2626; }
.form-field input, .form-field select, .form-field textarea { display: block; width: 100%; padding: 11px 13px; border: 1px solid var(--border-strong); border-radius: 11px; color: var(--text); background: var(--surface); font-size: 15px; transition: border-color .15s, box-shadow .15s; }
.form-field textarea { min-height: 150px; resize: vertical; }
.form-field input:focus, .form-field select:focus, .form-field textarea:focus { outline: none; border-color: rgba(var(--primary-rgb), .6); box-shadow: 0 0 0 4px rgba(var(--primary-rgb), .12); }
.form-field [aria-invalid="true"] { border-color: #DC2626; }
.form-error { display: flex; align-items: center; gap: 6px; margin: 6px 0 0; color: #B91C1C; font-size: 13.5px; font-weight: 500; }
.form-note { display: flex; align-items: flex-start; gap: 8px; margin: 0 0 18px; color: var(--muted); font-size: 13.5px; }
.form-note i { margin-top: 2px; color: #16A34A; }
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.notice { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 18px; padding: 14px 16px; border: 1px solid; border-radius: var(--radius); }
.notice > i { margin-top: 2px; font-size: 18px; }
.notice p { margin: 2px 0 0; font-size: 14px; }
.notice-success { color: #166534; background: #F0FDF4; border-color: #BBF7D0; }
.notice-error { color: #991B1B; background: #FEF2F2; border-color: #FECACA; }

/* ---------- Pied de page ---------- */
.site-footer { margin-top: 40px; padding-top: 56px; color: #CBD5E1; background: #0B1020; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; }
.site-footer h3 { margin: 0 0 14px; color: #fff; font-size: 15px; }
.site-footer ul { display: grid; gap: 9px; margin: 0; padding: 0; list-style: none; }
.site-footer a { color: #CBD5E1; font-size: 14px; text-decoration: none; }
.site-footer a:hover { color: #fff; }
.brand-light .brand-text strong { color: #fff; }
.brand-light .brand-mark { color: #6366F1; }
.footer-brand p { max-width: 330px; margin: 16px 0; color: #94A3B8; font-size: 14px; }
.socials { display: flex; gap: 8px; }
.socials a { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; background: rgba(255, 255, 255, .08); }
.socials a:hover { background: rgba(255, 255, 255, .16); }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-top: 44px; padding-top: 22px; padding-bottom: 22px; color: #94A3B8; font-size: 13px; border-top: 1px solid rgba(255, 255, 255, .08); }
.footer-legal { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.site-footer .footer-legal a { color: #94A3B8; font-size: 13px; }
.site-footer .footer-legal a:hover { color: #fff; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
    .path-steps { grid-template-columns: repeat(3, 1fr); }
    .path-steps li::after { display: none; }
}
@media (max-width: 1024px) {
    .site-header { background: #fff; -webkit-backdrop-filter: none; backdrop-filter: none; }
    .nav-toggle { display: inline-grid; place-items: center; width: 42px; height: 42px; flex: none; border: 1px solid var(--border); border-radius: 12px; color: var(--text); background: var(--surface); font-size: 22px; cursor: pointer; }
    .main-nav {
        position: fixed; top: var(--header-h); right: 0; bottom: 0; left: 0; z-index: 49; flex-direction: column; align-items: stretch; gap: 4px;
        padding: 16px 16px 40px; overflow-y: auto; background: var(--surface); transform: translateX(100%); transition: transform .25s ease; visibility: hidden;
    }
    body.nav-open { overflow: hidden; }
    body.nav-open .main-nav { transform: none; visibility: visible; }
    .nav-link { width: 100%; justify-content: space-between; padding: 13px 14px; font-size: 16px; }
    .mega-menu { position: static; display: none; width: auto; grid-template-columns: 1fr 1fr; padding: 4px 0 10px; border: 0; box-shadow: none; opacity: 1; visibility: visible; transform: none; }
    .has-menu.open .mega-menu { display: grid; }
    .has-menu:hover .mega-menu { opacity: 1; }
    .header-search { flex: 1 1 auto; }
    .layout-sidebar { grid-template-columns: 1fr; }
    .aside-card.sticky { position: static; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
    .home-hero { padding: 52px 0 60px; }
    .home-hero-inner { grid-template-columns: 1fr; gap: 32px; }
    .lesson-hero-grid.has-cover { grid-template-columns: 1fr; }
    .lesson-cover { max-width: 420px; }
    .lesson-context { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
    .container { padding: 0 16px; }
    .section { padding: 40px 0; }
    .brand-text small { display: none; }
    .header-inner { gap: 10px; }
    .brand-text { display: none; }
    .home-hero-text > p { font-size: 16px; }
    .hero-search { padding-left: 12px; }
    .hero-search .btn { padding: 11px 14px; }
    .stat-card { padding: 18px 16px; }
    .stat-card strong { font-size: 32px; }
    .path-steps { grid-template-columns: 1fr 1fr; }
    .subject-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .subject-card { min-height: 160px; padding: 16px; }
    .subject-card-body strong { font-size: 16px; }
    .choice-grid { grid-template-columns: 1fr; }
    .hero-head { align-items: flex-start; }
    .hero-icon { width: 52px; height: 52px; font-size: 24px; border-radius: 15px; }
    .mega-menu { grid-template-columns: 1fr; }
    .file-item, .exam-item { flex-wrap: wrap; }
    .file-actions, .exam-actions { width: 100%; justify-content: flex-start; }
    .file-actions .btn { flex: 1; }
    .prev-next { grid-template-columns: 1fr; }
    .prev-next .next { grid-column: auto; }
    .result-item { flex-wrap: wrap; }
    .result-side { flex-direction: row; align-items: center; width: 100%; }
    .footer-grid { grid-template-columns: 1fr; }
    .info-article, .contact-form { padding: 20px 18px; }
    .form-row { grid-template-columns: 1fr; }
    .acc-body { padding: 16px; }
    .accordion > summary { padding: 14px 16px; gap: 12px; }
}
@media (max-width: 380px) {
    .subject-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
@media print {
    .site-header, .site-footer, .section-nav, .layout-aside, .prev-next, .stepper { display: none !important; }
    .page-hero { color: #000; background: none; }
    .layout-sidebar { display: block; }
    details > * { display: block; }
}
