/*
 * WhatsApp com captura de lead: botao flutuante, popup e espiral.
 * Regra visual do site: nada de borda de 1px. Destaque por fundo mais
 * claro, cor e brilho.
 */

.zf-wa,
.zf-wa-flutuante {
	--wa-verde: #25d366;
	--wa-verde-acao: #0e7a3d;
	--wa-verde-hover: #0f8a45;
	--wa-roxo: #7a1ef6;
	--wa-roxo-claro: #bd8efa;
	--wa-painel: #18181b;
	--wa-campo: #232328;
	--wa-campo-hover: #2a2a31;
	--wa-campo-foco: #2e2a3a;
	--wa-titulo: #ffffff;
	--wa-texto: #a1a1aa;
	--wa-rotulo: #e4e4e7;
	--wa-erro: #fca5a5;
	--wa-mola: cubic-bezier(0.16, 1, 0.3, 1);
	--wa-mola-forte: cubic-bezier(0.34, 1.56, 0.64, 1);
	font-family: var(--wp--preset--font-family--corpo, "Plus Jakarta Sans", Inter, system-ui, sans-serif);
}
.zf-wa *, .zf-wa *::before, .zf-wa *::after,
.zf-wa-flutuante, .zf-wa-flutuante * { box-sizing: border-box; }

/* =========================================================
 * Botao flutuante
 * ======================================================= */

.zf-wa-flutuante {
	position: fixed;
	right: max(20px, env(safe-area-inset-right));
	bottom: max(20px, env(safe-area-inset-bottom));
	z-index: 90;
	display: inline-flex;
	align-items: center;
	height: 60px;
	padding: 0;
	border-radius: 999px;
	background: var(--wa-verde-acao);
	color: #ffffff;
	text-decoration: none;
	box-shadow: 0 10px 30px -6px rgba(14, 122, 61, 0.55), 0 4px 12px rgba(10, 10, 11, 0.45);
	transition: background-color 0.2s ease, box-shadow 0.35s var(--wa-mola), transform 0.45s var(--wa-mola), opacity 0.25s ease;
	animation: zf-wa-flutuante-entra 0.7s var(--wa-mola-forte) 0.6s both;
}
.zf-wa-flutuante__icone {
	position: relative;
	display: grid;
	place-items: center;
	width: 60px;
	height: 60px;
	flex: none;
}
/* Anel que pulsa devagar chamando atencao, sem ser linha fixa. */
.zf-wa-flutuante__icone::before {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: 50%;
	background: var(--wa-verde);
	opacity: 0;
	animation: zf-wa-pulso 3.2s var(--wa-mola) 2s infinite;
	z-index: -1;
}
.zf-wa-flutuante__rotulo {
	max-width: 0;
	overflow: hidden;
	white-space: nowrap;
	font-size: 15px;
	font-weight: 600;
	opacity: 0;
	transition: max-width 0.45s var(--wa-mola), opacity 0.25s ease, padding 0.45s var(--wa-mola);
}
.zf-wa-flutuante:hover,
.zf-wa-flutuante:focus-visible {
	background: var(--wa-verde-hover);
	transform: translateY(-3px);
	box-shadow: 0 16px 36px -8px rgba(37, 211, 102, 0.55), 0 6px 14px rgba(10, 10, 11, 0.5);
}
.zf-wa-flutuante:focus-visible { outline: 2px solid var(--wa-roxo-claro); outline-offset: 3px; }
.zf-wa-flutuante:active { transform: translateY(0) scale(0.96); }

@media (hover: hover) and (min-width: 768px) {
	.zf-wa-flutuante:hover .zf-wa-flutuante__rotulo,
	.zf-wa-flutuante:focus-visible .zf-wa-flutuante__rotulo {
		max-width: 180px;
		padding-right: 22px;
		opacity: 1;
	}
}

.zf-wa-aberto .zf-wa-flutuante { animation: none; opacity: 0; transform: scale(0.8); pointer-events: none; }

