/* ============================================================
   Chat Widget — Página de Cadastro Trakia
   Usa variáveis de site.css
   ============================================================ */

.cadastro-section {
  min-height: calc(100vh - 80px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 120px 20px 80px;
}

/* ============================================================
   Chat Widget Container
   ============================================================ */
.chat-widget {
  width: 100%;
  max-width: 480px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 20px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  backdrop-filter: blur(20px);
  position: relative;
  z-index: 1;
}

/* ============================================================
   Header do chat
   ============================================================ */
.chat-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: rgba(255,255,255,0.04);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.chat-header-logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(139,92,246,0.2), rgba(236,72,153,0.2));
  border: 1px solid rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.chat-header-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.chat-header-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--t1);
  letter-spacing: -0.01em;
}

.chat-header-status {
  font-size: 12px;
  color: #4ade80;
  display: flex;
  align-items: center;
  gap: 5px;
}

.chat-status-dot {
  width: 7px;
  height: 7px;
  background: #4ade80;
  border-radius: 50%;
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ============================================================
   Mensagens
   ============================================================ */
.chat-messages {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 320px;
  max-height: 420px;
  overflow-y: auto;
  scroll-behavior: smooth;
}

.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-track { background: transparent; }
.chat-messages::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

/* Bolha bot */
.msg-bot {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  max-width: 88%;
}

.msg-bot-avatar {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, #8B5CF6, #EC4899);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

.msg-bot-bubble {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 16px 16px 16px 4px;
  padding: 10px 14px;
  font-size: 14px;
  color: var(--t1);
  line-height: 1.55;
}

/* Bolha usuário */
.msg-user {
  display: flex;
  justify-content: flex-end;
  max-width: 88%;
  align-self: flex-end;
}

.msg-user-bubble {
  background: linear-gradient(135deg, rgba(139,92,246,0.25), rgba(236,72,153,0.25));
  border: 1px solid rgba(139,92,246,0.3);
  border-radius: 16px 16px 4px 16px;
  padding: 10px 14px;
  font-size: 14px;
  color: var(--t1);
  line-height: 1.55;
}

/* Typing indicator */
.msg-typing {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.typing-bubble {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 16px 16px 16px 4px;
  padding: 12px 16px;
  display: flex;
  gap: 4px;
  align-items: center;
}

.typing-dot {
  width: 6px;
  height: 6px;
  background: rgba(255,255,255,0.4);
  border-radius: 50%;
  animation: typing-bounce 1.2s ease-in-out infinite;
}
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing-bounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-4px); }
}

/* Card de confirmação */
.msg-confirm-card {
  background: rgba(74,222,128,0.08);
  border: 1px solid rgba(74,222,128,0.2);
  border-radius: 14px;
  padding: 16px;
  font-size: 13px;
  color: rgba(255,255,255,0.7);
  line-height: 1.6;
}

.msg-confirm-card strong {
  color: #4ade80;
  display: block;
  font-size: 15px;
  margin-bottom: 6px;
}

/* ============================================================
   Google Button
   ============================================================ */
.chat-google-area {
  padding: 4px 0 8px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.btn-google {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 11px 16px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 100px;
  color: var(--t1);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  font-family: inherit;
}

.btn-google:hover {
  background: rgba(255,255,255,0.09);
}

.chat-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: rgba(255,255,255,0.3);
}

.chat-divider::before,
.chat-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255,255,255,0.08);
}

/* ============================================================
   Input Area
   ============================================================ */
.chat-input-area {
  padding: 12px 16px 16px;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.chat-input-area.hidden { display: none; }

.chat-form {
  display: flex;
  gap: 8px;
  align-items: center;
}

.chat-input {
  flex: 1;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 100px;
  padding: 11px 16px;
  font-size: 14px;
  color: var(--t1);
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}

.chat-input:focus {
  border-color: rgba(139,92,246,0.5);
}

.chat-input::placeholder { color: rgba(255,255,255,0.25); }

.chat-input.error {
  border-color: rgba(239,68,68,0.6);
}

.chat-send {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #8B5CF6, #EC4899);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: opacity 0.2s, transform 0.15s;
}

.chat-send:hover { opacity: 0.88; transform: scale(1.05); }
.chat-send:active { transform: scale(0.95); }
.chat-send:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

/* Erro inline */
.chat-input-error {
  font-size: 12px;
  color: #f87171;
  padding: 4px 16px 0;
}

/* ============================================================
   Toast
   ============================================================ */
.chat-toast {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(-10px);
  background: rgba(30,30,40,0.96);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 100px;
  padding: 10px 20px;
  font-size: 13px;
  color: rgba(255,255,255,0.8);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  z-index: 9999;
}

.chat-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ============================================================
   Responsivo
   ============================================================ */
@media (max-width: 540px) {
  .cadastro-section {
    padding: 100px 12px 60px;
    align-items: flex-start;
  }

  .chat-widget {
    border-radius: 16px;
  }
}
