:root {
  --navy: #0b1324;
  --navy-2: #121d36;
  --ink: #0f172a;
  --text: #334155;
  --muted: #64748b;
  --line: #e2e8f0;
  --bg: #ffffff;
  --bg-alt: #f6f8fb;
  --accent: #22c55e;
  --accent-dark: #15803d;
  --alta: #dc2626;
  --media: #ea580c;
  --baixa: #2563eb;
  --info: #64748b;
  --pass: #16a34a;
  --radius: 14px;
  --shadow: 0 1px 2px rgb(15 23 42 / 6%), 0 8px 24px rgb(15 23 42 / 6%);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Code", Consolas, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font); color: var(--text); background: var(--bg); line-height: 1.6; -webkit-font-smoothing: antialiased; }
h1, h2, h3 { color: var(--ink); line-height: 1.2; margin: 0 0 .5em; }
a { color: var(--accent-dark); }
code { font-family: var(--mono); font-size: .9em; background: #eef2f7; padding: .1em .35em; border-radius: 6px; }
img, svg { max-width: 100%; }

.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }
.narrow { width: min(760px, 100% - 32px); }
.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -9999px; top: 8px; background: #fff; padding: 8px 12px; z-index: 100; border-radius: 8px; }
.skip:focus { left: 8px; }
[hidden] { display: none !important; }

/* ---------- Botões ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5em; padding: .8em 1.3em; border-radius: 10px; border: 2px solid transparent; font: inherit; font-weight: 650; text-decoration: none; cursor: pointer; transition: transform .1s, background .2s, border-color .2s; white-space: nowrap; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible, .chip:focus-visible, input:focus-visible, summary:focus-visible { outline: 3px solid #86efac; outline-offset: 2px; }
.btn-primary { background: var(--accent); color: #052e16; }
.btn-primary:hover { background: #16a34a; color: #fff; }
.btn-primary:disabled { opacity: .6; cursor: progress; }
.btn-outline { border-color: var(--line); color: var(--ink); background: #fff; }
.btn-outline:hover { border-color: var(--accent); }
.btn-small { padding: .45em .9em; font-size: .9rem; border-color: rgb(255 255 255 / 25%); color: #fff; }
.btn-small:hover { border-color: var(--accent); }
.btn-large { font-size: 1.1rem; padding: 1em 1.6em; }

/* ---------- Topo ---------- */
.topbar { background: var(--navy); color: #fff; position: sticky; top: 0; z-index: 10; border-bottom: 1px solid rgb(255 255 255 / 8%); }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-size: 1.35rem; letter-spacing: -.01em; }
.brand strong { color: var(--accent); }
.brand-mark { width: 32px; height: 32px; fill: none; stroke: var(--accent); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }
.nav { display: flex; align-items: center; gap: 22px; }
.nav a:not(.btn) { color: #cbd5e1; text-decoration: none; font-size: .95rem; }
.nav a:not(.btn):hover { color: #fff; }

/* ---------- Hero ---------- */
.hero { background: radial-gradient(1200px 500px at 70% -10%, #1e3a5f 0%, transparent 60%), var(--navy); color: #cbd5e1; padding: 72px 0 88px; }
.hero-inner { max-width: 820px; }
.hero h1 { color: #fff; font-size: clamp(2.1rem, 5.5vw, 3.6rem); letter-spacing: -.02em; }
.accent { color: var(--accent); }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .78rem; font-weight: 700; color: #86efac; margin: 0 0 12px; }
.eyebrow.dark { color: var(--accent-dark); }
.lead { font-size: 1.15rem; max-width: 680px; margin: 0 0 32px; }
.scan-form { display: flex; gap: 10px; background: #fff; padding: 8px; border-radius: 14px; max-width: 640px; box-shadow: 0 20px 50px rgb(0 0 0 / 30%); }
.scan-form input { flex: 1; min-width: 0; border: 0; font: inherit; font-size: 1.05rem; padding: .7em .8em; color: var(--ink); background: transparent; border-radius: 8px; }
.form-extra { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; max-width: 640px; margin-top: 16px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .92rem; color: #cbd5e1; flex: 1 1 280px; cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--accent); flex: none; }
.check a { color: #86efac; }
.turnstile:empty { display: none; }
.form-note { font-size: .9rem; margin: 14px 0 0; max-width: 640px; color: #94a3b8; }
.form-note strong { color: #e2e8f0; }
.form-error { margin: 12px 0 0; color: #fecaca; background: rgb(220 38 38 / 18%); border: 1px solid rgb(248 113 113 / 40%); padding: 10px 14px; border-radius: 10px; max-width: 640px; }

/* ---------- Progresso ---------- */
.progress { margin-top: -40px; position: relative; }
.progress-card { display: flex; gap: 20px; align-items: flex-start; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px; border: 1px solid var(--line); }
.progress-card h2 { font-size: 1.2rem; }
.spinner { width: 36px; height: 36px; border: 4px solid #dcfce7; border-top-color: var(--accent); border-radius: 50%; animation: spin 1s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.steps { list-style: none; padding: 0; margin: 0; }
.steps li { padding-left: 26px; position: relative; color: var(--muted); }
.steps li::before { content: "○"; position: absolute; left: 0; }
.steps li.is-done { color: var(--ink); }
.steps li.is-done::before { content: "✓"; color: var(--pass); font-weight: 700; }
.steps li.is-failed::before { content: "!"; color: var(--media); font-weight: 700; }

/* ---------- Resultados ---------- */
.results { margin-top: -40px; position: relative; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 32px; border: 1px solid var(--line); }
.results-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 24px; align-items: center; }
.score-block { display: flex; gap: 20px; align-items: center; }
.score-block h2 { font-size: 1.6rem; word-break: break-all; margin: 0; }
.score-block .muted { margin: 4px 0 0; font-size: .9rem; }
.score-ring { --p: 0; --c: var(--muted); width: 112px; height: 112px; flex: none; border-radius: 50%; display: grid; place-content: center; text-align: center; background: radial-gradient(closest-side, #fff 78%, transparent 80% 100%), conic-gradient(var(--c) calc(var(--p) * 1%), #e5e7eb 0); }
.score-ring span { font-size: 2.1rem; font-weight: 800; color: var(--ink); line-height: 1; }
.score-ring small { font-weight: 700; color: var(--c); }
.cat-scores { display: flex; gap: 12px; flex-wrap: wrap; }
.cat-score { border: 1px solid var(--line); border-radius: 12px; padding: 10px 16px; min-width: 150px; }
.cat-score b { display: block; font-size: 1.5rem; color: var(--ink); }
.cat-score span { font-size: .82rem; color: var(--muted); }
.sev-summary { display: flex; flex-wrap: wrap; gap: 10px; margin: 24px 0; }
.sev-pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: var(--bg-alt); font-size: .9rem; font-weight: 600; }
.sev-pill i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dot-alta { background: var(--alta); } .dot-media { background: var(--media); } .dot-baixa { background: var(--baixa); } .dot-info { background: var(--info); } .dot-pass { background: var(--pass); }

.report-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 16px; background: var(--bg-alt); border-radius: 12px; margin-bottom: 20px; }
.report-actions label { font-weight: 600; color: var(--ink); font-size: .95rem; }
.report-actions input { flex: 1; min-width: 200px; font: inherit; padding: .65em .8em; border: 1px solid var(--line); border-radius: 10px; }

.filters { display: flex; gap: 8px; margin-bottom: 12px; }
.chip { font: inherit; font-size: .9rem; padding: .4em .9em; border-radius: 999px; border: 1px solid var(--line); background: #fff; cursor: pointer; color: var(--text); }
.chip.is-active { background: var(--ink); color: #fff; border-color: var(--ink); }

.findings { display: grid; gap: 10px; }
.finding { border: 1px solid var(--line); border-left: 5px solid var(--info); border-radius: 12px; background: #fff; }
.finding[data-status="pass"] { border-left-color: var(--pass); }
.finding.sev-alta:not([data-status="pass"]) { border-left-color: var(--alta); }
.finding.sev-media:not([data-status="pass"]) { border-left-color: var(--media); }
.finding.sev-baixa:not([data-status="pass"]) { border-left-color: var(--baixa); }
.finding summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 14px 16px; }
.finding summary::-webkit-details-marker { display: none; }
.finding .fid { font-family: var(--mono); font-size: .78rem; color: var(--muted); }
.finding .ftitle { font-weight: 650; color: var(--ink); }
.finding .fcat { display: block; font-size: .8rem; color: var(--muted); font-weight: 400; }
.finding .fbody { padding: 0 16px 16px; border-top: 1px dashed var(--line); }
.finding .fbody h4 { margin: 14px 0 4px; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.finding .fbody p { margin: 0; }
.evidence { font-family: var(--mono); font-size: .82rem; background: var(--bg-alt); padding: 8px 10px; border-radius: 8px; word-break: break-word; }
.tag { font-size: .75rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.tag-media { background: #ffedd5; color: #9a3412; }
.tag-alta { background: #fee2e2; color: #991b1b; }
.tag-baixa { background: #dbeafe; color: #1e40af; }
.tag-info { background: #f1f5f9; color: #475569; }
.tag-pass { background: #dcfce7; color: #166534; }

.cta-box { display: flex; flex-wrap: wrap; gap: 20px; justify-content: space-between; align-items: center; margin-top: 28px; padding: 24px; border-radius: var(--radius); background: var(--navy); color: #cbd5e1; }
.cta-box h3 { color: #fff; }
.cta-box p { margin: 0; max-width: 640px; }

/* ---------- Seções ---------- */
.section { padding: 88px 0; }
.section.alt { background: var(--bg-alt); }
.section-title { font-size: clamp(1.6rem, 3.5vw, 2.3rem); letter-spacing: -.01em; max-width: 760px; margin-bottom: 40px; }
.center .section-title { margin-inline: auto; margin-bottom: 16px; }
.flow { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 20px; }
.flow li { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.flow-num { display: inline-grid; place-content: center; width: 36px; height: 36px; border-radius: 10px; background: #dcfce7; color: var(--accent-dark); font-weight: 800; margin-bottom: 14px; }
.flow p, .card p { margin: 0; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 20px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; align-items: stretch; }
.plan { border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; display: flex; flex-direction: column; position: relative; }
.plan.featured { border: 2px solid var(--accent); box-shadow: var(--shadow); }
.plan .badge { position: absolute; top: -12px; left: 24px; margin: 0; background: var(--accent); color: #052e16; font-size: .75rem; font-weight: 800; padding: 3px 10px; border-radius: 999px; }
.plan .price { font-size: 1.6rem; font-weight: 800; color: var(--ink); margin: 0 0 12px; }
.plan ul { padding-left: 1.1em; margin: 0 0 24px; flex: 1; }
.plan li { margin-bottom: 6px; }
details:not(.finding) { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 0 20px; margin-bottom: 10px; }
details:not(.finding) summary { cursor: pointer; font-weight: 650; color: var(--ink); padding: 18px 0; }
details:not(.finding) p { margin: 0 0 18px; }
.contact { background: var(--navy); color: #cbd5e1; }
.contact h2 { color: #fff; }
.contact p { margin-bottom: 28px; }

.footer { background: #070d1a; color: #94a3b8; font-size: .9rem; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding: 24px 0; }
.footer p { margin: 0; }
.footer a { color: #cbd5e1; }

.legal { padding: 64px 0; }
.legal h1 { font-size: 2rem; }
.legal h2 { font-size: 1.2rem; margin-top: 2em; }

/* ---------- Responsivo ---------- */
@media (max-width: 760px) {
  .nav a:not(.btn) { display: none; }
  .hero { padding: 48px 0 72px; }
  .scan-form { flex-direction: column; }
  .results { padding: 20px; }
  .score-block { flex-direction: column; align-items: flex-start; }
  .finding summary { grid-template-columns: 1fr auto; }
  .finding .fid { grid-column: 1 / -1; }
  .section { padding: 64px 0; }
}

/* ---------- Relatório (somente impressão) ---------- */
.report { display: none; }

@media print {
  /* Rodapé próprio do relatório: ao definir as margens da página, o navegador deixa de
     imprimir o cabeçalho/rodapé automático dele (com a URL, a data e o título da aba). */
  @page {
    size: A4;
    margin: 16mm 14mm 18mm;
    @top-left { content: ""; }
    @top-center { content: ""; }
    @top-right { content: ""; }
    @bottom-left { content: "BugLess · Relatório de verificação passiva · Confidencial"; font: 7.5pt system-ui, sans-serif; color: #64748b; }
    @bottom-center { content: ""; }
    @bottom-right { content: "Página " counter(page) " de " counter(pages); font: 7.5pt system-ui, sans-serif; color: #64748b; }
  }
  body { background: #fff; }
  body.printing > *:not(#report) { display: none !important; }
  body.printing #report { display: block; }
  .report { font-size: 10.5pt; color: #1f2937; line-height: 1.5; }
  .report * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .r-cover { min-height: 250mm; display: flex; flex-direction: column; justify-content: space-between; break-after: page; }
  .r-brand { display: flex; align-items: center; gap: 10px; font-size: 18pt; color: var(--ink); }
  .r-brand strong { color: var(--accent-dark); }
  .r-brand svg { width: 34px; height: 34px; fill: none; stroke: var(--accent-dark); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }
  .r-cover h1 { font-size: 28pt; margin: 0 0 6mm; letter-spacing: -.01em; }
  .r-cover .r-target { font-size: 16pt; color: var(--accent-dark); font-weight: 700; word-break: break-all; }
  .r-meta { border-top: 2px solid var(--ink); padding-top: 5mm; display: grid; grid-template-columns: 1fr 1fr; gap: 3mm 10mm; font-size: 10pt; }
  .r-meta b { display: block; color: var(--muted); font-size: 8pt; text-transform: uppercase; letter-spacing: .08em; }
  .r-score-big { display: flex; align-items: center; gap: 8mm; margin: 10mm 0; }
  .r-score-big .score-ring { width: 40mm; height: 40mm; }
  .report h2 { font-size: 15pt; margin: 8mm 0 3mm; padding-bottom: 2mm; border-bottom: 1px solid var(--line); break-after: avoid; }
  .report h3 { font-size: 11.5pt; margin: 0 0 1.5mm; break-after: avoid; }
  .r-table { width: 100%; border-collapse: collapse; margin: 3mm 0; font-size: 9.5pt; }
  .r-table th, .r-table td { border: 1px solid var(--line); padding: 2mm 2.5mm; text-align: left; vertical-align: top; }
  .r-table th { background: var(--bg-alt); font-size: 8.5pt; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
  .r-table tr.r-group th { background: #e2e8f0; color: var(--ink); font-size: 9pt; letter-spacing: .02em; text-transform: none; }
  .r-table td.r-id { white-space: nowrap; }
  .r-finding { border: 1px solid var(--line); border-left: 4px solid var(--info); border-radius: 3mm; padding: 3.5mm 4mm; margin: 0 0 3.5mm; break-inside: avoid; }
  .r-finding.sev-alta { border-left-color: var(--alta); }
  .r-finding.sev-media { border-left-color: var(--media); }
  .r-finding.sev-baixa { border-left-color: var(--baixa); }
  .r-finding p { margin: 1mm 0; }
  .r-finding .r-label { font-weight: 700; color: var(--ink); }
  .r-finding .evidence { font-size: 8.5pt; margin: 1.5mm 0; }
  .r-head { display: flex; justify-content: space-between; gap: 4mm; align-items: baseline; }
  .r-id { font-family: var(--mono); font-size: 8.5pt; color: var(--muted); }
  .r-note { background: var(--bg-alt); border-radius: 3mm; padding: 4mm; font-size: 9.5pt; break-inside: avoid; }
  .r-section { break-inside: auto; }
  .r-break { break-before: page; }
  a { color: var(--ink); text-decoration: none; }
}
