/* ══════════════════════════════════════════════════════════════════════════════════════════════
   demo.css — page publique « Posez une question à Hulotte » (web/demo.html + web/js/demo.js).
   S'appuie sur le design system (--h-*, classes .h-*) et le gabarit vitrine (.vc-*). On ne définit
   ici que la boîte de saisie, la zone de réponse et la barre d'écoute flottante propres à la démo.
   Accessibilité (CLAUDE.md règle #11) : gros texte, cibles ≥56px, fort contraste, focus visible.
   ══════════════════════════════════════════════════════════════════════════════════════════════ */

/* ── Boîte de saisie ─────────────────────────────────────────────────────────────────────────── */
.demo-boite {
  background: var(--h-surface);
  border: 2px solid var(--h-bordure);
  border-radius: var(--h-rayon-2, 18px);
  padding: var(--h-esp-5);
  margin: var(--h-esp-5) 0;
  box-shadow: 0 6px 24px rgba(30, 42, 71, .06);
}

.demo-label {
  display: block;
  font-weight: 700;
  font-size: 1.15rem;
  margin-bottom: var(--h-esp-3);
}

/* Champ + bouton micro côte à côte. */
.demo-champ {
  display: flex;
  align-items: stretch;
  gap: var(--h-esp-3);
}

.demo-saisie {
  flex: 1 1 auto;
  min-height: 56px;
  font-size: 1.25rem;
  line-height: 1.5;
  padding: var(--h-esp-3) var(--h-esp-4);
  border: 2px solid var(--h-bordure);
  border-radius: var(--h-rayon, 14px);
  background: var(--h-fond);
  color: var(--h-texte);
  resize: vertical;
  font-family: inherit;
}
.demo-saisie:focus-visible { outline: 3px solid var(--h-focus); outline-offset: 2px; border-color: var(--h-fauve); }

/* Bouton micro : carré, grande cible tactile. */
.demo-micro {
  flex: 0 0 auto;
  width: 56px; min-height: 56px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 2px solid var(--h-bordure);
  border-radius: var(--h-rayon, 14px);
  background: var(--h-fond);
  color: var(--h-fauve);
  font-size: 1.4rem;
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .1s;
}
.demo-micro:hover { border-color: var(--h-fauve); }
.demo-micro:focus-visible { outline: 3px solid var(--h-focus); outline-offset: 2px; }
.demo-micro[aria-pressed="true"] {
  background: var(--h-fauve); color: #fff; border-color: var(--h-fauve);
  animation: demo-pulse 1.3s ease-in-out infinite;
}
@keyframes demo-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(216, 122, 60, .5); } 50% { box-shadow: 0 0 0 10px rgba(216, 122, 60, 0); } }
@media (prefers-reduced-motion: reduce) { .demo-micro[aria-pressed="true"] { animation: none; } }

/* ── Suggestions ─────────────────────────────────────────────────────────────────────────────── */
.demo-suggestions {
  display: flex; flex-wrap: wrap; gap: var(--h-esp-2);
  margin-top: var(--h-esp-4);
}
.demo-tuile {
  display: inline-flex; align-items: center; gap: var(--h-esp-2);
  min-height: 48px;
  padding: var(--h-esp-2) var(--h-esp-4);
  border: 2px dashed var(--h-bordure);
  border-radius: 999px;
  background: transparent;
  color: var(--h-texte);
  font-size: 1.02rem;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.demo-tuile i { color: var(--h-fauve); }
.demo-tuile:hover { border-style: solid; border-color: var(--h-fauve); background: color-mix(in srgb, var(--h-fauve) 7%, transparent); }
.demo-tuile:focus-visible { outline: 3px solid var(--h-focus); outline-offset: 2px; }

/* ── Actions + compteur d'essais ─────────────────────────────────────────────────────────────── */
.demo-actions {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--h-esp-4);
  margin-top: var(--h-esp-5);
}
.demo-actions .h-bouton { width: auto; }
/* Bouton « Demander » désactivé (limite atteinte / envoi en cours) : visiblement estompé et non cliquable,
   pour qu'il ne semble jamais encore actif. */
.demo-actions .h-bouton:disabled,
.demo-actions .h-bouton[disabled] {
  opacity: .45; cursor: not-allowed; filter: none; transform: none; pointer-events: none;
}
.demo-restants {
  margin: 0;
  font-size: 1rem;
  color: var(--h-texte-doux, #6B6257);
}
.demo-restants.is-epuise { color: var(--h-alerte); font-weight: 600; }

/* ── Zone de réponse ─────────────────────────────────────────────────────────────────────────── */
.demo-reponse {
  background: var(--h-surface);
  border: 2px solid var(--h-bordure);
  border-radius: var(--h-rayon-2, 18px);
  padding: var(--h-esp-5);
  margin: var(--h-esp-5) 0;
  box-shadow: 0 6px 24px rgba(30, 42, 71, .06);
}
.demo-reponse__tete { display: flex; align-items: center; gap: var(--h-esp-3); margin-bottom: var(--h-esp-2); }
.demo-reponse__tete h2 { margin: 0; }
.demo-reponse__mascotte { width: 56px; height: 56px; flex: 0 0 auto; }
.demo-reponse__corps { font-size: 1.3rem; line-height: 1.7; }
/* max-width:none : neutralise le plafond global « p { max-width: 65ch } » (hulotte.css) pour que la
   réponse occupe toute la largeur de la carte. */
.demo-reponse__corps p { margin: 0 0 var(--h-esp-3); max-width: none; }
.demo-reponse__corps .h-mot { border-radius: 4px; }

/* Barre d'écoute (réutilise la logique de ecoute-page.js : .ecp-barre / .ecp-barre--flottante). */
.demo-reponse .ecp-barre { margin: var(--h-esp-4) 0 0; }

/* ── Attente ─────────────────────────────────────────────────────────────────────────────────── */
/* Même gabarit de carte que la boîte de saisie / la réponse, pour ne pas être « écrasée » entre deux
   cadres : surface, bordure douce, padding généreux et marge verticale aérée. */
.demo-attente {
  display: flex; align-items: center; gap: var(--h-esp-4);
  margin: var(--h-esp-6) 0;
  padding: var(--h-esp-5);
  background: var(--h-surface);
  border: 2px solid var(--h-bordure);
  border-radius: var(--h-rayon-2, 18px);
  box-shadow: 0 6px 24px rgba(30, 42, 71, .06);
  font-size: 1.25rem;
  color: var(--h-texte);
}
.demo-attente p { margin: 0; }
.demo-attente__mascotte { width: 64px; height: 64px; flex: 0 0 auto; animation: demo-flotte 1.8s ease-in-out infinite; }
@keyframes demo-flotte { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@media (prefers-reduced-motion: reduce) { .demo-attente__mascotte { animation: none; } }

/* Petites tailles. */
@media (max-width: 520px) {
  .demo-boite, .demo-reponse { padding: var(--h-esp-4); }
  .demo-reponse__corps { font-size: 1.2rem; }
}
