/* ==========================================================================
   ENSP/TA — Design system v4
   Fichier 4/4 : écrans (connexion, pages publiques, fiches, tableau de bord, espace étudiant,
   emploi du temps, Wi-Fi, erreurs) et palette catégorielle des graphiques.
   ========================================================================== */

/* Palette catégorielle (8 teintes, ordre fixe — validée daltonisme, voir skill dataviz) */
:root { --cat-1: #2A78D6; --cat-2: #EB6834; --cat-3: #1BAF7A; --cat-4: #EDA100; --cat-5: #E87BA4; --cat-6: #008300; --cat-7: #6250D6; --cat-8: #E34948; }
:root[data-theme="dark"] { --cat-1: #3987E5; --cat-2: #D95926; --cat-3: #199E70; --cat-4: #C98500; --cat-5: #D55181; --cat-6: #008300; --cat-7: #9085E9; --cat-8: #E66767; }

/* ==========================================================================
   Connexion : scène nocturne (réseau de santé qui émet) + carte « badge » à encoches.
   Palette propre à cette page (indépendante du thème choisi dans l'application).
   ========================================================================== */
body.auth-page {
  --night: #081226; --navy: #0B1730; --blue: #2B5BA8; --green: #8CC63F; --green-d: #6AA62A;
  --paper: #FFFDF7; --a-ink: #0B1730; --a-ink-2: #4A5568; --rule: #E7E3D6;
  --cut: 98px; --stub: 84px; --hole: 13px;
  margin: 0; min-height: 100vh; min-height: 100dvh; color: var(--a-ink); overflow-x: hidden;
  background:
    radial-gradient(70% 60% at 22% 18%, rgba(43, 91, 168, .55), transparent 70%),
    radial-gradient(50% 50% at 88% 92%, rgba(140, 198, 63, .22), transparent 70%),
    linear-gradient(165deg, #0d1d40 0%, var(--night) 60%, #050b18 100%) fixed;
}
body.auth-page::after { /* grain léger */
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: .08; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Réseau et pouls en fond */
.net { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.net-links path { fill: none; stroke: rgba(140, 170, 230, .16); stroke-width: 1.2; }
.net-flow path { fill: none; stroke: var(--green); stroke-width: 2; stroke-linecap: round; stroke-dasharray: 2 26; opacity: .55; animation: netFlow 3.2s linear infinite; }
.net-flow path:nth-child(2) { animation-duration: 4.4s; animation-direction: reverse; }
.net-flow path:nth-child(3) { animation-duration: 5.6s; stroke: #7FB2FF; }
@keyframes netFlow { to { stroke-dashoffset: -280; } }
.net-nodes .core { fill: var(--green); filter: drop-shadow(0 0 6px rgba(140, 198, 63, .9)); }
.net-nodes .ring { fill: none; stroke: var(--green); stroke-width: 1.5; transform-box: fill-box; transform-origin: center; opacity: 0; animation: netPing 3.6s ease-out infinite; animation-delay: var(--d); }
@keyframes netPing { 0% { transform: scale(.25); opacity: .9; } 80%, 100% { transform: scale(2.6); opacity: 0; } }
.net-pulse { fill: none; stroke: var(--green); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; opacity: .22; stroke-dasharray: 900; animation: netBeat 6s ease-in-out infinite; }
@keyframes netBeat { 0% { stroke-dashoffset: 900; } 60%, 100% { stroke-dashoffset: 0; } }

/* Mise en page */
.auth { position: relative; z-index: 1; min-height: 100vh; min-height: 100dvh; display: grid; align-items: center; grid-template-columns: minmax(0, 1fr) minmax(0, auto); gap: clamp(32px, 6vw, 110px); max-width: 1240px; margin: 0 auto; padding: 40px clamp(20px, 5vw, 64px); }

/* Accroche */
.auth-hero { color: #fff; max-width: 580px; animation: authUp .7s cubic-bezier(.2, .8, .2, 1) both; }
.auth-eyebrow { display: inline-flex; align-items: center; gap: 10px; margin: 0 0 18px; font: 600 .76rem var(--font-mono); letter-spacing: .18em; text-transform: uppercase; color: var(--green); }
.auth-live { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--green); animation: authPulse 2s infinite; }
@keyframes authPulse { 0% { box-shadow: 0 0 0 0 rgba(140, 198, 63, .6); } 70% { box-shadow: 0 0 0 10px rgba(140, 198, 63, 0); } 100% { box-shadow: 0 0 0 0 rgba(140, 198, 63, 0); } }
.auth-hero h2 { margin: 0; font: 800 clamp(2.3rem, 4.4vw, 3.9rem)/1.02 var(--font-display); letter-spacing: -.035em; color: #fff; }
.auth-hero h2 em { font-style: normal; color: var(--green); }
.auth-hero .nw { white-space: nowrap; }
.auth-chips { list-style: none; display: flex; flex-wrap: wrap; gap: 12px; margin: 36px 0 0; padding: 0; }
.auth-chips li { display: grid; justify-items: center; gap: 10px; width: 108px; padding: 16px 8px 13px; border-radius: 20px; background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .1); backdrop-filter: blur(8px); font: 700 .86rem var(--font-display); color: #DBE5F7; text-align: center; line-height: 1.15; animation: authUp .6s cubic-bezier(.2, .8, .2, 1) both; }
.auth-chips li:nth-child(2) { animation-delay: .08s; } .auth-chips li:nth-child(3) { animation-delay: .16s; } .auth-chips li:nth-child(4) { animation-delay: .24s; }
.auth-chips .ci { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; color: var(--night); background: var(--green); box-shadow: 0 10px 24px -10px rgba(140, 198, 63, .8); }
.auth-chips .ci .i { width: 28px; height: 28px; stroke-width: 1.8; }
.auth-chips li:nth-child(2) .ci { background: #7FB2FF; box-shadow: 0 10px 24px -10px rgba(127, 178, 255, .8); }
.auth-chips li:nth-child(3) .ci { background: #FFC94D; box-shadow: 0 10px 24px -10px rgba(255, 201, 77, .8); }
.auth-chips li:nth-child(4) .ci { background: #C3A6F5; box-shadow: 0 10px 24px -10px rgba(195, 166, 245, .8); }
@keyframes authUp { from { opacity: 0; transform: translateY(18px); } }

/* La carte */
.auth-main { display: grid; justify-items: center; gap: 16px; }
.tkt { width: 430px; max-width: 100%; filter: drop-shadow(0 30px 40px rgba(0, 0, 0, .45)) drop-shadow(0 2px 4px rgba(0, 0, 0, .25)); animation: tktIn .8s cubic-bezier(.2, .8, .2, 1) both .1s; }
@keyframes tktIn { from { opacity: 0; transform: translateY(-26px) rotate(-1.5deg); } }
.auth-card {
  position: relative; background: var(--paper); border-radius: 22px; overflow: hidden;
  -webkit-mask:
    radial-gradient(circle var(--hole) at 0 var(--cut), #0000 98%, #000), radial-gradient(circle var(--hole) at 100% var(--cut), #0000 98%, #000),
    radial-gradient(circle var(--hole) at 0 calc(100% - var(--stub)), #0000 98%, #000), radial-gradient(circle var(--hole) at 100% calc(100% - var(--stub)), #0000 98%, #000);
  -webkit-mask-composite: source-in;
  mask:
    radial-gradient(circle var(--hole) at 0 var(--cut), #0000 98%, #000), radial-gradient(circle var(--hole) at 100% var(--cut), #0000 98%, #000),
    radial-gradient(circle var(--hole) at 0 calc(100% - var(--stub)), #0000 98%, #000), radial-gradient(circle var(--hole) at 100% calc(100% - var(--stub)), #0000 98%, #000);
  mask-composite: intersect;
}
.tkt-top { position: relative; height: var(--cut); box-sizing: border-box; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; align-content: center; column-gap: 14px; padding: 0 30px; color: #fff; text-decoration: none; background: radial-gradient(120% 140% at 0% 0%, #1F4B94 0%, var(--navy) 60%); }
.tkt-top:hover { text-decoration: none; color: #fff; }
.tkt-top::before { content: ""; position: absolute; inset: 0; opacity: .35; background: repeating-linear-gradient(-45deg, rgba(255, 255, 255, .04) 0 10px, transparent 10px 20px); }
.tkt-top::after { content: ""; position: absolute; left: var(--hole); right: var(--hole); bottom: -1px; border-bottom: 2px dashed rgba(11, 23, 48, .25); }
.tkt-top .logo { grid-row: 1 / 3; position: relative; width: 54px; height: 54px; padding: 4px; border-radius: 16px; background: #fff; object-fit: contain; box-shadow: 0 6px 16px rgba(0, 0, 0, .35); }
.tkt-brand { position: relative; align-self: end; font: 800 1.4rem/1.1 var(--font-display); letter-spacing: .04em; }
.tkt-brand b { color: var(--green); }
.tkt-tag { position: relative; align-self: start; margin-top: 4px; display: inline-flex; align-items: center; gap: 6px; font: 600 .68rem var(--font-mono); letter-spacing: .14em; text-transform: uppercase; color: #9FB4DC; }
.tkt-tag .i { width: 14px; height: 14px; color: var(--green); }
.tkt-body { display: grid; gap: 18px; padding: 28px 30px 28px; }
.auth-head h1 { margin: 0; font: 800 1.8rem/1.1 var(--font-display); letter-spacing: -.025em; color: var(--a-ink); }
.auth-head p { margin: 6px 0 0; color: var(--a-ink-2); font-size: .93rem; }
.auth-form { display: grid; gap: 16px; }
.auth-card .field label { margin-bottom: 7px; color: #3B4658; font-size: .82rem; font-weight: 700; }
.auth-card .field input { height: 54px; border-radius: 16px; border: 2px solid var(--rule); background: #fff; color: var(--a-ink); font: 600 16px var(--font-ui); padding-left: 50px; box-shadow: none; }
.auth-card .field input::placeholder { color: #B3B9C4; font-weight: 500; }
.auth-card .field input:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(43, 91, 168, .15); outline: none; }
.auth-card .input-icon > .i { left: 17px; width: 21px; height: 21px; color: #9AA3B2; }
.auth-card .input-icon:focus-within > .i { color: var(--blue); }
.auth-card .pw-toggle { color: #9AA3B2; }
.auth-card .pw-toggle:hover { background: #F1EFE6; color: var(--blue); }
.auth-card .field .err { color: #B42318; }
.auth-card .check { color: #3B4658; font-size: .88rem; }
.auth-submit { height: 56px; border: 0; border-radius: 16px; margin-top: 2px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; font: 800 1.08rem var(--font-display); letter-spacing: .01em; color: var(--night); cursor: pointer; background: linear-gradient(135deg, #9FD34F, var(--green-d)); box-shadow: 0 14px 28px -14px rgba(106, 166, 42, .95), inset 0 -3px 0 rgba(0, 0, 0, .12); transition: transform .15s, filter .15s; }
.auth-submit:hover { transform: translateY(-2px); filter: brightness(1.05); }
.auth-submit:active { transform: translateY(1px); }
.auth-submit .i { width: 22px; height: 22px; transition: transform .2s; }
.auth-submit:hover .i { transform: translateX(4px); }
.auth-card .alert { margin: 0; }
.auth-stub { position: relative; height: var(--stub); box-sizing: border-box; margin: 4px -30px -28px; padding: 0 30px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px; background: #F3F8E9; color: #2F5410; text-decoration: none; transition: background .2s; }
.auth-stub:hover { background: #E9F4D6; text-decoration: none; color: #2F5410; }
.auth-stub::before { content: ""; position: absolute; top: 0; left: var(--hole); right: var(--hole); border-top: 2px dashed #CFD8BD; }
.auth-stub .si { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: var(--green); color: var(--night); }
.auth-stub .si .i { width: 24px; height: 24px; }
.auth-stub span.t { display: grid; line-height: 1.2; }
.auth-stub b { font: 800 1.05rem var(--font-display); color: var(--a-ink); }
.auth-stub small { font-size: .84rem; color: #4D7A1F; font-weight: 600; }
.auth-stub .go { width: 22px; height: 22px; color: var(--green-d); transition: transform .2s; }
.auth-stub:hover .go { transform: translateX(4px); }
.auth-foot { margin: 0; max-width: 430px; text-align: center; font-size: .8rem; line-height: 1.55; color: #8EA0C4; }
.auth-foot a { color: #B8CBF0; font-weight: 600; }

@media (max-width: 960px) {
  .auth { grid-template-columns: minmax(0, 1fr); align-content: center; gap: 0; padding: calc(18px + env(safe-area-inset-top)) 14px calc(18px + env(safe-area-inset-bottom)); }
  .auth-hero { display: none; }
  .auth-main { justify-items: stretch; }
  .tkt { width: 100%; max-width: 480px; justify-self: center; }
  .auth-foot { max-width: 480px; justify-self: center; }
}
@media (max-width: 420px) {
  body.auth-page { --cut: 86px; --stub: 78px; }
  .tkt-top { padding: 0 22px; column-gap: 12px; }
  .tkt-top .logo { width: 46px; height: 46px; }
  .tkt-brand { font-size: 1.2rem; }
  .tkt-body { padding: 24px 20px 24px; gap: 16px; }
  .auth-stub { margin: 2px -20px -24px; padding: 0 20px; }
  .auth-head h1 { font-size: 1.6rem; }
}
@media (prefers-reduced-motion: reduce) {
  .net-flow path, .net-nodes .ring, .net-pulse, .auth-live, .tkt, .auth-hero, .auth-chips li { animation: none !important; }
}

/* ==========================================================================
   Pages publiques (candidature, suivi, vérification)
   ========================================================================== */
body.public-page { background: var(--bg); min-height: 100dvh; display: flex; flex-direction: column; }
.pub-top { position: sticky; top: 0; z-index: 30; border-bottom: 1px solid var(--line); background: var(--bg); }
@supports (backdrop-filter: blur(1px)) { .pub-top { background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: saturate(1.4) blur(12px); } }
.pub-top-inner { max-width: 1120px; margin: 0 auto; display: flex; align-items: center; gap: 14px; height: 68px; padding: 0 clamp(16px, 3vw, 32px); }
.pub-brand { display: flex; align-items: center; gap: 12px; min-width: 0; color: inherit; text-decoration: none; }
.pub-brand:hover { text-decoration: none; }
.pub-brand img { width: 42px; height: 42px; padding: 3px; border-radius: 13px; background: #fff; border: 1px solid var(--line); object-fit: contain; flex: none; }
.pub-brand b { display: block; font-family: var(--font-display); font-size: 1.125rem; font-weight: 600; color: var(--ink); line-height: 1.1; }
.pub-brand small { display: block; color: var(--muted); font-size: var(--fs-xs); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 38ch; }
.pub-nav { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.pub-nav a:not(.btn) { padding: 8px 12px; border-radius: 10px; color: var(--muted); font-size: var(--fs-sm); font-weight: 500; }
.pub-nav a:not(.btn):hover { background: var(--bg-sunk); color: var(--ink); text-decoration: none; }
.public { flex: 1; width: 100%; max-width: 1120px; margin: 0 auto; padding: 36px clamp(16px, 3vw, 32px) 64px; }
.public .narrow { max-width: 760px; margin-inline: auto; }
.pub-foot { border-top: 1px solid var(--line); padding: 26px clamp(16px, 3vw, 32px); text-align: center; color: var(--muted); font-size: var(--fs-xs); line-height: 1.7; }
.pub-foot b { color: var(--ink); }
.hero { display: flex; align-items: center; gap: 20px; margin-bottom: 28px; }
.hero img { width: 84px; height: 84px; padding: 6px; border-radius: 24px; background: #fff; border: 1px solid var(--line); box-shadow: var(--sh-1); object-fit: contain; }
.hero h1 { margin: 0 0 6px; }
.hero p { margin: 0; color: var(--muted); }
.banner { display: block; width: 100%; max-width: 760px; margin: 0 auto 16px; }
.login-box { max-width: 440px; margin: 32px auto; }
.pub-steps { display: flex; gap: 8px; margin-bottom: 24px; counter-reset: s; }
.pub-steps li { flex: 1; list-style: none; counter-increment: s; display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: var(--fs-sm); font-weight: 500; }
.pub-steps li::before { content: counter(s); flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--bg-sunk); color: var(--muted); font-size: var(--fs-xs); font-weight: 700; }
.pub-steps li.is-active { border-color: var(--primary-soft-2); background: var(--primary-soft); color: var(--primary); }
.pub-steps li.is-active::before { background: var(--primary); color: var(--on-primary); }
.pub-steps li.is-done::before { content: "✓"; background: var(--success); color: #fff; }
@media (max-width: 720px) { .pub-nav a:not(.btn) { display: none; } .pub-steps { flex-direction: column; } .hero { align-items: flex-start; } .hero img { width: 64px; height: 64px; border-radius: 18px; } }

/* ==========================================================================
   Tableau de bord et en-têtes de fiche
   ========================================================================== */
.greet { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 28px; margin-bottom: 26px; }
.greet .eyebrow { display: block; margin-bottom: 8px; }
.greet h1 { margin: 0; font-size: clamp(1.9rem, 1.3rem + 2vw, 2.75rem); }
.greet p { margin: 8px 0 0; color: var(--muted); max-width: 62ch; }
.greet .chips { display: flex; flex-wrap: wrap; gap: 8px; }
.today-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: var(--gap); }
.today-chip { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: inherit; text-decoration: none; box-shadow: var(--sh-1); transition: border-color var(--t), transform var(--t) var(--ease); }
a.today-chip:hover { border-color: var(--primary-soft-2); transform: translateY(-1px); text-decoration: none; }
.today-chip b { display: block; color: var(--ink); font-family: var(--font-display); font-size: 1.5rem; font-weight: 600; line-height: 1; letter-spacing: -.02em; }
.today-chip span { color: var(--muted); font-size: var(--fs-sm); line-height: 1.25; }
.profile-hero { position: relative; overflow: hidden; display: grid; gap: 22px; padding: 26px; }
.profile-hero::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 92px; background: linear-gradient(120deg, var(--primary-soft) 0%, var(--accent-soft) 100%); opacity: .9; }
.profile-hero > * { position: relative; }
.ph-main { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 20px; padding-top: 28px; }
.ph-main .avatar-xl { box-shadow: 0 0 0 4px var(--surface), var(--sh-2); }
.ph-title { flex: 1; min-width: 220px; }
.ph-title h1 { margin: 0 0 6px; font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.25rem); }
.ph-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; color: var(--muted); font-size: var(--fs-sm); }
.ph-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.ph-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.ph-stat { padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); }
.ph-stat small { display: block; color: var(--muted); font-size: var(--fs-xs); font-weight: 500; }
.ph-stat b { display: block; margin-top: 4px; color: var(--ink); font-size: var(--fs-md); font-weight: 600; line-height: 1.3; }
.ph-stat b.big { font-family: var(--font-display); font-size: 1.5rem; letter-spacing: -.02em; }
.vigil { display: flex; align-items: center; gap: 18px; }
.vigil-factors { flex: 1; min-width: 0; display: grid; gap: 10px; }
.vigil-factor { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; font-size: var(--fs-sm); }
.vigil-factor .progress { grid-column: 1 / -1; height: 6px; }
.vigil-factor span:last-child { color: var(--muted); font-variant-numeric: tabular-nums; }

/* Carte « héros » (espace étudiant, accueil) */
.hero-card { position: relative; overflow: hidden; padding: clamp(20px, 3vw, 30px); border-radius: 22px; color: #fff; background: radial-gradient(520px 260px at 100% 0%, var(--hero-glow), transparent 62%), linear-gradient(150deg, var(--hero-1) 0%, var(--hero-2) 100%); box-shadow: var(--sh-2); }
.hero-card::before { content: ""; position: absolute; inset: 0; pointer-events: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='56' viewBox='0 0 56 56' fill='none' stroke='%23fff' stroke-opacity='.07'%3E%3Cpath d='M28 3 53 28 28 53 3 28z'/%3E%3Cpath d='M28 16 40 28 28 40 16 28z'/%3E%3C/svg%3E"); -webkit-mask-image: linear-gradient(115deg, #000, transparent 70%); mask-image: linear-gradient(115deg, #000, transparent 70%); }
.hero-card > * { position: relative; }
.hero-card h1, .hero-card h2, .hero-card b, .hero-card strong { color: #fff; }
.hero-card .eyebrow { color: #F6C06A; }
.hero-card p, .hero-card small { color: rgba(255, 255, 255, .72); }
.hero-card .btn-outline { --b-bg: rgba(255, 255, 255, .08); --b-fg: #fff; --b-bd: rgba(255, 255, 255, .28); --b-hover: rgba(255, 255, 255, .16); box-shadow: none; }
.hero-card .btn-outline:hover { border-color: #fff; color: #fff; }

/* ==========================================================================
   Emploi du temps
   ========================================================================== */
.timetable { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.timetable .day { min-height: 150px; padding: 12px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: var(--sh-1); }
.timetable .day h4 { margin: 0 0 10px; padding-bottom: 8px; border-bottom: 1px solid var(--line-soft); color: var(--muted); font-family: var(--font-ui); font-size: var(--fs-xs); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.timetable .day.is-today { border-color: var(--primary-soft-2); box-shadow: var(--sh-1), 0 0 0 3px var(--primary-soft); }
.timetable .day.is-today h4 { color: var(--primary); }
.slot { margin-bottom: 8px; padding: 8px 10px; border-left: 3px solid var(--primary); border-radius: 4px 10px 10px 4px; background: var(--primary-soft); color: var(--text); font-size: var(--fs-xs); line-height: 1.4; }
.slot strong { display: block; color: var(--ink); font-size: var(--fs-sm); line-height: 1.3; }
.slot.conflict { border-left-color: var(--danger); background: var(--danger-soft); }
@media (max-width: 1100px) { .timetable { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 720px) { .timetable { grid-template-columns: 1fr; } }

/* ==========================================================================
   Wi-Fi étudiants (anciens noms wf-* conservés, couleurs issues des tokens)
   ========================================================================== */
.wf-root { display: block; }
.wf-tiles { display: grid; grid-template-columns: 1.35fr repeat(4, minmax(0, 1fr)); gap: var(--gap); margin-bottom: var(--gap); }
.wf-tile { min-width: 0; padding: 18px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--sh-1); }
.wf-tile .l { color: var(--muted); font-size: var(--fs-sm); font-weight: 500; }
.wf-tile .v { margin-top: 6px; color: var(--ink); font-family: var(--font-display); font-size: 1.875rem; font-weight: 600; line-height: 1.1; letter-spacing: -.02em; }
.wf-tile .s { margin-top: 6px; color: var(--muted); font-size: var(--fs-sm); }
.wf-tile.hero { display: block; margin: 0; background: radial-gradient(360px 180px at 100% 0%, var(--hero-glow), transparent 65%), linear-gradient(150deg, var(--hero-1), var(--hero-2)); border-color: transparent; color: #fff; align-items: initial; gap: 0; }
.wf-tile.hero .l, .wf-tile.hero .s { color: rgba(255, 255, 255, .72); }
.wf-tile.hero .v { color: #fff; font-size: 4rem; line-height: 1; }
.wf-live { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: var(--fs-xs); }
.wf-live::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--viz-good); box-shadow: 0 0 0 0 rgba(31, 122, 77, .5); animation: pulse 2.2s ease-out infinite; }
.wf-sub { margin: -10px 0 20px; color: var(--muted); font-size: var(--fs-sm); }
.wf-chart { position: relative; }
.wf-chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.wf-chart svg:focus-visible { outline: 2px solid var(--primary); outline-offset: 4px; border-radius: 6px; }
.wf-chart .grid line { stroke: var(--viz-grid); stroke-width: 1; shape-rendering: crispEdges; }
.wf-chart .base { stroke: var(--viz-axis); stroke-width: 1; shape-rendering: crispEdges; }
.wf-chart text { font-family: var(--font-ui); font-size: 11px; fill: var(--viz-label); font-variant-numeric: tabular-nums; }
.wf-chart text.lab { fill: var(--muted); font-size: 12px; font-variant-numeric: normal; }
.wf-chart text.val { fill: var(--ink); font-size: 12px; font-weight: 600; }
.wf-chart .line { fill: none; stroke: var(--viz-1); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.wf-chart .area { fill: var(--viz-1-soft); stroke: none; }
.wf-chart .bar { fill: var(--viz-1); pointer-events: none; transition: fill var(--t-fast); }
.wf-chart .dot { fill: var(--viz-1); stroke: var(--surface); stroke-width: 2; }
.wf-chart .hit { fill: transparent; outline: none; }
.wf-chart .hit:hover + .bar, .wf-chart .hit:focus + .bar { fill: var(--primary-hover); }
.wf-chart .hit:focus-visible { stroke: var(--primary); stroke-width: 1.5; }
.wf-chart .xhair { stroke: var(--muted); stroke-width: 1; shape-rendering: crispEdges; opacity: 0; pointer-events: none; }
.wf-chart.on .xhair { opacity: .55; }
.wf-tip { position: fixed; z-index: 160; pointer-events: none; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); box-shadow: var(--sh-2); color: var(--muted); font-size: var(--fs-sm); white-space: nowrap; opacity: 0; transition: opacity .1s; }
.wf-tip.show { opacity: 1; }
.wf-tip b { display: block; color: var(--ink); font-size: var(--fs-md); font-weight: 600; }
.wf-tip .k { display: inline-block; width: 12px; height: 2px; margin-right: 6px; vertical-align: middle; background: var(--viz-1); }
.wf-data { margin-top: 14px; font-size: var(--fs-sm); }
.wf-data summary { display: inline-flex; align-items: center; gap: 6px; color: var(--primary); font-weight: 600; }
.wf-data .table-wrap { max-height: 260px; overflow: auto; margin-top: 8px; border: 1px solid var(--line); border-radius: 12px; }
.wf-meter { display: flex; align-items: center; gap: 10px; min-width: 150px; }
.wf-meter .t { flex: 1; height: 8px; border-radius: var(--r-pill); background: var(--viz-track); overflow: hidden; }
.wf-meter .t span { display: block; height: 100%; border-radius: var(--r-pill); background: var(--viz-1); }
.wf-meter.warn .t span { background: var(--viz-warn); }
.wf-meter.crit .t span { background: var(--viz-crit); }
.wf-meter .n { color: var(--muted); font-size: var(--fs-xs); white-space: nowrap; font-variant-numeric: tabular-nums; }
.wf-routers { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.wf-router { display: block; padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface-2); color: inherit; text-decoration: none; transition: border-color var(--t), box-shadow var(--t), transform var(--t) var(--ease); }
.wf-router:hover { border-color: var(--primary-soft-2); box-shadow: var(--sh-2); transform: translateY(-2px); text-decoration: none; }
.wf-router .nm { color: var(--ink); font-weight: 600; }
.wf-router .ct { margin-top: 6px; color: var(--ink); font-family: var(--font-display); font-size: 2rem; font-weight: 600; line-height: 1.1; letter-spacing: -.02em; }
.wf-cmd { display: block; padding: 16px 18px; border-radius: 14px; background: #0B1431; color: #DCE6FF; font: 13px/1.65 var(--font-mono); white-space: pre-wrap; word-break: break-all; user-select: all; }
.wf-steps { counter-reset: s; list-style: none; padding: 0; margin: 18px 0 0; }
.wf-steps li { counter-increment: s; position: relative; padding: 2px 0 16px 42px; }
.wf-steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); font-size: var(--fs-sm); font-weight: 700; }
.wf-code { font: 600 1.75rem/1.2 var(--font-mono); letter-spacing: .2em; color: var(--ink); }
.wf-qr { display: flex; flex-wrap: wrap; gap: 18px; }
.wf-qr figure { max-width: 210px; margin: 0; text-align: center; color: var(--muted); font-size: var(--fs-sm); }
.wf-qr img { width: 190px; height: 190px; padding: 8px; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
@media (max-width: 1180px) { .wf-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } .wf-tile.hero { grid-column: 1 / -1; } }
@media (max-width: 720px) { .wf-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } .wf-tile.hero .v { font-size: 3.2rem; } }

/* ==========================================================================
   Pages d'erreur
   ========================================================================== */
.err-page { max-width: 560px; margin: 8vh auto 0; text-align: center; }
.err-code { font-family: var(--font-display); font-size: clamp(5rem, 14vw, 8rem); font-weight: 600; line-height: 1; letter-spacing: -.04em; background: linear-gradient(160deg, var(--primary), var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.err-page h1 { margin: 6px 0 10px; }
.err-page p { color: var(--muted); font-size: var(--fs-md); }

/* ==========================================================================
   Utilisateurs et activité (tableau de bord de l'administrateur)
   ========================================================================== */
.presence-list { list-style: none; margin: 0; padding: 6px 8px; display: flex; flex-direction: column; }
.presence-list li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; transition: background var(--t-fast); }
.presence-list li:hover { background: var(--surface-2); }
.presence-list b { display: block; color: var(--ink); font-weight: 600; font-size: var(--fs-base); line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.presence-list small { display: block; color: var(--muted); font-size: var(--fs-xs); line-height: 1.4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.presence-meta { flex: none; text-align: right; line-height: 1.35; color: var(--muted); font-size: var(--fs-sm); }
.presence-meta small { color: var(--subtle); }
.av-wrap { position: relative; flex: none; }
.presence { position: absolute; right: -2px; bottom: -2px; width: 12px; height: 12px; border-radius: 50%; background: var(--subtle); border: 2px solid var(--surface); }
.presence.on { background: var(--success); }
.evt { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; color: var(--text); white-space: nowrap; }
.evt .i { width: 16px; height: 16px; }
.evt-good .i { color: var(--success); } .evt-bad .i { color: var(--danger); } .evt-warn .i { color: var(--accent-ink); } .evt-neutral .i { color: var(--subtle); }

/* ==========================================================================
   v4 « FREECOM » : pages publiques (barre marine), titres et chiffres en Bricolage
   ========================================================================== */
body.public-page { background: radial-gradient(circle at 1px 1px, var(--bg-pattern) 1px, transparent 0) 0 0 / 22px 22px, var(--bg); }
.pub-top { background: var(--nav-bg); color: var(--nav-strong); border-bottom: 1px solid var(--nav-line); box-shadow: 0 2px 12px -6px rgba(0, 0, 0, .45); backdrop-filter: none; }
.pub-top::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; pointer-events: none; background: linear-gradient(90deg, #E8731A 0 33.33%, #FFFFFF 33.33% 66.66%, #1FA64A 66.66%); opacity: .92; }
.pub-top-inner { height: 62px; max-width: 1180px; }
.pub-logo { flex: none; display: grid; place-items: center; width: 40px; height: 40px; padding: 2px; border-radius: 11px; background: #fff; }
.pub-logo img { width: 100%; height: 100%; border: 0; padding: 0; border-radius: 0; background: none; object-fit: contain; }
.pub-brand b { color: var(--nav-strong); font-weight: 700; font-size: 1.05rem; }
.pub-brand small { color: var(--nav-muted); }
.pub-nav a:not(.btn) { color: var(--nav-text); font-weight: 600; }
.pub-nav a:not(.btn):hover { background: var(--nav-hover); color: var(--nav-strong); }
.public { max-width: 1180px; }
.pub-foot { background: var(--nav-bg); color: var(--nav-muted); border-top: 0; }
.pub-foot b { color: var(--nav-strong); }
.hero h1, .greet h1, .ph-title h1 { font-weight: 800; }
.greet .eyebrow { text-transform: none; letter-spacing: 0; font-size: var(--fs-sm); font-weight: 600; color: var(--muted); }
.greet h1 em { color: inherit; }
.today-chip b, .ph-stat b.big, .ring-label b { font-weight: 800; }
.hero-card .eyebrow { color: var(--lime); }
.hero-card h1 em, .hero-card h2 em { font-style: normal; color: var(--lime); }
.today-chip .stat-ico { color: #fff; font-size: inherit; line-height: 1; }
.today-chip .stat-ico.tone-amber { color: var(--on-yellow); }
@media (max-width: 640px) {
  .pub-brand small { display: none; }
  .pub-brand { flex: 1; }
  .pub-nav { flex: none; }
}

/* Connexion : univers santé (croix, gélules, pouls) sur fond vert-médical */
body.auth-page { --night: #04262B; --navy: #073B42; --blue: #0E7C86; --green-d: #5FA02A;
  background: radial-gradient(70% 60% at 20% 15%, rgba(14, 124, 134, .6), transparent 70%), radial-gradient(55% 55% at 90% 95%, rgba(140, 198, 63, .25), transparent 70%), linear-gradient(165deg, #0A4B52 0%, #052E34 60%, #031C20 100%) fixed; }
.tkt-top { background: radial-gradient(120% 140% at 0% 0%, #12929C 0%, var(--navy) 62%); }
.med-ring circle { fill: none; stroke: rgba(255, 255, 255, .08); stroke-width: 2; }
.med-float g { opacity: .9; animation: medFloat 7s ease-in-out infinite; }
.med-float g:nth-child(2) { animation-delay: -2s; } .med-float g:nth-child(3) { animation-delay: -4s; } .med-float g:nth-child(4) { animation-delay: -1s; } .med-float g:nth-child(5) { animation-delay: -3s; }
.med-float rect, .med-float circle, .med-float path { fill: rgba(255, 255, 255, .07); stroke: rgba(140, 198, 63, .55); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.med-float g:first-child path { stroke: #8CC63F; fill: none; }
@keyframes medFloat { 50% { transform: translateY(-10px); } }
@media (prefers-reduced-motion: reduce) { .med-float g { animation: none; } }
.auth-chips li:nth-child(1) .ci { background: #8CC63F; } .auth-chips li:nth-child(2) .ci { background: #FF9DB0; box-shadow: 0 10px 24px -10px rgba(255,157,176,.8); }
.auth-chips li:nth-child(3) .ci { background: #7FD6E8; box-shadow: 0 10px 24px -10px rgba(127,214,232,.8); }
.auth-chips li:nth-child(4) .ci { background: #FFD27F; box-shadow: 0 10px 24px -10px rgba(255,210,127,.8); }
