/* Vox mic — paridade com mascote_vox_painel_de_ia.html */
.cv-mascote-host {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
}
.cv-mascote-host--launcher {
  pointer-events: none;
}
.cv-mascote-stage {
  --vox-bg-stage: #0f172a;
  background: radial-gradient(circle at center, #334155 0%, var(--vox-bg-stage) 100%);
  border-radius: 1rem;
  min-height: 450px;
  height: 450px;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  box-shadow: inset 0 10px 30px rgba(0, 0, 0, 0.6);
  border: 3px solid #cbd5e1;
  cursor: crosshair;
}
.cv-mascote-stage.no-bg {
  background: transparent;
  box-shadow: none;
  border-color: transparent;
}
.cv-mascote-host--stage {
  width: 100%;
  height: 100%;
  position: absolute;
  inset: 0;
}
/* Launcher — só o mascote, sem prato; o botão inteiro abre/fecha */
.cv-chat.has-mascote {
  right: var(--cv-pos-right, 24px);
  bottom: var(--cv-pos-bottom, 24px);
}
.cv-chat-launcher.has-mascote,
.cv-chat.is-open .cv-chat-launcher.has-mascote {
  width: calc(128px * var(--cv-launcher-scale, 0.72) / 0.72 * 0.82);
  height: calc(180px * var(--cv-launcher-scale, 0.72) / 0.72 * 0.82);
  overflow: visible;
  padding: 0;
  background: transparent !important;
  box-shadow: none !important;
  border: 0 !important;
  border-radius: 0;
}
.cv-chat-launcher.has-mascote .cv-chat-ico-abrir,
.cv-chat-launcher.has-mascote .cv-chat-ico-fechar { display: none !important; }
.cv-chat-launcher.has-mascote .cv-mascote-host--launcher {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.cv-chat.is-open .cv-chat-launcher.has-mascote .cv-mascote-host { display: flex; }
.cv-chat-launcher.has-mascote .cv-chat-badge {
  z-index: 4;
  top: 8px;
  right: 18px;
}
.cv-chat-launcher .cv-mascote {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: none;
}
.cv-chat-launcher .cv-mascote-figure {
  transform: scale(calc(var(--cv-launcher-scale, 0.72) / 0.72 * 0.82));
  transform-origin: center center;
}
.cv-chat-launcher .cv-mascote-waves { display: none !important; }
.cv-chat-avatar.has-mascote {
  width: calc(44px * var(--cv-avatar-scale, 1));
  height: calc(44px * var(--cv-avatar-scale, 1));
  overflow: hidden;
  padding: 0;
  position: relative;
  border-radius: 50%;
  background: #1e293b;
}
.cv-chat-avatar .cv-mascote-host--avatar {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.cv-chat-avatar .cv-mascote {
  position: absolute;
  width: 120px;
  height: 180px;
  left: 50%;
  top: 50%;
  transform: translate(-50%, calc(var(--cv-avatar-y, 78) * -1%)) scale(var(--cv-avatar-crop, 0.58));
  transform-origin: center var(--cv-avatar-y, 78%);
}
.cv-chat-avatar .cv-mascote-figure {
  transform: none;
}
.cv-chat-avatar .mic-capsule,
.cv-chat-avatar .brain-glow,
.cv-chat-avatar .stand-base {
  animation: none !important;
  transform: none !important;
}
.cv-chat-avatar .cv-mascote-waves,
.cv-chat-avatar .arm,
.cv-chat-avatar .stand-base,
.cv-chat-avatar .brain-canvas { display: none !important; }
.cv-mascote-flow {
  position: fixed;
  left: var(--cv-flow-left, 24px);
  bottom: var(--cv-flow-bottom, 24px);
  z-index: 1040;
  width: calc(160px * var(--cv-flow-scale, 1));
  height: calc(200px * var(--cv-flow-scale, 1));
  pointer-events: none;
}
.cv-mascote-flow .cv-mascote-host--flow {
  width: 100%;
  height: 100%;
}
.cv-mascote-flow .cv-mascote-figure {
  transform: scale(calc(0.85 * var(--cv-flow-scale, 1)));
  transform-origin: center 60%;
}
.cv-mascote-var-preview .cv-mascote-flow {
  position: relative;
  left: auto;
  bottom: auto;
}
.cv-mascote-flow .cv-mascote-waves { display: none !important; }
.cv-mascote-flow-label {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  margin: 0;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--vox-primary, #06b6d4);
}

.cv-mascote {
  --vox-primary: #06b6d4;
  --vox-secondary: #1e293b;
  --mascot-scale: 1;
  --brain-glow-base: 0.2;
  --brain-speed: 3s;
  --vox-eye-x: 0px;
  --vox-eye-y: 0px;
  position: relative;
  z-index: 10;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  transform: none;
}
.cv-mascote-figure {
  position: relative;
  z-index: 10;
  transform-origin: center center;
  transition: transform 0.25s ease;
}
.cv-mascote-host--stage .cv-mascote-figure {
  transform: scale(var(--mascot-scale, 1));
}
.cv-mascote-host--stage > .cv-mascote {
  position: absolute;
  inset: 0;
}
.cv-mascote-host--stage .cv-mascote-waves.left { left: 10%; }
.cv-mascote-host--stage .cv-mascote-waves.right { right: 10%; }
.cv-mascote-waves {
  position: absolute;
  display: flex;
  gap: 10px;
  align-items: center;
  opacity: 0.15;
  z-index: 1;
  top: 50%;
  bottom: auto;
  height: auto;
  transform: translateY(-50%);
  transition: opacity 0.3s;
  pointer-events: none;
}
.cv-mascote-waves.left { left: 10%; right: auto; }
.cv-mascote-waves.right { right: 10%; left: auto; }
.cv-mascote-color-swatch {
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: 2px solid var(--bs-border-color);
  border-radius: 50%;
  cursor: pointer;
}
.cv-mascote-waves.is-off { display: none !important; }
.cv-mascote .wave-bar-bg {
  width: 14px;
  background-color: var(--vox-primary);
  border-radius: 7px;
  animation: cvIdleWave 1.5s ease-in-out infinite alternate;
  transition: background-color 0.3s;
}
.cv-mascote .wave-bar-bg:nth-child(1) { height: 40px; animation-delay: 0s; }
.cv-mascote .wave-bar-bg:nth-child(2) { height: 90px; animation-delay: 0.2s; }
.cv-mascote .wave-bar-bg:nth-child(3) { height: 130px; animation-delay: 0.4s; }
.cv-mascote .wave-bar-bg:nth-child(4) { height: 70px; animation-delay: 0.6s; }
@keyframes cvIdleWave {
  0% { transform: scaleY(0.6); }
  100% { transform: scaleY(1.4); }
}
.cv-mascote .mic-capsule {
  width: 120px;
  height: 180px;
  position: relative;
  animation: cvMascoteFloat 4s ease-in-out infinite;
  z-index: 10;
}
@keyframes cvMascoteFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-15px); }
}
.cv-mascote .mic-mesh {
  width: 100%;
  height: 100px;
  background: linear-gradient(135deg, #cbd5e1, #94a3b8);
  border-radius: 60px 60px 0 0;
  border: 4px solid var(--vox-secondary);
  border-bottom: none;
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
  transition: border-color 0.3s;
}
.cv-mascote .mic-mesh::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(15, 23, 42, 0.2) 2px, transparent 2px),
    linear-gradient(90deg, rgba(15, 23, 42, 0.2) 2px, transparent 2px);
  background-size: 8px 8px;
  border-radius: 56px 56px 0 0;
  z-index: 3;
  pointer-events: none;
}
.cv-mascote .brain-glow {
  position: absolute;
  bottom: -20px;
  left: 50%;
  transform: translateX(-50%);
  width: 150px;
  height: 150px;
  background: radial-gradient(circle at center, var(--vox-primary) 0%, transparent 60%);
  opacity: var(--brain-glow-base);
  mix-blend-mode: color-dodge;
  animation: cvBrainPulse var(--brain-speed) ease-in-out infinite alternate;
  transition: all 0.5s ease;
  z-index: 1;
}
@keyframes cvBrainPulse {
  0% { transform: translateX(-50%) scale(0.9); opacity: calc(var(--brain-glow-base) * 0.5); }
  100% { transform: translateX(-50%) scale(1.1); opacity: calc(var(--brain-glow-base) * 1.5); }
}
.cv-mascote .brain-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
}
.cv-mascote .led-ring {
  width: 100%;
  height: 14px;
  background: var(--vox-primary);
  box-shadow: 0 0 20px var(--vox-primary), inset 0 0 5px rgba(255, 255, 255, 0.8);
  border-left: 4px solid var(--vox-secondary);
  border-right: 4px solid var(--vox-secondary);
  box-sizing: border-box;
  z-index: 3;
  transition: all 0.3s;
}
.cv-mascote .mic-body {
  width: 100%;
  height: 70px;
  background: var(--vox-secondary);
  border-radius: 0 0 60px 60px;
  border: 4px solid var(--vox-secondary);
  border-top: none;
  box-sizing: border-box;
  position: relative;
  box-shadow: inset -10px -10px 20px rgba(0, 0, 0, 0.4);
  transition: background-color 0.3s, border-color 0.3s;
}
.cv-mascote .face {
  position: absolute;
  top: 15px;
  left: 50%;
  transform: translateX(-50%);
  width: 65px;
  height: 35px;
  z-index: 4;
}
.cv-mascote .eye-container {
  position: absolute;
  top: 0;
  width: 16px;
  height: 22px;
  background-color: rgba(0, 0, 0, 0.3);
  border-radius: 50px;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  transform: translate(var(--vox-eye-x), var(--vox-eye-y));
}
.cv-mascote .eye-container.left { left: 0; }
.cv-mascote .eye-container.right { right: 0; }
.cv-mascote .eye-pupil {
  width: 16px;
  height: 22px;
  background: var(--vox-primary);
  border-radius: 50px;
  box-shadow: 0 0 10px var(--vox-primary);
  transition: background-color 0.3s, height 0.2s, box-shadow 0.3s;
}
.cv-mascote .mouth {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 18px;
  height: 6px;
  background: var(--vox-primary);
  border-radius: 10px;
  box-shadow: 0 0 10px var(--vox-primary);
  transition: all 0.2s;
}
.cv-mascote .stand-base {
  position: absolute;
  bottom: -60px;
  left: 50%;
  transform: translateX(-50%);
  width: 70px;
  height: 18px;
  background: var(--vox-secondary);
  border-radius: 50%;
  opacity: 0.5;
  animation: cvShadowPulse 4s ease-in-out infinite;
  transition: background-color 0.3s;
}
@keyframes cvShadowPulse {
  0%, 100% { transform: translateX(-50%) scale(1); opacity: 0.5; }
  50% { transform: translateX(-50%) scale(0.8); opacity: 0.25; }
}
.cv-mascote .arm {
  width: 24px;
  height: 24px;
  background: #cbd5e1;
  border: 4px solid var(--vox-secondary);
  border-radius: 50%;
  position: absolute;
  top: 95px;
  z-index: 5;
  transition: all 0.3s ease;
  box-shadow: inset -3px -3px 6px rgba(0, 0, 0, 0.3);
}
.cv-mascote .arm.left { left: -35px; }
.cv-mascote .arm.right { right: -35px; }

