/* ==========================================================================
   VIMOTIC — Gestion des sessions de formation
   Palette tirée du logo : bleu marine VIMOTIC (#00002B) et indigo (#3442C8)
   ========================================================================== */

@font-face {
  font-family: "Manrope";
  src: url("../fonts/manrope-latin-wght-normal.woff2") format("woff2-variations");
  font-weight: 200 800;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Manrope";
  src: url("../fonts/manrope-latin-ext-wght-normal.woff2") format("woff2-variations");
  font-weight: 200 800;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face { font-family: "Playfair Display"; src: url("../fonts/playfair-display-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Playfair Display"; src: url("../fonts/playfair-display-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Playfair Display"; src: url("../fonts/playfair-display-latin-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }

:root {
  --ink: #00002B;
  --ink-deep: #00001A;
  --ink-soft: #26266A;
  --globe: #3442C8;
  --globe-deep: #262F9E;
  --globe-soft: #E9EBFB;
  --paper: #F3F4F9;
  --surface: #ffffff;
  --line: #DDDFEC;
  --line-strong: #C6C9DE;
  --text: #11122F;
  --muted: #5D6085;
  --faint: #8F92AF;
  --amber: #c98411;
  --amber-soft: #fbf1dc;
  --green: #1f8a5b;
  --green-soft: #e1f3e9;
  --red: #c0453b;
  --red-soft: #fae6e3;
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;
  --shadow: 0 1px 2px rgba(0, 0, 43, .06), 0 4px 14px rgba(0, 0, 43, .05);
  --sidebar: 252px;
  --font: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: "Playfair Display", Georgia, serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background: var(--paper);
  font-feature-settings: "tnum" 0;
}
img { max-width: 100%; display: block; }
a { color: var(--globe-deep); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; color: var(--ink); letter-spacing: -0.01em; }
h1 { font-size: 1.65rem; font-weight: 800; }
h2 { font-size: 1.2rem; font-weight: 750; }
h3 { font-size: 1rem; font-weight: 700; }
p { margin: 0 0 .8em; }
small, .small { font-size: .84rem; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.num { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.mono { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; letter-spacing: .04em; }
:focus-visible { outline: 3px solid rgba(52, 66, 200, .45); outline-offset: 2px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
svg.i.sm { width: 15px; height: 15px; }
svg.i.lg { width: 22px; height: 22px; }

/* ---------- Structure du back-office ---------- */
.app { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; background: linear-gradient(to right, var(--ink) var(--sidebar), var(--paper) var(--sidebar)); }
.sidebar {
  background: var(--ink);
  color: #D5D7EE;
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  padding: 18px 14px 16px;
}
.brand { display: block; padding: 6px 8px 4px; margin-bottom: 22px; }
.brand img { height: 50px; width: auto; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 11px;
  color: #D5D7EE; padding: 9px 11px; border-radius: 8px; font-weight: 600; font-size: .93rem;
}
.nav a:hover { background: rgba(255,255,255,.07); color: #fff; text-decoration: none; }
.nav a.active { background: var(--globe); color: #fff; }
.nav-title { font-size: .76rem; font-weight: 700; color: #8D91C4; margin: 22px 11px 6px; }
.side-session { margin-top: 6px; background: rgba(255,255,255,.06); border-radius: var(--radius); padding: 12px; }
.side-session .code { font-size: .75rem; color: #9DA2D6; font-weight: 700; }
.side-session .title { color: #fff; font-weight: 700; font-size: .92rem; line-height: 1.3; margin: 2px 0 10px; }
.side-session .nav a { padding: 7px 9px; font-size: .88rem; }
.sidebar-foot { margin-top: auto; padding: 16px 11px 0; font-size: .76rem; color: #868ABA; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 28px; background: var(--surface); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.switcher { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.switcher label { font-size: .82rem; color: var(--muted); font-weight: 600; white-space: nowrap; }
.switcher select { max-width: 520px; font-weight: 650; }
.usermenu { position: relative; }
.usermenu summary { list-style: none; display: flex; align-items: center; gap: 10px; cursor: pointer; padding: 4px 6px; border-radius: 8px; }
.usermenu summary::-webkit-details-marker { display: none; }
.usermenu summary:hover { background: var(--paper); }
.usermenu .who { line-height: 1.2; text-align: right; }
.usermenu .who strong { display: block; font-size: .9rem; }
.usermenu .who span { font-size: .76rem; color: var(--muted); }
.dropdown {
  position: absolute; right: 0; top: calc(100% + 6px); min-width: 210px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 6px; z-index: 30;
}
.dropdown a, .dropdown button {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 6px;
  color: var(--text); background: none; border: 0; font: inherit; font-size: .9rem; cursor: pointer; text-align: left;
}
.dropdown a:hover, .dropdown button:hover { background: var(--paper); text-decoration: none; }
.topbar .menu-toggle { display: none; }

.content { padding: 26px 28px 60px; max-width: 1360px; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head .sub { color: var(--muted); margin-top: 4px; font-size: .93rem; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.back { display: inline-flex; align-items: center; gap: 6px; font-size: .86rem; font-weight: 600; color: var(--muted); margin-bottom: 8px; }

/* Onglets de session */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: -4px 0 22px; overflow-x: auto; scrollbar-width: none; }
.tabs a {
  padding: 10px 14px; font-weight: 650; font-size: .9rem; color: var(--muted); white-space: nowrap;
  border-bottom: 2.5px solid transparent; margin-bottom: -1px;
}
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a.active { color: var(--ink); border-bottom-color: var(--globe); }

/* ---------- Composants ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px 0; flex-wrap: wrap; }
.panel-head p { margin: 2px 0 0; color: var(--muted); font-size: .86rem; }
.panel-body { padding: 16px 20px 20px; }
.panel + .panel { margin-top: 18px; }
.grid { display: grid; gap: 18px; align-items: start; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); }
.stack > * + * { margin-top: 18px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.spacer { flex: 1; }
hr.sep { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 15px; border-radius: 8px; border: 1px solid transparent;
  font: inherit; font-size: .9rem; font-weight: 700; cursor: pointer; white-space: nowrap;
  background: var(--ink); color: #fff; transition: background .15s, border-color .15s;
}
.btn:hover { background: var(--ink-deep); text-decoration: none; }
.btn.accent { background: var(--globe); }
.btn.accent:hover { background: var(--globe-deep); }
.btn.ghost { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn.ghost:hover { background: var(--paper); border-color: var(--ink-soft); }
.btn.danger { background: var(--surface); color: var(--red); border-color: #e9c4bf; }
.btn.danger:hover { background: var(--red-soft); }
.btn.success { background: var(--green); }
.btn.sm { height: 31px; padding: 0 11px; font-size: .83rem; border-radius: 7px; }
.btn.lg { height: 48px; padding: 0 22px; font-size: 1rem; border-radius: 10px; }
.btn.block { width: 100%; }
.btn[disabled], .btn.disabled { opacity: .5; pointer-events: none; }
.icon-btn { width: 31px; padding: 0; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--globe-deep); cursor: pointer; font-weight: 600; }
.link-btn:hover { text-decoration: underline; }
form.inline { display: inline; }

.pill {
  display: inline-flex; align-items: center; gap: 5px; height: 23px; padding: 0 9px; border-radius: 99px;
  font-size: .76rem; font-weight: 700; background: var(--paper); color: var(--muted); white-space: nowrap;
}
.pill.blue { background: var(--globe-soft); color: var(--globe-deep); }
.pill.green { background: var(--green-soft); color: var(--green); }
.pill.amber { background: var(--amber-soft); color: #9a6408; }
.pill.red { background: var(--red-soft); color: var(--red); }
.pill.ink { background: var(--ink); color: #fff; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

.avatar {
  width: 38px; height: 38px; border-radius: 50%; flex: none; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--globe-soft); color: var(--ink); font-weight: 800; font-size: .82rem;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.lg { width: 96px; height: 96px; font-size: 1.6rem; border-radius: 18px; }
.avatar.xl { width: 132px; height: 132px; font-size: 2rem; border-radius: 22px; }
.person { display: flex; align-items: center; gap: 11px; min-width: 0; }
.person .name { font-weight: 700; color: var(--text); line-height: 1.25; }
.person .meta { font-size: .8rem; color: var(--muted); }

/* Tableaux */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th {
  text-align: left; font-size: .78rem; font-weight: 700; color: var(--muted);
  padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; background: #F8F8FC;
}
.table td { padding: 11px 12px; border-bottom: 1px solid #EEEFF6; vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: #FAFAFD; }
.table .right { text-align: right; }
.table .center { text-align: center; }
.panel > .table-wrap .table th:first-child, .panel > .table-wrap .table td:first-child { padding-left: 20px; }
.panel > .table-wrap .table th:last-child, .panel > .table-wrap .table td:last-child { padding-right: 20px; }
.panel > .table-wrap:first-child .table th:first-child { border-top-left-radius: var(--radius-lg); }
.panel > .table-wrap:first-child .table th:last-child { border-top-right-radius: var(--radius-lg); }

/* Formulaires */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .label { font-size: .84rem; font-weight: 700; color: var(--ink); }
.field .hint { font-size: .8rem; color: var(--muted); }
.field .error, .error-text { font-size: .82rem; color: var(--red); font-weight: 600; }
.input, select.input, textarea.input {
  width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 8px;
  font: inherit; font-size: .93rem; color: var(--text); background: #fff;
}
textarea.input { height: auto; min-height: 90px; padding: 10px 12px; resize: vertical; }
.input:focus { outline: none; border-color: var(--globe); box-shadow: 0 0 0 3px rgba(52,66,200,.16); }
.input.is-invalid { border-color: var(--red); }
select.input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%235D6085' stroke-width='1.8' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.check { display: flex; align-items: flex-start; gap: 10px; font-size: .92rem; cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--globe); flex: none; }
.check strong { display: block; font-size: .9rem; }
.check span { color: var(--muted); font-size: .84rem; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; padding-top: 6px; flex-wrap: wrap; }
fieldset.group { border: 0; padding: 0; margin: 0; }
.section-title { font-size: .95rem; font-weight: 750; color: var(--ink); margin: 0 0 12px; }

/* Messages */
.flash { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius); margin-bottom: 18px; font-weight: 600; font-size: .92rem; }
.flash.success { background: var(--green-soft); color: #145c3c; }
.flash.error { background: var(--red-soft); color: #8b2a22; }
.flash.info { background: var(--globe-soft); color: var(--ink); }
.flash ul { margin: 4px 0 0; padding-left: 18px; font-weight: 500; }

.empty { text-align: center; padding: 42px 20px; color: var(--muted); }
.empty h3 { margin-bottom: 6px; }
.empty .btn { margin-top: 14px; }

/* ---------- Tableau de bord ---------- */
.hero-session {
  background: var(--ink); color: #DEE0F4; border-radius: var(--radius-lg);
  padding: 24px 26px 22px; margin-bottom: 20px; position: relative; overflow: hidden;
}
.hero-session h1 { color: #fff; font-size: 1.55rem; max-width: 46ch; }
.hero-session .meta { display: flex; gap: 18px; flex-wrap: wrap; font-size: .88rem; margin-top: 8px; color: #B3B6DD; }
.hero-session .meta span { display: inline-flex; align-items: center; gap: 6px; }
.hero-session .top { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: flex-start; }
.hero-session .code { font-weight: 800; font-size: .8rem; color: #A3AAF2; margin-bottom: 6px; }
.hero-session .btn.ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.3); }
.hero-session .btn.ghost:hover { background: rgba(255,255,255,.08); }

/* Ruban des journées : chaque jour se remplit selon son taux de présence (comme l'ampoule du logo) */
.ribbon { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(84px, 1fr); gap: 8px; margin-top: 22px; overflow-x: auto; padding-bottom: 2px; }
.day {
  position: relative; height: 92px; border-radius: 12px; overflow: hidden;
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.1);
  display: flex; flex-direction: column; justify-content: space-between; padding: 8px 10px;
}
.day .fill { position: absolute; left: 0; right: 0; bottom: 0; background: linear-gradient(180deg, #5662E0, var(--globe)); z-index: 0; transition: height .9s cubic-bezier(.2,.8,.2,1); }
.day > * { position: relative; z-index: 1; }
.day .d { font-size: .72rem; font-weight: 700; color: #B3B6DD; text-transform: capitalize; }
.day .n { font-size: 1.15rem; font-weight: 800; color: #fff; font-variant-numeric: tabular-nums; }
.day.future { border-style: dashed; background: transparent; }
.day.future .n { color: #767BB0; font-size: .85rem; font-weight: 700; }
.day.today { border-color: #fff; box-shadow: 0 0 0 1px #fff inset; }
.day .tag { position: absolute; top: 8px; right: 8px; font-size: .62rem; font-weight: 800; color: var(--ink); background: #fff; border-radius: 99px; padding: 1px 6px; z-index: 2; }
@media (prefers-reduced-motion: reduce) { .day .fill { transition: none; } }

.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 15px 17px 14px; }
.kpi .label { font-size: .8rem; color: var(--muted); font-weight: 650; display: flex; align-items: center; gap: 7px; }
.kpi .value { font-size: 1.75rem; font-weight: 800; color: var(--ink); line-height: 1.15; margin-top: 6px; font-variant-numeric: tabular-nums; }
.kpi .value small { font-size: .9rem; font-weight: 700; color: var(--muted); }
.kpi .foot { font-size: .8rem; color: var(--muted); margin-top: 3px; }
.kpi .bar { height: 5px; border-radius: 3px; background: #E8E9F3; margin-top: 10px; overflow: hidden; }
.kpi .bar span { display: block; height: 100%; background: var(--globe); border-radius: 3px; }
.trend-up { color: var(--green); font-weight: 750; }
.trend-down { color: var(--red); font-weight: 750; }

.chart-box { position: relative; height: 260px; }
.chart-box.sm { height: 200px; }
.chart-box.lg { height: 320px; }

.meter { display: flex; align-items: center; gap: 10px; }
.meter .track { flex: 1; height: 8px; background: #E8E9F3; border-radius: 4px; overflow: hidden; min-width: 60px; }
.meter .track span { display: block; height: 100%; background: var(--globe); border-radius: 4px; }
.meter .track span.warn { background: var(--amber); }
.meter .track span.bad { background: var(--red); }
.meter .track span.good { background: var(--green); }
.meter .v { font-size: .84rem; font-weight: 750; min-width: 42px; text-align: right; font-variant-numeric: tabular-nums; }

.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid #EEEFF6; }
.list li:last-child { border-bottom: 0; }

.quick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.quick a {
  display: flex; flex-direction: column; gap: 6px; padding: 14px; border-radius: var(--radius);
  border: 1px solid var(--line); color: var(--text); background: #FBFBFE;
}
.quick a:hover { border-color: var(--globe); text-decoration: none; background: #fff; }
.quick a strong { font-size: .9rem; }
.quick a span { font-size: .8rem; color: var(--muted); }
.quick svg.i { color: var(--globe); }

/* Matrice de présence */
.matrix th.day-col { text-align: center; min-width: 58px; font-size: .74rem; line-height: 1.2; }
.matrix th.day-col.today { color: var(--globe-deep); }
.matrix td.cell { text-align: center; padding: 6px; }
.cell-btn {
  width: 34px; height: 30px; border-radius: 7px; border: 1px dashed var(--line-strong); background: #fff;
  font: inherit; font-weight: 800; font-size: .78rem; color: var(--faint); cursor: pointer;
}
.cell-btn:hover { border-color: var(--globe); }
.cell-btn.present { background: var(--green-soft); color: var(--green); border: 1px solid #b6dfc8; }
.cell-btn.retard { background: var(--amber-soft); color: #9a6408; border: 1px solid #efd6a5; }
.cell-btn.absent { background: var(--red-soft); color: var(--red); border: 1px solid #efc7c2; }
.cell-btn.future { opacity: .35; cursor: not-allowed; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .82rem; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 14px; height: 14px; border-radius: 4px; display: inline-block; }

/* Constructeur de quiz */
.q-card { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; margin-bottom: 14px; }
.q-card .q-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: #F8F8FC; border-radius: var(--radius) var(--radius) 0 0; }
.q-card .q-num { font-weight: 800; color: var(--ink); }
.q-card .q-body { padding: 14px; display: grid; gap: 12px; }
.opt { display: flex; align-items: center; gap: 10px; }
.opt .mark { width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--line-strong); background: #fff; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: transparent; flex: none; }
.opt .mark.on { background: var(--green); border-color: var(--green); color: #fff; }
.opt .input { flex: 1; }

/* ---------- Pages publiques & espace participant ---------- */
.public { min-height: 100vh; display: flex; flex-direction: column; }
.public-top { background: #fff; border-bottom: 1px solid var(--line); }
.public-top .inner { max-width: 1080px; margin: 0 auto; padding: 12px 20px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.public-top img { height: 46px; width: auto; }
.public-main { flex: 1; width: 100%; max-width: 1080px; margin: 0 auto; padding: 28px 20px 48px; }
.public-main.narrow { max-width: 620px; }
.public-foot { border-top: 1px solid var(--line); background: #fff; font-size: .82rem; color: var(--muted); }
.public-foot .inner { max-width: 1080px; margin: 0 auto; padding: 16px 20px; display: flex; gap: 8px 24px; flex-wrap: wrap; justify-content: space-between; }
.public-foot .copyright { border-top: 1px solid var(--line); padding-top: 12px; padding-bottom: 14px; justify-content: center; color: var(--faint); font-size: .78rem; }
.sidebar-foot a, .copyright-dark a { color: #fff; font-weight: 700; }
.copyright-dark { display: inline-block; margin-top: 10px; color: #8D91C4; }

.home-hero { display: grid; grid-template-columns: 1.1fr 1fr; gap: 36px; align-items: center; padding: 26px 0 30px; }
.home-hero h1 { font-family: var(--serif); font-weight: 700; font-size: 2.6rem; line-height: 1.12; letter-spacing: -0.015em; }
.home-hero p.lead { font-size: 1.08rem; color: var(--muted); max-width: 46ch; margin-top: 14px; }
.code-card { background: var(--ink); color: #DEE0F4; border-radius: 20px; padding: 28px; }
.code-card h2 { color: #fff; font-size: 1.25rem; }
.code-card p { color: #B3B6DD; font-size: .92rem; margin-top: 6px; }
.code-input {
  width: 100%; height: 62px; border-radius: 12px; border: 2px solid transparent; background: #fff;
  font: inherit; font-size: 1.7rem; font-weight: 800; letter-spacing: .32em; text-align: center; text-transform: uppercase; color: var(--ink);
}
.code-input:focus { outline: none; border-color: var(--globe); }
.code-input::placeholder { color: #C2C5DA; letter-spacing: .32em; }
.paths { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 10px; }
.path { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 18px; color: var(--text); display: flex; flex-direction: column; gap: 6px; }
.path:hover { border-color: var(--globe); text-decoration: none; }
.path strong { color: var(--ink); }
.path span { color: var(--muted); font-size: .88rem; }
.path svg.i { color: var(--globe); margin-bottom: 4px; }

.portal-head { display: flex; gap: 18px; align-items: center; margin-bottom: 22px; }
.portal-head h1 { font-family: var(--serif); font-size: 1.85rem; font-weight: 700; }
.portal-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 18px 20px; }
.portal-card + .portal-card { margin-top: 14px; }
.portal-card h2 { font-size: 1.05rem; margin-bottom: 4px; }
.task { display: flex; align-items: center; gap: 14px; padding: 13px 0; border-top: 1px solid #EEEFF6; }
.task:first-of-type { border-top: 0; }
.task .ico { width: 40px; height: 40px; border-radius: 10px; background: var(--globe-soft); color: var(--globe-deep); display: flex; align-items: center; justify-content: center; flex: none; }
.task .ico.done { background: var(--green-soft); color: var(--green); }
.task .ico.locked { background: var(--paper); color: var(--faint); }
.task .txt { flex: 1; min-width: 0; }
.task .txt strong { display: block; color: var(--text); }
.task .txt span { font-size: .84rem; color: var(--muted); }
.days-strip { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.days-strip span { width: 44px; text-align: center; padding: 6px 0; border-radius: 8px; font-size: .74rem; font-weight: 750; background: var(--paper); color: var(--faint); line-height: 1.2; }
.days-strip span.p { background: var(--green-soft); color: var(--green); }
.days-strip span.r { background: var(--amber-soft); color: #9a6408; }
.days-strip span.a { background: var(--red-soft); color: var(--red); }

/* Passage d'un quiz */
.qz-question { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 18px 20px; margin-bottom: 14px; }
.qz-question .q { font-weight: 750; font-size: 1.02rem; color: var(--ink); margin-bottom: 4px; }
.qz-question .t { font-size: .8rem; color: var(--muted); margin-bottom: 12px; }
.choice { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 10px; cursor: pointer; margin-top: 8px; font-weight: 550; }
.choice:hover { border-color: var(--globe); }
.choice input { width: 20px; height: 20px; accent-color: var(--globe); flex: none; margin: 0; }
.choice:has(input:checked) { border-color: var(--globe); background: var(--globe-soft); }
.choice.correct { border-color: var(--green); background: var(--green-soft); }
.choice.wrong { border-color: var(--red); background: var(--red-soft); }
.timer { position: sticky; top: 10px; z-index: 5; display: flex; justify-content: center; margin-bottom: 14px; }
.timer span { background: var(--ink); color: #fff; padding: 6px 16px; border-radius: 99px; font-weight: 800; font-variant-numeric: tabular-nums; }
.timer span.low { background: var(--red); }

.rating { display: flex; gap: 6px; }
.rating label { flex: 1; }
.rating input { position: absolute; opacity: 0; pointer-events: none; }
.rating span {
  display: flex; align-items: center; justify-content: center; height: 42px; border-radius: 9px; border: 1.5px solid var(--line);
  font-weight: 800; color: var(--muted); cursor: pointer; background: #fff;
}
.rating input:checked + span { background: var(--ink); border-color: var(--ink); color: #fff; }
.rating input:focus-visible + span { outline: 3px solid rgba(52,66,200,.45); }
.crit { display: grid; grid-template-columns: 1fr 260px; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid #EEEFF6; }
.crit:first-of-type { border-top: 0; }
.scale-hint { display: flex; justify-content: space-between; font-size: .74rem; color: var(--faint); margin-top: 3px; }

/* Vérification publique */
.verify-card { background: #fff; border: 1px solid var(--line); border-radius: 20px; overflow: hidden; }
.verify-status { padding: 16px 22px; display: flex; align-items: center; gap: 12px; font-weight: 800; font-size: 1.05rem; }
.verify-status.ok { background: var(--green); color: #fff; }
.verify-status.no { background: var(--red); color: #fff; }
.verify-status.wait { background: var(--amber); color: #fff; }
.verify-body { padding: 22px; display: flex; gap: 20px; align-items: flex-start; }
.dl { display: grid; grid-template-columns: 150px 1fr; gap: 8px 14px; font-size: .92rem; margin: 0; }
.dl dt { color: var(--muted); font-weight: 600; }
.dl dd { margin: 0; font-weight: 650; }

/* ---------- Écrans projetés (pointage, quiz en direct) ---------- */
.screen { background: var(--ink); color: #DEE0F4; min-height: 100vh; display: flex; flex-direction: column; }
.screen-top { display: flex; align-items: center; justify-content: space-between; padding: 18px 32px; gap: 20px; }
.screen-top .logo img { height: 52px; width: auto; }
.screen-top .clock { font-size: 2rem; font-weight: 800; color: #fff; font-variant-numeric: tabular-nums; }
.screen-main { flex: 1; display: grid; grid-template-columns: auto 1fr; gap: 48px; align-items: center; padding: 10px 48px 36px; }
.qr-frame { background: #fff; border-radius: 28px; padding: 22px; width: min(46vh, 460px); aspect-ratio: 1; display: flex; align-items: center; justify-content: center; }
.qr-frame svg { width: 100%; height: 100%; }
.screen h1 { color: #fff; font-size: clamp(1.8rem, 3.4vw, 3rem); font-weight: 800; line-height: 1.1; }
.screen .big { font-size: clamp(3rem, 7vw, 6rem); font-weight: 800; color: #fff; line-height: 1; font-variant-numeric: tabular-nums; }
.screen .steps { margin: 22px 0 0; padding: 0; list-style: none; counter-reset: s; }
.screen .steps li { counter-increment: s; display: flex; gap: 14px; align-items: center; font-size: 1.15rem; margin-bottom: 12px; }
.screen .steps li::before { content: counter(s); width: 34px; height: 34px; border-radius: 50%; background: var(--globe); color: #fff; font-weight: 800; display: flex; align-items: center; justify-content: center; flex: none; }
.feed { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 26px; }
.feed .who { display: flex; align-items: center; gap: 10px; background: rgba(255,255,255,.08); border-radius: 99px; padding: 5px 14px 5px 5px; font-weight: 650; color: #fff; }
.feed .who .avatar { width: 34px; height: 34px; background: #fff; }
.feed .who time { color: #A3AAF2; font-size: .82rem; }
.feed .who.new { animation: pop .6s ease-out; }
@keyframes pop { from { transform: scale(.85); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .feed .who.new { animation: none; } }

/* Scanner */
.scanner-layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 18px; align-items: start; }
#reader { width: 100%; border-radius: var(--radius-lg); overflow: hidden; background: #06063A; min-height: 320px; }
#reader video { border-radius: var(--radius-lg); }
.scan-result { border-radius: var(--radius-lg); padding: 20px; text-align: center; border: 1px solid var(--line); background: #fff; min-height: 260px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; }
.scan-result.ok { background: var(--green-soft); border-color: #b6dfc8; }
.scan-result.deja { background: var(--globe-soft); border-color: #C5CAF5; }
.scan-result.late { background: var(--amber-soft); border-color: #efd6a5; }
.scan-result.refuse, .scan-result.inconnu { background: var(--red-soft); border-color: #efc7c2; }
.scan-result .msg { font-weight: 800; font-size: 1.05rem; }

/* Certificats */
.checks { display: flex; gap: 6px; flex-wrap: wrap; }
.check-chip { display: inline-flex; align-items: center; gap: 4px; font-size: .75rem; font-weight: 700; padding: 2px 8px; border-radius: 6px; background: var(--paper); color: var(--faint); }
.check-chip.ok { background: var(--green-soft); color: var(--green); }
.check-chip.ko { background: var(--red-soft); color: var(--red); }

/* Connexion */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-side { background: var(--ink); color: #B3B6DD; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; }
.auth-side h2 { font-family: var(--serif); font-size: 2.2rem; color: #fff; font-weight: 700; line-height: 1.15; max-width: 16ch; }
.auth-side .logo { align-self: flex-start; }
.auth-side .logo img { height: 64px; width: auto; }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 40px 24px; background: #fff; }
.auth-form form { width: 100%; max-width: 380px; }

/* Pagination */
.pagination { display: flex; gap: 4px; justify-content: center; padding: 16px; flex-wrap: wrap; }
.pagination a, .pagination span { min-width: 34px; height: 34px; padding: 0 10px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; font-weight: 700; font-size: .86rem; border: 1px solid var(--line); background: #fff; color: var(--text); }
.pagination span.current { background: var(--ink); color: #fff; border-color: var(--ink); }
.pagination span.disabled { opacity: .45; }

/* Recherche participant existant */
.suggest { border: 1px solid var(--line); border-radius: var(--radius); margin-top: 6px; background: #fff; max-height: 300px; overflow-y: auto; }
.suggest button { display: flex; width: 100%; gap: 10px; align-items: center; padding: 9px 12px; border: 0; background: none; text-align: left; font: inherit; cursor: pointer; border-bottom: 1px solid #EEEFF6; }
.suggest button:hover { background: var(--paper); }
.photo-pick { display: flex; gap: 16px; align-items: center; }

/* ---------- Responsive ---------- */
@media (max-width: 1200px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1020px) {
  .app { grid-template-columns: 1fr; background: var(--paper); }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 270px; z-index: 50; transform: translateX(-100%); transition: transform .2s; }
  body.menu-open .sidebar { transform: none; box-shadow: 0 0 0 100vmax rgba(0,0,0,.35); }
  .topbar .menu-toggle { display: inline-flex; }
  .g-main, .g-3, .scanner-layout { grid-template-columns: 1fr; }
  .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-hero { grid-template-columns: 1fr; }
  .screen-main { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .auth { grid-template-columns: 1fr; }
  .auth-side { display: none; }
}
@media (max-width: 700px) {
  body { font-size: 14.5px; }
  .content { padding: 18px 16px 48px; }
  .topbar { padding: 10px 16px; }
  .switcher label, .usermenu .who { display: none; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .g-2, .g-4, .form-grid, .form-grid.three, .paths, .quick { grid-template-columns: 1fr; }
  .hero-session { padding: 20px 18px; }
  .hero-session h1 { font-size: 1.3rem; }
  .day .tag { display: none; }
  #reader { min-height: 240px; }
  .scan-result { min-height: 180px; }
  .home-hero h1 { font-size: 2rem; }
  .crit { grid-template-columns: 1fr; }
  .verify-body { flex-direction: column; align-items: center; text-align: center; }
  .dl { grid-template-columns: 1fr; text-align: left; }
  .public-main { padding: 20px 16px 40px; }
}
@media print {
  .sidebar, .topbar, .tabs, .page-head .actions, .no-print { display: none !important; }
  .app { display: block; }
  body { background: #fff; }
}
