/*
Theme Name: Funil de Qualificação — Mapeamento
Theme URI: 
Author: 
Description: Tema simples para o funil de chat de pré-qualificação do Mapeamento de Posicionamento Feminino, com CRM externo de acompanhamento em tempo real.
Version: 1.0.0
Text Domain: funil-mapeamento
*/

:root {
  /* ── Paleta — bordô, dourado, creme. Elegante, feminino, sem soar infantil. ── */
  --brand-900: #4A1420;   /* bordô mais escuro — títulos grandes */
  --brand-700: #7A1E2B;   /* bordô principal — botões, destaques */
  --brand-500: #A8385A;   /* bordô mais claro — hover, detalhes */
  --gold: #C6A664;        /* dourado — bordas, ícones, acentos */
  --gold-light: #E8D9B5;  /* dourado claro — fundos suaves */
  --cream: #FAF8F5;       /* fundo principal */
  --cream-dark: #F0EAE2;  /* fundo secundário, cards */
  --white: #FFFFFF;
  --text-dark: #2B2422;   /* texto principal */
  --text-muted: #6F6A65;  /* texto secundário */
  --border-soft: #EAE2D6;
  --success: #3A8C5F;
  --shadow: 0 8px 28px rgba(74, 20, 32, 0.10);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--text-dark);
  font-family: 'Inter', -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .serif {
  font-family: 'Playfair Display', serif;
  color: var(--brand-900);
}

/* ── Container do funil ── */
.chat-wrap {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--cream);
}

.chat-header {
  text-align: center;
  padding: 2rem 1.25rem 1rem;
}

.chat-header .brand-mark {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  color: var(--brand-700);
  font-size: 1.15rem;
  letter-spacing: 0.02em;
}

.chat-body {
  flex: 1;
  padding: 0.5rem 1.1rem 6rem;
  overflow-y: auto;
}

/* ── Bolhas de mensagem ── */
.msg {
  max-width: 88%;
  margin: 0 0 0.85rem;
  padding: 0.85rem 1.1rem;
  border-radius: 16px;
  font-size: 0.95rem;
  line-height: 1.6;
  opacity: 0;
  transform: translateY(8px);
  animation: msgIn 0.35s ease forwards;
}

@keyframes msgIn {
  to { opacity: 1; transform: translateY(0); }
}

.msg-bot {
  background: var(--white);
  border: 1px solid var(--border-soft);
  border-bottom-left-radius: 4px;
  color: var(--text-dark);
  box-shadow: var(--shadow);
}

.msg-bot strong { color: var(--brand-700); }

.msg-user {
  background: var(--brand-700);
  color: var(--white);
  margin-left: auto;
  border-bottom-right-radius: 4px;
}

/* ── Botões de opção ── */
.opts {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin: 0.5rem 0 1.25rem;
}

.opt-btn {
  background: var(--white);
  border: 2px solid var(--brand-700);
  color: var(--brand-700);
  padding: 0.9rem 1.15rem;
  border-radius: 14px;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(74, 20, 32, 0.08);
  transition: all 0.15s ease;
}

.opt-btn:hover {
  background: var(--brand-700);
  color: var(--white);
}

.opt-btn:active {
  transform: scale(0.98);
}

/* ── Campo de texto (nome) ── */
.text-input-row {
  display: flex;
  gap: 0.6rem;
  margin: 0.5rem 0 1.25rem;
}

.text-input-row input {
  flex: 1;
  padding: 0.85rem 1rem;
  border-radius: 14px;
  border: 2px solid var(--brand-700);
  font-family: inherit;
  font-size: 0.92rem;
  background: var(--white);
  color: var(--text-dark);
}

.text-input-row input:focus {
  outline: none;
  border-color: var(--gold);
}

.text-input-row button {
  background: var(--brand-700);
  color: var(--white);
  border: none;
  border-radius: 14px;
  padding: 0 1.2rem;
  font-weight: 600;
  cursor: pointer;
}