/* Ações — piscar na pupila para não anular o translate do olhar */
.cv-mascote.action-idle .eye-pupil {
  transform-origin: center center;
  animation: cvBlink 5.6s ease-in-out infinite;
}
@keyframes cvBlink {
  0%, 88%, 100% { transform: scaleY(1); }
  93% { transform: scaleY(0.08); }
}
.cv-mascote.action-wave .arm.right { animation: cvWaveTech 0.6s ease-in-out infinite alternate; transform-origin: center; }
.cv-mascote.action-wave .mouth { width: 24px; height: 14px; border-radius: 0 0 24px 24px; }
@keyframes cvWaveTech {
  0% { transform: translateY(0) scale(1) rotate(-20deg); }
  100% { transform: translateY(-40px) scale(1.1) rotate(40deg); }
}
.cv-mascote.action-listen { --brain-glow-base: 0.5; --brain-speed: 1s; }
.cv-mascote.action-listen .eye-pupil { height: 26px; }
.cv-mascote.action-listen .mouth { width: 10px; height: 10px; border-radius: 50%; }
.cv-mascote.action-listen .arm.left { transform: translateY(-10px) rotate(15deg); }
.cv-mascote.action-listen .arm.right { transform: translateY(-10px) rotate(-15deg); }
.cv-mascote.action-speak { --brain-glow-base: 0.6; --brain-speed: 0.5s; }
.cv-mascote.action-speak .mouth { animation: cvTalkWave 0.16s ease-in-out infinite alternate; }
.cv-mascote.action-speak.is-pausa-fala .mouth {
  animation: none;
  width: 18px;
  height: 6px;
  border-radius: 10px;
}
.cv-mascote.action-speak .wave-bar-bg { animation-duration: 0.25s; }
.cv-mascote.action-speak .cv-mascote-waves { opacity: 0.5; }
@keyframes cvTalkWave {
  0% { height: 6px; width: 16px; border-radius: 10px; }
  100% { height: 20px; width: 26px; border-radius: 50%; }
}
.cv-mascote.action-think { --brain-glow-base: 0.8; --brain-speed: 0.3s; }
.cv-mascote.action-think .eye-pupil {
  height: 14px;
  background: transparent;
  border: 3px solid var(--vox-primary);
  box-shadow: none;
  animation: cvSpinEye 1s linear infinite;
}
.cv-mascote.action-think .mouth { width: 8px; height: 8px; border-radius: 50%; }
.cv-mascote.action-think .mic-capsule { animation: cvHoverThink 2s ease-in-out infinite; }
@keyframes cvSpinEye { 100% { transform: rotate(360deg); } }
@keyframes cvHoverThink {
  0%, 100% { transform: translateY(-10px); }
  50% { transform: translateY(-25px); }
}
.cv-mascote.action-error { --brain-glow-base: 0.6; --brain-speed: 0.2s; }
.cv-mascote.action-error .eye-pupil { height: 6px; border-radius: 4px; }
.cv-mascote.action-error .eye-container.left .eye-pupil { transform: rotate(15deg); }
.cv-mascote.action-error .eye-container.right .eye-pupil { transform: rotate(-15deg); }
.cv-mascote.action-error .mouth {
  width: 24px;
  height: 6px;
  border-radius: 2px;
  animation: cvGlitchMouth 0.1s infinite;
}
.cv-mascote.action-error .mic-capsule { animation: cvShakeError 0.4s infinite; }
@keyframes cvGlitchMouth {
  0% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-55%) translateY(2px) rotate(5deg); }
  100% { transform: translateX(-45%) translateY(-2px) rotate(-5deg); }
}
@keyframes cvShakeError {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-3px) rotate(-2deg); }
  75% { transform: translateX(3px) rotate(2deg); }
}
.cv-mascote.action-cheer { --brain-glow-base: 0.7; --brain-speed: 0.6s; }
.cv-mascote.action-cheer .eye-pupil {
  background: transparent;
  border-top: 5px solid var(--vox-primary);
  border-radius: 50% 50% 0 0;
  height: 12px;
  box-shadow: none;
  margin-top: 6px;
}
.cv-mascote.action-cheer .mouth { width: 28px; height: 16px; border-radius: 0 0 28px 28px; }
.cv-mascote.action-cheer .arm.left,
.cv-mascote.action-cheer .arm.right {
  transform: translateY(-55px);
  background: var(--vox-primary);
  border-color: var(--vox-primary);
}
.cv-mascote.action-cheer .mic-capsule { animation: cvBounceCheer 0.4s ease-in-out infinite alternate; }
@keyframes cvBounceCheer {
  0% { transform: translateY(0); }
  100% { transform: translateY(-30px); }
}
.cv-mascote.is-swapping { animation: cvSwap 0.45s ease; }
@keyframes cvSwap {
  0% { opacity: 1; filter: brightness(1); }
  50% { opacity: 0.2; filter: brightness(1.8); }
  100% { opacity: 1; filter: brightness(1); }
}

