/* Interface pour personnes déficientes visuelles : fort contraste, grandes cibles, aucun plan */
:root { --bg: #000; --fg: #fff; --accent: #ffd500; --muted: #d0d0d0; --line: #fff; }
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--fg); }
body { font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; font-size: 22px; line-height: 1.35; -webkit-text-size-adjust: 100%; }
main { max-width: 640px; margin: 0 auto; padding: 16px 16px calc(24px + env(safe-area-inset-bottom)); min-height: 100vh; display: flex; flex-direction: column; }
.sr-only { position: absolute; top: 0; left: 0; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
h1 { font-size: 26px; margin: 4px 0 16px; }
:focus-visible { outline: 5px solid var(--accent); outline-offset: 3px; }
button { font: inherit; color: inherit; cursor: pointer; }

/* Saisie */
.field { margin-bottom: 22px; }
.field label { display: block; font-size: 26px; font-weight: 700; margin-bottom: 8px; }
.field input { width: 100%; min-height: 84px; font-size: 30px; font-weight: 600; padding: 12px 18px; color: var(--fg); background: #111; border: 4px solid var(--line); border-radius: 14px; }
.field input::placeholder { color: #9a9a9a; font-weight: 400; }
.field.chosen input { border-color: var(--accent); color: var(--accent); }
.results { list-style: none; margin: 8px 0 0; padding: 0; }
.results li + li { margin-top: 8px; }
.results button { width: 100%; min-height: 76px; text-align: left; font-size: 26px; font-weight: 600; padding: 12px 18px; background: #1c1c1c; border: 3px solid #777; border-radius: 12px; }
.results button:hover, .results button:focus-visible { border-color: var(--accent); background: #262200; }
.results .none { font-size: 22px; color: var(--muted); padding: 8px 4px; }

.check { display: flex; align-items: center; gap: 16px; min-height: 76px; font-size: 24px; font-weight: 600; margin: 4px 0 22px; }
.check input { width: 44px; height: 44px; accent-color: var(--accent); flex: none; }

.primary { display: block; width: 100%; min-height: 110px; font-size: 34px; font-weight: 800; color: #000; background: var(--accent); border: 0; border-radius: 18px; }
.primary:disabled { background: #555; color: #bbb; }
.secondary { min-height: 80px; font-size: 26px; font-weight: 700; background: #1c1c1c; border: 3px solid var(--line); border-radius: 14px; }
.link { background: none; border: 0; text-decoration: underline; font-size: 22px; color: var(--muted); min-height: 56px; margin-top: 12px; }
.error { color: #ff8a80; font-size: 24px; font-weight: 700; min-height: 1.2em; margin: 12px 0 0; }

/* Guidage */
.guide { flex: 1; display: flex; flex-direction: column; }
.count { font-size: 24px; font-weight: 700; color: var(--muted); margin: 0; text-align: center; }
.picto { display: flex; justify-content: center; align-items: center; margin: 8px 0; }
.picto svg { width: min(70vw, 34vh, 320px); height: auto; color: var(--accent); }
.instruction { font-size: 30px; font-weight: 800; line-height: 1.25; text-align: center; margin: 0 0 20px; }
.guide .spacer { flex: 1; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.guide .primary { min-height: 130px; font-size: 40px; }

/* Accueil, choix de lieu, récapitulatif */
.brand { text-align: center; margin: 8px 0 18px; }
.brand img { display: block; width: 120px; height: 120px; margin: 0 auto 10px; }
.brand-title { font-size: 34px; font-weight: 800; margin: 0; }
main > .count { text-align: left; margin-bottom: 4px; }
.back { align-self: flex-start; min-height: 64px; padding: 0 22px; font-size: 24px; font-weight: 700; background: #1c1c1c; border: 3px solid var(--line); border-radius: 12px; margin: 4px 0 8px; }
.back::before { content: "← "; }
.hint { font-size: 22px; color: var(--muted); margin: 0 0 10px; }
.results .cat { display: flex; justify-content: space-between; align-items: center; gap: 12px; border-color: var(--line); }
.results .cat small { font-size: 20px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.results .cat::after { content: "›"; font-size: 40px; line-height: 1; color: var(--accent); }
.results .sub { font-size: 22px; font-weight: 700; color: var(--muted); padding: 14px 4px 2px; }
/* Récapitulatif compact : intitulé et lieu à gauche, Modifier à droite, tout tient sans défiler */
.recap { display: grid; grid-template-columns: 1fr auto; align-items: center; column-gap: 12px; border: 3px solid #555; border-radius: 14px; padding: 10px 12px 10px 16px; margin-bottom: 12px; }
.recap-label { grid-column: 1; font-size: 20px; color: var(--muted); margin: 0; }
.recap-value { grid-column: 1; font-size: 26px; font-weight: 800; line-height: 1.2; color: var(--accent); margin: 2px 0 0; }
.recap .secondary { grid-column: 2; grid-row: 1 / span 2; min-height: 64px; padding: 0 16px; font-size: 22px; }
.recap-screen h1 { margin-bottom: 12px; }
.recap-screen .check { min-height: 64px; margin: 4px 0 8px; }
.recap-screen .primary { min-height: 100px; }
.error:empty { display: none; }
main .spacer { flex: 1; min-height: 12px; }

/* Page d'accueil : logo et choix de la langue */
.home { justify-content: flex-start; }
.home .brand { margin-top: 24px; }
.home .brand img { width: 140px; height: 140px; }
.brand-site { font-size: 22px; font-weight: 700; color: var(--accent); margin: 4px 0 0; }
.home-q { text-align: center; font-size: 24px; font-weight: 700; margin: 8px 0 20px; }
.home-q span { display: block; }
.home-q span + span { color: var(--muted); font-weight: 600; font-size: 20px; }
.langs { display: flex; flex-direction: column; gap: 14px; }
.lang { display: flex; align-items: center; gap: 20px; min-height: 104px; padding: 16px 20px; background: #1c1c1c; border: 4px solid var(--line); border-radius: 18px; color: var(--fg); text-decoration: none; font-size: 34px; font-weight: 800; }
.lang:hover, .lang:focus-visible { border-color: var(--accent); background: #262200; }
.lang svg { width: 96px; height: 64px; flex: none; border-radius: 6px; box-shadow: 0 0 0 2px #fff; }
.link { display: inline-block; text-align: center; }

/* Boussole : flèche vivante orientée vers le cap à suivre */
#dial { display: flex; transition: transform 0.15s linear; border-radius: 50%; }
#dial.aligned { box-shadow: 0 0 0 8px var(--accent); }
.dial-hint { font-size: 18px; color: var(--muted); text-align: center; margin: 0 0 8px; }
#dial svg { width: min(60vw, 26vh, 280px); }

/* Compteur de pas : distance restante sur l'étape */
.walk-left { font-size: 24px; font-weight: 800; color: var(--accent); text-align: center; margin: -8px 0 8px; }
/* Trois options au récapitulatif : plus compactes */
.recap-screen .check { font-size: 20px; min-height: 56px; margin: 2px 0 6px; }

/* Petits écrans (iPhone SE, 667 px) : l'étape tient sans défiler, boussole comprise */
@media (max-height: 700px) {
  .guide .primary { min-height: 100px; font-size: 36px; }
  .instruction { font-size: 26px; margin-bottom: 12px; }
  .picto { margin: 4px 0; }
  .row { margin-top: 8px; }
  .secondary { min-height: 68px; }
  .guide .link { min-height: 44px; margin-top: 4px; }
  .recap-screen .check { font-size: 19px; min-height: 48px; margin: 0 0 4px; }
  .recap-screen .check input { width: 38px; height: 38px; }
  .recap-value { font-size: 24px; }
  .recap-screen .primary { min-height: 92px; }
}

/* Réalité augmentée : caméra et tracé en plein écran, consigne dans un bandeau en bas */
#ar-video, #ar-canvas { position: fixed; inset: 0; width: 100vw; height: 100vh; object-fit: cover; z-index: 0; }
#ar-video { background: #000; }
body.ar-on { overflow: hidden; }
body.ar-on #app { position: relative; z-index: 1; background: transparent; }
.ar-screen { padding: 0 !important; max-width: none !important; }
.ar-hud { flex: 1; display: flex; flex-direction: column; min-height: 100vh; padding: calc(10px + env(safe-area-inset-top)) 12px calc(12px + env(safe-area-inset-bottom)); box-sizing: border-box; }
.ar-count { align-self: center; margin: 0; padding: 6px 14px; border-radius: 999px; background: rgba(0,0,0,0.65); font-size: 18px; font-weight: 700; }
.ar-panel { background: rgba(0,0,0,0.78); border-radius: 18px; padding: 12px; }
.ar-line { display: flex; align-items: center; gap: 12px; }
.ar-picto svg { width: 64px; height: 64px; color: var(--accent); flex: none; }
.ar-panel .instruction { font-size: 22px; text-align: left; margin: 0; }
.ar-panel .walk-left { margin: 8px 0 0; text-align: left; }
.ar-buttons { display: grid; grid-template-columns: 1fr 1fr 1.4fr; gap: 8px; margin-top: 10px; }
.ar-buttons .secondary { min-height: 60px; font-size: 18px; }
.ar-buttons .primary { min-height: 60px; font-size: 24px; }
.ar-panel .link { display: block; width: 100%; min-height: 40px; margin-top: 4px; font-size: 18px; }

/* Départ à plusieurs endroits : distance GPS, emplacement au récapitulatif, départ proposé */
.results .dist { display: block; font-size: 20px; font-weight: 600; color: var(--accent); margin-top: 4px; }
.gps { width: 100%; margin: 0 0 12px; }
.recap-sub { grid-column: 1; font-size: 18px; color: var(--muted); margin: 2px 0 0; }
.error .suggest { display: block; width: 100%; margin-top: 10px; color: var(--fg); }

/* Réglage « voix de l'application » (premier écran) */
.voice-toggle { width: 100%; margin-top: 18px; font-size: 22px; }
.voice-toggle[aria-pressed="false"] { border-color: var(--accent); color: var(--accent); }
