/* ============================================================
   PowerPoint — Cours interactif (Skolae)
   Feuille de style partagée · thème orange PowerPoint
   ============================================================ */

:root {
  --pp: #D24726;            /* orange PowerPoint (accent) */
  --pp-dark: #B23A1B;       /* orange foncé (survol / bordures) */
  --pp-deep: #9E3217;       /* orange profond (barre, hero) */
  --ink: #1f1b19;
  --ink-soft: #423a36;
  --muted: #786f6a;
  --bg: #faf7f5;
  --card: #ffffff;
  --line: #ece5e1;
  --line-strong: #d8cdc7;
  --brand: #9E3217;         /* identité (barre du haut) */
  --accent: #117865;        /* « valider / terminé » (teal, complément) */
  --accent-soft: #e3f4ef;
  --info: #1f6feb;
  --info-soft: #e8f1ff;
  --warn: #b54708;
  --warn-soft: #fff4e5;
  --tip: #7a3db8;
  --tip-soft: #f3ebfb;
  --tint: #fbe9e1;          /* fond orange très clair */
  --tint-line: #f1c6b4;
  --code-bg: #2a211d;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(40,20,10,.06), 0 8px 24px rgba(40,20,10,.07);
  --maxw: 1180px;
  --font: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg); line-height: 1.62; -webkit-font-smoothing: antialiased; }
a { color: var(--info); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }

