/* Arc Seuil — styles de base (Propshaft). Contraste WCAG 2.1 AA, zones tactiles ≥ 44 px,
   police ≥ 18 px au kiosque (CDC §7.5). Couleur d'entité via --primary. */
:root {
  --primary: #1f4e79;
  --ink: #1d2433;
  --muted: #5b6472;
  --bg: #f6f7f9;
  --card: #ffffff;
  --danger: #a4262c;
  --ok: #1b6e3a;
  --radius: 12px;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--ink); background: var(--bg); line-height: 1.45; }
h1, h2 { margin: 0 0 0.5em; line-height: 1.2; }
.muted { color: var(--muted); }
.button, button.button { display: inline-block; min-height: 44px; min-width: 44px; padding: 0.6rem 1.2rem; border: 0; border-radius: var(--radius); background: var(--primary); color: #fff; font-size: 1rem; font-weight: 600; cursor: pointer; }
.button--small { min-height: 36px; padding: 0.4rem 0.9rem; font-size: 0.95rem; }
.button--danger { background: #a4262c; }
.button:disabled { opacity: 0.55; cursor: not-allowed; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 0.3rem 1rem; margin: 0 0 1rem; }
.facts dt { font-weight: 600; }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.link { background: none; border: 0; color: var(--primary); text-decoration: underline; cursor: pointer; min-height: 44px; font-size: 1rem; }
.field { display: grid; gap: 0.35rem; margin-bottom: 1rem; }
.field input { min-height: 44px; font-size: 1.05rem; padding: 0.5rem 0.75rem; border: 1px solid #c3c9d2; border-radius: 8px; }
.flash { margin: 0; padding: 0.75rem 1rem; }
.flash--notice { background: #e3f3e8; color: var(--ok); }
.flash--alert { background: #fbe9ea; color: var(--danger); }
.auth { max-width: 26rem; margin: 10vh auto; padding: 2rem; background: var(--card); border-radius: var(--radius); box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08); }
.tenants { list-style: none; padding: 0; display: grid; gap: 0.75rem; }
.panel { background: var(--card); border-radius: var(--radius); padding: 1.25rem; margin: 1rem 0; }
.app-shell { max-width: 60rem; margin: 0 auto; padding: 1rem; }
.app-header { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 1rem; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 0.6rem 0.5rem; border-bottom: 1px solid #e3e6ea; vertical-align: middle; }
.code { font-family: ui-monospace, Menlo, monospace; font-size: 1.25rem; letter-spacing: 0.15em; margin: 0 0.75rem; }
.tags { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.tag { background: #e9eef5; border-radius: 999px; padding: 0.2rem 0.7rem; font-size: 0.9rem; }
.tag--danger { background: #fde7e9; color: #8a1020; font-weight: 600; }
.panel--alert { border-left: 4px solid #b00020; }

/* Kiosque : plein écran, gros caractères, boutons larges */
body.kiosk { font-size: 18px; }
/* Zoom permis au kiosque (WCAG 1.4.4, CDC §7.5) : le pincement reste possible partout ; sur les contrôles, le
   double-tap ne zoome pas (un toucher rapide répété reste deux touchers sur le bouton). La signature et l'appui
   maintenu gardent touch-action: none. */
body.kiosk :is(button, a, input, select, textarea, label, summary, [role="button"]):not(.hold-button) { touch-action: manipulation; }
.kiosk-screen { min-height: 100vh; display: grid; grid-template-rows: auto 1fr auto; padding: 2rem; background: linear-gradient(180deg, var(--primary) 0 30%, var(--bg) 30%); }
.kiosk-screen__header { color: #fff; text-align: center; }
.kiosk-screen__header h1 { font-size: 2.5rem; }
.kiosk-screen__tenant { font-size: 1.4rem; margin: 0 0 1rem; }
.kiosk-choices { align-self: center; justify-self: center; width: min(100%, 36rem); display: grid; gap: 1rem; background: var(--card); padding: 2rem; border-radius: var(--radius); box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12); }
.kiosk-choice { min-height: 72px; font-size: 1.4rem; font-weight: 600; border: 2px solid var(--primary); border-radius: var(--radius); background: #fff; color: var(--primary); cursor: pointer; }
.kiosk-choice:disabled { opacity: 0.55; cursor: not-allowed; }
.kiosk-hint { color: var(--muted); text-align: center; margin: 0; }
.kiosk-screen__footer { text-align: center; color: var(--muted); }
.kiosk-degraded { color: var(--danger); font-weight: 600; font-size: 1.3rem; }
.kiosk-activation { max-width: 30rem; margin: 10vh auto; padding: 2rem; background: var(--card); border-radius: var(--radius); }
.kiosk-help { color: var(--muted); }
.lang { display: flex; justify-content: center; gap: 0.5rem; }
.lang__button { min-height: 44px; min-width: 44px; padding: 0.4rem 1rem; border-radius: 999px; border: 2px solid rgba(255, 255, 255, 0.7); background: transparent; color: #fff; font-size: 1.125rem; cursor: pointer; }
.lang__button--active { background: #fff; color: var(--primary); }

/* Pages visiteur */
.guest-shell { max-width: 36rem; margin: 6vh auto; padding: 2rem; background: var(--card); border-radius: var(--radius); border-top: 8px solid var(--primary); }
.guest-expired { max-width: 36rem; margin: 10vh auto; padding: 2rem; text-align: center; }

/* Back-office : navigation, formulaires de paramétrage (lot 1) */
.app-nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; margin: 0.5rem 0 1rem; }
.app-nav a { min-height: 44px; display: inline-flex; align-items: center; color: var(--primary); font-weight: 600; text-decoration: none; }
.app-nav a.router-link-exact-active { text-decoration: underline; }
.panel__head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.form fieldset { border: 1px solid #e3e6ea; border-radius: 8px; margin: 0 0 1rem; padding: 0.75rem 1rem; }
.form legend { font-weight: 600; padding: 0 0.3rem; }
.field select, .field textarea { min-height: 44px; font-size: 1.05rem; padding: 0.5rem 0.75rem; border: 1px solid #c3c9d2; border-radius: 8px; font-family: inherit; }
.check { display: inline-flex; align-items: center; gap: 0.4rem; min-height: 44px; margin-right: 1rem; }
.choices { list-style: none; padding: 0; margin: 0; }
.translations { border: 0 !important; padding: 0 !important; }
.flow { margin: 0 0 0.75rem; padding-left: 1.4rem; }
.flow li { min-height: 44px; display: list-item; }
.form--inline { display: flex; flex-wrap: wrap; gap: 0 1rem; align-items: end; margin-top: 1rem; }
.theme-preview { max-height: 64px; max-width: 200px; vertical-align: middle; margin-right: 1rem; }
.kiosk-logo { max-height: 96px; max-width: 60%; margin: 0 auto 1rem; display: block; }
.kiosk-screen--background { background: var(--kiosk-background) center / cover no-repeat, var(--bg); }
.policy-body { border-top: 1px solid #e3e6ea; padding-top: 0.5rem; }
.kiosk-preview-banner { position: sticky; top: 0; z-index: 10; margin: 0; padding: 0.6rem 1rem; text-align: center; background: #fff4ce; color: #5c4500; font-weight: 600; }
.kiosk-form { display: grid; gap: 0.5rem; }
.kiosk-field input, .kiosk-field select { min-height: 56px; font-size: 1.25rem; }
/* Tactile au kiosque (CDC §7.5) : texte ≥ 18 px, cibles ≥ 44 × 44 px, y compris liens et champs de recherche. */
.kiosk-screen { font-size: 1.125rem; }
/* Message du serveur au kiosque (« Tablette activée ») en surimpression : sa disparition ne décale aucune cible. */
.kiosk > .flash { position: fixed; top: 0; left: 0; right: 0; z-index: 20; }
.kiosk-screen .link { font-size: 1.125rem; min-width: 44px; padding: 0 0.75rem; }
.kiosk-screen .field input { min-height: 56px; font-size: 1.25rem; }
.kiosk-choice--primary { background: var(--primary); color: #fff; }
.kiosk-choice--primary:disabled { opacity: 0.5; }
.kiosk-error { color: var(--danger); font-weight: 600; margin: 0.25rem 0 0; }
.kiosk-results { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.75rem; }
.kiosk-results .kiosk-choice { width: 100%; }
.kiosk-muted { color: var(--muted); font-weight: 400; }
.kiosk-lead { font-size: 1.5rem; font-weight: 600; }
.kiosk-instructions { white-space: pre-line; }
/* Information RGPD (RGPD-03) : bouton ≥ 44 px, police ≥ 18 px ; texte de l'entité tel quel, retours à la ligne gardés. */
.kiosk-privacy { margin-top: 1rem; }
.kiosk-privacy__toggle { min-height: 48px; padding: 0.5rem 1rem; font-size: 1.125rem; background: none; border: 0; color: var(--primary); text-decoration: underline; cursor: pointer; }
.kiosk-privacy__text { white-space: pre-line; font-size: 1.125rem; line-height: 1.5; margin: 0.5rem 0 0; padding: 1rem; border-left: 4px solid var(--primary); background: #f5f7fa; }
.qr-scanner { display: grid; justify-items: center; gap: 0.5rem; }
.qr-scanner__video { width: min(100%, 360px); aspect-ratio: 4 / 3; background: #0b1220; border-radius: var(--radius); object-fit: cover; }
.policy-scroll { max-height: 40vh; overflow-y: auto; border: 1px solid #c3c9d2; border-radius: 8px; padding: 0.75rem 1rem; background: #fff; }
.policy h3 { margin-top: 0; }
.policy-end { height: 1px; }
.signature { display: grid; gap: 0.25rem; }
.signature__canvas { width: 100%; height: 180px; border: 2px dashed var(--primary); border-radius: 8px; background: #fff; touch-action: none; }
.kiosk-qr { display: grid; justify-items: center; margin: 1rem 0; }
.kiosk-qr img { width: 180px; height: 180px; background: #fff; }
.kiosk-qr figcaption { color: var(--muted); text-align: center; }
.kiosk-farewell { font-size: 1.3rem; font-weight: 600; text-align: center; }
.visitor-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: 0.5rem; margin-bottom: 0.5rem; }
.visitor-row input { min-height: 44px; font-size: 1rem; padding: 0.4rem 0.6rem; border: 1px solid #c3c9d2; border-radius: 8px; }
.app-nav [aria-selected="true"] { font-weight: 700; text-decoration: underline; }
@media (max-width: 40rem) { .table thead { display: none; } .table tr { display: grid; padding: 0.5rem 0; border-bottom: 1px solid #e3e6ea; } .table td { border: 0; padding: 0.15rem 0; } }
/* Lot 2 — filtres des listes (registre, présents) ; tableau défilant sur petit écran. */
.filters { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-bottom: 1rem; }
.filters label { display: grid; gap: 0.25rem; font-size: 0.9rem; }
.filters select, .filters input { min-height: 44px; font-size: 1rem; padding: 0.4rem 0.6rem; border: 1px solid #c3c9d2; border-radius: 8px; }
.table-scroll { overflow-x: auto; }
.error { color: #a4262c; margin: 0.25rem 0 0; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* Urgence (URG-01 à 04) : bouton à maintenir, bandeaux EXERCICE / ÉVACUATION, compteurs lisibles en extérieur. */
.hold-button { position: relative; overflow: hidden; min-height: 64px; min-width: 260px; border: 0; border-radius: 12px; background: #8b1a1a; color: #fff; font-size: 1.2rem; font-weight: 700; padding: 0.75rem 1.25rem; display: grid; gap: 0.2rem; touch-action: none; user-select: none; -webkit-user-select: none; }
.hold-button__fill { position: absolute; inset: 0; background: #e3a008; transform-origin: left; transform: scaleX(var(--hold, 0)); opacity: 0.55; }
.hold-button__label, .hold-button small { position: relative; }
.banner-drill { background: #6b3fa0; color: #fff; font-weight: 800; font-size: 1.4rem; letter-spacing: 0.12em; text-align: center; padding: 0.6rem; border-radius: 8px; }
.banner-real { background: #b00020; color: #fff; font-weight: 800; font-size: 1.4rem; text-align: center; padding: 0.6rem; border-radius: 8px; }
.counters { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 0.75rem 0; }
.counter { background: #f2f4f7; border-radius: 10px; padding: 0.6rem 1rem; min-width: 7rem; }
.counter strong { display: block; font-size: 1.8rem; line-height: 1.1; }
.counter--missing strong { color: #b00020; }
.counter--safe strong { color: #1b6e2d; }
.chrono { font-variant-numeric: tabular-nums; font-size: 2rem; font-weight: 700; }
/* Appel nominal (URG-03) : une main, cibles ≥ 44 px, contraste AA en extérieur. */
.roll-call .point-choice { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.5rem 0; }
.roll-call .point-choice .button { min-height: 48px; }
.button--active { outline: 4px solid #1b6e2d; }
.roll-call__search { width: 100%; min-height: 48px; font-size: 1.1rem; padding: 0.5rem 0.75rem; border: 2px solid #3a4352; border-radius: 10px; margin: 0.5rem 0; }
.roll-call__list { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.5rem; }
.roll-call__row { width: 100%; min-height: 56px; display: grid; gap: 0.15rem; text-align: left; padding: 0.6rem 0.8rem; border: 2px solid #3a4352; border-radius: 10px; background: #fff; color: #111; font-size: 1.05rem; }
.roll-call__row[disabled] { opacity: 0.85; }
li[data-state="safe"] .roll-call__row { border-color: #1b6e2d; background: #eef8f0; }
.roll-call__name { font-weight: 700; font-size: 1.15rem; }

/* Tâches de l'intervenant au kiosque (VIS-11) : cases larges (≥ 44 px), texte ≥ 18 px. */
.kiosk-tasks { list-style: none; padding: 0; margin: 1rem 0; display: grid; gap: 0.75rem; }
.kiosk-check { display: flex; align-items: center; gap: 1rem; min-height: 56px; padding: 0.75rem 1rem; border: 2px solid #c9d3df; border-radius: 12px; background: #fff; font-size: 1.15rem; }
.kiosk-check input { width: 32px; height: 32px; flex: none; }
.kiosk-required { margin-left: auto; font-size: 0.95rem; color: #8a1020; font-weight: 600; }

/* Statistiques (STA-01) : tuiles, barres d'une seule teinte (couleur primaire), axe discret. */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0.75rem; margin: 1rem 0; }
.tile { background: #f3f5f8; border-radius: 10px; padding: 0.75rem 1rem; display: grid; gap: 0.25rem; }
.tile strong { font-size: 1.6rem; color: #1b2430; }
.tile span { color: #4a5563; font-size: 0.9rem; }
.chart { margin: 1rem 0; }
.chart__svg { width: 100%; height: 160px; display: block; }
.chart__bar { fill: var(--primary, #1f4e79); }
.chart__bar:hover { fill: #163a5b; }
.chart__axis { stroke: #c9d3df; stroke-width: 1; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; }
.button.button--ghost { background: transparent; color: var(--primary, #1f4e79); border: 1px solid currentColor; }
