/* ============================================================================
 * FILE: /mobile/app/app.css
 * CREATION DATE: 19-10-2026 23:20
 * MODIFICATION DATE: 20-10-2026 00:10
 * Application mobile CIS : aucune dépendance externe (fonctionne hors ligne).
 * Style « verre dépoli » avec trois thèmes : claire (défaut), ardoise, sombre.
 * ========================================================================== */

/* ---------- Thèmes ---------- */
:root, [data-theme="light"] {
  --primary: #1d6ff2;
  --primary-2: #4f46e5;
  --primary-soft: rgba(29, 111, 242, .12);
  --btn: #1d6ff2;
  --btn-active: #165bd0;
  --on-primary: #ffffff;
  --text: #2b3445;
  --text-strong: #161b26;
  --muted: #6b778a;
  --border: rgba(255, 255, 255, .7);
  --hairline: rgba(43, 52, 69, .09);
  --glass: rgba(255, 255, 255, .58);
  --glass-strong: rgba(255, 255, 255, .78);
  --glass-row: rgba(255, 255, 255, .66);
  --field: rgba(255, 255, 255, .85);
  --field-border: rgba(43, 52, 69, .14);
  --chip: rgba(43, 52, 69, .06);
  --shadow: 0 8px 24px rgba(55, 60, 120, .10), 0 1px 2px rgba(55, 60, 120, .06);
  --backdrop: rgba(30, 32, 60, .30);
  --bg-base: #eef0fb;
  --blob-1: rgba(29, 111, 242, .30);
  --blob-2: rgba(3, 195, 236, .25);
  --blob-3: rgba(255, 171, 0, .18);
  --success: #2f9e44;
  --success-soft: rgba(47, 158, 68, .14);
  --warning: #b07800;
  --warning-soft: rgba(255, 171, 0, .18);
  --danger: #e03131;
  --danger-soft: rgba(224, 49, 49, .12);
  --info: #0b9ec0;
  --info-soft: rgba(3, 195, 236, .16);
  --toast: rgba(22, 27, 38, .9);
  color-scheme: light;
}
[data-theme="slate"] {
  --primary: #60a5fa;
  --primary-2: #6366f1;
  --primary-soft: rgba(96, 165, 250, .18);
  --btn: #2f7cf6;
  --btn-active: #1d6ff2;
  --text: #dbe3ee;
  --text-strong: #f4f7fb;
  --muted: #94a3b8;
  --border: rgba(255, 255, 255, .13);
  --hairline: rgba(255, 255, 255, .08);
  --glass: rgba(84, 100, 124, .45);
  --glass-strong: rgba(62, 76, 97, .86);
  --glass-row: rgba(84, 100, 124, .42);
  --field: rgba(41, 53, 71, .7);
  --field-border: rgba(255, 255, 255, .12);
  --chip: rgba(255, 255, 255, .07);
  --shadow: 0 8px 24px rgba(0, 0, 0, .25);
  --backdrop: rgba(10, 15, 25, .5);
  --bg-base: #364457;
  --blob-1: rgba(47, 124, 246, .28);
  --blob-2: rgba(56, 189, 248, .18);
  --blob-3: rgba(148, 163, 184, .22);
  --success: #69db7c;
  --success-soft: rgba(105, 219, 124, .15);
  --warning: #ffd43b;
  --warning-soft: rgba(255, 212, 59, .14);
  --danger: #ff8787;
  --danger-soft: rgba(255, 135, 135, .14);
  --info: #66d9ef;
  --info-soft: rgba(102, 217, 239, .14);
  --toast: rgba(15, 23, 42, .92);
  color-scheme: dark;
}
[data-theme="dark"] {
  --primary: #5b9dff;
  --primary-2: #6366f1;
  --primary-soft: rgba(91, 157, 255, .16);
  --btn: #2f7cf6;
  --btn-active: #1d6ff2;
  --text: #d9dae6;
  --text-strong: #ffffff;
  --muted: #8a8ca3;
  --border: rgba(255, 255, 255, .08);
  --hairline: rgba(255, 255, 255, .06);
  --glass: rgba(26, 27, 38, .55);
  --glass-strong: rgba(24, 25, 35, .86);
  --glass-row: rgba(30, 31, 44, .62);
  --field: rgba(14, 15, 22, .7);
  --field-border: rgba(255, 255, 255, .10);
  --chip: rgba(255, 255, 255, .06);
  --shadow: 0 8px 28px rgba(0, 0, 0, .45);
  --backdrop: rgba(0, 0, 0, .55);
  --bg-base: #0c0d13;
  --blob-1: rgba(47, 124, 246, .26);
  --blob-2: rgba(99, 102, 241, .16);
  --blob-3: rgba(3, 195, 236, .10);
  --success: #69db7c;
  --success-soft: rgba(105, 219, 124, .13);
  --warning: #ffd43b;
  --warning-soft: rgba(255, 212, 59, .12);
  --danger: #ff8787;
  --danger-soft: rgba(255, 135, 135, .12);
  --info: #66d9ef;
  --info-soft: rgba(102, 217, 239, .12);
  --toast: rgba(30, 31, 44, .95);
  color-scheme: dark;
}