/* Admin — painel de ações (protótipo) */
.cv-mascote-btn-action {
  border: 2px solid var(--bs-border-color);
  background: var(--bs-body-bg);
  color: var(--bs-body-color);
  padding: 0.65rem 0.75rem;
  border-radius: 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  width: 100%;
  transition: all 0.2s;
}
.cv-mascote-btn-action:hover {
  border-color: var(--vox-primary, var(--bs-primary));
  color: var(--vox-primary, var(--bs-primary));
  transform: translateY(-2px);
}
.cv-mascote-btn-action.active {
  background: var(--vox-primary, var(--bs-primary));
  color: #fff;
  border-color: var(--vox-primary, var(--bs-primary));
}
.cv-mascote-status {
  color: var(--vox-primary, var(--bs-primary));
  min-height: 1.75rem;
  font-weight: 600;
}

@media (prefers-reduced-motion: reduce) {
  .cv-mascote .mic-capsule,
  .cv-mascote .brain-glow,
  .cv-mascote .stand-base,
  .cv-mascote .wave-bar-bg,
  .cv-mascote.action-idle .eye-pupil,
  .cv-mascote.action-speak .mouth,
  .cv-mascote.action-think .eye-pupil,
  .cv-mascote.action-error .mic-capsule,
  .cv-mascote.action-cheer .mic-capsule { animation: none !important; }
}