@keyframes zf-wa-flutuante-entra {
	from { opacity: 0; transform: translateY(24px) scale(0.6); }
	to { opacity: 1; transform: none; }
}
@keyframes zf-wa-pulso {
	0% { opacity: 0.45; transform: scale(1); }
	70%, 100% { opacity: 0; transform: scale(1.55); }
}

/* =========================================================
 * Popup (dialog)
 * ======================================================= */

.zf-wa-aberto,
.zf-wa-aberto body { overflow: hidden; }

.zf-wa {
	width: min(440px, calc(100vw - 32px));
	max-width: none;
	max-height: calc(100dvh - 32px);
	margin: auto;
	padding: 0;
	border: 0;
	background: transparent;
	color: var(--wa-rotulo);
	overflow: visible;
}
.zf-wa::backdrop {
	background: radial-gradient(120% 90% at 50% 100%, rgba(43, 4, 95, 0.55), rgba(10, 10, 11, 0.82));
	-webkit-backdrop-filter: blur(10px) saturate(1.2);
	backdrop-filter: blur(10px) saturate(1.2);
}

.zf-wa__painel {
	position: relative;
	overflow: hidden;
	padding: 36px 28px 26px;
	border-radius: 22px;
	background:
		radial-gradient(130% 70% at 100% 0%, rgba(122, 30, 246, 0.28), transparent 60%),
		radial-gradient(90% 60% at 0% 100%, rgba(37, 211, 102, 0.12), transparent 65%),
		var(--wa-painel);
	box-shadow: 0 40px 80px -20px rgba(0, 0, 0, 0.7), 0 0 60px -10px rgba(122, 30, 246, 0.35);
}
@media (min-width: 480px) {
	.zf-wa__painel { padding: 40px 36px 28px; }
}

/* Entrada: o fundo desfoca, o painel sobe do desfoque com mola, e os itens
   chegam em cascata. Saida: o caminho inverso, rapido. */
.zf-wa[open]::backdrop { animation: zf-wa-fundo 0.4s ease both; }
.zf-wa[open] .zf-wa__painel { animation: zf-wa-painel 0.65s var(--wa-mola) both; }
.zf-wa[open][data-etapa="form"] .zf-wa__etapa--form > *,
.zf-wa[open][data-etapa="form"] .zf-wa__form > * {
	animation: zf-wa-item 0.6s var(--wa-mola) both;
}
.zf-wa[open] .zf-wa__selo { animation-delay: 0.08s; }
.zf-wa[open] .zf-wa__titulo { animation-delay: 0.14s; }
.zf-wa[open] .zf-wa__etapa--form > .zf-wa__texto { animation-delay: 0.2s; }
.zf-wa[open] .zf-wa__form > :nth-child(1) { animation-delay: 0.26s; }
.zf-wa[open] .zf-wa__form > :nth-child(2) { animation-delay: 0.32s; }
.zf-wa[open] .zf-wa__form > .zf-wa__enviar { animation-delay: 0.38s; }
.zf-wa[open] .zf-wa__form > .zf-wa__nota { animation-delay: 0.44s; }

.zf-wa.is-fechando::backdrop { animation: zf-wa-fundo 0.22s ease reverse both; }
.zf-wa.is-fechando .zf-wa__painel { animation: zf-wa-painel-sai 0.22s ease both; }

@keyframes zf-wa-fundo {
	from { opacity: 0; }
	to { opacity: 1; }
}
@keyframes zf-wa-painel {
	from { opacity: 0; transform: translateY(40px) scale(0.92); filter: blur(10px); }
	to { opacity: 1; transform: none; filter: blur(0); }
}
@keyframes zf-wa-painel-sai {
	to { opacity: 0; transform: translateY(16px) scale(0.96); filter: blur(4px); }
}
@keyframes zf-wa-item {
	from { opacity: 0; transform: translateY(14px); }
	to { opacity: 1; transform: none; }
}

