/* ═══════════════════════════════════════════════════════════════
   ANJOPONTOCOM — Conversa com o Anjo
   A mesma página do site; só o formulário dá lugar ao chat.
   ═══════════════════════════════════════════════════════════════ */

/* ── o painel da conversa, no lugar do formulário ─────────────── */

.chat-embed {
  display: flex;
  flex-direction: column;
  height: clamp(460px, 72svh, 660px);
  background: rgba(7, 19, 32, 0.55);
  border: 1px solid var(--line);
  border-radius: 20px;
  overflow: hidden;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
}

/* ── topo: o Anjo está online ─────────────────────────────────── */

.chat-top {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px clamp(16px, 4vw, 24px);
  background: rgba(6, 17, 29, 0.72);
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}

.chat-avatar {
  width: 44px;
  filter: drop-shadow(0 0 10px rgba(242, 182, 75, 0.3));
}

.chat-nome {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.3rem;
  line-height: 1.15;
  color: var(--moon-hi);
}

.chat-status {
  font-family: var(--sans);
  font-weight: 300;
  font-size: 0.76rem;
  letter-spacing: 0.06em;
  color: var(--moon-lo);
  display: flex;
  align-items: center;
  gap: 6px;
}

.chat-status .ponto {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 10px rgba(242, 182, 75, 0.7);
  animation: pulsaPonto 2.4s ease-in-out infinite;
}

@keyframes pulsaPonto {
  0%, 100% { opacity: 0.7; }
  50%      { opacity: 1; }
}

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

.chat-log {
  flex: 1;
  overflow-y: auto;
  padding: clamp(16px, 3vh, 24px) clamp(14px, 3.5vw, 22px);
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
  overscroll-behavior: contain;
}

.msg {
  max-width: 86%;
  padding: 12px 17px;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(1.14rem, 3vw, 1.26rem);
  line-height: 1.55;
  animation: chegaMsg 0.45s cubic-bezier(0.2, 0.6, 0.2, 1) both;
  overflow-wrap: break-word;
  white-space: pre-wrap;
}

@keyframes chegaMsg {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* fala do Anjo: vidro noturno com luar */
.msg-anjo {
  align-self: flex-start;
  background: rgba(10, 26, 44, 0.85);
  border: 1px solid var(--line);
  border-radius: 18px 18px 18px 6px;
  color: var(--moon-hi);
}

/* resposta da pessoa: papel de carta */
.msg-eu {
  align-self: flex-end;
  background: linear-gradient(180deg, #f9f4e8, #efe6d1);
  border-radius: 18px 18px 6px 18px;
  color: var(--ink);
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.3);
}

/* o Anjo digitando… */
.msg-typing {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  min-height: 1.4em;
}

.msg-typing i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--moon-lo);
  animation: digita 1.2s ease-in-out infinite;
}

.msg-typing i:nth-child(2) { animation-delay: 0.18s; }
.msg-typing i:nth-child(3) { animation-delay: 0.36s; }

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

/* botão de ação dentro da conversa (ver a mensagem pronta) */
.chat-acao {
  align-self: flex-start;
  margin-top: 4px;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.16rem;
  color: var(--night-1);
  background: linear-gradient(180deg, #f2f6fb, #cfdcec);
  border: none;
  border-radius: 999px;
  padding: 12px 30px;
  cursor: pointer;
  box-shadow: 0 4px 30px rgba(150, 190, 235, 0.18);
  transition: transform 0.4s ease, box-shadow 0.4s ease;
  animation: chegaMsg 0.45s cubic-bezier(0.2, 0.6, 0.2, 1) both;
}

.chat-acao:hover { transform: translateY(-2px); box-shadow: 0 6px 40px rgba(160, 200, 240, 0.3); }

/* ── barra de escrever ────────────────────────────────────────── */

.chat-bar {
  padding: 10px clamp(12px, 3vw, 20px) 12px;
  background: rgba(6, 17, 29, 0.72);
  border-top: 1px solid var(--line);
  flex-shrink: 0;
}

.chat-skip {
  display: block;
  margin: 0 0 8px auto;
}

/* o atributo hidden precisa vencer o display: block acima */
.chat-skip[hidden] { display: none; }

.chat-skip {
  font-family: var(--sans);
  font-weight: 300;
  font-size: 0.76rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--moon-lo);
  background: transparent;
  border: 1px solid rgba(190, 214, 240, 0.24);
  border-radius: 999px;
  padding: 6px 15px;
  cursor: pointer;
  transition: border-color 0.4s ease, color 0.4s ease;
}

.chat-skip:hover { border-color: rgba(210, 230, 250, 0.5); color: var(--moon); }

