/* Académie Finance — sobre, inspiré des plateformes de cours (Udemy) : blanc, gris clair, une seule couleur d'accent.
   Police unique : Figtree. Pour changer l'accent, modifier --brand / --brand-2 / --brand-soft. */
:root {
  --bg: #ffffff; --surface: #ffffff; --sunken: #f6f7f9; --ink: #2d2f31; --muted: #595c73; --line: #d1d2e0; --line-strong: #9194ac;
  --brand: #0a6b50; --brand-2: #07513c; --brand-deep: #1d1e27; --brand-soft: #e6f2ed;
  --gold: #0a6b50; --gold-fill: #0a6b50; --gold-soft: #f6f7f9;
  --danger: #a8322a; --danger-soft: #f7e4e0; --warning: #8a5a00; --warning-soft: #f8edd4;
  --success: #17704a; --success-soft: #e1efe5; --info: #24557f; --info-soft: #e4edf5;
  --radius: 6px; --radius-lg: 10px;
  --sans: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: var(--sans); --mono: var(--sans);
  --ease: cubic-bezier(.2, .7, .2, 1);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--sans); background: var(--bg); color: var(--ink); line-height: 1.6; font-size: 16px;
  font-feature-settings: "tnum" 1; -webkit-font-smoothing: antialiased; }
a { color: var(--brand); text-decoration: underline; text-decoration-color: color-mix(in srgb, currentColor 30%, transparent);
  text-underline-offset: 3px; transition: color .15s var(--ease), text-decoration-color .15s var(--ease); }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 2px; }
h1, h2, h3 { font-family: var(--sans); font-weight: 700; line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(1.8rem, 3.2vw, 2.4rem); }
h2 { font-size: clamp(1.35rem, 2.2vw, 1.7rem); }
h3 { font-size: 1.18rem; }
.container { max-width: 1160px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 760px; }
.ico { flex-shrink: 0; vertical-align: -0.2em; }
.eyebrow { font: 700 .78rem/1 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--brand); margin: 0 0 14px; display: block; }

/* Header */
.site-header { background: #fff; box-shadow: 0 2px 4px rgba(0,0,0,.06), 0 4px 12px rgba(0,0,0,.04); position: sticky; top: 0; z-index: 20; }
.nav { display: flex; align-items: center; gap: 28px; min-height: 68px; flex-wrap: wrap; }
.logo { font: 800 1.2rem/1 var(--sans); color: var(--ink); display: flex; align-items: center; gap: 10px; text-decoration: none; letter-spacing: -.01em; }
.logo span { width: 28px; height: 28px; display: inline-grid; place-items: center; background: var(--brand); color: var(--gold-fill);
  border-radius: 3px; font: 600 .78rem/1 var(--mono); letter-spacing: 0; }
.logo img { width: 34px; height: 34px; display: block; }
.nav-links { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
.nav-links a { color: var(--muted); font-weight: 500; font-size: .93rem; text-decoration: none; padding: 8px 10px; border-radius: var(--radius);
  position: relative; }
.nav-links a:hover { color: var(--ink); background: var(--sunken); }
.nav-links a.active { color: var(--ink); }
.nav-links a.active::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -15px; height: 2px; background: var(--ink); }
.nav-user { display: flex; gap: 8px; align-items: center; }
.nav-user form { margin: 0; }
.nav .menu-toggle { display: none; }
@media (max-width: 980px) {
  .nav { gap: 12px; }
  .nav .menu-toggle { display: inline-flex; margin-left: auto; }
  .nav-links, .nav-user { display: none; width: 100%; flex-direction: column; gap: 2px; padding-bottom: 14px; }
  .nav-links a { padding: 12px 10px; }
  .nav-links a.active::after { display: none; }
  .nav-links a.active { background: var(--sunken); }
  .nav.open .nav-links, .nav.open .nav-user { display: flex; align-items: stretch; }
}

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 20px; border-radius: var(--radius-lg);
  border: 1px solid var(--brand); font: 700 .94rem/1.2 var(--sans); cursor: pointer; background: var(--brand); color: #fff;
  text-decoration: none; transition: background .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease); }
