/* S33D Voice : vitrine et administration. Une seule feuille, des jetons en tête. */

@font-face {
  font-family: "Manrope";
  src: url("/assets/fonts/manrope-latin.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Manrope";
  src: url("/assets/fonts/manrope-latin-ext.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
  unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF,
    U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --fond: #f6f5f1;
  --surface: #ffffff;
  --surface-2: #faf9f6;
  --encre: #15151c;
  --texte: #3b3b47;
  --doux: #6c6c7a;
  --ligne: #e5e2da;
  --accent: #5a3cf0;
  --accent-fonce: #4527d6;
  --accent-doux: #eeeaff;
  --accent-2: #0e9f8e;
  --ok: #15803d;
  --ok-doux: #e5f5ea;
  --alerte: #a15c07;
  --alerte-doux: #fcf2e1;
  --refus: #b42318;
  --refus-doux: #fdeceb;
  --code-fond: #16161f;
  --code-texte: #e8e6f5;
  --rayon: 14px;
  --rayon-petit: 9px;
  --ombre: 0 1px 2px rgba(20, 18, 40, 0.05), 0 10px 30px rgba(20, 18, 40, 0.07);
  --police: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", Consolas, monospace;
  --largeur: 1120px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --fond: #101016;
    --surface: #18181f;
    --surface-2: #1d1d26;
    --encre: #f3f2f8;
    --texte: #cfcdd9;
    --doux: #9795a6;
    --ligne: #2c2b37;
    --accent: #8b74ff;
    --accent-fonce: #a594ff;
    --accent-doux: #25204a;
    --accent-2: #2cc2ae;
    --ok: #4ade80;
    --ok-doux: #15291d;
    --alerte: #f5b454;
    --alerte-doux: #2e2413;
    --refus: #f87171;
    --refus-doux: #2f1818;
    --code-fond: #0b0b10;
    --ombre: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 30px rgba(0, 0, 0, 0.35);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--police);
  font-size: 16px;
  line-height: 1.6;
  color: var(--texte);
  background: var(--fond);
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { color: var(--encre); line-height: 1.15; margin: 0 0 0.5em; letter-spacing: -0.02em; }
h1 { font-size: clamp(2rem, 4.6vw, 3.3rem); font-weight: 800; }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); font-weight: 750; }
h3 { font-size: 1.1rem; font-weight: 700; }
p { margin: 0 0 1em; }
code, pre, kbd { font-family: var(--mono); font-size: 0.9em; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.enveloppe { width: min(var(--largeur), 100% - 2.5rem); margin-inline: auto; }

/* ── En-tête ─────────────────────────────────────────────────────────── */
.entete {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--fond) 86%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--ligne);
}
.entete .enveloppe { display: flex; align-items: center; gap: 1.5rem; height: 64px; }
.marque { display: flex; align-items: center; gap: 0.6rem; color: var(--encre); font-weight: 800; font-size: 1.12rem; }
.marque:hover { text-decoration: none; }
.marque svg { width: 30px; height: 30px; }
.marque span { color: var(--accent); }
.nav { display: flex; gap: 1.4rem; margin-left: auto; font-weight: 600; font-size: 0.95rem; }
.nav a { color: var(--texte); }
.nav a:hover { color: var(--accent); text-decoration: none; }
@media (max-width: 720px) { .nav { gap: 0.9rem; font-size: 0.88rem; } .nav .optionnel { display: none; } }

/* ── Boutons, champs ─────────────────────────────────────────────────── */
.bouton {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  border: 1px solid transparent; border-radius: 999px;
  padding: 0.7rem 1.25rem; font: inherit; font-weight: 700; font-size: 0.95rem;
  cursor: pointer; transition: background 0.15s, transform 0.05s, border-color 0.15s;
  background: var(--accent); color: #fff;
}
.bouton:hover { background: var(--accent-fonce); text-decoration: none; }
.bouton:active { transform: translateY(1px); }
.bouton:disabled { opacity: 0.5; cursor: not-allowed; }
.bouton.secondaire { background: var(--surface); color: var(--encre); border-color: var(--ligne); }
.bouton.secondaire:hover { border-color: var(--accent); color: var(--accent); }
.bouton.danger { background: var(--surface); color: var(--refus); border-color: var(--ligne); }
.bouton.danger:hover { border-color: var(--refus); }
.bouton.petit { padding: 0.35rem 0.8rem; font-size: 0.85rem; }
.bouton svg { width: 18px; height: 18px; }