:root {
  --radius: 18px;
  --nav-h: 66px;
  --top-h: 56px;
  --blur: blur(18px) saturate(170%);
  /* Zones système (heure, batterie, barre de gestes) : navigateur via env(), APK via les variables injectées par Capacitor */
  --safe-top: max(env(safe-area-inset-top, 0px), var(--safe-area-inset-top, 0px));
  --safe-bottom: max(env(safe-area-inset-bottom, 0px), var(--safe-area-inset-bottom, 0px));
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; color: var(--text);
  font-family: -apple-system, "Segoe UI", Roboto, "Public Sans", Arial, sans-serif; font-size: 15px; }
html { background: var(--bg-base); }
body { min-height: 100vh; overscroll-behavior-y: contain; background: transparent; transition: color .25s; }
/* Fond : halos de couleur fixes, que le verre vient flouter */
body::before { content: ""; position: fixed; inset: -20%; z-index: -1; pointer-events: none;
  background:
    radial-gradient(40% 35% at 15% 10%, var(--blob-1), transparent 70%),
    radial-gradient(35% 30% at 90% 30%, var(--blob-2), transparent 70%),
    radial-gradient(45% 35% at 40% 95%, var(--blob-3), transparent 70%),
    var(--bg-base); }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.icon { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.icon.sm { width: 18px; height: 18px; }
.icon.lg { width: 28px; height: 28px; }

.glass { background: var(--glass); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border: 1px solid var(--border); box-shadow: var(--shadow); }

/* ---------- Barre du haut (passe sous l'heure/batterie, contenu décalé) ---------- */
.topbar { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 8px;
  padding: var(--safe-top) 10px 0 14px; height: calc(var(--top-h) + var(--safe-top));
  background: var(--glass-strong); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border-bottom: 1px solid var(--hairline); }
.topbar h1 { font-size: 1.1rem; font-weight: 750; margin: 0; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-strong); letter-spacing: -.2px; }
.icon-btn { width: 42px; height: 42px; border: 0; border-radius: 50%; background: transparent; display: inline-flex;
  align-items: center; justify-content: center; color: var(--text); }
.icon-btn:active { background: var(--chip); }
.net-pill { display: inline-flex; align-items: center; gap: 6px; font-size: .75rem; font-weight: 650; padding: 6px 11px;
  border-radius: 20px; border: 1px solid var(--hairline); background: var(--chip); color: var(--muted); }
.net-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.net-pill.online .dot { background: var(--success); box-shadow: 0 0 0 3px var(--success-soft); }
.net-pill.offline { background: var(--warning-soft); color: var(--warning); }
.net-pill.offline .dot { background: var(--warning); }
.net-pill.syncing .dot { background: var(--info); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .3; } }

/* ---------- Contenu ---------- */
main { padding: 14px 14px calc(var(--nav-h) + 96px + var(--safe-bottom)); max-width: 720px; margin: 0 auto; }
.screen { display: none; }
.screen.active { display: block; animation: fadein .2s ease; }
@keyframes fadein { from { opacity: 0; transform: translateY(4px); } }
.card { background: var(--glass); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border: 1px solid var(--border); box-shadow: var(--shadow); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; }
.card h2 { font-size: .95rem; margin: 0 0 12px; color: var(--text-strong); }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.hello { font-size: 1.4rem; font-weight: 780; margin: 4px 0 2px; color: var(--text-strong); letter-spacing: -.3px; }

