/* Modal de chat — Agente IA (site público) */

.vaq-agente-modal {
  position: fixed;
  inset: 0;
  z-index: 10075;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.vaq-agente-modal[hidden] {
  display: none !important;
}

.vaq-agente-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
}

.vaq-agente-modal-dialog {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(420px, 100%);
  height: min(640px, 92vh);
  max-height: 92vh;
  overflow: hidden;
  background: #fff;
  border-radius: 12px;
  border: 1px solid rgba(244, 166, 35, 0.35);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

.vaq-agente-modal-header {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1.15rem 0.85rem;
  border-bottom: 1px solid rgba(27, 94, 107, 0.12);
  background: #0E2E33;
}

.vaq-agente-modal-title {
  margin: 0;
  padding-right: 0.5rem;
  font-family: var(--vaq-font-display, Spartan, sans-serif);
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.3;
  color: #fff;
}

.vaq-agente-modal-close {
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.15rem 0.4rem;
  border-radius: 6px;
}

.vaq-agente-modal-close:hover,
.vaq-agente-modal-close:focus-visible {
  color: #F4A623;
  outline: none;
}

.vaq-agente-mensagens {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  background: #f4f7f8;
  -webkit-overflow-scrolling: touch;
}

.vaq-agente-empty {
  margin: auto;
  max-width: 16rem;
  text-align: center;
  color: #5a7a82;
  font-size: 0.9rem;
  line-height: 1.45;
}

.vaq-agente-bubble {
  max-width: 85%;
  padding: 0.65rem 0.85rem;
  border-radius: 14px;
  font-size: 0.92rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.vaq-agente-bubble--user {
  align-self: flex-end;
  background: #2FA89A;
  color: #fff;
  border-bottom-right-radius: 4px;
}

.vaq-agente-bubble--agent {
  align-self: flex-start;
  background: #fff;
  color: #16363d;
  border: 1px solid rgba(27, 94, 107, 0.12);
  border-bottom-left-radius: 4px;
  box-shadow: 0 2px 8px rgba(27, 94, 107, 0.06);
}

.vaq-agente-bubble--error {
  align-self: flex-start;
  background: rgba(220, 53, 69, 0.08);
  color: #842029;
  border: 1px solid rgba(220, 53, 69, 0.25);
  border-bottom-left-radius: 4px;
}

.vaq-agente-typing {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.7rem 0.95rem;
  background: #fff;
  border: 1px solid rgba(27, 94, 107, 0.12);
  border-radius: 14px;
  border-bottom-left-radius: 4px;
}

.vaq-agente-typing[hidden] {
  display: none !important;
}

.vaq-agente-typing-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #1B5E6B;
  opacity: 0.35;
  animation: vaq-agente-bounce 1.2s infinite ease-in-out;
}

.vaq-agente-typing-dot:nth-child(2) {
  animation-delay: 0.15s;
}

.vaq-agente-typing-dot:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes vaq-agente-bounce {
  0%,
  80%,
  100% {
    opacity: 0.3;
    transform: translateY(0);
  }
  40% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

.vaq-agente-footer {
  flex: 0 0 auto;
  padding: 0.75rem 0.85rem 0.9rem;
  border-top: 1px solid rgba(27, 94, 107, 0.12);
  background: #fff;
}

.vaq-agente-form {
  display: flex;
  gap: 0.5rem;
  align-items: flex-end;
}

.vaq-agente-input {
  flex: 1 1 auto;
  min-width: 0;
  box-sizing: border-box;
  border: 1px solid rgba(27, 94, 107, 0.25);
  border-radius: 10px;
  padding: 0.7rem 0.8rem;
  font: inherit;
  font-size: 0.95rem;
  color: #16363d;
  background: #fff;
  resize: none;
  min-height: 44px;
  max-height: 96px;
}

.vaq-agente-input:focus {
  outline: none;
  border-color: #2FA89A;
  box-shadow: 0 0 0 3px rgba(47, 168, 154, 0.2);
}

.vaq-agente-input:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.vaq-agente-send {
  flex: 0 0 auto;
  min-width: 44px;
  min-height: 44px;
  border: 0;
  border-radius: 10px;
  padding: 0 0.95rem;
  background: #F4A623;
  color: #0E2E33;
  font-family: var(--vaq-font-display, Spartan, sans-serif);
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}

.vaq-agente-send:hover:not(:disabled),
.vaq-agente-send:focus-visible:not(:disabled) {
  background: #ffb83d;
  outline: none;
  transform: translateY(-1px);
}

.vaq-agente-send:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

@media (max-width: 575px) {
  .vaq-agente-modal {
    padding: 0;
    align-items: stretch;
  }

  .vaq-agente-modal-dialog {
    width: 100%;
    height: 100%;
    max-height: 100%;
    border-radius: 0;
    border: 0;
  }
}
