/* ESMA brand book (docs/charte/): values come from /v1/branding (Paramètres ESMA), these are only
   fallbacks. Text on orange is always black, never white. States always carry text and an icon.
   Poppins (SIL OFL, fonts/OFL.txt) stands in for Galano, which has no web licence. */
@font-face { font-family: "Poppins"; font-weight: 400; font-display: swap; src: url("fonts/Poppins-Regular.ttf") format("truetype"); }
@font-face { font-family: "Poppins"; font-weight: 600; font-display: swap; src: url("fonts/Poppins-SemiBold.ttf") format("truetype"); }
@font-face { font-family: "Poppins"; font-weight: 700; font-display: swap; src: url("fonts/Poppins-Bold.ttf") format("truetype"); }
:root {
  --orange: #FA7D0F;
  --orange-dark: #EF6100;
  --navy: #000000;          /* ESMA black (name kept for the scripts) */
  --on-orange: #000000;
  --bar-bg: #000000;        /* variant "noir"; "orange" sets the bar to orange with black text */
  --bar-fg: #FFFFFF;
  --bar-border: #FA7D0F;
  --font: "Poppins";
  --bg: #F6F7F9;
  --ok: #1B7F3B;
  --ko: #B42318;
}
* { box-sizing: border-box; }
input[type=radio], input[type=checkbox] { accent-color: var(--orange-dark); }
html, body { margin: 0; background: var(--bg); color: var(--navy);
  font: 17px/1.45 var(--font), system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.bar { display: flex; justify-content: space-between; align-items: center; gap: 8px;
  background: var(--bar-bg); color: var(--bar-fg); padding: 12px 16px; border-bottom: 4px solid var(--bar-border);
  padding-top: max(12px, env(safe-area-inset-top)); }
.brand { font-weight: 700; display: inline-flex; align-items: center; gap: 10px; }
.brand img { width: 30px; height: 30px; }
.net { font-size: 14px; white-space: nowrap; }
main { max-width: 480px; margin: 0 auto; padding: 16px; }
h1 { font-size: 22px; margin: 8px 0 16px; }
.hint { color: #4A5568; font-size: 15px; }
.msg { min-height: 1.4em; font-weight: 600; }
form { display: grid; gap: 14px; }
label { display: grid; gap: 6px; font-weight: 600; }
input[type=text], input:not([type]), input[type=password] {
  font-size: 20px; padding: 12px; border: 2px solid #CBD2DC; border-radius: 10px; background: #fff; width: 100%; }
input:focus { outline: 3px solid var(--orange); border-color: var(--navy); }
#pin { text-align: center; letter-spacing: 8px; font-size: 28px; }
fieldset.roles { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; }
fieldset.roles label { font-weight: 500; display: flex; gap: 10px; align-items: center; }
button { font: inherit; border-radius: 12px; padding: 14px 16px; border: 2px solid var(--navy); cursor: pointer; width: 100%; }
button.primary { background: var(--orange); border-color: var(--orange); color: var(--on-orange); font-weight: 700; }
button.primary:active { background: var(--orange-dark); border-color: var(--orange-dark); }
button.secondary { background: #fff; color: var(--navy); margin-top: 12px; }
button.big { font-size: 20px; padding: 22px 16px; }
button.link { background: none; border: 0; color: var(--navy); text-decoration: underline; margin-top: 24px; }
button:disabled { opacity: .6; }
.actions { display: grid; gap: 14px; }
.camera { position: relative; border-radius: 12px; overflow: hidden; background: #000; aspect-ratio: 1; }
.camera video { width: 100%; height: 100%; object-fit: cover; }
.list { list-style: none; padding: 0; display: grid; gap: 10px; }
.list button { text-align: left; background: #fff; }
.result { text-align: center; padding: 24px 8px; }
.result-icon { display: inline-flex; width: 96px; height: 96px; border-radius: 50%; align-items: center; justify-content: center;
  font-size: 56px; font-weight: 700; color: #fff; }
.result.ok .result-icon { background: var(--ok); }
.result.ko .result-icon { background: var(--ko); }
.result p { font-size: 20px; font-weight: 600; }

/* Enrolment and guard screens */
.student { display: flex; gap: 12px; align-items: center; margin: 8px 0; }
.student img { width: 96px; height: 96px; object-fit: cover; border-radius: 8px; border: 2px solid var(--navy); }
.print-label { text-align: center; }
.print-label img { width: 40mm; height: 40mm; }
@media print {
  body * { visibility: hidden; }
  .print-label, .print-label * { visibility: visible; }
  .print-label { position: absolute; left: 0; top: 0; width: 54mm; }
}
.result.warn { border-color: var(--orange); }
.result.warn .result-icon { background: var(--orange); color: var(--on-orange); }
.checklist { list-style: none; padding: 0; }
.checklist li { padding: 10px 4px; border-bottom: 1px solid #DDE1E6; }
.checklist input { width: 22px; height: 22px; vertical-align: middle; }

/* Legal information (Paramètres ESMA > Informations légales), hidden while empty. */
.legal { max-width: 560px; margin: 0 auto; padding: 8px 16px 24px; font-size: .78rem; color: #454748; text-align: center; }
.legal[hidden] { display: none; }
