/*
 * Conversa do WhatsApp (iPhone, modo escuro) recriada para a landing — quadro 390×844, sem escala.
 * Geometria e cores medidas dos prints reais de 2026-11-18 (740×1600, fator 390/740), sem a barra
 * de status do iPhone. Ícones do WhatsApp desenhados em SVG inline; o papel de parede é desenho
 * próprio (img/wa-wallpaper.svg). Texto das bolhas = templates aprovados (data/whatsapp-templates.json).
 * Avatar: img/wa-avatar.png = assets/images/skipa-twilio-profile-512.png (foto de perfil do remetente
 * na Twilio) reduzida para 128px.
 */
:root {
  /* medido dos prints de 2026-11-18 */
  --wa-wallpaper: #0A0A0A;
  --wa-header: #101010;
  --wa-header-line: #1B1B1B;
  --wa-control: #151515;
  --wa-control-line: #2D2D2D;
  --wa-chip: #171717;
  --wa-bubble: #242625;
  --wa-preview: #1E1E1E;
  --wa-separator: #373938;
  --wa-text: #FFFFFF;
  --wa-preview-text: #E6E6E6;
  --wa-time: #B0B2B1;
  --wa-notice: #8ADC9B;
  --wa-accent: #21C063;
  --wa-avatar: #FFFFFF;

  --wa-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --wa-width: 390px;
  --wa-height: 844px;
}

.wa-frame {
  position: relative;
  box-sizing: border-box;
  width: var(--wa-width);
  height: var(--wa-height);
  overflow: hidden;
  background: var(--wa-wallpaper) url("../img/wa-wallpaper.svg") 0 0 / 126px 126px repeat;
  color: var(--wa-text);
  font: 15px/20px var(--wa-font);
  -webkit-font-smoothing: antialiased;
}

.wa-frame *,
.wa-frame *::before,
.wa-frame *::after {
  box-sizing: border-box;
}

.wa-frame svg { display: block; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- cabeçalho ---------- */
.wa-header {
  position: absolute; top: 0; left: 0; right: 0; z-index: 1; height: 93px;
  background: var(--wa-header); border-bottom: 1px solid var(--wa-header-line);
}
.wa-header__back {
  position: absolute; left: 18px; top: 43px; width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--wa-control); border: 1px solid var(--wa-control-line); color: var(--wa-text);
}
.wa-header__back svg { width: 22px; height: 22px; stroke-width: 2.4; }
.wa-header__avatar {
  position: absolute; left: 66px; top: 44px; width: 37px; height: 37px; border-radius: 50%;
  background: var(--wa-avatar); overflow: hidden;
}
.wa-header__avatar img { display: block; width: 100%; height: 100%; }
.wa-header__name { position: absolute; left: 111px; top: 53px; font-size: 15px; line-height: 20px; font-weight: 600; }

/* ---------- conversa ----------
 * Abre no topo (cabeçalho, "Hoje", aviso da Meta e o convite de cadastro, como no print 1.png) e rola
 * por --wa-scroll (px, padrão 0, definida no quadro ou num ancestral): o conteúdo sobe esse tanto.
 * Menor --wa-scroll que deixa cada bolha inteira visível no quadro 390×844 (área da conversa: y 93–751,
 * 658px de altura; medido com o conteúdo deste arquivo):
 *   cadastro  (customer_confirm_v2)          0px      (conteúdo y 133–387)
 *   compra    (sale_confirm_v2)              0px      (y 391–607: já cabe sem rolar)
 *   lembrete  (reminder_d1_professional_v3)  209.4px  (y 611–867)
 *   pagamento (payment_received_customer_v2) 410.4px  (y 871–1068; fim da conversa, como no print 2.png)
 * Acima de 410.4px a conversa sobe além da última mensagem.
 */
