/* ==========================================================================
   FTPS — système visuel
   Blanc chaud, bleu marine profond, bleu confiance, vert sauge.
   ========================================================================== */
:root {
  --bg: #FAFAF8;
  --surface: #FFFFFF;
  --surface-2: #F4F4F0;
  --navy: #1E3A5F;
  --navy-2: #2B4C77;
  --navy-deep: #16304F;
  --blue: #1070B4;
  --blue-hover: #0C5C96;
  --blue-soft: #EAF3FA;
  --blue-line: #C4DCEF;
  --sage: #4CAF8C;
  --sage-dark: #2F8468;
  --sage-soft: #EBF6F1;
  --sage-line: #C5E6D8;
  --amber: #A86B12;
  --amber-soft: #FBF4E6;
  --amber-line: #F0DDB6;
  --danger: #C23B41;
  --danger-soft: #FCEEEE;
  --danger-line: #F3C9CB;
  --ink: #17222F;
  --ink-2: #4A5665;
  --ink-3: #7C8693;
  --line: #ECEAE4;
  --line-2: #E2E0D9;
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 24px;
  --shadow-1: 0 1px 2px rgba(30, 58, 95, .04), 0 1px 1px rgba(30, 58, 95, .02);
  --shadow-2: 0 1px 2px rgba(30, 58, 95, .04), 0 10px 30px -12px rgba(30, 58, 95, .12);
  --shadow-3: 0 2px 6px rgba(30, 58, 95, .05), 0 24px 60px -24px rgba(30, 58, 95, .22);
  --font: "Inter", "Source Sans 3", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --header-h: 64px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.6; color: var(--ink); background: var(--bg);
  -webkit-font-smoothing: antialiased; font-feature-settings: "cv11", "ss01"; overflow-x: clip;
}
a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue-hover); }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { margin: 0 0 .5em; color: var(--navy); line-height: 1.2; }
h1 { font-size: clamp(1.75rem, 1.2rem + 1.6vw, 2.35rem); font-weight: 700; letter-spacing: -.025em; }
h2 { font-size: 1.3rem; font-weight: 650; letter-spacing: -.015em; }
h3 { font-size: 1.05rem; font-weight: 620; letter-spacing: -.01em; }
p { margin: 0 0 1em; }
small, .muted { color: var(--ink-3); }
strong { font-weight: 620; }
code { background: var(--surface-2); padding: 1px 6px; border-radius: 6px; font-size: .88em; color: var(--navy); }
hr { border: 0; border-top: 1px solid var(--line); margin: 28px 0; }
::selection { background: var(--blue-soft); color: var(--navy); }
:focus-visible { outline: 3px solid rgba(16, 112, 180, .35); outline-offset: 2px; border-radius: 6px; }
.icon { width: 1.15em; height: 1.15em; flex: none; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; vertical-align: -.2em; }
.display { font-size: clamp(2.1rem, 1.3rem + 3vw, 3.4rem); font-weight: 700; letter-spacing: -.035em; line-height: 1.05; color: var(--navy); margin: 0 0 .3em; }
.lead { font-size: 1.15rem; color: var(--ink-2); line-height: 1.55; max-width: 60ch; }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- En-tête ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30; height: var(--header-h);
  background: rgba(250, 250, 248, .78); backdrop-filter: saturate(180%) blur(18px); -webkit-backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid rgba(30, 58, 95, .07);
}
.topbar-inner { max-width: 1320px; height: 100%; margin: 0 auto; padding: 0 24px; display: flex; align-items: center; gap: 20px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--navy); font-weight: 700; font-size: 1.12rem; letter-spacing: -.02em; }
.brand:hover { color: var(--navy); }
.brand .sub { font-weight: 500; font-size: .8rem; color: var(--ink-3); letter-spacing: 0; margin-left: 2px; padding-left: 10px; border-left: 1px solid var(--line-2); }
.mark { display: grid; place-items: center; flex: none; border-radius: 9px; background: var(--navy); color: #fff; font-weight: 750; letter-spacing: -.04em; }
.nav { display: flex; gap: 2px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a { position: relative; color: var(--ink-2); padding: 8px 10px; border-radius: 999px; font-weight: 520; font-size: .93rem; white-space: nowrap; transition: color .2s, background .2s; }
.nav a:hover { color: var(--navy); background: rgba(30, 58, 95, .05); }
.nav a.active { color: var(--navy); font-weight: 620; background: rgba(30, 58, 95, .07); }
.usermenu { display: flex; align-items: center; gap: 12px; font-size: .9rem; color: var(--ink-2); }
.usermenu form { margin: 0; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--blue-soft); color: var(--navy); display: grid; place-items: center; font-weight: 700; font-size: .78rem; border: 1px solid var(--blue-line); }
.avatar:hover { color: var(--navy); background: #E3ECFD; }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; border: 0; background: transparent; color: var(--ink-2); cursor: pointer; }
.icon-btn:hover { background: rgba(30, 58, 95, .06); color: var(--navy); }

/* ---------- Mise en page ---------- */
.container { max-width: 1240px; margin: 0 auto; padding: 40px 24px 80px; }
.container.narrow { max-width: 860px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 28px; flex-wrap: wrap; }
.page-head h1 { margin: 0; }
.page-head p { margin: 6px 0 0; color: var(--ink-2); }
.breadcrumb { display: flex; align-items: center; gap: 6px; font-size: .86rem; color: var(--ink-3); margin-bottom: 10px; flex-wrap: wrap; }
.breadcrumb a { color: var(--ink-3); }
.breadcrumb a:hover { color: var(--navy); }
.section { margin-top: 48px; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-bottom: 18px; }
.section-head h2 { margin: 0; font-size: 1.45rem; }
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; align-items: start; }
@media (max-width: 960px) { .split { grid-template-columns: minmax(0, 1fr); } }
.stack > * + * { margin-top: 20px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.right { margin-left: auto; }
.sticky { position: sticky; top: calc(var(--header-h) + 20px); }

/* ---------- Surfaces ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-1); padding: 24px; }
.card.flush { padding: 0; overflow: hidden; }
.card.soft { background: var(--surface-2); border-color: transparent; box-shadow: none; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 18px 24px; border-bottom: 1px solid var(--line); }
.card-head h2, .card-head h3 { margin: 0; }
.card-head h2 { font-size: 1.1rem; }
.card-body { padding: 24px; }
.tile { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-2); border: 1px solid var(--line); overflow: hidden; }

.stat { padding: 22px 24px; }
.stat .label { font-size: .88rem; color: var(--ink-3); font-weight: 520; display: flex; align-items: center; gap: 8px; }
.stat .label .icon { color: var(--blue); }
.stat .value { font-size: 2.2rem; font-weight: 700; margin-top: 6px; letter-spacing: -.03em; color: var(--navy); font-variant-numeric: tabular-nums; line-height: 1.1; }
.stat .sub { font-size: .85rem; color: var(--ink-3); margin-top: 4px; }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 20px; border-radius: 999px;
  border: 1px solid transparent; background: var(--blue); color: #fff; font: inherit; font-weight: 600; font-size: .93rem; letter-spacing: -.005em;
  cursor: pointer; text-decoration: none; line-height: 1.2; white-space: nowrap; transition: background .2s var(--ease), transform .12s var(--ease), box-shadow .2s;
  box-shadow: 0 1px 2px rgba(16, 112, 180, .25);
}
.btn:hover { background: var(--blue-hover); color: #fff; }
.btn:active { transform: scale(.98); }
.btn:disabled, .btn.disabled { opacity: .4; cursor: not-allowed; pointer-events: none; box-shadow: none; }
.btn.secondary { background: var(--surface); color: var(--navy); border-color: var(--line-2); box-shadow: var(--shadow-1); }
.btn.secondary:hover { background: #F7F7F4; border-color: #D5D3CB; color: var(--navy); }
.btn.ghost { background: transparent; color: var(--navy); box-shadow: none; }
.btn.ghost:hover { background: rgba(30, 58, 95, .06); }
.btn.danger { background: var(--surface); color: var(--danger); border-color: var(--danger-line); box-shadow: none; }
.btn.danger:hover { background: var(--danger-soft); }
.btn.success { background: var(--sage); box-shadow: 0 1px 2px rgba(76, 175, 140, .3); }
.btn.success:hover { background: var(--sage-dark); }
.btn.navy { background: var(--navy); box-shadow: none; }
.btn.navy:hover { background: var(--navy-deep); }
.btn.light { background: #fff; color: var(--navy); box-shadow: none; }
.btn.light:hover { background: #F1F4F9; color: var(--navy); }
.btn.small { min-height: 34px; padding: 0 14px; font-size: .85rem; }
.btn.large { min-height: 50px; padding: 0 28px; font-size: 1rem; }
.btn.block { width: 100%; }
.linkbtn { background: none; border: 0; color: var(--blue); font: inherit; cursor: pointer; padding: 0; font-weight: 520; }
.linkbtn:hover { color: var(--blue-hover); }
.linkbtn.danger { color: var(--danger); }
form.inline { display: inline; margin: 0; }

/* ---------- Formulaires ---------- */
label { display: block; font-weight: 580; font-size: .9rem; margin-bottom: 6px; color: var(--navy); }
.field { margin-bottom: 18px; }
.field .hint { font-size: .83rem; color: var(--ink-3); margin-top: 6px; font-weight: 400; }
input:not([type]), input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=time], input[type=url], input[type=search], select, textarea {
  width: 100%; min-height: 44px; padding: 10px 14px; border: 1px solid var(--line-2); border-radius: var(--r-sm); font: inherit; font-size: .95rem;
  background: #fff; color: var(--ink); transition: border-color .15s, box-shadow .15s; -webkit-appearance: none; appearance: none;
}
select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237C8693' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 38px; }
input::placeholder, textarea::placeholder { color: #A3AAB3; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px rgba(16, 112, 180, .12); }
input[type=file] { font: inherit; font-size: .88rem; color: var(--ink-2); }
input[type=file]::file-selector-button { font: inherit; font-weight: 600; font-size: .85rem; border: 1px solid var(--line-2); background: #fff; color: var(--navy); padding: 8px 14px; border-radius: 999px; margin-right: 12px; cursor: pointer; }
textarea { min-height: 120px; resize: vertical; line-height: 1.55; }
textarea.tall { min-height: 340px; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: .87rem; }
input[type=checkbox], input[type=radio] { accent-color: var(--blue); }
.check { display: flex; align-items: center; gap: 10px; font-weight: 480; color: var(--ink); }
.check input { width: 18px; height: 18px; margin: 0; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 0 18px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }

/* ---------- Tableaux ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th { text-align: left; font-size: .82rem; color: var(--ink-3); font-weight: 550; padding: 12px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; background: #FCFCFA; }
td { padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tbody tr { transition: background .15s; }
tbody tr:hover { background: #FBFBF9; }
td a strong { color: var(--navy); }
.empty { padding: 48px 24px; text-align: center; color: var(--ink-3); }
.empty .icon { width: 36px; height: 36px; color: var(--blue-line); margin: 0 auto 12px; display: block; stroke-width: 1.5; }

/* ---------- Pastilles & progression ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: .77rem; font-weight: 580; white-space: nowrap; background: var(--surface-2); color: var(--ink-2); line-height: 1.5; }
.badge .icon { width: 13px; height: 13px; stroke-width: 2.2; }
.badge.blue, .badge.teal { background: var(--blue-soft); color: var(--blue-hover); }
.badge.green { background: var(--sage-soft); color: var(--sage-dark); }
.badge.red { background: var(--danger-soft); color: var(--danger); }
.badge.amber { background: var(--amber-soft); color: var(--amber); }
.badge.navy { background: var(--navy); color: #fff; }
.chip { display: inline-flex; align-items: center; gap: 7px; font-size: .9rem; color: var(--ink-2); }
.chip .icon { color: var(--ink-3); }
.progress { height: 6px; background: #ECEEF1; border-radius: 99px; overflow: hidden; min-width: 70px; }
.progress > span { display: block; height: 100%; background: var(--blue); border-radius: 99px; transform-origin: left; animation: grow .9s var(--ease) both; }
.progress.done > span { background: var(--sage); }
.progress.thick { height: 8px; }
@keyframes grow { from { transform: scaleX(0); } }
.progress-label { display: flex; justify-content: space-between; font-size: .83rem; color: var(--ink-3); margin-bottom: 7px; font-variant-numeric: tabular-nums; }
.ring { --p: 0; --c: var(--blue); width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: radial-gradient(closest-side, #fff 78%, transparent 80% 100%), conic-gradient(var(--c) calc(var(--p) * 1%), #ECEEF1 0); }
.ring span { font-weight: 700; font-size: .95rem; color: var(--navy); font-variant-numeric: tabular-nums; }
.ring.large { width: 132px; height: 132px; }
.ring.large span { font-size: 1.9rem; letter-spacing: -.03em; }

/* ---------- Alertes ---------- */
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 14px 18px; border-radius: 14px; margin-bottom: 20px; font-size: .93rem; border: 1px solid; }
.alert > .icon { margin-top: 2px; }
.alert.success { background: var(--sage-soft); border-color: var(--sage-line); color: #1F6A51; }
.alert.error { background: var(--danger-soft); border-color: var(--danger-line); color: #9C2A2F; }
.alert.info { background: var(--blue-soft); border-color: var(--blue-line); color: var(--navy); }
.alert.warn { background: var(--amber-soft); border-color: var(--amber-line); color: #7C4F0F; }
.alert pre { white-space: pre-wrap; background: rgba(255, 255, 255, .6); padding: 10px 12px; border-radius: 10px; }
.secret { font-family: ui-monospace, Menlo, monospace; font-size: 1rem; background: var(--blue-soft); color: var(--navy); padding: 4px 10px; border-radius: 8px; user-select: all; }

/* ---------- Cartes de formation (catalogue) ---------- */
.course-card { display: flex; flex-direction: column; color: inherit; background: var(--surface); border-radius: var(--r-md); border: 1px solid var(--line); box-shadow: var(--shadow-1); overflow: hidden; transition: box-shadow .25s var(--ease), transform .25s var(--ease); }
.course-card:hover { color: inherit; box-shadow: var(--shadow-3); transform: translateY(-2px); }
.course-card .body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.course-card h3 { margin: 0; font-size: 1.05rem; line-height: 1.35; }
.course-card .meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .84rem; color: var(--ink-3); }
.course-card .meta .icon { width: 15px; height: 15px; margin-right: 4px; }
.course-card .foot { margin-top: auto; padding-top: 10px; }
.cover { position: relative; aspect-ratio: 16 / 9; background: linear-gradient(145deg, #EEF3FB, #E4ECF7); overflow: hidden; }
.cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.course-card:hover .cover img { transform: scale(1.03); }
.cover .ph { position: absolute; inset: 0; display: grid; place-items: center; color: var(--blue);
  background:
    repeating-radial-gradient(circle at 88% 120%, transparent 0 34px, rgba(30, 58, 95, .06) 34px 35px),
    linear-gradient(150deg, #F3F6FB 0%, #E6EDF8 100%); }
.cover .ph .icon { width: 30px; height: 30px; stroke-width: 1.6; box-sizing: content-box; padding: 17px; border-radius: 18px; background: #fff; box-shadow: 0 8px 24px -8px rgba(30, 58, 95, .25); }
.cover .ph .initial { display: none; }
.cover .tag { position: absolute; left: 12px; top: 12px; }
.cover .tag .badge { background: rgba(255, 255, 255, .92); color: var(--navy); backdrop-filter: blur(6px); }
.cover .done-mark { position: absolute; right: 12px; top: 12px; width: 30px; height: 30px; border-radius: 50%; background: var(--sage); color: #fff; display: grid; place-items: center; }

/* Reprendre : grande tuile */
.resume { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); color: inherit; }
.resume:hover { color: inherit; }
.resume .cover { aspect-ratio: auto; min-height: 280px; }
.resume .content { padding: 36px 40px; display: flex; flex-direction: column; justify-content: center; gap: 14px; }
.resume .kicker { font-size: .9rem; color: var(--blue); font-weight: 600; display: flex; align-items: center; gap: 8px; }
.resume h2 { font-size: clamp(1.4rem, 1rem + 1.2vw, 1.9rem); letter-spacing: -.025em; margin: 0; }
.resume .next { color: var(--ink-2); display: flex; gap: 10px; align-items: center; }
@media (max-width: 760px) { .resume { grid-template-columns: 1fr; } .resume .cover { min-height: 190px; } .resume .content { padding: 24px; } }

/* Sessions : tuile calendrier */
.session-card { display: flex; gap: 18px; align-items: center; padding: 18px 20px; color: inherit; }
.session-card:hover { color: inherit; box-shadow: var(--shadow-2); }
.datebox { width: 62px; flex: none; text-align: center; border-radius: 14px; background: var(--blue-soft); padding: 8px 0 9px; color: var(--navy); }
.datebox .d { font-size: 1.6rem; font-weight: 750; letter-spacing: -.04em; line-height: 1; }
.datebox .m { font-size: .75rem; font-weight: 600; color: var(--blue); margin-top: 3px; }
.session-card h3 { margin: 0 0 4px; }

.banner-live { display: flex; align-items: center; gap: 16px; padding: 16px 20px; border-radius: var(--r-md); background: var(--sage-soft); border: 1px solid var(--sage-line); color: #1F6A51; margin-bottom: 24px; }
.banner-live:hover { color: #1F6A51; }
.banner-live .pulse { width: 10px; height: 10px; border-radius: 50%; background: var(--sage); box-shadow: 0 0 0 0 rgba(76, 175, 140, .5); animation: pulse 2s infinite; flex: none; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px rgba(76, 175, 140, 0); } 100% { box-shadow: 0 0 0 0 rgba(76, 175, 140, 0); } }

/* ---------- Fiche formation (bandeau) ---------- */
.hero-band { background: var(--navy); color: #fff; margin: -40px calc(50% - 50vw) 0; padding: 48px 0 60px; position: relative; }
.hero-band .inner { max-width: 1240px; margin: 0 auto; padding: 0 24px; }
.hero-band .breadcrumb, .hero-band .breadcrumb a { color: rgba(255, 255, 255, .6); }
.hero-band .breadcrumb a:hover { color: #fff; }
.hero-band h1 { color: #fff; font-size: clamp(1.9rem, 1.2rem + 2.2vw, 2.9rem); letter-spacing: -.03em; max-width: 22ch; margin: 6px 0 12px; }
.hero-band .lead { color: rgba(255, 255, 255, .78); }
.hero-band .chips { display: flex; flex-wrap: wrap; gap: 10px 22px; margin-top: 22px; }
.hero-band .chip { color: rgba(255, 255, 255, .85); }
.hero-band .chip .icon { color: rgba(255, 255, 255, .55); }
.course-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 40px; align-items: start; }
.course-layout .aside { margin-top: -220px; position: sticky; top: calc(var(--header-h) + 20px); z-index: 2; }
.course-layout .hero-text { padding-right: 20px; }
@media (max-width: 960px) {
  .course-layout { grid-template-columns: minmax(0, 1fr); }
  .course-layout .aside { margin-top: 0; position: static; }
}
.aside-card { background: #fff; border-radius: var(--r-lg); box-shadow: var(--shadow-3); border: 1px solid var(--line); overflow: hidden; }
.aside-card .cover { border-bottom: 1px solid var(--line); }
.aside-card .inner { padding: 24px; }
.aside-card .feature { display: flex; gap: 10px; align-items: center; font-size: .9rem; color: var(--ink-2); padding: 5px 0; }
.aside-card .feature .icon { color: var(--sage); }
.learn-box { border: 1px solid var(--line-2); border-radius: var(--r-md); padding: 26px 28px; background: #fff; }
.learn-box h2 { margin-bottom: 16px; }
.learn-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px 28px; list-style: none; margin: 0; padding: 0; }
.learn-grid li { display: flex; gap: 12px; align-items: flex-start; color: var(--ink); font-size: .95rem; }
.learn-grid .icon { color: var(--sage); margin-top: 3px; stroke-width: 2.2; }

/* ---------- Programme / modules ---------- */
.module-list { list-style: none; margin: 0; padding: 0; }
.module-list li { border-bottom: 1px solid var(--line); }
.module-list li:last-child { border-bottom: 0; }
.module-list a, .module-list .locked { display: flex; align-items: center; gap: 14px; padding: 14px 22px; color: var(--ink); transition: background .15s; }
.module-list a:hover { background: #FAFAF7; color: var(--ink); }
.module-list a.current { background: var(--blue-soft); box-shadow: inset 3px 0 0 var(--blue); }
.module-list .locked { color: var(--ink-3); cursor: not-allowed; }
.module-list .title { flex: 1; min-width: 0; font-weight: 520; }
.module-list .title small { display: block; font-weight: 450; margin-top: 1px; }
.module-list .dur { font-size: .83rem; color: var(--ink-3); white-space: nowrap; font-variant-numeric: tabular-nums; }
.status-dot { width: 30px; height: 30px; border-radius: 50%; flex: none; display: grid; place-items: center; background: var(--surface-2); color: var(--ink-3); font-size: .78rem; font-weight: 650; }
.status-dot .icon { width: 15px; height: 15px; }
.status-dot.done { background: var(--sage); color: #fff; }
.status-dot.lock { background: transparent; border: 1.5px dashed var(--line-2); }
.status-dot.type { background: var(--blue-soft); color: var(--blue); }

.lesson { font-size: 1.04rem; line-height: 1.75; color: #22303F; max-width: 72ch; }
.lesson h1, .lesson h2, .lesson h3 { margin-top: 1.6em; }
.lesson h2 { font-size: 1.4rem; }
.lesson img { border-radius: 14px; margin: 1.2em 0; box-shadow: var(--shadow-1); }
.lesson blockquote { margin: 1.4em 0; padding: 16px 20px; border-left: 3px solid var(--sage); background: var(--sage-soft); border-radius: 0 14px 14px 0; color: #1F4D3D; }
.lesson blockquote p:last-child { margin: 0; }
.lesson table { margin: 1.2em 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.lesson th, .lesson td { border-bottom: 1px solid var(--line); font-size: .93rem; }
.lesson ul, .lesson ol { padding-left: 1.3em; }
.lesson li { margin: .3em 0; }
.lesson li::marker { color: var(--blue); }
.media { position: relative; aspect-ratio: 16 / 9; background: #0E1B2C; border-radius: var(--r-md); overflow: hidden; margin: 8px 0 24px; box-shadow: var(--shadow-2); }
.media iframe, .media video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.doc-frame { width: 100%; height: 74vh; border: 1px solid var(--line); border-radius: var(--r-md); background: #fff; }
.timer-box { display: flex; align-items: center; gap: 8px; font-size: .9rem; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.player-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.player-nav { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 18px 24px; }

/* ---------- Quiz ---------- */
.quiz-q { padding: 22px 0; border-bottom: 1px solid var(--line); }
.quiz-q:last-of-type { border-bottom: 0; }
.quiz-q .q-title { font-weight: 620; margin-bottom: 14px; color: var(--navy); font-size: 1.02rem; }
.quiz-q .q-num { color: var(--blue); margin-right: 6px; }
.quiz-opt { display: flex; gap: 12px; align-items: flex-start; padding: 13px 16px; border: 1.5px solid var(--line); border-radius: 14px; margin-bottom: 9px; cursor: pointer; font-weight: 470; transition: border-color .15s, background .15s; background: #fff; }
.quiz-opt:hover { border-color: var(--blue-line); background: #F7FAFD; }
.quiz-opt:has(input:checked) { border-color: var(--blue); background: var(--blue-soft); }
.quiz-opt input { margin-top: 4px; width: 17px; height: 17px; flex: none; }
.quiz-opt.correct { border-color: var(--sage); background: var(--sage-soft); }
.quiz-opt.wrong { border-color: var(--danger-line); background: var(--danger-soft); }
.quiz-opt .mk { flex: none; width: 20px; display: grid; place-items: center; margin-top: 2px; }
.explain { font-size: .9rem; background: var(--surface-2); border-radius: 12px; padding: 12px 14px; margin-top: 8px; color: var(--ink-2); display: flex; gap: 8px; }
.result-hero { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 16px 0 28px; border-bottom: 1px solid var(--line); }
.score-ring { font-size: 2.6rem; font-weight: 800; font-variant-numeric: tabular-nums; }

/* ---------- Admin : éditeur de quiz ---------- */
.q-editor { border: 1px solid var(--line); border-radius: var(--r-md); padding: 18px; margin-bottom: 14px; background: #FCFCFA; }
.q-editor .opt-row { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.q-editor .opt-row input[type=text] { flex: 1; }
.q-editor .opt-row label { margin: 0; font-weight: 500; font-size: .85rem; display: flex; gap: 6px; align-items: center; white-space: nowrap; color: var(--ink-2); }
.q-head { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; }
.q-num { font-weight: 700; color: var(--blue); min-width: 34px; }

/* ---------- Signature ---------- */
.sig-pad { width: 100%; height: 220px; border: 1.5px dashed var(--blue-line); border-radius: var(--r-md); background: #fff; touch-action: none; display: block; cursor: crosshair;
  background-image: linear-gradient(to right, transparent 8%, var(--line) 8%, var(--line) 92%, transparent 92%); background-size: 100% 1px; background-repeat: no-repeat; background-position: 0 72%; }
.sig-img { height: 44px; max-width: 130px; object-fit: contain; margin: 0 auto; }
.slot-card { border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px 16px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; background: #fff; }
.slot-card + .slot-card { margin-top: 10px; }
dialog::backdrop { background: rgba(22, 48, 79, .35); backdrop-filter: blur(4px); }
dialog[open] { animation: pop .25s var(--ease); }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }

.live-bar { height: 10px; border-radius: 99px; background: #ECEEF1; overflow: hidden; }
.live-bar > span { display: block; height: 100%; background: var(--blue); border-radius: 99px; transition: width .5s var(--ease); }
.live-bar > span.ok { background: var(--sage); }

/* ---------- Connexion ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); background: var(--bg); }
.auth-side { background: var(--navy); color: #fff; padding: 48px 56px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-side::after { content: ""; position: absolute; width: 520px; height: 520px; right: -160px; bottom: -180px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .08); box-shadow: 0 0 0 60px rgba(255, 255, 255, .025), 0 0 0 130px rgba(255, 255, 255, .02); }
.auth-side .brand { color: #fff; }
.auth-side .mark { background: #fff; color: var(--navy); }
.auth-side h1 { color: #fff; font-size: clamp(2rem, 1.4rem + 2vw, 3rem); letter-spacing: -.035em; line-height: 1.08; max-width: 14ch; margin: 0 0 18px; }
.auth-side p { color: rgba(255, 255, 255, .72); max-width: 42ch; font-size: 1.05rem; }
.auth-points { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 14px; }
.auth-points li { display: flex; gap: 12px; align-items: center; color: rgba(255, 255, 255, .88); font-size: .96rem; }
.auth-points .icon { color: var(--sage); stroke-width: 2; }
.auth-side .foot { font-size: .82rem; color: rgba(255, 255, 255, .45); position: relative; z-index: 1; }
.auth-main { display: grid; place-items: center; padding: 40px 24px; }
.auth-card { width: 100%; max-width: 400px; }
.auth-card h2 { font-size: 1.7rem; letter-spacing: -.025em; margin-bottom: 6px; }
.auth-card .brand.mobile { display: none; margin-bottom: 28px; }
@media (max-width: 880px) {
  .auth { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  .auth-card .brand.mobile { display: flex; }
}

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 26px; overflow-x: auto; scrollbar-width: none; }
.tabs a { padding: 12px 16px; color: var(--ink-3); font-weight: 560; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; font-size: .94rem; }
.tabs a.active { color: var(--navy); border-bottom-color: var(--navy); }
.tabs a:hover { color: var(--navy); }

/* Finalisation */
.certificate { background: var(--sage-soft); border: 1px solid var(--sage-line); border-radius: var(--r-lg); padding: 44px 32px; text-align: center; }
.certificate .medal { width: 72px; height: 72px; border-radius: 50%; background: var(--sage); color: #fff; display: grid; place-items: center; margin: 0 auto 18px; box-shadow: 0 10px 30px -10px rgba(76, 175, 140, .6); }
.certificate .medal .icon { width: 34px; height: 34px; stroke-width: 1.6; }
.rating { display: flex; gap: 6px; }
.rating label { margin: 0; }
.rating input { position: absolute; opacity: 0; pointer-events: none; }
.rating span { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; border: 1.5px solid var(--line-2); font-weight: 620; color: var(--ink-2); cursor: pointer; transition: all .15s; background: #fff; }
.rating label:hover span { border-color: var(--blue-line); }
.rating input:checked + span { background: var(--blue); border-color: var(--blue); color: #fff; }
.rating input:focus-visible + span { outline: 3px solid rgba(16, 112, 180, .35); }
.rate-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }

/* Invitation à installer l'application */
.install-hint { position: fixed; left: 16px; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 40; max-width: 460px; margin: 0 auto;
  background: rgba(255, 255, 255, .96); backdrop-filter: blur(16px); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-3);
  padding: 14px 16px; display: flex; gap: 12px; align-items: center; animation: pop .35s var(--ease); }
.install-hint .mark { width: 42px; height: 42px; font-size: 1.2rem; border-radius: 11px; }
.install-hint p { margin: 0; font-size: .87rem; color: var(--ink-2); line-height: 1.4; }
.install-hint strong { color: var(--navy); display: block; font-size: .95rem; }

.footer { text-align: center; font-size: .8rem; color: var(--ink-3); padding: 28px 20px 36px; }

@media (max-width: 720px) {
  :root { --header-h: 58px; }
  .topbar-inner { gap: 12px; padding: 0 16px; }
  .brand .sub, .usermenu .uname, .usermenu .hide-sm { display: none; }
  .container { padding: 24px 16px 64px; }
  .hero-band { margin-top: -24px; padding-top: 32px; padding-bottom: 36px; }
  .hero-band .inner { padding: 0 16px; }
  td, th { padding: 11px 12px; }
  .card { padding: 20px; }
  .card-head, .card-body { padding-left: 18px; padding-right: 18px; }
  .module-list a, .module-list .locked { padding: 13px 16px; }
}
/* Application installée (plein écran) : marges de sécurité iPhone */
@media (display-mode: standalone) {
  .topbar { padding-top: env(safe-area-inset-top); height: calc(var(--header-h) + env(safe-area-inset-top)); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media print {
  .topbar, .no-print, .footer, .install-hint { display: none !important; }
  body { background: #fff; }
  .container { padding: 0; max-width: none; }
  .card { box-shadow: none; border: 0; padding: 0; }
}

/* Vignettes de couverture dans les tableaux */
td .cover .ph .icon { width: 16px; height: 16px; padding: 7px; border-radius: 8px; box-shadow: none; }
td .cover .ph .initial { display: none; }

/* Cloche de notifications */
.bell { position: relative; }
.bell-count { position: absolute; top: 1px; right: -1px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--danger); color: #fff; font-size: .68rem; font-weight: 700; display: grid; place-items: center; border: 2px solid var(--bg); line-height: 1; }
.notif { display: flex; gap: 14px; padding: 16px 22px; border-bottom: 1px solid var(--line); align-items: flex-start; }
.notif:last-child { border-bottom: 0; }
.notif.unread { background: #F7FAFD; }
.notif .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--blue); margin-top: 8px; flex: none; }
.notif.read .dot { background: transparent; }
.notif .when { font-size: .82rem; color: var(--ink-3); }
/* Statistiques équipe */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 28px; }
.mini-bars { display: flex; flex-direction: column; gap: 10px; }
.mini-bars .row { flex-wrap: nowrap; }
.mini-bars .name { flex: 1; min-width: 0; font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-bars .progress { width: 38%; flex: none; }
.mini-bars .val { width: 48px; text-align: right; font-size: .85rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }

/* ==========================================================================
   Création de formations
   ========================================================================== */
.mode-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap: 20px; }
.mode-card { display: flex; flex-direction: column; gap: 12px; padding: 30px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-1); color: inherit; transition: box-shadow .25s var(--ease), transform .25s var(--ease), border-color .2s; }
.mode-card:hover { color: inherit; box-shadow: var(--shadow-3); transform: translateY(-2px); border-color: var(--blue-line); }
.mode-card h2 { margin: 4px 0 0; font-size: 1.35rem; }
.mode-card p { color: var(--ink-2); margin: 0; }
.mode-card ul { list-style: none; padding: 0; margin: 4px 0 8px; display: grid; gap: 8px; font-size: .92rem; color: var(--ink-2); }
.mode-card li { display: flex; gap: 8px; align-items: center; }
.mode-card li .icon { color: var(--sage); stroke-width: 2.2; }
.mode-card .btn { align-self: flex-start; margin-top: auto; }
.mode-icon { width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; background: var(--blue-soft); color: var(--blue); }
.mode-card.ai { background: linear-gradient(160deg, #FFFFFF 40%, #EEF3FE); }
.mode-card.ai .mode-icon { background: var(--navy); color: #fff; }

/* Arborescence */
.part-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-1); margin-bottom: 16px; overflow: hidden; }
.part-card.loose { background: #FCFCFA; border-style: dashed; }
.part-top { display: flex; gap: 12px; align-items: flex-start; padding: 16px 18px 12px; border-bottom: 1px solid var(--line); background: #FCFCFA; }
.part-titles { flex: 1; min-width: 0; display: grid; gap: 2px; }
.part-label { font-size: .78rem; font-weight: 650; color: var(--blue); }
.part-title, .part-summary { border: 1px solid transparent !important; background: transparent !important; padding: 4px 8px !important; margin-left: -8px; min-height: 0 !important; box-shadow: none !important; }
.part-title { font-size: 1.08rem !important; font-weight: 650; color: var(--navy) !important; }
.part-summary { font-size: .9rem !important; color: var(--ink-2) !important; }
.part-title:hover, .part-summary:hover { border-color: var(--line-2) !important; }
.part-title:focus, .part-summary:focus { border-color: var(--blue) !important; background: #fff !important; }
.part-add { display: flex; gap: 6px; flex-wrap: wrap; padding: 8px 12px 12px; border-top: 1px solid var(--line); }
.drag { cursor: grab; color: var(--ink-3); display: inline-grid; place-items: center; width: 22px; height: 30px; flex: none; touch-action: none; }
.drag:hover { color: var(--navy); }
.part-drag { margin-top: 18px; }
.chapter-list, .sub-list { list-style: none; margin: 0; padding: 0; min-height: 8px; }
.chapter-list { padding: 6px 0; min-height: 44px; }
.sub-list { margin-left: 46px; border-left: 2px solid var(--line); min-height: 4px; }
.chapter-row { display: flex; align-items: center; gap: 10px; padding: 8px 14px 8px 10px; }
.chapter-row:hover { background: #FAFAF7; }
.chapter-title { flex: 1; min-width: 0; color: var(--ink); font-weight: 540; }
.chapter-title:hover { color: var(--blue); }
.chapter-title small { display: block; color: var(--ink-3); font-weight: 450; font-size: .8rem; }
.chapter-badges { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.chapter-actions { display: flex; gap: 4px; align-items: center; }
.chapter-empty { margin: 0; padding: 4px 18px 14px; font-size: .88rem; }
.sort-ghost { opacity: .35; background: var(--blue-soft) !important; }
.sort-chosen { box-shadow: var(--shadow-2); background: #fff; }
.add-part { display: flex; gap: 10px; margin-top: 4px; }
.add-part input { flex: 1; }
.menu { position: relative; }
.menu > summary { list-style: none; cursor: pointer; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 10; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-3); padding: 8px; min-width: 240px; display: grid; gap: 2px; }
.menu-pop form { margin: 0; }
.menu-pop .linkbtn { display: flex; gap: 8px; align-items: center; width: 100%; text-align: left; padding: 8px 10px; border-radius: 8px; color: var(--ink); font-weight: 500; }
.menu-pop .linkbtn:hover { background: var(--surface-2); }
.menu-pop .linkbtn.danger { color: var(--danger); }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.facts div { display: flex; flex-direction: column; }
.facts strong { font-size: 1.5rem; color: var(--navy); font-variant-numeric: tabular-nums; line-height: 1.1; }
.facts span { font-size: .82rem; color: var(--ink-3); }
@media (max-width: 720px) {
  .chapter-badges { display: none; }
  .sub-list { margin-left: 22px; }
  .add-part { flex-direction: column; }
}

/* Éditeur de chapitre */
.editor-head { display: flex; gap: 14px; align-items: center; margin-bottom: 22px; flex-wrap: wrap; }
.title-input { flex: 1; min-width: 240px; font-size: 1.5rem !important; font-weight: 700; color: var(--navy) !important; letter-spacing: -.02em; border-color: transparent !important; background: transparent !important; padding-left: 8px !important; }
.title-input:hover { border-color: var(--line-2) !important; }
.title-input:focus { background: #fff !important; border-color: var(--blue) !important; }
.block-editor { display: grid; gap: 14px; }
.blk-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-1); }
.blk-card:focus-within { border-color: var(--blue-line); box-shadow: 0 0 0 4px rgba(16, 112, 180, .06), var(--shadow-1); }
.blk-head { display: flex; align-items: center; gap: 8px; padding: 6px 8px 6px 10px; border-bottom: 1px solid var(--line); font-size: .86rem; color: var(--ink-2); }
.blk-head strong { color: var(--navy); font-weight: 620; }
.blk-body { padding: 14px 16px 16px; display: grid; gap: 10px; }
.blk-body textarea { min-height: 0; font-size: .95rem; }
.blk-card.text .blk-body textarea { min-height: 140px; }
.blk-preview { max-height: 260px; width: auto; border-radius: 10px; border: 1px solid var(--line); }
.mdbar { display: flex; gap: 4px; flex-wrap: wrap; }
.mdbar button { font: inherit; font-size: .8rem; padding: 4px 9px; border: 1px solid var(--line-2); background: #fff; border-radius: 7px; cursor: pointer; color: var(--ink-2); }
.mdbar button:hover { border-color: var(--blue-line); color: var(--navy); }
.add-blocks { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; padding: 14px; border: 1.5px dashed var(--line-2); border-radius: var(--r-md); background: #FCFCFA; }
.up-btn { cursor: pointer; }
.up-state { font-size: .84rem; color: var(--ink-3); }
.up-state.err { color: var(--danger); }
.icon-btn.danger:hover { color: var(--danger); background: var(--danger-soft); }
.icon-btn.confirm { color: #fff !important; background: var(--danger) !important; }
.mini { font-size: .82rem; font-weight: 600; color: var(--ink-2); margin: 2px 0 -4px; }
.q-editor textarea { min-height: 0; margin-bottom: 10px; }
.q-editor .q-opts { display: grid; gap: 2px; margin-bottom: 10px; }
.import-msg { margin: 10px 0 0; font-size: .88rem; }
.import-msg.ok { color: var(--sage-dark); }
.import-msg.err { color: var(--danger); }

/* Création par IA */
.dropzone { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding: 34px 20px; border: 2px dashed var(--blue-line); border-radius: var(--r-md); background: #F7FAFD; cursor: pointer; transition: background .2s, border-color .2s; font-weight: 450; }
.dropzone:hover, .dropzone.over { background: var(--blue-soft); border-color: var(--blue); }
.dropzone strong { color: var(--navy); }
.dropzone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.dz-icon { width: 54px; height: 54px; border-radius: 50%; background: #fff; display: grid; place-items: center; color: var(--blue); box-shadow: var(--shadow-1); margin-bottom: 6px; }
.dz-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 4px; font-size: .9rem; color: var(--ink); }
.ai-stage { text-align: center; max-width: 620px; margin: 24px auto 0; }
.ai-stage h1 { font-size: clamp(1.5rem, 1.1rem + 1.4vw, 2.1rem); text-wrap: balance; margin-top: 22px; }
.ai-orb { width: 84px; height: 84px; margin: 0 auto; border-radius: 50%; display: grid; place-items: center; color: #fff; background: radial-gradient(circle at 30% 30%, #5B8FF5, var(--navy) 70%); box-shadow: 0 0 0 10px rgba(16, 112, 180, .08), 0 0 0 22px rgba(16, 112, 180, .04); animation: breathe 2.6s var(--ease) infinite; }
.ai-orb.done { background: var(--sage); animation: none; box-shadow: 0 0 0 10px rgba(76, 175, 140, .12); }
.ai-orb.error { background: var(--danger); animation: none; box-shadow: 0 0 0 10px rgba(194, 59, 65, .1); }
@keyframes breathe { 50% { transform: scale(1.06); box-shadow: 0 0 0 14px rgba(16, 112, 180, .1), 0 0 0 30px rgba(16, 112, 180, .04); } }
.ai-progress { display: flex; align-items: center; gap: 12px; margin: 26px 0 22px; }
.ai-progress .progress { flex: 1; }
.ai-progress .progress > span { transition: width .8s var(--ease); animation: none; }
.ai-progress span#ai-pct { font-variant-numeric: tabular-nums; font-weight: 650; color: var(--navy); width: 48px; text-align: right; }
.ai-steps { list-style: none; padding: 0; margin: 0 auto; display: grid; gap: 12px; text-align: left; max-width: 420px; }
.ai-steps li { display: flex; gap: 12px; align-items: center; color: var(--ink-3); }
.ai-steps li.active { color: var(--navy); font-weight: 600; }
.ai-steps li.done { color: var(--ink); }
.ai-steps li.error { color: var(--danger); font-weight: 600; }
.step-dot { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line-2); flex: none; display: grid; place-items: center; background: #fff; }
.ai-steps li.active .step-dot { border-color: var(--blue); border-top-color: transparent; animation: spin 1s linear infinite; }
.ai-steps li.done .step-dot { background: var(--sage); border-color: var(--sage); }
.ai-steps li.done .step-dot::after { content: ""; width: 8px; height: 4px; border-left: 2px solid #fff; border-bottom: 2px solid #fff; transform: rotate(-45deg) translate(1px, -1px); }
.ai-steps li.error .step-dot { border-color: var(--danger); }
@keyframes spin { to { transform: rotate(360deg); } }
.ai-log { margin: 26px auto 0; max-width: 520px; text-align: left; font-size: .82rem; color: var(--ink-3); background: var(--surface-2); border-radius: 12px; padding: 12px 14px; display: grid; gap: 3px; font-variant-numeric: tabular-nums; }
.ai-log:empty { display: none; }

/* ==========================================================================
   Contenus de leçon (côté apprenant)
   ========================================================================== */
.part-head { display: flex; align-items: baseline; gap: 10px; padding: 14px 22px 8px; border-top: 1px solid var(--line); background: #FCFCFA; }
.part-head:first-of-type { border-top: 0; }
.part-head strong { color: var(--navy); flex: 1; min-width: 0; }
.part-head .part-num { font-size: .76rem; font-weight: 650; color: var(--blue); white-space: nowrap; }
.part-head .muted { font-size: .82rem; font-variant-numeric: tabular-nums; }
.part-head.small { padding: 10px 16px 6px; font-size: .86rem; }
.module-list li.sub > a, .module-list li.sub > .locked { padding-left: 50px; }
.module-list li.sub .status-dot { width: 24px; height: 24px; }
.blk-figure { margin: 1.6em 0; }
.blk-figure img { border-radius: 14px; box-shadow: var(--shadow-1); margin: 0; }
.blk-figure figcaption { font-size: .88rem; color: var(--ink-3); margin-top: 8px; text-align: center; }
.blk-label { display: flex; align-items: center; gap: 8px; font-weight: 650; color: var(--navy); font-size: .95rem; margin-bottom: 8px; }
.blk-audio { display: flex; gap: 14px; align-items: flex-start; padding: 16px 18px; border-radius: 14px; background: var(--surface-2); margin: 1.4em 0; }
.blk-audio > .icon { color: var(--blue); margin-top: 3px; }
.blk-audio strong { display: block; color: var(--navy); margin-bottom: 8px; font-size: .95rem; }
.blk-audio audio { width: 100%; }
.blk-audio small { display: block; margin-top: 6px; }
.blk-file { display: flex; gap: 14px; align-items: center; padding: 14px 18px; border: 1px solid var(--line); border-radius: 14px; background: #fff; color: inherit; margin: 1.2em 0; transition: border-color .2s; }
.blk-file:hover { border-color: var(--blue-line); color: inherit; }
.blk-file > .icon:first-child { color: var(--blue); }
.blk-file span { flex: 1; min-width: 0; }
.blk-file strong { display: block; color: var(--navy); }
.blk-file small { color: var(--ink-3); }
.blk-callout { margin: 1.5em 0; padding: 16px 20px; border-radius: 14px; background: var(--blue-soft); border: 1px solid var(--blue-line); }
.blk-callout > *:last-child { margin-bottom: 0; }
.blk-callout.key, .blk-callout.memo, .blk-callout.summary { background: var(--sage-soft); border-color: var(--sage-line); }
.blk-callout.key .blk-label, .blk-callout.memo .blk-label, .blk-callout.summary .blk-label { color: #1F6A51; }
.blk-callout.warning { background: var(--amber-soft); border-color: var(--amber-line); }
.blk-callout.tip { background: #FFF8E6; border-color: #F3DFA6; }
.blk-callout.tip .blk-label { color: #8A6200; }
.blk-callout.warning .blk-label { color: #7C4F0F; }
.blk-exercise { margin: 1.6em 0; padding: 18px 20px; border-radius: 14px; border: 1.5px dashed var(--blue-line); background: #F7FAFD; }
.blk-exercise .ex-answer { margin: 6px 0 12px; min-height: 0; font-family: inherit; }
.ex-solution { margin-top: 14px; padding: 14px 16px; border-radius: 12px; background: #fff; border: 1px solid var(--sage-line); }
.ex-solution .blk-label { color: #1F6A51; }
.quiz-text { max-width: 480px; }
.tf-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; max-width: 480px; }
.tf-row .quiz-opt { margin: 0; }
.title-input { font-weight: 700 !important; }
.sub-list:empty { border-left-color: transparent; }

/* ---------- Espace entreprise, relances, droits ---------- */
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; }
.weekbars { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 8px; margin-top: 18px; }
.weekbars .wb { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.weekbars .bars { height: 120px; width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 3px; border-bottom: 1px solid var(--line); }
.weekbars .bars span { width: 38%; max-width: 16px; min-height: 2px; border-radius: 4px 4px 0 0; transition: height .4s; }
.weekbars small { font-size: .72rem; color: var(--ink-3); }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 18px; }
.filters .field { margin: 0; min-width: 150px; flex: 1; }
.filters .field.grow { flex: 2; min-width: 200px; }
.selbar { position: sticky; bottom: 16px; z-index: 5; display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; background: var(--navy); color: #fff; padding: 12px 18px; border-radius: 16px; margin-top: 16px; box-shadow: 0 14px 36px rgba(30, 58, 95, .25); }
.selbar .btn.secondary { background: #fff; }
.perm-table td, .perm-table th { text-align: center; }
.perm-table td:first-child, .perm-table th:first-child { text-align: left; }
.perm-table input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--blue); }
.perm-table .na { color: var(--line); }
.var-list { display: flex; flex-wrap: wrap; gap: 6px; }
.var-list button { font: inherit; font-size: .82rem; border: 1px solid var(--line); background: #fff; color: var(--navy); border-radius: 999px; padding: 4px 10px; cursor: pointer; }
.var-list button:hover { border-color: var(--blue); color: var(--blue); }
.msg-preview { white-space: pre-wrap; background: var(--bg); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; font-size: .94rem; line-height: 1.55; }
.msg-preview .subj { font-weight: 640; color: var(--navy); margin-bottom: 8px; }
.option-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; }
.option-cards label { margin: 0; }
.timeline-mini { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: .85rem; color: var(--ink-3); }
.timeline-mini .step { background: rgba(16, 112, 180, .08); color: var(--blue); border-radius: 999px; padding: 3px 10px; font-weight: 560; }
.notif-item { display: flex; gap: 14px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.notif-item:last-child { border-bottom: 0; }
.notif-item.unread { background: rgba(16, 112, 180, .04); }
.notif-item .body { white-space: pre-wrap; font-size: .93rem; color: var(--ink-2); }
dialog.dialog { border: 0; border-radius: 22px; padding: 0; width: min(600px, calc(100vw - 32px)); box-shadow: 0 24px 70px rgba(22, 48, 79, .28); }
.dialog-body { padding: 26px 28px; }
.text-danger { color: var(--danger); }
a.card.hover { color: inherit; transition: transform .2s, box-shadow .2s, border-color .2s; } a.card.hover:hover { transform: translateY(-2px); border-color: var(--blue-line); box-shadow: 0 10px 26px rgba(30, 58, 95, .08); }
.form-grid.three { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }

/* ---------- Évaluations variées ---------- */
.q-format { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 650; text-transform: uppercase; letter-spacing: .04em; color: var(--blue); background: var(--blue-soft); border-radius: 999px; padding: 4px 10px; margin-bottom: 10px; }
.q-context { background: var(--bg); border-left: 3px solid var(--blue); border-radius: 0 12px 12px 0; padding: 12px 16px; margin-bottom: 12px; font-size: .95rem; }
.q-context p:last-child { margin-bottom: 0; }
.q-media { margin: 0 0 14px; }
.q-media img { display: block; max-width: 100%; max-height: 420px; border-radius: 12px; border: 1px solid var(--line); background: #fff; }
.q-media figcaption { font-size: .84rem; color: var(--ink-3); margin-top: 6px; }
.q-media audio { width: 100%; }
.q-media video { width: 100%; max-height: 360px; border-radius: 12px; background: #000; }
.fill-text { line-height: 2.4; font-size: 1rem; white-space: pre-wrap; }
.fill-input { display: inline-block; width: auto; min-width: 120px; max-width: 220px; padding: 4px 10px !important; margin: 0 4px; border-radius: 8px !important; font-size: .95rem !important; vertical-align: baseline; }
.match-grid { display: flex; flex-direction: column; gap: 8px; }
.match-row { display: grid; grid-template-columns: minmax(0, 1fr) 20px minmax(0, 1fr); gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.match-left { font-weight: 560; color: var(--navy); }
.match-arrow { color: var(--ink-3); text-align: center; }
@media (max-width: 600px) { .match-row { grid-template-columns: minmax(0, 1fr); } .match-arrow { display: none; } }
.order-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; counter-reset: ord; }
.order-item { counter-increment: ord; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; cursor: grab; touch-action: none; }
.order-item::before { content: counter(ord); font-weight: 700; color: var(--blue); min-width: 18px; }
.order-item .txt { flex: 1; min-width: 0; }
.order-item .drag, .cat-chip .drag { color: var(--ink-3); display: inline-flex; }
.order-btns { display: flex; gap: 2px; }
.order-btns .icon-btn { width: 30px; height: 30px; font-size: .9rem; }
.cat-board { display: flex; flex-direction: column; gap: 12px; }
.cat-pool { display: flex; flex-wrap: wrap; gap: 8px; min-height: 52px; padding: 10px; border: 1.5px dashed var(--line-2); border-radius: 14px; background: var(--bg); }
.cat-pool:empty::after { content: 'Tous les éléments sont classés'; color: var(--ink-3); font-size: .86rem; align-self: center; }
.cat-zones { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.cat-zone { border: 1px solid var(--line); border-radius: 14px; background: #fff; overflow: hidden; }
.cat-title { font-weight: 650; color: var(--navy); font-size: .92rem; padding: 10px 12px; background: var(--blue-soft); }
.cat-drop { min-height: 70px; padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.cat-chip { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font-size: .92rem; cursor: grab; touch-action: none; box-shadow: 0 1px 2px rgba(30, 58, 95, .05); }
.cat-select { width: auto !important; padding: 2px 6px !important; font-size: .78rem !important; border-radius: 6px !important; margin-left: auto; color: var(--ink-3); }
.corr-list .quiz-opt { margin-bottom: 6px; }

img.logo { display: block; width: auto; max-width: 100%; }
.auth-side .brand img.logo { margin-bottom: 4px; }
@media (max-width: 640px) { .topbar img.logo { height: 30px; } }

/* Blocs interactifs */
.blk-steps, .blk-flip, .blk-check, .blk-scenario { border: 1px solid var(--line); border-radius: var(--r-md); padding: 20px 22px; margin: 22px 0; background: #fff; }
.blk-scenario { background: linear-gradient(180deg, #F4F8FC, #fff); border-color: var(--blue-line); }
.blk-check { border-left: 4px solid var(--blue); }
.steps-track { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 10px; }
.step { display: none; gap: 14px; align-items: flex-start; padding: 14px 16px; border-radius: 14px; background: var(--blue-soft); }
.step.on { display: flex; animation: stepIn .45s var(--ease) both; }
.step.on:not(.current) { background: #F4F6F8; opacity: .85; }
.step-n { flex: none; width: 32px; height: 32px; border-radius: 50%; background: var(--blue); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .9rem; }
.step.on:not(.current) .step-n { background: var(--sage, #4CAF8C); }
.step-body { min-width: 0; } .step-body p { margin: 4px 0 0; } .step-body strong { color: var(--navy); }
.steps-nav { display: flex; align-items: center; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.steps-count { font-size: .85rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }
@keyframes stepIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.flip-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; margin-top: 12px; }
.flip-card { perspective: 900px; border: 0; padding: 0; background: none; cursor: pointer; min-height: 150px; text-align: left; font: inherit; color: inherit; }
.flip-in { position: relative; display: grid; width: 100%; height: 100%; min-height: 150px; transition: transform .55s var(--ease); transform-style: preserve-3d; }
.flip-card.flipped .flip-in { transform: rotateY(180deg); }
/* Les deux faces occupent la même case : la carte prend la hauteur de la face la plus longue (plus de texte coupé sur téléphone) */
.flip-front, .flip-back { position: relative; grid-area: 1 / 1; min-height: 150px; border-radius: 14px; padding: 16px; backface-visibility: hidden; -webkit-backface-visibility: hidden; display: flex; flex-direction: column; justify-content: center; }
.flip-front { background: var(--navy); color: #fff; font-weight: 650; }
.flip-front p { margin: 0; } .flip-front small { margin-top: 10px; opacity: .7; font-weight: 500; font-size: .78rem; }
.flip-back { background: var(--blue-soft); color: var(--ink); transform: rotateY(180deg); font-size: .92rem; }
.flip-back p { margin: 0 0 6px; } .flip-back ul { margin: 0; padding-left: 18px; }
.choice-list { display: grid; gap: 8px; margin-top: 12px; }
.choice { display: flex; gap: 12px; align-items: center; text-align: left; width: 100%; padding: 12px 14px; border: 1.5px solid var(--line-2); border-radius: 12px; background: #fff; font: inherit; color: var(--ink); cursor: pointer; transition: border-color .2s, background .2s; }
.choice:hover:not(:disabled) { border-color: var(--blue); }
.choice-mark { flex: none; width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line-2); }
.choice.picked .choice-mark { border-color: var(--blue); background: var(--blue); box-shadow: inset 0 0 0 3px #fff; }
.choice.ok { border-color: #2F8A68; background: #EAF6F0; } .choice.ok .choice-mark { border-color: #2F8A68; background: #2F8A68; box-shadow: inset 0 0 0 3px #EAF6F0; }
.choice.ko { border-color: #C2410C; background: #FDF1EC; } .choice.ko .choice-mark { border-color: #C2410C; background: #C2410C; box-shadow: inset 0 0 0 3px #FDF1EC; }
.choice:disabled { cursor: default; } .choice.neutral { opacity: .7; }
.choice-fb { margin: -2px 0 4px 32px; padding: 10px 14px; border-radius: 10px; background: #F4F6F8; font-size: .92rem; animation: stepIn .35s var(--ease) both; }
.choice-fb p { margin: 0; }
.choice-sol { margin-top: 14px; padding: 14px 16px; border-radius: 12px; background: #EAF6F0; animation: stepIn .35s var(--ease) both; }
.small-note { font-size: .85rem; margin: 6px 0 0; }
[data-choice-validate] { margin-top: 12px; }
@media (prefers-reduced-motion: reduce) { .step.on, .choice-fb, .choice-sol { animation: none; } .flip-in { transition: none; } }

.it-list { display: grid; gap: 8px; margin: 8px 0; }
.it-row { border: 1px solid var(--line); border-radius: 12px; padding: 10px; display: grid; gap: 6px; background: #FBFBFA; }
.it-head { display: flex; align-items: center; gap: 10px; } .it-head .icon-btn { margin-left: auto; }

.blk-gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin: 18px 0; }
.blk-gallery .blk-figure { margin: 0; }
.blk-gallery .blk-figure img { width: 100%; height: 170px; object-fit: contain; background: #F6F7F8; border-radius: 12px; }
.blk-gallery figcaption { font-size: .8rem; }

/* Images des leçons agrandies au toucher */
.blk-figure img { cursor: zoom-in; }
.zoom-box { position: fixed; inset: 0; z-index: 1000; background: rgba(12, 22, 36, .92); display: flex; flex-direction: column; }
.zoom-scroll { flex: 1; overflow: auto; display: flex; align-items: center; justify-content: center; padding: 56px 12px 24px; -webkit-overflow-scrolling: touch; }
.zoom-box img { max-width: 100%; max-height: 100%; border-radius: 12px; background: #fff; box-shadow: 0 12px 40px rgba(0, 0, 0, .35); }
.zoom-box.is-svg .zoom-scroll { justify-content: flex-start; }
.zoom-box.is-svg img { width: max(100%, 860px); max-width: none; max-height: none; margin: auto; }
.zoom-close { position: absolute; top: max(10px, env(safe-area-inset-top)); right: 12px; width: 44px; height: 44px; border-radius: 50%; border: 0; background: #fff; color: #1E3A5F; font-size: 28px; line-height: 1; cursor: pointer; z-index: 1; }
@media (max-width: 640px) {
  .blk-figure figcaption::after { content: " · Touchez pour agrandir"; color: var(--ink-3); }
  .blk-gallery figcaption::after { content: ""; }
}

/* Abonnement : étapes et choix du paiement */
.pay-steps { list-style: none; display: flex; gap: 8px; padding: 0; margin: 0 0 20px; flex-wrap: wrap; }
.pay-steps li { display: flex; align-items: center; gap: 8px; padding: 8px 14px 8px 8px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: .9rem; color: var(--ink-3); }
.pay-steps li span { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: #EEF1F4; font-weight: 700; font-size: .85rem; }
.pay-steps li.done { color: var(--ink-1, #1E3A5F); } .pay-steps li.done span { background: var(--sage, #4CAF8C); color: #fff; }
.pay-steps li.current { border-color: var(--blue); color: var(--blue); font-weight: 650; } .pay-steps li.current span { background: var(--blue); color: #fff; }
.pay-choice { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 12px; }
.pay-option { border: 1px solid var(--line); border-radius: 16px; padding: 20px; display: flex; flex-direction: column; gap: 6px; }
.pay-option p { margin: 0 0 6px; font-size: .94rem; }
.po-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.po-head h3 { margin: 0; flex: 1; }
.po-steps { margin: 6px 0 14px; padding-left: 20px; font-size: .88rem; color: var(--ink-3); display: grid; gap: 4px; }
.po-note { font-size: .8rem; color: var(--ink-3); margin: 8px 0 0 !important; }
.pay-option form { margin-top: auto; }
table.kv td:first-child { color: var(--ink-3); width: 40%; }
.mono { font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; letter-spacing: .02em; }
.sub-list { margin: 0 0 12px; padding-left: 18px; font-size: .9rem; display: grid; gap: 3px; }
.sub-total-mini { display: flex; justify-content: space-between; align-items: baseline; padding: 12px 14px; border-radius: 12px; background: var(--blue-soft, #EAF3FA); font-size: .92rem; }
@media (max-width: 760px) { .pay-choice { grid-template-columns: minmax(0, 1fr); } }

/* Formations regroupées par catégorie (A Fondamentaux, B Métiers spécialisés, C Sensibilisation) */
tr.group-row th { background: var(--blue-soft); color: var(--navy); font-size: .8rem; letter-spacing: .04em; text-transform: uppercase; padding-top: 12px; padding-bottom: 12px; text-align: left; }
tr.group-row th .muted { text-transform: none; letter-spacing: 0; font-weight: 450; }
.group-title { margin: 28px 0 14px; font-size: .95rem; letter-spacing: .04em; text-transform: uppercase; color: var(--navy); display: flex; align-items: center; gap: 12px; }
.group-title::after { content: ""; flex: 1; height: 1px; background: var(--line, #e3e9f0); }
.section-head + .group-title { margin-top: 4px; }
.group-title.small { margin: 14px 0 8px; font-size: .78rem; font-weight: 600; }
.group-title.small:first-child { margin-top: 0; }

/* Format hybride : semaine (administration et espace stagiaire) */
.hw-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.hw-day { border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 4px; background: var(--surface); }
.hw-day.visio { border-top: 3px solid var(--blue); }
.hw-day.elearning { border-top: 3px solid var(--sage); }
.hw-day.evaluation { border-top: 3px solid var(--amber); }
.hw-date { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); }
.hw-codes { font-size: .8rem; color: var(--navy); margin-top: 6px; line-height: 1.5; }
@media (max-width: 860px) { .hw-grid { grid-template-columns: 1fr; } }
.hybrid-tile { display: block; padding: 24px; margin-bottom: 24px; color: inherit; text-decoration: none; border-color: var(--blue-line); }
.hybrid-tile h2 { margin: 6px 0 6px; }
.hybrid-tile .kicker { font-size: .82rem; font-weight: 600; color: var(--blue); display: flex; align-items: center; gap: 6px; }
.hybrid-tile .hw-day { padding: 10px 12px; }
.hw-day.open { background: var(--blue-soft); }
.hw-day.past { opacity: .6; }
.hp-day { padding: 20px 22px; margin-bottom: 12px; }
.hp-day.visio { border-left: 4px solid var(--blue); }
.hp-day.elearning { border-left: 4px solid var(--sage); }
.hp-day.evaluation { border-left: 4px solid var(--amber); }
.hp-day.past { opacity: .75; }
.hp-courses { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; margin-top: 14px; }
.hp-course { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); text-decoration: none; background: var(--surface); }
a.hp-course:hover { border-color: var(--blue-line); background: var(--blue-soft); }
.hp-course.locked { color: var(--ink-3); background: var(--surface-2); }
.hp-code { font-weight: 700; color: var(--navy); min-width: 32px; }
.hp-title { flex: 1; font-size: .92rem; line-height: 1.3; }
.hp-state { font-size: .85rem; color: var(--ink-2); white-space: nowrap; }
@media (max-width: 860px) { .hybrid-tile .hw-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; } .hybrid-tile .hw-day strong { display: none; } }

/* Quiz créé par l'IA */
.qia-more { border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; margin: 6px 0 18px; }
.qia-more summary { cursor: pointer; font-weight: 600; color: var(--navy); }
.qia-spinner { width: 46px; height: 46px; margin: 0 auto; border-radius: 50%; border: 4px solid var(--blue-soft); border-top-color: var(--blue); animation: qia-spin 1s linear infinite; }
@keyframes qia-spin { to { transform: rotate(360deg); } }
.dq-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.dq-day { border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.dq-day.today { border-color: var(--sage-line); background: var(--sage-soft); }
.dq-quiz { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 9px; font-size: .9rem; }
.dq-add { font-size: .85rem; display: inline-flex; align-items: center; gap: 5px; margin-top: 2px; }
@media (max-width: 860px) { .dq-grid { grid-template-columns: 1fr; } }
.wt-day { padding: 20px 22px; margin-bottom: 14px; }
.wt-quiz { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; background: var(--surface); }
.wt-quiz .t { flex: 1; }
.wt-quiz select { max-width: 130px; padding: 4px 8px; }
.wk-cand { max-height: 240px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; }

/* Import d'une liste de stagiaires */
.imp-step { display: flex; gap: 18px; padding: 26px 28px; margin-bottom: 16px; align-items: flex-start; }
.imp-step h2 { margin: 0 0 6px; font-size: 1.15rem; }
.imp-num { flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--blue); color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center; }

/* Fin de formation : « Pour aller plus loin » (formations suivantes du parcours) */
.next-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; margin-top: 16px; }
.next-card { display: grid; gap: 8px; align-content: start; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface-2, #f7f8fa); }
.next-card .muted { font-size: .9rem; }
.next-card .btn { justify-self: start; margin-top: 4px; }

/* Leçons : effets pédagogiques (public/js/rm.js) — barre de lecture, numéro de leçon, progression, compteur, confettis, fin de leçon */
.rm-read { position: fixed; left: 0; top: 0; height: 4px; width: 0; z-index: 60; background: linear-gradient(90deg, var(--blue), var(--sage)); transition: width .15s linear; }
.lesson-title { display: flex; align-items: center; gap: 14px; }
.lesson-num { flex: none; width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; font-size: 1.35rem; font-weight: 800; color: #fff; background: var(--blue); box-shadow: 0 10px 22px -12px rgba(16, 112, 180, .8); }
.rm-stepbar { display: grid; grid-auto-flow: column; gap: 6px; margin: 12px 0 4px; }
.rm-stepbar i { height: 6px; border-radius: 999px; background: var(--blue-line); transition: background .3s; }
.rm-stepbar i.on { background: var(--blue); }
.step.current { animation: fxPop .45s cubic-bezier(.2, .9, .3, 1.3) both; }
.rm-count { display: inline-flex; align-items: center; gap: 8px; margin-top: 12px; font-size: .85rem; font-weight: 600; color: var(--ink-2); background: var(--surface-2); padding: 6px 12px; border-radius: 999px; }
.rm-count.done { background: var(--sage-soft); color: var(--sage-dark); }
.choice.ok { animation: fxPop .4s cubic-bezier(.2, .9, .3, 1.3) both; }
.choice.ko { animation: fxShake .4s both; }
.rm-confetti { position: fixed; inset: 0; pointer-events: none; z-index: 80; overflow: hidden; }
.rm-confetti i { position: absolute; width: 9px; height: 14px; border-radius: 3px; top: -20px; animation: rmFall 1.6s ease-in forwards; }
@keyframes rmFall { to { transform: translate(var(--dx), 105vh) rotate(var(--r)); opacity: .9; } }
@keyframes fxPop { 0% { transform: scale(.96); } 60% { transform: scale(1.02); } 100% { transform: scale(1); } }
@keyframes fxShake { 0%, 100% { transform: none; } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
.rm-done { margin-top: 28px; border-radius: 22px; padding: 22px 24px; background: linear-gradient(135deg, var(--navy), var(--blue)); color: #fff; display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: center; animation: fxPop .5s both; }
.rm-done[hidden] { display: none; }
.rm-done .medal-rm { width: 56px; height: 56px; border-radius: 50%; background: #F2B632; color: #3A2A00; display: grid; place-items: center; font-size: 1.6rem; box-shadow: 0 0 0 7px rgba(242, 182, 50, .25); }
.rm-done h3 { margin: 0 0 4px; color: #fff; font-size: 1.15rem; }
.rm-done p { margin: 0; color: rgba(255, 255, 255, .85); }
@media (prefers-reduced-motion: reduce) { .step.current, .choice.ok, .choice.ko, .rm-done { animation: none !important; } .rm-confetti { display: none; } }
@media (max-width: 640px) { .lesson-num { width: 40px; height: 40px; font-size: 1.1rem; border-radius: 12px; } }

/* Aperçu « voir en tant que » (administrateur) */
.preview-bar { position: sticky; top: 0; z-index: 70; display: flex; align-items: center; justify-content: center; gap: 16px; flex-wrap: wrap; padding: 8px 16px; background: #FFF3D6; color: #5A3B00; font-size: .92rem; border-bottom: 1px solid #F0DDB6; }
.preview-bar form { margin: 0; }

/* Espace apprenant sur téléphone : onglets en bas de l'écran (le menu du haut ne tient pas en largeur) */
.learn-tabbar { display: none; }
@media (max-width: 640px) {
  body:has(.learn-tabbar) .topbar .nav { display: none; }
  body:has(.learn-tabbar) .container { padding-bottom: 92px; }
  .learn-tabbar {
    display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    background: rgba(255, 255, 255, .96); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line);
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px));
  }
  .learn-tabbar a { display: grid; justify-items: center; gap: 2px; padding: 6px 0; font-size: .72rem; font-weight: 600; color: var(--ink-3); border-radius: 12px; }
  .learn-tabbar a .icon { width: 22px; height: 22px; }
  .learn-tabbar a.active { color: var(--blue, #1A6FB5); }
  body:has(.learn-tabbar) .install-hint { bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
}
