/* Charte : rouge du logo UCI, bleu encre de la plume, papier légèrement bleuté.
   Le rouge est réservé aux points d'attention (action principale, onglet actif, progression). */
@font-face{font-family:"Bricolage";src:url(/static/fonts/bricolage-grotesque-latin-wght-normal.woff2) format("woff2");font-weight:200 800;font-display:swap}
@font-face{font-family:"Figtree";src:url(/static/fonts/figtree-latin-wght-normal.woff2) format("woff2");font-weight:300 900;font-display:swap}
:root{
  --ink:#15183f;--navy:#2a2d7c;--navy-d:#1f2260;--navy-50:#eef0fa;--navy-100:#dfe3f5;
  --red:#d90b0b;--red-d:#b20808;--red-50:#fdecec;
  --paper:#f6f7fb;--card:#fff;--line:#e1e4f0;--mute:#5a6085;
  --ok:#11805b;--ok-50:#e3f5ee;--warn:#8a5a00;--warn-50:#fff3d6;
  --head:"Bricolage",system-ui,sans-serif;--body:"Figtree",system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;
  --r-lg:18px;--r-md:12px;--r-sm:9px;
}
*{box-sizing:border-box}html{-webkit-text-size-adjust:100%}
body{margin:0;font:400 1.0625rem/1.6 var(--body);background:var(--paper);color:var(--ink);padding-bottom:84px}
h1,h2,h3{font-family:var(--head);color:var(--ink);line-height:1.2;letter-spacing:-.01em}
h1{font-size:clamp(1.65rem,4.2vw,2.25rem);font-weight:700;margin:.3em 0 .5em}
h2{font-size:1.3rem;font-weight:700;margin:1.7em 0 .6em}h3{font-size:1.1rem;font-weight:650;margin:1.1em 0 .4em}
a{color:var(--navy);text-underline-offset:3px}a:hover{color:var(--red)}
:focus-visible{outline:3px solid #7f87e8;outline-offset:2px;border-radius:6px}
.muted{color:var(--mute)}.small{font-size:.9rem}.right{text-align:right}.center{text-align:center}.nowrap{white-space:nowrap}

/* En-tête */
.top{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:10px 16px;background:#fff;border-bottom:1px solid var(--line);position:sticky;top:0;z-index:20}
.top::after{content:"";position:absolute;left:0;right:0;bottom:-1px;height:3px;background:linear-gradient(90deg,var(--red) 0 22%,var(--navy) 22% 100%)}
.brand{display:flex;align-items:center;gap:12px;text-decoration:none;color:var(--ink);min-width:0}
.brand img{height:42px;width:auto;display:block}
.brand-text{display:flex;flex-direction:column;line-height:1.15;min-width:0}
.brand-text strong{font:700 1.02rem var(--head);color:var(--ink);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.brand-text small{color:var(--mute);font-size:.82rem}
.me{position:relative}.me summary{list-style:none;display:flex;align-items:center;gap:8px;cursor:pointer;padding:4px;border-radius:99px}
.me summary::-webkit-details-marker{display:none}.me summary:hover{background:var(--navy-50)}
.avatar{width:36px;height:36px;border-radius:50%;background:var(--navy);color:#fff;display:grid;place-items:center;font:700 .9rem var(--head)}
.me-name{font-weight:600;font-size:.95rem;max-width:130px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.menu{position:absolute;right:0;top:calc(100% + 8px);background:#fff;border:1px solid var(--line);border-radius:var(--r-md);box-shadow:0 8px 24px rgba(21,24,63,.14);min-width:230px;padding:6px}
.menu a,.menu button{display:block;width:100%;text-align:left;padding:10px 12px;border:0;background:none;font:inherit;color:var(--ink);text-decoration:none;border-radius:8px;cursor:pointer}
.menu a:hover,.menu button:hover{background:var(--navy-50);color:var(--navy)}.menu form{margin:0}.menu .who{padding:8px 12px;color:var(--mute);font-size:.88rem;border-bottom:1px solid var(--line);margin-bottom:4px}

/* Navigation : barre d'onglets en bas sur téléphone, en haut sur ordinateur */
.tabs{position:fixed;left:0;right:0;bottom:0;z-index:30;display:flex;background:#fff;border-top:1px solid var(--line);padding:6px 4px calc(6px + env(safe-area-inset-bottom))}
.tabs a{flex:1;display:flex;flex-direction:column;align-items:center;gap:2px;padding:6px 2px;color:var(--mute);text-decoration:none;font-size:.7rem;font-weight:600;border-radius:10px;min-width:0}
.tabs svg{width:23px;height:23px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.tabs a.on{color:var(--red)}.tabs a.on svg{stroke-width:2.2}
.subnav{display:flex;gap:6px;overflow-x:auto;padding:10px 14px;background:var(--navy-50);border-bottom:1px solid var(--navy-100);-webkit-overflow-scrolling:touch}
.subnav a{white-space:nowrap;padding:7px 13px;border-radius:99px;text-decoration:none;color:var(--navy);font-size:.92rem;font-weight:600}
.subnav a.on{background:var(--navy);color:#fff}
.wrap{max-width:1000px;margin:0 auto;padding:18px 16px}
.foot{text-align:center;color:var(--mute);font-size:.86rem;padding:8px 16px 28px}

/* Cartes, listes, badges */
.card{background:var(--card);border:1px solid var(--line);border-radius:var(--r-md);padding:18px;margin:0 0 14px}
.card>h3:first-child{margin-top:0}
.grid{display:grid;gap:14px;grid-template-columns:repeat(auto-fit,minmax(240px,1fr))}
.list{list-style:none;padding:0;margin:0}.list li{display:flex;gap:12px;align-items:center;justify-content:space-between;padding:12px 0;border-bottom:1px solid var(--line)}
.list li:last-child{border:0}.list a{text-decoration:none;color:var(--ink);font-weight:600}.list a:hover{color:var(--navy);text-decoration:underline}
.list .meta{display:flex;gap:8px;align-items:center;flex-wrap:wrap;justify-content:flex-end}
.badge{display:inline-block;padding:2px 10px;border-radius:99px;font-size:.8rem;font-weight:600;background:var(--navy-50);color:var(--navy);white-space:nowrap}
.b-ok{background:var(--ok-50);color:var(--ok)}.b-wait{background:var(--warn-50);color:var(--warn)}.b-bad{background:var(--red-50);color:var(--red-d)}.b-todo{background:#eceef5;color:var(--mute)}
.bar{height:8px;background:var(--navy-100);border-radius:99px;overflow:hidden;margin:10px 0 4px}.bar span{display:block;height:100%;background:var(--navy);border-radius:99px}
.bar.done span{background:var(--ok)}

/* Boutons */
.btn,button.btn{display:inline-flex;align-items:center;gap:8px;justify-content:center;background:var(--navy);color:#fff;border:0;border-radius:10px;padding:11px 18px;font:600 1rem var(--body);cursor:pointer;text-decoration:none;min-height:44px}
.btn:hover{background:var(--navy-d);color:#fff}.btn.sec{background:var(--navy-50);color:var(--navy)}.btn.sec:hover{background:var(--navy-100);color:var(--navy)}
.btn.accent{background:var(--red)}.btn.accent:hover{background:var(--red-d)}
.btn.danger{background:#fff;color:var(--red-d);border:1.5px solid #f0b4b4}.btn.danger:hover{background:var(--red-50);color:var(--red-d)}
.btn.small{padding:6px 12px;font-size:.9rem;min-height:36px}
.link{background:none;border:0;color:var(--navy);text-decoration:underline;cursor:pointer;font:inherit;padding:0}

/* Formulaires */
label{display:block;font-weight:600;margin:14px 0 5px}
input[type=text],input[type=email],input[type=password],input[type=url],input[type=number],input[type=date],input[type=datetime-local],select,textarea{width:100%;padding:11px 12px;border:1.5px solid #c7cce2;border-radius:var(--r-sm);font:inherit;background:#fff;color:var(--ink);min-height:46px}
input:focus,select:focus,textarea:focus{border-color:var(--navy);outline:3px solid #cfd3f5;outline-offset:0}
textarea{min-height:150px;font-family:ui-monospace,Menlo,Consolas,monospace;font-size:.93rem;line-height:1.5}input[type=file]{width:100%;padding:8px 0}
.row{display:flex;gap:12px;flex-wrap:wrap;align-items:end}.row>*{flex:1 1 160px}
.flash{padding:13px 16px;border-radius:var(--r-md);margin-bottom:16px;white-space:pre-line;font-weight:500;border-left:5px solid}
.flash.ok{background:var(--ok-50);color:#0b6446;border-color:var(--ok)}.flash.err{background:var(--red-50);color:var(--red-d);border-color:var(--red)}.flash.info{background:var(--navy-50);color:var(--navy);border-color:var(--navy)}

/* Tableaux */
.tw{overflow-x:auto;border:1px solid var(--line);border-radius:var(--r-md);background:#fff;margin-bottom:14px}
table{width:100%;border-collapse:collapse}th,td{padding:11px 12px;border-bottom:1px solid var(--line);text-align:left;vertical-align:top;font-size:.95rem}
th{background:var(--navy-50);font-weight:700;color:var(--navy);font-size:.92rem}tr:last-child td{border-bottom:0}

/* Contenu pédagogique */
.prose{line-height:1.75}.prose>*{max-width:68ch}.prose table{max-width:none}.prose img{max-width:100%;height:auto;border-radius:8px}
.prose h2{font-size:1.3rem}.prose h3{font-size:1.1rem}
.prose pre{background:var(--ink);color:#e5e8ff;padding:14px;border-radius:var(--r-sm);overflow:auto}.prose code{background:var(--navy-50);padding:1px 6px;border-radius:5px;font-size:.92em}.prose pre code{background:none;padding:0}
.prose kbd{background:#fff;border:1px solid #bcc2e0;border-bottom-width:3px;border-radius:6px;padding:1px 7px;font:700 .86em var(--body);color:var(--ink);white-space:nowrap}
.prose blockquote{margin:16px 0;padding:10px 16px;border-left:5px solid var(--red);background:var(--navy-50);border-radius:0 var(--r-sm) var(--r-sm) 0}.prose blockquote p{margin:.3em 0}
.prose table{display:block;overflow-x:auto}
.prose-card{padding:22px}

/* Quiz */
.q{border:1px solid var(--line);border-radius:var(--r-md);padding:16px;margin:14px 0;background:#fff}
.q strong{font-family:var(--head);font-weight:650;font-size:1.05rem}
.q.good{border-color:#8fd3ae;background:#f4fbf7}.q.bad{border-color:#f0b4b4;background:#fff7f7}
.opt{display:flex;gap:12px;align-items:flex-start;padding:11px 12px;border:1.5px solid var(--line);border-radius:10px;font-weight:500;margin:8px 0 0;cursor:pointer;background:#fff}
.opt:hover{border-color:#aab0e3}.opt input{margin-top:5px;width:18px;height:18px;accent-color:var(--navy)}
.opt:has(input:checked){border-color:var(--navy);background:var(--navy-50)}
.opt.right{background:var(--ok-50);border-color:#8fd3ae}.opt.wrong{background:var(--red-50);border-color:#f0b4b4}

/* Accueil */
.hero{background:var(--ink);color:#fff;border-radius:var(--r-lg);padding:24px 22px;display:grid;gap:18px;grid-template-columns:1fr auto;align-items:center;margin-bottom:18px}
.hero h1{color:#fff;margin:0 0 .3em}.hero p{margin:0 0 16px;color:#d4d8f5;max-width:46ch}
.hero .btn.accent{background:#e5262b}.hero .btn.accent:hover{background:#c91a1f}
.hero .resume-label{display:block;font-size:.88rem;color:#aab0e3;margin-bottom:8px}
.ring{position:relative;width:128px;height:128px;flex:none}
.ring svg{width:100%;height:100%;transform:rotate(-90deg)}
.ring circle{fill:none;stroke-width:11}.ring .bg{stroke:rgba(255,255,255,.16)}
.ring .fg{stroke:#ff5156;stroke-linecap:round;animation:draw .9s ease-out}
@keyframes draw{from{stroke-dasharray:0 314.2}}
.ring b{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;font:700 1.9rem var(--head);text-align:center;line-height:1}
.ring b small{display:block;font:500 .74rem var(--body);color:#aab0e3;margin-top:3px}
.tile{display:flex;flex-direction:column;gap:2px}.tile .big{font:700 1.9rem var(--head);line-height:1.1;color:var(--navy)}.tile .muted{font-size:.95rem}
.step{width:26px;height:26px;border-radius:50%;border:2px solid #b6bce3;flex:none;display:inline-grid;place-items:center;font-size:.8rem;color:#fff}
.step.on{background:var(--ok);border-color:var(--ok)}
.chap a{display:flex;align-items:center;gap:12px}
.mod-card{border-left:5px solid var(--navy)}.mod-card.complete{border-left-color:var(--ok)}
.mod-card h3 a{text-decoration:none;color:var(--ink)}.mod-card h3 a:hover{color:var(--navy)}
.empty{text-align:center;padding:26px 16px;color:var(--mute)}
.big{font:700 2rem var(--head);color:var(--navy);display:block;line-height:1.15}.stat{text-align:center}
.code-big{font:700 2.4rem var(--head);letter-spacing:.2em;color:var(--navy)}
#h5p-container{background:#fff;border:1px solid var(--line);border-radius:var(--r-md);padding:8px;min-height:200px}

/* Connexion */
body.auth{padding:0;background:var(--paper)}
.auth-wrap{min-height:100vh;display:grid;grid-template-columns:1fr}
.auth-side{display:none}
.auth-main{display:grid;place-items:center;padding:28px 18px}
.auth-card{width:100%;max-width:420px;background:#fff;border:1px solid var(--line);border-radius:var(--r-lg);padding:28px 24px;box-shadow:0 10px 30px rgba(21,24,63,.07)}
.auth-card .logo{display:block;width:190px;max-width:70%;margin:0 auto 14px}
.auth-card h1{text-align:center;margin:.1em 0 .2em}.auth-card .lead{text-align:center;color:var(--mute);margin:0 0 8px}
.auth-card .btn{width:100%;margin-top:6px}
@media(min-width:900px){
  .auth-wrap{grid-template-columns:1.05fr 1fr}
  .auth-side{display:flex;flex-direction:column;justify-content:flex-end;padding:56px;background:var(--ink);color:#fff;position:relative;overflow:hidden}
  .auth-side::before{content:"";position:absolute;left:0;top:0;bottom:0;width:10px;background:var(--red)}
  .auth-side h2{color:#fff;font-size:2.1rem;margin:0 0 .5em;max-width:16ch}.auth-side p{color:#d4d8f5;max-width:40ch;font-size:1.1rem;margin:0}
}

/* Ordinateur */
@media(min-width:900px){
  body{padding-bottom:0}
  .tabs{position:static;border-top:0;border-bottom:1px solid var(--line);padding:0 16px;justify-content:center;gap:4px}
  .tabs a{flex:none;flex-direction:row;gap:8px;font-size:.96rem;padding:13px 16px;border-radius:0;border-bottom:3px solid transparent}
  .tabs a.on{border-bottom-color:var(--red);color:var(--ink)}.tabs svg{width:20px;height:20px}
  .hero{padding:32px 36px}.ring{width:150px;height:150px}.ring b{font-size:2.2rem}
}
@media(max-width:600px){
  .hero{grid-template-columns:1fr;text-align:left}.ring{order:-1}
  .list li{align-items:flex-start;flex-direction:column;gap:6px}.list .meta{justify-content:flex-start}
  .me-name{display:none}.brand-text small{display:none}.brand-text strong{font-size:.95rem;white-space:normal}
}
@media print{.top,.tabs,.subnav,.foot,.btn{display:none!important}body{background:#fff;padding:0}}
@media(prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important}}
.visually-hidden{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.hero .btn{text-align:left;line-height:1.3;padding:12px 18px}

.tiles{grid-template-columns:repeat(2,1fr)}
.tiles .tile .big{font-size:1.55rem}
.prose>:first-child{margin-top:0}.prose>:last-child{margin-bottom:0}
@media(min-width:900px){.tiles .tile .big{font-size:1.9rem}}