.btn:hover { background: var(--brand-2); border-color: var(--brand-2); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn-ghost:hover { background: var(--sunken); }
.btn-gold { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-gold:hover { background: var(--brand-2); border-color: var(--brand-2); }
.btn-danger { background: transparent; color: var(--danger); border-color: var(--line-strong); }
.btn-danger:hover { background: var(--danger-soft); border-color: var(--danger); }
.btn-sm { min-height: 36px; padding: 6px 14px; font-size: .86rem; }
.btn-link { background: none; border: none; color: var(--danger); cursor: pointer; padding: 0; font: inherit; }
.btn .ico { transition: transform .2s var(--ease); }
.btn:hover .ico-move { transform: translateX(3px); }

/* Layout pieces */
main { padding: 40px 0 80px; }
.hero { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 56px; align-items: end;
  padding: 24px 0 48px; margin-bottom: 8px; }
.hero h1 { font-size: clamp(2.1rem, 4.4vw, 3.2rem); line-height: 1.1; letter-spacing: -.02em; margin-bottom: 20px; }
.hero h1 em { font-style: normal; color: var(--brand); }
.hero p { font-size: 1.12rem; color: var(--muted); max-width: 560px; margin: 0; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }
@media (max-width: 900px) { .hero { grid-template-columns: 1fr; gap: 36px; } }

/* Panneau de séance (accueil) */
.tape { background: var(--brand-deep); color: #f1f1f5; border-radius: var(--radius-lg); padding: 22px 22px 14px; }
.tape-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 14px;
  font: 600 .72rem/1 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: #b4b6c8; }
.tape-index { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; padding-bottom: 16px; border-bottom: 1px solid rgba(255,255,255,.14); }
.tape-index strong { font: 700 2.3rem/1 var(--sans); color: #fff; letter-spacing: -.01em; }
.tape-index small { color: #b4b6c8; font-size: .85rem; width: 100%; }
.tape .up { color: #7fd6a4; } .tape .down { color: #f2a196; }
.tape-rows { list-style: none; margin: 0; padding: 0; }
.tape-rows li { display: grid; grid-template-columns: 64px 1fr auto; gap: 12px; align-items: center; padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,.08); font-size: .9rem; }
.tape-rows li:last-child { border-bottom: 0; }
.tape-rows a { color: inherit; text-decoration: none; display: contents; }
.tape-rows .sym { font: 700 .85rem/1 var(--sans); color: #fff; }
.tape-rows .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #d1d2e0; }
.tape-rows .chg { font-family: var(--mono); font-size: .85rem; }
.tape-foot { display: block; margin-top: 8px; font-size: .84rem; color: #fff; }

/* Chiffres clés */
.figures { display: grid; grid-template-columns: repeat(4, 1fr); background: var(--sunken); border-radius: var(--radius-lg); margin-bottom: 8px; }
.figures div { padding: 24px; border-left: 1px solid var(--line); }
.figures div:first-child { border-left: 0; }
.figures strong { display: block; font: 700 2.2rem/1 var(--sans); color: var(--ink); margin-bottom: 6px; }
.figures span { color: var(--muted); font-size: .9rem; }
@media (max-width: 640px) {
  .figures { grid-template-columns: repeat(2, 1fr); }
  .figures div { padding: 18px; border-left: 0; border-top: 1px solid var(--line); }
  .figures div:nth-child(-n+2) { border-top: 0; }
  .figures div:nth-child(odd) { padding-left: 18px; }
  .figures strong { font-size: 1.9rem; }
}

/* Parcours en liste numérotée */
.index-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); counter-reset: idx; }
.index-list li { counter-increment: idx; border-bottom: 1px solid var(--line); }
.index-list a { display: grid; grid-template-columns: 56px 44px minmax(0, 1fr) auto; gap: 20px; align-items: center;
  padding: 22px 8px; color: inherit; text-decoration: none; transition: background .15s var(--ease); }
.index-list a::before { content: counter(idx, decimal-leading-zero); font: 700 1rem/1 var(--sans); color: var(--line-strong); }
.index-list a:hover { background: var(--sunken); }
.index-list a:hover h3 { color: var(--brand); }
.index-list h3 { margin: 0 0 4px; font-size: 1.35rem; transition: color .15s var(--ease); }
.index-list p { margin: 0; color: var(--muted); font-size: .94rem; }
.index-list .count { font-size: .85rem; color: var(--muted); white-space: nowrap; display: inline-flex; gap: 8px; align-items: center; }
.icon-box { width: 44px; height: 44px; border: 1px solid var(--line-strong); border-radius: var(--radius); display: grid; place-items: center; color: var(--brand); background: var(--surface); }
@media (max-width: 640px) {
  .index-list a { grid-template-columns: 32px minmax(0, 1fr); gap: 4px 12px; padding: 18px 0; }
  .index-list .icon-box, .index-list .count .ico { display: none; }
  .index-list .count { grid-column: 2; }
}

.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
@media (max-width: 560px) { .grid { gap: 12px; } .card { padding: 18px; } .grid-2, .grid-3 { grid-template-columns: 1fr; } }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 24px; }
.card h3 a { color: var(--ink); text-decoration: none; }
.card-link { display: block; color: inherit; text-decoration: none; transition: border-color .15s var(--ease), background .15s var(--ease); }
.card-link:hover { border-color: var(--ink); }
.card-link:hover h3 { color: var(--brand); }
.card-link h3 { transition: color .15s var(--ease); }
.stat { text-align: left; }
.stat strong { display: block; font: 700 clamp(1.3rem, 2.3vw, 1.9rem)/1.2 var(--sans); color: var(--ink); overflow-wrap: break-word; margin-bottom: 4px; }
.stat span { color: var(--muted); font-size: .88rem; }
.section { margin: 64px 0; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.section-head h2 { margin: 0; }
.section-head a { font-weight: 500; font-size: .93rem; display: inline-flex; gap: 6px; align-items: center; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.icon { width: 40px; height: 40px; display: grid; place-items: center; border-radius: var(--radius); background: var(--brand-soft); color: var(--brand); margin-bottom: 16px; font-size: 1.3rem; }
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: .74rem; font-weight: 600; letter-spacing: .02em; padding: 3px 9px; border-radius: 3px;
  background: var(--brand-soft); color: var(--brand); vertical-align: middle; }
.tag-gold { background: #fdecea; color: #a8322a; }
.tag-grey { background: var(--sunken); color: var(--muted); }
.meta { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 8px 0 12px; }
.breadcrumb { font-size: .86rem; color: var(--muted); margin-bottom: 16px; }
.breadcrumb a { color: var(--muted); }

/* Outils */
.tools { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 0 40px; }
.tools a { display: flex; gap: 16px; align-items: flex-start; padding: 20px 0; border-top: 1px solid var(--line); color: inherit; text-decoration: none; }
.tools a:hover h3 { color: var(--brand); }
.tools h3 { font-size: 1.08rem; margin: 0 0 4px; transition: color .15s var(--ease); }
.tools p { margin: 0; color: var(--muted); font-size: .9rem; }

/* Progress */
.progress { background: var(--sunken); border-radius: 2px; height: 6px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--brand); border-radius: 2px; }
.progress.gold > span { background: var(--gold-fill); }
.progress.over > span { background: var(--danger); }

/* Lists */
.lesson-list { list-style: none; padding: 0; margin: 0; }
.lesson-list li { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.lesson-list li:last-child { border-bottom: 0; }
.num { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line-strong); color: var(--muted); display: inline-flex; align-items: center; justify-content: center;
  font: 500 .8rem/1 var(--mono); flex-shrink: 0; }
.num.done { background: var(--brand); border-color: var(--brand); color: #fff; }

/* Lesson content */
.prose { font-size: 1.07rem; line-height: 1.75; max-width: 68ch; }
.prose h2 { margin-top: 1.6em; } .prose h3 { margin-top: 1.4em; }
.prose table { border-collapse: collapse; width: 100%; margin: 1.2em 0; font-size: .93rem; display: block; overflow-x: auto; }
.prose th, .prose td { border-bottom: 1px solid var(--line); padding: 9px 12px; text-align: left; }
.prose th { border-bottom: 1px solid var(--ink); font-weight: 600; }
.prose blockquote { margin: 1.4em 0; padding: 12px 18px; border-left: 3px solid var(--brand); background: var(--sunken); color: var(--ink); }
.prose blockquote p { margin: 0; }
.keypoints { background: var(--surface); border: 1px solid var(--line); border-top: 3px solid var(--brand); border-radius: var(--radius); padding: 20px 24px; margin: 32px 0; }
.keypoints h3 { color: var(--brand); display: flex; gap: 8px; align-items: center; }
.keypoints ul { margin: 0; padding-left: 20px; }
.keypoints li { margin: 4px 0; }
.lesson-layout { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 48px; align-items: start; }
.lesson-side { position: sticky; top: 92px; }
.lesson-side ol { padding-left: 20px; margin: 0; font-size: .92rem; }
.lesson-side li { margin: 8px 0; }
.lesson-side li a { color: var(--muted); text-decoration: none; }
.lesson-side li a:hover { color: var(--ink); }
.lesson-side li.current a { font-weight: 600; color: var(--ink); }
@media (max-width: 900px) { .lesson-layout { grid-template-columns: 1fr; } .lesson-side { position: static; } }
.pager { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--line); }

/* Forms */
form p, .field { margin: 0 0 16px; }
label { display: block; font-weight: 600; font-size: .88rem; margin-bottom: 6px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=month], input[type=date], input[type=search], select, textarea {
  width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius); font: inherit; background: #fff; color: var(--ink);
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.helptext, .field small { display: block; color: var(--muted); font-size: .82rem; margin-top: 4px; }
.errorlist { color: var(--danger); list-style: none; padding: 0; margin: 4px 0; font-size: .88rem; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 16px; }
.form-inline { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; align-items: end; }
.form-inline p { margin: 0; }

/* Alerts */
.messages { list-style: none; padding: 0; margin: 0 0 24px; }
.alert { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 10px; border: 1px solid transparent; border-left-width: 3px; }
.alert-success { background: var(--success-soft); color: var(--success); border-left-color: var(--success); }
.alert-info { background: var(--info-soft); color: var(--info); border-left-color: var(--info); }
.alert-warning { background: var(--warning-soft); color: var(--warning); border-left-color: var(--warning); }
.alert-danger, .alert-error { background: var(--danger-soft); color: var(--danger); border-left-color: var(--danger); }

/* Quiz */
.question { margin-bottom: 28px; }
.question legend { font: 700 1.12rem/1.35 var(--sans); margin-bottom: 12px; }
.question fieldset { border: 0; padding: 0; margin: 0; }
.choice { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 8px;
  cursor: pointer; font-weight: 400; background: var(--surface); transition: border-color .15s var(--ease), background .15s var(--ease); }
label.choice:hover { border-color: var(--ink); }
label.choice:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.choice input { margin-top: 4px; accent-color: var(--brand); width: 16px; height: 16px; flex-shrink: 0; }
.choice .ico { margin-top: 3px; }
.choice.correct { border-color: var(--success); background: var(--success-soft); }
.choice.wrong { border-color: var(--danger); background: var(--danger-soft); }
.score-ring { width: 148px; height: 148px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font: 700 2.4rem/1 var(--sans); margin: 0 auto 16px; border: 3px solid currentColor; }
.score-pass { background: var(--success-soft); color: var(--success); }
.score-fail { background: var(--warning-soft); color: var(--warning); }

/* Tables */
.table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.table th, .table td { padding: 11px 10px; border-bottom: 1px solid var(--line); text-align: left; }
.table th { color: var(--muted); font-weight: 600; font-size: .74rem; text-transform: uppercase; letter-spacing: .08em; border-bottom-color: var(--ink); }
.table tbody tr { transition: background .12s var(--ease); }
.table tbody tr:hover { background: color-mix(in srgb, var(--sunken) 50%, transparent); }
.table td.num-cell, .table th.num-cell { text-align: right; white-space: nowrap; }
.table-wrap { overflow-x: auto; }
.big-number { font: 700 2rem/1.15 var(--sans); color: var(--ink); }
.positive { color: var(--success); } .negative { color: var(--danger); }

details.solution { margin-top: 24px; border: 1px solid var(--line); border-left: 3px solid var(--gold-fill); border-radius: var(--radius); background: var(--surface); padding: 16px 20px; }
details.solution summary { cursor: pointer; font-weight: 600; color: var(--ink); }

.site-footer { background: var(--brand-deep); padding: 40px 0 48px; color: #b4b6c8; font-size: .88rem; }
.site-footer .logo { color: #fff; }
.disclaimer { font-size: .8rem; color: #b4b6c8; max-width: 820px; }
.bar-row { display: grid; grid-template-columns: 170px 1fr 120px; gap: 10px; align-items: center; margin: 8px 0; font-size: .92rem; }
@media (max-width: 560px) { .bar-row { grid-template-columns: 1fr; gap: 4px; } }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }
