:root {
  --fundo: #dbe2ec; --card: #fff; --texto: #1b2433; --muted: #5b6678; --borda: #c5cfdd;
  --azul: #0066ff; --azul-esc: #0050cc; --verde: #0a9d44; --vermelho: #c0392b;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Plus Jakarta Sans', 'Segoe UI', system-ui, sans-serif; background: var(--fundo); color: var(--texto); min-height: 100vh; display: flex; flex-direction: column; line-height: 1.5; }
main { flex: 1; width: 100%; max-width: 960px; margin: 0 auto; padding: 32px 16px 48px; }

/* Barra superior */
.topo { background: var(--card); border-bottom: 1px solid var(--borda); display: flex; align-items: center; justify-content: space-between; padding: 6px max(16px, calc((100% - 960px) / 2)); }
.topo-marca img { height: 64px; width: auto; display: block; }
.topo-links { display: flex; align-items: center; gap: 18px; font-weight: 600; font-size: 15px; }
.topo-links a { color: var(--texto); text-decoration: none; }
.topo-links a:hover { color: var(--azul); }
.topo-links .btn-mini { background: var(--azul); color: #fff; padding: 9px 16px; border-radius: 4px; }
.topo-links .btn-mini:hover { background: var(--azul-esc); color: #fff; }
.rodape { text-align: center; font-size: 13px; color: var(--muted); padding: 18px; }

/* Cartões e tipografia */
.card { background: var(--card); border: 1px solid var(--borda); border-radius: 6px; padding: 24px; }
.card-estreito { max-width: 440px; margin: 0 auto; }
h1 { font-size: 22px; font-weight: 800; line-height: 1.25; }
h2 { font-size: 16px; font-weight: 800; margin-bottom: 12px; }
.texto-info { font-size: 14px; color: var(--muted); }
.card-estreito h1, .etapa h1 { text-align: center; margin-bottom: 18px; }

/* Botões */
.btn { display: block; width: 100%; padding: 13px 18px; border: 1px solid transparent; border-radius: 4px; font: 700 15px inherit; font-family: inherit; text-align: center; text-decoration: none; cursor: pointer; transition: background .15s; }
.btn-azul { background: var(--azul); color: #fff; } .btn-azul:hover { background: var(--azul-esc); }
.btn-verde { background: var(--verde); color: #fff; width: auto; } .btn-verde:hover { background: #087f37; }
.btn-claro { background: var(--card); color: var(--azul); border-color: var(--azul); } .btn-claro:hover { background: #eef4ff; }
.btn-sair { background: none; color: var(--vermelho); border-color: var(--vermelho); margin-top: 8px; } .btn-sair:hover { background: #fdecea; }
.btn:disabled { opacity: .6; cursor: wait; }
.btn-link { background: none; border: none; color: var(--azul); font: 600 14px inherit; font-family: inherit; cursor: pointer; padding: 6px; }
.btn-link:disabled { color: #94a3b8; cursor: default; }
:is(.btn, .btn-link, input, a, button):focus-visible { outline: 2px solid var(--azul); outline-offset: 2px; }

/* Formulários */
.form-col { display: flex; flex-direction: column; gap: 12px; }
.form-linha { display: flex; gap: 10px; } .form-linha input { flex: 1; min-width: 0; } .form-linha .btn { width: auto; }
input { padding: 12px; border: 1px solid var(--borda); border-radius: 4px; font: 400 15px inherit; font-family: inherit; background: #fff; color: var(--texto); }
.input-codigo { text-align: center; font-size: 24px; letter-spacing: 6px; font-weight: 800; }
#auth-msg { margin-top: 14px; font-size: 14px; min-height: 20px; color: var(--vermelho); text-align: center; } #auth-msg.ok { color: var(--verde); }
.auth-links { margin-top: 12px; font-size: 14px; display: flex; flex-direction: column; gap: 6px; } .auth-links a { color: var(--azul); text-decoration: none; font-weight: 600; }

/* Home */
.hero { display: grid; grid-template-columns: 1.2fr 1fr; gap: 32px; align-items: center; padding: 24px 0; }
.hero h1 { font-size: 38px; font-weight: 800; line-height: 1.15; letter-spacing: -.5px; }
.hero-sub { margin: 16px 0 24px; color: var(--muted); font-size: 17px; max-width: 46ch; }
.hero-acoes { display: flex; gap: 12px; flex-wrap: wrap; } .hero-acoes .btn { width: auto; padding: 13px 24px; }
.passos { list-style: none; display: flex; flex-direction: column; gap: 20px; counter-reset: p; }
.passos li { display: grid; grid-template-columns: 34px 1fr; column-gap: 14px; counter-increment: p; }
.passos li::before { content: counter(p); grid-row: span 2; width: 34px; height: 34px; border-radius: 50%; background: var(--azul); color: #fff; display: grid; place-items: center; font-weight: 800; }
.passos span { color: var(--muted); font-size: 14px; }

/* Painel */
.painel { display: flex; flex-direction: column; gap: 16px; max-width: 680px; margin: 0 auto; }
.painel-topo { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.stat small { color: var(--muted); font-size: 13px; display: block; } .stat strong { font-size: 28px; font-weight: 800; }
.verde { color: var(--verde); } .azul { color: var(--azul); }
.resultado { margin-top: 10px; font-size: 14px; word-break: break-all; }
.lista { max-height: 340px; overflow-y: auto; }
.link-item { padding: 10px 0; border-bottom: 1px solid #e6ebf2; font-size: 13px; word-break: break-all; }
.link-item:last-child { border-bottom: 0; }
.link-item .destino { color: var(--muted); font-size: 12px; }
.link-item .acoes { display: flex; gap: 8px; align-items: center; margin-top: 6px; }
.link-item .acoes button { background: #eef2f7; border: 1px solid var(--borda); border-radius: 4px; padding: 3px 10px; font-size: 12px; cursor: pointer; }
.link-item .acoes .excluir { color: var(--vermelho); }
.badge-cliques { margin-left: auto; font-size: 12px; color: var(--muted); }

/* Páginas de espera (anúncios) */
.etapa { max-width: 480px; margin: 0 auto; text-align: center; }
.ad-box-vertical { width: 160px; min-height: 600px; margin: 16px auto; overflow: hidden; }
.ad-box-quadrado { width: 300px; min-height: 250px; margin: 16px auto; overflow: hidden; }
.contador { --p: 0%; position: relative; overflow: hidden; margin: 18px 0; padding: 16px 14px 20px; background: #eef4ff; border: 1px solid #c9dbff; border-radius: 4px; font-size: 17px; font-weight: 700; color: var(--azul); }
.contador::after { content: ""; position: absolute; left: 0; bottom: 0; height: 5px; width: var(--p); background: var(--azul); transition: width 1s linear; }
.contador span { font-size: 24px; }
.area-botao { margin-top: 16px; min-height: 52px; }
#btn-ir-redirect, #btn-destino-final { display: none; width: 100%; padding: 15px; border-radius: 4px; text-decoration: none; font-size: 16px; font-weight: 800; color: #fff; text-align: center; }
#btn-ir-redirect { background: var(--azul); } #btn-ir-redirect:hover { background: var(--azul-esc); }
#btn-destino-final { background: var(--verde); } #btn-destino-final:hover { background: #087f37; }

@media (max-width: 720px) {
  .hero { grid-template-columns: 1fr; } .hero h1 { font-size: 30px; }
  .topo-marca img { height: 52px; } .form-linha { flex-direction: column; } .form-linha .btn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { .contador::after { transition: none; } }