.wa-thread { position: absolute; left: 0; right: 0; top: 93px; bottom: 93px; overflow: hidden; }
.wa-thread__content {
  display: flex; flex-direction: column;
  transform: translateY(calc(-1 * var(--wa-scroll, 0px)));
  transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
}
@media (prefers-reduced-motion: reduce) {
  .wa-thread__content { transition: none; }
}
.wa-day {
  align-self: center; flex: none; width: 72px; height: 17px; margin-top: 31px; border-radius: 8px;
  background: var(--wa-chip); font-size: 11px; line-height: 17px; font-weight: 600; text-align: center;
}
.wa-notice {
  align-self: center; flex: none; width: 292px; margin-top: 13px; padding: 6px 8px; border-radius: 8px;
  background: var(--wa-chip); color: var(--wa-notice); font-size: 11.8px; line-height: 16.3px; text-align: center;
}
.wa-notice + .wa-bubble { margin-top: 11px; }

.wa-bubble {
  position: relative; flex: none; width: 295px; margin: 4px 0 0 15px; border-radius: 16px;
  background: var(--wa-bubble);
}
/* Cauda só na última bolha do grupo: a classe é posta na mensagem, não por :last-child. */
.wa-bubble--tail { border-bottom-left-radius: 4px; }
.wa-bubble--tail::before {
  content: ""; position: absolute; left: -6px; bottom: 0; width: 14px; height: 14px; background: var(--wa-bubble);
  clip-path: path("M0 14C4 13.5 6 11 6.5 6V0H14V14Z");
}

/* Prévia do domínio do botão — só na primeira mensagem da conversa. */
.wa-preview {
  display: flex; align-items: center; gap: 8px; height: 57px; margin: 4px 4px 0; padding: 13px 0 0 6px;
  border-radius: 13px 13px 11px 11px; background: var(--wa-preview); color: var(--wa-preview-text);
  font-size: 11.5px;
}
.wa-preview svg { width: 11px; height: 11px; stroke-width: 1.6; }

.wa-text { position: relative; padding: 5.5px 12px 11.5px; }
.wa-preview + .wa-text { padding-top: 3px; }
.wa-text p { display: inline; margin: 0; white-space: pre-line; }
/* Reserva o lugar do horário na última linha; o horário fica no canto de baixo. */
.wa-time { display: inline-block; width: 44px; height: 1px; }
.wa-time span {
  position: absolute; right: 11px; bottom: 4px; color: var(--wa-time); font-size: 10.5px; line-height: 13px;
}

/* Botão do template: faixa separada por linha, ícone de link externo + rótulo em verde. */
.wa-button {
  display: flex; align-items: center; justify-content: center; gap: 8px; height: 39px;
  border-top: 1px solid var(--wa-separator); color: var(--wa-accent); font-size: 13.7px;
}
.wa-button svg { width: 15px; height: 15px; stroke-width: 1.3; }

/* ---------- barra de digitação ---------- */
.wa-input { position: absolute; left: 0; right: 0; top: 771px; height: 37px; }
.wa-input > * { position: absolute; top: 0; height: 36px; display: flex; align-items: center; justify-content: center; }
.wa-input__round {
  width: 36px; border-radius: 50%; background: var(--wa-control); border: 1px solid var(--wa-control-line); color: var(--wa-text);
}
.wa-input__plus { left: 15px; }
.wa-input__plus svg { width: 20px; height: 20px; stroke-width: 1.8; }
.wa-input__field {
  left: 59px; width: 228px; justify-content: flex-end; padding-right: 10px; border-radius: 18px;
  background: var(--wa-control); border: 1px solid var(--wa-control-line); color: var(--wa-text);
}
.wa-input__field svg { width: 18px; height: 18px; stroke-width: 1.6; }
.wa-input__camera { left: 295px; }
.wa-input__camera svg { width: 21px; height: 21px; stroke-width: 1.6; }
.wa-input__mic { left: 338px; width: 37px; height: 37px; border-radius: 50%; background: var(--wa-accent); color: var(--wa-wallpaper); }
.wa-input__mic svg { width: 18px; height: 18px; stroke-width: 1.8; }