label { display: block; font-weight: 650; font-size: 0.88rem; color: var(--encre); margin-bottom: 0.3rem; }
.aide { font-size: 0.82rem; color: var(--doux); font-weight: 500; }
input[type=text], input[type=password], input[type=number], select, textarea {
  width: 100%; font: inherit; color: var(--encre);
  background: var(--surface); border: 1px solid var(--ligne); border-radius: var(--rayon-petit);
  padding: 0.6rem 0.75rem;
}
textarea { resize: vertical; min-height: 96px; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-doux); }
.champ { margin-bottom: 1rem; }
.rangee { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.case { display: flex; align-items: center; gap: 0.5rem; font-weight: 600; font-size: 0.9rem; }
.case input { width: auto; }

/* ── Cartes, pastilles ───────────────────────────────────────────────── */
.carte { background: var(--surface); border: 1px solid var(--ligne); border-radius: var(--rayon); padding: 1.4rem; box-shadow: var(--ombre); }
.pastille {
  display: inline-flex; align-items: center; gap: 0.35rem;
  font-size: 0.76rem; font-weight: 700; padding: 0.15rem 0.6rem; border-radius: 999px;
  background: var(--surface-2); color: var(--doux); border: 1px solid var(--ligne); white-space: nowrap;
}
.pastille::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pastille.ok { color: var(--ok); background: var(--ok-doux); border-color: transparent; }
.pastille.attention { color: var(--alerte); background: var(--alerte-doux); border-color: transparent; }
.pastille.refus { color: var(--refus); background: var(--refus-doux); border-color: transparent; }
.pastille.neutre::before { display: none; }

/* ── Vitrine ─────────────────────────────────────────────────────────── */
.heros { padding: clamp(2.5rem, 7vw, 5rem) 0 3rem; }
.heros .grille { display: grid; gap: 2.5rem; grid-template-columns: 1.05fr 1fr; align-items: center; }
@media (max-width: 900px) { .heros .grille { grid-template-columns: 1fr; } }
.heros .accroche { font-size: 1.14rem; color: var(--texte); max-width: 34rem; }
.surtitre { display: inline-block; font-weight: 750; font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent-2); margin-bottom: 0.8rem; }
.onde { display: flex; align-items: center; gap: 4px; height: 40px; margin: 1.5rem 0 0; }
.onde i { display: block; width: 5px; border-radius: 3px; background: var(--accent); opacity: 0.85; height: 30%; }
.onde.joue i { animation: onde 0.9s ease-in-out infinite; }
@keyframes onde { 0%, 100% { height: 18%; } 50% { height: 100%; } }
@media (prefers-reduced-motion: reduce) { .onde.joue i { animation: none; height: 60%; } }

.demo .compteur { font-size: 0.8rem; color: var(--doux); text-align: right; margin-top: 0.25rem; }
.demo .actions { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; margin-top: 1rem; }
.demo audio, .lecteur { width: 100%; margin-top: 1rem; }
.moteurs { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 1rem; }

section.bloc { padding: 4rem 0; border-top: 1px solid var(--ligne); }
section.bloc > .enveloppe > p.intro { max-width: 44rem; font-size: 1.05rem; }
.grille-voix { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); margin-top: 1.8rem; }
.voix-carte { display: flex; flex-direction: column; gap: 0.6rem; }
.voix-carte .tete { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.voix-carte h3 { margin: 0; }
.voix-carte p { font-size: 0.9rem; color: var(--doux); margin: 0; flex: 1; }
.vide { color: var(--doux); font-style: italic; }

.atouts { display: grid; gap: 1.2rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); margin-top: 1.8rem; }
.atout h3 { display: flex; align-items: center; gap: 0.5rem; }
.atout h3 svg { width: 22px; height: 22px; color: var(--accent); flex: none; }
.atout p { font-size: 0.94rem; margin: 0; }

