/* SPFF — Borne d'accueil. Palette Secours populaire : bleu profond + rouge, fond crème. */
:root {
  --bleu: #0e4c9c;
  --bleu-fonce: #0a3570;
  --rouge: #e0312f;
  --creme: #faf6ee;
  --encre: #17233a;
  --sable: #efe7d8;
  --ok: #2c7a4b;
  --r: 22px;
  --shadow-1: 0 1px 2px rgba(23, 35, 58, .06), 0 6px 18px rgba(23, 35, 58, .08);
  --shadow-2: 0 2px 4px rgba(10, 53, 112, .12), 0 14px 40px rgba(10, 53, 112, .18);
  --font-display: "Bricolage Grotesque", system-ui, sans-serif;
  --font-body: system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: var(--font-body);
  color: var(--encre);
  background:
    radial-gradient(1200px 800px at 85% -10%, rgba(14, 76, 156, .10), transparent 60%),
    radial-gradient(900px 700px at -10% 110%, rgba(224, 49, 47, .08), transparent 55%),
    var(--creme);
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
body::after { /* grain */
  content: ""; position: fixed; inset: 0; pointer-events: none; opacity: .35;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.03 0'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)'/%3E%3C/svg%3E");
}
.screen { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 4vmin; z-index: 1; }
.screen[hidden] { display: none; }
.muted { color: rgba(23, 35, 58, .55); font-weight: 400; }
.muted-inline { font-size: .75em; opacity: .7; font-weight: 400; }

/* ---------- boutons ---------- */
.btn {
  font-family: var(--font-display); font-weight: 700; border: none; cursor: pointer;
  border-radius: var(--r); padding: 20px 36px; font-size: clamp(18px, 2.6vmin, 26px);
  transition: transform .15s cubic-bezier(.34, 1.56, .64, 1), box-shadow .15s ease;
}
.btn:active { transform: scale(.96); }
.btn:focus-visible { outline: 3px solid var(--bleu); outline-offset: 3px; }
.btn-primary { background: var(--bleu); color: #fff; box-shadow: var(--shadow-2); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 4px 8px rgba(10,53,112,.16), 0 20px 50px rgba(10,53,112,.24); }
.btn-secondary { background: #fff; color: var(--bleu-fonce); border: 2px solid rgba(14,76,156,.25); box-shadow: var(--shadow-1); }
.btn-secondary:hover { transform: translateY(-2px); border-color: var(--bleu); }
.btn-danger { background: var(--rouge); color: #fff; box-shadow: 0 2px 4px rgba(224,49,47,.2), 0 14px 40px rgba(224,49,47,.25); }
.btn-danger:hover { transform: translateY(-2px); }
.btn-ghost { background: none; border: none; font-size: 26px; cursor: pointer; opacity: .45; padding: 10px; border-radius: 12px; transition: opacity .15s ease, transform .15s ease; }
.btn-ghost:hover, .btn-ghost:focus-visible { opacity: 1; }
.btn-ghost:active { transform: scale(.9); }
.btn-ghost-big { background: none; border: none; font-family: var(--font-display); font-size: clamp(18px, 2.4vmin, 24px); font-weight: 600; color: var(--bleu-fonce); cursor: pointer; padding: 16px 28px; border-radius: var(--r); transition: transform .15s ease, opacity .15s ease; opacity: .75; }
.btn-ghost-big:hover, .btn-ghost-big:focus-visible { opacity: 1; }
.btn-ghost-big:active { transform: scale(.96); }

/* ---------- verrouillage ---------- */
.lock-card {
  background: #fff; border-radius: 32px; padding: clamp(32px, 6vmin, 64px);
  box-shadow: var(--shadow-2); display: flex; flex-direction: column; gap: 18px; align-items: center;
  max-width: 480px; width: 100%;
}
.brand-mark {
  width: 84px; height: 84px; border-radius: 26px; display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 800; font-size: 34px; color: #fff;
  background: linear-gradient(135deg, var(--bleu) 0%, var(--bleu-fonce) 60%), var(--bleu);
  box-shadow: inset 0 -14px 24px rgba(224, 49, 47, .5), var(--shadow-1);
}
.brand-mark.small { width: 56px; height: 56px; font-size: 22px; border-radius: 18px; }
.lock-title { font-family: var(--font-display); font-size: clamp(26px, 4vmin, 38px); letter-spacing: -.03em; text-align: center; line-height: 1.1; }
.lock-sub { color: rgba(23,35,58,.55); font-size: 16px; }
#code-input {
  font-size: 32px; text-align: center; letter-spacing: .4em; width: 100%;
  padding: 16px; border: 2px solid var(--sable); border-radius: 18px; background: var(--creme);
  font-family: var(--font-body); color: var(--encre);
}
#code-input:focus { outline: none; border-color: var(--bleu); }
.lock-error { color: var(--rouge); font-weight: 600; min-height: 1.4em; font-size: 15px; }

/* ---------- accueil ---------- */
.home-head { position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center; gap: 16px; padding: 3vmin 4vmin; }
.home-brand { font-family: var(--font-display); font-weight: 700; font-size: clamp(16px, 2.2vmin, 22px); letter-spacing: -.02em; }
.home-place { color: rgba(23,35,58,.55); font-size: clamp(13px, 1.8vmin, 17px); }
.home-head .btn-ghost { margin-left: auto; }
.home-center { display: flex; flex-direction: column; align-items: center; gap: clamp(16px, 3vmin, 32px); text-align: center; max-width: 900px; }
.home-title { font-family: var(--font-display); font-size: clamp(28px, 5vmin, 54px); letter-spacing: -.03em; line-height: 1.15; }
.home-sub { font-size: clamp(17px, 2.6vmin, 26px); line-height: 1.7; }
.talk-btn {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  width: clamp(220px, 34vmin, 340px); height: clamp(220px, 34vmin, 340px); border-radius: 50%;
  border: none; cursor: pointer; color: #fff;
  font-family: var(--font-display); font-weight: 800; font-size: clamp(24px, 3.6vmin, 40px); letter-spacing: -.02em;
  background: radial-gradient(circle at 30% 25%, #1a63c4, var(--bleu) 45%, var(--bleu-fonce) 100%);
  box-shadow: 0 4px 10px rgba(10,53,112,.25), 0 24px 70px rgba(10,53,112,.35), inset 0 2px 10px rgba(255,255,255,.25);
  transition: transform .18s cubic-bezier(.34,1.56,.64,1), box-shadow .18s ease;
  animation: breathe 3.2s ease-in-out infinite;
  justify-content: center;
}
.talk-btn small { display: block; font-size: .45em; font-weight: 600; opacity: .85; margin-top: 6px; }
.talk-btn:hover { transform: scale(1.04); }
.talk-btn:active { transform: scale(.97); animation: none; }
.talk-btn:focus-visible { outline: 4px solid var(--rouge); outline-offset: 6px; }
@keyframes breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.025); } }
.lang-strip { max-width: 820px; color: rgba(23,35,58,.5); font-size: clamp(13px, 1.9vmin, 17px); line-height: 1.8; }
.home-foot { position: absolute; bottom: 0; left: 0; right: 0; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 3vmin 4vmin; flex-wrap: wrap; }
.privacy-link { color: rgba(23,35,58,.5); font-size: clamp(12px, 1.7vmin, 15px); text-decoration: none; border-bottom: 1px solid rgba(23,35,58,.2); padding-bottom: 2px; transition: color .15s ease; }
.privacy-link:hover, .privacy-link:focus-visible { color: var(--bleu); }

/* ---------- grille langues ---------- */
.langs-title { font-family: var(--font-display); font-size: clamp(24px, 4vmin, 42px); letter-spacing: -.03em; margin-bottom: 8px; }
.lang-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; width: min(1100px, 94vw); margin: 3vmin 0; max-height: 58vh; overflow-y: auto; padding: 6px; }
.lang-cell {
  font-family: var(--font-display); font-weight: 600; font-size: clamp(16px, 2.2vmin, 21px);
  background: #fff; border: 2px solid rgba(14,76,156,.15); border-radius: 18px; padding: 18px 12px;
  cursor: pointer; box-shadow: var(--shadow-1); color: var(--encre); line-height: 1.3;
  transition: transform .15s cubic-bezier(.34,1.56,.64,1), border-color .15s ease;
}
.lang-cell small { display: block; font-weight: 400; color: rgba(23,35,58,.55); font-size: .78em; margin-top: 2px; }
.lang-cell:hover, .lang-cell:focus-visible { transform: translateY(-3px); border-color: var(--bleu); }
.lang-cell:active { transform: scale(.96); }