/* ── Botão de destaque (final / WhatsApp) ── */
.cta-btn {
  display: block;
  width: 100%;
  background: linear-gradient(135deg, var(--brand-700), var(--brand-900));
  color: var(--white);
  border: none;
  padding: 1rem 1.2rem;
  border-radius: 14px;
  font-size: 0.98rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(122, 30, 43, 0.28);
  margin: 0.5rem 0 1.25rem;
  text-decoration: none;
  text-align: center;
}

.cta-btn.whatsapp {
  background: linear-gradient(135deg, #3A8C5F, #235c3c);
}

/* ── Indicador "digitando" ── */
.typing {
  display: inline-flex;
  gap: 4px;
  padding: 0.85rem 1.1rem;
  background: var(--white);
  border: 1px solid var(--border-soft);
  border-radius: 16px;
  border-bottom-left-radius: 4px;
  width: fit-content;
  box-shadow: var(--shadow);
}

.typing span {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--gold);
  animation: typingBounce 1.2s infinite ease-in-out;
}
.typing span:nth-child(2) { animation-delay: 0.15s; }
.typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-4px); opacity: 1; }
}

/* ── Progresso ── */
.progress-track {
  height: 4px;
  background: var(--cream-dark);
  border-radius: 4px;
  margin: 0 1.1rem 0.5rem;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--brand-700));
  transition: width 0.4s ease;
}

/* ═══════════════════════════════════════
   CRM — painel de acompanhamento
═══════════════════════════════════════ */
.crm-wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

.crm-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.crm-title { font-size: 1.6rem; margin: 0; }

.crm-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--white);
  border: 1px solid var(--border-soft);
  padding: 0.4rem 0.85rem;
  border-radius: 20px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.crm-live-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--success);
  animation: livePulse 1.6s infinite;
}
@keyframes livePulse {
  0%, 100% { opacity: 1; } 50% { opacity: 0.35; }
}

.crm-grid {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 1.5rem;
}
@media (max-width: 800px) {
  .crm-grid { grid-template-columns: 1fr; }
}

.crm-list {
  background: var(--white);
  border-radius: 16px;
  border: 1px solid var(--border-soft);
  overflow: hidden;
  max-height: 78vh;
  overflow-y: auto;
}

.crm-lead-item {
  padding: 0.9rem 1.1rem;
  border-bottom: 1px solid var(--cream-dark);
  cursor: pointer;
  transition: background 0.15s;
}
.crm-lead-item:hover, .crm-lead-item.active {
  background: var(--gold-light);
}
.crm-lead-name { font-weight: 700; color: var(--brand-900); font-size: 0.92rem; }
.crm-lead-meta { font-size: 0.72rem; color: var(--text-muted); margin-top: 2px; }
.crm-lead-pattern {
  display: inline-block;
  margin-top: 5px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 8px;
  border-radius: 8px;
  background: var(--brand-700);
  color: var(--white);
}
.crm-lead-pattern.pattern-b { background: var(--gold); color: var(--brand-900); }
.crm-lead-pattern.pattern-c { background: var(--success); }

.crm-detail {
  background: var(--white);
  border-radius: 16px;
  border: 1px solid var(--border-soft);
  padding: 1.5rem;
  max-height: 78vh;
  overflow-y: auto;
}

.crm-transcript-item {
  margin-bottom: 0.9rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px dashed var(--border-soft);
}
.crm-transcript-role {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gold);
  margin-bottom: 3px;
}
.crm-transcript-role.role-user { color: var(--brand-500); }
.crm-transcript-text { font-size: 0.9rem; color: var(--text-dark); }
.crm-transcript-time { font-size: 0.68rem; color: var(--text-muted); margin-top: 2px; }

.crm-empty {
  color: var(--text-muted);
  font-size: 0.9rem;
  text-align: center;
  padding: 3rem 1rem;
}