.onglets { display: flex; gap: 0.25rem; border-bottom: 1px solid var(--ligne); margin-top: 1.5rem; overflow-x: auto; }
.onglets button {
  font: inherit; font-weight: 700; font-size: 0.9rem; background: none; border: none; cursor: pointer;
  color: var(--doux); padding: 0.6rem 1rem; border-bottom: 2px solid transparent; white-space: nowrap;
}
.onglets button[aria-selected=true] { color: var(--accent); border-bottom-color: var(--accent); }
.code { position: relative; background: var(--code-fond); color: var(--code-texte); border-radius: 0 0 var(--rayon) var(--rayon); padding: 1.2rem 1.3rem; overflow-x: auto; margin: 0; font-size: 0.86rem; line-height: 1.55; }
.code.seul { border-radius: var(--rayon); }
.copier { position: absolute; top: 0.6rem; right: 0.6rem; font: inherit; font-size: 0.75rem; font-weight: 700; background: rgba(255,255,255,0.1); color: #fff; border: 1px solid rgba(255,255,255,0.15); border-radius: 6px; padding: 0.2rem 0.55rem; cursor: pointer; }
.copier:hover { background: rgba(255,255,255,0.2); }

.tableau-conteneur { overflow-x: auto; border: 1px solid var(--ligne); border-radius: var(--rayon); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { text-align: left; padding: 0.7rem 0.9rem; border-bottom: 1px solid var(--ligne); vertical-align: top; }
th { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--doux); background: var(--surface-2); font-weight: 700; }
tr:last-child td { border-bottom: none; }
td code { background: var(--accent-doux); color: var(--accent-fonce); padding: 0.1rem 0.35rem; border-radius: 5px; }
.methode { font-family: var(--mono); font-weight: 700; font-size: 0.78rem; }
.methode.get { color: var(--accent-2); }
.methode.post { color: var(--accent); }
.methode.put { color: var(--alerte); }
.methode.delete { color: var(--refus); }

.pied { border-top: 1px solid var(--ligne); padding: 2rem 0 3rem; font-size: 0.88rem; color: var(--doux); }
.pied .enveloppe { display: flex; flex-wrap: wrap; gap: 1rem 2rem; justify-content: space-between; }
.pied a { color: var(--doux); }

/* ── Administration ──────────────────────────────────────────────────── */
.admin-corps { display: grid; grid-template-columns: 220px 1fr; gap: 2rem; padding: 2rem 0 4rem; align-items: start; }
@media (max-width: 860px) { .admin-corps { grid-template-columns: 1fr; } }
.menu { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 0.2rem; }
@media (max-width: 860px) { .menu { position: static; flex-direction: row; overflow-x: auto; } }
.menu button {
  font: inherit; font-weight: 650; font-size: 0.93rem; text-align: left; cursor: pointer;
  background: none; border: none; color: var(--texte); padding: 0.6rem 0.85rem; border-radius: var(--rayon-petit); white-space: nowrap;
}
.menu button:hover { background: var(--surface); }
.menu button[aria-current=page] { background: var(--accent-doux); color: var(--accent-fonce); }
.panneau[hidden] { display: none; }
.panneau > h2 { margin-bottom: 0.3rem; }
.panneau > p.intro { color: var(--doux); margin-bottom: 1.5rem; max-width: 46rem; }
.pile { display: grid; gap: 1.2rem; }
.connexion { max-width: 440px; margin: 4rem auto; }
.barre-etat { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; margin-left: auto; }

.studio { display: grid; grid-template-columns: 1fr 300px; gap: 1.2rem; align-items: start; }
@media (max-width: 1000px) { .studio { grid-template-columns: 1fr; } }
.phrase-bloc { font-size: 0.8rem; font-weight: 750; text-transform: uppercase; letter-spacing: 0.07em; color: var(--accent-2); }
.phrase-consigne { font-size: 0.9rem; color: var(--doux); margin: 0.2rem 0 1rem; }
.phrase-texte {
  font-size: clamp(1.35rem, 2.6vw, 1.9rem); font-weight: 650; color: var(--encre); line-height: 1.4;
  padding: 1.4rem; background: var(--surface-2); border-radius: var(--rayon); border: 1px solid var(--ligne); min-height: 8rem;
}
.commandes { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; margin-top: 1.2rem; }
.bouton-rec {
  width: 72px; height: 72px; border-radius: 50%; border: 4px solid var(--surface); cursor: pointer;
  background: var(--refus); box-shadow: 0 0 0 2px var(--refus), var(--ombre); display: grid; place-items: center; flex: none;
}
.bouton-rec::after { content: ""; width: 26px; height: 26px; border-radius: 50%; background: #fff; transition: border-radius 0.15s, transform 0.15s; }
.bouton-rec.actif::after { border-radius: 5px; transform: scale(0.85); }
.bouton-rec.actif { animation: pulse 1.2s ease-in-out infinite; }
.bouton-rec:disabled { opacity: 0.4; cursor: not-allowed; animation: none; }
@keyframes pulse { 50% { box-shadow: 0 0 0 8px color-mix(in srgb, var(--refus) 25%, transparent), var(--ombre); } }
.chrono { font-family: var(--mono); font-size: 1.3rem; font-weight: 700; color: var(--encre); min-width: 4.5rem; }
.vumetre { position: relative; height: 12px; background: var(--surface-2); border: 1px solid var(--ligne); border-radius: 999px; overflow: hidden; margin-top: 1rem; }
.vumetre .niveau { position: absolute; inset: 0 auto 0 0; width: 0; background: linear-gradient(90deg, var(--ok) 0 70%, var(--alerte) 70% 90%, var(--refus) 90%); transition: width 0.05s linear; }
.vumetre .crete { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--encre); left: 0; }
.verdict { margin-top: 1rem; padding: 0.9rem 1rem; border-radius: var(--rayon-petit); font-size: 0.92rem; }
.verdict.ok { background: var(--ok-doux); color: var(--ok); }
.verdict.attention { background: var(--alerte-doux); color: var(--alerte); }
.verdict.refus { background: var(--refus-doux); color: var(--refus); }
.verdict .mesures { display: block; font-family: var(--mono); font-size: 0.78rem; opacity: 0.85; margin-top: 0.3rem; }
.liste-phrases { list-style: none; margin: 0; padding: 0; max-height: 560px; overflow-y: auto; }
.liste-phrases li button {
  width: 100%; display: flex; gap: 0.6rem; align-items: center; text-align: left; cursor: pointer;
  font: inherit; font-size: 0.85rem; background: none; border: none; border-radius: 8px; padding: 0.45rem 0.55rem; color: var(--texte);
}
.liste-phrases li button:hover { background: var(--surface-2); }
.liste-phrases li button[aria-current=true] { background: var(--accent-doux); color: var(--accent-fonce); }
.liste-phrases .id { font-family: var(--mono); font-size: 0.75rem; color: var(--doux); flex: none; width: 3.2rem; }
.liste-phrases .extrait { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.liste-phrases .puce { width: 9px; height: 9px; border-radius: 50%; background: var(--ligne); flex: none; }
.puce.ok { background: var(--ok); } .puce.attention { background: var(--alerte); } .puce.refus { background: var(--refus); }
.progression { height: 6px; background: var(--surface-2); border-radius: 999px; overflow: hidden; margin: 0.4rem 0 1rem; }
.progression i { display: block; height: 100%; background: var(--accent); width: 0; transition: width 0.3s; }
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 760px) { .duo { grid-template-columns: 1fr; } }
.meta { font-family: var(--mono); font-size: 0.78rem; color: var(--doux); margin-top: 0.4rem; }
.cle-affichee { font-family: var(--mono); background: var(--accent-doux); color: var(--accent-fonce); padding: 0.8rem 1rem; border-radius: var(--rayon-petit); word-break: break-all; }
details summary { cursor: pointer; font-weight: 700; color: var(--encre); }
details[open] summary { margin-bottom: 0.8rem; }

#toasts { position: fixed; right: 1rem; bottom: 1rem; display: flex; flex-direction: column; gap: 0.5rem; z-index: 50; }
.toast { background: var(--encre); color: var(--fond); padding: 0.75rem 1rem; border-radius: 10px; box-shadow: var(--ombre); font-size: 0.9rem; max-width: 380px; }
.toast.erreur { background: var(--refus); color: #fff; }
.toast.ok { background: var(--ok); color: #fff; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
