/* =========================================================================
   SparkNews — Quiz "Diagnóstico de Exposição Patrimonial"
   Usa as variáveis de cor do tema (claro/escuro). Fallbacks para o caso de
   o quiz rodar sem o tema SparkNews.
   ========================================================================= */
.snq {
  --q-brand: var(--sn-brand, #00A878);
  --q-brand-hover: var(--sn-brand-hover, #008F66);
  --q-brand-soft: var(--sn-brand-soft, #E6F7F2);
  --q-ink: var(--sn-ink, #111827);
  --q-ink-2: var(--sn-ink-2, #64748B);
  --q-surface: var(--sn-surface, #fff);
  --q-surface-2: var(--sn-surface-2, #F8FAFC);
  --q-line: var(--sn-line, #E2E8F0);
  --q-line-strong: var(--sn-line-strong, #CBD5E1);
  --q-amber-ink: var(--sn-amber-ink, #B45309);
  --q-red: var(--sn-red, #DC2626);
  max-width: 760px;
  margin: 0 auto;
  font-family: Inter, system-ui, sans-serif;
  color: var(--q-ink);
}
.snq *, .snq *::before, .snq *::after { box-sizing: border-box; }
.snq-card {
  position: relative;
  background: var(--q-surface);
  border: 1px solid var(--q-line);
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(17, 24, 39, .04);
  overflow: hidden;
}

/* Cabeçalho + progresso */
.snq-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 28px 0; }
.snq-kicker, .snq-step, .snq-label {
  font: 700 11px/1.3 "IBM Plex Mono", ui-monospace, monospace;
  letter-spacing: .08em; text-transform: uppercase;
}
.snq-kicker { color: var(--q-brand); }
.snq-step { color: var(--q-ink-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.snq-bar { height: 4px; margin: 14px 28px 0; border-radius: 99px; background: var(--q-line); overflow: hidden; }
.snq-bar > i { display: block; height: 100%; width: 0; background: var(--q-brand); border-radius: 99px; transition: width .5s cubic-bezier(.2, .8, .2, 1); }

/* Corpo das etapas */
.snq-body { padding: 26px 28px 30px; min-height: 380px; display: flex; flex-direction: column; }
.snq-screen { display: flex; flex-direction: column; gap: 16px; animation: snq-in .38s cubic-bezier(.2, .8, .2, 1) both; }
.snq-screen.is-back { animation-name: snq-in-back; }
@keyframes snq-in { from { opacity: 0; transform: translateX(18px); } to { opacity: 1; transform: none; } }
@keyframes snq-in-back { from { opacity: 0; transform: translateX(-18px); } to { opacity: 1; transform: none; } }
.snq-label { color: var(--q-brand); }
.snq-title { font: 700 28px/1.2 "Space Grotesk", system-ui, sans-serif; letter-spacing: -.02em; margin: 0; color: var(--q-ink); }
.snq-title--sm { font-size: 22px; }
.snq-title:focus, .snq-title:focus-visible { outline: none; }
.snq-lead { font: 600 17px/1.45 "Space Grotesk", system-ui, sans-serif; margin: 0; color: var(--q-ink); }
.snq-text { font-size: 15px; line-height: 1.6; color: var(--q-ink-2); margin: 0; }
.snq-note {
  display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--q-ink-2);
  background: var(--q-surface-2); border: 1px solid var(--q-line); border-radius: 6px; padding: 10px 12px;
}
.snq-note svg { flex-shrink: 0; color: var(--q-brand); }

/* Opções */
.snq-options { display: flex; flex-direction: column; gap: 10px; margin: 4px 0 0; padding: 0; list-style: none; }
.snq-opt {
  width: 100%; display: flex; align-items: center; gap: 14px; text-align: left; cursor: pointer;
  background: var(--q-surface-2); border: 1px solid var(--q-line); border-radius: 8px; padding: 14px 16px;
  font: 500 15px/1.4 Inter, system-ui, sans-serif; color: var(--q-ink);
  transition: border-color .15s ease, background-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.snq-opt:hover { border-color: var(--q-brand); background: var(--q-surface); transform: translateY(-1px); box-shadow: 0 4px 14px -6px rgba(17, 24, 39, .12); }
.snq-opt:focus-visible { outline: 2px solid var(--q-brand); outline-offset: 2px; }
.snq-key {
  flex-shrink: 0; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 6px;
  border: 1px solid var(--q-line-strong); background: var(--q-surface);
  font: 700 12px/1 "IBM Plex Mono", monospace; color: var(--q-ink-2); transition: all .15s ease;
}
.snq-opt-text { flex: 1; }
.snq-check { flex-shrink: 0; opacity: 0; transform: scale(.6); color: var(--q-brand); transition: all .2s ease; }
.snq-opt[aria-checked="true"] { border-color: var(--q-brand); background: var(--q-brand-soft); }
.snq-opt[aria-checked="true"] .snq-key { background: var(--q-brand); border-color: var(--q-brand); color: #fff; }
.snq-opt[aria-checked="true"] .snq-check { opacity: 1; transform: none; }
.snq-opt.is-picked { animation: snq-pick .35s ease; }
@keyframes snq-pick { 40% { transform: scale(.985); } }

/* Navegação */
.snq-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: auto; padding-top: 22px; }
.snq-back {
  background: none; border: 0; padding: 6px 0; cursor: pointer; color: var(--q-ink-2);
  font: 600 13px/1 "IBM Plex Mono", monospace; display: inline-flex; align-items: center; gap: 6px;
}
.snq-back:hover { color: var(--q-ink); }
.snq-hint { font: 500 11px/1.4 "IBM Plex Mono", monospace; color: var(--q-ink-2); }
.snq-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; text-decoration: none;
  background: var(--q-brand); color: #fff; border: 0; border-radius: 6px; padding: 14px 22px;
  font: 700 14px/1 "Space Grotesk", system-ui, sans-serif; letter-spacing: .04em; text-transform: uppercase;
  transition: background-color .15s ease, transform .15s ease;
}
.snq-btn:hover { background: var(--q-brand-hover); color: #fff; }
.snq-btn:active { transform: translateY(1px); }
.snq-btn[disabled] { opacity: .65; cursor: progress; }
.snq-btn--block { width: 100%; }
.snq-btn--ghost { background: transparent; color: var(--q-ink); border: 1px solid var(--q-line-strong); }
.snq-btn--ghost:hover { background: var(--q-surface-2); color: var(--q-ink); }

/* Processamento */
.snq-checks { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.snq-checks li { display: flex; align-items: center; gap: 12px; font-size: 15px; color: var(--q-ink-2); transition: color .25s ease; }
.snq-checks .snq-dot {
  width: 24px; height: 24px; border-radius: 99px; display: grid; place-items: center; flex-shrink: 0;
  border: 2px solid var(--q-line-strong); color: transparent; transition: all .3s ease;
}
.snq-checks li.is-done { color: var(--q-ink); font-weight: 600; }
.snq-checks li.is-done .snq-dot { background: var(--q-brand); border-color: var(--q-brand); color: #fff; }
.snq-checks li.is-active .snq-dot { border-color: var(--q-brand); border-top-color: transparent; animation: snq-spin .8s linear infinite; }
@keyframes snq-spin { to { transform: rotate(360deg); } }
.snq-loading { position: relative; overflow: hidden; }
.snq-loading::after {
  content: ""; position: absolute; left: 0; bottom: 0; height: 2px; width: 40%; background: var(--q-brand);
  animation: snq-slide 1.2s ease-in-out infinite;
}
@keyframes snq-slide { from { transform: translateX(-100%); } to { transform: translateX(260%); } }

/* Formulário de contato */
.snq-field { display: flex; flex-direction: column; gap: 6px; }
.snq-field label { font: 700 16px/1.3 "Space Grotesk", system-ui, sans-serif; color: var(--q-ink); }
.snq-field small { font-size: 13px; line-height: 1.5; color: var(--q-ink-2); }
.snq-input {
  width: 100%; background: var(--q-surface-2); color: var(--q-ink); border: 1px solid var(--q-line); border-radius: 6px;
  padding: 13px 14px; font: 500 16px/1.2 Inter, system-ui, sans-serif; transition: border-color .15s ease, box-shadow .15s ease;
}
.snq-input:focus { outline: none; border-color: var(--q-brand); box-shadow: 0 0 0 3px rgba(0, 168, 120, .15); }
.snq-input[aria-invalid="true"] { border-color: var(--q-red); }
.snq-consent { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; line-height: 1.5; color: var(--q-ink-2); cursor: pointer; }
.snq-consent input { margin-top: 2px; width: 16px; height: 16px; accent-color: var(--q-brand); flex-shrink: 0; }
.snq-consent a { color: var(--q-brand); }
.snq-error { color: var(--q-red); font-size: 14px; font-weight: 600; margin: 0; }
.snq-center { text-align: center; }

/* Final */
.snq-res-profile { align-self: flex-start; display: inline-flex; background: var(--q-brand-soft); color: var(--q-brand-hover); font: 700 11px/1 "IBM Plex Mono", monospace; letter-spacing: .08em; text-transform: uppercase; padding: 8px 10px; border-radius: 4px; }
.snq-res-k { margin: 0 0 4px; font: 700 11px/1.4 "IBM Plex Mono", monospace; letter-spacing: .1em; text-transform: uppercase; color: var(--q-ink-2); }
.snq-res-block .snq-text { margin: 0; }
.snq-res-rec { background: var(--q-surface-2); border: 1px solid var(--q-line); border-left: 3px solid var(--q-brand); border-radius: 6px; padding: 16px 18px; }
.snq-res-rec .snq-res-k { color: var(--q-brand-hover); }
.snq-res-rec p:last-child { margin: 0; font-size: 16px; line-height: 1.65; color: var(--q-ink); }
.snq-res-next { border: 1px solid var(--q-line); border-radius: 6px; padding: 14px 18px; }
.snq-res-next p:last-child { margin: 0; display: flex; gap: 8px; align-items: flex-start; font: 600 16px/1.5 "Space Grotesk", system-ui, sans-serif; color: var(--q-ink); }
.snq-res-next svg { flex-shrink: 0; margin-top: 4px; color: var(--q-brand); }
.snq-success { width: 64px; height: 64px; border-radius: 99px; background: var(--q-brand-soft); display: grid; place-items: center; color: var(--q-brand); }
.snq-success path { stroke-dasharray: 30; stroke-dashoffset: 30; animation: snq-draw .55s .15s ease forwards; }
@keyframes snq-draw { to { stroke-dashoffset: 0; } }
.snq-summary { display: grid; grid-template-columns: 1fr; gap: 0; border: 1px solid var(--q-line); border-radius: 8px; overflow: hidden; }
.snq-summary div { display: flex; flex-direction: column; gap: 2px; padding: 11px 14px; background: var(--q-surface-2); }
.snq-summary div + div { border-top: 1px solid var(--q-line); }
.snq-summary span { font: 700 10px/1.3 "IBM Plex Mono", monospace; letter-spacing: .08em; text-transform: uppercase; color: var(--q-ink-2); }
.snq-summary strong { font-size: 14px; font-weight: 600; color: var(--q-ink); }
.snq-badge {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 6px;
  background: var(--q-surface-2); border: 1px solid var(--q-line);
  font: 700 11px/1.3 "IBM Plex Mono", monospace; letter-spacing: .08em; text-transform: uppercase; color: var(--q-ink);
}
.snq-badge i { width: 8px; height: 8px; border-radius: 99px; background: var(--q-brand); animation: snq-pulse 1.8s ease infinite; }
@keyframes snq-pulse { 50% { opacity: .35; } }
.snq-disclaimer { font-size: 12px; line-height: 1.6; color: var(--q-ink-2); margin: 0; }
.snq-legal { font: 700 10px/1.5 "IBM Plex Mono", monospace; letter-spacing: .06em; text-transform: uppercase; color: var(--q-amber-ink); margin: 0; }
.snq-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.snq-prev { border-left: 3px solid var(--q-brand); }

/* Skeleton inicial */
.snq-skel { padding: 28px; display: flex; flex-direction: column; gap: 14px; }
.snq-skel span { display: block; height: 18px; border-radius: 4px; background: var(--q-line); animation: snq-pulse 1.4s ease infinite; }
.snq-skel span:nth-child(1) { width: 40%; }
.snq-skel span:nth-child(2) { height: 32px; width: 90%; }
.snq-skel span:nth-child(3) { height: 60px; }
.snq-noscript { padding: 20px; text-align: center; color: var(--q-ink-2); }

@media (max-width: 600px) {
  .snq-head { padding: 16px 18px 0; }
  .snq-bar { margin: 12px 18px 0; }
  .snq-body { padding: 22px 18px 24px; min-height: 0; }
  .snq-title { font-size: 23px; }
  .snq-title--sm { font-size: 20px; }
  .snq-opt { padding: 13px 13px; font-size: 15px; }
  .snq-hint { display: none; }
  .snq-actions .snq-btn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .snq *, .snq *::before, .snq *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
