/* ===== Widget de chat ===== */
#dq-chat-toggle {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 200;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  color: #04101f;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
  transition: transform .15s ease;
}
#dq-chat-toggle:hover { transform: translateY(-2px); }
#dq-chat-toggle svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
#dq-chat-toggle .dq-chat-icon-close { display: none; }
#dq-chat-toggle[aria-expanded="true"] .dq-chat-icon-open { display: none; }
#dq-chat-toggle[aria-expanded="true"] .dq-chat-icon-close { display: block; }

#dq-chat-panel {
  position: fixed;
  right: 24px;
  bottom: 94px;
  z-index: 200;
  width: 380px;
  max-width: calc(100vw - 32px);
  height: 560px;
  max-height: calc(100vh - 140px);
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius);
  box-shadow: 0 30px 80px rgba(0,0,0,.35);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
#dq-chat-panel[hidden] { display: none; }

.dq-chat-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--surface-border);
  background: var(--bg-alt);
}
.dq-chat-header strong { font-family: 'Space Grotesk', sans-serif; font-size: .98rem; }
.dq-chat-header span { display: block; font-size: .76rem; color: var(--text-muted); margin-top: 2px; }
.dq-chat-header button {
  background: none;
  border: none;
  font-size: 1.4rem;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px 4px;
}
.dq-chat-header button:hover { color: var(--text); }

.dq-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dq-msg {
  max-width: 88%;
  padding: 10px 13px;
  border-radius: 14px;
  font-size: .92rem;
  line-height: 1.45;
  white-space: pre-wrap;
}
.dq-msg-assistant {
  align-self: flex-start;
  background: var(--bg-alt);
  border: 1px solid var(--surface-border);
  border-bottom-left-radius: 4px;
}
.dq-msg-user {
  align-self: flex-end;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  color: #04101f;
  border-bottom-right-radius: 4px;
}
.dq-msg-system {
  align-self: center;
  background: transparent;
  color: var(--text-muted);
  font-size: .8rem;
  text-align: center;
  max-width: 100%;
}

.dq-typing { display: inline-flex; gap: 4px; align-items: center; padding: 4px 0; }
.dq-typing span {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--text-muted);
  animation: dq-blink 1.2s infinite ease-in-out;
}
.dq-typing span:nth-child(2) { animation-delay: .2s; }
.dq-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes dq-blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }

.dq-chat-actions { display: flex; gap: 8px; align-self: flex-start; flex-wrap: wrap; }
.dq-chat-actions button {
  font-size: .85rem;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--surface-border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}
.dq-chat-actions button.dq-primary {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  color: #04101f;
  border-color: transparent;
}
.dq-chat-actions button:hover { border-color: var(--accent-text); }

.dq-lead-form {
  align-self: stretch;
  background: var(--bg-alt);
  border: 1px solid var(--surface-border);
  border-radius: 14px;
  padding: 14px;
  display: grid;
  gap: 8px;
}
.dq-lead-form input {
  background: var(--bg);
  border: 1px solid var(--surface-border);
  border-radius: 8px;
  padding: 9px 11px;
  color: var(--text);
  font: inherit;
  font-size: .88rem;
}
.dq-lead-form input:focus { outline: none; border-color: var(--accent-text); }
.dq-lead-form button {
  margin-top: 2px;
  padding: 9px;
  border-radius: 8px;
  border: none;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  color: #04101f;
  font-weight: 600;
  font-size: .88rem;
  cursor: pointer;
}
.dq-lead-form small { color: var(--text-muted); font-size: .74rem; }

.dq-chat-form {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--surface-border);
}
.dq-chat-form input {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--surface-border);
  border-radius: 999px;
  padding: 10px 14px;
  color: var(--text);
  font: inherit;
  font-size: .9rem;
}
.dq-chat-form input:focus { outline: none; border-color: var(--accent-text); }
.dq-chat-form button {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  color: #04101f;
  font-size: 1rem;
  cursor: pointer;
  flex-shrink: 0;
}
.dq-chat-form button:disabled { opacity: .5; cursor: not-allowed; }

.dq-chat-call-cta {
  margin: 0 12px 12px;
  padding: 9px;
  border-radius: 999px;
  border: 1px solid var(--surface-border);
  background: transparent;
  color: var(--text-muted);
  font-size: .82rem;
  cursor: pointer;
}
.dq-chat-call-cta:hover { border-color: var(--accent-text); color: var(--accent-text); }

@media (max-width: 480px) {
  #dq-chat-panel {
    right: 12px;
    left: 12px;
    bottom: 88px;
    width: auto;
    max-width: none;
    height: calc(100vh - 120px);
  }
  #dq-chat-toggle { right: 16px; bottom: 16px; }
}
