/* Pointage Splash Park : mobile d'abord, utilisable a une main. */
:root {
    --primaire: #0EA5E9;
    --primaire-fonce: #0284C7;
    --fond: #F4F9FF;
    --surface: #FFFFFF;
    --texte: #0F172A;
    --texte-2: #64748B;
    --bordure: #D6E4F0;
    --erreur: #B91C1C;
    --erreur-fond: #FEF2F2;
    --rayon: 16px;
    --police: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }

body {
    font-family: var(--police);
    font-size: 17px;
    line-height: 1.45;
    color: var(--texte);
    background: var(--fond);
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

[hidden] { display: none !important; }

.vue {
    flex: 1;
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    padding: 24px 20px 28px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.vue-centre { align-items: center; justify-content: center; text-align: center; }

h1 { margin: 8px 0 4px; font-size: 28px; line-height: 1.15; }

.logo { width: 96px; height: 96px; }
.logo-petit { width: 40px; height: 40px; border-radius: 10px; }

.entete-centre { text-align: center; padding-top: 12px; }
.entete-barre { display: flex; align-items: center; gap: 12px; }
.entete-texte { display: flex; flex-direction: column; min-width: 0; }
.entete-texte strong { font-size: 19px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.muet { color: var(--texte-2); margin: 0; }
.petit { font-size: 14px; }

.carte {
    background: var(--surface);
    border: 1px solid var(--bordure);
    border-radius: var(--rayon);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}

label { font-weight: 600; font-size: 15px; margin-top: 6px; }

input {
    width: 100%;
    min-height: 54px;
    padding: 12px 14px;
    font: inherit;
    font-size: 18px;               /* >= 16px : evite le zoom automatique sur iPhone */
    color: var(--texte);
    background: #fff;
    border: 1.5px solid var(--bordure);
    border-radius: 12px;
}
input:focus { outline: 3px solid rgba(14, 165, 233, .35); border-color: var(--primaire); }

.bouton {
    width: 100%;
    min-height: 56px;
    margin-top: 12px;
    padding: 14px 18px;
    font: inherit;
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    background: var(--primaire);
    border: 0;
    border-radius: 14px;
    cursor: pointer;
}
.bouton:active { background: var(--primaire-fonce); }
.bouton:disabled { opacity: .6; cursor: default; }
.bouton-secondaire { color: var(--primaire-fonce); background: #E0F2FE; }
.bouton-secondaire:active { background: #BAE6FD; }

.message { margin: 6px 0 0; padding: 10px 12px; border-radius: 10px; font-size: 15px; }
.message.erreur { color: var(--erreur); background: var(--erreur-fond); }

.pied { margin-top: auto; }

.installation {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    padding: 0 20px 24px;
}
.installation .bouton { margin-top: 0; }

h2 { margin: 0 0 4px; font-size: 22px; line-height: 1.2; }

/* ---- Scan ---- */
.vue.vue-scan { max-width: none; padding: 0; gap: 0; background: #0B1220; color: #fff; }
.scan-zone { position: relative; flex: 1; min-height: 0; overflow: hidden; background: #000; }
.scan-zone video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.scan-cadre {
    position: absolute; top: 50%; left: 50%;
    width: min(68vw, 320px); aspect-ratio: 1;
    transform: translate(-50%, -50%);
    border: 3px solid rgba(255, 255, 255, .92);
    border-radius: 22px;
    box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .45);
}
.scan-bas { padding: 16px 20px 20px; display: flex; flex-direction: column; gap: 6px; background: #0B1220; }
.scan-statut { margin: 0; font-size: 18px; font-weight: 600; text-align: center; }
.scan-gps { margin: 0; font-size: 15px; text-align: center; color: #94A3B8; }
.scan-gps.ok { color: #4ADE80; }
.scan-gps.mauvais { color: #FBBF24; }
.bouton-clair { color: #fff; background: rgba(255, 255, 255, .16); }
.bouton-clair:active { background: rgba(255, 255, 255, .28); }

/* ---- Resultat ---- */
.resultat-icone {
    width: 104px; height: 104px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: #fff; background: var(--texte-2);
}
.resultat-icone.ok { background: #16A34A; }
.resultat-icone.info { background: var(--primaire); }
.resultat-icone.erreur { background: #DC2626; }
.resultat-icone.attente svg { animation: tourner 1s linear infinite; }
@keyframes tourner { to { transform: rotate(360deg); } }
.resultat-message { margin: 0; font-size: 18px; max-width: 24em; }
.resultat-actions { width: 100%; margin-top: auto; }
.resultat-actions .bouton { margin-top: 10px; }
@media (prefers-reduced-motion: reduce) { .resultat-icone.attente svg { animation: none; } }
