/* ============================================================
   Widget de chat da Elida — aparece no momento do pitch da VSL
   Paleta: verde oficial da página (#009515 → #036512)
   ============================================================ */

#elida-chat-btn {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 99990;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 3px solid #009515;
  background: #fff;
  padding: 0;
  cursor: pointer;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .28);
  transition: transform .2s ease;
}
#elida-chat-btn:hover { transform: scale(1.06); }
#elida-chat-btn img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}
#elida-chat-btn .elida-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #00B419;
  border: 2px solid #fff;
}
#elida-chat-btn.elida-pulse::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 3px solid #00B419;
  animation: elida-pulse 1.6s ease-out infinite;
}
@keyframes elida-pulse {
  0%   { transform: scale(1);    opacity: .9; }
  100% { transform: scale(1.45); opacity: 0; }
}

#elida-chat-panel {
  position: fixed;
  right: 20px;
  bottom: 96px;
  z-index: 99991;
  width: 370px;
  max-width: calc(100vw - 24px);
  height: 520px;
  max-height: calc(100vh - 120px);
  display: none;
  flex-direction: column;
  background: #ECE5DD;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 12px 48px rgba(0, 0, 0, .35);
  font-family: "Montserrat", Sans-serif;
}
#elida-chat-panel.open { display: flex; }

.elida-chat-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background-image: linear-gradient(180deg, #009515 0%, #036512 100%);
  color: #fff;
}
.elida-chat-header img {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, .7);
}
.elida-chat-header .elida-h-name {
  font-family: "Exo 2", Sans-serif;
  font-weight: 700;
  font-size: 16px;
  line-height: 1.2;
}
.elida-chat-header .elida-h-status {
  font-size: 11.5px;
  opacity: .92;
  display: flex;
  align-items: center;
  gap: 5px;
}
.elida-chat-header .elida-h-status::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #7CFF8E;
}
.elida-chat-close {
  margin-left: auto;
  background: none;
  border: none;
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 6px;
}

.elida-chat-msgs {
  flex: 1;
  overflow-y: auto;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.elida-msg {
  max-width: 82%;
  padding: 9px 12px;
  border-radius: 12px;
  font-size: 13.5px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-wrap: break-word;
  box-shadow: 0 1px 1px rgba(0, 0, 0, .08);
}
.elida-msg.bot {
  align-self: flex-start;
  background: #fff;
  color: #111;
  border-top-left-radius: 4px;
}
.elida-msg.user {
  align-self: flex-end;
  background: #DCF8C6;
  color: #111;
  border-top-right-radius: 4px;
}
.elida-msg a { color: #036512; font-weight: 700; }

.elida-typing {
  align-self: flex-start;
  background: #fff;
  border-radius: 12px;
  border-top-left-radius: 4px;
  padding: 12px 14px;
  display: flex;
  gap: 4px;
}
.elida-typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #9ab59c;
  animation: elida-blink 1.2s infinite;
}
.elida-typing span:nth-child(2) { animation-delay: .2s; }
.elida-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes elida-blink {
  0%, 80%, 100% { opacity: .25; }
  40% { opacity: 1; }
}

.elida-chat-inputbar {
  display: flex;
  gap: 8px;
  padding: 10px;
  background: #F0F0F0;
}
.elida-chat-inputbar input {
  flex: 1;
  border: 1px solid #d5d5d5;
  border-radius: 22px;
  padding: 10px 15px;
  font-size: 14px;
  font-family: "Montserrat", Sans-serif;
  outline: none;
  background: #fff;
}
.elida-chat-inputbar input:focus { border-color: #009515; }
.elida-chat-send {
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 50%;
  background-image: linear-gradient(180deg, #009515 0%, #036512 100%);
  color: #fff;
  font-size: 17px;
  cursor: pointer;
  flex-shrink: 0;
}
.elida-chat-send:disabled { opacity: .55; cursor: default; }

@media (max-width: 480px) {
  #elida-chat-panel {
    right: 8px;
    left: 8px;
    width: auto;
    bottom: 88px;
    height: 62vh;
  }
}
