:root {
  --navy: #00375c;
  --navy-deep: #060f14;
  --card: #0a1a22;
  --card-2: #0d222c;
  --golden: #ffc000;
  --golden-2: #ff9d00;
  --electric: #1a8fff;
  --green: #22c55e;
  --red: #ef4444;
  --text: #e8edf0;
  --muted: #8aa0ab;
  --border: #16303c;
  --radius: 0.75rem;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
  font-family: "Plus Jakarta Sans", "Inter", ui-sans-serif, system-ui, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(900px 500px at -10% -10%, rgba(255, 192, 0, 0.10), transparent 60%),
    radial-gradient(900px 500px at 110% 10%, rgba(26, 143, 255, 0.10), transparent 60%),
    var(--navy-deep);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 28px;
  border-bottom: 1px solid var(--border);
  background: rgba(6, 15, 20, 0.7);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand { display: flex; align-items: center; gap: 12px; }

.brand .logo {
  width: 40px; height: 40px; border-radius: 12px;
  display: grid; place-items: center; font-size: 22px; font-weight: 800;
  background: linear-gradient(135deg, var(--golden), var(--golden-2));
  color: #1a1200;
  box-shadow: 0 0 24px rgba(255, 192, 0, 0.35);
}

.brand .name { font-weight: 800; font-size: 18px; letter-spacing: 0.3px; }
.brand .sub { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 2px; }

.nav { display: flex; gap: 8px; }
.nav a {
  padding: 8px 14px; border-radius: 10px; font-size: 14px; font-weight: 600;
  color: var(--muted); border: 1px solid transparent;
}
.nav a:hover { color: var(--text); background: rgba(255, 255, 255, 0.04); }
.nav a.active {
  color: var(--golden);
  background: linear-gradient(135deg, rgba(255, 192, 0, 0.14), rgba(255, 157, 0, 0.06));
  border-color: rgba(255, 192, 0, 0.35);
}

.container { max-width: 1080px; margin: 0 auto; padding: 32px 24px 64px; }

.title-golden {
  background: linear-gradient(135deg, #ffd257 0%, var(--golden-2) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  font-weight: 800; font-size: 30px; margin: 0 0 6px;
}
.subtitle { color: var(--muted); margin: 0 0 28px; font-size: 15px; }

.card {
  background: linear-gradient(180deg, var(--card-2), var(--card));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 820px) { .grid-2 { grid-template-columns: 1fr; } }

.home-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 8px; }
@media (max-width: 820px) { .home-cards { grid-template-columns: 1fr; } }

.home-card {
  background: linear-gradient(180deg, var(--card-2), var(--card));
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 28px 24px; transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
  display: block;
}
.home-card:hover { transform: translateY(-4px); border-color: rgba(255, 192, 0, 0.4); box-shadow: 0 24px 60px rgba(0,0,0,0.6); }
.home-card .ico { font-size: 30px; margin-bottom: 12px; }
.home-card h3 { margin: 0 0 6px; font-size: 18px; }
.home-card p { margin: 0; color: var(--muted); font-size: 14px; }

label { display: block; font-size: 13px; font-weight: 600; margin: 16px 0 6px; color: #cdd9df; }
input[type="text"], textarea {
  width: 100%; padding: 12px 14px; border-radius: 10px;
  background: #071319; border: 1px solid var(--border); color: var(--text);
  font-size: 14px; font-family: inherit;
}
input[type="text"]:focus, textarea:focus { outline: none; border-color: var(--golden); }
textarea { resize: vertical; min-height: 80px; }

.check { display: flex; align-items: flex-start; gap: 10px; margin-top: 14px; }
.check input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--golden); }
.check label { margin: 0; font-weight: 500; color: var(--muted); }
.check .req { color: var(--golden); font-weight: 700; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px; border-radius: 10px; font-weight: 700; font-size: 14px;
  border: 1px solid transparent; cursor: pointer; font-family: inherit;
}
.btn-primary { background: linear-gradient(135deg, var(--golden), var(--golden-2)); color: #1a1200; }
.btn-primary:hover { filter: brightness(1.05); }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--text); }
.btn-ghost:hover { background: rgba(255,255,255,0.04); }
.btn-danger { background: transparent; border-color: rgba(239,68,68,0.4); color: #ff9c9c; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-row { display: flex; gap: 12px; margin-top: 22px; flex-wrap: wrap; }

video, canvas.preview {
  width: 100%; border-radius: 12px; background: #000; border: 1px solid var(--border);
  aspect-ratio: 4 / 3; object-fit: cover;
}

.cam-wrap { position: relative; }
.cam-hint { font-size: 12px; color: var(--muted); margin-top: 8px; text-align: center; }

.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
}
.badge-risk { background: rgba(239,68,68,0.15); color: #ff9c9c; border: 1px solid rgba(239,68,68,0.4); }
.badge-ok { background: rgba(34,197,94,0.15); color: #86efac; border: 1px solid rgba(34,197,94,0.4); }
.badge-sim { background: rgba(26,143,255,0.15); color: #8ccaff; border: 1px solid rgba(26,143,255,0.4); }

.result { margin-top: 22px; }
.result .match {
  display: flex; gap: 18px; align-items: center;
  padding: 18px; border-radius: 12px; border: 1px solid var(--border); background: #071319;
}
.result .match.risk { border-color: rgba(239,68,68,0.5); box-shadow: 0 0 0 1px rgba(239,68,68,0.15) inset; }
.result .match img { width: 96px; height: 96px; border-radius: 12px; object-fit: cover; border: 1px solid var(--border); }
.result .match h3 { margin: 0 0 6px; font-size: 20px; }
.result .match .meta { color: var(--muted); font-size: 13px; margin: 2px 0; }
.result .match .mono { font-family: "JetBrains Mono", monospace; }

.alert { padding: 14px 16px; border-radius: 10px; font-size: 14px; margin-top: 16px; }
.alert-warn { background: rgba(255,192,0,0.1); border: 1px solid rgba(255,192,0,0.35); color: #ffe08a; }
.alert-err { background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.35); color: #ffb4b4; }
.alert-ok { background: rgba(34,197,94,0.1); border: 1px solid rgba(34,197,94,0.35); color: #b7f7cd; }

.table { width: 100%; border-collapse: collapse; margin-top: 8px; }
.table th, .table td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--border); font-size: 14px; }
.table th { color: var(--muted); text-transform: uppercase; font-size: 11px; letter-spacing: 1px; }
.table td img { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; }

.lgpd-note { margin-top: 24px; font-size: 12px; color: var(--muted); border-left: 2px solid rgba(255,192,0,0.4); padding-left: 12px; }

.spinner {
  width: 18px; height: 18px; border: 2px solid rgba(0,0,0,0.25); border-top-color: #1a1200;
  border-radius: 50%; animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
