:root {
  --pink: #ED1E79; --pink-dark: #c9125f; --pink-soft: #fde7f0;
  --blue: #6078C0; --blue-soft: #e9edf8;
  --ink: #2F2F2F; --muted: #6b6b76; --line: #e6e6ea; --bg: #f6f6f8; --card: #fff;
  --ok: #2e9e5b; --ok-soft: #e4f6ea; --warn: #b7791f; --warn-soft: #fff4dd;
  --radius: 14px; --shadow: 0 2px 10px rgba(30,30,50,.06);
  --font-head: "Outfit", system-ui, sans-serif; --font-body: "Inter", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font-body); color: var(--ink); background: var(--bg); line-height: 1.55; display: flex; flex-direction: column; min-height: 100vh; }
a { color: var(--pink-dark); }
h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(1.7rem, 4vw, 2.5rem); font-weight: 800; }
h2 { font-size: clamp(1.3rem, 3vw, 1.7rem); font-weight: 700; }
h3 { font-size: 1.15rem; font-weight: 700; }
h4 { font-size: 1rem; font-weight: 700; color: var(--pink-dark); margin-top: 1.2em; }
p { margin: 0 0 .9em; }
ul { padding-left: 1.2em; margin: 0 0 .9em; }
li { margin-bottom: .3em; }
img { max-width: 100%; }