/* ---------- Barre supérieure ---------- */
.topbar { position: sticky; top: 0; z-index: 50; background: var(--brand); color: #fff; border-bottom: 3px solid var(--pp); }
.topbar-inner { max-width: var(--maxw); margin: 0 auto; display: flex; align-items: center; gap: 18px; padding: 12px 22px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: .3px; color: #fff; }
.brand:hover { text-decoration: none; }
.brand .logo { width: 30px; height: 30px; border-radius: 7px; background: var(--pp); color: #fff; display: grid; place-items: center; font-weight: 900; font-size: 18px; }
.topnav { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; }
.topnav a { color: #f0ddd5; padding: 7px 12px; border-radius: 8px; font-size: 14px; font-weight: 600; }
.topnav a:hover { background: rgba(255,255,255,.12); color: #fff; text-decoration: none; }
.topnav a.active { background: var(--pp); color: #fff; }

/* ---------- Layout cours ---------- */
.layout { max-width: var(--maxw); margin: 0 auto; display: grid; grid-template-columns: 268px 1fr; gap: 34px; padding: 28px 22px 80px; }
.sidebar { position: sticky; top: 84px; align-self: start; max-height: calc(100vh - 100px); overflow-y: auto; }
.sidebar h2 { font-size: 12px; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); margin: 0 0 10px 4px; }
.toc { list-style: none; margin: 0; padding: 0; }
.toc li { margin: 1px 0; }
.toc a { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 9px; color: var(--ink-soft); font-size: 14px; font-weight: 600; }
.toc a:hover { background: #f3e9e4; text-decoration: none; }
.toc a.active { background: var(--tint); color: #8a2e14; box-shadow: inset 3px 0 0 var(--pp); }
.toc .num { flex: 0 0 22px; height: 22px; border-radius: 50%; background: #e8ddd7; color: var(--ink-soft); display: grid; place-items: center; font-size: 12px; font-weight: 800; }
.toc a.done .num { background: var(--accent); color: #fff; }
.toc a.done .num::after { content: "✓"; }
.toc a.done .num span { display: none; }
.content { min-width: 0; }

/* ---------- En-tête de page ---------- */
.page-head { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px 28px; box-shadow: var(--shadow); margin-bottom: 26px; position: relative; overflow: hidden; }
.page-head::before { content: ""; position: absolute; right: -40px; top: -40px; width: 160px; height: 160px; background: var(--pp); opacity: .12; border-radius: 50%; }
.kicker { display: inline-block; background: var(--tint); color: #a8351a; font-size: 12px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase; padding: 4px 10px; border-radius: 999px; margin-bottom: 10px; }
.page-head h1 { margin: 0 0 8px; font-size: 30px; line-height: 1.2; }
.page-head p { margin: 0; color: var(--ink-soft); max-width: 70ch; }
.meta-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.chip { display: inline-flex; align-items: center; gap: 7px; background: #f4ece8; border: 1px solid var(--line); border-radius: 999px; padding: 6px 13px; font-size: 13px; font-weight: 600; color: var(--ink-soft); }

/* ---------- Barre de progression ---------- */
.progress-wrap { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px; box-shadow: var(--shadow); margin-bottom: 26px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.progress-wrap .label { font-weight: 700; font-size: 14px; }
.progress-bar { flex: 1; min-width: 180px; height: 12px; background: #eee3dd; border-radius: 999px; overflow: hidden; }
.progress-bar > span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--pp), var(--accent)); transition: width .4s ease; }
.progress-pct { font-weight: 800; font-variant-numeric: tabular-nums; }
.btn-reset { background: none; border: 1px solid var(--line-strong); border-radius: 8px; padding: 6px 12px; font-size: 13px; cursor: pointer; color: var(--muted); font-weight: 600; }
.btn-reset:hover { background: #f4ece8; color: var(--ink); }

/* ---------- Module / section ---------- */
.module { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 22px; overflow: hidden; scroll-margin-top: 84px; }
.module-head { display: flex; align-items: center; gap: 14px; padding: 18px 24px; cursor: pointer; user-select: none; border-bottom: 1px solid transparent; }
.module-head:hover { background: #fdf8f6; }
.module.open .module-head { border-bottom-color: var(--line); }
.module-badge { flex: 0 0 38px; height: 38px; border-radius: 11px; background: var(--pp-deep); color: #fff; display: grid; place-items: center; font-weight: 900; font-size: 16px; }
.module-head h2 { margin: 0; font-size: 19px; flex: 1; }
.module-head .obj { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-top: 2px; }
.module-head .caret { transition: transform .25s; color: var(--muted); font-size: 20px; }
.module.open .module-head .caret { transform: rotate(90deg); }
.module-head .done-flag { font-size: 12px; font-weight: 800; color: var(--accent); background: var(--accent-soft); padding: 3px 9px; border-radius: 999px; display: none; }
.module.completed .module-head .done-flag { display: inline-block; }
.module-body { padding: 6px 24px 22px; display: none; }
.module.open .module-body { display: block; animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(-4px);} to {opacity:1; transform:none;} }
.module-body h3 { font-size: 15px; margin: 22px 0 8px; color: var(--ink); }
.module-body p { margin: 8px 0; }
.module-body ul, .module-body ol { margin: 8px 0; padding-left: 22px; }
.module-body li { margin: 5px 0; }

/* ---------- Étapes numérotées ---------- */
.steps { list-style: none; counter-reset: step; margin: 14px 0; padding: 0; }
.steps > li { position: relative; padding: 4px 0 18px 50px; margin: 0; border-left: 2px solid var(--line); margin-left: 16px; }
.steps > li:last-child { border-left-color: transparent; padding-bottom: 4px; }
.steps > li::before { counter-increment: step; content: counter(step); position: absolute; left: -17px; top: 0; width: 32px; height: 32px; border-radius: 50%; background: var(--pp); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 14px; box-shadow: 0 0 0 4px var(--card); }
.steps > li strong { color: var(--ink); }

/* ---------- Repères d'interface ---------- */
.path { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; background: #f4ece8; border: 1px solid var(--line); border-radius: 7px; padding: 2px 8px; font-size: 13.5px; font-weight: 600; color: var(--ink-soft); }
.path .sep { color: var(--muted); }
kbd { background: #fff; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 5px; padding: 1px 6px; font-family: var(--font); font-size: 12.5px; font-weight: 700; }
.ui { background: var(--tint); border-radius: 4px; padding: 0 5px; font-weight: 700; color: #a8351a; }

/* ---------- Encadrés ---------- */
.callout { border-radius: 10px; padding: 13px 16px 13px 46px; margin: 14px 0; position: relative; font-size: 14.5px; border: 1px solid; }
.callout::before { position: absolute; left: 14px; top: 12px; font-size: 18px; }
.callout p:first-child { margin-top: 0; } .callout p:last-child { margin-bottom: 0; }
.callout.info  { background: var(--info-soft); border-color: #cfe0ff; color: #1b3a66; }
.callout.info::before { content: "ℹ️"; }
.callout.warn  { background: var(--warn-soft); border-color: #ffd9a8; color: #7a3d00; }
.callout.warn::before { content: "⚠️"; }
.callout.tip   { background: var(--tip-soft); border-color: #e4d2f5; color: #5a2d8a; }
.callout.tip::before { content: "💡"; }
.callout.goal  { background: var(--accent-soft); border-color: #b8e3d6; color: #0c5a4a; }
.callout.goal::before { content: "🎯"; }
.callout.pp    { background: var(--tint); border-color: var(--tint-line); color: #a8351a; }
.callout.pp::before { content: "📙"; }
.callout.pp code { background: rgba(168,53,26,.1); padding: 0 4px; border-radius: 4px; }
.callout strong { font-weight: 800; }

/* ---------- Rappel « fichier à utiliser » ---------- */
.data-badge { display: flex; align-items: center; gap: 10px; background: var(--tint); border: 1px solid var(--tint-line); border-left: 4px solid var(--pp-dark); border-radius: 8px; padding: 9px 14px; margin: 0 0 14px; font-size: 14px; color: #a8351a; }
.data-badge .di { font-size: 18px; flex: 0 0 auto; }
.data-badge b { color: #8a2e14; }
.data-badge code { background: rgba(168,53,26,.12); padding: 0 5px; border-radius: 4px; font-size: 13px; }

/* ---------- Tableau démo ---------- */
table.demo { border-collapse: collapse; width: 100%; margin: 12px 0; font-size: 13.5px; }
table.demo th, table.demo td { border: 1px solid var(--line-strong); padding: 6px 10px; text-align: left; }
table.demo th { background: #f4ece8; font-weight: 700; }
table.demo caption { caption-side: top; text-align: left; font-size: 12.5px; color: var(--muted); margin-bottom: 4px; }
table.demo code { background: #f4ece8; padding: 0 4px; border-radius: 4px; font-size: 13px; }

/* ---------- Captures d'écran ---------- */
figure.shot { margin: 16px 0; }
figure.shot img { display: block; width: 100%; height: auto; border: 1px solid var(--line-strong); border-radius: 10px; box-shadow: var(--shadow); background: #fff; cursor: zoom-in; }
figure.shot figcaption { font-size: 12.5px; color: var(--muted); margin-top: 6px; text-align: center; font-style: italic; }
.lightbox { position: fixed; inset: 0; z-index: 200; background: rgba(10,12,20,.86); display: none; align-items: center; justify-content: center; padding: 30px; cursor: zoom-out; }
.lightbox.open { display: flex; }
.lightbox img { max-width: 96vw; max-height: 92vh; border-radius: 8px; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.lightbox .close { position: absolute; top: 18px; right: 24px; color: #fff; font-size: 34px; font-weight: 700; cursor: pointer; line-height: 1; }

/* ---------- Bloc « démarche » (pseudo-code des étapes PPT) ---------- */
.code { position: relative; background: var(--code-bg); color: #f0e6e0; border-radius: 10px; margin: 14px 0; overflow: hidden; border: 1px solid #3a2d27; }
.code .code-head { display: flex; align-items: center; justify-content: space-between; padding: 7px 12px; background: rgba(255,255,255,.04); border-bottom: 1px solid #3a2d27; font-size: 12px; font-weight: 700; color: #cbb6ab; letter-spacing: .4px; }
.code pre { margin: 0; padding: 14px 16px; overflow-x: auto; }
.code code { font-family: "Cascadia Code", "Fira Code", Consolas, monospace; font-size: 13.5px; line-height: 1.65; white-space: pre; color: #f0e6e0; }
.code .kw { color: #ff9e6d; font-weight: 700; }
.code .str { color: #ffd79a; }
.code .com { color: #9a8a82; font-style: italic; }
.btn-copy { background: rgba(255,255,255,.08); color: #e0d2ca; border: 1px solid #4a3a32; border-radius: 6px; padding: 3px 10px; font-size: 12px; cursor: pointer; font-weight: 600; }
.btn-copy:hover { background: rgba(255,255,255,.16); }
.btn-copy.ok { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---------- À toi de jouer / checklist ---------- */
.task { background: #fdf3ee; border: 1px dashed var(--pp-dark); border-radius: 10px; padding: 14px 16px; margin: 16px 0; }
.task .task-title { font-weight: 800; color: #a8351a; margin-bottom: 6px; display: flex; align-items: center; gap: 8px; }
.check { display: flex; align-items: flex-start; gap: 10px; margin: 8px 0; cursor: pointer; }
.check input { margin-top: 4px; width: 17px; height: 17px; accent-color: var(--accent); cursor: pointer; flex: 0 0 auto; }
.check span { font-size: 14.5px; }
.check input:checked + span { color: var(--muted); text-decoration: line-through; }
.module-done-row { margin-top: 18px; padding-top: 14px; border-top: 1px dashed var(--line); display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.btn-done { background: var(--accent); color: #fff; border: none; border-radius: 9px; padding: 9px 18px; font-size: 14px; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; }
.btn-done:hover { filter: brightness(1.07); }
.btn-done.is-done { background: #eef6f3; color: var(--accent); border: 1px solid #bfe3d8; }

/* ---------- Cartes accueil ---------- */
.hero { background: linear-gradient(135deg, #9E3217, #d2542b); color: #fff; border-radius: 18px; padding: 46px 44px; margin-bottom: 30px; position: relative; overflow: hidden; box-shadow: var(--shadow); }
.hero::after { content: ""; position: absolute; right: -60px; bottom: -60px; width: 260px; height: 260px; background: #ffb38f; opacity: .22; border-radius: 50%; }
.hero h1 { font-size: 38px; margin: 0 0 12px; line-height: 1.15; max-width: 18ch; }
.hero p { font-size: 17px; color: #fbe4d9; margin: 0 0 24px; max-width: 60ch; }
.hero .cta { display: flex; gap: 12px; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; gap: 9px; padding: 12px 22px; border-radius: 11px; font-weight: 700; font-size: 15px; cursor: pointer; border: 1px solid transparent; }
.btn-primary { background: var(--pp); color: #fff; }
.btn-primary:hover { background: var(--pp-dark); text-decoration: none; }
.btn-ghost { background: rgba(255,255,255,.10); color: #fff; border-color: rgba(255,255,255,.30); }
.btn-ghost:hover { background: rgba(255,255,255,.18); text-decoration: none; }
.section-title { font-size: 22px; margin: 36px 0 6px; }
.section-sub { color: var(--muted); margin: 0 0 20px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 20px; }
.course-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; display: flex; flex-direction: column; transition: transform .15s, box-shadow .15s; position: relative; overflow: hidden; }
.course-card:hover { transform: translateY(-3px); box-shadow: 0 12px 30px rgba(40,20,10,.13); text-decoration: none; }
.course-card .cc-num { width: 46px; height: 46px; border-radius: 12px; background: var(--pp-deep); color: #fff; display: grid; place-items: center; font-weight: 900; font-size: 22px; margin-bottom: 14px; }
.course-card h3 { margin: 0 0 6px; font-size: 18px; color: var(--ink); }
.course-card p { margin: 0 0 14px; color: var(--ink-soft); font-size: 14px; flex: 1; }
.course-card .tags { display: flex; flex-wrap: wrap; gap: 6px; }
.course-card .tag { font-size: 11.5px; font-weight: 700; background: #f4ece8; color: var(--muted); padding: 3px 9px; border-radius: 999px; }
.course-card .cc-progress { margin-top: 14px; height: 7px; background: #eee3dd; border-radius: 999px; overflow: hidden; }
.course-card .cc-progress > span { display: block; height: 100%; width: 0; background: var(--accent); }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px,1fr)); gap: 14px; }
.tile { display: flex; align-items: center; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; box-shadow: var(--shadow); }
.tile:hover { border-color: var(--pp-dark); text-decoration: none; }
.tile .ico { font-size: 22px; flex: 0 0 auto; }
.tile .t-name { font-weight: 700; color: var(--ink); font-size: 14px; }
.tile .t-sub { font-size: 12.5px; color: var(--muted); }

.pager { display: flex; justify-content: space-between; gap: 14px; margin-top: 30px; flex-wrap: wrap; }
.pager a { flex: 1; min-width: 200px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px 20px; box-shadow: var(--shadow); }
.pager a:hover { border-color: var(--pp-dark); text-decoration: none; }
.pager .dir { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.pager .ttl { font-weight: 700; color: var(--ink); }
.pager a.next { text-align: right; }

footer.site { border-top: 1px solid var(--line); background: var(--card); padding: 22px; text-align: center; color: var(--muted); font-size: 13px; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; gap: 18px; padding: 18px 16px 60px; }
  .sidebar { position: static; max-height: none; order: -1; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
  .hero { padding: 32px 24px; }
  .hero h1 { font-size: 28px; }
}
@media (max-width: 640px) {
  html { scroll-padding-top: 64px; }
  .topbar-inner { padding: 10px 12px; gap: 10px; flex-wrap: nowrap; }
  .brand { font-size: 14px; gap: 7px; }
  .brand .logo { width: 26px; height: 26px; font-size: 15px; }
  .topnav { margin-left: auto; gap: 2px; flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 62vw; scrollbar-width: none; }
  .topnav::-webkit-scrollbar { display: none; }
  .topnav a { padding: 6px 9px; font-size: 13px; white-space: nowrap; }
  main[style] { padding-left: 14px !important; padding-right: 14px !important; }
  .page-head { padding: 18px 16px; border-radius: 12px; }
  .page-head h1 { font-size: 22px; }
  .progress-wrap { padding: 12px 14px; gap: 10px; }
  .toc a { padding: 9px 10px; font-size: 14px; }
  .module-head { padding: 14px 16px; gap: 10px; }
  .module-badge { flex-basis: 32px; height: 32px; font-size: 14px; border-radius: 9px; }
  .module-head h2 { font-size: 16.5px; }
  .module-head .done-flag { display: none !important; }
  .module-body { padding: 4px 16px 18px; }
  .steps > li { padding-left: 42px; margin-left: 12px; }
  .steps > li::before { width: 28px; height: 28px; font-size: 13px; left: -15px; }
  .callout { padding-left: 42px; font-size: 14px; }
  .check input { width: 22px; height: 22px; }
  .btn-done { padding: 12px 18px; font-size: 15px; width: 100%; justify-content: center; }
  table.demo { display: block; overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; }
  .code code { font-size: 12.5px; }
  .hero { padding: 26px 18px; border-radius: 14px; }
  .hero h1 { font-size: 23px; }
  .hero .cta { flex-direction: column; }
  .hero .btn { width: 100%; justify-content: center; }
  .section-title { font-size: 19px; margin-top: 28px; }
  .cards { grid-template-columns: 1fr; gap: 14px; }
  .tiles { grid-template-columns: 1fr; }
  .pager { flex-direction: column; }
  .pager a, .pager a.next { text-align: left; min-width: 0; }
  .q-card { padding: 16px 16px; }
  .opt { padding: 12px 13px; }
  .scorebar { padding: 12px 14px; }
  .scorebar .big { font-size: 18px; }
}