/* Fechar */
.zf-wa__fechar {
	position: absolute;
	top: 14px;
	right: 14px;
	z-index: 2;
	display: grid;
	place-items: center;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--wa-texto);
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease, transform 0.35s var(--wa-mola);
}
.zf-wa__fechar:hover { background: var(--wa-campo); color: #ffffff; transform: rotate(90deg); }
.zf-wa__fechar:focus-visible { outline: 2px solid var(--wa-roxo-claro); outline-offset: 2px; }
.zf-wa[data-etapa="ir"] .zf-wa__fechar { opacity: 0; pointer-events: none; }

/* Cabecalho */
.zf-wa__selo {
	display: grid;
	place-items: center;
	width: 56px;
	height: 56px;
	margin-bottom: 18px;
	border-radius: 16px;
	background: linear-gradient(145deg, var(--wa-verde) 0%, var(--wa-verde-acao) 100%);
	color: #ffffff;
	box-shadow: 0 10px 24px -6px rgba(37, 211, 102, 0.5);
}
.zf-wa__titulo {
	margin: 0 0 8px;
	font-size: 1.5rem;
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: -0.02em;
	color: var(--wa-titulo);
}
.zf-wa__texto {
	margin: 0 0 24px;
	font-size: 0.9375rem;
	line-height: 1.55;
	color: var(--wa-texto);
}

/* Campos: sem borda, fundo mais claro que o painel; foco com fundo e brilho. */
.zf-wa__form { display: grid; gap: 14px; }
.zf-wa__campo { display: flex; flex-direction: column; gap: 6px; }
.zf-wa__campo label {
	font-size: 0.8125rem;
	font-weight: 600;
	color: var(--wa-rotulo);
}
.zf-wa__campo input {
	width: 100%;
	min-height: 52px;
	margin: 0;
	padding: 14px 16px;
	border: 0;
	border-radius: 12px;
	background: var(--wa-campo);
	box-shadow: none;
	font: inherit;
	font-size: 16px; /* iOS nao da zoom no foco */
	line-height: 1.4;
	color: #ffffff;
	transition: background-color 0.2s ease, box-shadow 0.35s var(--wa-mola);
}
.zf-wa__campo input::placeholder { color: #71717a; opacity: 1; }
.zf-wa__campo input:hover { background: var(--wa-campo-hover); }
.zf-wa__campo input:focus {
	outline: none;
	background: var(--wa-campo-foco);
	box-shadow: 0 0 0 4px rgba(122, 30, 246, 0.28), 0 0 28px rgba(122, 30, 246, 0.22);
}
.zf-wa__campo.is-erro input { background: rgba(127, 29, 29, 0.32); }
.zf-wa__campo.is-erro input:focus { box-shadow: 0 0 0 4px rgba(248, 113, 113, 0.22); }
.zf-wa__erro {
	margin: 0;
	min-height: 0;
	font-size: 0.8125rem;
	line-height: 1.45;
	color: var(--wa-erro);
}
.zf-wa__erro:empty { display: none; }
.zf-wa__campo.is-erro .zf-wa__erro { animation: zf-wa-item 0.35s var(--wa-mola) both; }

.zf-wa__hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Botao */
.zf-wa__enviar {
	position: relative;
	overflow: hidden;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	width: 100%;
	min-height: 54px;
	margin-top: 6px;
	padding: 0 24px;
	border: 0;
	border-radius: 12px;
	background: var(--wa-verde-acao);
	color: #ffffff;
	font: inherit;
	font-size: 1rem;
	font-weight: 700;
	cursor: pointer;
	box-shadow: 0 12px 26px -10px rgba(37, 211, 102, 0.6);
	transition: background-color 0.2s ease, transform 0.35s var(--wa-mola), box-shadow 0.35s var(--wa-mola);
}
/* Brilho que atravessa o botao no hover. */
.zf-wa__enviar::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.22) 50%, transparent 70%);
	transform: translateX(-120%);
	transition: transform 0.7s var(--wa-mola);
}
.zf-wa__enviar:hover { background: var(--wa-verde-hover); transform: translateY(-2px); box-shadow: 0 18px 32px -12px rgba(37, 211, 102, 0.7); }
.zf-wa__enviar:hover::after { transform: translateX(120%); }
.zf-wa__enviar:active { transform: scale(0.98); }
.zf-wa__enviar:focus-visible { outline: 2px solid var(--wa-roxo-claro); outline-offset: 3px; }

