﻿/* ==========================================================================
   funnel.css — checkout, tela Pix, upsell, downsell, obrigado e páginas legais
   ========================================================================== */
.pg-funil { min-height: 100vh; display: flex; flex-direction: column; }
.pg-funil main { flex: 1; }
.wrap-funil { max-width: 560px; }

.funil-topo { background: var(--paper); border-bottom: 1px solid var(--line); }
.funil-topo .wrap { display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; min-height: 60px; flex-wrap: wrap; padding-top: 10px; padding-bottom: 10px; }
.funil-topo .brand { font-size: 15px; }
.etapas { list-style: none; display: flex; gap: 6px; margin: 0; padding: 0; font-size: 12.5px; font-weight: 700; color: var(--muted); }
.etapas li { padding: 4px 8px; border-radius: 99px; background: var(--bg); }
.etapas li.is-atual { background: var(--ink); color: #fff; }
.etapas li.is-feito { background: var(--hl); color: var(--ink); }
.etapas li.is-feito::before { content: "✔ "; }

.funil-rodape { padding: 22px 0 28px; font-size: 13px; color: var(--muted); text-align: center; }
.funil-rodape p { margin: 0 0 4px; }
.funil-rodape a { display: inline-block; padding: 12px 4px; }

/* ---------- Checkout ---------- */
.checkout { padding-top: 22px; padding-bottom: 28px; }
.ck-titulo { font-size: clamp(1.25rem, 5.2vw, 1.6rem); margin-bottom: 16px; }

.resumo { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); margin-bottom: 18px; }
.resumo-topo { display: flex; gap: 14px; align-items: center; }
.resumo-img { width: 72px; height: 72px; border-radius: 10px; flex-shrink: 0; }
.resumo p { margin: 0; }
.resumo-nome { font-weight: 800; line-height: 1.3; }
.resumo-ref { font-size: 14px; color: var(--muted); }
.resumo-preco { font-size: 1.5rem; font-weight: 800; }
.resumo-preco small { font-size: 13px; font-weight: 600; color: var(--muted); }
.resumo-inclui { list-style: none; padding: 12px 0 0; margin: 12px 0 0; border-top: 1px dashed var(--line); display: grid; gap: 4px; font-size: 15px; }
.resumo-inclui li::before { content: "✔ "; color: var(--ok); font-weight: 800; }
.upgrade { margin-top: 14px; background: var(--hl); border-radius: 12px; padding: 12px 14px; }
.upgrade p { margin-bottom: 10px; font-size: 15px; }
.upgrade .btn { background: var(--paper); min-height: 48px; font-size: 15.5px; }

.bloco { border: 0; padding: 0; margin: 0 0 20px; min-width: 0; }
.bloco legend { font-weight: 800; font-size: 1.1rem; margin-bottom: 10px; padding: 0; }
.campo { margin-bottom: 14px; }
.campo label { display: block; font-weight: 700; font-size: 15px; margin-bottom: 5px; }
.campo-dica { font-weight: 500; color: var(--muted); font-size: 13.5px; }
.campo input {
  width: 100%; min-height: 52px; padding: 12px 14px; border: 2px solid #CFC8B8; border-radius: 10px; background: var(--paper);
  font: 17px var(--font); color: var(--ink); transition: border-color .15s;
}
.campo input:focus { border-color: var(--ink); outline: none; box-shadow: 0 0 0 3px rgba(22, 56, 74, .15); }
.campo input[aria-invalid="true"] { border-color: var(--err); }
.campo.is-ok input { border-color: var(--ok); }
.erro { color: var(--err); font-size: 14px; margin: 5px 0 0; min-height: 0; }
.erro:empty { display: none; }

