/* ═══════════════════════════════════
   EVO — Widget de Chat (Instituto Danielle Azevedo)
   Mesmo estilo da Evo, tema dourado/IDA.
═══════════════════════════════════ */
:root {
  --evo-gold: #a0783a;
  --evo-gold-soft: rgba(160,120,58,.14);
  --evo-gold-line: rgba(160,120,58,.22);
  --evo-dark: #2a2320;
  --evo-card: #fff;
  --evo-bg: #f6f2ec;
  --evo-dim: #8a7f73;
  --evo-shadow: rgba(0,0,0,.16);
  --evo-wa: #25d366;
}

/* ── Botão flutuante (launcher) ── */
.evo-launcher {
  position: fixed;
  right: 20px;
  bottom: 94px;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(145deg, #b98c47, #8a6630);
  box-shadow: 0 10px 25px rgba(0,0,0,.35);
  cursor: pointer;
  z-index: 999998;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  animation: evoPulse 2.4s ease-in-out infinite;
  transition: transform .2s;
}
.evo-launcher:hover { transform: scale(1.06); }
.evo-launcher img {
  width: 46px;
  height: 46px;
  object-fit: contain;
}
.evo-launcher .evo-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--evo-wa);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
}
.evo-launcher.hidden { display: none; }

@keyframes evoPulse {
  0%   { box-shadow: 0 10px 25px rgba(0,0,0,.35), 0 0 0 0 rgba(160,120,58,.45); }
  70%  { box-shadow: 0 10px 25px rgba(0,0,0,.35), 0 0 0 16px rgba(160,120,58,0); }
  100% { box-shadow: 0 10px 25px rgba(0,0,0,.35), 0 0 0 0 rgba(160,120,58,0); }
}

/* ── Janela do chat ── */
.evo-panel {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 370px;
  max-width: calc(100vw - 40px);
  height: 560px;
  max-height: calc(100vh - 40px);
  background: var(--evo-bg);
  border-radius: 22px;
  box-shadow: 0 24px 60px rgba(0,0,0,.4);
  z-index: 999999;
  display: none;
  flex-direction: column;
  overflow: hidden;
  font-family: 'Poppins', sans-serif;
  animation: evoUp .3s cubic-bezier(.34,1.56,.64,1) both;
}
.evo-panel.open { display: flex; }

@keyframes evoUp {
  from { opacity: 0; transform: translateY(30px) scale(.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Cabeçalho ── */
.evo-head {
  background: linear-gradient(135deg, #8a6630, #b98c47);
  color: #fff;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.evo-head-ava {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255,255,255,.18);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.evo-head-ava img { width: 32px; height: 32px; object-fit: contain; }
.evo-head-info { flex: 1; line-height: 1.2; }
.evo-head-name { font-weight: 600; font-size: 15px; display: flex; align-items: center; gap: 6px; }
.evo-head-sub { font-size: 11px; opacity: .85; }
.evo-online-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #4ade80; display: inline-block;
  box-shadow: 0 0 0 0 rgba(74,222,128,.7);
  animation: evoBlink 1.8s infinite;
}
@keyframes evoBlink {
  0% { box-shadow: 0 0 0 0 rgba(74,222,128,.6); }
  70% { box-shadow: 0 0 0 6px rgba(74,222,128,0); }
  100% { box-shadow: 0 0 0 0 rgba(74,222,128,0); }
}
.evo-close {
  background: rgba(255,255,255,.18);
  border: none;
  color: #fff;
  width: 30px; height: 30px;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s;
  flex-shrink: 0;
}
.evo-close:hover { background: rgba(255,255,255,.3); }

/* ── Barra de handoff (falar com humano) ── */
.evo-handoff {
  padding: 8px 16px;
  background: rgba(37,211,102,.06);
  border-bottom: 1px solid rgba(37,211,102,.14);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.evo-handoff-txt { flex: 1; font-size: 11px; color: var(--evo-dim); }
.evo-handoff-btn {
  background: var(--evo-wa);
  color: #fff;
  font-size: 11.5px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 18px;
  text-decoration: none;
  white-space: nowrap;
}

/* ── Área de mensagens ── */
.chat-area {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scrollbar-width: thin;
  scrollbar-color: var(--evo-gold-line) transparent;
}
.chat-area::-webkit-scrollbar { width: 4px; }
.chat-area::-webkit-scrollbar-thumb { background: var(--evo-gold-line); border-radius: 2px; }

/* ── Mensagens ── */
.msg {
  max-width: 86%;
  padding: 11px 14px;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.55;
  animation: evoFade .28s cubic-bezier(.34,1.56,.64,1) both;
}
.msg.bot {
  background: var(--evo-card);
  border: 1px solid var(--evo-gold-line);
  border-radius: 4px 14px 14px 14px;
  align-self: flex-start;
  color: var(--evo-dark);
  box-shadow: 0 2px 10px var(--evo-shadow);
}
.msg.bot strong { color: var(--evo-gold); }
.msg.user {
  background: linear-gradient(135deg, #b98c47, #8a6630);
  border-radius: 14px 4px 14px 14px;
  align-self: flex-end;
  color: #fff;
  font-weight: 500;
}
@keyframes evoFade {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Etiquetas das mensagens ── */
.mlbl {
  font-size: 10px;
  color: var(--evo-dim);
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  gap: 5px;
}
.mlbl.u { justify-content: flex-end; }
.mlbl-ava { width: 20px; height: 20px; object-fit: contain; }

/* ── Indicador "digitando" ── */
.typing-dot {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  background: var(--evo-card);
  border: 1px solid var(--evo-gold-line);
  border-radius: 4px 14px 14px 14px;
  align-self: flex-start;
  width: max-content;
  animation: evoFade .28s ease both;
}
.typing-dot img { width: 30px; height: 30px; object-fit: contain; animation: evoBob 1s ease-in-out infinite; }
.typing-dot span { width: 6px; height: 6px; background: var(--evo-gold); border-radius: 50%; animation: evoTd 1.2s infinite; }
.typing-dot span:nth-child(3) { animation-delay: .2s; }
.typing-dot span:nth-child(4) { animation-delay: .4s; }
@keyframes evoTd { 0%,60%,100% { opacity: .3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }
@keyframes evoBob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }

/* ── Chips (respostas rápidas) ── */
.inline-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding: 4px 0 10px;
  transition: opacity .25s;
  justify-content: flex-end;
}
.qrb {
  font-size: 12px;
  padding: 8px 13px;
  background: var(--evo-card);
  border: 1.5px solid var(--evo-gold-line);
  border-radius: 20px;
  color: var(--evo-gold);
  cursor: pointer;
  font-family: 'Poppins', sans-serif;
  transition: all .2s;
  text-decoration: none;
  display: inline-block;
}
.qrb:hover { background: var(--evo-gold-soft); }
.qrb-wa { background: rgba(37,211,102,.1); border-color: rgba(37,211,102,.5); color: #1ba94c; }
.qrb-back { opacity: .55; font-size: 11.5px; }

/* ── Responsivo ── */
@media (max-width: 600px) {
  .evo-panel {
    left: 0; right: 0; bottom: 0;
    width: 100%;
    max-width: 100%;
    height: 86vh;
    max-height: 86vh;
    border-radius: 22px 22px 0 0;
  }
  .evo-launcher { width: 56px; height: 56px; right: 16px; bottom: 90px; }
  .evo-launcher img { width: 42px; height: 42px; }
}