.zf-wa__nota {
	margin: 2px 0 0;
	text-align: center;
	font-size: 0.75rem;
	color: #71717a;
}

/* =========================================================
 * Etapa "Direcionando": espiral
 * ======================================================= */

.zf-wa__etapa--ir {
	display: flex;
	flex-direction: column;
	align-items: center;
	padding: 12px 0 8px;
	text-align: center;
}
.zf-wa__etapa--ir[hidden] { display: none; }
.zf-wa[data-etapa="ir"] .zf-wa__etapa--ir > * { animation: zf-wa-item 0.55s var(--wa-mola) both; }
.zf-wa[data-etapa="ir"] .zf-wa__etapa--ir > :nth-child(2) { animation-delay: 0.08s; }
.zf-wa[data-etapa="ir"] .zf-wa__etapa--ir > :nth-child(3) { animation-delay: 0.14s; }

.zf-wa__espiral {
	position: relative;
	width: 120px;
	height: 120px;
	margin-bottom: 26px;
}
.zf-wa__espiral svg { display: block; overflow: visible; }
.zf-wa__anel {
	fill: none;
	stroke: url(#zf-wa-grad);
	stroke-linecap: round;
	transform-origin: 60px 60px;
}
/* Tres arcos de tamanhos e velocidades diferentes, girando em sentidos
   alternados e "respirando": juntos formam a espiral. */
.zf-wa__anel--1 { stroke-width: 5; stroke-dasharray: 170 400; animation: zf-wa-gira 1.6s linear infinite, zf-wa-respira 1.6s ease-in-out infinite; }
.zf-wa__anel--2 { stroke-width: 4.5; stroke-dasharray: 110 300; opacity: 0.85; animation: zf-wa-gira-inv 1.25s linear infinite; }
.zf-wa__anel--3 { stroke-width: 4; stroke-dasharray: 60 200; opacity: 0.7; animation: zf-wa-gira 0.95s linear infinite; }

.zf-wa__espiral-icone {
	position: absolute;
	inset: 0;
	display: grid;
	place-items: center;
	color: var(--wa-verde);
	animation: zf-wa-batida 1.6s var(--wa-mola) infinite;
}

.zf-wa__titulo--ir { font-size: 1.25rem; }
.zf-wa__etapa--ir .zf-wa__texto { margin-bottom: 8px; }

.zf-wa__manual {
	margin-top: 12px;
	padding: 10px 16px;
	border-radius: 10px;
	background: var(--wa-campo);
	font-size: 0.875rem;
	font-weight: 600;
	color: var(--wa-roxo-claro);
	text-decoration: none;
	transition: background-color 0.2s ease;
}
.zf-wa__manual:hover { background: var(--wa-campo-hover); }

@keyframes zf-wa-gira { to { transform: rotate(360deg); } }
@keyframes zf-wa-gira-inv { to { transform: rotate(-360deg); } }
@keyframes zf-wa-respira {
	0%, 100% { stroke-dasharray: 60 400; }
	50% { stroke-dasharray: 220 400; }
}
@keyframes zf-wa-batida {
	0%, 100% { transform: scale(1); }
	45% { transform: scale(1.14); }
}

/* =========================================================
 * Movimento reduzido
 * ======================================================= */

@media (prefers-reduced-motion: reduce) {
	.zf-wa-flutuante,
	.zf-wa-flutuante__icone::before,
	.zf-wa[open]::backdrop,
	.zf-wa[open] .zf-wa__painel,
	.zf-wa[open] .zf-wa__etapa--form > *,
	.zf-wa[open] .zf-wa__form > *,
	.zf-wa[data-etapa="ir"] .zf-wa__etapa--ir > *,
	.zf-wa__espiral-icone { animation: none !important; }
	.zf-wa__anel--1 { animation: zf-wa-gira 2.4s linear infinite; }
	.zf-wa__anel--2, .zf-wa__anel--3 { animation: none; }
	.zf-wa-flutuante, .zf-wa__enviar, .zf-wa__fechar { transition: none; }
}
