/* ============================================================
   DaviPlayer — chat de vendas e dúvidas do site (02/10/2026)
   Estilos do widget de chat.js. Tudo com prefixo .dpc- para não brigar com o CSS das páginas.
   Cores/raios herdam a linguagem do site (claro, degradê ciano→roxo só no botão/destaque).
   Grade de 4 px; alvos de toque >= 44 px; contraste >= 4.5:1 no texto; foco visível.
   ============================================================ */
.dpc-lanc, .dpc-janela, .dpc-janela * { box-sizing: border-box; }
.dpc-janela { padding: 0; margin: 0; }

/* ── Botão flutuante ── */
.dpc-lanc {
  position: fixed; z-index: 72; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom));
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 56px; height: 56px; padding: 0; border: 0; border-radius: 999px; cursor: pointer;
  background: linear-gradient(90deg, #22d3ee, #8b5cf6); color: #0b0e14;
  font: 700 14px/1 Inter, system-ui, sans-serif; letter-spacing: .01em;
  box-shadow: 0 12px 28px -10px rgba(124, 58, 237, .6), 0 2px 6px rgba(20, 24, 38, .18);
  transition: transform .15s ease, box-shadow .2s ease;
  -webkit-tap-highlight-color: transparent;
}
.dpc-lanc:hover { box-shadow: 0 16px 34px -10px rgba(124, 58, 237, .75), 0 2px 6px rgba(20, 24, 38, .2); }
.dpc-lanc:active { transform: scale(.96); }
/* bolinha animada: anel que pulsa + balanço suave (some com "reduzir movimento") */
@keyframes dpc-pulso {
  0%   { box-shadow: 0 0 0 0 rgba(139, 92, 246, .55), 0 12px 28px -10px rgba(124, 58, 237, .6); }
  70%  { box-shadow: 0 0 0 20px rgba(139, 92, 246, 0), 0 12px 28px -10px rgba(124, 58, 237, .6); }
  100% { box-shadow: 0 0 0 0 rgba(139, 92, 246, 0), 0 12px 28px -10px rgba(124, 58, 237, .6); }
}
@keyframes dpc-balanco { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
.dpc-lanc { animation: dpc-pulso 2.4s ease-out infinite, dpc-balanco 3.2s ease-in-out infinite; }
.dpc-lanc:hover, .dpc-lanc:focus-visible { animation-play-state: paused; }
@media (prefers-reduced-motion: reduce) { .dpc-lanc { animation: none; } }
.dpc-lanc svg { width: 24px; height: 24px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.dpc-lanc .dpc-lanc-t { display: none; white-space: nowrap; }
/* a página já tem o botão do WhatsApp (verde, 58 px, canto inferior direito): o chat fica logo acima dele */
.dpc-lanc.dpc-sobe { bottom: calc(16px + 58px + 12px + env(safe-area-inset-bottom)); }
.dpc-lanc.dpc-off { display: none; }
@media (min-width: 760px) {
  .dpc-lanc { right: 18px; bottom: 18px; width: auto; height: 48px; padding: 0 20px 0 16px; }
  .dpc-lanc .dpc-lanc-t { display: inline; }
  .dpc-lanc.dpc-sobe { bottom: calc(18px + 58px + 12px); }
}
.dpc-lanc:focus-visible, .dpc-janela button:focus-visible, .dpc-janela a:focus-visible, .dpc-janela input:focus-visible {
  outline: 3px solid #6d28d9; outline-offset: 2px;
}

/* ── Fundo (só no celular) e janela ── */
html.dpc-trava, html.dpc-trava body { overflow: hidden; }
.dpc-fundo { position: fixed; top:0;right:0;bottom:0;left:0; z-index: 90; background: rgba(20, 24, 38, .5); opacity: 0; pointer-events: none; transition: opacity .2s ease; }
.dpc-fundo.on { opacity: 1; pointer-events: auto; }
.dpc-janela {
  position: fixed; z-index: 91; left: 0; right: 0; bottom: 0;
  display: flex; flex-direction: column; overflow: hidden;
  width: 100%; height: min(640px, 88vh); height: min(640px, 88dvh);
  background: #fff; color: #141826; border-radius: 20px 20px 0 0;
  font: 400 15px/1.5 Inter, system-ui, sans-serif; text-align: left;
  box-shadow: 0 -12px 40px rgba(20, 24, 38, .25);
  transform: translateY(105%); visibility: hidden; transition: transform .28s cubic-bezier(.22, .61, .36, 1), visibility 0s linear .28s;
}
.dpc-janela.on { transform: none; visibility: visible; transition-delay: 0s; }
/* teclado aberto no celular: a janela ocupa só a área VISÍVEL (medida pelo visualViewport no chat.js) */
.dpc-janela.dpc-tec { border-radius: 0; }
.dpc-janela.dpc-tec .dpc-acoes, .dpc-janela.dpc-tec .dpc-priv, .dpc-janela.dpc-tec .dpc-rap { display: none; }
@media (min-width: 760px) {
  .dpc-fundo { display: none; }
  .dpc-janela {
    left: auto; right: 18px; bottom: 18px; width: 392px; height: min(600px, calc(100vh - 36px)); height: min(600px, calc(100dvh - 36px));
    border-radius: 20px; box-shadow: 0 24px 64px rgba(20, 24, 38, .28), 0 0 0 1px rgba(20, 24, 38, .06);
    transform: translateY(16px); opacity: 0; transition: transform .22s ease, opacity .22s ease, visibility 0s linear .22s;
  }
  .dpc-janela.on { transform: none; opacity: 1; }
}

/* ── Cabeçalho ── */
.dpc-cab { display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 16px; border-bottom: 1px solid #eceae6; background: #fff; flex: none; }
.dpc-av { width: 40px; height: 40px; flex: none; border-radius: 12px; background: #fff; border: 1px solid #eceae6; padding: 6px; object-fit: contain; }
.dpc-cab-t { flex: 1; min-width: 0; }
.dpc-cab-t b { display: block; font: 700 16px/1.25 Poppins, Inter, system-ui, sans-serif; letter-spacing: -.01em; }
.dpc-cab-t small { display: block; font-size: 12px; line-height: 16px; color: #5b6172; }
.dpc-x { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border: 0; border-radius: 12px; background: transparent; color: #5b6172; cursor: pointer; }
.dpc-x:hover { background: #f5f3f8; color: #141826; }
.dpc-x svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; }

/* ── Mensagens ── */
.dpc-msgs { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 16px 16px 8px; display: flex; flex-direction: column; gap: 8px; background: #fbfaf9; scroll-behavior: smooth; }
.dpc-msgs > * { flex: none; }
.dpc-m { max-width: 86%; padding: 10px 14px; border-radius: 16px; font-size: 15px; line-height: 22px; white-space: pre-wrap; overflow-wrap: anywhere; animation: dpc-entra .2s ease; }
.dpc-m.ia { align-self: flex-start; background: #fff; border: 1px solid #eceae6; border-bottom-left-radius: 4px; }
.dpc-m.eu { align-self: flex-end; background: #141826; color: #fff; border-bottom-right-radius: 4px; }
.dpc-m.dono { align-self: flex-start; background: #f5f3ff; border: 1px solid #ddd6fe; border-bottom-left-radius: 4px; }
.dpc-rot { display: block; font: 700 11px/16px Inter, system-ui, sans-serif; letter-spacing: .06em; text-transform: uppercase; color: #5b21b6; margin-bottom: 2px; }
.dpc-m a { color: #6d28d9; text-decoration: underline; text-underline-offset: 2px; font-weight: 600; }
.dpc-aviso { align-self: center; max-width: 92%; text-align: center; font-size: 12px; line-height: 16px; color: #5b6172; padding: 4px 8px; }
.dpc-dig { align-self: flex-start; display: inline-flex; align-items: center; gap: 4px; background: #fff; border: 1px solid #eceae6; border-radius: 16px; border-bottom-left-radius: 4px; padding: 14px 16px; }
.dpc-dig i { width: 8px; height: 8px; border-radius: 50%; background: #8b5cf6; opacity: .45; animation: dpc-onda 1.1s ease-in-out infinite; }
.dpc-dig i:nth-child(2) { animation-delay: .15s; } .dpc-dig i:nth-child(3) { animation-delay: .3s; }
.dpc-vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@keyframes dpc-entra { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes dpc-onda { 0%, 60%, 100% { transform: none; opacity: .45; } 30% { transform: translateY(-4px); opacity: 1; } }

/* ── Botões ── */
.dpc-bt {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px;
  border-radius: 12px; border: 1px solid #dcd9e3; background: #fff; color: #141826; cursor: pointer; text-decoration: none;
  font: 600 14px/1.2 Inter, system-ui, sans-serif; -webkit-tap-highlight-color: transparent;
}
.dpc-bt:hover { background: #f4f1fb; border-color: #c9c1e4; }
.dpc-bt:active { transform: scale(.98); }
.dpc-bt[disabled] { opacity: .6; cursor: default; }
.dpc-bt svg { width: 18px; height: 18px; flex: none; fill: currentColor; }
.dpc-bt.zap { background: #0f7a40; border-color: #0f7a40; color: #fff; }       /* verde escuro: texto branco com contraste 5,4:1 */
.dpc-bt.zap:hover { background: #0c6a37; border-color: #0c6a37; }
.dpc-bt.pri { background: linear-gradient(90deg, #22d3ee, #8b5cf6); border-color: transparent; color: #0b0e14; }
.dpc-bt.pri:hover { filter: brightness(1.05); }
.dpc-inl { align-self: flex-start; display: flex; flex-wrap: wrap; gap: 8px; max-width: 100%; }

/* ── Atalhos de pergunta ── */
.dpc-rap { display: flex; gap: 8px; overflow-x: auto; padding: 8px 16px; background: #fbfaf9; scrollbar-width: none; flex: none; }
.dpc-rap::-webkit-scrollbar { display: none; }
.dpc-rap:empty { display: none; }
.dpc-chip { flex: none; min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid #dcd9e3; background: #fff; color: #141826; cursor: pointer; white-space: nowrap; font: 500 14px/1.2 Inter, system-ui, sans-serif; }
.dpc-chip:hover { background: #f4f1fb; border-color: #c9c1e4; }

/* ── Ações fixas (WhatsApp) ── */
.dpc-acoes { display: flex; gap: 8px; padding: 8px 16px; background: #fbfaf9; border-top: 1px solid #eceae6; flex: none; }
.dpc-acoes .dpc-bt { flex: 1 1 0; min-width: 0; padding: 0 8px; font-size: 13px; }

/* ── Formulário de contato (dentro da conversa) ── */
.dpc-form { align-self: stretch; background: #fff; border: 1px solid #eceae6; border-radius: 16px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.dpc-form label { font-size: 12px; line-height: 16px; font-weight: 600; color: #5b6172; }
.dpc-form input { width: 100%; height: 44px; padding: 0 12px; border: 1px solid #cfcbd8; border-radius: 12px; background: #fff; color: #141826; font: 400 16px/1.2 Inter, system-ui, sans-serif; }
.dpc-form .dpc-err { margin: 0; min-height: 0; font-size: 13px; line-height: 18px; color: #b91c1c; }
.dpc-form .dpc-err:empty { display: none; }
.dpc-form small { font-size: 12px; line-height: 16px; color: #5b6172; }
.dpc-form small a { color: #6d28d9; text-decoration: underline; }
.dpc-form .dpc-linha { display: flex; gap: 8px; }
.dpc-form .dpc-linha .dpc-bt { flex: 1 1 0; }
.dpc-ok { align-self: stretch; background: #ecfdf5; border: 1px solid #a7f3d0; border-radius: 16px; padding: 12px 14px; font-size: 14px; line-height: 20px; color: #065f46; }

/* ── Entrada de texto ── */
.dpc-ent { display: flex; gap: 8px; padding: 8px 12px 8px 16px; background: #fff; border-top: 1px solid #eceae6; flex: none; }
.dpc-ent input { flex: 1; min-width: 0; height: 48px; padding: 0 16px; border: 1px solid #cfcbd8; border-radius: 999px; background: #fff; color: #141826; font: 400 16px/1.2 Inter, system-ui, sans-serif; }   /* 16 px: o iPhone não dá zoom */
.dpc-ent input::placeholder { color: #6b7080; }
.dpc-ent input:focus { border-color: #6d28d9; outline: none; box-shadow: 0 0 0 3px rgba(109, 40, 217, .18); }
.dpc-env { width: 48px; height: 48px; flex: none; display: grid; place-items: center; border: 0; border-radius: 50%; cursor: pointer; background: linear-gradient(90deg, #22d3ee, #8b5cf6); color: #0b0e14; }
.dpc-env[disabled] { opacity: .5; cursor: default; }
.dpc-env svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.dpc-priv { margin: 0; padding: 0 16px 12px; background: #fff; font-size: 12px; line-height: 16px; color: #5b6172; flex: none; padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
.dpc-priv a { color: #6d28d9; text-decoration: underline; text-underline-offset: 2px; }
@media (min-width: 760px) { .dpc-priv { padding-bottom: 12px; } }

@media (prefers-reduced-motion: reduce) {
  .dpc-lanc, .dpc-janela, .dpc-fundo, .dpc-m { transition: none; animation: none; }
  .dpc-dig i { animation: none; opacity: .8; }
  .dpc-msgs { scroll-behavior: auto; }
}
