/* =========================================================================
   SparkNews — popup de captação (antes do Diagnóstico)
   Cores e fontes do tema (claro/escuro), com fallback se o tema mudar.
   ========================================================================= */
.snl {
  --l-brand: var(--sn-brand, #00A878);
  --l-brand-hover: var(--sn-brand-hover, #008F66);
  --l-brand-soft: var(--sn-brand-soft, #E6F7F2);
  --l-ink: var(--sn-ink, #111827);
  --l-ink-2: var(--sn-ink-2, #64748B);
  --l-surface: var(--sn-surface, #fff);
  --l-surface-2: var(--sn-surface-2, #F8FAFC);
  --l-line: var(--sn-line, #E2E8F0);
  --l-line-strong: var(--sn-line-strong, #CBD5E1);
  --l-red: var(--sn-red, #DC2626);
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center; padding: 16px;
  font-family: Inter, system-ui, sans-serif; color: var(--l-ink);
}
.snl[hidden] { display: none !important; }
.snl *, .snl *::before, .snl *::after { box-sizing: border-box; }
html.snl-lock, html.snl-lock body { overflow: hidden; }

.snl-backdrop {
  position: absolute; inset: 0; background: rgba(8, 15, 24, .62);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  opacity: 0; transition: opacity .2s ease;
}
.snl-dialog {
  position: relative; width: 100%; max-width: 580px; max-height: calc(100dvh - 32px); overflow: auto;
  background: var(--l-surface); border: 1px solid var(--l-line); border-radius: 12px;
  box-shadow: 0 24px 60px -12px rgba(8, 15, 24, .45);
  opacity: 0; transform: translateY(14px) scale(.98); transition: opacity .22s ease, transform .22s cubic-bezier(.2, .8, .2, 1);
}
.snl.is-open .snl-backdrop { opacity: 1; }
.snl.is-open .snl-dialog { opacity: 1; transform: none; }
.snl-dialog.is-shake { animation: snl-shake .32s ease; }
@keyframes snl-shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }

/* Cabeçalho + progresso */
.snl-head { display: flex; align-items: center; gap: 12px; padding: 16px 16px 0 24px; }
.snl-kicker, .snl-step {
  font: 700 11px/1.3 "IBM Plex Mono", ui-monospace, monospace; letter-spacing: .08em; text-transform: uppercase;
}
.snl-kicker { color: var(--l-brand); flex: 1; min-width: 0; }
.snl-step { color: var(--l-ink-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.snl-close {
  display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 8px;
  background: transparent; color: var(--l-ink-2); cursor: pointer;
}
.snl-close:hover { background: var(--l-surface-2); color: var(--l-ink); }
.snl-bar { height: 4px; margin: 12px 24px 0; border-radius: 99px; background: var(--l-line); overflow: hidden; }
.snl-bar > i { display: block; height: 100%; width: 0; background: var(--l-brand); border-radius: 99px; transition: width .45s cubic-bezier(.2, .8, .2, 1); }

/* Corpo */
.snl-body { padding: 28px 24px 26px; min-height: 300px; display: flex; flex-direction: column; margin: 0; }
.snl-screen { display: flex; flex-direction: column; gap: 14px; animation: snl-in .34s cubic-bezier(.2, .8, .2, 1) both; }
.snl-screen.is-back { animation-name: snl-in-back; }
@keyframes snl-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes snl-in-back { from { opacity: 0; transform: translateY(-14px); } to { opacity: 1; transform: none; } }

.snl-intro { margin: 0 0 10px; font: 400 19px/1.45 "Space Grotesk", system-ui, sans-serif; color: var(--l-ink); }
.snl-intro strong { font-weight: 700; }
.snl-q { display: block; margin: 0; font: 700 22px/1.3 "Space Grotesk", system-ui, sans-serif; letter-spacing: -.01em; color: var(--l-ink); }
.snl-q > span { color: var(--l-brand); }
.snl-text { margin: 0; font-size: 15px; line-height: 1.6; color: var(--l-ink-2); }
.snl-help { margin: -2px 0 0; font-size: 12.5px; line-height: 1.5; color: var(--l-ink-2); }
.snl-help--top { margin-top: -6px; font-size: 14px; }
.snl-help a { color: var(--l-brand); text-decoration: underline; text-underline-offset: 2px; }

/* Campo "sublinhado" (referência) com a cor da marca */
.snl-input {
  width: 100%; border: 0; border-bottom: 2px solid var(--l-line-strong); border-radius: 0;
  background: transparent; padding: 10px 2px; font: 400 21px/1.3 "Space Grotesk", system-ui, sans-serif; color: var(--l-ink);
  outline: none; transition: border-color .15s ease;
}
.snl-input::placeholder { color: var(--l-ink-2); opacity: .55; }
.snl-input:focus { border-bottom-color: var(--l-brand); }
.snl-input[aria-invalid="true"] { border-bottom-color: var(--l-red); }

.snl-phone { display: flex; gap: 10px; align-items: flex-end; }
.snl-ddi {
  flex: 0 0 auto; width: 104px; border: 0; border-bottom: 2px solid var(--l-line-strong); border-radius: 0;
  background: transparent; color: var(--l-ink); padding: 12px 18px 12px 2px; font: 500 16px/1.2 Inter, system-ui, sans-serif;
  appearance: none; -webkit-appearance: none; cursor: pointer; outline: none;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 9px) 52%, calc(100% - 4px) 52%; background-size: 5px 5px; background-repeat: no-repeat;
}
.snl-ddi:focus { border-bottom-color: var(--l-brand); }
.snl-ddi option { color: #111827; background: #fff; }

.snl-suggest {
  align-self: flex-start; border: 1px dashed var(--l-brand); background: var(--l-brand-soft); color: var(--l-ink);
  border-radius: 6px; padding: 6px 10px; font-size: 13px; cursor: pointer;
}
.snl-error { margin: 0; font-size: 13.5px; font-weight: 500; color: var(--l-red); }
.snl-error::before { content: "⚠ "; }

/* Botões */
.snl-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding-top: 4px; }
.snl-ok {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 6px; background: var(--l-brand); color: #fff; cursor: pointer; text-decoration: none;
  font: 700 15px/1 "Space Grotesk", system-ui, sans-serif; padding: 12px 20px; transition: background-color .15s ease, transform .1s ease;
}
.snl-ok:hover { background: var(--l-brand-hover); color: #fff; }
.snl-ok:active { transform: translateY(1px); }
.snl-ok[disabled] { opacity: .75; cursor: wait; }
.snl-hint { font: 500 11.5px/1.3 "IBM Plex Mono", ui-monospace, monospace; color: var(--l-ink-2); }
.snl-hint b { display: inline-flex; align-items: center; gap: 3px; font-weight: 700; }
.snl-back {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; margin-top: 6px;
  border: 0; background: none; color: var(--l-ink-2); font: 500 13px/1 Inter, system-ui, sans-serif; cursor: pointer; padding: 6px 0;
}
.snl-back:hover { color: var(--l-ink); }
.snl-spin { width: 14px; height: 14px; border: 2px solid rgba(255, 255, 255, .45); border-top-color: #fff; border-radius: 50%; animation: snl-rot .7s linear infinite; }
@keyframes snl-rot { to { transform: rotate(360deg); } }

/* Opções A–E (referência) */
.snl-options { display: flex; flex-direction: column; gap: 8px; max-width: 420px; }
.snl-opt {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  border: 1px solid var(--l-line); background: var(--l-surface-2); color: var(--l-ink); border-radius: 8px;
  padding: 11px 12px; font: 500 15px/1.3 Inter, system-ui, sans-serif; cursor: pointer;
  transition: border-color .15s ease, background-color .15s ease, transform .1s ease;
}
.snl-opt:hover { border-color: var(--l-brand); }
.snl-opt:active { transform: scale(.99); }
.snl-key {
  flex: 0 0 auto; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 4px;
  border: 1px solid var(--l-line-strong); background: var(--l-surface);
  font: 700 11px/1 "IBM Plex Mono", ui-monospace, monospace; color: var(--l-ink-2);
}
.snl-opt > span:nth-child(2) { flex: 1; }
.snl-tick { opacity: 0; color: var(--l-brand); transition: opacity .15s ease; display: flex; }
.snl-opt.is-on { border-color: var(--l-brand); background: var(--l-brand-soft); }
.snl-opt.is-on .snl-key { background: var(--l-brand); border-color: var(--l-brand); color: #fff; }
.snl-opt.is-on .snl-tick { opacity: 1; }

/* Final */
.snl-final { align-items: center; text-align: center; padding: 10px 0 4px; }
.snl-center { text-align: center; }
.snl-success { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: var(--l-brand-soft); color: var(--l-brand); margin-bottom: 4px; animation: snl-pop .45s cubic-bezier(.2, .9, .3, 1.4) both; }
@keyframes snl-pop { from { transform: scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }
.snl-final .snl-text { max-width: 440px; }
.snl-go { margin-top: 6px; }

/* Isca anti-robô */
.snl-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; }

/* Celular: ocupa a tela, botões grandes */
@media (max-width: 560px) {
  .snl { padding: 0; align-items: stretch; }
  .snl-dialog { max-width: none; max-height: none; height: 100%; border-radius: 0; border: 0; display: flex; flex-direction: column; }
  .snl-body { flex: 1; padding: 26px 20px 28px; }
  .snl-head { padding-left: 20px; }
  .snl-bar { margin-left: 20px; margin-right: 20px; }
  .snl-q { font-size: 21px; }
  .snl-intro { font-size: 18px; }
  .snl-input { font-size: 19px; }
  .snl-ok { width: 100%; padding: 14px 20px; }
  .snl-hint { display: none; }
  .snl-final .snl-hint { display: block; }
  .snl-options { max-width: none; }
}
@media (prefers-reduced-motion: reduce) {
  .snl-dialog, .snl-backdrop, .snl-screen, .snl-success { animation: none !important; transition: none !important; }
}

/* ---------- Entrar (bonequinho do topo) ---------- */
.snl .screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.snl-dialog.is-login { max-width: 500px; }
.snl-dialog.is-login .snl-bar, .snl-dialog.is-login .snl-step { display: none; }
.snl-login { gap: 14px; }
.snl-login .snl-text { margin-top: -6px; margin-bottom: 4px; }
.snl-pill {
  position: relative; display: flex; align-items: center; flex: 1; min-width: 0;
  background: var(--l-surface-2); border: 1px solid var(--l-line); border-radius: 999px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.snl-pill:focus-within { border-color: var(--l-brand); box-shadow: 0 0 0 3px var(--l-brand-soft); }
.snl-pill input {
  flex: 1; min-width: 0; border: 0; background: transparent; outline: none; color: var(--l-ink);
  padding: 16px 8px 16px 22px; font: 400 16px/1.2 Inter, system-ui, sans-serif;
}
.snl-pill input::placeholder { color: var(--l-ink-2); opacity: .75; }
.snl-pill-ico { display: grid; place-items: center; width: 44px; height: 44px; margin-right: 8px; color: var(--l-ink-2); flex: 0 0 auto; }
button.snl-pill-ico { border: 0; background: none; cursor: pointer; border-radius: 50%; }
button.snl-pill-ico:hover { color: var(--l-brand); }
.snl-login-row { display: flex; align-items: center; gap: 10px; }
.snl-round {
  flex: 0 0 auto; display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--l-brand); color: #fff; transition: background-color .15s ease, transform .1s ease;
}
.snl-round:hover { background: var(--l-brand-hover); }
.snl-round:active { transform: scale(.96); }
.snl-round[disabled] { opacity: .8; cursor: wait; }
.snl-or { display: flex; align-items: center; gap: 12px; margin: 6px 0 2px; color: var(--l-ink-2); font: 600 11px/1 "IBM Plex Mono", ui-monospace, monospace; letter-spacing: .1em; text-transform: uppercase; }
.snl-or::before, .snl-or::after { content: ""; flex: 1; height: 1px; background: var(--l-line); }
.snl-noacc { position: relative; display: flex; justify-content: center; padding-top: 2px; }
.snl-ghost {
  border: 1px solid var(--l-line-strong); background: var(--l-surface); color: var(--l-ink-2); border-radius: 999px; cursor: pointer;
  padding: 13px 22px; font: 500 14px/1.2 Inter, system-ui, sans-serif; transition: border-color .15s ease, color .15s ease, background-color .15s ease;
}
.snl-ghost b { color: var(--l-ink); font-weight: 700; }
.snl-ghost:hover, .snl-ghost:focus-visible { border-color: var(--l-brand); background: var(--l-brand-soft); }
.snl-ghost:hover b, .snl-ghost:focus-visible b { color: var(--l-brand); }
/* Aviso ao passar o mouse */
.snl-tip {
  position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translate(-50%, 4px); width: max-content; max-width: min(440px, 92vw);
  background: var(--l-ink); color: var(--l-surface); border-radius: 8px; padding: 9px 13px; font-size: 13px; line-height: 1.45; text-align: center;
  box-shadow: 0 10px 24px -8px rgba(8, 15, 24, .4); opacity: 0; pointer-events: none; transition: opacity .15s ease, transform .15s ease; z-index: 2;
}
.snl-tip::after { content: ""; position: absolute; top: 100%; left: 50%; margin-left: -6px; border: 6px solid transparent; border-top-color: var(--l-ink); }
.snl-noacc:hover .snl-tip, .snl-noacc:focus-within .snl-tip { opacity: 1; transform: translate(-50%, 0); }
@media (hover: none) {
  /* Celular não tem "passar o mouse": o aviso aparece como texto acima do botão. */
  .snl-noacc { flex-direction: column; align-items: center; gap: 8px; }
  .snl-tip { position: static; transform: none; opacity: 1; background: none; color: var(--l-ink-2); box-shadow: none; padding: 0; max-width: 100%; }
  .snl-tip::after { display: none; }
}
@media (max-width: 560px) {
  .snl-login .snl-ok { width: auto; }
  .snl-ghost { width: 100%; }
}