.bump {
  display: grid; gap: 4px; padding: 0 14px 14px; margin-bottom: 12px; border: 2px dashed var(--cta); border-radius: 12px;
  background: #FFF8F5; cursor: pointer; transition: background-color .15s, border-color .15s;
}
.bump.is-marcado { border-style: solid; background: #FDECE7; }
.bump-topo { display: flex; align-items: center; gap: 10px; margin: 0 -14px 6px; padding: 10px 14px; background: #FBE3DD; border-radius: 10px 10px 0 0; min-height: 48px; }
.bump input { width: 24px; height: 24px; accent-color: var(--cta); flex-shrink: 0; margin: 0; cursor: pointer; }
.bump-check { font-weight: 800; color: #8A2E1C; flex: 1; font-size: 15px; }
.bump-preco { font-weight: 800; white-space: nowrap; }
.bump-nome { font-weight: 800; }
.bump-desc { font-size: 14.5px; color: var(--ink-2); }

.total { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 16px; }
.total p { margin: 0; }
.total-item { display: flex; justify-content: space-between; gap: 12px; font-size: 14.5px; color: var(--ink-2); padding: 3px 0; }
.total-item span:last-child { white-space: nowrap; }
.total-linha { display: flex; justify-content: space-between; align-items: baseline; border-top: 1px solid var(--line); margin-top: 8px !important; padding-top: 10px; font-weight: 800; font-size: 18px; }
.total-linha strong { font-size: 1.6rem; }
.total-sub { font-size: 13px; color: var(--muted); }

.btn-gerar { min-height: 58px; font-size: 18px; }
.selos { list-style: none; padding: 0; margin: 14px 0 6px; display: flex; flex-wrap: wrap; gap: 6px 14px; justify-content: center; font-size: 13.5px; color: var(--ink-2); }
.ck-legal { font-size: 12.5px; color: var(--muted); text-align: center; }

/* ---------- Tela Pix ---------- */
.etapa-pix { scroll-margin-top: 10px; }
.pix-card { background: var(--paper); border: 1px solid var(--line); border-radius: 18px; padding: 20px 18px; box-shadow: var(--shadow); text-align: center; }
.pix-loading { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 200px; font-weight: 700; }
.spinner { width: 18px; height: 18px; border: 3px solid var(--line); border-top-color: var(--ink); border-radius: 50%; animation: girar .8s linear infinite; display: inline-block; flex-shrink: 0; }
@keyframes girar { to { transform: rotate(360deg); } }
.pix-ok-tag { display: inline-block; background: var(--hl); font-weight: 800; font-size: 13px; padding: 4px 10px; border-radius: 99px; margin-bottom: 8px; }
.pix-ok-tag.is-expirado { background: #FBE3DD; color: #8A2E1C; }
.pix-titulo { font-size: 1.3rem; }
.pix-valor { font-size: 17px; }
.pix-valor strong { font-size: 1.4rem; }
.pix-timer { background: #FFF4E5; border: 1px solid #F3D19C; border-radius: 12px; padding: 10px 14px; margin: 0 0 16px; }
.pix-timer p { margin: 0; }
.pix-timer strong { font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.pix-timer-sub { font-size: 13.5px; color: var(--ink-2); }
.pix-barra { height: 6px; background: #F3E2C3; border-radius: 3px; overflow: hidden; margin: 8px 0; }
.pix-barra span { display: block; height: 100%; background: #D98E04; transform-origin: left; transition: transform 1s linear; }
.pix-timer.is-acabando { background: #FDECE7; border-color: #F0B3A5; }
.pix-timer.is-acabando strong { color: var(--err); }
.pix-timer.is-acabando .pix-barra span { background: var(--err); }
.pix-qr { width: 232px; height: 232px; margin: 0 auto 14px; border: 1px solid var(--line); border-radius: 12px; }
.pix-label { display: block; font-weight: 700; font-size: 14px; text-align: left; margin-bottom: 4px; }
.pix-codigo { width: 100%; resize: none; font: 13px/1.4 ui-monospace, Consolas, monospace; padding: 10px; border: 2px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--ink); word-break: break-all; margin-bottom: 10px; }
.btn.is-copiado { background: var(--ok); box-shadow: 0 4px 0 #1F5A38; }
.pix-passos { text-align: left; font-size: 15px; padding-left: 22px; margin: 16px 0; display: grid; gap: 4px; }
.pix-status { display: flex; align-items: center; justify-content: center; gap: 10px; font-weight: 700; color: var(--ink-2); }
.pix-teste { margin: 16px 0 6px; padding: 12px; border: 2px dashed #8C7A3A; border-radius: 12px; background: #FFFBEA; text-align: left; }
.pix-teste p { font-size: 13.5px; margin-bottom: 10px; }
.btn-teste { background: #FFE58A; color: #3D3000; border: 2px solid #8C7A3A; }
.pix-garantia { font-size: 13px; color: var(--muted); margin: 12px 0 0; }
.pix-erro { color: var(--err); font-weight: 700; }
.pix-aprovado { padding: 30px 0; }
.pix-check { display: inline-grid; place-items: center; width: 72px; height: 72px; border-radius: 50%; background: var(--ok); color: #fff; font-size: 36px; margin-bottom: 12px; animation: pop .35s ease-out; }
@keyframes pop { from { transform: scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- Upsell / Downsell ---------- */
.oferta { padding-top: 18px; padding-bottom: 30px; }
.aprovado-faixa { display: flex; gap: 10px; align-items: center; background: #E6F4EA; border: 1px solid #B9DEC4; border-radius: 12px; padding: 10px 14px; font-size: 14.5px; margin-bottom: 18px; }
.aprovado-faixa strong { color: var(--ok); }
.aviso-etapa { text-align: center; font-weight: 800; color: var(--cta-hover); text-transform: uppercase; letter-spacing: .05em; font-size: 13px; margin-bottom: 6px; }
.oferta-etiqueta { display: inline-block; background: var(--ink); color: #fff; font-weight: 800; font-size: 13px; padding: 4px 12px; border-radius: 99px; margin-bottom: 10px; }
.oferta h1 { font-size: clamp(1.5rem, 6.4vw, 2.1rem); }
.oferta-texto { color: var(--ink-2); }
.oferta-card { background: var(--paper); border: 3px solid var(--cta); border-radius: 18px; padding: 18px; box-shadow: var(--shadow); margin: 16px 0; }
.oferta-card img { width: 100%; border-radius: 12px; margin-bottom: 14px; }
.oferta-nome { font-weight: 800; font-size: 1.15rem; margin-bottom: 2px; }
.oferta-sub { color: var(--muted); font-size: 14.5px; }
.oferta-itens { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 6px; }
.oferta-itens li::before { content: "✔ "; color: var(--ok); font-weight: 800; }
.oferta-preco { font-size: 2.3rem; font-weight: 800; margin: 0; line-height: 1.1; }
.oferta-preco-sub { font-size: 14px; color: var(--muted); }
.btn-recusar { display: flex; width: 100%; justify-content: center; min-height: 48px; margin-top: 8px; background: none; border: 0; color: var(--muted); font: 15px var(--font); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; align-items: center; }

/* ---------- Obrigado ---------- */
.obrigado { padding-top: 26px; padding-bottom: 30px; }
.obrigado-topo { text-align: center; }
.obrigado-topo .pix-check { animation: none; }
.obrigado h1 { font-size: clamp(1.6rem, 6.4vw, 2.2rem); }
.obrigado-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); margin-bottom: 16px; }
.obrigado-card h2 { font-size: 1.2rem; }
.obrigado-pedido p { margin: 0; }
.passos-acesso { list-style: none; counter-reset: a; padding: 0; margin: 0; display: grid; gap: 14px; }
.passos-acesso li { counter-increment: a; position: relative; padding-left: 46px; }
.passos-acesso li::before { content: counter(a); position: absolute; left: 0; top: 0; width: 32px; height: 32px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; font-weight: 800; }
.passos-acesso p { margin: 2px 0 0; color: var(--ink-2); font-size: 15.5px; }

/* ---------- Páginas legais ---------- */
.legal { padding-top: 26px; padding-bottom: 40px; }
.legal h1 { font-size: 1.8rem; }
.legal h2 { font-size: 1.2rem; margin-top: 1.4em; }
.legal .placeholder-aviso { background: #FFF4CC; border: 1px solid #E8D48A; border-radius: 10px; padding: 12px 14px; font-size: 14.5px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Conteúdo montado pelo JS (a partir do config.js) aparece de uma vez só,
   evitando layout shift (CLS). Se o JS falhar, aparece sozinho em 2,5 s. */
.js-render { visibility: hidden; animation: revelar 0s 2.5s forwards; }
.js-render.is-pronto { visibility: visible; animation: none; }
@keyframes revelar { to { visibility: visible; } }

/* Obrigado: links de download (preenchidos pelo back-end) */
.downloads { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 10px; }
.downloads a { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); font-weight: 700; text-decoration: none; }
.downloads a::before { content: "PDF"; flex: none; font-size: 11px; font-weight: 800; letter-spacing: .04em; color: #fff; background: var(--cta); border-radius: 6px; padding: 4px 6px; }
