/* =========================================================
   Widget de captação de lead estilo chat (ASF Advogados)
   Segue a paleta de public/css/asf.css (preto + dourado)
   ========================================================= */
/* Substitui o botão flutuante de WhatsApp: o chat assume o mesmo lugar/protagonismo */
.floating-whatsapp { display: none !important; }

.asf-chat-launcher {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 950;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  padding: 0;
  background: linear-gradient(135deg, #f6e3b6 0%, var(--gold-2, #c9a253) 45%, var(--gold, #b1842f) 100%);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 14px 34px rgba(177,132,47,.4);
  transition: transform .2s var(--ease, ease), box-shadow .2s ease;
}
.asf-chat-launcher:hover { transform: translateY(-2px) scale(1.04); box-shadow: 0 20px 44px rgba(177,132,47,.5); }
.asf-chat-launcher svg { width: 24px; height: 24px; fill: #1a1305; flex-shrink: 0; }
.asf-chat-launcher .asf-online-dot { position: absolute; top: 2px; right: 2px; border: 2px solid #f6e3b6; }
.asf-chat-launcher.is-hidden { display: none; }

.asf-online-dot {
  position: relative;
  display: inline-block;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: #2ecc71;
  flex-shrink: 0;
  box-shadow: 0 0 0 rgba(46, 204, 113, .55);
  animation: asfOnlinePulse 2.2s infinite;
}
@keyframes asfOnlinePulse {
  0% { box-shadow: 0 0 0 0 rgba(46, 204, 113, .55); }
  70% { box-shadow: 0 0 0 6px rgba(46, 204, 113, 0); }
  100% { box-shadow: 0 0 0 0 rgba(46, 204, 113, 0); }
}

@media (max-width: 680px) {
  .asf-chat-launcher { right: 16px; bottom: 88px; width: 48px; height: 48px; }
  .asf-chat-launcher svg { width: 20px; height: 20px; }
}

.asf-chat-panel {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 960;
  width: min(380px, calc(100vw - 32px));
  max-height: min(560px, calc(100vh - 48px));
  display: flex;
  flex-direction: column;
  background: var(--black, #0c0b0a);
  border: 1px solid rgba(236, 195, 117, .25);
  border-radius: 18px;
  box-shadow: var(--shadow-dark, 0 24px 70px rgba(0,0,0,.5));
  overflow: hidden;
  opacity: 0;
  transform: translateY(16px) scale(.98);
  pointer-events: none;
  transition: opacity .25s var(--ease, ease), transform .25s var(--ease, ease);
}
.asf-chat-panel.is-open { opacity: 1; transform: none; pointer-events: auto; }

@media (max-width: 680px) {
  .asf-chat-panel {
    left: 12px;
    right: 12px;
    bottom: 12px;
    width: auto;
    max-height: min(78vh, 620px);
  }
}

.asf-chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  background: linear-gradient(135deg, rgba(236,195,117,.14), transparent);
  border-bottom: 1px solid rgba(236, 195, 117, .18);
}
.asf-chat-head__id { display: flex; align-items: center; gap: 10px; }
.asf-chat-avatar {
  position: relative;
  width: 38px; height: 38px;
  border-radius: 50%;
  background: linear-gradient(150deg, rgba(236,195,117,.35), rgba(177,132,47,.15));
  border: 1px solid rgba(236,195,117,.4);
  display: grid; place-items: center;
  color: var(--gold-bright, #ecc375);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 700; font-size: .78rem; letter-spacing: .02em;
  flex-shrink: 0;
}
.asf-chat-avatar .asf-online-dot { position: absolute; right: -1px; bottom: -1px; border: 2px solid var(--black, #0c0b0a); }
.asf-chat-head strong { color: #f4ead2; font-family: "Cormorant Garamond", Georgia, serif; font-size: 1.15rem; font-weight: 700; }
.asf-chat-head__status { display: flex; align-items: center; gap: 5px; color: #6fd394; font-size: .78rem; margin-top: 2px; font-weight: 600; }
.asf-chat-head__actions { display: flex; align-items: center; gap: 2px; }
.asf-chat-head__whats {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 50%;
  color: #6fd394; background: rgba(46,204,113,.12);
  transition: background .15s ease, color .15s ease;
}
.asf-chat-head__whats:hover { background: #1fae53; color: #08210f; }
.asf-chat-head__whats svg { width: 16px; height: 16px; }
.asf-chat-close {
  background: transparent; border: none; color: #a89a76; font-size: 1.3rem; line-height: 1; cursor: pointer; padding: 4px 8px;
}
.asf-chat-close:hover { color: var(--gold-bright, #ecc375); }

.asf-chat-body { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.asf-chat-body::-webkit-scrollbar { width: 6px; }
.asf-chat-body::-webkit-scrollbar-thumb { background: rgba(236,195,117,.3); border-radius: 3px; }

.asf-msg { max-width: 88%; padding: 10px 13px; border-radius: 14px; font-size: .9rem; line-height: 1.45; }
.asf-msg--bot { align-self: flex-start; background: #1a1712; color: #ece4d0; border-bottom-left-radius: 4px; }
.asf-msg--user { align-self: flex-end; background: var(--gold, #b1842f); color: #17130a; font-weight: 600; border-bottom-right-radius: 4px; }

.asf-chat-choices { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 2px; }
.asf-chat-choices button, .asf-chat-choices a {
  display: inline-flex; align-items: center; gap: 6px;
  background: transparent; border: 1px solid rgba(236,195,117,.4); color: #ecc375;
  border-radius: 999px; padding: 8px 14px; font-size: .85rem; font-weight: 600; cursor: pointer;
  text-decoration: none; transition: background .15s ease, color .15s ease;
}
.asf-chat-choices button:hover, .asf-chat-choices a:hover { background: var(--gold, #b1842f); color: #17130a; }
.asf-chat-choices__whats { border-color: rgba(46,204,113,.45) !important; color: #6fd394 !important; font-weight: 700 !important; }
.asf-chat-choices__whats:hover { background: #1fae53 !important; color: #08210f !important; }

.asf-chat-form { display: flex; gap: 8px; padding: 12px 14px; border-top: 1px solid rgba(236,195,117,.18); }
.asf-chat-form input, .asf-chat-form textarea {
  flex: 1; background: #1a1712; border: 1px solid rgba(236,195,117,.25); color: #f4ead2;
  border-radius: 10px; padding: 10px 12px; font-size: 16px; resize: none;
}
.asf-chat-form input::placeholder, .asf-chat-form textarea::placeholder { color: #7c735c; }
.asf-chat-form input:focus, .asf-chat-form textarea:focus { outline: none; border-color: var(--gold-bright, #ecc375); }
.asf-chat-send {
  background: var(--gold, #b1842f); color: #17130a; border: none; border-radius: 10px;
  padding: 0 16px; font-weight: 700; cursor: pointer; flex-shrink: 0;
}
.asf-chat-send:disabled { opacity: .5; cursor: default; }

.asf-chat-typing { display: inline-flex; gap: 4px; align-self: flex-start; padding: 10px 13px; background: #1a1712; border-radius: 14px; border-bottom-left-radius: 4px; }
.asf-chat-typing span { width: 6px; height: 6px; border-radius: 50%; background: #a89a76; animation: asfTypingBounce 1.1s infinite ease-in-out; }
.asf-chat-typing span:nth-child(2) { animation-delay: .15s; }
.asf-chat-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes asfTypingBounce { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-4px); opacity: 1; } }

.asf-chat-honeypot { position: absolute; left: -9999px; top: -9999px; }
