/* MonLMS : lecteur élève. Polices servies localement (aucun appel à Google). */
@font-face { font-family: "MonLMS Sans"; font-weight: 500; font-style: normal; font-display: swap; src: url("../fonts/plus-jakarta-sans-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "MonLMS Sans"; font-weight: 600; font-style: normal; font-display: swap; src: url("../fonts/plus-jakarta-sans-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "MonLMS Sans"; font-weight: 700; font-style: normal; font-display: swap; src: url("../fonts/plus-jakarta-sans-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "MonLMS Sans"; font-weight: 800; font-style: normal; font-display: swap; src: url("../fonts/plus-jakarta-sans-latin-800-normal.woff2") format("woff2"); }

body.monlms-player-page { margin: 0; padding: 0; background: #F7F7F9; }

.monlms-player {
	--mp-accent: #2D5BFF;
	--mp-accent-soft: color-mix(in srgb, var(--mp-accent) 9%, transparent);
	--mp-ink: #141B2D;
	--mp-text: #2A3142;
	--mp-muted: #5B6478;
	--mp-line: #ECEDF1;
	--mp-top: var(--wp-admin--admin-bar--height, 0px);
	min-height: 100vh;
	background: #F7F7F9;
	color: var(--mp-ink);
	font-family: "MonLMS Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
	font-size: 15px;
	line-height: 1.55;
	word-spacing: 0.04em;
	-webkit-font-smoothing: antialiased;
}
.monlms-player *, .monlms-player *::before, .monlms-player *::after { box-sizing: border-box; }
.monlms-player a { color: inherit; }
.monlms-player .mp-i { flex: none; display: block; }
.mp-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Bandeau du haut */
.mp-top { position: sticky; top: var(--mp-top); z-index: 30; display: flex; align-items: center; gap: 16px; padding: 10px 20px; background: #fff; border-bottom: 1px solid var(--mp-line); }
.monlms-player a.mp-back { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px 0 6px; border-radius: 12px; text-decoration: none; font-weight: 700; color: #3C4458; }
.monlms-player a.mp-back:hover { background: #F1F2F6; color: var(--mp-ink); }
.mp-sep { width: 1px; height: 28px; background: var(--mp-line); flex: none; }
.mp-course { flex: 1; min-width: 0; }
.mp-course-title { font-weight: 800; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mp-progress { display: flex; align-items: center; gap: 10px; margin-top: 4px; max-width: 420px; }
.mp-bar { flex: 1; height: 6px; border-radius: 999px; background: #EEF0F4; overflow: hidden; }
.mp-bar span { display: block; height: 100%; border-radius: 999px; background: var(--mp-accent); transition: width .6s cubic-bezier(.2, .8, .2, 1); }
.mp-pct { font-size: 12.5px; font-weight: 700; color: #3C4458; white-space: nowrap; }
.mp-avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--mp-accent-soft); color: var(--mp-ink); display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; }
.mp-menu { display: none; width: 44px; height: 44px; border-radius: 12px; border: 0; background: #F1F2F6; color: var(--mp-ink); place-items: center; cursor: pointer; flex: none; padding: 0; }

.mp-banner { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; padding: 10px 20px; background: #FFF6E5; color: #7A4B00; font-size: 13.5px; font-weight: 600; text-align: center; border-bottom: 1px solid #FBE3C2; }
.mp-banner.is-preview { background: var(--mp-accent-soft); color: var(--mp-ink); border-bottom-color: var(--mp-line); }
.monlms-player .mp-banner a { color: var(--mp-accent); font-weight: 800; }

/* Mise en page */
.mp-layout { display: flex; align-items: flex-start; }
.mp-nav { position: sticky; top: calc(var(--mp-top) + 65px); flex: 0 0 360px; max-width: 360px; height: calc(100vh - var(--mp-top) - 65px); overflow-y: auto; background: #fff; border-right: 1px solid var(--mp-line); padding: 20px 14px 28px; overscroll-behavior: contain; }
.mp-nav-head { display: none; }
.mp-main { flex: 1; min-width: 0; padding: 28px clamp(16px, 4vw, 56px) 120px; }
.mp-inner { max-width: 880px; margin: 0 auto; animation: mpFade .35s ease both; }

/* Progression */
.mp-ring-card { display: flex; align-items: center; gap: 16px; padding: 14px; border-radius: 18px; background: var(--mp-accent-soft); margin-bottom: 18px; }
.mp-ring { position: relative; width: 64px; height: 64px; flex: none; color: var(--mp-accent); }
.mp-ring svg { display: block; }
.mp-ring svg circle:last-child { transition: stroke-dasharray .6s cubic-bezier(.2, .8, .2, 1); }
.mp-ring span { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 800; font-size: 14px; color: var(--mp-ink); }
.mp-ring-title { font-weight: 800; }
.mp-ring-sub { color: #3C4458; font-size: 13.5px; }

/* Programme */
.mp-lesson { margin-bottom: 14px; }
.mp-lesson-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 6px 10px; font-size: 11.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--mp-muted); }
.mp-score { font-size: 12px; letter-spacing: 0; white-space: nowrap; }
.mp-unlock { display: flex; align-items: center; gap: 8px; margin: 0 10px 6px; padding: 8px 10px; border-radius: 10px; background: #FFF4E5; color: #8A4100; font-size: 12.5px; font-weight: 700; }
.monlms-player .mp-ch { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; padding: 8px 10px; border-radius: 12px; text-decoration: none; color: var(--mp-ink); transition: background .15s; }
.monlms-player a.mp-ch:hover { background: #F4F5F8; }
.monlms-player .mp-ch.is-current { background: var(--mp-accent-soft); }
.mp-dot { width: 26px; height: 26px; border-radius: 50%; flex: none; display: grid; place-items: center; background: #fff; border: 2px solid #D5DAE3; color: #8A93A6; }
.mp-ch.is-current .mp-dot { border-color: var(--mp-accent); color: var(--mp-accent); }
.mp-ch.is-done .mp-dot { background: var(--mp-accent); border-color: var(--mp-accent); color: #fff; }
.mp-ch-text { flex: 1; min-width: 0; }
.mp-ch-title { display: block; font-weight: 600; font-size: 14px; line-height: 1.3; }
.mp-ch.is-current .mp-ch-title { font-weight: 800; }
.mp-ch.is-locked .mp-ch-title, .mp-ch.is-denied .mp-ch-title { color: var(--mp-muted); }
.mp-ch-meta { display: block; font-size: 12.5px; color: var(--mp-muted); margin-top: 1px; }

/* Chapitre */
.mp-eyebrow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--mp-muted); }
.mp-done-pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; background: #DCFCE7; color: #166534; letter-spacing: 0; text-transform: none; font-size: 12px; }
.monlms-player h1.mp-title { margin: 6px 0 18px; font-family: inherit; font-size: clamp(26px, 3vw, 34px); font-weight: 800; letter-spacing: -0.03em; line-height: 1.15; color: var(--mp-ink); }
.mp-content { font-size: 17px; color: var(--mp-text); }
.mp-content > :first-child { margin-top: 0; }
.mp-content img, .mp-content video, .mp-content iframe { max-width: 100%; height: auto; }
.mp-content iframe[src*="youtube"], .mp-content iframe[src*="vimeo"], .mp-content iframe[src*="mediadelivery"], .mp-content iframe[src*="bunny"] { width: 100%; aspect-ratio: 16 / 9; height: auto; border: 0; border-radius: 20px; }
.mp-content a { color: var(--mp-accent); }
.mp-content strong, .mp-content b { font-weight: 700; }
.mp-content code { padding: 1px 6px; border-radius: 6px; background: #F1F2F6; font-size: .9em; }
.mp-content blockquote, .mp-content .wp-block-quote { margin: 1.6em 0; padding: 16px 20px; border: 0; border-left: 4px solid var(--mp-accent); border-radius: 0 14px 14px 0; background: color-mix(in srgb, var(--mp-accent) 7%, #fff); font-style: normal; font-size: 16px; }
.mp-content blockquote > :last-child { margin-bottom: 0; }
.mp-content blockquote > :first-child { margin-top: 0; }
.mp-content figure { margin: 1.6em 0; }
.mp-content figure img { border-radius: 14px; border: 1px solid var(--mp-line); }
.mp-content figcaption { margin-top: 8px; font-size: 14px; color: var(--mp-muted, #5B6478); text-align: center; }

/* Chapitre pas encore débloqué */
.mp-locked { margin-top: 40px; padding: 48px 32px; border-radius: 28px; background: #fff; border: 1px solid var(--mp-line); text-align: center; }
.mp-locked-icon { width: 84px; height: 84px; border-radius: 26px; background: #FFF4E5; color: #8A4100; display: grid; place-items: center; margin: 0 auto 20px; }
.mp-locked .mp-eyebrow { justify-content: center; }
.monlms-player .mp-locked h1 { margin: 8px 0 10px; font-family: inherit; font-size: 28px; font-weight: 800; letter-spacing: -0.02em; color: var(--mp-ink); }
.mp-locked p { margin: 0 auto; max-width: 460px; color: #3C4458; }
.mp-locked .mp-btn { margin-top: 24px; }

/* Quiz */
.mp-quiz { margin-top: 32px; }
.mp-quiz-card { position: relative; display: flex; align-items: center; gap: 16px; padding: 18px 20px; border-radius: 22px; background: var(--mp-accent-soft); border: 1px solid color-mix(in srgb, var(--mp-accent) 18%, transparent); transition: background .3s ease, border-color .3s ease; }
.mp-quiz-badge { position: relative; width: 52px; height: 52px; border-radius: 16px; background: #fff; color: var(--mp-accent); display: grid; place-items: center; flex: none; box-shadow: 0 6px 16px rgba(14, 20, 36, .06); }
.mp-quiz-badge .mp-q-ico-ok, .mp-quiz-badge .mp-q-ico-ko { display: none; }
.mp-quiz-text { flex: 1; min-width: 0; }
.mp-quiz-title { display: block; font-size: 17px; font-weight: 800; letter-spacing: -0.01em; color: var(--mp-ink); }
.mp-quiz-sub { display: block; margin-top: 2px; font-size: 14px; color: var(--mp-muted); }
.mp-quiz-score { flex: none; font-size: 26px; font-weight: 800; letter-spacing: -0.03em; color: var(--mp-ink); font-variant-numeric: tabular-nums; }
.mp-quiz[data-state="passed"] .mp-quiz-card { background: #ECFDF3; border-color: #BBF0CF; }
.mp-quiz[data-state="passed"] .mp-quiz-badge { background: #16A34A; color: #fff; animation: mpPop .5s cubic-bezier(.2, 1.4, .4, 1) both; }
.mp-quiz[data-state="passed"] .mp-q-ico-ok { display: inline; }
.mp-quiz[data-state="passed"] .mp-q-ico-todo { display: none; }
.mp-quiz[data-state="passed"] .mp-quiz-score { color: #15803D; }
.mp-quiz[data-state="failed"] .mp-quiz-card, .mp-quiz[data-state="unreadable"] .mp-quiz-card { background: #FFF7ED; border-color: #FBD9B0; }
.mp-quiz[data-state="failed"] .mp-quiz-badge, .mp-quiz[data-state="unreadable"] .mp-quiz-badge { color: #B45309; }
.mp-quiz[data-state="failed"] .mp-q-ico-ko, .mp-quiz[data-state="unreadable"] .mp-q-ico-ko { display: inline; }
.mp-quiz[data-state="failed"] .mp-q-ico-todo, .mp-quiz[data-state="unreadable"] .mp-q-ico-todo { display: none; }
.mp-quiz.is-checking .mp-quiz-card { opacity: .75; }
.mp-quiz-form { margin-top: 22px; padding: 26px; border-radius: 22px; background: #fff; border: 1px solid var(--mp-line); }
.mp-quiz-form > :first-child { margin-top: 0; }
.mp-quiz-retry { margin-top: 16px; }
.mp-quiz-retry[hidden] { display: none !important; }
.mp-confetti { position: absolute; inset: 50% auto auto 50%; width: 0; height: 0; pointer-events: none; }
.mp-confetti i { position: absolute; left: -4px; top: -4px; width: 8px; height: 8px; border-radius: 2px; background: var(--mp-accent); animation: mpBurst 1.1s cubic-bezier(.15, .8, .3, 1) both; }
.mp-confetti i.is-green { background: #22C55E; border-radius: 50%; }
.mp-confetti i.is-amber { background: #F59E0B; width: 6px; height: 10px; }
@keyframes mpBurst { 0% { transform: translate(0, 0) rotate(0); opacity: 1; } 75% { opacity: 1; } 100% { transform: translate(var(--x), calc(var(--y) + 40px)) rotate(var(--r)); opacity: 0; } }
.monlms-player .mp-btn.is-gate { min-height: 54px; padding: 0 22px; background: #F1F2F6; color: var(--mp-muted); font-weight: 700; }
.monlms-player .mp-btn.is-gate:hover { color: var(--mp-ink); }

/* Boutons */
.mp-actions { margin-top: 36px; padding-top: 22px; border-top: 1px solid #E6E8EE; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.mp-complete { margin: 0; }
.monlms-player .mp-btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 50px; padding: 0 20px; border-radius: 14px; border: 0; font: inherit; font-weight: 800; font-size: 15px; text-decoration: none !important; cursor: pointer; transition: transform .12s ease, box-shadow .2s ease, background .15s ease; }
.monlms-player .mp-btn:active { transform: translateY(1px); }
.monlms-player .mp-btn:focus-visible, .monlms-player a:focus-visible, .mp-menu:focus-visible, .mp-close:focus-visible { outline: 3px solid color-mix(in srgb, var(--mp-accent) 45%, transparent); outline-offset: 2px; }
.monlms-player .mp-btn.is-primary { min-height: 54px; padding: 0 26px; background: var(--mp-accent); color: #fff; font-size: 16px; box-shadow: 0 12px 26px color-mix(in srgb, var(--mp-accent) 30%, transparent); }
.monlms-player .mp-btn.is-primary:hover { box-shadow: 0 14px 30px color-mix(in srgb, var(--mp-accent) 40%, transparent); color: #fff; }
.monlms-player .mp-btn.is-dark { min-height: 54px; padding: 0 24px; background: var(--mp-ink); color: #fff; font-size: 16px; }
.monlms-player .mp-btn.is-ghost { border: 1.5px solid #D5DAE3; background: #fff; color: var(--mp-ink); font-weight: 700; }
.monlms-player .mp-btn.is-ghost:hover { border-color: #B9C0CE; }
.mp-btn.is-disabled { opacity: .45; cursor: default; }
.mp-pill { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 999px; background: #16A34A; font-size: 12px; }
.mp-undo { margin: 14px 0 0; text-align: right; }
.mp-undo button { border: 0; background: none; padding: 6px 0; font: inherit; font-size: 13px; color: var(--mp-muted); text-decoration: underline; cursor: pointer; }

/* Confirmation */
.mp-toast { position: fixed; left: 50%; bottom: 28px; z-index: 50; display: flex; align-items: center; gap: 12px; padding: 12px 18px 12px 12px; border-radius: 18px; background: var(--mp-ink); color: #fff; box-shadow: 0 18px 40px rgba(14, 20, 36, .35); animation: mpToast 3.2s ease both; max-width: calc(100vw - 32px); }
.mp-toast-icon { width: 36px; height: 36px; border-radius: 12px; background: #16A34A; display: grid; place-items: center; flex: none; animation: mpPop .5s cubic-bezier(.2, 1.4, .4, 1) both; }
.mp-toast strong { display: block; font-weight: 800; }
.mp-toast strong + span { display: block; font-size: 13px; color: #C9CEDA; }

/* Fondu sans déplacement : une transformation piégerait la barre de boutons fixée en bas sur mobile. */
@keyframes mpFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes mpToast { 0% { opacity: 0; transform: translate(-50%, 16px) scale(.96); } 10% { opacity: 1; transform: translate(-50%, 0) scale(1); } 85% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, 6px); visibility: hidden; } }
@keyframes mpPop { 0% { transform: scale(.4); opacity: 0; } 60% { transform: scale(1.12); opacity: 1; } 100% { transform: scale(1); } }

/* Tablette et mobile : le programme devient un tiroir, les boutons restent en bas */
@media (max-width: 960px) {
	.mp-menu { display: grid; }
	.mp-nav { position: fixed; z-index: 60; top: var(--mp-top); left: 0; bottom: 0; height: auto; flex: none; width: min(380px, 88vw); max-width: none; transform: translateX(-102%); visibility: hidden; transition: transform .25s ease, visibility 0s linear .25s; box-shadow: 0 0 60px rgba(14, 20, 36, .25); }
	.mp-nav.is-open { transform: none; visibility: visible; transition: transform .25s ease, visibility 0s; }
	.mp-nav-head { display: flex; align-items: center; justify-content: space-between; position: sticky; top: -20px; z-index: 2; margin: -20px -14px 14px; padding: 14px 14px 10px 24px; background: #fff; border-bottom: 1px solid var(--mp-line); font-size: 16px; }
	.mp-close { width: 44px; height: 44px; border-radius: 12px; border: 0; background: #F1F2F6; color: var(--mp-ink); display: grid; place-items: center; cursor: pointer; padding: 0; }
	.mp-scrim { position: fixed; inset: 0; z-index: 55; background: rgba(14, 20, 36, .4); }
	.mp-scrim[hidden] { display: none; }
	.mp-main { padding-bottom: 130px; }
	.mp-actions { position: fixed; z-index: 40; left: 0; right: 0; bottom: 0; margin: 0; padding: 12px 16px calc(14px + env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid var(--mp-line); flex-wrap: nowrap; }
	.mp-actions .mp-prev { width: 54px; min-height: 54px; padding: 0; flex: none; border-radius: 16px; }
	.mp-actions .mp-prev span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
	.mp-actions .mp-complete, .mp-actions > .mp-btn:not(.mp-prev) { flex: 1; }
	.mp-actions > .mp-btn:not(.mp-prev) { min-width: 0; }
	.monlms-player .mp-actions .mp-btn.is-gate { padding: 0 16px; font-size: 14.5px; }
	.mp-actions .mp-btn.is-gate span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
	.mp-quiz-form { padding: 18px; }
	.mp-actions .mp-complete .mp-btn { width: 100%; }
	.mp-undo { text-align: center; }
	.mp-toast { bottom: 96px; }
}
@media (max-width: 600px) {
	.mp-top { gap: 10px; padding: 10px 12px; }
	.monlms-player a.mp-back { width: 44px; padding: 0; justify-content: center; background: #F1F2F6; }
	.monlms-player a.mp-back span, .mp-sep, .mp-avatar { display: none; }
	.mp-course-title { font-size: 14px; }
	.mp-main { padding: 20px 18px 130px; }
	.mp-content { font-size: 16px; }
	.mp-locked { padding: 36px 20px; }
	.mp-quiz-card { align-items: flex-start; gap: 12px; padding: 16px; }
	.mp-quiz-badge { width: 40px; height: 40px; border-radius: 13px; }
	.mp-quiz-badge svg { width: 21px; height: 21px; }
	.mp-quiz-title { font-size: 16px; }
	.mp-quiz-score { font-size: 20px; padding-top: 1px; }
}
@media (prefers-reduced-motion: reduce) {
	.monlms-player *, .monlms-player *::before, .monlms-player *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