/* Carte d'accueil en dégradé */
.hero { background: linear-gradient(135deg, var(--btn), var(--primary-2)); color: #fff; border: 0;
  box-shadow: 0 12px 30px rgba(29, 111, 242, .3); position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; right: -40px; top: -40px; width: 160px; height: 160px; border-radius: 50%; background: rgba(255, 255, 255, .14); }
.hero .muted, .hero .hello { color: #fff; }
.hero .muted { opacity: .85; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat { background: var(--chip); border: 1px solid var(--hairline); border-radius: 14px; padding: 12px 8px; text-align: center; }
.stat b { display: block; font-size: 1.4rem; color: var(--text-strong); }
.stat span { font-size: .7rem; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.progress { height: 8px; border-radius: 4px; background: var(--chip); overflow: hidden; margin-top: 12px; }
.progress i { display: block; height: 100%; border-radius: 4px; background: var(--btn); transition: width .4s; }

.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.action { border: 1px solid var(--border); background: var(--glass); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 14px;
  display: flex; flex-direction: column; align-items: flex-start; gap: 12px; text-align: left; font-weight: 650; min-height: 100px; color: var(--text-strong); transition: transform .12s; }
.badge-ico { width: 42px; height: 42px; border-radius: 13px; display: flex; align-items: center; justify-content: center;
  background: var(--primary-soft); color: var(--primary); flex-shrink: 0; }
.action.dark .badge-ico { background: var(--chip); color: var(--text-strong); }
.action.green .badge-ico, .badge-ico.green { background: var(--success-soft); color: var(--success); }
.action.cyan .badge-ico { background: var(--info-soft); color: var(--info); }
.action:active { transform: scale(.97); }

.sync-card { display: flex; align-items: center; gap: 12px; }
.sync-card.warn .badge-ico { background: var(--warning-soft); color: var(--warning); }
.sync-card .grow { flex: 1; min-width: 0; }
.sync-card b { color: var(--text-strong); }

/* ---------- Liste élèves ---------- */
.list-head { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.class-chip { flex: 1; min-width: 0; border: 1px solid var(--border); background: var(--glass); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border-radius: 14px; box-shadow: var(--shadow); padding: 12px 14px; display: flex; align-items: center; gap: 10px; text-align: left; color: var(--text-strong); }
.class-chip .icon { color: var(--primary); }
.class-chip .t { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 650; }
.search { position: relative; margin-bottom: 10px; }
.search input { width: 100%; border: 1px solid var(--field-border); background: var(--field); border-radius: 14px; padding: 12px 12px 12px 42px; outline: none; }
.search input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.search .icon { position: absolute; left: 14px; top: 13px; color: var(--muted); }
.filter-tabs { display: flex; gap: 6px; margin-bottom: 12px; overflow-x: auto; scrollbar-width: none; }
.filter-tabs::-webkit-scrollbar { display: none; }
.filter-tabs button { border: 1px solid var(--hairline); background: var(--glass-row); border-radius: 20px; padding: 7px 13px; font-size: .82rem; white-space: nowrap; font-weight: 600; }
.filter-tabs button.on { background: var(--btn); color: #fff; border-color: transparent; }

/* Lignes : verre sans flou (plus fluide sur les téléphones modestes) */
.student-row { background: var(--glass-row); border: 1px solid var(--border); border-radius: 16px; margin-bottom: 8px; display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; box-shadow: 0 2px 8px rgba(0, 0, 0, .04); }
.student-row:active { background: var(--glass-strong); }
.avatar { width: 48px; height: 48px; border-radius: 50%; background: var(--chip); display: flex; align-items: center; justify-content: center;
  overflow: hidden; flex-shrink: 0; color: var(--muted); font-weight: 700; font-size: .9rem; }
.avatar.has { box-shadow: 0 0 0 2px var(--primary); }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.s-info { flex: 1; min-width: 0; }
.s-name { font-weight: 700; text-transform: uppercase; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; color: var(--text-strong); }
.s-meta { font-size: .78rem; color: var(--muted); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.tag { font-size: .66rem; font-weight: 700; padding: 2px 8px; border-radius: 10px; background: var(--warning-soft); color: var(--warning); text-transform: uppercase; }
.tag.info { background: var(--info-soft); color: var(--info); }
.tag.err { background: var(--danger-soft); color: var(--danger); }
.cam-btn { width: 44px; height: 44px; border-radius: 50%; border: 0; display: flex; align-items: center; justify-content: center;
  background: var(--btn); color: #fff; box-shadow: 0 4px 10px rgba(29, 111, 242, .3); flex-shrink: 0; }
.cam-btn:active { background: var(--btn-active); }
.cam-btn.done { background: var(--primary-soft); color: var(--primary); box-shadow: none; }
.empty { text-align: center; padding: 40px 20px; }
.empty h3 { color: var(--text-strong); }
.empty .icon { width: 44px; height: 44px; color: var(--primary); }

/* ---------- Navigation basse ---------- */
.bottomnav { position: fixed; left: 10px; right: 10px; bottom: calc(10px + var(--safe-bottom)); z-index: 60; height: var(--nav-h);
  background: var(--glass-strong); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border: 1px solid var(--border); border-radius: 22px; box-shadow: var(--shadow); display: flex; max-width: 700px; margin: 0 auto; }
.bottomnav button { flex: 1; border: 0; background: transparent; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font-size: .72rem; font-weight: 650; color: var(--muted); position: relative; }
.bottomnav button.on { color: var(--primary); }
.bottomnav button.on::before { content: ""; position: absolute; top: 7px; width: 46px; height: 30px; border-radius: 15px; background: var(--primary-soft); z-index: -1; }
.bottomnav .count { position: absolute; top: 6px; left: 56%; min-width: 18px; height: 18px; border-radius: 9px; background: var(--danger); color: #fff;
  font-size: .65rem; display: flex; align-items: center; justify-content: center; padding: 0 5px; }

/* ---------- Bouton flottant d'options ---------- */
.fab { position: fixed; right: 20px; bottom: calc(var(--nav-h) + 24px + var(--safe-bottom)); z-index: 70; width: 58px; height: 58px; border-radius: 20px; border: 0;
  background: var(--btn); color: #fff; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 20px rgba(29, 111, 242, .4); transition: transform .15s; }
.fab:active { transform: scale(.92); }

/* ---------- Feuilles (bas d'écran) ---------- */
.sheet-backdrop { position: fixed; inset: 0; background: var(--backdrop); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  z-index: 200; opacity: 0; pointer-events: none; transition: opacity .2s; }
.sheet-backdrop.open { opacity: 1; pointer-events: auto; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 201; max-height: calc(92vh - var(--safe-top)); overflow-y: auto;
  background: var(--glass-strong); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border: 1px solid var(--border); border-bottom: 0; border-radius: 26px 26px 0 0; box-shadow: 0 -10px 40px rgba(0, 0, 0, .18);
  transform: translateY(105%); transition: transform .28s cubic-bezier(.2, .8, .2, 1); padding: 8px 16px calc(18px + var(--safe-bottom)); max-width: 720px; margin: 0 auto; }
.sheet.open { transform: translateY(0); }
.sheet .grip { width: 42px; height: 5px; background: var(--hairline); border-radius: 3px; margin: 4px auto 14px; }
.sheet h3 { margin: 0 0 14px; font-size: 1.08rem; color: var(--text-strong); }
.menu-item { width: 100%; border: 0; background: transparent; display: flex; align-items: center; gap: 14px; padding: 11px 6px; border-radius: 14px; text-align: left; font-weight: 650; color: var(--text-strong); }
.menu-item:active { background: var(--chip); }
.menu-item .sub { display: block; font-weight: 400; font-size: .78rem; color: var(--muted); }
.menu-item .ico { width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; background: var(--chip); color: var(--text); }
.menu-item.highlight .ico { background: var(--success-soft); color: var(--success); }
.menu-item.danger, .menu-item.danger .ico { color: var(--danger); }
.sep { height: 1px; background: var(--hairline); margin: 8px 0; }

/* Sélecteur de thème */
.theme-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 4px 0 6px; }
.theme-opt { border: 2px solid transparent; background: var(--chip); border-radius: 14px; padding: 8px; display: flex; flex-direction: column; align-items: center; gap: 6px;
  font-size: .78rem; font-weight: 650; color: var(--text); }
.theme-opt.on { border-color: var(--primary); color: var(--primary); }
.theme-opt .swatch { width: 100%; height: 40px; border-radius: 10px; position: relative; overflow: hidden; border: 1px solid rgba(127, 127, 127, .25); }
.theme-opt .swatch::after { content: ""; position: absolute; left: 18%; right: 18%; top: 28%; height: 44%; border-radius: 6px; }
.sw-light { background: linear-gradient(135deg, #e7e8ff, #d5f3fb); }
.sw-light::after { background: rgba(255, 255, 255, .8); }
.sw-slate { background: linear-gradient(135deg, #334155, #243041); }
.sw-slate::after { background: rgba(71, 85, 105, .85); }
.sw-dark { background: linear-gradient(135deg, #1a1b2e, #0c0d13); }
.sw-dark::after { background: rgba(40, 41, 58, .9); }
.section-label { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); margin: 2px 6px 8px; }

/* ---------- Formulaires ---------- */
.field { margin-bottom: 12px; }
.field label { display: block; font-size: .8rem; font-weight: 650; margin-bottom: 5px; color: var(--text); }
.field label .req { color: var(--danger); }
.field input, .field select { width: 100%; border: 1px solid var(--field-border); background: var(--field); border-radius: 12px; padding: 12px; outline: none; min-height: 46px; color: var(--text-strong); }
.field input:focus, .field select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.field select option { background: var(--bg-base); color: var(--text-strong); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.seg { display: flex; gap: 8px; }
.seg label { flex: 1; margin: 0; }
.seg input { display: none; }
.seg span { display: block; text-align: center; border: 1px solid var(--field-border); background: var(--field); border-radius: 12px; padding: 11px; font-weight: 650; }
.seg input:checked + span { background: var(--btn); color: #fff; border-color: transparent; }
.btn { border: 0; border-radius: 14px; padding: 14px 16px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; text-decoration: none; }
.btn-primary { background: var(--btn); color: #fff; box-shadow: 0 4px 12px rgba(29, 111, 242, .3); }
.btn-primary:active { background: var(--btn-active); }
.btn-primary:disabled { opacity: .6; }
.btn-light { background: var(--chip); color: var(--text-strong); border: 1px solid var(--hairline); }
.btn-success { background: var(--btn); color: #fff; box-shadow: 0 4px 12px rgba(29, 111, 242, .3); }
.btn + .btn { margin-top: 8px; }
.form-error { background: var(--danger-soft); color: var(--danger); border-radius: 12px; padding: 10px 12px; font-size: .85rem; margin-bottom: 12px; }
.note { background: var(--primary-soft); color: var(--primary); border-radius: 12px; padding: 10px 12px; font-size: .82rem; margin-bottom: 12px; }
details.adv summary { color: var(--muted); font-size: .85rem; cursor: pointer; margin: 6px 0 10px; }

/* ---------- Connexion ---------- */
.login-wrap { min-height: 100vh; display: flex; flex-direction: column; justify-content: center;
  padding: calc(24px + var(--safe-top)) 20px calc(24px + var(--safe-bottom)); max-width: 420px; margin: 0 auto; }
.brand { text-align: center; margin-bottom: 24px; }
.brand .logo { width: 76px; height: 76px; border-radius: 24px; background: var(--btn); color: #fff; display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 1.45rem; box-shadow: 0 12px 28px rgba(29, 111, 242, .35); }
.brand h1 { font-size: 1.35rem; margin: 14px 0 4px; color: var(--text-strong); }
.login-themes { display: flex; justify-content: center; gap: 8px; margin-top: 16px; }
.login-themes button { width: 30px; height: 30px; border-radius: 50%; border: 2px solid transparent; padding: 0; position: relative; overflow: hidden; }
.login-themes button.on { border-color: var(--primary); }

/* ---------- Fiche élève ---------- */
.profile { text-align: center; }
.profile .avatar { width: 110px; height: 140px; border-radius: 18px; margin: 0 auto 10px; font-size: 1.6rem; }
.profile h3 { margin: 0; text-transform: uppercase; color: var(--text-strong); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; text-align: left; margin: 16px 0; font-size: .9rem;
  background: var(--chip); border-radius: 14px; padding: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 650; word-break: break-word; color: var(--text-strong); }

/* ---------- File d'envoi ---------- */
.queue-item { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--hairline); }
.queue-item:last-child { border-bottom: 0; }
.queue-item .grow { flex: 1; min-width: 0; }
.queue-item b { color: var(--text-strong); }
.queue-item .msg { color: var(--danger); font-size: .8rem; margin-top: 2px; }
.link-btn { border: 0; background: transparent; color: var(--primary); font-weight: 650; font-size: .82rem; padding: 4px 0; }
.link-btn.danger { color: var(--danger); }

/* ---------- Caméra ---------- */
.camera { position: fixed; inset: 0; background: #000; z-index: 500; display: none; flex-direction: column; }
.camera.open { display: flex; }
.cam-top { display: flex; align-items: center; justify-content: space-between; padding: calc(12px + var(--safe-top)) 12px 12px; color: #fff; position: absolute; top: 0; left: 0; right: 0; z-index: 3;
  background: linear-gradient(rgba(0, 0, 0, .55), transparent); }
.cam-top .name { font-weight: 700; text-align: center; flex: 1; padding: 0 8px; text-shadow: 0 2px 4px rgba(0, 0, 0, .8); text-transform: uppercase; }
.cam-round { width: 48px; height: 48px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .25); background: rgba(255, 255, 255, .14);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); color: #fff; display: flex; align-items: center; justify-content: center; }
.cam-view { flex: 1; position: relative; overflow: hidden; }
.cam-view video { width: 100%; height: 100%; object-fit: cover; }
.cam-overlay { position: absolute; inset: 0; pointer-events: none; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.face-guide { position: relative; box-sizing: border-box; width: 240px; height: 320px; border: 3px dashed rgba(255, 255, 255, .75); border-radius: 22px; box-shadow: 0 0 0 2000px rgba(0, 0, 0, .4); }
/* Ovale de la tête : sommet à 12 % du cadre, tête = la moitié de la hauteur (cadrage d'une photo d'identité) */
.face-guide::after { content: ''; position: absolute; left: 25%; top: 12%; width: 50%; height: 50%; border: 2px solid rgba(255, 255, 255, .55); border-radius: 50%; }
.guide-text { color: #fff; background: rgba(255, 255, 255, .14); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); padding: 6px 15px; border-radius: 20px; font-size: .75rem; text-transform: uppercase; letter-spacing: 1px; margin-top: 15px; }
.cam-bottom { background: rgba(10, 10, 15, .55); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  padding: 18px 20px calc(18px + var(--safe-bottom)); display: flex; justify-content: space-around; align-items: center; }
.shutter { width: 74px; height: 74px; border-radius: 50%; border: 4px solid #fff; background: transparent; padding: 0; display: flex; align-items: center; justify-content: center; }
.shutter i { width: 60px; height: 60px; border-radius: 50%; background: #1d6ff2; display: flex; align-items: center; justify-content: center; color: #fff; }
.shutter:disabled { opacity: .5; }
.flash-ok { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 100px; height: 100px; border-radius: 50%; background: #2ecc71; color: #fff;
  display: none; align-items: center; justify-content: center; animation: pop .5s cubic-bezier(.175, .885, .32, 1.275); }
.flash-ok.show { display: flex; }
.flash-ok .icon { width: 56px; height: 56px; stroke-width: 3; }
@keyframes pop { 0% { transform: translate(-50%, -50%) scale(0); } 70% { transform: translate(-50%, -50%) scale(1.15); } 100% { transform: translate(-50%, -50%) scale(1); } }

/* ---------- Notifications ---------- */
.toast-zone { position: fixed; left: 12px; right: 12px; top: calc(var(--top-h) + var(--safe-top) + 8px); z-index: 900; display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; }
.toast { background: var(--toast); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); color: #fff; padding: 10px 16px; border-radius: 14px; font-size: .88rem;
  box-shadow: 0 8px 20px rgba(0, 0, 0, .25); max-width: 480px; animation: tin .2s; border: 1px solid rgba(255, 255, 255, .08); }
.toast.success { background: rgba(43, 138, 62, .94); }
.toast.error { background: rgba(201, 42, 42, .94); }
.toast.warn { background: rgba(176, 120, 0, .94); }
@keyframes tin { from { transform: translateY(-10px); opacity: 0; } }

/* Navigateurs sans flou : verre plus opaque pour rester lisible */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  :root, [data-theme] { --glass: var(--glass-strong); }
}

/* ---------- Accès établissement ---------- */
.access-item { padding: 10px 0; border-bottom: 1px solid var(--hairline); }
.access-item:last-child { border-bottom: 0; padding-bottom: 0; }
.access-item:first-child { padding-top: 0; }
.access-item b { color: var(--text-strong); }
.warn-text { color: var(--warning); font-weight: 600; }
.field.locked > label::after { content: " 🔒"; font-size: .75rem; }
.field input:disabled, .field select:disabled, .seg input:disabled + span { opacity: .55; }