.chat-linha-input {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.chat-linha-input textarea {
  flex: 1;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.16rem;
  line-height: 1.5;
  color: var(--moon-hi);
  background: rgba(9, 24, 40, 0.6);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 11px 17px;
  resize: none;
  outline: none;
  max-height: 120px;
  caret-color: var(--moon-hi);
  transition: border-color 0.4s ease, box-shadow 0.4s ease;
}

.chat-linha-input textarea:focus {
  border-color: var(--line-focus);
  box-shadow: 0 0 24px rgba(150, 190, 235, 0.12);
}

.chat-linha-input textarea::placeholder {
  font-weight: 400;
  color: rgba(150, 178, 208, 0.42);
}

.chat-linha-input textarea:disabled { opacity: 0.45; }

.chat-send {
  flex-shrink: 0;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(180deg, #f2f6fb, #cfdcec);
  color: var(--night-1);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 24px rgba(150, 190, 235, 0.2);
  transition: transform 0.35s ease, box-shadow 0.35s ease, opacity 0.35s ease;
}

.chat-send:hover { transform: translateY(-2px); box-shadow: 0 6px 32px rgba(160, 200, 240, 0.32); }
.chat-send:disabled { opacity: 0.4; cursor: default; transform: none; }

.chat-count {
  min-height: 15px;
  margin-top: 5px;
  text-align: right;
  font-family: var(--sans);
  font-weight: 300;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--moon-dim);
}

/* ── celular ──────────────────────────────────────────────────── */

@media (max-width: 640px) {
  .chat-embed { height: clamp(440px, 74svh, 620px); border-radius: 16px; }
  .msg { max-width: 90%; font-size: 1.16rem; }
}

/* ── linha de opções (pular / encerrar) ───────────────────────── */

.chat-opcoes {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-bottom: 8px;
}

.chat-opcoes[hidden] { display: none; }

.chat-opcoes .chat-skip { margin: 0; }

.chat-encerrar {
  font-family: var(--sans);
  font-weight: 300;
  font-size: 0.76rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--moon);
  background: rgba(12, 32, 52, 0.5);
  border: 1px solid rgba(190, 214, 240, 0.28);
  border-radius: 999px;
  padding: 6px 15px;
  cursor: pointer;
  transition: border-color 0.4s ease, color 0.4s ease, background 0.4s ease;
}

.chat-encerrar:hover { border-color: rgba(210, 230, 250, 0.5); background: rgba(16, 40, 64, 0.6); }
.chat-encerrar[hidden] { display: none; }

/* ── as duas escolhas do "encerrar" ───────────────────────────── */

.chat-escolha {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-self: flex-start;
  margin-top: 4px;
}

.chat-acao-ghost {
  background: transparent;
  color: var(--moon);
  border: 1px solid rgba(190, 214, 240, 0.3);
  box-shadow: none;
}

.chat-acao-ghost:hover {
  border-color: rgba(210, 230, 250, 0.55);
  background: rgba(12, 32, 52, 0.4);
  box-shadow: none;
}

@media (prefers-reduced-motion: reduce) {
  .msg, .chat-acao { animation: none; }
  .chat-log { scroll-behavior: auto; }
}

/* ── a chamada que leva pro chat (gente se perdia aqui) ─────────── */

.conversa-chamada {
  scroll-margin-top: 18px;
  text-align: center;
  margin-bottom: clamp(20px, 3.5vh, 30px);
}

.conversa-titulo {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.5rem, 4.2vw, 1.85rem);
  line-height: 1.25;
  color: var(--moon-hi);
}

.conversa-sub {
  max-width: 30em;
  margin: 10px auto 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(1.1rem, 2.9vw, 1.24rem);
  line-height: 1.6;
  color: var(--moon);
  text-wrap: balance;
}


/* ── aviso: dá pra responder falando, muita gente não sabe ─────────
   --voz é a cor do microfone. A página do pai (tema claro) sobrescreve
   esse valor no pai.css, então o aviso funciona na noite e no dia. */

.conversa-audio {
  --voz: 240, 194, 171;
  display: flex;
  align-items: center;
  gap: 12px;
  width: fit-content;
  max-width: 27em;
  margin: 18px auto 0;
  padding: 10px 20px 10px 12px;
  border: 1px solid rgba(var(--voz), 0.40);
  border-radius: 999px;
  background: rgba(var(--voz), 0.09);
  font-family: var(--sans);
  font-weight: 400;
  font-size: clamp(0.92rem, 2.5vw, 1rem);
  line-height: 1.45;
  color: var(--moon-hi);
  text-align: left;
}

/* o microfone é a voz: ganha cor, halo e uma respirada devagar */
.conversa-audio-ico {
  flex-shrink: 0;
  box-sizing: border-box;
  width: 36px;
  height: 36px;
  padding: 7px;
  border-radius: 50%;
  background: rgba(var(--voz), 0.16);
  fill: none;
  stroke: rgb(var(--voz));
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transform-origin: center;
  animation: micBrilha 2.4s ease-in-out infinite;
}

@keyframes micBrilha {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 1px rgba(var(--voz), 0.42), 0 0 10px rgba(var(--voz), 0.35);
  }
  50% {
    transform: scale(1.08);
    box-shadow: 0 0 0 1px rgba(var(--voz), 0.62), 0 0 22px rgba(var(--voz), 0.72);
  }
}

@media (prefers-reduced-motion: reduce) {
  .conversa-audio-ico {
    animation: none;
    box-shadow: 0 0 0 1px rgba(var(--voz), 0.5), 0 0 14px rgba(var(--voz), 0.5);
  }
}
