/* Plateforme de formation C3R — feuille de style unique
   Couleur de marque : variables --brand* (redéfinies par partenaire en marque blanche). */

@font-face { font-family: Manrope; font-weight: 700; font-display: swap; src: url(../fonts/manrope-latin-700-normal.woff2) format("woff2"); }
@font-face { font-family: Manrope; font-weight: 800; font-display: swap; src: url(../fonts/manrope-latin-800-normal.woff2) format("woff2"); }
@font-face { font-family: "Source Sans 3"; font-weight: 400; font-display: swap; src: url(../fonts/source-sans-3-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Source Sans 3"; font-weight: 600; font-display: swap; src: url(../fonts/source-sans-3-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Source Sans 3"; font-weight: 700; font-display: swap; src: url(../fonts/source-sans-3-latin-700-normal.woff2) format("woff2"); }

:root {
  --brand: #2F55B0; --brand-dark: #264690; --brand-tint: #EAEEF7; --brand-tint2: #D5DDEF;
  --navy: #1F2A48; --navy-2: #2A3860;
  --text: #1F2A48; --text-2: #3D4A66; --muted: #56627D;
  --bg: #F4F7FC; --surface: #FFFFFF; --line: #E3E9F4; --line-2: #C7D2E8;
  --ok: #1E6B3A; --ok-bg: #E3F1E8; --warn: #8A3B0C; --warn-bg: #FDEBDD; --err: #A63D1F; --err-bg: #FBE9E4;
  --radius: 12px; --radius-lg: 16px;
  --font: "Source Sans 3", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-title: Manrope, "Source Sans 3", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 17px; line-height: 1.55; color: var(--text); background: var(--bg); }
img { max-width: 100%; height: auto; }
a { color: var(--brand); }
a:hover { color: var(--brand-dark); }
h1, h2, h3, h4 { font-family: var(--font-title); line-height: 1.2; margin: 0 0 .5em; letter-spacing: -0.01em; }
h1 { font-size: clamp(28px, 4vw, 38px); font-weight: 800; }
h2 { font-size: clamp(22px, 3vw, 28px); font-weight: 800; }
h3 { font-size: 20px; font-weight: 700; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.small { font-size: 15px; }
.icon { flex: none; vertical-align: middle; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
.skip-link { position: absolute; left: -9999px; top: 8px; background: #fff; padding: 8px 12px; z-index: 100; }
.skip-link:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }

/* ---------- Boutons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 20px; border-radius: 10px; border: 1px solid var(--brand); background: var(--brand); color: #fff; font: 700 16px/1.2 var(--font); text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--line-2); font-weight: 600; }
.btn-secondary:hover { background: var(--bg); color: var(--text); border-color: var(--muted); }
.btn-ghost { background: none; border-color: transparent; color: var(--brand); padding-left: 8px; padding-right: 8px; }
.btn-ghost:hover { background: var(--brand-tint); color: var(--brand-dark); border-color: transparent; }
.btn-danger { background: var(--surface); color: var(--err); border-color: #E4B5A8; }
.btn-danger:hover { background: var(--err-bg); color: var(--err); border-color: var(--err); }
.btn-lg { min-height: 52px; padding: 14px 28px; font-size: 18px; }
.btn-sm { min-height: 36px; padding: 6px 12px; font-size: 15px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

/* ---------- Cartes et grilles ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 24px; }
.card + .card { margin-top: 20px; }
.card-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.card-head h2, .card-head h3 { margin: 0; }
.card-flush { padding: 0; overflow: hidden; }
.card-flush .card-head { padding: 20px 24px; margin: 0; border-bottom: 1px solid var(--line); }
.grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.grid-2 { display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }
.stack { display: flex; flex-direction: column; gap: 20px; }
.kpis { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); margin-bottom: 24px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 22px; }
.kpi .label { color: var(--muted); font-size: 15px; margin: 0 0 4px; }
.kpi .value { font-family: var(--font-title); font-weight: 800; font-size: 32px; margin: 0; line-height: 1.1; }
.kpi .sub { color: var(--muted); font-size: 14px; margin: 4px 0 0; }

/* ---------- Badges, progression, alertes ---------- */
.badge { display: inline-block; border-radius: 999px; padding: 3px 12px; font-size: 14px; font-weight: 700; white-space: nowrap; background: #EEF1F6; color: var(--text-2); }
.badge-done, .badge-ok, .badge-sent, .badge-won { background: var(--ok-bg); color: var(--ok); }
.badge-progress, .badge-new, .badge-info { background: var(--brand-tint); color: var(--brand-dark); }
.badge-late, .badge-warn, .badge-error, .badge-lost { background: var(--warn-bg); color: var(--warn); }
.progress { height: 10px; background: var(--brand-tint); border-radius: 999px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--brand); border-radius: 999px; }
.alert { border-radius: 10px; padding: 14px 18px; margin-bottom: 20px; font-weight: 600; }
.alert-success { background: var(--ok-bg); color: #14472A; }
.alert-error { background: var(--err-bg); color: #6E2814; }
.alert-info { background: var(--brand-tint); color: var(--brand-dark); }
.alert-warning { background: var(--warn-bg); color: var(--warn); }
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }

/* ---------- Formulaires ---------- */
.form { display: flex; flex-direction: column; gap: 18px; }
.form-grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-weight: 600; font-size: 16px; }
.field input:not([type=checkbox]):not([type=radio]), .field select, .field textarea, input.input, select.input {
  width: 100%; border: 1px solid var(--line-2); border-radius: 8px; padding: 10px 14px; font: 17px/1.4 var(--font); color: var(--text); background: #fff; min-height: 44px; }
.field textarea { resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--brand); outline: 2px solid var(--brand-tint2); outline-offset: 0; }
.field input[type=color] { padding: 4px; width: 80px; }
.field-check { flex-direction: row; align-items: flex-start; gap: 10px; }
.field-check input { width: 20px; height: 20px; margin-top: 3px; flex: none; }
.field-check label { font-weight: 400; color: var(--text-2); font-size: 16px; }
.help { margin: 0; font-size: 14px; color: var(--muted); }
fieldset { border: none; margin: 0; padding: 0; }
legend { font-weight: 700; margin-bottom: 8px; padding: 0; }

/* ---------- Tableaux ---------- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 16px; }
.table th { text-align: left; font-weight: 700; padding: 12px 16px; background: var(--bg); white-space: nowrap; }
.table td { padding: 13px 16px; border-top: 1px solid var(--line); vertical-align: middle; }
.table tr:hover td { background: #FAFBFE; }
.table .num { text-align: right; white-space: nowrap; }
.table .actions { text-align: right; white-space: nowrap; }
.table th:first-child, .table td:first-child { padding-left: 24px; }
.table th:last-child, .table td:last-child { padding-right: 24px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { display: inline-flex; align-items: center; min-height: 38px; border-radius: 999px; padding: 6px 16px; border: 1px solid var(--line-2); background: #fff; color: var(--text); text-decoration: none; font-size: 15px; }
.pill:hover { border-color: var(--muted); color: var(--text); }
.pill.active { background: var(--navy); border-color: var(--navy); color: #fff; font-weight: 700; }

/* ---------- Mise en page des espaces connectés ---------- */
.app { min-height: 100vh; display: flex; flex-wrap: wrap; }
.sidebar { flex: 1 1 260px; max-width: 280px; background: var(--surface); border-right: 1px solid var(--line); padding: 20px 16px; display: flex; flex-direction: column; gap: 24px; }
.sidebar .brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px; text-decoration: none; color: var(--text); }
.sidebar .brand img { height: 40px; width: auto; }
.sidebar .brand .brand-name { font-family: var(--font-title); font-weight: 800; font-size: 18px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--text-2); text-decoration: none; font-weight: 600; min-height: 44px; }
.nav a:hover { background: var(--bg); color: var(--text); }
.nav a.active { background: var(--brand-tint); color: var(--brand-dark); }
.nav-title { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 0 12px; margin: 8px 0 4px; }
.sidebar .user-box { margin-top: auto; border-top: 1px solid var(--line); padding: 16px 8px 0; font-size: 15px; }
.sidebar .user-box strong { display: block; }
.main { flex: 999 1 560px; min-width: 0; padding: 32px clamp(16px, 4vw, 48px) 80px; }
.page-head { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; justify-content: space-between; margin-bottom: 28px; }
.page-head h1 { margin: 0; }
.page-head p { margin: 6px 0 0; color: var(--muted); }
.breadcrumb { font-size: 15px; margin-bottom: 8px; }
.breadcrumb a { text-decoration: none; }
.powered { font-size: 13px; color: var(--muted); text-align: center; margin-top: 40px; }
.menu-toggle { display: none; }
@media (max-width: 860px) {
  .app { flex-direction: column; }
  .sidebar { max-width: none; flex: none; border-right: none; border-bottom: 1px solid var(--line); padding: 12px 16px; gap: 12px; }
  .sidebar-top { display: flex; align-items: center; justify-content: space-between; }
  .menu-toggle { display: inline-flex; }
  .sidebar .nav, .sidebar .user-box, .sidebar .nav-title { display: none; }
  .sidebar.open .nav, .sidebar.open .user-box, .sidebar.open .nav-title { display: flex; }
  .sidebar.open .nav-title { display: block; }
  .sidebar.open .user-box { display: block; }
  .main { padding-top: 24px; }
}

/* ---------- Site public ---------- */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.site-header { background: #fff; border-bottom: 1px solid var(--line); position: relative; z-index: 5; }
.site-header .container { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding-top: 14px; padding-bottom: 14px; }
.site-header .logo { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text); }
.site-header .logo img { height: 48px; width: auto; }
.site-header .logo span { font-family: var(--font-title); font-weight: 700; font-size: 16px; }
.site-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 22px; font-size: 16px; }
.site-nav a:not(.btn) { color: var(--text); text-decoration: none; }
.site-nav a:not(.btn):hover { color: var(--brand); }
.hero { background: var(--bg); }
.hero .container { padding-top: clamp(48px, 8vw, 96px); padding-bottom: clamp(48px, 7vw, 88px); display: flex; flex-wrap: wrap; gap: 48px; align-items: center; }
.hero h1 { font-size: clamp(34px, 5vw, 54px); line-height: 1.1; letter-spacing: -0.02em; margin-bottom: 24px; }
.hero .lead { font-size: clamp(18px, 2vw, 21px); color: var(--text-2); max-width: 600px; margin-bottom: 32px; }
.eyebrow { margin: 0 0 14px; font-weight: 700; color: var(--brand); font-size: 15px; letter-spacing: .08em; text-transform: uppercase; }
.section { padding: clamp(56px, 8vw, 88px) 0; }
.section-alt { background: var(--bg); }
.section-dark { background: var(--navy); color: #fff; }
.section-dark p { color: #D3DCEE; }
.section-tint { background: var(--brand-tint); }
.section h2 { font-size: clamp(26px, 3.5vw, 38px); }
.section .intro { color: var(--text-2); max-width: 760px; margin-bottom: 40px; }
.section-dark .intro { color: #D3DCEE; }
.feature { border: 1px solid var(--line); border-radius: 14px; padding: 28px; background: #fff; }
.feature h3 { margin-bottom: 8px; }
.feature p { color: var(--text-2); margin: 0; }
.step-card { background: var(--navy-2); border-radius: 16px; padding: 32px; }
.step-card .num { font-family: var(--font-title); font-weight: 800; font-size: 44px; color: #9DB8EC; margin: 0 0 8px; line-height: 1; }
.step-card h3 { color: #fff; }
.module-card { border: 1px solid var(--line); border-radius: 14px; padding: 24px; display: flex; gap: 20px; background: #fff; }
.module-card .n { flex: none; width: 48px; height: 48px; border-radius: 50%; background: var(--brand-tint); color: var(--brand); display: flex; align-items: center; justify-content: center; font-family: var(--font-title); font-weight: 800; font-size: 20px; }
.module-card h3 { font-size: 19px; margin-bottom: 4px; }
.module-card p { margin: 0 0 8px; color: var(--text-2); font-size: 16px; }
.price-card { border: 1px solid var(--line); border-radius: 16px; padding: 32px; display: flex; flex-direction: column; gap: 14px; background: #fff; }
.price-card.featured { border: 2px solid var(--brand); }
.price-card .price { font-family: var(--font-title); font-weight: 800; font-size: 30px; margin: 0; }
.timeline { background: #fff; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.timeline div { display: flex; flex-wrap: wrap; gap: 4px 24px; padding: 18px 24px; border-bottom: 1px solid var(--line); }
.timeline div:last-child { border-bottom: none; }
.timeline b { flex: 0 0 110px; color: var(--brand); }
.faq details { border-bottom: 1px solid var(--line); padding: 4px 0; }
.faq summary { cursor: pointer; padding: 18px 0; font-weight: 700; font-size: 19px; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--brand); font-size: 26px; line-height: 1; }
.faq details[open] summary::after { content: "−"; }
.faq details p { color: var(--text-2); }
.site-footer { border-top: 1px solid var(--line); background: #fff; }
.site-footer .container { display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; align-items: center; padding-top: 32px; padding-bottom: 32px; font-size: 15px; color: var(--muted); }
.site-footer a { color: var(--muted); }
.checklist { display: flex; flex-direction: column; gap: 18px; }
.checklist div { display: flex; gap: 14px; align-items: flex-start; }
.checklist .icon { color: var(--brand); margin-top: 3px; }

/* ---------- Pages d'authentification ---------- */
.auth-wrap { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 16px; }
.auth-card { width: 100%; max-width: 460px; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 40px; }
.auth-card .logo { display: flex; justify-content: center; margin-bottom: 24px; }
.auth-card .logo img { height: 52px; width: auto; }
.auth-card h1 { font-size: 28px; text-align: center; }

/* ---------- Espace stagiaire ---------- */
.hero-progress { background: var(--navy); color: #fff; border-radius: 16px; padding: 32px; }
.hero-progress .progress { background: #3A4A75; height: 12px; }
.hero-progress .progress > span { background: #9DB8EC; }
.hero-progress p { color: #C5D2EC; }
.player { aspect-ratio: 16 / 9; background: #0F1626; border-radius: 16px; overflow: hidden; display: flex; align-items: center; justify-content: center; color: #fff; }
.player video { width: 100%; height: 100%; display: block; background: #000; }
.player .placeholder { text-align: center; padding: 24px; color: #C5D2EC; }
.lesson-list { background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.lesson-list a { display: flex; gap: 14px; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--text); min-height: 56px; }
.lesson-list a:last-child { border-bottom: none; }
.lesson-list a:hover { background: var(--bg); }
.lesson-list a.current { background: var(--brand-tint); }
.lesson-list .dot { flex: none; width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line-2); display: flex; align-items: center; justify-content: center; color: #fff; }
.lesson-list .dot.done { background: var(--brand); border-color: var(--brand); }
.quiz-q { border: 1px solid var(--line); border-radius: 14px; padding: 24px; background: #fff; }
.quiz-q h3 { font-size: 19px; line-height: 1.4; }
.quiz-opt { display: flex; gap: 12px; align-items: flex-start; border: 1px solid var(--line-2); border-radius: 10px; padding: 12px 16px; margin-top: 10px; cursor: pointer; }
.quiz-opt:hover { border-color: var(--brand); }
.quiz-opt input { margin-top: 4px; width: 18px; height: 18px; flex: none; }
.quiz-opt.correct { background: var(--ok-bg); border: 2px solid var(--ok); }
.quiz-opt.wrong { background: var(--err-bg); border: 2px solid var(--err); }
.explain { margin-top: 14px; padding: 14px 16px; border-radius: 10px; background: var(--bg); color: var(--text-2); }
.transcript { white-space: pre-line; color: var(--text-2); }

/* ---------- Barres horizontales (statistiques) ---------- */
.hbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.hbar .name { flex: 0 0 300px; font-size: 16px; }
.hbar .progress { flex: 1 1 260px; height: 14px; }
.hbar .val { flex: 0 0 60px; text-align: right; font-weight: 700; }

@media print { .sidebar, .site-header, .site-footer, .btn { display: none !important; } .main { padding: 0; } }