/* ---------- conversation ---------- */
.live-mode { position: absolute; top: 3vmin; font-family: var(--font-display); font-weight: 700; color: var(--bleu-fonce); background: #fff; border-radius: 999px; padding: 10px 26px; box-shadow: var(--shadow-1); font-size: clamp(15px, 2vmin, 20px); }
.orb-wrap { display: flex; flex-direction: column; align-items: center; gap: 24px; }
.orb {
  width: clamp(180px, 28vmin, 280px); height: clamp(180px, 28vmin, 280px); border-radius: 50%;
  display: grid; place-items: center;
  background: radial-gradient(circle at 32% 28%, rgba(26,99,196,.25), rgba(14,76,156,.12) 60%, transparent 75%);
  transition: transform .2s ease;
}
.orb-core {
  width: 58%; height: 58%; border-radius: 50%;
  background: radial-gradient(circle at 30% 25%, #2a74d8, var(--bleu) 50%, var(--bleu-fonce));
  box-shadow: 0 10px 50px rgba(10,53,112,.4), inset 0 2px 12px rgba(255,255,255,.3);
  transition: transform .12s ease;
}
.orb.listening .orb-core { animation: pulse-listen 1.6s ease-in-out infinite; }
.orb.speaking { background: radial-gradient(circle at 32% 28%, rgba(224,49,47,.22), rgba(224,49,47,.1) 60%, transparent 75%); }
.orb.speaking .orb-core { background: radial-gradient(circle at 30% 25%, #ef5350, var(--rouge) 55%, #a71f1d); box-shadow: 0 10px 50px rgba(224,49,47,.4), inset 0 2px 12px rgba(255,255,255,.3); animation: pulse-speak .5s ease-in-out infinite; }
@keyframes pulse-listen { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.12); } }
@keyframes pulse-speak { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.07); } }
.live-status { font-family: var(--font-display); font-weight: 600; font-size: clamp(17px, 2.4vmin, 24px); color: rgba(23,35,58,.7); }
.captions { min-height: 18vh; max-width: min(900px, 92vw); display: flex; flex-direction: column; gap: 10px; justify-content: flex-start; margin: 3vmin 0; text-align: center; }
.cap { font-size: clamp(16px, 2.4vmin, 24px); line-height: 1.6; }
.cap-user { color: rgba(23,35,58,.55); }
.cap-agent { color: var(--encre); font-weight: 600; }
