/* ──────────────────────────────────────────────────────────────────────────
   speedp — application de terrain (docs/DESIGN.md §5).

   Claire et joyeuse, aux couleurs du web (static/ds/jetons.css, partagé) :
   violet = la marque et l'action ; vert = pointé ; ambre = en attente ;
   le dégradé pour les moments forts (bienvenue, « C'est pointé ! », le mois).

   Faite pour le chantier :
     · fond blanc, texte >= 7:1     au soleil, le clair se lit mieux que le noir
     · cibles de 56 px et plus       un gant ramène la précision du doigt à 20-25 mm
     · aucun flou ni translucidité   ils disparaissent dehors et ralentissent
                                     les téléphones d'entrée de gamme
     · l'action vit en bas           on pointe d'une seule main
     · de 360 × 640 à 430 × 932      encoche et barre du bas respectées
   Seuls le scan et le selfie restent noirs : c'est l'image de la caméra.
   ────────────────────────────────────────────────────────────────────────── */

:root {
  --fond: #ffffff;
  --texte: var(--mauve-12);
  --gris: var(--mauve-11);
  --gris-2: var(--mauve-9);
  --ligne: var(--mauve-5);
  --carte: var(--violet-2);
  --carte-2: var(--violet-3);
  --marque: var(--violet-9);
  --marque-fort: var(--violet-11);
  --degrade-fort: linear-gradient(150deg, var(--violet-9) 0%, #9d3df0 55%, var(--fuchsia-9) 100%);
  --degrade-leger: linear-gradient(170deg, var(--violet-3) 0%, var(--fuchsia-2) 55%, #ffffff 100%);
  --vert: var(--green-9);
  --vert-fond: var(--green-3);
  --vert-texte: var(--green-texte);
  --ambre: var(--amber-9);
  --ambre-fond: var(--amber-3);
  --ambre-texte: var(--amber-texte);
  --rouge: var(--red-11);
  --rouge-fond: var(--red-3);

  --cible: 56px;
  --r: 16px;
  --r-grand: 24px;
  --marge: 20px;
  --haut: env(safe-area-inset-top, 0px);
  --bas: env(safe-area-inset-bottom, 0px);
  --sortie: cubic-bezier(.2, .8, .2, 1);
  --ombre-douce: 0 1px 2px rgb(46 16 101 / .05), 0 8px 24px -12px rgb(46 16 101 / .18);
  --ombre-bouton: 0 14px 32px -14px rgb(124 58 237 / .7);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { height: 100%; background: var(--fond); }
body {
  margin: 0; min-height: 100%; display: flex; flex-direction: column;
  background: var(--fond); color: var(--texte);
  font-family: "Inter", "Plex Arabic", system-ui, -apple-system, sans-serif;
  font-size: 17px; line-height: 1.45; font-feature-settings: "cv11";
  -webkit-font-smoothing: antialiased; overscroll-behavior: none;
  -webkit-user-select: none; user-select: none;
}
[dir="rtl"] body { line-height: 1.6; }
h1, p { margin: 0; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--marque); outline-offset: 3px; border-radius: 10px; }
.nb { font-variant-numeric: tabular-nums; font-feature-settings: "cv11", "tnum"; direction: ltr; unicode-bidi: isolate; }
.ic { width: 24px; height: 24px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ic-20 { width: 20px; height: 20px; } .ic-28 { width: 28px; height: 28px; } .ic-32 { width: 32px; height: 32px; }
[dir="rtl"] .miroir { transform: scaleX(-1); }
/* Les fleches d'arrivee et de depart suivent le sens de lecture. */
[dir="rtl"] .pointer .icone-pointer .ic, [dir="rtl"] .frise .point .ic { transform: scaleX(-1); }
/* Un element masque le reste, quel que soit son display. */
[hidden] { display: none !important; }
.centre { text-align: center; }
.masque-visuel { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); opacity: 0; }

/* ── Écrans ──────────────────────────────────────────────────────────── */
.ecran { display: none; flex: 1; flex-direction: column; min-height: 100dvh;
  padding: calc(var(--haut) + 16px) var(--marge) calc(var(--bas) + 20px); }
.ecran.actif { display: flex; animation: entre .28s var(--sortie) both; }
.ecran--plein { padding: 0; }
.ecran--onglets { padding-bottom: calc(var(--bas) + 88px); }
@keyframes entre { from { opacity: 0; transform: translateY(8px); } }

/* Les écrans de bienvenue : le fond au dégradé doux, comme la connexion web. */
.ecran--marque { background: var(--degrade-leger); background-repeat: no-repeat; background-size: 100% 70%; background-color: #fff; }
.entete-marque { display: flex; flex-direction: column; align-items: center; gap: 10px; margin: 28px 0 22px; }
.entete-marque.petit { margin: 16px 0 18px; }
.tuile-s { width: 76px; height: 76px; border-radius: 22px; display: grid; place-items: center;
  background: linear-gradient(135deg, #ede9fe 0%, #fae8ff 100%); border: 1px solid #fff; animation: respire 3s ease-in-out infinite; }
.entete-marque.petit .tuile-s { width: 60px; height: 60px; border-radius: 18px; }
.tuile-s img { width: 60%; height: 60%; object-fit: contain; }
@keyframes respire {
  0%, 100% { box-shadow: 0 0 0 0 rgb(124 58 237 / .3), 0 10px 26px -10px rgb(124 58 237 / .5); }
  50%      { box-shadow: 0 0 0 10px rgb(124 58 237 / 0), 0 14px 34px -10px rgb(124 58 237 / .6); }
}
.mot-marque { font-size: 28px; font-weight: 700; letter-spacing: -.04em; }
.titre { margin: 8px 0 10px; font-size: 28px; line-height: 1.18; font-weight: 700; letter-spacing: -.02em; font-variation-settings: "opsz" 32; }
.sous-titre-ar { display: inline-block; margin-top: 6px; color: var(--gris); font-weight: 600; font-size: 24px; }
.texte { color: var(--gris); font-size: 17px; }
.form-identifiants { flex: 1; display: flex; flex-direction: column; }
.bas-ecran { margin-top: auto; padding-top: 20px; display: flex; flex-direction: column; gap: 12px; }
/* Ce que speedp enregistre : le bouton reste en bas, visible sans defiler
   (une main, le pouce) ; le texte complet, deplie, en couleur pleine (soleil). */
.bas-ecran--colle { position: sticky; bottom: 0; z-index: 1;
  margin: auto calc(-1 * var(--marge)) calc(-1 * (var(--bas) + 20px)); padding: 24px var(--marge) calc(var(--bas) + 20px);
  background: linear-gradient(to bottom, rgb(255 255 255 / 0), #fff 24px); }
.pour-employeur { margin: 16px 4px 4px; color: var(--texte); font-size: 16px; font-weight: 500; text-align: center; }
.actions-notice { display: flex; justify-content: center; flex-wrap: wrap; gap: 4px 16px; }
.actions-notice .lien-discret { display: inline-flex; align-items: center; gap: 6px; }
#bouton-detail-notice[aria-expanded="true"] .ic { transform: rotate(180deg); }
.notice { margin-top: 8px; padding: 4px 18px 16px; border-radius: 20px; background: #fff; color: var(--texte); font-size: 16px; line-height: 1.45; }
.notice > p { margin: 12px 0 0; }
.notice h2 { margin: 16px 0 6px; font-size: 17px; font-weight: 700; }
.notice ul { margin: 0; padding-inline-start: 20px; display: flex; flex-direction: column; gap: 4px; }

/* Tuiles d'icône : la signature visuelle, reprise partout. */
.tuile-icone { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; flex: none;
  background: linear-gradient(135deg, #f5f3ff 0%, #fdf4ff 100%); color: var(--marque); border: 1px solid var(--violet-4); margin-top: 16px; }
.tuile-icone.petite { width: 44px; height: 44px; border-radius: 13px; margin: 0; }
.tuile-icone .ic { width: 26px; height: 26px; }
.tuile-icone.petite .ic { width: 22px; height: 22px; }

/* ── Langue ──────────────────────────────────────────────────────────── */
.langues { gap: 14px; }
.choix-langue { display: flex; align-items: center; gap: 16px; min-height: 76px; padding: 0 20px; border-radius: 20px;
  background: #fff; border: 1.5px solid var(--violet-4); box-shadow: var(--ombre-douce); font-size: 22px; font-weight: 650; text-align: start;
  transition: transform .12s var(--sortie), border-color .12s; }
.choix-langue:active { transform: scale(.98); border-color: var(--marque); }
.choix-langue .ic { margin-inline-start: auto; color: var(--marque); }
.pastille-langue { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; flex: none;
  background: var(--degrade-fort); color: #fff; font-size: 18px; font-weight: 700; }
.choix-langue[lang="ar"] { font-family: "Plex Arabic", system-ui, sans-serif; }

/* ── Connexion : l'illustration (un écran qui affiche le QR) ──────────── */
.illustration-carte { position: relative; align-self: center; width: 232px; height: 150px; margin: 30px 0 8px; }
.carte-factice { position: absolute; inset: 0; border-radius: 16px; background: #fff; overflow: hidden;
  border: 1.5px solid var(--violet-5); box-shadow: 0 18px 40px -18px rgb(76 29 149 / .45); transform: rotate(-4deg); }
.carte-factice .bande { position: absolute; inset: 0 0 auto 0; height: 10px; background: var(--degrade-fort); }
.carte-factice .lignes { position: absolute; top: 34px; inset-inline-start: 18px; display: flex; flex-direction: column; gap: 9px; }
.carte-factice .lignes i { display: block; height: 9px; border-radius: 5px; background: var(--violet-4); width: 96px; }
.carte-factice .lignes i:nth-child(2) { width: 72px; background: var(--mauve-4); }
.carte-factice .lignes i:nth-child(3) { width: 84px; background: var(--mauve-4); }
.carte-factice .qr-factice { position: absolute; bottom: 16px; inset-inline-end: 16px; width: 64px; height: 64px; border-radius: 12px;
  display: grid; place-items: center; background: var(--violet-3); color: var(--marque); }
.carte-factice .qr-factice .ic { width: 40px; height: 40px; stroke-width: 1.6; }
.rayon-scan { position: absolute; inset-inline: -12px; height: 3px; border-radius: 3px; top: 50%;
  background: linear-gradient(90deg, transparent, var(--fuchsia-8), transparent); animation: balaye-carte 2.4s ease-in-out infinite; }
@keyframes balaye-carte { 0%, 100% { top: 12%; opacity: .2; } 50% { top: 88%; opacity: 1; } }

.alerte-carte { display: flex; gap: 12px; align-items: flex-start; margin-top: 18px; padding: 14px 16px; border-radius: var(--r);
  background: var(--rouge-fond); color: var(--rouge); border: 1px solid var(--red-6); }
.alerte-carte.doux { background: var(--carte-2); color: var(--marque-fort); border-color: var(--violet-5); }
.alerte-carte .ic { margin-top: 1px; }
.alerte-carte b { display: block; font-size: 17px; margin-bottom: 2px; }
.alerte-carte span { font-size: 15px; color: var(--texte); }
.attente { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 18px; }
.tourne { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid var(--violet-5); border-top-color: var(--marque); animation: rotation .7s linear infinite; }
@keyframes rotation { to { transform: rotate(360deg); } }

/* ── Boutons ─────────────────────────────────────────────────────────── */
.bouton { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: var(--cible); padding: 0 20px;
  border-radius: var(--r); border: 0; background: var(--carte-2); color: var(--marque-fort); font-size: 18px; font-weight: 650;
  transition: transform .12s var(--sortie); }
.bouton:active { transform: scale(.98); }
.bouton:disabled { opacity: .5; }
.bouton--plein { background: var(--marque); color: #fff; box-shadow: var(--ombre-bouton); }
.bouton--grand { min-height: 64px; font-size: 20px; border-radius: 20px; }
.bouton--clair { background: #fff; color: #111; }
.bouton--transparent { background: transparent; color: var(--gris); }
.lien-discret { background: none; border: 0; color: var(--marque-fort); font-size: 16px; font-weight: 600; min-height: 48px; padding: 0 8px;
  text-decoration: underline; text-underline-offset: 3px; }
.rond-clair { width: 44px; height: 44px; border-radius: 50%; border: 0; display: grid; place-items: center; background: var(--carte-2); color: var(--marque-fort); }

/* ── Champs ──────────────────────────────────────────────────────────── */
.etiquette { display: block; margin: 12px 0 6px; font-size: 15px; font-weight: 600; color: var(--gris); }
.champ { width: 100%; min-height: var(--cible); padding: 0 16px; border-radius: var(--r); background: #fff;
  border: 2px solid var(--mauve-6); font-size: 18px; -webkit-user-select: text; user-select: text; }
.champ:focus { outline: none; border-color: var(--marque); box-shadow: 0 0 0 4px var(--violet-3); }
.erreur { min-height: 24px; margin: 8px 0; color: var(--rouge); font-size: 16px; font-weight: 600; }
.erreur.info { color: var(--gris); }

/* ── Autorisations ───────────────────────────────────────────────────── */
.autorisation { display: flex; gap: 14px; align-items: flex-start; padding: 16px; border-radius: 20px; background: #fff;
  border: 1px solid var(--violet-4); box-shadow: var(--ombre-douce); margin-top: 12px; }
.autorisation b { display: block; font-size: 18px; margin-bottom: 2px; }
.autorisation span { color: var(--gris); font-size: 16px; }

/* ── Aujourd'hui ─────────────────────────────────────────────────────── */
.haut { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; }
.salut { display: flex; align-items: center; gap: 12px; min-width: 0; }
.s-mini { width: 34px; height: 34px; object-fit: contain; flex: none; }
.bonjour { font-size: 21px; font-weight: 700; letter-spacing: -.015em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.date-jour { font-size: 15px; color: var(--gris); }
.date-jour::first-letter { text-transform: uppercase; }
.avatar { width: 44px; height: 44px; border-radius: 50%; border: 0; flex: none; background: var(--violet-4); color: var(--marque-fort);
  display: grid; place-items: center; font-size: 15px; font-weight: 700; }

.puce-envoi { align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; height: 32px; margin: 14px 0 12px; padding-inline: 10px 14px;
  border-radius: 999px; border: 1px solid var(--green-6); background: var(--vert-fond); color: var(--vert-texte); font-size: 14px; font-weight: 650; }
.puce-envoi i { width: 8px; height: 8px; border-radius: 50%; background: var(--vert); }
.puce-envoi.attente { color: var(--ambre-texte); background: var(--ambre-fond); border-color: var(--amber-6); }
.puce-envoi.attente i { background: var(--ambre); animation: respire-point 1.6s ease-in-out infinite; }
.puce-envoi.hors { color: var(--gris); background: var(--mauve-3); border-color: var(--mauve-6); }
.puce-envoi.hors i { background: var(--gris-2); }
@keyframes respire-point { 50% { opacity: .35; } }

.carte-journee { border-radius: var(--r-grand); background: #fff; border: 1px solid var(--violet-4); box-shadow: var(--ombre-douce); overflow: hidden; }
.chantier { display: flex; align-items: center; gap: 12px; padding: 18px 18px 16px; background: var(--degrade-leger); border-bottom: 1px solid var(--violet-4); }
.chantier-noms { flex: 1; min-width: 0; }
.chantier h1 { font-size: 21px; line-height: 1.2; font-weight: 700; letter-spacing: -.015em; overflow-wrap: anywhere; }
.chantier p { font-size: 15px; color: var(--gris); }
.horloge { display: flex; flex-direction: column; align-items: flex-end; flex: none; }
.libelle-horloge { font-size: 12px; font-weight: 600; color: var(--gris); text-transform: uppercase; letter-spacing: .04em; }
.horloge .heure { font-size: 30px; line-height: 1.05; font-weight: 700; letter-spacing: -.03em; color: var(--marque-fort); font-variation-settings: "opsz" 32; }

.frise { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; padding: 18px; }
.frise .etape { display: flex; align-items: center; gap: 10px; }
.frise .etape.fin { flex-direction: row-reverse; text-align: end; }
.etape-texte { display: flex; flex-direction: column; }
.frise .point { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex: none;
  border: 2px dashed var(--mauve-7); color: var(--gris-2); background: #fff; }
.frise .point .ic { width: 20px; height: 20px; }
.frise .point.fait { border: 0; background: var(--vert); color: #fff; box-shadow: 0 6px 14px -6px rgb(48 164 108 / .7); }
.frise .ligne { height: 3px; border-radius: 3px; background: repeating-linear-gradient(90deg, var(--mauve-6) 0 6px, transparent 6px 11px); }
.frise .ligne.faite { background: linear-gradient(90deg, var(--vert), var(--green-6)); }
[dir="rtl"] .frise .ligne.faite { background: linear-gradient(-90deg, var(--vert), var(--green-6)); }
.frise .libelle { font-size: 13px; font-weight: 600; color: var(--gris); }
.frise .valeur { font-size: 20px; font-weight: 700; }
.frise .valeur.vide { color: var(--gris-2); font-weight: 500; font-size: 15px; }
.bandeau-hors-ligne { display: flex; align-items: center; gap: 10px; margin: 0 18px 16px; padding: 10px 12px; border-radius: 12px;
  background: var(--mauve-3); color: var(--gris); font-size: 14px; }
.bandeau-hors-ligne .ic { width: 20px; height: 20px; }

#zone-action { margin-top: auto; padding-top: 18px; }
.pointer { display: flex; align-items: center; gap: 16px; width: 100%; min-height: 104px; padding: 18px 22px; border: 0; border-radius: var(--r-grand);
  background: var(--marque); color: #fff; box-shadow: var(--ombre-bouton); text-align: start; transition: transform .12s var(--sortie); }
.pointer:active { transform: scale(.975); }
.pointer .icone-pointer { width: 60px; height: 60px; border-radius: 18px; display: grid; place-items: center; flex: none; background: rgb(255 255 255 / .16); }
.pointer .icone-pointer .ic { width: 32px; height: 32px; stroke-width: 2.2; }
.pointer b { display: block; font-size: 24px; line-height: 1.15; font-weight: 750; letter-spacing: -.01em; }
.pointer small { display: block; margin-top: 3px; font-size: 15px; opacity: .88; }
.calme { display: flex; align-items: center; gap: 14px; min-height: 96px; padding: 18px 20px; border-radius: var(--r-grand);
  background: var(--vert-fond); border: 1px solid var(--green-6); }
.calme .rond-ok { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--vert); color: #fff; }
.calme b { display: block; font-size: 20px; font-weight: 700; color: var(--green-12); }
.calme span { color: var(--vert-texte); font-size: 15px; }
.calme.neutre { background: var(--carte); border-color: var(--violet-4); }
.calme.neutre .rond-ok { background: var(--carte-2); color: var(--marque); }
.calme.neutre b { color: var(--texte); } .calme.neutre span { color: var(--gris); }

/* Invitation à installer l'application : le texte en haut, le bouton en entier dessous. */
.installer { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 4px 12px; margin-top: 14px;
  padding: 14px 10px 14px 14px; border-radius: var(--r); background: var(--carte); border: 1px solid var(--violet-4); }
.installer .tuile-icone { margin: 0; }
.installer div { min-width: 0; }
.installer b { display: block; font-size: 16px; }
.installer span { font-size: 14px; color: var(--gris); }
.installer .bouton { grid-column: 1 / -1; margin-top: 10px; min-height: 48px; font-size: 16px; }
.installer .fermer-installer { grid-column: 3; grid-row: 1; width: 40px; height: 40px; border: 0; background: none; color: var(--gris-2); display: grid; place-items: center; align-self: start; }

/* ── Barre d'onglets ─────────────────────────────────────────────────── */
.onglets { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: none; justify-content: space-around; gap: 8px;
  height: calc(72px + var(--bas)); padding: 8px 16px var(--bas); background: #fff; border-top: 1px solid var(--mauve-5); }
.onglets.visible { display: flex; }
.onglets button { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  border: 0; border-radius: 16px; background: none; color: var(--gris-2); font-size: 13px; font-weight: 650; }
.onglets button[aria-current="page"] { color: var(--marque); background: var(--carte-2); }

/* ── Caméra : scan et selfie ─────────────────────────────────────────── */
.camera { position: relative; flex: 1; background: #000; color: #fff; overflow: hidden; min-height: 100dvh; }
.camera video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.camera .consigne { position: absolute; top: 0; left: 0; right: 0; z-index: 3; display: flex; flex-direction: column; gap: 4px; align-items: center;
  text-align: center; padding: calc(var(--haut) + 22px) var(--marge) 34px; font-size: 21px; font-weight: 700;
  background: linear-gradient(#000 0%, rgb(0 0 0 / .8) 55%, transparent); }
.camera .consigne small { font-size: 15px; font-weight: 500; opacity: .85; }
.viseur { position: absolute; inset: 0; z-index: 2; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.viseur .cadre { position: relative; width: min(72vw, 320px); aspect-ratio: 1; border-radius: 28px;
  box-shadow: 0 0 0 100vmax rgb(0 0 0 / .6); transition: background .2s; }
.viseur .coin { position: absolute; width: 52px; height: 52px; border: 5px solid #fff; transition: border-color .2s; }
.viseur .c1 { top: -3px; left: -3px; border-right: 0; border-bottom: 0; border-radius: 26px 0 0 0; }
.viseur .c2 { top: -3px; right: -3px; border-left: 0; border-bottom: 0; border-radius: 0 26px 0 0; }
.viseur .c3 { bottom: -3px; left: -3px; border-right: 0; border-top: 0; border-radius: 0 0 0 26px; }
.viseur .c4 { bottom: -3px; right: -3px; border-left: 0; border-top: 0; border-radius: 0 0 26px 0; }
.viseur .trait { position: absolute; left: 10%; right: 10%; height: 3px; border-radius: 3px;
  background: linear-gradient(90deg, transparent, var(--violet-7), transparent); animation: balaye 2.2s ease-in-out infinite; }
@keyframes balaye { 0%, 100% { top: 10%; } 50% { top: 88%; } }
.viseur .lu-ok { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) scale(.8); opacity: 0;
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 999px; background: #fff; color: var(--green-11);
  font-size: 17px; font-weight: 700; white-space: nowrap; transition: opacity .15s, transform .2s var(--sortie); }
.viseur .cadre.lu { background: rgb(48 164 108 / .35); }
.viseur .cadre.lu .coin { border-color: var(--green-8); }
.viseur .cadre.lu .trait { display: none; }
.viseur .cadre.lu .lu-ok { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.indice { position: absolute; z-index: 4; left: 50%; transform: translateX(-50%); bottom: calc(var(--bas) + 250px);
  padding: 10px 16px; border-radius: 999px; background: #fff; color: #111; font-size: 16px; font-weight: 650; white-space: nowrap;
  animation: entre .3s var(--sortie); }
.camera .bas { position: absolute; left: 0; right: 0; bottom: 0; z-index: 3;
  padding: 24px var(--marge) calc(var(--bas) + 20px); display: flex; flex-direction: column; gap: 12px;
  background: linear-gradient(transparent, rgb(0 0 0 / .85) 30%, #000); }
.rangee { display: flex; gap: 28px; justify-content: center; }
.rond-legende { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; opacity: .9; }
.rond { width: 60px; height: 60px; border-radius: 50%; border: 0; display: grid; place-items: center; background: rgb(255 255 255 / .18); color: #fff; }
.rond[aria-pressed="true"] { background: #fff; color: #111; }
.camera .bouton--transparent { color: #fff; }

/* Selfie : ovale et anneau */
.ovale { position: absolute; inset: 0; z-index: 2; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.ovale svg { width: 100%; height: 100%; }
.ovale .masque { fill: rgb(0 0 0 / .62); }
.ovale .anneau-fond { fill: none; stroke: rgb(255 255 255 / .28); stroke-width: 6; }
.ovale .anneau { fill: none; stroke: var(--violet-7); stroke-width: 6; stroke-linecap: round; }
.rebours { position: absolute; z-index: 4; left: 0; right: 0; bottom: calc(var(--bas) + 56px); text-align: center;
  font-size: 68px; font-weight: 800; text-shadow: 0 4px 20px rgb(0 0 0 / .8); }
.eclair { position: absolute; inset: 0; z-index: 9; background: #fff; animation: eclair .35s ease-out forwards; pointer-events: none; }
@keyframes eclair { from { opacity: .9; } to { opacity: 0; } }

/* ── Code à six chiffres : le clavier de l'application ───────────────── */
.ecran--code .texte { margin-bottom: 20px; }
.cases-code { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.cases-code i { aspect-ratio: .82; border-radius: 14px; display: grid; place-items: center; font-style: normal;
  font-size: 30px; font-weight: 700; background: var(--carte); border: 2px solid var(--mauve-6); transition: border-color .12s, transform .12s; }
.cases-code i.pleine { border-color: var(--marque); background: #fff; color: var(--marque-fort); }
.cases-code i.courante { border-color: var(--marque); box-shadow: 0 0 0 4px var(--violet-3); }
.cases-code.secoue { animation: secoue .4s; }
@keyframes secoue { 20% { transform: translateX(-6px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(4px); } }
.clavier { margin-top: auto; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.clavier button { min-height: 62px; border-radius: 18px; border: 0; background: var(--carte); font-size: 28px; font-weight: 650;
  font-variant-numeric: tabular-nums; transition: transform .08s, background .08s; }
.clavier button:active { transform: scale(.96); background: var(--carte-2); }
.clavier .touche-action { color: var(--gris); display: grid; place-items: center; }
.clavier .touche-valider { background: var(--marque); color: #fff; display: grid; place-items: center; box-shadow: var(--ombre-bouton); }
.clavier .touche-valider:disabled { background: var(--mauve-5); color: var(--gris-2); box-shadow: none; }
.clavier .ic { width: 28px; height: 28px; }

/* ── Confirmation : le moment joyeux ─────────────────────────────────── */
.confirmation { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  padding: calc(var(--haut) + 24px) var(--marge) calc(var(--bas) + 40px); text-align: center;
  background: var(--degrade-fort); color: #fff; min-height: 100dvh; position: relative; overflow: hidden; }
.confirmation::before, .confirmation::after { content: ""; position: absolute; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgb(255 255 255 / .28), transparent 65%); }
.confirmation::before { width: 320px; height: 320px; top: -80px; inset-inline-start: -100px; animation: flotte 6s ease-in-out infinite; }
.confirmation::after { width: 260px; height: 260px; bottom: -60px; inset-inline-end: -80px; animation: flotte 7s ease-in-out infinite reverse; }
@keyframes flotte { 50% { transform: translate(18px, 22px) scale(1.06); } }
.confirmation > * { position: relative; z-index: 1; }
.confirmation svg.coche { width: 104px; height: 104px; margin-bottom: 14px; border-radius: 50%; background: rgb(255 255 255 / .16);
  animation: pop .45s var(--sortie); }
@keyframes pop { from { transform: scale(.6); opacity: 0; } }
.confirmation svg.coche * { fill: none; stroke: #fff; stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }
.confirmation svg.coche circle { stroke-dasharray: 251; stroke-dashoffset: 251; animation: trace .5s var(--sortie) .1s forwards; }
.confirmation svg.coche path { stroke-dasharray: 60; stroke-dashoffset: 60; animation: trace .35s var(--sortie) .45s forwards; }
@keyframes trace { to { stroke-dashoffset: 0; } }
.confirmation .quoi { font-size: 24px; font-weight: 700; }
.confirmation .heure { font-size: clamp(88px, 28vw, 120px); line-height: .95; font-weight: 750; letter-spacing: -.035em; font-variation-settings: "opsz" 32; }
.confirmation .site { font-size: 18px; font-weight: 600; opacity: .92; }
.confirmation .mot { margin-top: 18px; font-size: 19px; font-weight: 650; }
.confirmation .note { display: inline-flex; align-items: center; gap: 8px; margin-top: 16px; padding: 8px 16px; border-radius: 999px;
  background: rgb(255 255 255 / .2); font-size: 15px; font-weight: 600; }
.confirmation .note .ic { width: 18px; height: 18px; }
.confirmation .progres { position: absolute; z-index: 1; left: 0; bottom: 0; height: 5px; background: rgb(255 255 255 / .55); animation: vide 3s linear forwards; }
@keyframes vide { from { width: 100%; } to { width: 0; } }

/* ── Mes jours ───────────────────────────────────────────────────────── */
.carte-mois { position: relative; overflow: hidden; margin-top: 4px; padding: 16px 16px 20px; border-radius: var(--r-grand);
  background: var(--degrade-fort); color: #fff; box-shadow: var(--ombre-bouton); }
.carte-mois::after { content: ""; position: absolute; width: 220px; height: 220px; border-radius: 50%; top: -90px; inset-inline-end: -70px;
  background: radial-gradient(circle, rgb(255 255 255 / .25), transparent 65%); }
.mois-nav { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; }
.mois-nav h1 { font-size: 20px; font-weight: 700; }
.mois-nav button { width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgb(255 255 255 / .18); color: #fff; display: grid; place-items: center; }
.mois-nav button:disabled { opacity: .35; }
.total-jours { position: relative; z-index: 1; margin-top: 10px; display: flex; align-items: baseline; justify-content: center; gap: 10px; }
.total-jours b { font-size: 60px; line-height: 1; font-weight: 800; letter-spacing: -.04em; }
.total-jours span { font-size: 18px; font-weight: 600; opacity: .92; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-top: 18px; touch-action: pan-y; }
.cal .js { text-align: center; font-size: 13px; font-weight: 650; color: var(--gris-2); padding-bottom: 2px; }
.cal .j { aspect-ratio: 1; border-radius: 14px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font-size: 16px; font-weight: 650; color: var(--gris); background: var(--mauve-2); }
.cal .j i { width: 6px; height: 6px; border-radius: 50%; background: transparent; }
.cal .j.pointe { background: var(--vert-fond); color: var(--vert-texte); }
.cal .j.pointe i { background: var(--vert); }
.cal .j.partiel { background: var(--ambre-fond); color: var(--ambre-texte); }
.cal .j.partiel i { background: var(--ambre); }
.cal .j.auj { box-shadow: inset 0 0 0 2.5px var(--marque); color: var(--marque-fort); }
.cal .j.futur { color: var(--mauve-7); background: transparent; }
.cal .j.vide { background: transparent; }
.cal.glisse-g { animation: glisse-g .25s var(--sortie); }
.cal.glisse-d { animation: glisse-d .25s var(--sortie); }
@keyframes glisse-g { from { transform: translateX(24px); opacity: .3; } }
@keyframes glisse-d { from { transform: translateX(-24px); opacity: .3; } }
#mois-vide { margin-top: 14px; }
.legende-jours { display: flex; justify-content: center; gap: 20px; margin-top: 16px; color: var(--gris); font-size: 14px; }
.legende-jours > span { display: inline-flex; align-items: center; gap: 8px; }
.legende-jours i { width: 10px; height: 10px; border-radius: 50%; }
.leg-complet { background: var(--vert); } .leg-partiel { background: var(--ambre); }

/* ── Feuille (profil) ────────────────────────────────────────────────── */
.voile { position: fixed; inset: 0; z-index: 40; background: rgb(46 16 101 / .35); animation: fondu .2s; }
@keyframes fondu { from { opacity: 0; } }
.feuille { position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; padding: 10px var(--marge) calc(var(--bas) + 18px);
  background: #fff; border-radius: 28px 28px 0 0; box-shadow: 0 -12px 40px -12px rgb(46 16 101 / .25);
  animation: monte .28s var(--sortie); display: flex; flex-direction: column; gap: 8px; }
.feuille .poignee { width: 40px; height: 5px; border-radius: 3px; background: var(--mauve-6); align-self: center; margin-bottom: 10px; }
.feuille .qui { display: flex; align-items: center; gap: 14px; padding: 4px 4px 14px; border-bottom: 1px solid var(--mauve-4); margin-bottom: 6px; }
.feuille .qui .avatar { width: 56px; height: 56px; font-size: 19px; }
.feuille .qui b { display: block; font-size: 20px; }
.feuille .qui span { font-size: 15px; color: var(--gris); }
.ligne-feuille { display: flex; align-items: center; gap: 14px; min-height: 60px; padding: 0 14px; border: 0; border-radius: var(--r);
  background: var(--carte); font-size: 17px; font-weight: 600; text-align: start; }
.ligne-feuille .ic { color: var(--marque); }
.ligne-feuille .valeur-ligne { margin-inline-start: auto; color: var(--gris); font-weight: 500; font-size: 15px; }
.ligne-feuille.danger { color: var(--rouge); background: var(--rouge-fond); }
.ligne-feuille.danger .ic { color: var(--rouge); }
.version { text-align: center; font-size: 13px; color: var(--gris-2); margin-top: 6px; }
.etapes-ios { display: flex; flex-direction: column; gap: 12px; margin: 6px 0 10px; }
.etapes-ios div { display: flex; align-items: center; gap: 12px; font-size: 16px; }
.etapes-ios .num { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--marque); color: #fff; font-weight: 700; font-size: 15px; }
.carte-etapes { margin-top: 18px; padding: 18px 16px; border-radius: 20px; background: #fff; border: 1px solid var(--violet-4); box-shadow: var(--ombre-douce); }
@keyframes monte { from { transform: translateY(100%); } }

/* ── Petits écrans (360 × 640) ───────────────────────────────────────── */
@media (max-height: 700px) {
  .entete-marque { margin: 12px 0 14px; }
  .titre { font-size: 24px; }
  .illustration-carte { width: 200px; height: 128px; margin: 18px 0 4px; }
  .pointer { min-height: 92px; padding: 14px 18px; }
  .pointer .icone-pointer { width: 52px; height: 52px; }
  .frise { padding: 14px 16px; }
  .carte-mois { padding: 12px 14px 14px; }
  .total-jours b { font-size: 48px; }
  .clavier button { min-height: 54px; }
}
@media (max-width: 370px) {
  :root { --marge: 16px; }
  .horloge .heure { font-size: 26px; }
  .chantier h1 { font-size: 19px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .viseur .trait, .rayon-scan { display: none; }
  .confirmation svg.coche * { stroke-dashoffset: 0; }
}

/* ═══ La photo de référence (première connexion) ═══ */
.apercu-reference { position: relative; width: 196px; height: 196px; margin: 20px auto 4px; border-radius: 50%;
  display: grid; place-items: center; overflow: hidden;
  background: var(--degrade-doux); box-shadow: 0 0 0 6px var(--violet-3), 0 0 0 7px var(--violet-6); }
.apercu-reference img { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.apercu-reference .silhouette { color: var(--marque); }
.apercu-reference .silhouette .ic { width: 72px; height: 72px; stroke-width: 1.5; }
.centre.erreur { text-align: center; }

/* L'écran de l'agence ou de l'employeur, qui affiche le QR de connexion. */
.ecran-factice { transform: none; inset: 0 12px 22px; border-radius: 12px; border-width: 5px; border-color: var(--mauve-12); }
.ecran-factice .bande { height: 16px; display: flex; align-items: center; gap: 4px; padding-inline: 8px; background: var(--violet-3); }
.ecran-factice .bande i { width: 5px; height: 5px; border-radius: 50%; background: var(--violet-7); }
.ecran-factice .qr-factice { inset: auto; bottom: auto; top: 50%; left: 50%; transform: translate(-50%, -38%);
  width: 70px; height: 70px; background: #fff; border: 1.5px solid var(--violet-5); }
.ecran-factice .qr-factice .ic { width: 50px; height: 50px; }
.pied-ecran { position: absolute; left: 50%; bottom: 0; transform: translateX(-50%); width: 76px; height: 22px; }
.pied-ecran::before { content: ""; position: absolute; left: 50%; top: 0; transform: translateX(-50%); width: 16px; height: 16px; background: var(--mauve-11); }
.pied-ecran::after { content: ""; position: absolute; inset: auto 0 0 0; height: 6px; border-radius: 3px; background: var(--mauve-12); }

/* ═══ Pointer un collègue : un bandeau fuchsia dit qu'on n'est plus chez soi ═══ */
.bandeau-collegue { display: flex; align-items: center; gap: 10px; margin: 0 -20px 20px; padding: 12px 20px;
  background: var(--degrade-fort); color: #fff; font-size: 16px; font-weight: 700; }
.bandeau-collegue .fermer-collegue { margin-inline-start: auto; width: 40px; height: 40px; border: 0; border-radius: 50%;
  display: grid; place-items: center; background: rgb(255 255 255 / .2); color: #fff; }
.bandeau-collegue.sur-camera { position: absolute; top: 0; left: 0; right: 0; z-index: 4; margin: 0; padding-top: calc(12px + env(safe-area-inset-top)); }
.ecran--collegue { padding-top: env(safe-area-inset-top); }
.ecran--collegue .bandeau-collegue { margin-top: 0; }
/* « Qui pointe ? » : la liste du jour, un nom par ligne, de grandes cibles. */
.recherche-choix { position: relative; display: block; margin: 4px 0 12px; }
.recherche-choix .ic { position: absolute; inset-inline-start: 16px; top: 50%; transform: translateY(-50%); color: var(--gris-2); }
.recherche-choix .champ { padding-inline-start: 48px; }
.liste-choix { list-style: none; margin: 0 -4px; padding: 0 0 calc(24px + var(--bas)); display: flex; flex-direction: column; gap: 8px; }
.liste-choix button { width: 100%; min-height: 64px; display: flex; align-items: center; gap: 14px; padding: 10px 14px;
  border: 1.5px solid var(--ligne); border-radius: var(--r); background: #fff; text-align: start; color: var(--texte); }
.liste-choix button:active { background: var(--carte); border-color: var(--marque); }
.liste-choix .initiales, .liste-choix img { flex: none; width: 44px; height: 44px; border-radius: 50%; }
.liste-choix .initiales { display: grid; place-items: center; background: var(--carte-2); color: var(--marque-fort); font-weight: 700; }
.liste-choix img { object-fit: cover; background: var(--carte-2); }
.liste-choix .nom-choix { flex: 1; min-width: 0; font-size: 18px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.liste-choix .badge-choix { flex: none; font-size: 13px; font-weight: 600; padding: 4px 8px; border-radius: 999px;
  background: var(--ambre-fond); color: var(--ambre-texte); }
.texte-vide { margin: 24px 0; text-align: center; color: var(--gris); font-size: 16px; }
.langue-choix { margin-inline-start: auto; min-height: 36px; padding: 0 12px; border: 0; border-radius: 999px;
  background: rgb(255 255 255 / .2); color: #fff; font-weight: 700; }
.langue-choix + .fermer-collegue { margin-inline-start: 8px; }
.lien-collegue { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; margin-top: 12px; }

/* Un telephone de la demo le dit, en permanence (retour de terrain du 28/09/2026). */
.bandeau-demo { display: flex; align-items: center; gap: 10px; margin: 0 18px 12px; padding: 10px 12px; border-radius: 12px;
  background: #fff4d6; color: #6b4e00; border: 1px solid #f0d58a; font-size: 14px; }
.bandeau-demo b { flex: none; padding: 2px 8px; border-radius: 999px; background: #6b4e00; color: #fff; font-size: 12px;
  letter-spacing: .04em; text-transform: uppercase; }
.bandeau-demo[hidden] { display: none; }
/* L'alerte d'un QR qui n'est pas le bon : la feuille du bas, boutons empiles. */
.feuille-alerte { display: flex; flex-direction: column; gap: 10px; }
.feuille-alerte .alerte-carte { margin-top: 0; }

/* Sous l'ovale du selfie : le salarie sait que sa photo est comparee a sa reference. */
.info-visage { position: absolute; left: 16px; right: 16px; bottom: calc(var(--bas, 0px) + 28px); text-align: center;
  color: #fff; font-size: 14px; opacity: .85; text-shadow: 0 1px 3px rgb(0 0 0 / .6); }
.info-visage[hidden] { display: none; }

/* ── Le scan du visage de reference (30/09/2026) ─────────────────────── */
/* L'avancement : quatre points, « Photo 2 sur 4 ». */
.scan-etapes { position: absolute; z-index: 4; left: 0; right: 0; top: calc(var(--haut) + 104px); display: flex; gap: 8px;
  align-items: center; justify-content: center; font-size: 14px; font-weight: 600; text-shadow: 0 1px 3px rgb(0 0 0 / .7); }
.scan-etapes[hidden] { display: none; }
.scan-etapes i { width: 10px; height: 10px; border-radius: 50%; background: rgb(255 255 255 / .35); }
.scan-etapes i.courante { background: #fff; box-shadow: 0 0 0 3px rgb(255 255 255 / .35); }
.scan-etapes i.faite { background: var(--vert, #2fb86d); }
.scan-etapes span { margin-inline-start: 6px; }
/* Le sens a tourner : une grande fleche qui glisse, toujours dans le sens de
   l'ecran (jamais retournee par l'arabe). */
.scan-fleche { position: absolute; z-index: 4; left: 50%; bottom: calc(var(--bas, 0px) + 150px); translate: -50% 0;
  display: flex; justify-content: center; padding: 10px 22px; border-radius: 999px; background: rgb(0 0 0 / .55);
  pointer-events: none; direction: ltr; }
.scan-fleche[hidden] { display: none; }
.scan-fleche svg { width: 84px; height: 42px; fill: none; stroke: #fff; stroke-width: 11; stroke-linecap: round; stroke-linejoin: round;
  animation: glisse 1.1s ease-in-out infinite; }
.scan-fleche svg + svg { animation-delay: .18s; opacity: .6; }
.scan-fleche.vers-gauche { transform: scaleX(-1); }
@keyframes glisse { 0% { transform: translateX(-14px); opacity: .2; } 50% { opacity: 1; } 100% { transform: translateX(14px); opacity: .2; } }
@media (prefers-reduced-motion: reduce) { .scan-fleche svg { animation: none; } }
/* Le guidage en direct : ce qu'il faut faire, maintenant. */
.scan-retour { position: absolute; z-index: 5; left: 16px; right: 16px; bottom: calc(var(--bas, 0px) + 92px); text-align: center;
  font-size: 22px; font-weight: 800; color: #fff; text-shadow: 0 2px 12px rgb(0 0 0 / .9); }
.scan-retour[hidden] { display: none; }
/* La coche apres chaque photo. */
.scan-coche { position: absolute; z-index: 6; inset: 0; display: grid; place-items: center; pointer-events: none; }
.scan-coche[hidden] { display: none; }
.scan-coche svg { width: 120px; height: 120px; fill: rgb(0 0 0 / .35); stroke: #fff; stroke-width: 7; stroke-linecap: round; stroke-linejoin: round; }
.scan-coche.vu svg { animation: coche .45s ease-out; }
@keyframes coche { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
