/* ClasseCT : styles communs (console et tablettes) */
:root {
  --bg: #eef1f5;
  --panel: #ffffff;
  --panel-2: #f7f9fb;
  --line: #e1e6ed;
  --line-2: #c9d1dc;
  --text: #0f172a;
  --text-2: #475569;
  --text-3: #8a96a8;
  /* Couleurs du centre (web/shared/brand.js les remplace) : principale (boutons, liens, sélection, focus)
     et secondaire (bandeaux, barres de progression, podium, badges) */
  --brand-1: #1d4ed8;
  --brand-1-ink: #ffffff;
  --brand-1-soft: #e0e9ff;
  --brand-1-line: #c4d4fa;
  --brand-1-hover: #1840b1;
  --brand-1-deep: #173892;
  --brand-1-deep-ink: #ffffff;
  --brand-1-light: #8ba4eb;
  --brand-1-rgb: 29, 78, 216;
  --brand-2: #2563eb;
  --brand-2-ink: #ffffff;
  --brand-2-rgb: 37, 99, 235;
  --accent: var(--brand-1);
  --accent-2: var(--brand-2);
  --accent-soft: var(--brand-1-soft);
  --ok: #15803d;
  --ok-2: #16a34a;
  --ok-soft: #dcfce7;
  --warn: #b45309;
  --warn-2: #f59e0b;
  --warn-soft: #fef3c7;
  --bad: #b91c1c;
  --bad-2: #dc2626;
  --bad-soft: #fee2e2;
  --radius: 10px;
  --radius-s: 7px;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.05), 0 6px 18px rgba(15, 23, 42, 0.07);
  --shadow-l: 0 10px 40px rgba(15, 23, 42, 0.22);
  --font: 'Segoe UI Variable Text', 'Segoe UI', system-ui, -apple-system, Roboto, 'Helvetica Neue', Arial, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); font-size: 14px; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }

.ic { width: 20px; height: 20px; flex: none; display: block; }

