/* Formulário público */
body { overflow-x: hidden; }

.cursor-glow {
  position: fixed; z-index: 0; pointer-events: none; width: 520px; height: 520px; border-radius: 50%;
  left: 0; top: 0; transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(124, 58, 237, 0.14), transparent 60%);
  opacity: 0; transition: opacity 0.6s;
}
@media (pointer: fine) { body.has-pointer .cursor-glow { opacity: 1; } }

/* ---------- topo + progresso ---------- */
.topbar { position: fixed; top: 0; left: 0; right: 0; z-index: 20; transition: background 0.3s, backdrop-filter 0.3s; }
.topbar.scrolled { background: rgba(8, 6, 15, 0.72); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: 0 1px 0 var(--line); }
.progress { height: 3px; background: rgba(167, 139, 250, 0.1); }
.progress-fill {
  height: 100%; width: 0; border-radius: 0 3px 3px 0;
  background: linear-gradient(90deg, #6b21a8, #a78bfa 60%, #f0abfc);
  box-shadow: 0 0 12px rgba(167, 139, 250, 0.8), 0 0 2px #fff;
  transition: width 0.7s var(--ease);
  position: relative;
}
.progress-fill::after { /* ponto de luz na ponta da barra */
  content: ''; position: absolute; right: -2px; top: 50%; width: 8px; height: 8px; border-radius: 50%;
  transform: translateY(-50%); background: #fff; box-shadow: 0 0 12px 3px rgba(240, 171, 252, 0.9);
  opacity: 0; transition: opacity 0.4s;
}
.progress-fill.moving::after { opacity: 1; }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; max-width: 1100px; margin: 0 auto; padding: 18px 24px; }
.logo { width: 128px; height: auto; display: block; opacity: 0.95; }
.step-count { font-size: 13px; font-weight: 500; color: var(--fg3); font-variant-numeric: tabular-nums; }
.step-count b { color: #fff; font-weight: 600; }

/* ---------- palco ---------- */
.stage {
  position: relative; z-index: 1; min-height: 100vh; min-height: 100dvh;
  display: grid; place-items: center; padding: 96px 20px 48px;
}
/* Sem moldura: as perguntas ficam soltas sobre o fundo, numa coluna centralizada */
.panel { width: 100%; max-width: 640px; padding: 8px 0 36px; }
.preview-banner {
  position: fixed; z-index: 30; left: 50%; bottom: 16px; transform: translateX(-50%);
  display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; font-size: 12px; font-weight: 600;
  color: var(--warn); background: rgba(40, 30, 10, 0.9); border: 1px solid rgba(252, 211, 77, 0.35);
}

.page { will-change: transform, opacity; }
.page.enter { animation: pageIn 0.6s var(--ease) both; }
.page.leave { animation: pageOut 0.32s var(--ease) both; }
.page.back.enter { animation-name: pageInBack; }
.page.back.leave { animation-name: pageOutBack; }
@keyframes pageIn { from { opacity: 0; transform: translateY(32px); filter: blur(8px); } }
@keyframes pageOut { to { opacity: 0; transform: translateY(-24px); filter: blur(6px); } }
@keyframes pageInBack { from { opacity: 0; transform: translateY(-32px); filter: blur(8px); } }
@keyframes pageOutBack { to { opacity: 0; transform: translateY(24px); filter: blur(6px); } }
.stagger > * { animation: rise 0.7s var(--ease) both; animation-delay: calc(var(--i, 0) * 70ms + 80ms); }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } }

.page-head { margin-bottom: 8px; }
.page-head h1 {
  font-size: clamp(26px, 4.4vw, 36px); font-weight: 800; letter-spacing: -0.035em; line-height: 1.12;
  margin: 16px 0 10px; text-wrap: balance;
}
.page-head .lead { color: var(--fg3); margin: 0; font-size: 16px; white-space: pre-line; text-wrap: pretty; }

