/* Demonstração animada: celular conversando com a Bia.
   Usa as variáveis de landing.css - carregue sempre depois dele. */

.demo-sec {
  /* o nav é fixo e alto (logo de 100px); sem isso o título entra por baixo
     dele quando se chega pelo link #demo */
  scroll-margin-top: 160px;
  padding: 90px 6% 70px;
  max-width: 1320px;
  margin: 0 auto;
}

.demo-head { text-align: center; margin-bottom: 52px; }

.demo-head h2 {
  font-family: 'Sora', sans-serif;
  font-weight: 700;
  font-size: clamp(26px, 4vw, 40px);
  color: var(--white);
  letter-spacing: -0.01em;
  margin-bottom: 14px;
  max-width: none;
}

.demo-head p {
  font-size: 16.5px;
  line-height: 1.7;
  color: var(--text-muted);
  max-width: 52em;
  margin: 0 auto;
}

.demo-wrap {
  display: grid;
  grid-template-columns: minmax(0, 380px) minmax(0, 1fr);
  gap: 56px;
  /* stretch, não start: o aparelho acompanha a altura da coluna de passos,
     para os dois blocos terminarem na mesma linha. */
  align-items: stretch;
  justify-content: center;
}

/* ─── aparelho ─────────────────────────────────────────────── */

.demo-phone {
  position: relative;
  width: 100%;
  max-width: 380px;
  margin: 0 auto;
  background: #0b141a;
  border: 10px solid #1d2733;
  border-radius: 42px;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.06);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  /* sem altura fixa: o grid estica, e .demo-chat (flex:1) absorve a sobra */
  min-height: 620px;
}

.demo-notch {
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 116px; height: 20px;
  background: #0b141a;
  border-radius: 0 0 14px 14px;
  z-index: 3;
}

.demo-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 30px 14px 11px;
  background: #1f2c34;
  flex-shrink: 0;
}

.demo-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--green);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}
.demo-avatar img { width: 100%; height: 100%; object-fit: cover; }

.demo-who { min-width: 0; line-height: 1.25; }
.demo-biz {
  color: #e9edef;
  font-size: 14.5px;
  font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.demo-status { color: #8696a0; font-size: 12px; }

/* ─── conversa ─────────────────────────────────────────────── */

.demo-chat {
  flex: 1 1 0;
  /* sem isto o item flex não encolhe abaixo do próprio conteúdo: a cada
     mensagem nova o aparelho crescia junto, em vez de rolar por dentro. */
  min-height: 0;
  overflow: hidden;
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  background-color: #0b141a;
  /* textura discreta, no espírito do papel de parede do WhatsApp */
  background-image:
    radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.022) 0 1px, transparent 1px),
    radial-gradient(circle at 70% 60%, rgba(255, 255, 255, 0.022) 0 1px, transparent 1px);
  background-size: 34px 34px, 46px 46px;
  scroll-behavior: smooth;
}

.demo-msg { display: flex; animation: demo-pop 0.22s ease-out; }
.demo-out { justify-content: flex-end; }
.demo-in { justify-content: flex-start; }

@keyframes demo-pop {
  from { opacity: 0; transform: translateY(7px); }
  to   { opacity: 1; transform: none; }
}

