/*!
 * voice-ui.css — VOX-1-C (12/06/2026)
 * Overlay vocal PULSE : FAB micro 4 états + bulles transitoires.
 * Charte Graphique Supernova (hex en dur → fichier autoportant, partagé manager + vendeur).
 *   Violet #6C5CE7 (actif) · Ink20 #C4C7D4 (idle manager) · Ink40 #8E92A4 (idle vendeur).
 * Aucune ombre excessive (C3). FAB ancré dans la colonne 375px, au-dessus de la bottom-nav + FAB feedback.
 */

.voice-overlay {
  position: fixed;
  inset: 0 auto 0 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 375px;
  height: 100%;
  pointer-events: none;
  z-index: 60;
}

/* ---- FAB ---- */
.voice-fab {
  position: absolute;
  right: 20px;
  bottom: 144px;            /* au-dessus de la bottom-nav (52px) + FAB feedback (bottom 80px) */
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  pointer-events: auto;
  background: #C4C7D4;       /* idle — Ink20 */
  color: #3D4150;            /* icône idle (contraste sur gris clair), trait 1.5px */
  box-shadow: 0 3px 12px rgba(10,22,40,0.16);
  transition: background 0.18s ease, color 0.18s ease, transform 0.12s ease;
  -webkit-tap-highlight-color: transparent;
}
.voice-fab:active { transform: scale(0.94); }

.voice-fab.voice-listening,
.voice-fab.voice-processing,
.voice-fab.voice-speaking {
  background: #6C5CE7;       /* Violet actif */
  color: #FFFFFF;
}

/* ---- Icônes : visibilité par état ---- */
.voice-fab .vfi { display: none; }
.voice-fab.voice-idle .vfi-mic,
.voice-fab.voice-listening .vfi-mic { display: block; }
.voice-fab.voice-processing .vfi-loader { display: block; }
.voice-fab.voice-speaking .vfi-wave { display: inline-flex; }

/* ---- État listening : pulse box-shadow violet ---- */
.voice-fab.voice-listening {
  animation: voice-pulse 1.5s ease-in-out infinite;
}
@keyframes voice-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(108,92,231,0.45); }
  70%  { box-shadow: 0 0 0 16px rgba(108,92,231,0); }
  100% { box-shadow: 0 0 0 0 rgba(108,92,231,0); }
}

/* ---- État processing : loader en rotation ---- */
.voice-fab.voice-processing .vfi-loader {
  animation: voice-spin 1s linear infinite;
}
@keyframes voice-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* ---- État speaking : onde sonore (3 barres) ---- */
.vfi-wave { align-items: center; gap: 3px; height: 22px; }
.vfi-wave i {
  display: block;
  width: 3px;
  height: 8px;
  border-radius: 2px;
  background: currentColor;
  animation: voice-wave 0.8s ease-in-out infinite;
}
.vfi-wave i:nth-child(2) { animation-delay: 0.18s; }
.vfi-wave i:nth-child(3) { animation-delay: 0.36s; }
@keyframes voice-wave {
  0%, 100% { height: 7px; }
  50%      { height: 20px; }
}

/* ---- Pile bulles + transcription partielle ---- */
.voice-stack {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 212px;            /* juste au-dessus du FAB */
  display: flex;
  flex-direction: column;
  gap: 6px;
  pointer-events: none;
}
.voice-bubble {
  max-width: 82%;
  padding: 8px 12px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.35;
  word-wrap: break-word;
  box-shadow: 0 2px 8px rgba(10,22,40,0.10);
  animation: voice-bubble-in 0.18s ease-out;
}
@keyframes voice-bubble-in {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.voice-bubble-user {
  align-self: flex-end;
  background: #6C5CE7;
  color: #FFFFFF;
  border-bottom-right-radius: 4px;
}
.voice-bubble-assistant {
  align-self: flex-start;
  background: #FFFFFF;
  color: #2A3446;
  border: 1px solid #E8E9EF;
  border-bottom-left-radius: 4px;
}
.voice-partial {
  align-self: flex-end;
  max-width: 88%;
  padding: 6px 11px;
  border-radius: 12px;
  font-size: 13px;
  font-style: italic;
  color: #4A5568;
  background: rgba(255,255,255,0.92);
  border: 1px dashed #C4C7D4;
}

/* ---- Toast discret (erreur micro / connexion) ---- */
.voice-toast {
  position: absolute;
  left: 50%;
  bottom: 90px;
  transform: translateX(-50%);
  max-width: 88%;
  background: #0A1628;
  color: #FFFFFF;
  padding: 9px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 4px 18px rgba(10,22,40,0.30);
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
  white-space: nowrap;
}
.voice-toast.show { opacity: 1; }

/* ============================================================
   Variante VENDEUR (PWA réseau) — mode vocal = option (SL-6)
   48×48, idle Ink40, pas de pulse en idle, violet uniquement au tap.
   ============================================================ */
.voice-overlay.voice-variant-vendeur .voice-fab {
  width: 48px;
  height: 48px;
  bottom: 24px;             /* vendeur.html : pas de bottom-nav, ancrage bas droite */
  background: #8E92A4;      /* idle — Ink40 (moins proéminent) */
  color: #FFFFFF;
  box-shadow: 0 2px 10px rgba(10,22,40,0.14);
}
.voice-overlay.voice-variant-vendeur .voice-fab.voice-listening,
.voice-overlay.voice-variant-vendeur .voice-fab.voice-processing,
.voice-overlay.voice-variant-vendeur .voice-fab.voice-speaking {
  background: #6C5CE7;
  color: #FFFFFF;
}
.voice-overlay.voice-variant-vendeur .voice-stack {
  bottom: 84px;
}
