/* ==========================================================================
   "Como podemos ajudar?" — a Lia no chat e no WhatsApp (site_kit/static/js/chat.js)
   Usa os tokens do kit: o accent de cada site pinta o botão, o chat e as bolhas.
   ========================================================================== */

/* ---- bloco "Fale com a gente" (no lugar do antigo formulário) ---- */
.falar {
  max-width: 720px; margin: 0 auto; text-align: center; padding: 40px 28px;
  border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--bg);
  box-shadow: var(--shadow-sm); position: relative;
}
.falar__ancora { position: absolute; top: -96px; }
.falar h3 { font-size: 24px; font-weight: 600; text-wrap: balance; }
.falar p { margin-top: 10px; font-size: 15px; color: var(--text-2); max-width: 56ch; margin-inline: auto; }
.falar__acoes { margin-top: 24px; display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.falar__acoes .btn { gap: 10px; }
.falar__acoes .btn[hidden] { display: none; }
.falar__nota { font-size: 13.5px !important; color: var(--text-3) !important; }
.falar__nota a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

/* ---- o botão do canto ---- */
.cw-lancador {
  position: fixed; right: 20px; bottom: 20px; z-index: 90; display: flex; align-items: center; gap: 10px;
  padding: 8px 18px 8px 8px; border: 0; border-radius: 999px; cursor: pointer;
  font-family: var(--font-head); font-weight: 600; font-size: 14.5px; color: #fff; background: var(--grad-accent);
  box-shadow: 0 12px 32px color-mix(in srgb, var(--accent) 40%, transparent);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.cw-lancador:hover { transform: translateY(-2px); box-shadow: 0 16px 36px color-mix(in srgb, var(--accent) 48%, transparent); }
.cw-lancador:focus-visible, .cw-opcao:focus-visible, .cw-icone-btn:focus-visible, .cw-cta:focus-visible,
.cw-pe button:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 55%, #fff); outline-offset: 2px; }
.cw-lancador[hidden] { display: none; }

.cw-avatar {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; flex: none; overflow: hidden;
  background: rgba(255, 255, 255, .22); font-size: 20px; line-height: 1;
}
.cw-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cw-lancador .cw-avatar { border: 2px solid rgba(255, 255, 255, .65); }
.cw-pulso { position: relative; }
.cw-pulso::after {
  content: ""; position: absolute; right: -1px; bottom: -1px; width: 11px; height: 11px; border-radius: 50%;
  background: #22c55e; border: 2px solid #fff;
}

/* ---- o menu: chat aqui, WhatsApp ou e-mail ---- */
.cw-menu, .cw-chat {
  position: fixed; right: 20px; bottom: 20px; z-index: 96; background: var(--bg); color: var(--text);
  border: 1px solid var(--border); border-radius: 22px; box-shadow: 0 24px 64px rgba(7, 15, 38, .28);
  width: min(360px, calc(100vw - 32px)); overflow: hidden;
  animation: cw-entra .22s var(--ease);
}
.cw-menu[hidden], .cw-chat[hidden] { display: none; }
@keyframes cw-entra { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }

.cw-menu__topo { display: flex; align-items: flex-start; gap: 12px; padding: 18px 18px 6px; }
.cw-menu__topo .cw-avatar { width: 46px; height: 46px; font-size: 24px; background: var(--accent-soft); }
.cw-menu__topo h2 { font-family: var(--font-head); font-size: 17px; font-weight: 600; line-height: 1.3; }
.cw-menu__topo p { font-size: 13px; color: var(--text-2); margin-top: 2px; line-height: 1.45; }
.cw-menu__lista { display: grid; gap: 8px; padding: 12px 14px 16px; }
.cw-opcao {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px; border-radius: 14px;
  border: 1px solid var(--border); background: var(--bg); color: var(--text); text-align: left; cursor: pointer;
  font: inherit; text-decoration: none; transition: background .15s, border-color .15s;
}
.cw-opcao:hover { background: var(--bg-2); border-color: var(--accent-border); }
.cw-opcao__icone { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.cw-opcao__icone svg { width: 21px; height: 21px; }
.cw-opcao--chat .cw-opcao__icone { background: var(--accent-soft); color: var(--accent); }
.cw-opcao--whatsapp .cw-opcao__icone { background: #e7f8ee; color: #1a9e55; }
.cw-opcao--email .cw-opcao__icone { background: var(--bg-3); color: var(--text-2); }
.cw-opcao b { display: block; font-family: var(--font-head); font-size: 14.5px; font-weight: 600; }
.cw-opcao small { display: block; font-size: 12.5px; color: var(--text-2); margin-top: 1px; overflow-wrap: anywhere; }
.cw-opcao[aria-busy="true"] { opacity: .6; cursor: progress; }

.cw-icone-btn {
  flex: none; width: 32px; height: 32px; border-radius: 10px; border: 0; cursor: pointer; display: grid; place-items: center;
  background: var(--bg-2); color: var(--text-2); margin-left: auto;
}
.cw-icone-btn svg { width: 16px; height: 16px; }

/* ---- o chat ---- */
.cw-chat { height: min(560px, calc(100vh - 100px)); display: flex; flex-direction: column; }
.cw-chat__topo { display: flex; align-items: center; gap: 10px; padding: 12px 12px 12px 14px; background: var(--ink); color: #fff; }
.cw-chat__topo .cw-avatar { width: 38px; height: 38px; background: rgba(255, 255, 255, .12); }
.cw-chat__topo b { font-family: var(--font-head); font-size: 15px; display: block; }
.cw-chat__topo span.cw-sub { font-size: 11.5px; opacity: .7; display: block; }
.cw-chat__topo .cw-icone-btn { background: rgba(255, 255, 255, .12); color: #fff; margin-left: 0; }
.cw-chat__topo .cw-acoes { margin-left: auto; display: flex; gap: 6px; }
.cw-corpo { flex: 1; overflow-y: auto; padding: 16px 14px; display: flex; flex-direction: column; gap: 10px; background: var(--bg-2); }
.cw-msg { max-width: 85%; padding: 9px 13px; border-radius: 15px; font-size: 14px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.cw-msg--lia { background: #fff; border: 1px solid var(--border); color: var(--text); align-self: flex-start; border-bottom-left-radius: 5px; }
.cw-msg--eu { background: var(--grad-accent); color: #fff; align-self: flex-end; border-bottom-right-radius: 5px; }
.cw-msg a { color: inherit; text-decoration: underline; }
.cw-aviso-chat { align-self: center; font-size: 12px; color: var(--text-3); text-align: center; padding: 2px 10px; }
.cw-digitando { align-self: flex-start; display: inline-flex; gap: 4px; padding: 12px 14px; background: #fff; border: 1px solid var(--border); border-radius: 15px; border-bottom-left-radius: 5px; }
.cw-digitando span { width: 6px; height: 6px; border-radius: 50%; background: var(--text-3); animation: cw-ponto 1.2s infinite ease-in-out; }
.cw-digitando span:nth-child(2) { animation-delay: .15s; }
.cw-digitando span:nth-child(3) { animation-delay: .3s; }
@keyframes cw-ponto { 0%, 80%, 100% { opacity: .35; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.cw-cta {
  align-self: flex-start; border: 0; border-radius: 12px; padding: 11px 18px; cursor: pointer;
  background: var(--grad-accent); color: #fff; font-family: var(--font-head); font-weight: 600; font-size: 14px;
  box-shadow: 0 8px 20px color-mix(in srgb, var(--accent) 30%, transparent); transition: transform .2s var(--ease);
}
.cw-cta:hover { transform: translateY(-2px); }
.cw-rodape-aviso { text-align: center; font-size: 10.5px; color: var(--text-3); padding: 6px 14px 4px; background: var(--bg); }
.cw-pe { display: flex; gap: 8px; padding: 6px 12px 12px; background: var(--bg); }
.cw-pe input {
  flex: 1; min-width: 0; border: 1px solid var(--border); border-radius: 12px; padding: 11px 13px; font: inherit;
  font-size: 14.5px; color: var(--text); background: var(--bg); outline: none;
}
.cw-pe input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.cw-pe button {
  border: 0; border-radius: 12px; padding: 0 16px; background: var(--grad-accent); color: #fff;
  font-family: var(--font-head); font-weight: 600; cursor: pointer;
}
.cw-pe button:disabled { opacity: .55; cursor: default; }

/* ---- celular: o botão vira um círculo; o chat ocupa a tela de baixo ---- */
@media (max-width: 640px) {
  .cw-lancador { padding: 6px; right: 16px; bottom: 16px; }
  .cw-lancador .cw-rotulo { display: none; }
  .cw-lancador .cw-avatar { width: 44px; height: 44px; font-size: 24px; }
  .cw-menu, .cw-chat { right: 12px; bottom: 12px; width: calc(100vw - 24px); }
  .cw-chat { height: min(620px, calc(100dvh - 88px)); }
}
@media (prefers-reduced-motion: reduce) {
  .cw-menu, .cw-chat { animation: none; }
  .cw-digitando span { animation: none; opacity: .6; }
  .cw-lancador, .cw-cta { transition: none; }
}
