/* ==========================================================
   BizOS Academy — styles (inspiration « classroom » Skool)
   Change les couleurs ici : tout le site suit.
   ========================================================== */
:root {
  --bg: #f8f7f5;
  --card: #ffffff;
  --text: #202124;
  --muted: #65676b;
  --faint: #909090;
  --border: #e4e4e4;
  --hover: #f4f4f4;
  --accent: #f8d481;          /* jaune Skool */
  --accent-soft: #fdf1cf;     /* leçon active */
  --accent-ink: #6b4e00;
  --dark: #202124;            /* boutons principaux */
  --done: #1f9d55;
  --done-soft: #e3f5ea;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 1px 3px rgba(0, 0, 0, .06);
  --topbar: 64px;
  --sidebar: 340px;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button { font: inherit; color: inherit; }

/* ---------- Barre du haut ---------- */
.topbar { position: sticky; top: 0; z-index: 40; height: var(--topbar); background: var(--card); border-bottom: 1px solid var(--border); }
.topbar__inner { max-width: 1320px; height: 100%; margin: 0 auto; padding: 0 20px; display: flex; align-items: center; gap: 18px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; flex-shrink: 0; }
.brand__logo { width: 36px; height: 36px; border-radius: 9px; background: var(--dark); color: var(--accent); display: grid; place-items: center; font-weight: 800; font-size: 18px; }
.brand__name { font-weight: 700; font-size: 17px; letter-spacing: -.01em; }
.tabs { display: flex; gap: 4px; height: 100%; }
.tab { display: flex; align-items: center; padding: 0 12px; text-decoration: none; color: var(--muted); font-weight: 500; border-bottom: 3px solid transparent; }
.tab.is-active { color: var(--text); border-bottom-color: var(--text); }
.search { margin-left: auto; display: flex; align-items: center; gap: 8px; background: var(--hover); border-radius: 10px; padding: 0 12px; height: 40px; width: 300px; color: var(--muted); }
.search input { border: 0; background: transparent; outline: none; font: inherit; color: var(--text); width: 100%; }
.global-progress { font-size: 13px; color: var(--muted); white-space: nowrap; display: flex; align-items: center; gap: 8px; }
.global-progress .bar { width: 90px; }
.icon-btn { border: 0; background: transparent; width: 40px; height: 40px; border-radius: 8px; cursor: pointer; display: grid; place-items: center; }
.icon-btn:hover { background: var(--hover); }
.menu-toggle { display: none; margin-left: -8px; }

/* ---------- Mise en page ---------- */
.layout { max-width: 1320px; margin: 0 auto; padding: 24px 20px 60px; display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); gap: 24px; align-items: start; }
.sidebar { position: sticky; top: calc(var(--topbar) + 24px); background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); max-height: calc(100vh - var(--topbar) - 48px); display: flex; flex-direction: column; overflow: hidden; }
.sidebar__scroll { overflow-y: auto; padding: 8px 0 12px; overscroll-behavior: contain; }
.content { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); min-height: 70vh; outline: none; }
.backdrop { display: none; }

