:root {
  --azul: #1062AC;
  --azul-escuro: #0B4A82;
  --coral: #FF6B5B;
  --violeta: #7C6FF6;
  --turquesa: #22C7B5;
  --amarelo: #FFC24B;
  --bg: #F6F7FB;
  --card: #FFFFFF;
  --texto: #1D2939;
  --texto-muted: #667085;
  --borda: #E4E7EC;
  --sombra: 0 20px 50px -20px rgba(16, 98, 172, 0.25);
  --font-titulo: 'Poppins', sans-serif;
  --font-corpo: 'Manrope', sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background: var(--bg);
  font-family: var(--font-corpo);
  color: var(--texto);
  overflow-x: hidden;
}

body {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

/* blobs decorativos */
.bg-blob {
  position: fixed;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.4;
  z-index: 0;
  pointer-events: none;
}
.blob-1 { width: 420px; height: 420px; background: var(--violeta); top: -120px; left: -140px; }
.blob-2 { width: 380px; height: 380px; background: var(--turquesa); bottom: -140px; right: -120px; }
.blob-3 { width: 300px; height: 300px; background: var(--coral); bottom: 30%; left: -160px; opacity: 0.3; }
.blob-4 { width: 260px; height: 260px; background: var(--amarelo); top: 20%; right: -120px; opacity: 0.3; }

.quiz-shell {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 620px;
  background: var(--card);
  border-radius: 28px;
  box-shadow: var(--sombra);
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: min(720px, 88vh);
}

.quiz-topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--borda);
}
.topbar-logo {
  height: 30px;
  width: auto;
  border-radius: 6px;
  flex-shrink: 0;
}
.progress-track {
  flex: 1;
  height: 8px;
  border-radius: 99px;
  background: #EEF1F6;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--violeta), var(--azul), var(--turquesa));
  transition: width .4s ease;
}
.topbar-step {
  font-size: 12px;
  font-weight: 600;
  color: var(--texto-muted);
  white-space: nowrap;
}

#mapaForm {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.honeypot {
  position: absolute;
  left: -9999px;
  opacity: 0;
  height: 0;
  width: 0;
}

.steps-viewport {
  position: relative;
  flex: 1;
  overflow-y: auto;
  padding: 32px 26px 20px;
}

.step {
  display: none;
  animation: entra .35s ease;
}
.step.is-active { display: block; }

@keyframes entra {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

.step-eyebrow {
  font-family: var(--font-titulo);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--violeta);
  margin: 0 0 8px;
}

/* icone tematico + borrao de tinta por assunto */
.step { position: relative; }
.step-icon {
  position: relative;
  z-index: 1;
  width: 60px;
  height: 60px;
  border-radius: 46% 54% 55% 45% / 50% 45% 55% 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}
.step-icon svg {
  width: 28px;
  height: 28px;
  stroke: #fff;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.step-icon::before {
  content: '';
  position: absolute;
  inset: -22px;
  border-radius: 44% 56% 60% 40% / 55% 40% 60% 45%;
  filter: blur(20px);
  opacity: .5;
  z-index: -1;
}
.step-icon::after {
  content: '';
  position: absolute;
  inset: -46px -60px auto auto;
  top: -30px;
  right: -50px;
  width: 90px;
  height: 90px;
  border-radius: 40% 60% 55% 45% / 60% 45% 55% 40%;
  filter: blur(34px);
  opacity: .22;
  z-index: -2;
}

.tema-azul .step-icon { background: linear-gradient(135deg, var(--azul), var(--turquesa)); }
.tema-azul .step-icon::before, .tema-azul .step-icon::after { background: var(--azul); }

.tema-turquesa .step-icon { background: linear-gradient(135deg, var(--turquesa), var(--azul)); }
.tema-turquesa .step-icon::before, .tema-turquesa .step-icon::after { background: var(--turquesa); }

.tema-coral .step-icon { background: linear-gradient(135deg, var(--coral), var(--amarelo)); }
.tema-coral .step-icon::before, .tema-coral .step-icon::after { background: var(--coral); }

.tema-violeta .step-icon { background: linear-gradient(135deg, var(--violeta), var(--coral)); }
.tema-violeta .step-icon::before, .tema-violeta .step-icon::after { background: var(--violeta); }

.tema-amarelo .step-icon { background: linear-gradient(135deg, var(--amarelo), var(--coral)); }
.tema-amarelo .step-icon::before, .tema-amarelo .step-icon::after { background: var(--amarelo); }

.step h2 {
  font-family: var(--font-titulo);
  font-size: 24px;
  line-height: 1.3;
  margin: 0 0 18px;
  color: var(--texto);
}

.step-help {
  font-size: 14px;
  color: var(--texto-muted);
  margin: -10px 0 16px;
}