/* Boutons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 36px; padding: 0 14px; border-radius: var(--radius-s);
  border: 1px solid var(--line-2); background: var(--panel); color: var(--text);
  font-weight: 600; cursor: pointer; white-space: nowrap; user-select: none;
  transition: background .12s, border-color .12s, color .12s, box-shadow .12s;
}
.btn:hover { background: var(--panel-2); border-color: #b4bfcd; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: default; transform: none; }
.btn .ic { width: 18px; height: 18px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--brand-1-ink); }
.btn.primary:hover { background: var(--brand-1-hover); border-color: var(--brand-1-hover); }
.btn.danger { color: var(--bad); border-color: #f1b4b4; }
.btn.danger:hover { background: var(--bad-soft); }
.btn.danger.solid { background: var(--bad-2); border-color: var(--bad-2); color: #fff; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: rgba(15, 23, 42, .06); }
.btn.small { height: 30px; padding: 0 10px; font-size: 13px; }
.btn.icon { width: 36px; padding: 0; }
.btn.small.icon { width: 30px; }
.btn.on { background: var(--accent-soft); border-color: var(--brand-1-line); color: var(--accent); }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 99px; font-size: 12px; font-weight: 600; background: var(--panel-2); color: var(--text-2); border: 1px solid var(--line); white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); border-color: #b9e8c8; }
.badge.warn { background: var(--warn-soft); color: var(--warn); border-color: #f5dc9c; }
.badge.bad { background: var(--bad-soft); color: var(--bad); border-color: #f5c2c2; }
.badge.blue { background: var(--accent-soft); color: var(--accent); border-color: var(--brand-1-line); }
.badge .ic { width: 14px; height: 14px; }

/* Batterie */
.bat { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.bat .ic { width: 22px; height: 22px; }
.bat-ok { color: var(--ok-2); }
.bat-mid { color: #ca8a04; }
.bat-low { color: var(--bad-2); }
.bat-charge { color: var(--accent-2); }
.bat-na { color: var(--text-3); }

/* Animation de chargement */
@keyframes spin { to { transform: rotate(360deg); } }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid currentColor; border-right-color: transparent; animation: spin .8s linear infinite; display: inline-block; flex: none; opacity: .8; }

/* ------------------------------------------------------------ lecteur de page */
.pv { position: relative; overflow: hidden; }
.pv-stage { position: absolute; inset: 0; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.pv-page { position: absolute; left: 0; top: 0; transform-origin: 0 0; background: #fff; box-shadow: 0 2px 18px rgba(0, 0, 0, .28); will-change: transform; }
.pv-page.pv-snap { transition: transform .2s ease-out; }
.pv-surface, .pv-surface > canvas, .pv-media { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
/* Étape précédente d'une diapo animée, effacée en fondu sur la nouvelle */
.pv-ghost, .pv-ghost > canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; }
.pv-ghost { transition: opacity .35s ease; }
.pv-ghost.out { opacity: 0; }
.pv-media { object-fit: contain; background: #000; }
.pv-ink { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.pv-zones { position: absolute; inset: 0; pointer-events: none; }
.pv-zone { position: absolute; border-radius: 4px; }
.pv-zone.k-info { box-shadow: inset 0 0 0 calc(2px / var(--z, 1)) rgba(var(--brand-2-rgb), .55); background: rgba(var(--brand-2-rgb), .07); }
.pv-zone.k-link:not(.auto), .pv-zone.k-url:not(.auto) { box-shadow: inset 0 0 0 calc(2px / var(--z, 1)) rgba(var(--brand-2-rgb), .4); }
.pv-zone.k-video { background: rgba(0, 0, 0, .12); }
.pv-zone.k-defect.hidden { display: none; }
.pv-zone.k-defect { box-shadow: inset 0 0 0 calc(3px / var(--z, 1)) rgba(220, 38, 38, .8); background: rgba(220, 38, 38, .08); }
.pv-zone.k-defect.found { box-shadow: inset 0 0 0 calc(3px / var(--z, 1)) #16a34a; background: rgba(22, 163, 74, .16); }
.pv-zone.k-defect.missed { box-shadow: inset 0 0 0 calc(3px / var(--z, 1)) #f59e0b; background: rgba(245, 158, 11, .18); }
.pv-badge {
  position: absolute; top: 0; right: 0; width: 30px; height: 30px; border-radius: 50%;
  background: var(--accent-2); color: var(--brand-2-ink); display: grid; place-items: center;
  transform: translate(35%, -35%) scale(calc(var(--badge, 1) / var(--z, 1))); transform-origin: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .3);
}
.pv-badge .ic { width: 18px; height: 18px; }
.pv-badge.play { top: 50%; left: 50%; right: auto; width: 64px; height: 64px; background: rgba(15, 23, 42, .72); transform: translate(-50%, -50%) scale(calc(var(--badge, 1) / var(--z, 1))); }
.pv-badge.play .ic { width: 30px; height: 30px; margin-left: 4px; }
.pv-label {
  position: absolute; left: 50%; bottom: 100%; margin-bottom: 4px; transform: translateX(-50%) scale(calc(var(--badge, 1) / var(--z, 1))); transform-origin: bottom center;
  background: #0f172a; color: #fff; font-size: 13px; font-weight: 600; padding: 4px 9px; border-radius: 6px; white-space: nowrap; max-width: 320px; overflow: hidden; text-overflow: ellipsis;
}
.pv-zone.found .pv-label { background: #15803d; }
.pv-zone.missed .pv-label { background: #b45309; }
.pv-miss { position: absolute; width: 44px; height: 44px; margin: -22px 0 0 -22px; color: #dc2626; transform: scale(calc(1 / var(--z, 1))); animation: miss 1.2s ease-out forwards; }
.pv-miss .ic { width: 44px; height: 44px; stroke-width: 3; }
@keyframes miss { 0% { opacity: 0; transform: scale(calc(.4 / var(--z, 1))); } 15% { opacity: 1; transform: scale(calc(1.1 / var(--z, 1))); } 70% { opacity: 1; } 100% { opacity: 0; } }
.pv-empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--text-3); font-size: 13px; text-align: center; padding: 8px; }
.pv-loading::after { content: ''; position: absolute; left: 50%; top: 50%; width: 26px; height: 26px; margin: -13px; border-radius: 50%; border: 3px solid rgba(148, 163, 184, .7); border-right-color: transparent; animation: spin .8s linear infinite; }

/* Écrans d'attente aux couleurs du centre (web/shared/ecrans.js, docs/RETOURS-PILOTE-1.md) */
.wait-logo { display: block; margin: 0 auto; max-width: min(380px, 62vw); max-height: 26vh; object-fit: contain; padding: 14px 22px; border-radius: 20px; background: rgba(255, 255, 255, .94); box-shadow: 0 12px 34px rgba(0, 0, 0, .3); }
[data-wait="brand"] p, [data-wait="image"] p, [data-wait="brand"] .muted, [data-wait="image"] .muted, [data-wait="brand"] .waiting, [data-wait="image"] .waiting { color: inherit !important; opacity: .86; }
.wait-resume { display: inline-flex; align-items: center; gap: 8px; margin-top: 18px; padding: 8px 18px; border-radius: 999px; background: rgba(255, 255, 255, .14); font-weight: 700; }
.wait-lock { display: inline-grid; place-items: center; width: 64px; height: 64px; margin-bottom: 6px; border-radius: 50%; background: #b45309; color: #fff; }
.wait-lock .ic { width: 34px; height: 34px; }
/* Sécurité des comptes (docs/SECURITE-COMPTES.md), console et site : champ du code, jauge du mot de passe
   (/shared/motdepasse.js) */
.mfa-code { font-family: 'Cascadia Mono', Consolas, monospace; font-size: 22px; letter-spacing: 6px; text-align: center; }
.mdp-force { margin: -2px 0 8px; font-size: 12.5px; text-align: left; }
.mdp-barre { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: 6px; }
.mdp-barre span { height: 6px; border-radius: 3px; background: var(--line); }
.mdp-barre.f0 span:nth-child(-n+1), .mdp-barre.f1 span:nth-child(-n+1) { background: var(--bad); }
.mdp-barre.f2 span:nth-child(-n+2) { background: var(--warn); }
.mdp-barre.f3 span:nth-child(-n+3) { background: var(--ok); }
.mdp-barre.f4 span { background: var(--ok); }
.mdp-niveau { font-weight: 600; margin: 3px 0 4px; min-height: 1.3em; }
.mdp-titre { margin: 4px 0 2px; color: var(--text-2); }
.mdp-regles { list-style: none; padding: 0; margin: 0; color: var(--text-2); }
.mdp-regles li { padding-left: 20px; position: relative; line-height: 1.45; }
.mdp-regles li::before { content: '•'; position: absolute; left: 6px; }
.mdp-regles li.ok { color: var(--ok); }
.mdp-regles li.ok::before { content: '✓'; left: 3px; font-weight: 700; }
.mdp-regles li.non { color: var(--bad); }
.mdp-regles li.non::before { content: '✗'; left: 3px; font-weight: 700; }
.mdp-aide { margin: 4px 0 0; color: var(--text-3); }
.login-card .chk { display: flex; gap: 10px; align-items: flex-start; text-align: left; margin: 4px 0; line-height: 1.45; cursor: pointer; }
.login-card .chk input { margin-top: 3px; width: 17px; height: 17px; flex: none; }
