:root {
    --navy: #101b3f;
    --navy-soft: #192957;
    --blue: #5069f7;
    --blue-dark: #3f55dc;
    --yellow: #ffd54a;
    --cream: #f7f8fc;
    --white: #ffffff;
    --text: #152044;
    --muted: #69718b;
    --line: #e8eaf2;
    --success: #19a66a;
    --danger: #df5364;
    --shadow: 0 18px 50px rgba(23, 33, 74, .10);
    --radius: 24px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    color: var(--text);
    background: var(--cream);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.55;
}
button, a { font: inherit; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; }
.container { width: min(1160px, calc(100% - 40px)); margin: 0 auto; }

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(247, 248, 252, .92);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(232, 234, 242, .85);
}
.nav { min-height: 74px; display: flex; align-items: center; justify-content: space-between; gap: 28px; }
.brand { display: inline-flex; align-items: center; gap: 11px; font-weight: 900; letter-spacing: -.035em; font-size: 1.25rem; }
.brand-mark {
    width: 39px; height: 39px; display: grid; place-items: center;
    border-radius: 12px; color: var(--navy); background: var(--yellow);
    transform: rotate(-4deg); box-shadow: 0 7px 16px rgba(255, 213, 74, .3);
}
.brand span:last-child em { color: var(--blue); font-style: normal; }
.nav-links { display: flex; align-items: center; gap: 30px; color: #46506d; font-weight: 650; font-size: .94rem; }
.nav-links a:hover { color: var(--blue); }
.nav-links a[aria-current="page"] { color: var(--blue); }
.nav-actions { display: flex; align-items: center; gap: 10px; }
.btn {
    border: 0; border-radius: 13px; padding: 12px 18px; font-weight: 800;
    display: inline-flex; justify-content: center; align-items: center; gap: 8px;
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { color: white; background: var(--blue); box-shadow: 0 10px 24px rgba(80,105,247,.28); }
.btn-primary:hover { background: var(--blue-dark); }
.btn-light { color: var(--navy); background: white; border: 1px solid var(--line); }
.menu-button { display: none; width: 42px; height: 42px; border: 1px solid var(--line); background: white; border-radius: 12px; }

.hero { overflow: hidden; padding: 82px 0 76px; background: linear-gradient(180deg, #f7f8fc 0%, #eef1ff 100%); position: relative; }
.hero::before, .hero::after { content: ""; position: absolute; border-radius: 999px; filter: blur(1px); opacity: .6; pointer-events: none; }
.hero::before { width: 360px; height: 360px; background: #dce1ff; top: -180px; right: -100px; }
.hero::after { width: 250px; height: 250px; background: #fff0ad; bottom: -180px; left: -80px; }
.hero-grid { position: relative; z-index: 1; display: grid; grid-template-columns: 1.04fr .96fr; align-items: center; gap: 70px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 999px; background: white; color: var(--blue-dark); font-size: .82rem; font-weight: 850; box-shadow: 0 6px 18px rgba(32, 46, 101, .08); }
.eyebrow-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 5px rgba(25,166,106,.12); }
h1 { margin: 23px 0 20px; color: var(--navy); font-size: clamp(2.65rem, 5.5vw, 5.1rem); line-height: .98; letter-spacing: -.065em; max-width: 720px; }
h1 .highlight { position: relative; color: var(--blue); white-space: nowrap; }
h1 .highlight::after { content: ""; position: absolute; z-index: -1; height: 13px; left: -3px; right: -3px; bottom: 5px; background: var(--yellow); opacity: .85; transform: rotate(-1deg); border-radius: 20px; }
.hero-copy > p { max-width: 590px; margin: 0; color: var(--muted); font-size: 1.12rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 31px; }
.hero-actions .btn { min-height: 52px; padding-inline: 24px; }
.hero-proof { display: flex; align-items: center; flex-wrap: wrap; gap: 17px; margin-top: 26px; color: var(--muted); font-size: .86rem; font-weight: 650; }
.proof-item { display: flex; gap: 7px; align-items: center; }
.check { width: 19px; height: 19px; border-radius: 50%; display: grid; place-items: center; color: white; background: var(--success); font-size: .67rem; }

.quiz-shell { position: relative; }
.floating-note { position: absolute; z-index: 3; padding: 10px 14px; border-radius: 14px; color: var(--navy); background: var(--yellow); font-weight: 900; font-size: .82rem; box-shadow: 0 12px 25px rgba(37, 43, 81, .15); transform: rotate(5deg); top: 35px; right: -30px; }
.quiz-card { background: white; border: 1px solid rgba(255,255,255,.7); border-radius: 30px; box-shadow: 0 26px 70px rgba(27, 40, 98, .17); overflow: hidden; }
.quiz-top { padding: 22px 24px 18px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.quiz-title { font-size: .86rem; font-weight: 900; text-transform: uppercase; letter-spacing: .09em; color: var(--blue); }
.quiz-step { color: var(--muted); font-weight: 750; font-size: .82rem; }
.progress { height: 6px; margin: 0 24px; background: #ebedf6; border-radius: 999px; overflow: hidden; }
.progress-bar { width: 33.33%; height: 100%; background: linear-gradient(90deg, var(--blue), #8d6cf7); transition: width .35s ease; }
.quiz-body { padding: 29px 24px 24px; }
.category-label { color: var(--muted); font-weight: 800; font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; }
.question { min-height: 68px; margin: 8px 0 21px; color: var(--navy); font-weight: 900; font-size: 1.32rem; line-height: 1.32; }
.answers { display: grid; gap: 11px; }
.answer {
    width: 100%; padding: 14px 16px; text-align: left; border: 1.5px solid var(--line); border-radius: 14px;
    background: #fafbff; color: #33405f; font-weight: 750; transition: .16s ease;
}
.answer:hover:not(:disabled) { border-color: var(--blue); background: #f1f3ff; transform: translateX(3px); }
.answer.correct { border-color: var(--success); color: #0d7650; background: #eaf9f3; }
.answer.wrong { border-color: var(--danger); color: #a53746; background: #fff0f2; }
.answer:disabled { cursor: default; }
.feedback { display: none; margin-top: 15px; padding: 13px 14px; background: #f4f6fb; border-radius: 12px; color: #55607b; font-size: .86rem; }
.feedback.show { display: block; animation: fadeIn .2s ease; }
.quiz-footer { margin-top: 18px; display: flex; justify-content: space-between; align-items: center; gap: 14px; }
.score { color: var(--muted); font-weight: 750; font-size: .86rem; }
.next-button { visibility: hidden; padding: 10px 15px; }
.next-button.show { visibility: visible; }

.section { padding: 84px 0; }
.section-white { background: white; }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 25px; margin-bottom: 34px; }
.section-kicker { margin: 0 0 7px; color: var(--blue); font-size: .8rem; font-weight: 900; text-transform: uppercase; letter-spacing: .11em; }
h2 { margin: 0; color: var(--navy); font-size: clamp(2rem, 4vw, 3.05rem); line-height: 1.08; letter-spacing: -.045em; }
.section-heading > p { max-width: 470px; margin: 0; color: var(--muted); }
.subject-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 15px; }
.subject-card { position: relative; padding: 23px 19px; border-radius: 20px; background: white; border: 1px solid var(--line); box-shadow: 0 8px 24px rgba(24, 35, 74, .05); transition: transform .2s ease, box-shadow .2s ease; overflow: hidden; }
.subject-card:hover { transform: translateY(-6px); box-shadow: var(--shadow); }
.subject-icon { width: 48px; height: 48px; margin-bottom: 22px; display: grid; place-items: center; border-radius: 15px; font-weight: 950; font-size: 1.05rem; }
.subject-card h3 { margin: 0 0 4px; color: var(--navy); font-size: 1rem; }
.subject-card p { margin: 0; color: var(--muted); font-size: .82rem; }
.subject-arrow { position: absolute; right: 18px; bottom: 18px; color: #a3a9ba; }
.blue .subject-icon { color: #3455df; background: #eaf0ff; }
.violet .subject-icon { color: #7651d6; background: #f1ebff; }
.orange .subject-icon { color: #bf671e; background: #fff1df; }
.green .subject-icon { color: #167957; background: #e8f8f1; }
.pink .subject-icon { color: #c34b7b; background: #ffebf3; }

.method-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.method-card { padding: 30px; border-radius: var(--radius); background: #f8f9fd; border: 1px solid var(--line); }
.step-number { width: 42px; height: 42px; display: grid; place-items: center; margin-bottom: 22px; border-radius: 13px; color: white; background: var(--navy); font-weight: 900; box-shadow: 6px 6px 0 var(--yellow); }
.method-card h3 { margin: 0 0 9px; color: var(--navy); }
.method-card p { margin: 0; color: var(--muted); }

.cta { padding: 28px 0 88px; background: white; }
.cta-card { position: relative; overflow: hidden; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 30px; padding: 48px 54px; color: white; background: var(--navy); border-radius: 30px; }
.cta-card::after { content: "?"; position: absolute; right: 180px; top: -70px; color: rgba(255,255,255,.05); font-weight: 950; font-size: 16rem; transform: rotate(11deg); }
.cta-card h2 { color: white; max-width: 700px; }
.cta-card p { max-width: 670px; margin: 13px 0 0; color: #bdc6e4; }
.cta-card .btn { position: relative; z-index: 2; color: var(--navy); background: var(--yellow); min-height: 53px; padding-inline: 25px; }

footer { padding: 28px 0; color: #727991; background: white; border-top: 1px solid var(--line); font-size: .85rem; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.footer-links { display: flex; gap: 22px; }

.toast { position: fixed; left: 50%; bottom: 24px; z-index: 100; padding: 12px 18px; transform: translate(-50%, 130px); color: white; background: var(--navy); border-radius: 13px; box-shadow: var(--shadow); font-weight: 750; transition: transform .3s ease; }
.toast.show { transform: translate(-50%, 0); }

/* Page Matières */
.page-hero {
    padding: 72px 0 64px;
    overflow: hidden;
    position: relative;
    background: linear-gradient(180deg, #f7f8fc 0%, #eef1ff 100%);
}
.page-hero::after {
    content: "";
    position: absolute;
    width: 340px;
    height: 340px;
    top: -190px;
    right: -80px;
    border-radius: 50%;
    background: #dce1ff;
}
.page-hero-inner { position: relative; z-index: 1; }
.page-hero h1 { margin-bottom: 18px; }
.page-hero p { max-width: 650px; margin: 0; color: var(--muted); font-size: 1.08rem; }
.subjects-page { background: var(--cream); }
.subjects-list { display: grid; gap: 24px; }
.subject-panel {
    padding: 30px;
    background: white;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 10px 32px rgba(24, 35, 74, .06);
}
.subject-panel-head { display: flex; align-items: center; gap: 18px; margin-bottom: 24px; }
.subject-panel-head .subject-icon { flex: 0 0 52px; margin: 0; }
.subject-panel h2 { margin: 0 0 4px; font-size: 1.45rem; letter-spacing: -.025em; }
.subject-panel-head p { margin: 0; color: var(--muted); }
.chapter-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 11px; }
.chapter-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    min-height: 56px;
    padding: 13px 16px;
    color: #35405f;
    background: #f8f9fd;
    border: 1px solid var(--line);
    border-radius: 13px;
    font-weight: 750;
    transition: transform .18s ease, border-color .18s ease, background .18s ease;
}
.chapter-link:hover { transform: translateY(-2px); border-color: var(--blue); background: #f1f3ff; }
.chapter-link small { margin-left: auto; color: var(--muted); font-size: .72rem; }
.chapter-link.is-locked { opacity: .62; cursor: default; }
.chapter-link.is-locked:hover { transform: none; border-color: var(--line); background: #f8f9fd; }

/* Page d'une matière */
.subject-hero { padding: 62px 0; background: linear-gradient(180deg, #f7f8fc 0%, #eef1ff 100%); }
.subject-hero-inner { display: flex; align-items: center; gap: 25px; }
.subject-icon.large { width: 76px; height: 76px; flex: 0 0 76px; margin: 0; border-radius: 22px; font-size: 1.35rem; }
.subject-hero h1 { margin: 8px 0 9px; font-size: clamp(2.5rem, 5vw, 4.5rem); }
.subject-hero p { margin: 0; color: var(--muted); font-size: 1.05rem; }
.breadcrumb { color: var(--blue); font-size: .86rem; font-weight: 850; }
.section-heading.compact { margin-bottom: 26px; }
.topic-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 15px; }
.topic-card {
    min-height: 145px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 18px;
    padding: 24px;
    background: white;
    border: 1px solid var(--line);
    border-radius: 20px;
    box-shadow: 0 8px 24px rgba(24, 35, 74, .05);
}
.topic-card.available { transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.topic-card.available:hover { transform: translateY(-4px); border-color: var(--blue); box-shadow: var(--shadow); }
.topic-card.locked { opacity: .62; }
.topic-number { color: #c0c5d4; font-size: 1.25rem; font-weight: 950; }
.topic-card h3 { margin: 7px 0 4px; color: var(--navy); font-size: 1.14rem; }
.topic-card p { margin: 0; color: var(--muted); font-size: .84rem; }
.status-pill { display: inline-flex; padding: 4px 8px; color: #167957; background: #e8f8f1; border-radius: 999px; font-size: .67rem; font-weight: 900; text-transform: uppercase; letter-spacing: .06em; }
.locked .status-pill { color: #747b8f; background: #eef0f5; }
.topic-arrow { color: var(--blue); font-size: 1.35rem; }
.topic-lock { color: #a1a7b7; }
.empty-state { max-width: 650px; padding-block: 90px; text-align: center; }
.empty-state h1 { margin: 18px 0 10px; font-size: 2.5rem; }
.empty-state p { margin: 0 0 26px; color: var(--muted); }
.empty-icon { width: 62px; height: 62px; display: grid; place-items: center; margin: 0 auto; border-radius: 18px; color: var(--navy); background: var(--yellow); font-size: 1.6rem; font-weight: 950; }

/* Moteur de quiz */
.quiz-page { min-height: calc(100vh - 150px); padding: 44px 0 80px; background: linear-gradient(180deg, #f4f6ff 0%, #f8f9fc 100%); }
.quiz-breadcrumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; margin-bottom: 28px; color: var(--muted); font-size: .84rem; }
.quiz-breadcrumbs a:hover { color: var(--blue); }
.quiz-breadcrumbs strong { color: var(--navy); }
.quiz-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); align-items: start; gap: 26px; }
.quiz-sidebar { position: sticky; top: 102px; padding: 27px; color: white; background: var(--navy); border-radius: 24px; box-shadow: var(--shadow); }
.quiz-sidebar .section-kicker { color: #9bacff; }
.quiz-sidebar h1 { margin: 8px 0 12px; color: white; font-size: 2rem; line-height: 1.05; }
.quiz-sidebar > p { margin: 0 0 24px; color: #c4cce5; font-size: .9rem; }
.quiz-stat { display: flex; justify-content: space-between; gap: 14px; padding: 13px 0; border-top: 1px solid rgba(255,255,255,.12); color: #c4cce5; font-size: .85rem; }
.quiz-stat strong { color: white; font-size: 1rem; }
.quiz-engine { min-height: 500px; background: white; border: 1px solid var(--line); border-radius: 26px; box-shadow: var(--shadow); overflow: hidden; }
.engine-top { display: flex; justify-content: space-between; gap: 20px; padding: 23px 28px 17px; color: var(--muted); font-size: .84rem; font-weight: 850; }
.quiz-engine .progress { margin-inline: 28px; }
.engine-content { padding: 34px 28px 29px; }
.engine-content h2 { min-height: 72px; margin-bottom: 24px; font-size: clamp(1.35rem, 3vw, 2rem); }
.engine-actions { display: flex; justify-content: flex-end; margin-top: 20px; }
.results-screen { padding: 42px 34px; text-align: center; }
.results-screen[hidden] { display: none; }
.result-badge { display: inline-flex; padding: 7px 11px; color: var(--blue); background: #eef1ff; border-radius: 999px; font-size: .75rem; font-weight: 900; text-transform: uppercase; letter-spacing: .08em; }
.results-screen h2 { margin: 16px 0 7px; }
.result-score { margin: 0; color: var(--blue); font-size: 2rem; font-weight: 950; }
.results-screen > p:not(.result-score) { color: var(--muted); }
.result-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 11px; margin: 25px 0 34px; }
.review-list { padding-top: 28px; border-top: 1px solid var(--line); text-align: left; }
.review-list > h3 { margin: 0 0 17px; }
.review-item { margin-top: 12px; padding: 18px; border-left: 4px solid var(--success); border-radius: 13px; background: #f7faf9; }
.review-item.review-wrong { border-left-color: var(--danger); background: #fff8f8; }
.review-item h4 { margin: 0 0 9px; color: var(--navy); }
.review-item p { margin: 5px 0 0; color: var(--muted); font-size: .88rem; }
.quiz-source { margin: 18px 0 0 306px; color: var(--muted); font-size: .75rem; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 980px) {
    .nav-links { display: none; }
    .menu-button { display: grid; place-items: center; }
    .hero-grid { grid-template-columns: 1fr; gap: 50px; }
    .hero-copy { text-align: center; }
    .hero-copy > p { margin-inline: auto; }
    .hero-actions, .hero-proof { justify-content: center; }
    .quiz-shell { width: min(540px, 100%); margin-inline: auto; }
    .subject-grid { grid-template-columns: repeat(3, 1fr); }
    .chapter-grid { grid-template-columns: repeat(2, 1fr); }
    .quiz-layout { grid-template-columns: 1fr; }
    .quiz-sidebar { position: static; }
    .quiz-source { margin-left: 0; }
}
@media (max-width: 700px) {
    .container { width: min(100% - 26px, 1160px); }
    .nav { min-height: 66px; }
    .nav-actions .btn-light { display: none; }
    .nav-actions .btn-primary { padding: 10px 13px; font-size: .82rem; }
    .hero { padding: 52px 0 58px; }
    h1 { font-size: clamp(2.45rem, 13vw, 4rem); }
    .hero-copy > p { font-size: 1rem; }
    .floating-note { right: -5px; top: -18px; }
    .section { padding: 62px 0; }
    .section-heading { align-items: start; flex-direction: column; }
    .subject-grid { grid-template-columns: 1fr 1fr; }
    .page-hero { padding: 50px 0; }
    .subject-panel { padding: 22px 18px; }
    .chapter-grid { grid-template-columns: 1fr; }
    .subject-hero-inner { align-items: flex-start; flex-direction: column; }
    .topic-grid { grid-template-columns: 1fr; }
    .topic-card { min-height: 125px; padding: 20px 17px; }
    .quiz-page { padding-top: 28px; }
    .engine-top, .engine-content { padding-left: 19px; padding-right: 19px; }
    .quiz-engine .progress { margin-inline: 19px; }
    .results-screen { padding: 34px 20px; }
    .method-grid { grid-template-columns: 1fr; }
    .cta-card { grid-template-columns: 1fr; padding: 36px 26px; }
    .cta-card .btn { justify-self: start; }
    .footer-inner { align-items: start; flex-direction: column; }
}
@media (max-width: 440px) {
    .brand span:last-child { font-size: 1.05rem; }
    .brand-mark { width: 35px; height: 35px; }
    .nav-actions .btn-primary { display: none; }
    .hero-actions { flex-direction: column; }
    .hero-actions .btn { width: 100%; }
    .subject-grid { grid-template-columns: 1fr; }
    .quiz-body { padding: 24px 18px 19px; }
    .quiz-top { padding-inline: 18px; }
    .progress { margin-inline: 18px; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