.demo-bubble {
  max-width: 82%;
  padding: 7px 11px 8px;
  border-radius: 8px;
  font-size: 13.6px;
  line-height: 1.48;
  color: #e9edef;
  word-wrap: break-word;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.25);
}
.demo-out .demo-bubble { background: #005c4b; border-top-right-radius: 2px; }
.demo-in  .demo-bubble { background: #202c33; border-top-left-radius: 2px; }
.demo-bubble strong { font-weight: 700; color: #fff; }

/* balão de "digitando" */
.demo-dots { display: inline-flex; gap: 4px; padding: 3px 2px; }
.demo-dots i {
  width: 6px; height: 6px; border-radius: 50%;
  background: #8696a0;
  animation: demo-blink 1.3s infinite ease-in-out;
}
.demo-dots i:nth-child(2) { animation-delay: 0.18s; }
.demo-dots i:nth-child(3) { animation-delay: 0.36s; }
@keyframes demo-blink {
  0%, 60%, 100% { opacity: 0.32; transform: translateY(0); }
  30%           { opacity: 1;    transform: translateY(-3px); }
}

/* ─── campo de entrada ─────────────────────────────────────── */

.demo-input {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px 12px;
  background: #1f2c34;
  flex-shrink: 0;
}

.demo-input-box {
  flex: 1;
  min-height: 34px;
  background: #2a3942;
  border-radius: 20px;
  padding: 8px 13px;
  font-size: 13.4px;
  color: #e9edef;
  line-height: 1.35;
  position: relative;
  word-break: break-word;
}
.demo-input-text[data-empty="1"]::before {
  content: attr(data-ph);
  color: #8696a0;
}
.demo-input-text::after {
  content: '';
  display: inline-block;
  width: 1.5px; height: 14px;
  background: var(--green);
  vertical-align: -2px;
  margin-left: 1px;
  animation: demo-caret 1s steps(1) infinite;
}
@keyframes demo-caret { 0%, 50% { opacity: 1; } 51%, 100% { opacity: 0; } }

.demo-send {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--green);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  color: #0b141a;
}
.demo-send svg { width: 17px; height: 17px; }

/* ─── passos explicativos ao lado ──────────────────────────── */

.demo-side {
  display: flex;
  flex-direction: column;
}

/* flex:1 + space-between: os nove cards preenchem exatamente a altura do
   aparelho, sem sobra embaixo e sem precisar esticar card nenhum. */
.demo-steps {
  list-style: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  flex: 1;
}

.demo-step {
  display: flex;
  gap: 13px;
  padding: 12px 16px;
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  background: var(--card-bg);
  transition: border-color 0.3s, background 0.3s, transform 0.3s;
}
.demo-step.on {
  border-color: rgba(0, 196, 106, 0.55);
  background: rgba(0, 196, 106, 0.08);
  transform: translateX(4px);
}

.demo-step-num {
  flex-shrink: 0;
  width: 25px; height: 25px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Sora', sans-serif;
  transition: background 0.3s, color 0.3s;
}
.demo-step.on .demo-step-num { background: var(--green); color: var(--dark); }

.demo-step strong {
  display: block;
  font-family: 'Sora', sans-serif;
  font-size: 14.5px;
  color: var(--white);
  margin-bottom: 2px;
}
.demo-step p { font-size: 13.2px; line-height: 1.5; color: var(--text-muted); }

.demo-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-top: 16px;
  flex-shrink: 0;
}

.demo-replay {
  background: none;
  border: 1px solid var(--card-border);
  color: var(--text);
  border-radius: 50px;
  padding: 9px 18px;
  font-size: 13.5px;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.demo-replay:hover { border-color: var(--green); color: var(--white); }

.demo-note { font-size: 12.5px; color: var(--text-muted); }

/* ─── responsivo ───────────────────────────────────────────── */

@media (max-width: 940px) {
  /* empilhado: sem coluna para acompanhar, o aparelho volta a ter altura própria */
  .demo-wrap { grid-template-columns: 1fr; gap: 40px; align-items: start; }
  .demo-phone { min-height: 0; height: 620px; }
  .demo-side { max-width: 620px; margin: 0 auto; width: 100%; }
  .demo-foot { justify-content: center; text-align: center; }
}

@media (max-width: 480px) {
  .demo-sec { padding: 64px 5% 50px; }
  /* cabeçalho mais compacto para o celular entrar na dobra mais cedo */
  .demo-head { margin-bottom: 32px; }
  .demo-head p { font-size: 15px; }
  .demo-phone { height: 560px; min-height: 0; border-width: 8px; border-radius: 34px; }
  .demo-step { padding: 13px 14px; gap: 11px; }
}

/* Link do Google Calendar que a Bia envia após create_appointment.
   Ícone de agenda + destaque, como o WhatsApp trata um link reconhecido. */
.demo-cal {
  display: inline-flex;
  align-items: flex-start;
  gap: 6px;
  margin-top: 2px;
  color: #53bdeb;
}
.demo-cal-ico { flex-shrink: 0; font-size: 14px; line-height: 1.4; }
.demo-cal strong {
  color: #53bdeb;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
  word-break: break-all;
}