/* ---------- Barre de progression ---------- */
.bar { height: 8px; background: #ececec; border-radius: 99px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--done); border-radius: 99px; transition: width .35s ease; }

/* ---------- Sommaire (sidebar) ---------- */
.mod { border-bottom: 1px solid var(--border); }
.mod:last-child { border-bottom: 0; }
.mod__head { width: 100%; display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 0; background: none; cursor: pointer; text-align: left; }
.mod__head:hover { background: var(--hover); }
.mod__badge { width: 38px; height: 38px; flex-shrink: 0; border-radius: 10px; display: grid; place-items: center; background: var(--dark); color: var(--accent); font-weight: 800; font-size: 17px; }
.mod__badge.is-emoji { background: var(--accent-soft); font-size: 19px; }
.mod__meta { flex: 1; min-width: 0; }
.mod__title { font-weight: 700; font-size: 15px; line-height: 1.3; }
.mod__sub { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 12px; color: var(--muted); }
.mod__sub .bar { flex: 1; height: 6px; }
.chev { width: 18px; height: 18px; flex-shrink: 0; color: var(--faint); transition: transform .2s ease; }
.is-open > button > .chev { transform: rotate(90deg); }
.mod__body, .chap__body { display: none; }
.mod.is-open > .mod__body, .chap.is-open > .chap__body { display: block; }
.mod__body { padding-bottom: 8px; }

.chap__head { width: 100%; display: flex; align-items: center; gap: 8px; padding: 9px 16px 9px 18px; border: 0; background: none; cursor: pointer; text-align: left; font-weight: 600; font-size: 14px; }
.chap__head:hover { background: var(--hover); }
.chap__num { color: var(--muted); font-variant-numeric: tabular-nums; min-width: 26px; }
.chap__title { flex: 1; }
.chap__count { font-size: 12px; font-weight: 500; color: var(--faint); }
.chap__count.is-complete { color: var(--done); }

.lesson { display: flex; align-items: center; gap: 10px; margin: 1px 8px; padding: 8px 10px 8px 44px; border-radius: 8px; text-decoration: none; font-size: 14px; color: var(--text); line-height: 1.35; }
.lesson:hover { background: var(--hover); }
.lesson.is-active { background: var(--accent-soft); font-weight: 600; }
.lesson__title { flex: 1; }
.tick { width: 18px; height: 18px; flex-shrink: 0; border-radius: 50%; border: 1.5px solid #cfcfcf; display: grid; place-items: center; }
.tick svg { display: none; }
.is-done .tick { background: var(--done); border-color: var(--done); }
.is-done .tick svg { display: block; }
.lesson.is-hidden, .chap.is-hidden, .mod.is-hidden { display: none; }
.search-empty { padding: 24px 16px; color: var(--muted); font-size: 14px; text-align: center; }
mark { background: var(--accent); color: inherit; border-radius: 3px; padding: 0 1px; }

/* ---------- Leçon ---------- */
.lesson-page { padding: 28px 32px 32px; }
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.lesson-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 20px; }
.lesson-head h1 { flex: 1; margin: 0; font-size: 26px; line-height: 1.25; letter-spacing: -.02em; }
.btn { display: inline-flex; align-items: center; gap: 8px; border-radius: 10px; padding: 10px 16px; font-weight: 600; font-size: 14px; border: 1px solid var(--border); background: var(--card); cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { background: var(--hover); }
.btn--dark { background: var(--dark); border-color: var(--dark); color: #fff; }
.btn--dark:hover { background: #000; }
.btn--done { background: var(--done-soft); border-color: #bfe6cf; color: var(--done); }
.btn--done:hover { background: #d6f0e0; }
.btn .tick { width: 18px; height: 18px; }
.btn--done .tick { background: var(--done); border-color: var(--done); }
.btn--done .tick svg { display: block; }

.video { position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: #111; }
.video iframe, .video video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; }
.video--empty { display: grid; place-items: center; text-align: center; color: #cfcfcf; background: radial-gradient(120% 120% at 0% 0%, #2b2b2b 0%, #141414 60%); }
.video--empty .play { width: 68px; height: 68px; border-radius: 50%; background: rgba(255, 255, 255, .08); display: grid; place-items: center; margin: 0 auto 14px; }
.video--empty strong { display: block; color: #fff; font-size: 16px; margin-bottom: 4px; }
.video--empty small { font-size: 13px; color: #9a9a9a; }
.video-note { font-size: 12px; color: var(--muted); margin: 8px 2px 0; }

.section { margin-top: 30px; }
.section > h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin: 0 0 12px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.prose { font-size: 15px; }
.prose p { margin: 0 0 12px; }
.prose h3 { font-size: 17px; margin: 22px 0 8px; letter-spacing: -.01em; }
.prose ul, .prose ol { margin: 0 0 12px; padding-left: 22px; }
.prose li { margin: 4px 0; }
.prose li > ul, .prose li > ol { margin: 4px 0 4px; }

.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.checklist label { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; transition: background .15s; }
.checklist label:hover { background: var(--hover); }
.checklist input { appearance: none; width: 20px; height: 20px; margin: 1px 0 0; flex-shrink: 0; border: 1.5px solid #c8c8c8; border-radius: 6px; display: grid; place-items: center; cursor: pointer; }
.checklist input:checked { background: var(--done); border-color: var(--done); }
.checklist input:checked::after { content: ""; width: 5px; height: 10px; border: solid #fff; border-width: 0 2px 2px 0; transform: translateY(-1px) rotate(45deg); }
.checklist input:checked + span { color: var(--muted); text-decoration: line-through; text-decoration-color: #bbb; }

.tldr { background: var(--accent-soft); border: 1px solid #f3dfa6; border-radius: 12px; padding: 16px 18px; }
.tldr ul { margin: 0; padding-left: 20px; }
.tldr li { margin: 6px 0; }

.chapters { list-style: none; margin: 0; padding: 0; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.chapters li + li { border-top: 1px solid var(--border); }
.chapters button { width: 100%; display: flex; gap: 14px; align-items: baseline; padding: 10px 14px; border: 0; background: var(--card); cursor: pointer; text-align: left; font-size: 14px; }
.chapters button:hover { background: var(--hover); }
.chapters .ts { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--accent-ink); background: var(--accent-soft); border-radius: 6px; padding: 1px 7px; font-size: 13px; min-width: 52px; text-align: center; }

.resources { display: grid; gap: 10px; }
.res { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; text-decoration: none; transition: background .15s, border-color .15s; }
.res:hover { background: var(--hover); border-color: #d6d6d6; }
.res__icon { width: 40px; height: 40px; border-radius: 9px; background: var(--hover); display: grid; place-items: center; flex-shrink: 0; font-size: 11px; font-weight: 800; color: var(--muted); letter-spacing: .03em; }
.res__body { flex: 1; min-width: 0; }
.res__title { font-weight: 600; font-size: 14px; }
.res__type { font-size: 12px; color: var(--muted); }
.res__arrow { color: var(--faint); }
.res-note { font-size: 14px; color: var(--muted); margin: 10px 0 0; }
.res-empty { font-size: 14px; color: var(--muted); padding: 14px; border: 1px dashed var(--border); border-radius: 10px; }

.pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 36px; padding-top: 22px; border-top: 1px solid var(--border); }
.pager a { max-width: 48%; display: flex; flex-direction: column; gap: 2px; padding: 10px 14px; border: 1px solid var(--border); border-radius: 10px; text-decoration: none; }
.pager a:hover { background: var(--hover); }
.pager small { color: var(--muted); font-size: 12px; }
.pager span { font-weight: 600; font-size: 14px; }
.pager .next { margin-left: auto; text-align: right; }

/* ---------- Accueil ---------- */
.home { padding: 30px 32px 36px; }
.home h1 { margin: 0 0 6px; font-size: 28px; letter-spacing: -.02em; }
.home > p { margin: 0 0 22px; color: var(--muted); }
.resume { display: flex; align-items: center; gap: 16px; padding: 16px 18px; border-radius: 12px; background: var(--accent-soft); border: 1px solid #f3dfa6; margin-bottom: 26px; }
.resume div { flex: 1; min-width: 0; }
.resume small { color: var(--accent-ink); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.resume strong { display: block; margin-top: 2px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }
.card { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; text-decoration: none; background: var(--card); transition: box-shadow .2s, transform .2s; }
.card:hover { box-shadow: 0 8px 24px rgba(0, 0, 0, .08); transform: translateY(-2px); }
.card__cover { aspect-ratio: 16 / 8; display: grid; place-items: center; background: linear-gradient(135deg, #202124 0%, #3a3a3a 100%); color: var(--accent); font-size: 54px; font-weight: 800; letter-spacing: -.03em; }
.card__cover.is-emoji { background: linear-gradient(135deg, #fdf1cf 0%, #f8d481 100%); }
.card__body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card__title { font-weight: 700; font-size: 16px; }
.card__desc { font-size: 13px; color: var(--muted); flex: 1; }
.card__progress { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--muted); margin-top: 6px; }
.card__progress .bar { flex: 1; }

/* ---------- Mobile ---------- */
@media (max-width: 960px) {
  :root { --sidebar: 300px; }
  .search { width: 220px; }
  .global-progress { display: none; }
}
@media (max-width: 800px) {
  .menu-toggle { display: grid; }
  .tabs { display: none; }
  .brand__name { font-size: 15px; }
  .search { width: auto; flex: 1; min-width: 0; }
  .layout { grid-template-columns: 1fr; padding: 16px 12px 40px; gap: 16px; }
  .sidebar { position: fixed; z-index: 60; top: 0; left: 0; bottom: 0; width: min(88vw, 360px); max-height: none; border-radius: 0; transform: translateX(-105%); transition: transform .25s ease; }
  body.menu-open .sidebar { transform: none; }
  body.menu-open .backdrop { display: block; position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, .35); }
  .lesson-page, .home { padding: 20px 16px 24px; }
  .lesson-head { flex-direction: column; gap: 12px; }
  .lesson-head h1 { font-size: 22px; }
  .pager { flex-direction: column; }
  .pager a { max-width: none; }
  .resume { flex-direction: column; align-items: stretch; }
}
@media (max-width: 420px) {
  .brand__name { display: none; }
}