/* intro */
.step-intro { text-align: center; padding-top: 10px; }
.logo-grande-wrap {
  position: relative;
  width: 108px;
  height: 108px;
  margin: 0 auto 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.logo-grande-wrap::before {
  content: '';
  position: absolute;
  inset: -20px;
  border-radius: 42% 58% 60% 40% / 55% 42% 58% 45%;
  background: linear-gradient(135deg, var(--violeta), var(--turquesa), var(--coral));
  filter: blur(26px);
  opacity: .45;
  z-index: 0;
}
.logo-grande {
  position: relative;
  z-index: 1;
  width: 92px;
  height: 92px;
  object-fit: cover;
  border-radius: 26px;
  box-shadow: 0 14px 30px -12px rgba(16, 98, 172, 0.45);
  background: #fff;
}
.intro-badge {
  display: inline-block;
  font-family: var(--font-titulo);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #fff;
  background: linear-gradient(90deg, var(--coral), var(--violeta));
  padding: 7px 16px;
  border-radius: 99px;
  margin-bottom: 22px;
}
.step-intro h1 {
  font-family: var(--font-titulo);
  font-size: 28px;
  line-height: 1.35;
  margin: 0 0 16px;
}
.intro-text {
  font-size: 15.5px;
  line-height: 1.6;
  color: var(--texto-muted);
  max-width: 460px;
  margin: 0 auto 14px;
}
.intro-meta {
  font-size: 13.5px;
  color: var(--turquesa);
  font-weight: 600;
  margin: 0 0 26px;
}
.btn-start { margin: 0 auto; }

/* campos */
.field { margin-bottom: 18px; }
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
label {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--texto);
}
label .opt { font-weight: 400; color: var(--texto-muted); }

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="date"],
select,
textarea {
  width: 100%;
  font-family: var(--font-corpo);
  font-size: 15px;
  padding: 12px 14px;
  border: 1.5px solid var(--borda);
  border-radius: 12px;
  background: #FCFDFF;
  color: var(--texto);
  transition: border-color .2s, box-shadow .2s;
}
textarea { resize: vertical; min-height: 90px; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--azul);
  box-shadow: 0 0 0 4px rgba(16, 98, 172, 0.12);
}

/* chips */
.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-bottom: 10px;
}
.chip {
  font-family: var(--font-corpo);
  font-size: 14px;
  font-weight: 600;
  padding: 9px 16px;
  border-radius: 99px;
  border: 1.5px solid var(--borda);
  background: #fff;
  color: var(--texto);
  cursor: pointer;
  transition: all .15s ease;
}
.chip:hover { border-color: var(--azul); }
.chip.is-selected {
  background: linear-gradient(90deg, var(--azul), var(--turquesa));
  border-color: transparent;
  color: #fff;
  transform: scale(1.03);
}
.chip-add {
  display: inline-block;
  background: none;
  border: none;
  color: var(--violeta);
  font-weight: 700;
  font-size: 13.5px;
  cursor: pointer;
  padding: 4px 0;
}

/* trilhas */
.trilha-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}
.trilha-card {
  text-align: left;
  border: 1.5px solid var(--borda);
  background: #FCFDFF;
  border-radius: 16px;
  padding: 14px 14px;
  cursor: pointer;
  transition: all .15s ease;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.trilha-card:hover { border-color: var(--azul); }
.trilha-card.is-selected {
  background: linear-gradient(135deg, var(--violeta), var(--azul));
  border-color: transparent;
}
.trilha-card.is-selected .trilha-nome,
.trilha-card.is-selected .trilha-desc { color: #fff; }
.trilha-nome {
  font-family: var(--font-titulo);
  font-weight: 700;
  font-size: 15px;
}
.trilha-desc {
  font-size: 12.5px;
  color: var(--texto-muted);
  line-height: 1.4;
}
.trilha-limite {
  font-size: 13px;
  color: var(--coral);
  font-weight: 600;
  min-height: 18px;
  margin: 4px 0 0;
}

/* lgpd */
.lgpd-texto {
  font-size: 14px;
  line-height: 1.6;
  color: var(--texto-muted);
  background: #F6F7FB;
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 18px;
}
.lgpd-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 22px;
}
.lgpd-check input { margin-top: 3px; width: 18px; height: 18px; flex-shrink: 0; }
.erro-envio {
  color: var(--coral);
  font-size: 13.5px;
  font-weight: 600;
  min-height: 18px;
  margin-top: 10px;
}

/* final */
.step-final { text-align: center; padding-top: 30px; }
.final-emoji { font-size: 46px; margin-bottom: 14px; }
.step-final h1 {
  font-family: var(--font-titulo);
  font-size: 26px;
  margin: 0 0 14px;
}

/* nav */
.quiz-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 26px 22px;
  border-top: 1px solid var(--borda);
}

.btn {
  font-family: var(--font-titulo);
  font-weight: 600;
  font-size: 15px;
  padding: 13px 24px;
  border-radius: 14px;
  border: none;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.btn:active { transform: scale(0.97); }
.btn-primary {
  background: linear-gradient(90deg, var(--azul), var(--turquesa));
  color: #fff;
  box-shadow: 0 10px 24px -10px rgba(16, 98, 172, 0.55);
}
.btn-primary:hover { box-shadow: 0 14px 28px -10px rgba(16, 98, 172, 0.65); }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }
.btn-ghost {
  background: none;
  color: var(--texto-muted);
  padding: 13px 10px;
}
.btn-ghost:hover { color: var(--texto); }
.arrow { transition: transform .15s ease; }
.btn:hover .arrow { transform: translateX(3px); }

.quiz-nav.nav-hidden { display: none; }
.quiz-nav .btn-voltar-invisivel { visibility: hidden; }

@media (max-width: 520px) {
  body { padding: 0; align-items: stretch; }
  .quiz-shell { max-width: 100%; min-height: 100vh; border-radius: 0; }
  .field-row { grid-template-columns: 1fr; gap: 0; }
  .trilha-grid { grid-template-columns: 1fr; }
  .step h2 { font-size: 21px; }
  .step-intro h1 { font-size: 24px; }
}
