/* Mascote de IA — componente global, acessível e independente das integrações. */
.cp-ai-mascot {
  position: fixed;
  z-index: 70;
  left: clamp(12px, 2vw, 28px);
  bottom: clamp(16px, 2.2vw, 30px);
  width: clamp(82px, 7vw, 112px);
  aspect-ratio: 512 / 428;
  display: grid;
  place-items: center;
  color: #fff;
  text-decoration: none;
  isolation: isolate;
  filter: drop-shadow(0 14px 24px rgba(5, 12, 25, .3));
  animation: cp-ai-float 4.8s ease-in-out infinite, cp-ai-greet 14s ease-in-out infinite;
  transform-origin: 50% 80%;
}

.cp-ai-mascot::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 9% 7% 2%;
  border-radius: 48%;
  background: radial-gradient(circle, rgba(255, 38, 59, .34), transparent 67%);
  animation: cp-ai-glow 2.9s ease-in-out infinite;
}

.cp-ai-mascot img {
  display: block;
  width: 100%;
  height: auto;
  transition: transform .28s ease, filter .28s ease;
}

.cp-ai-mascot:hover img,
.cp-ai-mascot:focus-visible img {
  transform: scale(1.08) rotate(-3deg);
  filter: saturate(1.1) brightness(1.04);
}

.cp-ai-mascot:focus-visible {
  outline: 3px solid #ff263b;
  outline-offset: 6px;
  border-radius: 48%;
}

.cp-ai-label {
  position: absolute;
  left: calc(100% - 5px);
  bottom: 18%;
  min-width: max-content;
  padding: 8px 11px;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 999px;
  background: rgba(13, 19, 28, .94);
  box-shadow: 0 9px 24px rgba(0,0,0,.2);
  font: 800 12px/1.1 Inter, Arial, sans-serif;
  letter-spacing: .01em;
  opacity: 0;
  transform: translateX(-10px) scale(.94);
  pointer-events: none;
  transition: opacity .22s ease, transform .22s ease;
}

.cp-ai-mascot:hover .cp-ai-label,
.cp-ai-mascot:focus-visible .cp-ai-label {
  opacity: 1;
  transform: translateX(0) scale(1);
}

.cp-ai-spark {
  position: absolute;
  z-index: 2;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ff263b;
  box-shadow: 0 0 12px rgba(255, 38, 59, .9);
  opacity: 0;
  pointer-events: none;
}

.cp-ai-spark.s1 { right: 5%; top: 8%; animation: cp-ai-spark 3.6s .2s ease-in-out infinite; }
.cp-ai-spark.s2 { left: 3%; top: 38%; width: 5px; height: 5px; animation: cp-ai-spark 3.6s 1.4s ease-in-out infinite; }
.cp-ai-spark.s3 { right: 11%; bottom: 8%; width: 6px; height: 6px; background: #fff; animation: cp-ai-spark 3.6s 2.4s ease-in-out infinite; }

@keyframes cp-ai-float {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -9px; }
}

@keyframes cp-ai-greet {
  0%, 43%, 48%, 100% { rotate: 0deg; }
  45% { rotate: -4deg; }
  46.5% { rotate: 4deg; }
}

@keyframes cp-ai-glow {
  0%, 100% { opacity: .55; scale: .92; }
  50% { opacity: 1; scale: 1.12; }
}

@keyframes cp-ai-spark {
  0%, 48%, 100% { opacity: 0; transform: scale(.3); }
  55% { opacity: 1; transform: scale(1.25); }
  66% { opacity: 0; transform: translateY(-9px) scale(.5); }
}

@media (max-width: 720px) {
  .cp-ai-mascot { width: 74px; bottom: 14px; left: 10px; }
  .cp-ai-label { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .cp-ai-mascot,
  .cp-ai-mascot::before,
  .cp-ai-spark { animation: none !important; }
  .cp-ai-mascot,
  .cp-ai-mascot img,
  .cp-ai-label { transition: none !important; }
}
