/* LMS ANAIA — feuille de style principale (sans étape de build) */
:root {
  --primary: #4f46e5;
  --primary-soft: color-mix(in srgb, var(--primary) 12%, white);
  --bg: #f6f7fb;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #e5e7eb;
  --success: #059669;
  --success-soft: #d1fae5;
  --warning: #d97706;
  --warning-soft: #fef3c7;
  --danger: #dc2626;
  --danger-soft: #fee2e2;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
}
* { box-sizing: border-box; }
body { margin: 0; font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.55; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.6rem; margin: 0 0 .25rem; }
h2 { font-size: 1.2rem; margin: 1.5rem 0 .75rem; }
h3 { font-size: 1.05rem; margin: 0 0 .5rem; }
img, video, iframe { max-width: 100%; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }

/* Barre du haut */
.topbar { background: var(--card); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; }
.topbar .inner { max-width: 1180px; margin: 0 auto; padding: .6rem 1rem; display: flex; align-items: center; gap: 1rem; }
.brand { font-weight: 700; color: var(--text); display: flex; align-items: center; gap: .5rem; font-size: 1.05rem; }
.brand img { height: 32px; }
.brand .dot { width: 30px; height: 30px; border-radius: 9px; background: var(--primary); color: #fff; display: grid; place-items: center; font-size: .9rem; }
.nav { display: flex; gap: .25rem; flex: 1; flex-wrap: wrap; }
.nav a { padding: .45rem .75rem; border-radius: 9px; color: var(--muted); font-weight: 500; }
.nav a:hover, .nav a.active { background: var(--primary-soft); color: var(--primary); text-decoration: none; }
.userbox { display: flex; align-items: center; gap: .75rem; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--primary); color: #fff; display: grid; place-items: center; font-weight: 600; font-size: .85rem; }
.pill { display: inline-flex; align-items: center; gap: .3rem; padding: .2rem .6rem; border-radius: 999px; background: var(--primary-soft); color: var(--primary); font-size: .8rem; font-weight: 600; white-space: nowrap; }
.pill.gray { background: #f3f4f6; color: var(--muted); }
.pill.green { background: var(--success-soft); color: var(--success); }
.pill.orange { background: var(--warning-soft); color: var(--warning); }
.pill.red { background: var(--danger-soft); color: var(--danger); }
.bell { position: relative; font-size: 1.2rem; }
.bell .count { position: absolute; top: -6px; right: -8px; background: var(--danger); color: #fff; border-radius: 999px; font-size: .65rem; padding: 0 .35rem; }

.container { max-width: 1180px; margin: 0 auto; padding: 1.5rem 1rem 4rem; }
.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.row { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }

.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.25rem; }
.card.flush { padding: 0; overflow: hidden; }
.card h3 a { color: var(--text); }
.course-card .cover { height: 130px; background: linear-gradient(135deg, var(--primary), color-mix(in srgb, var(--primary) 65%, #0f172a)); background-size: cover; background-position: center; display: flex; align-items: flex-end; padding: .75rem; }
.course-card .body { padding: 1rem 1.25rem 1.25rem; }
.stat { text-align: center; }
.stat .value { font-size: 1.8rem; font-weight: 700; color: var(--primary); }
.stat .label { color: var(--muted); font-size: .85rem; }

.progress { height: 10px; background: #eef0f5; border-radius: 999px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--primary), color-mix(in srgb, var(--primary) 60%, #22c55e)); border-radius: 999px; transition: width .6s; }

.btn { display: inline-flex; align-items: center; gap: .4rem; border: 1px solid transparent; background: var(--primary); color: #fff; padding: .6rem 1.1rem; border-radius: 10px; font-weight: 600; cursor: pointer; font-size: .95rem; font-family: inherit; }
.btn:hover { filter: brightness(1.07); text-decoration: none; }
.btn.secondary { background: #fff; color: var(--text); border-color: var(--border); }
.btn.success { background: var(--success); }
.btn.danger { background: var(--danger); }
.btn.small { padding: .35rem .7rem; font-size: .85rem; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

.flash { padding: .8rem 1rem; border-radius: 10px; margin-bottom: 1rem; font-weight: 500; }
.flash.success { background: var(--success-soft); color: #065f46; }
.flash.error, .flash.danger { background: var(--danger-soft); color: #991b1b; }
.flash.info { background: var(--primary-soft); color: var(--primary); }

/* Formulaires */
label { display: block; font-weight: 600; margin: .9rem 0 .3rem; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=datetime-local], input[type=time], input[type=search], input[type=tel], input[type=url], select, textarea { width: 100%; padding: .6rem .75rem; border: 1px solid var(--border); border-radius: 10px; font: inherit; background: #fff; }
input:focus, select:focus, textarea:focus, input[type=file]:focus { outline: 2px solid color-mix(in srgb, var(--primary) 35%, transparent); border-color: var(--primary); }
textarea { min-height: 110px; }
.choice { display: flex; gap: .6rem; align-items: flex-start; padding: .65rem .8rem; border: 1px solid var(--border); border-radius: 10px; margin: .4rem 0; cursor: pointer; font-weight: 400; background: #fff; }
.choice:hover { border-color: var(--primary); }
.choice input { margin-top: .25rem; }
.choice.correct { border-color: var(--success); background: var(--success-soft); }
.choice.wrong { border-color: var(--danger); background: var(--danger-soft); }
.help { color: var(--muted); font-size: .85rem; margin-top: .2rem; }
.form-error, ul.form-errors { color: var(--danger); font-size: .85rem; }
.required::after { content: " *"; color: var(--danger); }
.scale { display: flex; gap: .4rem; }
.scale label { margin: 0; font-weight: 500; border: 1px solid var(--border); border-radius: 10px; padding: .45rem .9rem; cursor: pointer; }
.scale input { display: none; }
.scale input:checked + span { color: var(--primary); font-weight: 700; }

/* Plan du cours */
.module { margin-bottom: 1rem; }
.module-head { display: flex; align-items: center; gap: .75rem; padding: .9rem 1.25rem; background: #fafbff; border-bottom: 1px solid var(--border); }
.lesson-row { display: flex; align-items: center; gap: .9rem; padding: .75rem 1.25rem; border-bottom: 1px solid var(--border); color: var(--text); }
.lesson-row:last-child { border-bottom: 0; }
.lesson-row:hover { background: #fafbff; text-decoration: none; }
.lesson-row.locked { opacity: .5; pointer-events: none; }
.lesson-row .state { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--border); display: grid; place-items: center; font-size: .8rem; flex-shrink: 0; }
.lesson-row.done .state { background: var(--success); border-color: var(--success); color: #fff; }
.lesson-row.current .state { border-color: var(--primary); color: var(--primary); }

/* Lecteur de leçon */
.player { display: grid; grid-template-columns: 300px 1fr; gap: 1.25rem; align-items: start; }
.player aside { position: sticky; top: 76px; max-height: calc(100vh - 100px); overflow: auto; }
.player aside .lesson-row { padding: .55rem .9rem; font-size: .9rem; }
.player aside .lesson-row.active { background: var(--primary-soft); font-weight: 600; }
.lesson-content { font-size: 1.02rem; }
.lesson-content img { border-radius: 10px; }
.embed { position: relative; padding-top: 56.25%; border-radius: 12px; overflow: hidden; background: #000; }
.embed iframe, .embed video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.pdf-frame { width: 100%; height: 75vh; border: 1px solid var(--border); border-radius: 12px; }
.lesson-nav { display: flex; justify-content: space-between; gap: 1rem; margin-top: 1.5rem; }
@media (max-width: 900px) { .player { grid-template-columns: 1fr; } .player aside { position: static; max-height: none; } }

/* Tableaux */
table.table { width: 100%; border-collapse: collapse; background: #fff; }
.table th, .table td { text-align: left; padding: .65rem .8rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table th { font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); background: #fafbff; }
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); }

/* Badges */
.badge-tile { text-align: center; padding: 1rem .5rem; }
.badge-tile .icon { font-size: 2.2rem; }
.badge-tile.locked { filter: grayscale(1); opacity: .4; }
.level-ring { width: 86px; height: 86px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 1.6rem; color: var(--primary); background: conic-gradient(var(--primary) calc(var(--p) * 1%), #eef0f5 0); position: relative; }
.level-ring::before { content: ""; position: absolute; inset: 8px; border-radius: 50%; background: #fff; }
.level-ring span { position: relative; }

/* Page de connexion */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 1rem; background: radial-gradient(circle at 20% 20%, var(--primary-soft), var(--bg) 60%); }
.auth .card { width: 100%; max-width: 420px; padding: 2rem; }

.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 50; }
.empty { text-align: center; padding: 2.5rem 1rem; color: var(--muted); }
.empty .icon { font-size: 2.5rem; }
.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--border); margin-bottom: 1rem; flex-wrap: wrap; }
.tabs a { padding: .6rem 1rem; color: var(--muted); border-bottom: 2px solid transparent; font-weight: 500; }
.tabs a.active { color: var(--primary); border-color: var(--primary); text-decoration: none; }

/* Téléphone : barre du haut sur deux lignes (menu défilant), leçon avant le plan du cours */
@media (max-width: 720px) {
  .topbar .inner { flex-wrap: wrap; gap: .5rem; padding: .5rem .75rem; }
  .brand { flex: 1; min-width: 0; font-size: .95rem; }
  .brand > span:last-child, .brand { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .userbox { gap: .5rem; }
  .nav { order: 3; flex: 0 0 100%; flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: .15rem; }
  .nav a { white-space: nowrap; padding: .4rem .6rem; font-size: .9rem; }
  .container { padding: 1rem .75rem 3rem; }
  h1 { font-size: 1.35rem; }
  .player aside { order: 2; }
  .player section { order: 1; }
  .card { padding: 1rem; }
  .lesson-row { padding: .7rem .9rem; }
  .lesson-row .small.muted { display: none; }
  .grid-2, .grid-3, .grid[style*="grid-template-columns"] { grid-template-columns: 1fr !important; }
  .grid-4 { grid-template-columns: 1fr 1fr; }
  .row > div[style*="min-width"] { min-width: 0 !important; width: 100%; }
  .lesson-nav { flex-direction: column; }
  .lesson-nav .btn { justify-content: center; }
}

/* Messagerie */
.thread { display: flex; flex-direction: column; gap: .5rem; max-height: 60vh; overflow-y: auto; padding: .25rem; }
.bubble { max-width: 78%; background: #f1f3f9; border-radius: 14px 14px 14px 4px; padding: .55rem .8rem; align-self: flex-start; }
.bubble.mine { background: var(--primary); color: #fff; border-radius: 14px 14px 4px 14px; align-self: flex-end; }
.bubble.mine a { color: #fff; text-decoration: underline; }
.bubble .who { font-size: .8rem; font-weight: 600; color: var(--primary); margin-bottom: .15rem; }
.bubble .when { font-size: .7rem; opacity: .65; text-align: right; margin-top: .2rem; }
.day-sep, .unread-sep { text-align: center; font-size: .75rem; color: var(--muted); margin: .5rem 0; }
.unread-sep { color: var(--danger); font-weight: 600; border-top: 1px solid var(--danger-soft); padding-top: .4rem; }
.messaging-list .lesson-row.active { background: var(--primary-soft); }
@media (max-width: 720px) { .messaging-list { display: none; } .bubble { max-width: 90%; } }

/* Barre de navigation v2 */
.topbar { backdrop-filter: saturate(1.4) blur(8px); background: color-mix(in srgb, var(--card) 88%, transparent); }
.topbar .inner { height: 64px; padding-top: 0; padding-bottom: 0; }
.brand .dot { width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(135deg, var(--primary), color-mix(in srgb, var(--primary) 65%, #0f172a)); }
.nav { justify-content: center; gap: .15rem; }
.nav a { display: inline-flex; align-items: center; gap: .45rem; position: relative; height: 40px; padding: 0 .8rem; border-radius: 10px; color: #4b5563; font-weight: 500; font-size: .93rem; }
.nav a svg { opacity: .75; }
.nav a:hover { background: #f3f4f8; color: var(--text); }
.nav a.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.nav a.active svg { opacity: 1; }
.badge { position: absolute; top: 3px; right: 2px; 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; box-shadow: 0 0 0 2px var(--card); }
.score { display: inline-flex; align-items: center; gap: .3rem; height: 34px; padding: 0 .75rem; border-radius: 999px; background: #fff7e6; color: #92400e; font-weight: 700; font-size: .88rem; border: 1px solid #fde7b0; }
.score:hover { text-decoration: none; filter: brightness(.98); }
.score .star { color: #f59e0b; display: inline-flex; } .score .flame { color: #f97316; display: inline-flex; margin-left: .3rem; }
.icon-btn { position: relative; width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; color: #4b5563; }
.icon-btn:hover { background: #f3f4f8; color: var(--text); }
.icon-btn .badge { top: 2px; right: 2px; }
.usermenu { position: relative; }
.usermenu summary { list-style: none; cursor: pointer; }
.usermenu summary::-webkit-details-marker { display: none; }
.usermenu .menu { position: absolute; right: 0; top: 46px; width: 240px; background: var(--card); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 12px 32px rgba(16, 24, 40, .14); padding: .4rem; z-index: 20; }
.usermenu .menu-head { padding: .6rem .7rem; border-bottom: 1px solid var(--border); margin-bottom: .3rem; display: flex; flex-direction: column; }
.usermenu .menu a { display: flex; align-items: center; gap: .6rem; padding: .55rem .7rem; border-radius: 8px; color: var(--text); }
.usermenu .menu a:hover { background: #f3f4f8; text-decoration: none; }
@media (max-width: 900px) { .nav a span { display: none; } .nav a { padding: 0 .7rem; } .brand-name { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } }
@media (max-width: 720px) {
  .topbar .inner { height: auto; padding: .5rem .75rem; }
  .nav { justify-content: space-around; }
  .nav a span { display: none; }
  .score .flame, .score .flame + * { display: none; }
}

/* Menu sur une seule ligne ; icônes messagerie / notifications */
@media (min-width: 721px) { .nav { flex-wrap: nowrap; white-space: nowrap; } }
.icon-btn.active { background: var(--primary-soft); color: var(--primary); }

/* Pastille « top x % » (privée, uniquement positive) */
.top-tier { display: inline-flex; align-items: center; gap: .3rem; margin-top: .35rem; padding: .2rem .65rem; border-radius: 999px; font-size: .8rem; font-weight: 700;
  color: #7c2d12; background: linear-gradient(135deg, #fde68a, #fbbf24); box-shadow: 0 1px 0 rgba(0,0,0,.05); }
.top-tier-card { display: flex; gap: 1rem; align-items: center; background: linear-gradient(135deg, #fffbeb, #fef3c7); border-color: #fcd34d; }

/* Champs fichier homogènes avec les autres champs */
input[type=file] { width: 100%; padding: .5rem .6rem; border: 1px dashed var(--border); border-radius: 10px; background: #fafbff; font: inherit; }
input[type=file]::file-selector-button { border: 0; background: var(--primary-soft); color: var(--primary); font-weight: 600; padding: .4rem .8rem; border-radius: 8px; margin-right: .75rem; cursor: pointer; }
.brand { white-space: nowrap; flex-shrink: 0; }
.userbox { flex-shrink: 0; }
.nav { min-width: 0; }
/* Équipe (plus d'onglets) : icônes seules en dessous de 1200 px, libellés en info-bulle */
@media (max-width: 1200px) { .nav a span { display: none; } .nav a { padding: 0 .7rem; } }
.tabs a { display: inline-flex; align-items: center; gap: .4rem; }
/* Éditeur Quill (leçons) en français */
.ql-snow .ql-tooltip::before { content: "Ouvrir le lien :"; }
.ql-snow .ql-tooltip[data-mode=link]::before { content: "Adresse du lien :"; }
.ql-snow .ql-tooltip[data-mode=video]::before { content: "Lien de la vidéo :"; }
.ql-snow .ql-tooltip a.ql-action::after { content: "Modifier"; }
.ql-snow .ql-tooltip a.ql-remove::before { content: "Retirer"; }
.ql-snow .ql-tooltip.ql-editing a.ql-action::after { content: "Enregistrer"; }
.ql-snow .ql-picker.ql-header .ql-picker-label::before, .ql-snow .ql-picker.ql-header .ql-picker-item::before { content: "Texte"; }
.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="2"]::before, .ql-snow .ql-picker.ql-header .ql-picker-item[data-value="2"]::before { content: "Titre"; }
.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="3"]::before, .ql-snow .ql-picker.ql-header .ql-picker-item[data-value="3"]::before { content: "Sous-titre"; }

/* ─── Éditeur de leçon ─── */
.lesson-editor .editor-top { display: flex; align-items: center; gap: .75rem; margin: .75rem 0 1.25rem; position: sticky; top: 64px; z-index: 6; background: var(--bg); padding: .5rem 0; }
.type-chip { padding: .35rem .75rem; border-radius: 999px; background: var(--primary-soft); color: var(--primary); font-weight: 600; font-size: .85rem; white-space: nowrap; }
.title-input { flex: 1; font-size: 1.4rem !important; font-weight: 700; border: 0 !important; background: transparent !important; padding: .3rem .2rem !important; }
.title-input:focus { outline: 0 !important; box-shadow: inset 0 -2px 0 var(--primary); }
.editor-section { margin-bottom: 1rem; }
.editor-section > h3 { margin-bottom: .5rem; }
.editor-side { position: sticky; top: 140px; }
.blocks-editor { min-height: 220px; padding: .25rem .25rem .25rem 3.25rem; border: 1px dashed transparent; border-radius: 12px; }
.blocks-editor:hover { border-color: var(--border); }
.blocks-editor .ce-block__content, .blocks-editor .ce-toolbar__content { max-width: none; }
.blocks-editor .ce-toolbar__plus, .blocks-editor .ce-toolbar__settings-btn { background: var(--primary-soft); color: var(--primary); border-radius: 8px; }
.blocks-editor h2.ce-header { font-size: 1.35rem; } .blocks-editor h3.ce-header { font-size: 1.15rem; }
.callout-title:empty::before, .callout-text:empty::before { content: attr(data-placeholder); color: #9ca3af; }
.callout-title { font-weight: 700; outline: none; } .callout-text { outline: none; min-height: 1.4em; }

/* Cartes QCM / formulaire */
.q-card, .f-card { padding: 1rem 1.1rem; margin-bottom: .9rem; border-left: 4px solid var(--primary); transition: box-shadow .15s; }
.q-card:focus-within, .f-card:focus-within { box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent); }
.q-card.has-problem { border-left-color: var(--warning); }
.f-card.is-section { border-left-color: #0ea5e9; background: #f0f9ff; }
.q-head { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; margin-bottom: .6rem; }
.q-num { width: 30px; height: 30px; border-radius: 50%; background: var(--primary); color: #fff; display: grid; place-items: center; font-weight: 700; flex-shrink: 0; }
.seg { display: inline-flex; background: #f3f4f8; border-radius: 10px; padding: 3px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: .35rem .6rem; border-radius: 8px; font: inherit; font-size: .82rem; cursor: pointer; color: var(--muted); }
.seg button.on { background: #fff; color: var(--text); font-weight: 600; box-shadow: var(--shadow); }
.pts { display: inline-flex; align-items: center; gap: .3rem; margin: 0; font-weight: 600; font-size: .85rem; background: #fff7e6; border: 1px solid #fde7b0; padding: .2rem .5rem; border-radius: 10px; }
.pts input { width: 48px !important; padding: .15rem .3rem !important; text-align: center; border-radius: 6px !important; }
.icon-mini { border: 1px solid var(--border); background: #fff; border-radius: 8px; width: 30px; height: 30px; cursor: pointer; font-size: .85rem; color: var(--muted); }
.icon-mini:hover { color: var(--text); border-color: #cbd5e1; } .icon-mini.danger:hover { color: var(--danger); border-color: var(--danger); }
.q-label { font-size: 1.02rem; font-weight: 600; }
.choice-row { display: flex; align-items: center; gap: .5rem; margin: .35rem 0; }
.choice-row input { flex: 1; }
.tick { width: 34px; height: 34px; flex-shrink: 0; border-radius: 50%; border: 2px solid var(--border); background: #fff; color: transparent; font-weight: 800; cursor: pointer; display: grid; place-items: center; transition: all .15s; }
.tick.square { border-radius: 8px; }
.choice-row.is-correct .tick { background: var(--success); border-color: var(--success); color: #fff; }
.choice-row.is-correct input { border-color: var(--success); background: var(--success-soft); }
.f-card .tick { cursor: default; color: var(--muted); font-weight: 600; font-size: .8rem; }
.add-link { border: 0; background: none; color: var(--primary); font-weight: 600; cursor: pointer; padding: .4rem 0; font: inherit; font-size: .9rem; }
.feedback label { margin-top: .4rem; font-size: .88rem; } .feedback .ok { color: var(--success); } .feedback .ko { color: var(--warning); }
.q-problem { margin-top: .5rem; font-size: .85rem; color: var(--warning); font-weight: 600; }
.add-palette { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; padding: 1rem; border: 2px dashed var(--border); border-radius: var(--radius); background: #fff; }
.add-palette button { border: 1px solid var(--border); background: #fafbff; border-radius: 999px; padding: .45rem .85rem; font: inherit; font-size: .88rem; font-weight: 600; cursor: pointer; transition: all .15s; }
.add-palette button:hover { background: var(--primary); color: #fff; border-color: var(--primary); transform: translateY(-1px); }
.type-select { width: auto !important; font-weight: 600; }
.switch { display: inline-flex; align-items: center; gap: .35rem; margin: 0 .3rem 0 0; font-weight: 500; font-size: .88rem; }

/* ─── Rendu des blocs côté apprenant ─── */
.lesson-content .callout { display: flex; gap: .85rem; align-items: flex-start; padding: .9rem 1.1rem; border-radius: 12px; margin: 1rem 0; border: 1px solid; }
.callout-icon { font-size: 1.4rem; line-height: 1.2; }
.callout p { margin: .2rem 0 0; }
.callout-info { background: #eff6ff; border-color: #bfdbfe; } .callout-tip { background: #f5f3ff; border-color: #ddd6fe; }
.callout-warning { background: #fffbeb; border-color: #fde68a; } .callout-key { background: #fdf2f8; border-color: #fbcfe8; }
.callout-example { background: #ecfdf5; border-color: #a7f3d0; }
.blocks-editor .callout { display: flex; gap: .85rem; padding: .9rem 1.1rem; border-radius: 12px; border: 1px solid; margin: .4rem 0; }
.lesson-content figure.media { margin: 1.25rem 0; } .lesson-content figure img { border-radius: 12px; display: block; margin: 0 auto; }
.lesson-content figure.bordered img { border: 1px solid var(--border); } .lesson-content figure.backed { background: #f3f4f8; padding: 1rem; border-radius: 12px; }
.lesson-content figure.stretched img { width: 100%; }
.lesson-content figcaption { text-align: center; color: var(--muted); font-size: .88rem; margin-top: .4rem; }
.lesson-content blockquote { border-left: 4px solid var(--primary); margin: 1rem 0; padding: .5rem 1rem; background: #fafbff; border-radius: 0 10px 10px 0; font-style: italic; }
.lesson-content blockquote cite { display: block; font-style: normal; color: var(--muted); font-size: .88rem; margin-top: .3rem; }
.lesson-content ul.checklist { list-style: none; padding-left: 0; } .lesson-content ul.checklist li::before { content: "☐ "; } .lesson-content ul.checklist li.done::before { content: "☑️ "; }
.lesson-content hr { border: 0; text-align: center; margin: 1.5rem 0; } .lesson-content hr::after { content: "✦ ✦ ✦"; color: #c7cbe0; letter-spacing: .5rem; }
/* QCM apprenant */
.quiz-q { margin: .75rem 0; box-shadow: none; }
.quiz-q.q-ok { border-left: 4px solid var(--success); } .quiz-q.q-ko { border-left: 4px solid var(--danger); }
.feedback-box { margin-top: .6rem; padding: .6rem .8rem; border-radius: 10px; font-size: .93rem; }
.feedback-box.ok { background: var(--success-soft); color: #065f46; } .feedback-box.ko { background: var(--warning-soft); color: #92400e; }
.tf { display: flex; gap: .75rem; margin-top: .6rem; }
.tf label { flex: 1; margin: 0; } .tf input { display: none; }
.tf span { display: block; text-align: center; padding: .9rem; border: 2px solid var(--border); border-radius: 12px; font-weight: 700; cursor: pointer; transition: all .15s; }
.tf input:checked + span { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.answer-box { margin-top: .5rem; padding: .7rem .9rem; border-radius: 10px; background: #f6f7fb; border: 1px solid var(--border); white-space: pre-line; }
.score-pick { display: flex; flex-wrap: wrap; gap: .35rem; }
.score-pick label { margin: 0; } .score-pick input { display: none; }
.score-pick span { display: grid; place-items: center; min-width: 38px; height: 38px; border-radius: 10px; border: 2px solid var(--border); font-weight: 700; cursor: pointer; background: #fff; }
.score-pick input:checked + span { background: var(--primary); border-color: var(--primary); color: #fff; }
/* Blocs vidéo / audio dans l'éditeur */
.media-block { margin: .5rem 0; }
.media-empty { display: flex; gap: 1rem; align-items: center; padding: 1rem 1.1rem; border: 2px dashed var(--border); border-radius: 12px; background: #fafbff; }
.media-big { font-size: 2rem; }
.media-empty .media-url { margin: .45rem 0; }
.media-actions { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.media-actions label.btn { margin: 0; cursor: pointer; }
.media-block video { width: 100%; border-radius: 12px; background: #000; }
.media-caption { text-align: center; color: var(--muted); font-size: .9rem; margin-top: .35rem; outline: none; }
.media-caption:empty::before { content: attr(data-placeholder); color: #c0c4d0; }
.lesson-content figure.media video { width: 100%; border-radius: 12px; background: #000; }
.lesson-content figure.media-audio { padding: .9rem 1rem; background: #f6f7fb; border: 1px solid var(--border); border-radius: 12px; }
.lesson-content figure.media-audio audio { width: 100%; }
.var-chips { display: flex; flex-wrap: wrap; gap: .35rem; }
.var-chips button { border: 1px solid var(--border); background: #fafbff; border-radius: 999px; padding: .3rem .7rem; font: inherit; font-size: .82rem; cursor: pointer; color: var(--primary); }
.var-chips button:hover { background: var(--primary); color: #fff; }
/* Rendez-vous */
.live-card { display: flex; gap: 1.1rem; align-items: center; padding: 1rem 1.2rem; border-radius: 14px; background: linear-gradient(135deg, var(--primary-soft), #fff); border: 1px solid var(--border); margin-top: 1rem; }
.live-date { width: 78px; flex-shrink: 0; text-align: center; background: #fff; border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; }
.live-date .day { display: block; background: var(--primary); color: #fff; font-size: .72rem; font-weight: 700; padding: .2rem 0; }
.live-date .num { display: block; font-size: 1.8rem; font-weight: 800; line-height: 1.2; }
.live-date .month { display: block; font-size: .8rem; color: var(--muted); padding-bottom: .3rem; }
.live-when { font-weight: 700; font-size: 1.05rem; } .live-mode { color: var(--muted); }
.seg-btn { display: inline-block; padding: .35rem .7rem; border-radius: 8px; font-size: .85rem; cursor: pointer; color: var(--muted); }
.seg input:checked + .seg-btn { background: #fff; color: var(--text); font-weight: 700; box-shadow: var(--shadow); }
.seg input[value=present]:checked + .seg-btn { color: var(--success); } .seg input[value=absent]:checked + .seg-btn { color: var(--danger); }
.type-chip { max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.lock-reason { display: block; font-size: .8rem; color: var(--warning); font-weight: 600; }
.lesson-row.locked { opacity: .75; } .lesson-row.locked > span:not(:has(.lock-reason)) { opacity: .7; }
.conditions { margin-top: 1rem; border: 1px solid var(--border); border-radius: 10px; padding: .6rem .8rem; background: #fafbff; }
.conditions summary { cursor: pointer; font-weight: 600; }
.quiz-start { display: flex; gap: 1rem; align-items: center; background: linear-gradient(135deg, var(--primary-soft), #fff); }
.quiz-timer { position: sticky; top: 72px; z-index: 5; margin-left: auto; width: max-content; padding: .45rem .9rem; border-radius: 999px; background: var(--text); color: #fff; font-weight: 800; font-variant-numeric: tabular-nums; box-shadow: var(--shadow); }
.quiz-timer.urgent { background: var(--danger); animation: pulse 1s infinite; }
@keyframes pulse { 50% { transform: scale(1.06); } }
/* Assistant IA */
.tutor { position: fixed; right: 20px; bottom: 20px; z-index: 40; }
.tutor-fab { display: flex; align-items: center; gap: .4rem; border: 0; border-radius: 999px; padding: .8rem 1.1rem; background: linear-gradient(135deg, var(--primary), color-mix(in srgb, var(--primary) 65%, #0f172a)); color: #fff; font: inherit; font-weight: 700; cursor: pointer; box-shadow: 0 10px 25px color-mix(in srgb, var(--primary) 35%, transparent); }
.tutor.open .tutor-fab { display: none; }
.tutor-panel { display: none; width: min(400px, calc(100vw - 32px)); height: min(560px, calc(100vh - 110px)); background: var(--card); border: 1px solid var(--border); border-radius: 16px; box-shadow: 0 20px 50px rgba(16, 24, 40, .2); flex-direction: column; overflow: hidden; }
.tutor.open .tutor-panel { display: flex; }
.tutor-head { display: flex; align-items: center; gap: .5rem; padding: .75rem .9rem; background: linear-gradient(135deg, var(--primary), color-mix(in srgb, var(--primary) 65%, #0f172a)); color: #fff; }
.tutor-head .small { opacity: .85; flex: 1; text-align: right; } .tutor-head button { border: 0; background: none; color: #fff; cursor: pointer; font-size: 1rem; }
.tutor-body { flex: 1; overflow-y: auto; padding: .9rem; display: flex; flex-direction: column; gap: .55rem; background: #fafbff; }
.tmsg { max-width: 88%; padding: .55rem .8rem; border-radius: 14px; font-size: .93rem; line-height: 1.5; }
.tmsg.bot { background: #fff; border: 1px solid var(--border); align-self: flex-start; border-bottom-left-radius: 4px; }
.tmsg.me { background: var(--primary); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.tmsg ul { margin: .3rem 0; padding-left: 1.1rem; }
.tmsg.typing span { display: inline-block; width: 7px; height: 7px; margin: 0 2px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite; }
.tmsg.typing span:nth-child(2) { animation-delay: .2s; } .tmsg.typing span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 50% { opacity: .2; } }
.tutor-form { display: flex; gap: .5rem; padding: .6rem .9rem; border-top: 1px solid var(--border); align-items: flex-end; }
.tutor-form textarea { min-height: 44px; resize: none; }
@media (max-width: 720px) { .tutor { right: 12px; bottom: 12px; } .tutor-fab span { display: none; } }
.reply.is-answer { border-color: var(--success); background: #f0fdf4; }
.badge-page { text-align: center; padding: 1.5rem 0; } .badge-page img { filter: drop-shadow(0 10px 20px rgba(79,70,229,.25)); }

/* Notes et favoris */
.fav { border: 0; background: none; font-size: 1.5rem; color: #d1d5db; cursor: pointer; line-height: 1; } .fav.on { color: #f59e0b; } .fav:hover { transform: scale(1.15); }
.notes-box { margin-top: 1rem; } .notes-box summary { cursor: pointer; font-weight: 700; } .notes-box textarea { margin: .6rem 0 .4rem; background: #fffdf5; }

/* Planning */
.weeks { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .6rem; margin-top: 1rem; }
.week { border: 1px solid var(--border); border-radius: 12px; padding: .6rem .7rem; background: #fafbff; }
.week.current { border-color: var(--primary); background: var(--primary-soft); }
.week-lesson { display: inline-block; font-size: .86rem; padding: .25rem .55rem; margin: .2rem .2rem 0 0; border-radius: 8px; background: #fff; border: 1px solid var(--border); color: var(--text); }
.week-lesson:hover { border-color: var(--primary); text-decoration: none; }
.plan-card { background: linear-gradient(135deg, #fff, var(--primary-soft)); }
/* Rendez-vous individuels */
.day-row { display: flex; gap: .6rem; align-items: flex-start; padding: .45rem 0; border-bottom: 1px solid var(--border); }
.day-row > strong { width: 82px; padding-top: .35rem; font-size: .9rem; }
.day-pills { display: flex; gap: .4rem; overflow-x: auto; padding-bottom: .4rem; }
.day-pill { display: flex; flex-direction: column; align-items: center; min-width: 62px; padding: .45rem .3rem; border: 2px solid var(--border); border-radius: 12px; background: #fff; cursor: pointer; font: inherit; }
.day-pill strong { font-size: 1.25rem; } .day-pill.on { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.slots { margin-top: .8rem; display: flex; flex-wrap: wrap; gap: .4rem; }
.slots > div { width: 100%; }
.slot { border: 2px solid var(--border); background: #fff; border-radius: 10px; padding: .5rem .9rem; font: inherit; font-weight: 700; cursor: pointer; }
.slot:hover { border-color: var(--primary); } .slot.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.booking-card { display: flex; gap: 1rem; align-items: center; margin-bottom: .6rem; flex-wrap: wrap; }

.cancel-box { position: relative; } .cancel-box summary { list-style: none; } .cancel-box summary::-webkit-details-marker { display: none; }
.cancel-pop { position: absolute; right: 0; top: 40px; width: 340px; z-index: 10; box-shadow: 0 12px 30px rgba(16,24,40,.18); }
.policy { margin-top: 1rem; padding: .7rem .8rem; border-radius: 10px; background: var(--warning-soft); color: #92400e; font-size: .85rem; line-height: 1.45; }

/* Photos de profil */
.avatar { overflow: hidden; }
.avatar.has-photo { background: #e5e7eb; padding: 0; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-edit { display: flex; gap: 1rem; align-items: center; margin-bottom: 1.25rem; padding-bottom: 1.25rem; border-bottom: 1px solid var(--border); }
.photo-big { width: 84px; height: 84px; font-size: 1.6rem; flex-shrink: 0; }

/* Bascule d'espace (organismes) dans le menu */
.usermenu .menu-section { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: .5rem .9rem .2rem; }
.usermenu .menu-sep { height: 1px; background: var(--border); margin: .3rem 0; }
.usermenu .space-switch { display: flex; align-items: center; gap: .55rem; width: 100%; border: 0; background: none; padding: .45rem .9rem; font: inherit; color: inherit; cursor: pointer; text-align: left; }
.usermenu .space-switch:hover { background: var(--bg, #f6f7fb); }
.usermenu .space-switch img, .usermenu .space-switch .dot { width: 22px; height: 22px; border-radius: 6px; object-fit: contain; }
.usermenu .space-switch .dot { display: grid; place-items: center; color: #fff; font-size: .7rem; font-weight: 700; }

/* Application installable : conseil pour iPhone / iPad */
.install-ios { position: fixed; left: 1rem; right: 1rem; bottom: 1rem; z-index: 50; background: #264653; color: #fff; padding: .9rem 2.6rem .9rem 1rem; border-radius: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.2); font-size: .9rem; }
.install-ios button { position: absolute; top: .5rem; right: .6rem; border: 0; background: none; color: #fff; font-size: 1rem; cursor: pointer; }
@media (display-mode: standalone) { body { padding-bottom: env(safe-area-inset-bottom); } }

/* Accessibilité (réglages de l'utilisateur, sur son appareil) */
html[data-a11y-size="l"] { zoom: 1.12; }
html[data-a11y-size="xl"] { zoom: 1.25; }
html[data-a11y-font="legible"] body, html[data-a11y-font="legible"] input, html[data-a11y-font="legible"] textarea, html[data-a11y-font="legible"] button, html[data-a11y-font="legible"] select { font-family: "Atkinson Hyperlegible", system-ui, sans-serif !important; }
html[data-a11y-font="dys"] body, html[data-a11y-font="dys"] input, html[data-a11y-font="dys"] textarea, html[data-a11y-font="dys"] button, html[data-a11y-font="dys"] select { font-family: "OpenDyslexic", system-ui, sans-serif !important; }
html[data-a11y-contrast] { --text: #000; --muted: #374151; --border: #6b7280; }
html[data-a11y-contrast] body { background: #fff; }
html[data-a11y-contrast] a:not(.btn) { text-decoration: underline; }
html[data-a11y-contrast] .card, html[data-a11y-contrast] input, html[data-a11y-contrast] textarea, html[data-a11y-contrast] select { border-color: #4b5563 !important; }
html[data-a11y-contrast] :focus-visible { outline: 3px solid #000 !important; outline-offset: 2px; }
html[data-a11y-spacing] body { line-height: 1.9; letter-spacing: .02em; word-spacing: .08em; }
html[data-a11y-spacing] p, html[data-a11y-spacing] li { margin-bottom: 1em; }
html[data-a11y-motion] *, html[data-a11y-motion] *::before, html[data-a11y-motion] *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
.a11y-panel { border: 0; border-radius: 16px; padding: 1.4rem; width: min(420px, calc(100vw - 2rem)); box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.a11y-panel::backdrop { background: rgba(17,24,39,.45); }
.a11y-panel h2 { margin: 0 0 .3rem; font-size: 1.15rem; }
.a11y-panel fieldset { border: 1px solid var(--border); border-radius: 10px; margin: .7rem 0 0; padding: .5rem .8rem .7rem; }
.a11y-panel legend { font-weight: 600; font-size: .85rem; padding: 0 .3rem; }
.a11y-panel label { display: flex; align-items: center; gap: .5rem; margin: .3rem 0 0; font-weight: 400; }
.a11y-panel input { width: auto; margin: 0; }

/* Pied de page (« Confidentialité… ») toujours en bas de la fenêtre, même sur une page courte */
body { min-height: 100vh; display: flex; flex-direction: column; }
body > main { flex: 1 0 auto; width: 100%; box-sizing: border-box; }
body > footer { flex-shrink: 0; padding-bottom: 1.25rem; }
