:root {
  --bg: #0f1115;
  --surface: #181b22;
  --text: #f4f6fb;
  --muted: #9aa3b2;
  --ok: #1fbf6b;
  --ok-glow: rgba(31, 191, 107, 0.35);
  --bad: #ec4040;
  --bad-glow: rgba(236, 64, 64, 0.35);
  --idle: #3a4150;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: "Manrope", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid #232833;
}
.brand { font-family: "Sora", sans-serif; font-weight: 700; letter-spacing: 0.02em; }
.index-status { font-size: 0.75rem; color: var(--muted); }

main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 18px;
  padding-bottom: max(18px, env(safe-area-inset-bottom));
}

.reader {
  width: 100%;
  max-width: 380px;
  border-radius: 18px;
  overflow: hidden;
  background: #000;
  aspect-ratio: 1 / 1;
}
.reader video { object-fit: cover !important; }

.result {
  width: 100%;
  max-width: 480px;
  background: var(--surface);
  border-radius: 22px;
  padding: 32px 24px;
  text-align: center;
  border: 1px solid #232833;
  transition: border-color 0.25s, box-shadow 0.25s;
}
.status-dot {
  width: 54px; height: 54px;
  border-radius: 50%;
  margin: 0 auto 16px;
  background: var(--idle);
  transition: background 0.25s, box-shadow 0.25s;
}
.result h1 {
  font-family: "Sora", sans-serif;
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.nome { font-size: 1.25rem; font-weight: 700; margin-top: 10px; }
.empresa { color: var(--muted); margin-top: 2px; }
.cpf {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-top: 12px;
  font-size: 0.95rem;
}
.detalhe { color: var(--muted); font-size: 0.85rem; margin-top: 8px; }

.result--ok {
  border-color: var(--ok);
  box-shadow: 0 0 0 1px var(--ok), 0 14px 40px var(--ok-glow);
}
.result--ok .status-dot { background: var(--ok); box-shadow: 0 0 24px var(--ok-glow); }

.result--bad {
  border-color: var(--bad);
  box-shadow: 0 0 0 1px var(--bad), 0 14px 40px var(--bad-glow);
}
.result--bad .status-dot { background: var(--bad); box-shadow: 0 0 24px var(--bad-glow); }

.result--checking .status-dot { animation: pulse 0.9s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.35; } }

.rescan {
  font-family: "Sora", sans-serif;
  font-weight: 700;
  font-size: 1rem;
  color: var(--bg);
  background: var(--text);
  border: 0;
  border-radius: 999px;
  padding: 14px 28px;
  cursor: pointer;
}
.rescan:active { transform: scale(0.97); }