/* ---------- perguntas ---------- */
.q { margin-top: 30px; position: relative; }
.q-label { display: block; font-size: 17px; font-weight: 600; line-height: 1.4; margin: 0 0 4px; color: #fff; text-wrap: pretty; }
.q-label .req { color: var(--pink); margin-left: 3px; }
.q-desc { color: var(--fg3); font-size: 14px; margin: 0 0 12px; white-space: pre-line; }
.q-label + .q-control { margin-top: 12px; }
.q-error {
  display: flex; align-items: center; gap: 6px; margin-top: 10px; font-size: 13.5px; color: var(--err);
  animation: rise 0.35s var(--ease) both;
}
.q.has-error .input, .q.has-error .textarea, .q.has-error .select { border-color: rgba(253, 164, 175, 0.6); box-shadow: 0 0 0 4px rgba(253, 164, 175, 0.1); }
.q.shake { animation: shake 0.45s var(--ease); }
@keyframes shake { 20% { transform: translateX(-7px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(2px); } }

.q.statement { margin-top: 28px; padding: 20px 22px; border-radius: 16px; border: 1px solid var(--line); background: rgba(167, 139, 250, 0.05); }
.q.statement .q-label { font-size: 18px; }
.q.statement .q-desc { margin: 6px 0 0; font-size: 15px; color: var(--fg2); }

.input-wrap { position: relative; }
.input-wrap .prefix { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--fg3); font-weight: 500; pointer-events: none; }
.input-wrap .prefix + .input { padding-left: 48px; }
.input[type='date'], .input[type='time'] { min-height: 54px; }
.input[type='date']::-webkit-calendar-picker-indicator, .input[type='time']::-webkit-calendar-picker-indicator { filter: invert(0.75) sepia(1) hue-rotate(220deg) saturate(3); cursor: pointer; }
.counter { position: absolute; right: 12px; bottom: 10px; font-size: 11px; color: var(--fg4); pointer-events: none; }

/* Opções (múltipla escolha / caixas) */
.choices { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); }
.choice {
  position: relative; display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 13px 16px; min-height: 54px; border-radius: 14px;
  background: rgba(8, 6, 15, 0.45); border: 1px solid var(--line-2); color: var(--fg);
  transition: border-color 0.2s, background 0.25s, transform 0.2s var(--ease), box-shadow 0.25s;
}
.choice:hover { border-color: rgba(167, 139, 250, 0.6); background: rgba(124, 58, 237, 0.08); transform: translateY(-1px); }
.choice:focus-visible { outline: none; box-shadow: 0 0 0 4px rgba(167, 139, 250, 0.25); border-color: var(--lilac); }
.choice:active { transform: scale(0.985); }
.choice .key {
  flex: none; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px;
  font-size: 12px; font-weight: 700; color: var(--lilac); border: 1px solid rgba(167, 139, 250, 0.4); background: rgba(167, 139, 250, 0.06);
  transition: all 0.25s var(--ease);
}
.choice.multi .key { border-radius: 7px; }
.choice .label { flex: 1; font-size: 15px; font-weight: 500; line-height: 1.35; }
.choice .mark { flex: none; width: 20px; height: 20px; color: #fff; opacity: 0; transform: scale(0.4) rotate(-20deg); transition: all 0.35s var(--spring); }
.choice.selected {
  border-color: var(--lilac); background: linear-gradient(135deg, rgba(124, 58, 237, 0.26), rgba(107, 33, 168, 0.18));
  box-shadow: 0 10px 30px -12px rgba(124, 58, 237, 0.7), inset 0 0 0 1px rgba(167, 139, 250, 0.35);
}
.choice.selected .key { background: var(--grad); border-color: transparent; color: #fff; box-shadow: 0 4px 14px -4px rgba(124, 58, 237, 0.9); }
.choice.selected .mark { opacity: 1; transform: none; }
.choice.pulse { animation: pulse 0.4s var(--spring); }
@keyframes pulse { 50% { transform: scale(1.025); } }
.other-input { margin-top: 10px; animation: rise 0.35s var(--ease) both; }

/* Sim / Não */
.yesno { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.yesno .choice { flex-direction: column; justify-content: center; padding: 22px 12px; gap: 10px; text-align: center; min-height: 118px; }
.yesno .choice svg.big { width: 30px; height: 30px; color: var(--lilac); transition: transform 0.35s var(--spring), color 0.2s; }
.yesno .choice.selected svg.big { color: #fff; transform: scale(1.12) rotate(-6deg); }
.yesno .choice .key { position: absolute; top: 10px; left: 10px; width: 22px; height: 22px; font-size: 11px; }
.yesno .choice .mark { position: absolute; top: 10px; right: 10px; }

/* Estrelas */
.stars { display: flex; gap: 6px; flex-wrap: wrap; }
.star {
  width: 52px; height: 52px; display: grid; place-items: center; border-radius: 14px; border: 1px solid transparent; background: transparent;
  color: rgba(167, 139, 250, 0.35); transition: transform 0.3s var(--spring), color 0.2s;
}
.star svg { width: 36px; height: 36px; transition: fill 0.2s, filter 0.3s; }
.star.on { color: #fbbf24; }
.star.on svg { fill: #fbbf24; filter: drop-shadow(0 0 10px rgba(251, 191, 36, 0.55)); }
.star.hover { color: #fcd34d; transform: scale(1.12); }
.star.hover svg { fill: rgba(252, 211, 77, 0.35); }
.star.pop { animation: starPop 0.45s var(--spring); }
@keyframes starPop { 40% { transform: scale(1.35) rotate(-8deg); } }
.star:focus-visible { outline: none; border-color: var(--lilac); }

/* Escala */
.scale { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 6px; }
.scale button {
  height: 52px; border-radius: 12px; border: 1px solid var(--line-2); background: rgba(8, 6, 15, 0.45);
  font-size: 15px; font-weight: 600; color: var(--fg2); transition: all 0.25s var(--ease); padding: 0;
}
.scale button:hover { border-color: var(--lilac); color: #fff; transform: translateY(-2px); }
.scale button.selected { background: var(--grad); border-color: transparent; color: #fff; transform: translateY(-2px) scale(1.06); box-shadow: 0 10px 24px -8px rgba(124, 58, 237, 0.9); }
.scale-labels { display: flex; justify-content: space-between; gap: 16px; margin-top: 10px; font-size: 12.5px; color: var(--fg3); }

/* Upload */
.drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center;
  padding: 30px 20px; border-radius: 16px; border: 1.5px dashed rgba(167, 139, 250, 0.4); background: rgba(8, 6, 15, 0.4);
  color: var(--fg3); cursor: pointer; transition: all 0.25s var(--ease);
}
.drop:hover, .drop.over { border-color: var(--lilac); background: rgba(124, 58, 237, 0.1); color: #fff; }
.drop.over { transform: scale(1.01); box-shadow: 0 0 0 6px rgba(167, 139, 250, 0.1); }
.drop .ic { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: rgba(167, 139, 250, 0.12); color: var(--lilac); }
.drop .ic svg { width: 22px; height: 22px; }
.drop strong { color: #fff; font-weight: 600; font-size: 15px; }
.drop small { font-size: 12.5px; }
.files { display: grid; gap: 8px; margin-top: 10px; }
.file-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line);
  background: rgba(8, 6, 15, 0.5); font-size: 14px; animation: rise 0.35s var(--ease) both; position: relative; overflow: hidden;
}
.file-item .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-item .size { color: var(--fg4); font-size: 12px; }
.file-item .bar { position: absolute; left: 0; bottom: 0; height: 2px; background: var(--lilac); transition: width 0.2s; }
.file-item button { background: none; border: 0; color: var(--fg3); padding: 4px; border-radius: 8px; display: grid; }
.file-item button:hover { color: var(--err); background: rgba(253, 164, 175, 0.1); }

/* ---------- navegação ---------- */
.actions { display: flex; align-items: center; gap: 12px; margin-top: 36px; }
.actions .btn.next { min-width: 150px; padding: 16px 28px; }
.actions .back { width: 52px; height: 52px; padding: 0; border-radius: 50%; }
.actions .back svg { width: 20px; height: 20px; }
.hint { font-size: 12.5px; color: var(--fg4); display: inline-flex; align-items: center; gap: 6px; }
.hint kbd {
  font: 600 11px 'Poppins', sans-serif; padding: 3px 7px; border-radius: 6px; color: var(--fg2);
  border: 1px solid var(--line-2); background: rgba(167, 139, 250, 0.08);
}
.btn .spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.35); border-top-color: #fff; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.form-error { margin-top: 16px; color: var(--err); font-size: 14px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.powered { text-align: center; margin-top: 28px; font-size: 12px; color: var(--fg4); }
.powered a { color: var(--fg3); text-decoration: none; }

/* ---------- sucesso ---------- */
.success { text-align: center; padding: 20px 0 8px; }
.success .check { width: 96px; height: 96px; margin: 0 auto 24px; position: relative; }
.success .check::before {
  content: ''; position: absolute; inset: -18px; border-radius: 50%;
  background: radial-gradient(circle, rgba(124, 58, 237, 0.45), transparent 65%); animation: glowIn 1.2s var(--ease) both;
}
.success .check svg { position: relative; width: 100%; height: 100%; }
.success .check circle { stroke-dasharray: 290; stroke-dashoffset: 290; animation: draw 0.9s var(--ease) 0.1s forwards; }
.success .check path { stroke-dasharray: 60; stroke-dashoffset: 60; animation: draw 0.5s var(--ease) 0.75s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes glowIn { from { opacity: 0; transform: scale(0.5); } }
.success h1 { font-size: clamp(26px, 4.4vw, 34px); font-weight: 800; letter-spacing: -0.03em; line-height: 1.15; margin: 0 0 12px; }
.success p { color: var(--fg3); margin: 0 auto; max-width: 440px; white-space: pre-line; }
.success .redirect { margin-top: 22px; font-size: 13px; color: var(--fg4); }

.confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 40; }

/* ---------- mobile ---------- */
@media (max-width: 640px) {
  .topbar-inner { padding: 14px 20px; }
  .logo { width: 108px; }
  .stage { place-items: start center; padding: 76px 0 0; }
  .panel { padding: 12px 20px 0; min-height: calc(100dvh - 76px); display: flex; flex-direction: column; }
  .page { flex: 1; display: flex; flex-direction: column; }
  .page-body { flex: 1; }
  .page-head h1 { margin-top: 14px; }
  .q { margin-top: 26px; }
  .actions {
    position: sticky; bottom: 0; z-index: 5; margin: 28px -20px 0; padding: 16px 20px calc(16px + env(safe-area-inset-bottom));
    background: linear-gradient(to top, var(--bg) 62%, rgba(8, 6, 15, 0));
  }
  /* texto longo no botão quebra linha em vez de alargar a página (o .btn é nowrap) */
  .actions .btn.next { flex: 1; min-width: 0; white-space: normal; line-height: 1.25; text-align: center; }
  .hint { display: none; }
  .choices { grid-template-columns: 1fr; }
  .scale { gap: 4px; }
  .scale button { height: 46px; font-size: 14px; border-radius: 10px; }
  .star { width: 46px; height: 46px; }
  .star svg { width: 32px; height: 32px; }
  .powered { margin: 8px 0 12px; }
  .success { padding-top: 12vh; }
}
@media (max-width: 380px) {
  .scale button { height: 42px; font-size: 13px; border-radius: 8px; }
}

/* Perguntas condicionais: somem e reaparecem com a resposta */
.q[hidden] { display: none !important; }
.q.reveal { animation: reveal 0.55s var(--ease) both; }
@keyframes reveal { from { opacity: 0; transform: translateY(-8px); filter: blur(4px); } }

/* ---------- banner (largura total, proporção 3:1 exata = imagem inteira) ---------- */
/* O grid 1fr -> 0fr anima o recolhimento sem precisar saber a altura. */
/* Começa logo abaixo da barra do topo: nenhuma parte da imagem fica escondida atrás do logo. */
.hero-wrap { position: relative; z-index: 1; margin-top: var(--topbar-h, 60px); display: grid; grid-template-rows: 1fr; transition: grid-template-rows 0.75s var(--ease), opacity 0.6s var(--ease); }
.hero { min-height: 0; overflow: hidden; }
.hero-inner {
  position: relative; aspect-ratio: 3 / 1; width: 100%;
  background: linear-gradient(120deg, rgba(107, 33, 168, 0.45), rgba(167, 139, 250, 0.15));
  /* dissolve só a borda de baixo no fundo da página (sem faixa escura nem emenda) */
  -webkit-mask-image: linear-gradient(to bottom, #000 86%, transparent);
          mask-image: linear-gradient(to bottom, #000 86%, transparent);
}
.hero img {
  width: 100%; height: 100%; object-fit: cover; object-position: center var(--pos, center); display: block;
  opacity: 0; transform: scale(1.06); transition: opacity 1s var(--ease), transform 1.8s var(--ease);
}
.hero.loaded img { opacity: 1; transform: scale(1); }
body.banner-collapsed .hero-wrap { grid-template-rows: 0fr; opacity: 0; }

body.has-banner .stage { min-height: 0; place-items: start center; padding-top: 32px; transition: padding-top 0.75s var(--ease); }
body.has-banner.banner-collapsed .stage { padding-top: 96px; }
body.has-banner .topbar { background: rgba(8, 6, 15, 0.82); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }

@media (max-width: 640px) {
  body.has-banner .stage { padding-top: 4px; }
  body.has-banner.banner-collapsed .stage { padding-top: 76px; }
  body.has-banner .panel { min-height: 0; }
  body.has-banner.banner-collapsed .panel { min-height: calc(100dvh - 76px); }
}

/* ---------- incorporado em outro site (/embed.js) ---------- */
/* A moldura (cantos, sombra) é do site; aqui só compacta o topo e as margens para caber na janela menor. */
body.embed .topbar-inner { padding: 14px 20px; }
body.embed .logo { width: 104px; }
body.embed .stage { padding: 78px 20px 32px; }
body.embed.has-banner .stage { padding-top: 24px; }
body.embed.has-banner.banner-collapsed .stage { padding-top: 78px; }
body.embed .orb { filter: blur(60px); }
/* espaço para o botão de fechar, que fica sobre o canto direito do topo */
body.embed-popup .topbar-inner, body.embed-drawer .topbar-inner, body.embed-bubble .topbar-inner { padding-right: 60px; }
@media (max-width: 640px) {
  body.embed .stage { padding: 68px 0 0; }
  body.embed .panel { min-height: calc(100dvh - 68px); }
  body.embed.has-banner .stage { padding-top: 4px; }
  body.embed.has-banner.banner-collapsed .stage { padding-top: 68px; }
  body.embed.has-banner .panel { min-height: 0; }
  body.embed.has-banner.banner-collapsed .panel { min-height: calc(100dvh - 68px); }
}

/* ---------- consentimento LGPD (última etapa, quando a Meta está ativa) ---------- */
.consent {
  display: flex; align-items: flex-start; gap: 12px; margin-top: 28px; padding: 14px 16px; border-radius: 14px; cursor: pointer;
  border: 1px solid var(--line); background: rgba(8, 6, 15, 0.45); transition: border-color 0.2s, background 0.2s;
  -webkit-user-select: none; user-select: none;
}
.consent:hover { border-color: var(--line-2); }
.consent input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.consent .box {
  flex: none; width: 24px; height: 24px; margin-top: 1px; border-radius: 7px; display: grid; place-items: center;
  border: 1.5px solid rgba(167, 139, 250, 0.5); color: transparent; transition: all 0.25s var(--spring);
}
.consent .box svg { width: 15px; height: 15px; stroke-width: 3; transform: scale(0.4); transition: transform 0.3s var(--spring); }
.consent input:checked + .box { background: var(--grad); border-color: transparent; color: #fff; box-shadow: 0 4px 14px -4px rgba(124, 58, 237, 0.9); }
.consent input:checked + .box svg { transform: none; }
.consent input:focus-visible + .box { box-shadow: 0 0 0 4px rgba(167, 139, 250, 0.3); }
.consent:has(input:checked) { border-color: rgba(167, 139, 250, 0.45); background: rgba(124, 58, 237, 0.08); }
.consent .txt { font-size: 13.5px; line-height: 1.5; color: var(--fg2); }
.consent .opt { color: var(--fg4); }
.consent.has-error { border-color: rgba(253, 164, 175, 0.6); box-shadow: 0 0 0 4px rgba(253, 164, 175, 0.1); }
.consent.shake { animation: shake 0.45s var(--ease); }

/* ---------- botão de WhatsApp na conclusão ---------- */
.btn.wa {
  display: inline-flex; align-items: center; gap: 10px; margin-top: 26px; padding: 15px 26px; text-decoration: none;
  background: linear-gradient(135deg, #25d366, #128c4a); box-shadow: 0 14px 34px -12px rgba(37, 211, 102, 0.7);
}
@media (max-width: 640px) {
  .consent { margin-top: 22px; }
  .btn.wa { width: 100%; justify-content: center; }
}