/* ---- barre ---- */
.topbar { background: var(--pink); color: #fff; display: flex; align-items: center; justify-content: space-between; padding: 0 16px; height: 64px; position: sticky; top: 0; z-index: 20; box-shadow: 0 2px 12px rgba(237,30,121,.3); }
.brand { display: flex; align-items: baseline; gap: 4px; color: #fff; text-decoration: none; font-family: var(--font-head); line-height: 1; }
.brand-logo { height: 54px; width: auto; display: block; }
.brand-leaf { width: 22px; height: 22px; align-self: center; margin-right: 4px; }
.brand-moovin { font-weight: 500; font-size: 1.5rem; letter-spacing: -.02em; }
.brand-canada { font-weight: 800; font-size: 1.05rem; letter-spacing: .14em; }
.topnav { display: flex; gap: 6px; align-items: center; }
.topnav a, .topnav button { color: var(--pink-dark); text-decoration: none; font-weight: 700; font-size: .9rem; padding: 8px 14px; border-radius: 999px; background: #fff; border: 0; cursor: pointer; font-family: inherit; transition: opacity .15s; }
.topnav a:hover, .topnav button:hover { opacity: .75; }
.topnav .avatar { width: 34px; height: 34px; border-radius: 50%; background: #fff; color: var(--pink); display: grid; place-items: center; font-weight: 800; font-family: var(--font-head); }

/* ---- layout ---- */
.app { flex: 1; width: 100%; max-width: 1100px; margin: 0 auto; padding: 24px 16px 60px; }
.footer { border-top: 1px solid var(--line); padding: 18px 16px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; color: var(--muted); font-size: .85rem; }
.footer a { color: var(--muted); }
.loading { color: var(--muted); padding: 40px; text-align: center; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
.grid { display: grid; gap: 18px; }
.grid > * { min-width: 0; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.muted { color: var(--muted); }
.small { font-size: .86rem; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.mt { margin-top: 18px; } .mb { margin-bottom: 18px; }

/* ---- boutons ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 18px; border-radius: 999px; border: 0; cursor: pointer; font: 600 .95rem var(--font-body); text-decoration: none; transition: transform .08s, box-shadow .15s; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--pink); color: #fff; box-shadow: 0 4px 14px rgba(237,30,121,.3); }
.btn-primary:hover { background: var(--pink-dark); }
.btn-secondary { background: var(--blue); color: #fff; }
.btn-ghost { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.btn-ghost:hover { border-color: var(--ink); }
.btn-sm { padding: 7px 12px; font-size: .85rem; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-block { width: 100%; }

/* ---- formulaires ---- */
.form { display: grid; gap: 12px; max-width: 460px; }
.field label { display: block; font-weight: 600; font-size: .88rem; margin-bottom: 4px; }
.field input, .field select, .field textarea { width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; font: inherit; background: #fff; }
.field input:focus, .field select:focus { outline: 2px solid var(--blue); border-color: transparent; }
.error { background: #fdecef; color: #9f1239; padding: 10px 12px; border-radius: 10px; font-size: .9rem; }
.notice { background: var(--blue-soft); color: #2f3f7a; padding: 10px 12px; border-radius: 10px; font-size: .9rem; }
.auth { max-width: 460px; margin: 20px auto; }

/* ---- accueil ---- */
.hero { background: linear-gradient(135deg, var(--pink) 0%, #f24c93 60%, var(--blue) 140%); color: #fff; border-radius: 22px; padding: clamp(28px, 5vw, 56px); margin-bottom: 26px; position: relative; overflow: hidden; }
.hero h1 { color: #fff; max-width: 640px; }
.hero p { max-width: 560px; font-size: 1.05rem; opacity: .95; }
.hero .btn-primary { background: #fff; color: var(--pink-dark); box-shadow: none; }
.hero-leaf { position: absolute; right: -30px; bottom: -40px; width: 260px; opacity: .14; }
.course-card { display: flex; flex-direction: column; gap: 10px; }
.course-card .tag { align-self: flex-start; }
.course-card h2 { margin-bottom: 0; }
.course-card .cta { margin-top: auto; padding-top: 8px; }
.tag { display: inline-block; font-size: .75rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; padding: 4px 10px; border-radius: 999px; background: var(--pink-soft); color: var(--pink-dark); }
.tag-blue { background: var(--blue-soft); color: #3a4c9a; }
.tag-ok { background: var(--ok-soft); color: #1f6f40; }
.tag-grey { background: #eceef2; color: var(--muted); }

/* ---- progression ---- */
.progress { height: 10px; background: #e9e9ee; border-radius: 999px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--pink), var(--blue)); border-radius: 999px; transition: width .4s; }

/* ---- page cours ---- */
.course-head { display: grid; gap: 14px; grid-template-columns: 1fr; margin-bottom: 22px; }
@media (min-width: 760px) { .course-head { grid-template-columns: 1fr 320px; align-items: start; } }
.module { margin-bottom: 14px; }
.module-head { display: flex; align-items: center; gap: 12px; cursor: pointer; padding: 6px 0; }
.module-num { width: 38px; height: 38px; border-radius: 10px; background: var(--pink); color: #fff; display: grid; place-items: center; font: 800 1rem var(--font-head); flex: none; }
.module.locked .module-num { background: #c9c9d1; }
.module-head h3 { margin: 0; flex: 1; }
.module-head .meta { font-size: .82rem; color: var(--muted); white-space: nowrap; }
.module.closed .lessons, .module.closed > p { display: none; }
.module-head::after { content: "⌄"; color: var(--muted); font-size: 1.2rem; transition: .2s; }
.module.closed .module-head::after { transform: rotate(-90deg); }
.lessons { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 6px; }
.lesson { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; background: var(--bg); text-decoration: none; color: var(--ink); border: 1px solid transparent; }
.lesson:hover { border-color: var(--line); background: #fff; }
.lesson .thumb { width: 72px; height: 44px; border-radius: 6px; object-fit: cover; flex: none; background: #ddd; }
.lesson .title { flex: 1; font-weight: 500; font-size: .95rem; }
.lesson .state { font-size: .8rem; color: var(--muted); white-space: nowrap; }
.lesson.done .state { color: var(--ok); font-weight: 600; }
.lesson.blocked { opacity: .62; }
.lesson.paid-locked { position: relative; }
.lesson.paid-locked .thumb { filter: grayscale(.6); }
.lock { width: 16px; height: 16px; fill: var(--muted); }
.unlock-box { background: linear-gradient(135deg, var(--pink-soft), var(--blue-soft)); border-radius: var(--radius); padding: 20px; }

/* ---- leçon ---- */
.lesson-layout { display: grid; gap: 22px; grid-template-columns: 1fr; grid-template-areas: "main" "side" "left"; }
.lesson-main { grid-area: main; min-width: 0; } .lesson-left { grid-area: left; } .lesson-side { grid-area: side; }
@media (min-width: 980px) { .lesson-layout { grid-template-columns: 1fr 300px; grid-template-areas: "main side" "left side"; } }
@media (min-width: 1200px) { .app { max-width: 1280px; } .lesson-layout { grid-template-columns: 230px 1fr 290px; grid-template-areas: "left main side"; } .lesson-left .card { position: sticky; top: 80px; } }
.player { position: relative; padding-top: 56.25%; background: #000; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.player iframe, .player .player-lock { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.player-lock { display: grid; place-items: center; text-align: center; color: #fff; background: linear-gradient(180deg, rgba(0,0,0,.35), rgba(0,0,0,.8)), var(--thumb) center/cover; padding: 20px; }
.player-lock .lock { fill: #fff; width: 40px; height: 40px; }
.lesson-nav { display: flex; justify-content: space-between; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.section { margin-top: 22px; }
.section h2 { color: var(--pink); font-size: 1.25rem; border-bottom: 2px solid var(--pink-soft); padding-bottom: 6px; }
.link-list { list-style: none; padding: 0; display: grid; gap: 8px; }
.link-list a { display: flex; gap: 10px; align-items: center; padding: 10px 12px; background: var(--bg); border-radius: 10px; text-decoration: none; color: var(--ink); font-weight: 500; font-size: .92rem; }
.link-list a:hover { background: var(--blue-soft); }
.link-list a::before { content: "↗"; color: var(--blue); font-weight: 700; }
.side-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; max-height: 70vh; overflow: auto; }
.side-list a { display: flex; gap: 8px; align-items: center; padding: 8px 10px; border-radius: 8px; text-decoration: none; color: var(--ink); font-size: .88rem; }
.side-list a.current { background: var(--pink-soft); font-weight: 600; }
.side-list a.done::before { content: "✓"; color: var(--ok); font-weight: 700; }
.side-list a.todo::before { content: "○"; color: #bbb; }
.side-list a.lockd::before { content: "🔒"; font-size: .75rem; }
.side-list .mod { font: 700 .78rem var(--font-head); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 10px 10px 2px; }
.disclaimer { background: var(--warn-soft); border-left: 4px solid var(--warn); padding: 10px 14px; border-radius: 8px; }

/* ---- quiz ---- */
.quiz-q { margin-bottom: 18px; }
.quiz-q .q { font-weight: 600; margin-bottom: 8px; }
.quiz-q label { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 6px; cursor: pointer; background: #fff; }
.quiz-q label:hover { border-color: var(--blue); }
.quiz-q label.good { border-color: var(--ok); background: var(--ok-soft); }
.quiz-q label.bad { border-color: #e05a5a; background: #fdecec; }
.quiz-q input { margin-top: 3px; }
.badge-big { font-size: 2.6rem; }

/* ---- admin ---- */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.tabs a { padding: 8px 14px; border-radius: 999px; background: #fff; border: 1px solid var(--line); text-decoration: none; color: var(--ink); font-weight: 600; font-size: .9rem; }
.tabs a.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.stat { background: #fff; border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.stat b { display: block; font: 800 1.8rem var(--font-head); color: var(--pink); }
.table { width: 100%; border-collapse: collapse; font-size: .88rem; background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.table th, .table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { background: var(--bg); font-weight: 700; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.table-wrap { overflow: auto; }
.mini { height: 6px; width: 90px; }
code.copy { background: var(--bg); padding: 4px 8px; border-radius: 6px; font-size: .82rem; cursor: pointer; word-break: break-all; }

/* ---- toast ---- */
.toast { position: fixed; bottom: 20px; left: 50%; transform: translate(-50%, 20px); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; opacity: 0; pointer-events: none; transition: .25s; font-size: .9rem; max-width: 90vw; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 600px) {
  .topbar { padding: 0 12px; }
  .topnav a.hide-sm { display: none; }
  .card { padding: 16px; }
  .lesson .thumb { width: 56px; height: 36px; }
  .lesson .state { display: none; }
}

/* ===== refonte v2 : cartes photos, modules, bandeau ===== */
.hero { background: linear-gradient(120deg, var(--pink) 0%, #f24c93 70%, #b84f9c 140%); }
.hero-ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.55); }
.pill { display: inline-flex; align-items: center; gap: 4px; font-size: .75rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--pink-soft); color: var(--pink-dark); white-space: nowrap; }
.pill-blue { background: var(--blue-soft); color: #3a4c9a; }
.pill-ok { background: var(--ok-soft); color: #1f6f40; }
.pill-grey { background: #eceef2; color: var(--muted); }
.pill-lock { background: #f1f1f4; color: var(--muted); }
.pill-lock .lock { width: 12px; height: 12px; }
.pill-white { background: rgba(255,255,255,.9); color: var(--pink-dark); }

.ccard { background: #fff; border-radius: 18px; box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; transition: transform .15s, box-shadow .15s; }
.ccard:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(30,30,50,.1); }
.ccard-img { display: block; aspect-ratio: 16/8; background: #ddd center/cover; position: relative; }
.ccard-img .pill { position: absolute; top: 12px; left: 12px; }
.ccard-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 8px; }
.ccard-body h2 { margin: 0; font-size: 1.3rem; }
.ccard-body .row { margin-top: auto; padding-top: 6px; }

.cover { border-radius: 22px; background: #333 center/cover; min-height: 260px; display: flex; align-items: flex-end; overflow: hidden; margin-bottom: 14px; }
.cover-in { width: 100%; padding: clamp(20px, 4vw, 40px); background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(20,10,30,.78) 100%); color: #fff; }
.cover-in h1 { color: #fff; margin: 8px 0 4px; }
.cover-in p { margin: 0; max-width: 620px; opacity: .92; }
.action-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; background: #fff; border-radius: 14px; padding: 14px 18px; box-shadow: var(--shadow); margin-bottom: 14px; position: sticky; top: 72px; z-index: 5; }
.action-progress { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 160px; }
.action-progress .progress { flex: 1; }
.upsell { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; background: linear-gradient(135deg, var(--pink-soft), var(--blue-soft)); border-radius: 14px; padding: 12px 18px; margin-bottom: 18px; }
.upsell > div { display: flex; flex-direction: column; }

.mcard { background: #fff; border-radius: 16px; box-shadow: var(--shadow); margin-bottom: 12px; overflow: hidden; }
.mcard-head { display: flex; align-items: center; gap: 14px; padding: 12px 14px; cursor: pointer; }
.mcard-head:hover { background: #fafafb; }
.mcard-img { width: 110px; height: 72px; border-radius: 10px; background: #ccc center/cover; flex: none; position: relative; }
.mcard-img .mnum { position: absolute; left: 8px; bottom: 8px; background: var(--pink); color: #fff; font: 800 .85rem var(--font-head); width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; }
.mcard.locked .mcard-img { filter: grayscale(.5) brightness(.9); }
.mcard.locked .mnum { background: #9a9aa6; }
.mcard-info { flex: 1; min-width: 0; }
.mcard-info h3 { margin: 0 0 2px; font-size: 1.05rem; }
.mcard-info p { margin: 0 0 4px; }
.mcard-info .progress.mini { width: 160px; max-width: 100%; }
.mcard-right { display: flex; align-items: center; gap: 10px; flex: none; }
.chev { color: var(--muted); font-size: 1.3rem; transition: transform .2s; display: inline-block; }
.mcard.closed .chev { transform: rotate(-90deg); }
.mcard.closed .lessons { display: none; }
.mcard .lessons { margin: 0; padding: 4px 14px 14px; gap: 4px; }
.mcard .lesson { background: #fff; border: 1px solid var(--line); padding: 9px 12px; }
.mcard .lesson:hover { border-color: var(--blue); background: var(--blue-soft); }
.mcard .lesson .state { width: 22px; text-align: center; color: var(--muted); display: inline-flex; justify-content: center; }
.mcard .lesson.done .state { color: var(--ok); font-weight: 800; }
.mcard .lesson.done .title { color: var(--muted); }
.mcard .lesson .pill { margin-left: auto; }
@media (max-width: 600px) {
  .mcard-img { width: 72px; height: 54px; }
  .mcard-info .progress.mini { width: 100px; }
  .mcard-right .pill { font-size: .68rem; padding: 3px 7px; }
  .mcard-right .pill-lock .lock { display: none; }
  .action-bar { position: static; }
  .cover { min-height: 200px; }
}


/* ===== leçon v2 ===== */
.btn-lg { padding: 14px 24px; font-size: 1rem; }
.prev-link { color: var(--muted); font-size: .9rem; text-decoration: none; align-self: center; }
.prev-link:hover { color: var(--ink); }
.lesson-side { display: flex; flex-direction: column; gap: 14px; }
.lesson-side .card { position: sticky; top: 80px; }
.notice-box { margin-top: 32px; padding: 12px 0 0; border-top: 1px solid var(--line); color: var(--muted); font-size: .85rem; line-height: 1.5; }
.notice-box .notice-title { display: block; font: 700 .75rem var(--font-body); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.notice-box p { display: inline; margin: 0; } .notice-box p + p::before { content: " "; }
.notice-box br { display: none; }
.resources { background: var(--blue-soft); }
.resources-empty { opacity: .7; }
.resources .link-list a { font-size: .86rem; padding: 8px 10px; }
.resources h3 { margin-bottom: 10px; }
.resources .link-list a { background: #fff; }
.resources .link-list a.is-pdf::before { content: "PDF"; font-size: .7rem; font-weight: 800; color: #fff; background: var(--pink); padding: 2px 6px; border-radius: 5px; }
.side-list { max-height: none; overflow: visible; gap: 2px; }
.smod { list-style: none; border-top: 1px solid var(--line); }
.smod:first-child { border-top: 0; }
.smod-head { display: flex; align-items: center; gap: 10px; width: 100%; background: none; border: 0; padding: 10px 4px; cursor: pointer; font: inherit; text-align: left; color: var(--ink); }
.smod-num { width: 24px; height: 24px; border-radius: 7px; background: var(--pink-soft); color: var(--pink-dark); font: 800 .8rem var(--font-head); display: grid; place-items: center; flex: none; }
.smod-title { flex: 1; font-weight: 700; font-size: .9rem; line-height: 1.25; }
.smod-meta { font-size: .78rem; color: var(--muted); display: inline-flex; align-items: center; }
.smod-meta .lock { width: 13px; height: 13px; }
.smod ul { list-style: none; padding: 0 0 8px 8px; margin: 0; display: grid; gap: 2px; }
.smod.closed ul { display: none; }
.smod.open .smod-num { background: var(--pink); color: #fff; }
