/* Artist Up-Grade : thème clair, rouge #FF0129, noir #1A1A1A */
:root {
  --red: #FF0129; --red-dark: #d10022; --red-soft: #fff0f2;
  --ink: #1A1A1A; --ink-2: #4a4a4a; --muted: #777;
  --bg: #f6f6f7; --card: #fff; --line: #e6e6e9;
  --ok: #138a4b; --ok-soft: #e9f7ef; --info: #1f5fbf; --info-soft: #eef4fd; --err-soft: #fff0f2;
  --radius: 14px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--ink); background: var(--bg); line-height: 1.55; font-size: 16px; }
h1, h2, h3, .wordmark, .kicker, .btn, .score { font-family: Montserrat, Inter, sans-serif; }
h1 { font-size: 1.8rem; line-height: 1.2; margin: .2em 0 .5em; font-weight: 800; }
h2 { font-size: 1.2rem; margin: 0 0 .5em; font-weight: 700; }
a { color: var(--red); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.main { padding-top: 28px; padding-bottom: 48px; min-height: calc(100vh - 140px); }
.narrow { max-width: 480px; margin-left: auto; margin-right: auto; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.center { text-align: center; }
.kicker { text-transform: uppercase; letter-spacing: .08em; font-size: .75rem; font-weight: 700; color: var(--red); margin: 0 0 4px; }

/* En-tête */
.topbar { background: var(--ink); color: #fff; position: sticky; top: 0; z-index: 10; }
.topbar-in { display: flex; align-items: center; justify-content: space-between; min-height: 62px; gap: 16px; }
.brand img { height: 38px; display: block; }
.wordmark { white-space: nowrap; color: #fff; font-weight: 600; letter-spacing: .06em; font-size: 1.05rem; }
.wordmark b { color: var(--red); font-weight: 800; }
.nav { display: flex; gap: 2px; flex-wrap: nowrap; flex-shrink: 0; }
.nav a { color: #ddd; padding: 8px 9px; font-size: .88rem; white-space: nowrap; border-radius: 8px; font-weight: 500; }
.nav a:hover, .nav a.on { background: rgba(255,255,255,.1); color: #fff; text-decoration: none; }
.nav a.on { box-shadow: inset 0 -2px 0 var(--red); }
.burger { display: none; background: none; border: 0; color: #fff; font-size: 1.5rem; cursor: pointer; }
@media (max-width: 1100px) {
  .burger { display: block; }
  .nav { display: none; position: absolute; top: 62px; left: 0; right: 0; background: var(--ink); flex-direction: column; flex-wrap: nowrap; padding: 8px 16px 16px; }
  .nav-open .nav { display: flex; }
}

.foot { border-top: 1px solid var(--line); background: #fff; font-size: .88rem; color: var(--muted); }
.foot .wrap { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-top: 18px; padding-bottom: 18px; }

/* Cartes et grilles */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin-bottom: 18px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.stat b { display: block; font-family: Montserrat, sans-serif; font-size: 1.6rem; }
.stat span { color: var(--muted); font-size: .85rem; }
@media (max-width: 760px) { .grid2, .grid3 { grid-template-columns: 1fr; } .stats { grid-template-columns: 1fr 1fr; } }

/* Boutons */
.btn { display: inline-block; background: var(--red); color: #fff; border: 0; border-radius: 10px; padding: 11px 20px; font-weight: 700; font-size: .95rem; cursor: pointer; text-align: center; }
.btn:hover { background: var(--red-dark); text-decoration: none; color: #fff; }
.btn-ghost { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.btn-ghost:hover { background: #f2f2f2; color: var(--ink); }
.btn-dark { background: var(--ink); }
.btn-dark:hover { background: #000; }
.btn-small { padding: 7px 14px; font-size: .85rem; }
.btn-block { display: block; width: 100%; }
.linkbtn { background: none; border: 0; color: var(--muted); cursor: pointer; text-decoration: underline; font: inherit; font-size: .88rem; }
.linkbtn.danger { color: var(--red); }

/* Formulaires */
.form label { display: block; margin-bottom: 14px; font-weight: 500; font-size: .92rem; }
input, select, textarea { width: 100%; margin-top: 5px; padding: 10px 12px; border: 1px solid #d6d6db; border-radius: 9px; font: inherit; background: #fff; color: var(--ink); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--red); outline-offset: 0; border-color: transparent; }
input[type=radio], input[type=checkbox] { width: auto; margin: 0 6px 0 0; }
textarea { min-height: 110px; resize: vertical; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.row > * { flex: 1 1 160px; }
.row > .btn, .row > button { flex: 0 0 auto; }
.inline { display: inline; }
.check { display: flex !important; align-items: center; gap: 6px; }

/* Alertes */
.alert { padding: 12px 16px; border-radius: 10px; margin: 0 0 16px; font-size: .94rem; border-left: 4px solid; }
.alert-ok { background: var(--ok-soft); border-color: var(--ok); color: #0c5a31; }
.alert-err { background: var(--err-soft); border-color: var(--red); color: #8a0016; }
.alert-info { background: var(--info-soft); border-color: var(--info); color: #173f7a; }

/* Connexion */
.auth { display: grid; grid-template-columns: 1.1fr 1fr; gap: 28px; align-items: center; min-height: 60vh; }
.auth-side h1 { font-size: 2.6rem; }
.auth-side h1::after { content: ""; display: block; width: 64px; height: 5px; background: var(--red); margin-top: 14px; border-radius: 3px; }
@media (max-width: 760px) { .auth { grid-template-columns: 1fr; } .auth-side h1 { font-size: 2rem; } }

/* Progression */
.progress { height: 8px; background: #eee; border-radius: 99px; overflow: hidden; margin: 12px 0 4px; }
.progress.big { height: 10px; margin-bottom: 22px; }
.progress span { display: block; height: 100%; background: var(--red); border-radius: 99px; }
.courses { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }

/* Cours */
.crumbs { font-size: .88rem; color: var(--muted); margin: 0 0 6px; }
.course-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.module-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.pill { display: inline-block; padding: 3px 10px; border-radius: 99px; background: #f0f0f2; font-size: .82rem; font-weight: 600; white-space: nowrap; }
.pill-ok { background: var(--ok-soft); color: var(--ok); }
.pill-err { background: var(--err-soft); color: var(--red); }
.pill-info { background: var(--info-soft); color: var(--info); }
.lessons { list-style: none; padding: 0; margin: 10px 0; }
.lessons li { display: flex; align-items: center; gap: 12px; padding: 10px 4px; border-top: 1px solid var(--line); }
.lessons .lt { flex: 1; font-weight: 500; }
.lessons a.lt { color: var(--ink); }
.lessons a.lt:hover { color: var(--red); }
.lessons .dot { width: 28px; height: 28px; border-radius: 50%; background: var(--red-soft); color: var(--red); display: grid; place-items: center; font-size: .78rem; flex: 0 0 28px; }
.lessons li.done .dot { background: var(--ok-soft); color: var(--ok); }
.lessons li.locked { color: var(--muted); }
.lessons li.locked .dot { background: #f0f0f2; }
.module-foot { border-top: 1px solid var(--line); padding-top: 12px; }
.summary { background: #fafafa; border-radius: 10px; padding: 10px 14px; margin-bottom: 10px; }
.summary summary { cursor: pointer; font-weight: 600; }
.files { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0; }
.file { display: inline-flex; gap: 6px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 9px 14px; color: var(--ink); }
.file:hover { border-color: var(--red); text-decoration: none; }
.quiz-line { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 8px; }

/* Leçon */
.video { position: relative; padding-top: 56.25%; background: #000; border-radius: var(--radius); overflow: hidden; margin-bottom: 18px; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.prose p { margin: 0 0 1em; }
.lesson-nav { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin: 20px 0 8px; }
.lesson-nav form { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

/* Contrôles */
fieldset.question { margin: 0 0 18px; }
.qn { font-weight: 700; color: var(--red); font-size: .85rem; text-transform: uppercase; letter-spacing: .05em; padding: 0; }
.qt { font-weight: 600; margin-top: 0; }
.choice { display: flex; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; margin-bottom: 8px; cursor: pointer; }
.choice:hover { border-color: var(--red); }
.result { text-align: center; }
.result .score { font-size: 3rem; font-weight: 800; margin: 0; }
.result.ok .score { color: var(--ok); }
.result.ko .score { color: var(--red); }
.q-ok { border-left: 4px solid var(--ok); }
.q-ko { border-left: 4px solid var(--red); }
.choices-view { list-style: none; padding: 0; }
.choices-view li { padding: 6px 10px; border-radius: 8px; margin-bottom: 4px; }
.choices-view .right { background: var(--ok-soft); font-weight: 600; }
.choices-view .wrong { background: var(--err-soft); text-decoration: line-through; }

/* Tableaux */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; }
tr:hover td { background: #fcfcfc; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar h1 { margin: 0; }
.secret { font-family: ui-monospace, monospace; background: #fff6d6; padding: 2px 8px; border-radius: 6px; font-size: 1rem; }
.qa-choice { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.qa-choice input[type=text] { margin: 0; }

.inline-form { display: flex; gap: 6px; align-items: center; }
.inline-form select { width: auto; margin: 0; }
.module-locked { background: #fafafa; }
.module-locked h2 { color: var(--ink-2); }
.buy-line { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; justify-content: space-between; margin: 8px 0 0; }

/* Livres */
.books { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px; }
.book { display: grid; grid-template-columns: 120px 1fr; gap: 18px; align-items: start; }
.cover { aspect-ratio: 2 / 3; border-radius: 8px; overflow: hidden; background: var(--ink); color: #fff; display: grid; place-items: center; text-align: center; padding: 0; box-shadow: 0 6px 16px rgba(0,0,0,.15); }
.cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover span { padding: 10px; font-family: Montserrat, sans-serif; font-weight: 700; font-size: .85rem; border-top: 3px solid var(--red); }
.book h2 { margin-bottom: 2px; }
.price { font-weight: 700; font-size: 1.05rem; margin: 10px 0; }
.cover-preview { width: 120px; border-radius: 8px; margin-bottom: 10px; display: block; }
@media (max-width: 420px) { .book { grid-template-columns: 90px 1fr; gap: 12px; } }

.tabs { display: flex; gap: 6px; margin: 0 0 8px; flex-wrap: wrap; }
.tabs a { padding: 7px 14px; border-radius: 99px; background: #fff; border: 1px solid var(--line); color: var(--ink); font-weight: 600; font-size: .88rem; }
.tabs a.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.tabs a:hover { text-decoration: none; }
code { font-family: ui-monospace, monospace; font-size: .85rem; word-break: break-all; }
