/* Sarah Desk Web : style « fusion » repris de Fortuna (fortuna.css / app-client.css), adapté TV (bureau), téléphone et voiture.
   Aucune ressource externe : polices Inter locales (polices/), Space Grotesk si installée, sinon police système. */
@font-face { font-family: "Inter"; src: url("../polices/Inter-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Inter"; src: url("../polices/Inter-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Inter"; src: url("../polices/Inter-SemiBold.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Inter"; src: url("../polices/Inter-Bold.woff2") format("woff2"); font-weight: 700 800; font-display: swap; }

:root {
  --signature: linear-gradient(90deg, #E91E8C, #A855F7, #6366F1, #213CA0);
  --action: linear-gradient(135deg, #213CA0, #4F46E5, #D61A85);
  --compteur: linear-gradient(135deg, #D61A85, #7C3AED);
  --fond: #F6F6FB; --fond-2: #FAE9F3; --surface: #FFFFFF; --surface-2: #F2F0FA; --bord: #ECEAF4; --bord-fort: #DCD8EA;
  --texte: #1E1B3A; --texte-doux: #5E6380; --violet: #A855F7; --violet-fonce: #7E22CE; --focus: #9333EA;
  --ok: #15803D; --alerte: #B45309; --bloque: #B91C1C;
  --ombre-2: 0 1px 2px rgba(30, 27, 58, .04), 0 4px 14px rgba(30, 27, 58, .06);
  --ombre-3: 0 2px 6px rgba(30, 27, 58, .06), 0 14px 36px rgba(30, 27, 58, .14);
  --police: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --police-titre: "Space Grotesk", "Inter", system-ui, sans-serif;
  --rayon-carte: 16px; --rayon-bouton: 14px; --filet: 4px;
  --t: 16px;                       /* corps ; multiplié par mode */
}
body[data-theme="sombre"] {
  --fond: #0F1224; --fond-2: #15132E; --surface: #1E1B3A; --surface-2: #26224A; --bord: #34305C; --bord-fort: #433E70;
  --texte: #F2F0FA; --texte-doux: #A3A7C2; --violet-fonce: #E9D5FF; --focus: #C084FC;
  --ok: #4ADE80; --alerte: #FBBF24; --bloque: #F87171;
  --ombre-2: 0 1px 2px rgba(0, 0, 0, .3); --ombre-3: 0 16px 40px rgba(0, 0, 0, .5);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--police); font-weight: 500; font-size: var(--t); color: var(--texte);
  background: linear-gradient(160deg, var(--fond), var(--fond-2)); overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
.halos { position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background: radial-gradient(40vw 40vw at 92% 4%, rgba(233, 30, 140, .14), transparent 70%),
              radial-gradient(45vw 45vw at 4% 96%, rgba(99, 102, 241, .14), transparent 70%),
              radial-gradient(35vw 35vw at 50% 50%, rgba(168, 85, 247, .08), transparent 70%); }
body[data-theme="sombre"] .halos { background: radial-gradient(45vw 45vw at 4% 96%, rgba(99, 102, 241, .18), transparent 70%); }
.invisible { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }

/* ---------- barre en dégradé signature ---------- */
.barre { position: relative; z-index: 2; display: flex; align-items: center; gap: 1em; padding: .5em 1.2em; min-height: 3.2em;
  background: var(--signature); color: #fff; box-shadow: 0 6px 20px rgba(76, 29, 149, .45); }
.marque { font-family: var(--police-titre); font-weight: 800; font-size: 1.25em; letter-spacing: .02em; }
.heure-barre { margin-left: auto; font-weight: 700; }

/* ---------- pilule de statut (point coloré + texte, jamais la couleur seule) ---------- */
.pilule { display: inline-flex; align-items: center; gap: .5em; padding: .3em .9em; border-radius: 999px;
  background: rgba(255, 255, 255, .92); color: #1E1B3A; font-weight: 700; box-shadow: var(--ombre-2); }
.pilule .point { width: .7em; height: .7em; border-radius: 50%; background: var(--violet); }
.pilule .points { display: none; gap: .25em; }
.pilule .points i { width: .4em; height: .4em; border-radius: 50%; background: #7C3AED; animation: point 1.2s infinite ease-in-out; }
.pilule .points i:nth-child(2) { animation-delay: .2s; } .pilule .points i:nth-child(3) { animation-delay: .4s; }
body[data-etat="reflexion"] .pilule .points { display: inline-flex; }
body[data-etat="ecoute"] .pilule .point { background: #E91E8C; animation: pouls 1s infinite ease-in-out; }
body[data-etat="erreur"] .pilule .point, body[data-etat="hors_ligne"] .pilule .point { background: #B91C1C; border-radius: 2px; }
@keyframes point { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-.15em); } }
@keyframes pouls { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.25); opacity: .7; } }

.bandeau { position: fixed; z-index: 5; top: 4.2em; left: 50%; transform: translateX(-50%); margin: 0; padding: .5em 1.2em;
  border-radius: 999px; font-weight: 700; color: #fff; background: #B45309; box-shadow: var(--ombre-3); }
.bandeau[data-genre="ok"] { background: #15803D; }

/* ---------- cartes, boutons ---------- */
.carte { position: relative; background: var(--surface); border-radius: var(--rayon-carte); box-shadow: var(--ombre-3); overflow: hidden; }
.carte::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: var(--filet); background: var(--signature); }
.bouton-action { border: 0; border-radius: var(--rayon-bouton); padding: .7em 1.3em; font: inherit; font-weight: 700; color: #fff;
  background: var(--action); cursor: pointer; box-shadow: 0 6px 16px rgba(76, 29, 149, .35); }
.bouton-action:disabled { opacity: .6; }
.lien { border: 0; background: none; font: inherit; color: var(--violet-fonce); text-decoration: underline; cursor: pointer; padding: .3em 0; }
input { font: inherit; color: var(--texte); background: var(--surface); border: 1.5px solid var(--bord-fort); border-radius: var(--rayon-bouton); padding: .65em .9em; min-width: 0; }

/* ---------- appairage ---------- */
.ecran-appairage { position: relative; z-index: 1; height: calc(100% - 3.2em); display: grid; place-items: center; padding: 5vh 5vw; }
.carte-appairage { width: min(100%, 46em); padding: 2em 2.2em 1.6em; }
.carte-appairage h1 { margin: 0 0 .4em; font-size: 1.6em; font-weight: 800; }
.aide { margin: 0 0 1.2em; color: var(--texte-doux); }
.appairage-grille { display: flex; align-items: center; gap: 2em; flex-wrap: wrap; }
.qr { width: 11em; height: 11em; border-radius: 12px; background: #fff; box-shadow: var(--ombre-2); }
.code-legende { margin: 0; font-weight: 700; color: var(--texte-doux); text-transform: uppercase; letter-spacing: .08em; font-size: .8em; }
.code { margin: .1em 0; font-family: var(--police-titre); font-weight: 800; font-size: 3.4em; letter-spacing: .08em;
  background: var(--compteur); -webkit-background-clip: text; background-clip: text; color: transparent; font-variant-numeric: tabular-nums; }
.code-expire { margin: 0; color: var(--texte-doux); }
.form-code { margin-top: 1.2em; } .form-code label { display: block; font-weight: 700; margin-bottom: .4em; }
.ligne { display: flex; gap: .6em; } .ligne input { flex: 1; letter-spacing: .1em; }
.message { min-height: 1.4em; margin: .8em 0 0; color: var(--bloque); font-weight: 600; }

/* ---------- écran Sarah ---------- */
.ecran-sarah { position: relative; z-index: 1; height: calc(100% - 3.2em); display: grid; grid-template-columns: 38% 1fr; gap: 3vw; padding: 3vh 5vw 4vh; }
.scene { position: relative; min-height: 0; }
.avatar { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: transparent; pointer-events: none; }
.anneau { position: absolute; left: 22%; right: 14%; bottom: 0; height: 5%; border-radius: 50%; opacity: 0;
  background: radial-gradient(closest-side, transparent 55%, rgba(233, 30, 140, .9) 62%, rgba(168, 85, 247, .8) 72%, rgba(99, 102, 241, 0) 100%); }
body[data-etat="ecoute"] .anneau { opacity: 1; animation: pouls 1s infinite ease-in-out; }
.cote { display: flex; flex-direction: column; gap: .9em; min-height: 0; justify-content: center; }
.veille-info .heure { margin: 0; font-family: var(--police-titre); font-weight: 800; font-size: 4.5em; line-height: 1; font-variant-numeric: tabular-nums; }
.veille-info .date { margin: .2em 0 0; font-size: 1.3em; font-weight: 600; color: var(--texte-doux); text-transform: capitalize; }
body:not([data-etat="veille"]) .veille-info { display: none; }
.question { margin: 0; font-weight: 600; color: var(--texte-doux); min-height: 1.2em; }
.question:empty { display: none; }
.bulle-carte { padding: 1.1em 1.3em .9em; max-height: 40vh; overflow: auto; }
.bulle { margin: 0; white-space: pre-wrap; line-height: 1.45; }
.bulle-carte:has(.bulle:empty) { display: none; }
.sous-titre { margin: 0; font-size: 1.2em; font-weight: 600; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mot-cle { display: none; }
.saisie { display: flex; gap: .6em; } .saisie input { flex: 1; width: 0; }
.commandes { display: flex; gap: 1em; }
.btn-micro, .btn-stop { display: inline-flex; align-items: center; justify-content: center; gap: .5em; min-height: 3em; padding: .6em 1.4em;
  border-radius: var(--rayon-bouton); font: inherit; font-weight: 800; cursor: pointer; }
.btn-micro { background: var(--surface); color: var(--texte); border: 2px solid var(--bord-fort); }
.btn-micro[aria-pressed="true"] { border-color: #E91E8C; box-shadow: 0 0 0 4px rgba(233, 30, 140, .25); }
.btn-stop { background: var(--action); color: #fff; border: 0; }
.btn-micro svg, .btn-stop svg { width: 1.3em; height: 1.3em; fill: currentColor; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.btn-micro svg path { fill: none; } .btn-stop svg { stroke: none; }
.niveau { width: 100%; height: .5em; } body:not([data-etat="ecoute"]) .niveau { visibility: hidden; }
.reglages { display: flex; justify-content: space-between; align-items: center; gap: 1em; flex-wrap: wrap; color: var(--texte-doux); font-size: .8em; }
.ligne-eveil { display: inline-flex; gap: .5em; align-items: center; }

/* ---------- Bureau (TV 55" à 3 m) : échelle ×2,5 sur 1920 px ---------- */
body[data-mode="bureau"] { --t: clamp(16px, 2.08vw, 44px); --rayon-carte: 32px; --filet: 8px; }
body[data-mode="bureau"] .ecran-sarah { padding: 5vh 5vw; }
body[data-mode="bureau"] .sous-titre { font-size: 1.2em; }
body[data-mode="bureau"] .bulle-carte { display: none; }       /* TV : sous-titres seulement, phrase courante */

/* ---------- Téléphone (portrait) ---------- */
body[data-mode="telephone"] { --t: 16px; }
body[data-mode="telephone"] .ecran-sarah { grid-template-columns: minmax(0, 1fr); grid-template-rows: 34vh 1fr; gap: 1em; padding: 1em 16px 1.2em; }
body[data-mode="telephone"] .cote { justify-content: flex-end; }
body[data-mode="telephone"] .veille-info .heure { font-size: 3em; }
body[data-mode="telephone"] .sous-titre { display: none; }
body[data-mode="telephone"] .commandes button { flex: 1; min-height: 3.4em; }
body[data-mode="telephone"] .carte-appairage { padding: 1.6em 1.2em; }
body[data-mode="telephone"] .code { font-size: 2.6em; }

/* ---------- Voiture (8-12" tactile, sombre forcé) : Sarah + 2 boutons géants, rien d'autre ---------- */
body[data-mode="voiture"] { --t: 28px; }
body[data-mode="voiture"] .barre { background: transparent; box-shadow: none; position: absolute; left: 0; right: 0; top: 0; z-index: 3; justify-content: center; }
body[data-mode="voiture"] .marque, body[data-mode="voiture"] .heure-barre { display: none; }
body[data-mode="voiture"] .pilule { font-size: 1em; background: #1E1B3A; color: #F2F0FA; border: 2px solid #433E70; }
body[data-mode="voiture"] .ecran-sarah { height: 100%; grid-template-columns: 1fr; grid-template-rows: 1fr auto auto; gap: 16px; padding: 3.2em 4vw 24px; }
body[data-mode="voiture"] .scene { width: 40%; justify-self: center; height: 100%; }
body[data-mode="voiture"] .cote { display: contents; }
body[data-mode="voiture"] .veille-info, body[data-mode="voiture"] .question, body[data-mode="voiture"] .bulle-carte,
body[data-mode="voiture"] .sous-titre, body[data-mode="voiture"] .saisie, body[data-mode="voiture"] .reglages,
body[data-mode="voiture"] .niveau { display: none !important; }
body[data-mode="voiture"] .mot-cle { display: block; margin: 0; text-align: center; font-weight: 800; min-height: 1.3em; color: #F2F0FA; }
body[data-mode="voiture"] .commandes { gap: 24px; }
body[data-mode="voiture"] .commandes button { flex: 1; min-height: 120px; min-width: 96px; font-size: 1.15em; border-radius: 20px; }
body[data-mode="voiture"] .btn-micro { background: #1E1B3A; color: #F2F0FA; border: 3px solid #433E70; }
body[data-mode="voiture"] .btn-micro[aria-pressed="true"] { border-color: #E91E8C; }
body[data-mode="voiture"] .ecran-appairage { height: 100%; padding-top: 3.2em; }
body[data-mode="voiture"] .avatar { filter: none; }

@media (prefers-reduced-motion: reduce) { *, *::before { animation: none !important; transition: none !important; } }
/* Ajustements : carte d'appairage tenue dans l'écran TV, case à cocher lisible */
body[data-mode="bureau"] .carte-appairage { font-size: .72em; }
body[data-mode="bureau"] .ecran-appairage { padding: 3vh 5vw; }
.ligne-eveil input { width: 1.1em; height: 1.1em; accent-color: #A855F7; }
