/* LucIAno: mascote no canto inferior direito, balão em sanfona e painel de conversa. */
.chatbot-widget { position: fixed; right: 20px; bottom: 20px; z-index: 600; font-family: var(--fonte-texto, "Montserrat", "Segoe UI", Arial, sans-serif); }
.chatbot-mascote {
  position: relative; isolation: isolate; float: right; width: 104px; height: 104px; padding: 0; border: 0; border-radius: 50%;
  background: transparent; cursor: pointer; transition: transform .2s ease;
}
.chatbot-mascote:hover { transform: translateY(-3px) scale(1.04); }
.chatbot-mascote:focus-visible { outline: 3px solid var(--cor-ciano, #00D4FF); outline-offset: 3px; }
.chatbot-mascote picture, .chatbot-mascote img { display: block; width: 104px; height: 104px; }
.chatbot-mascote img { filter: drop-shadow(0 6px 10px rgba(6, 18, 38, .35)); transform-origin: 50% 80%; animation: chatbot-mascote 20s ease-in-out infinite; }
.chatbot-mascote::before { content: ""; position: absolute; inset: 6px; border-radius: 50%; z-index: -1; pointer-events: none; animation: chatbot-halo 20s ease-out infinite; }
.chatbot-mascote:hover img, .chatbot-mascote:focus-visible img, .chatbot-mascote:hover::before, .chatbot-mascote:focus-visible::before { animation-play-state: paused; }
.chatbot-widget:has(.chatbot-painel:not([hidden])) .chatbot-mascote img,
.chatbot-widget:has(.chatbot-painel:not([hidden])) .chatbot-mascote::before { animation: none; }

.chatbot-balao {
  position: absolute; right: 116px; bottom: 34px; white-space: nowrap; display: flex; align-items: center; gap: 10px;
  background: #fff; color: #1B2A3F; border: 1px solid #E2E8F0; border-radius: 14px; min-height: 52px; padding: 14px 16px 14px 20px;
  font-size: 1rem; font-weight: 600; box-shadow: 0 8px 22px rgba(6, 18, 38, .18);
}
.chatbot-balao::after { content: ""; position: absolute; right: -8px; bottom: 22px; width: 12px; height: 12px; background: #fff; border-right: 1px solid #E2E8F0; border-top: 1px solid #E2E8F0; transform: rotate(45deg); }
.chatbot-balao[hidden] { display: none; }
.chatbot-balao-fechar { border: 0; background: none; color: #5A6B82; font-size: 1.25rem; line-height: 1; cursor: pointer; padding: 0 2px; }
.chatbot-balao.sanfona { transform-origin: right center; transform: scaleX(0); opacity: 0; pointer-events: none; transition: transform .5s ease, opacity .5s ease; }
.chatbot-balao.sanfona.aberto { transform: scaleX(1); opacity: 1; pointer-events: auto; }
.chatbot-balao.sanfona span { opacity: 0; transition: opacity .3s ease; }
.chatbot-balao.sanfona.aberto span { opacity: 1; transition-delay: .3s; }

.chatbot-painel {
  position: absolute; right: 0; bottom: 116px; width: min(380px, calc(100vw - 32px)); height: min(540px, calc(100vh - 140px));
  display: flex; flex-direction: column; overflow: hidden; background: #fff; color: #1B2A3F;
  border-radius: 16px; border: 1px solid #E2E8F0; box-shadow: 0 18px 46px rgba(6, 18, 38, .3); animation: chatbot-entrar .25s ease both;
}
.chatbot-painel[hidden] { display: none; }
.chatbot-painel-topo { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; color: #fff; font-size: 1rem; background: linear-gradient(120deg, #0A1A33, #0878E8); }
.chatbot-painel-fechar { border: 0; background: none; color: #fff; font-size: 1.625rem; line-height: 1; cursor: pointer; }
.chatbot-mensagens { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; background: #F3F6FA; }
.chatbot-msg { max-width: 86%; padding: 10px 14px; border-radius: 14px; font-size: 0.9375rem; line-height: 1.45; white-space: pre-wrap; word-wrap: break-word; }
.chatbot-msg-bot { align-self: flex-start; background: #fff; border: 1px solid #E2E8F0; border-bottom-left-radius: 4px; }
.chatbot-msg-user { align-self: flex-end; background: #0878E8; color: #fff; border-bottom-right-radius: 4px; }
.chatbot-msg a { color: inherit; text-decoration: underline; font-weight: 700; word-break: break-all; }
.chatbot-msg-bot a { color: #0878E8; }
.chatbot-digitando { align-self: flex-start; display: inline-flex; gap: 5px; padding: 12px 14px; background: #fff; border: 1px solid #E2E8F0; border-radius: 14px; }
.chatbot-digitando span { width: 7px; height: 7px; border-radius: 50%; background: #9aa8bb; animation: chatbot-pontos 1s infinite ease-in-out; }
.chatbot-digitando span:nth-child(2) { animation-delay: .15s; }
.chatbot-digitando span:nth-child(3) { animation-delay: .3s; }

.chatbot-form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid #E2E8F0; background: #fff; }
.chatbot-form input { flex: 1; min-width: 0; height: 44px; padding: 0 12px; border: 1px solid #cbd5e1; border-radius: 8px; font: inherit; font-size: 1rem; color: #1B2A3F; background: #fff; }
.chatbot-form input:focus { outline: none; border-color: #0878E8; box-shadow: 0 0 0 2px rgba(8, 120, 232, .2); }
.chatbot-form button { height: 44px; padding: 0 16px; border: 0; border-radius: 8px; background: #0878E8; color: #fff; font: inherit; font-weight: 700; font-size: 0.9375rem; cursor: pointer; }
.chatbot-form button:disabled { opacity: .55; cursor: wait; }

.chatbot-botoes { display: flex; flex-wrap: wrap; gap: 8px; align-self: flex-start; }
.chatbot-botao-link { display: inline-block; padding: 8px 14px; border-radius: 999px; border: 1px solid #0878E8; color: #0878E8; background: #fff; font: inherit; font-size: 0.875rem; font-weight: 700; text-decoration: none; cursor: pointer; text-align: left; }
.chatbot-botao-link:hover, .chatbot-botao-link:focus-visible { background: #0878E8; color: #fff; outline: none; }
.chatbot-contato { display: flex; flex-direction: column; gap: 10px; align-self: stretch; padding: 14px; background: #fff; border: 1px solid #E2E8F0; border-radius: 12px; }
.chatbot-contato-rotulo { display: flex; flex-direction: column; gap: 4px; font-size: 0.875rem; font-weight: 700; }
.chatbot-contato input[type="text"], .chatbot-contato textarea { width: 100%; min-height: 42px; padding: 8px 12px; border: 1px solid #cbd5e1; border-radius: 8px; font: inherit; font-size: 1rem; color: #1B2A3F; background: #fff; box-sizing: border-box; }
.chatbot-contato textarea { resize: vertical; }
.chatbot-contato input:focus, .chatbot-contato textarea:focus { outline: none; border-color: #0878E8; }
.chatbot-contato-aut { display: flex; gap: 8px; align-items: flex-start; font-size: 0.8125rem; line-height: 1.4; }
.chatbot-contato-aut input { margin-top: 3px; }
.chatbot-contato-erro { margin: 0; color: #b91c1c; font-size: 0.875rem; font-weight: 600; }
.chatbot-contato-enviar { height: 44px; border: 0; border-radius: 8px; background: #0878E8; color: #fff; font: inherit; font-weight: 700; font-size: 0.9375rem; cursor: pointer; }
.chatbot-contato-enviar:disabled { opacity: .55; cursor: wait; }
.chatbot-isca { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

@keyframes chatbot-entrar { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes chatbot-pontos { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
/* Ciclo de 20s: respiração, anel de luz, aceno, anel, pulinho, respiração. Um efeito por vez. */
@keyframes chatbot-mascote {
  0%, 4%, 8%, 25%, 30.5%, 55%, 61%, 70%, 78%, 100% { transform: none; }
  4% { transform: scale(1.04); }
  26% { transform: rotate(-4deg); } 27.5% { transform: rotate(4deg); } 29% { transform: rotate(-2deg); }
  58% { transform: translateY(-6px); }
  74% { transform: scale(1.04); }
}
@keyframes chatbot-halo {
  0%, 39%, 49%, 100% { box-shadow: 0 0 0 0 transparent; }
  40% { box-shadow: 0 0 0 0 rgba(0, 212, 255, .55); }
  48% { box-shadow: 0 0 0 18px rgba(0, 212, 255, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .chatbot-painel, .chatbot-digitando span, .chatbot-mascote img, .chatbot-mascote::before { animation: none; }
  .chatbot-balao.sanfona, .chatbot-balao.sanfona span { transition: none; transform: none; }
  .chatbot-balao.sanfona:not(.aberto) { opacity: 0; }
}
[data-movimento="reduzido"] .chatbot-mascote img, [data-movimento="reduzido"] .chatbot-mascote::before { animation: none; }
[data-movimento="reduzido"] .chatbot-balao.sanfona { transition: none; transform: none; }
@media (max-width: 600px) {
  .chatbot-widget { right: 12px; bottom: 12px; }
  .chatbot-mascote, .chatbot-mascote picture, .chatbot-mascote img { width: 88px; height: 88px; }
  .chatbot-balao { right: 98px; bottom: 26px; font-size: 0.9375rem; }
  .chatbot-painel { bottom: 100px; }
}

/* Destaque do "IA" no nome do atendente (LucIAno) */
.chatbot-ia { font-weight: 800; }
.chatbot-painel-topo strong { font-weight: 500; }
.chatbot-painel-topo strong .chatbot-ia { font-weight: 800; }
.chatbot-balao span { font-weight: 500; }
.chatbot-balao .chatbot-ia { font-weight: 800; }
