:root {
  --bg-0: #0b1120;
  --bg-1: #0f172a;
  --card: rgba(30, 41, 59, .72);
  --card-solid: #1e293b;
  --stroke: rgba(148, 163, 184, .16);
  --stroke-strong: rgba(148, 163, 184, .28);
  --accent: #34d399;
  --accent-deep: #059669;
  --accent2: #60a5fa;
  --warn: #fbbf24;
  --danger: #f87171;
  --text: #e6edf6;
  --muted: #94a3b8;
  --radius: 20px;
  --radius-sm: 12px;
  --shadow: 0 1px 0 rgba(255,255,255,.04) inset, 0 18px 50px -12px rgba(0,0,0,.6);
  font-synthesis: none;
  -webkit-text-size-adjust: 100%;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Inter, sans-serif;
  color: var(--text);
  min-height: 100vh;
  background:
    radial-gradient(1100px 620px at 50% -8%, rgba(52,211,153,.14), transparent 60%),
    radial-gradient(900px 500px at 100% 0%, rgba(96,165,250,.10), transparent 55%),
    linear-gradient(180deg, var(--bg-1), var(--bg-0));
  background-attachment: fixed;
  display: flex; flex-direction: column; align-items: center;
  padding: 28px 16px 48px; gap: 18px;
  -webkit-font-smoothing: antialiased;
}
h1 { font-size: 1.55rem; font-weight: 700; letter-spacing: -.02em; text-align: center; }
h2 { font-size: 1.02rem; font-weight: 600; margin-bottom: 12px; color: var(--text); letter-spacing: -.01em; }
p { line-height: 1.5; }

.logo {
  font-size: 2rem; text-align: center; width: 64px; height: 64px; line-height: 64px;
  border-radius: 18px; margin: 4px auto 0;
  background: linear-gradient(160deg, rgba(52,211,153,.22), rgba(96,165,250,.14));
  border: 1px solid var(--stroke-strong);
  box-shadow: var(--shadow);
}

.card {
  background: var(--card);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  padding: 22px;
  width: 100%; max-width: 460px;
  box-shadow: var(--shadow);
  animation: rise .5s cubic-bezier(.22,1,.36,1) both;
}
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

label { display: block; font-size: .82rem; color: var(--muted); margin: 14px 0 6px; font-weight: 500; }
input, select {
  width: 100%; padding: 13px 14px; font-size: 1rem;
  border-radius: var(--radius-sm); border: 1px solid var(--stroke-strong);
  background: rgba(2, 6, 23, .55); color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus { outline: none; border-color: var(--accent2); box-shadow: 0 0 0 3px rgba(96,165,250,.18); }

button {
  width: 100%; padding: 15px; font-size: 1.02rem; font-weight: 650;
  border: none; border-radius: 14px; cursor: pointer; margin-top: 18px;
  color: #04231a; letter-spacing: .01em;
  background: linear-gradient(180deg, #4ade80, var(--accent-deep));
  box-shadow: 0 8px 20px -8px rgba(16,185,129,.7), 0 1px 0 rgba(255,255,255,.25) inset;
  transition: transform .12s ease, filter .15s, box-shadow .15s;
}
button:hover { filter: brightness(1.05); }
button:active { transform: translateY(1px) scale(.995); }
button.secondary { background: linear-gradient(180deg, #93c5fd, #3b82f6); color: #06203f; box-shadow: 0 8px 20px -8px rgba(59,130,246,.6), 0 1px 0 rgba(255,255,255,.25) inset; }
button.ghost { background: rgba(148,163,184,.12); color: var(--text); box-shadow: none; border: 1px solid var(--stroke-strong); }
button:disabled { opacity: .45; cursor: not-allowed; filter: grayscale(.4); transform: none; }

.msg { margin-top: 16px; padding: 13px 14px; border-radius: var(--radius-sm); font-size: .93rem; text-align: center; border: 1px solid transparent; }
.msg.ok { background: rgba(16,185,129,.14); color: #6ee7b7; border-color: rgba(16,185,129,.3); }
.msg.err { background: rgba(248,113,113,.14); color: #fca5a5; border-color: rgba(248,113,113,.3); }
.msg.info { background: rgba(96,165,250,.14); color: #bfdbfe; border-color: rgba(96,165,250,.28); }
.msg.warn { background: rgba(251,191,36,.14); color: #fcd34d; border-color: rgba(251,191,36,.3); }

/* ── Status pill (geofence: dentro/fora) ── */
.status {
  display: flex; align-items: center; gap: 12px;
  padding: 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--stroke-strong);
  background: rgba(2,6,23,.4);
  transition: background .3s, border-color .3s;
}
.status .dot { width: 12px; height: 12px; border-radius: 50%; flex: none; background: var(--muted); }
.status .st-main { font-weight: 650; font-size: 1.02rem; }
.status .st-sub { font-size: .82rem; color: var(--muted); margin-top: 2px; }
.status.inside { background: rgba(16,185,129,.12); border-color: rgba(16,185,129,.4); }
.status.inside .dot { background: var(--accent); box-shadow: 0 0 0 0 rgba(52,211,153,.6); animation: pulse 1.8s infinite; }
.status.inside .st-main { color: #6ee7b7; }
.status.outside { background: rgba(251,191,36,.10); border-color: rgba(251,191,36,.34); }
.status.outside .dot { background: var(--warn); }
.status.searching .dot { background: var(--accent2); animation: blink 1s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(52,211,153,.55); } 70% { box-shadow: 0 0 0 12px rgba(52,211,153,0); } 100% { box-shadow: 0 0 0 0 rgba(52,211,153,0); } }
@keyframes blink { 50% { opacity: .35; } }

/* progress dots (passos do ponto) */
.steps { list-style: none; font-size: .88rem; color: var(--muted); margin-top: 14px; display: grid; gap: 4px; }
.steps li { padding: 6px 0; display: flex; gap: 10px; align-items: center; }
.steps li::before { content: '○'; }
.steps li.done { color: var(--accent); }
.steps li.done::before { content: '✓'; }
.steps li.active { color: var(--text); font-weight: 650; }
.steps li.active::before { content: '◉'; color: var(--accent2); }

#reader { width: 100%; border-radius: var(--radius-sm); overflow: hidden; margin-top: 10px; border: 1px solid var(--stroke); }
.qr-wrap { text-align: center; }
.qr-wrap canvas, .qr-wrap img { background: #fff; padding: 16px; border-radius: 16px; box-shadow: var(--shadow); }
.countdown { font-size: .85rem; color: var(--muted); margin-top: 10px; }
.link { color: var(--accent2); text-decoration: none; font-size: .88rem; font-weight: 500; }
.link:hover { text-decoration: underline; }

table { width: 100%; border-collapse: collapse; font-size: .85rem; margin-top: 12px; }
th, td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--stroke); }
th { color: var(--muted); font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; }
tr:hover td { background: rgba(148,163,184,.05); }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 120px; }
.tag { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: .74rem; font-weight: 600; }
.tag.in { background: rgba(16,185,129,.2); color: #6ee7b7; }
.tag.out { background: rgba(248,113,113,.2); color: #fca5a5; }
.big-result { font-size: 1.7rem; font-weight: 750; text-align: center; margin: 8px 0; letter-spacing: -.02em; }

.muted { color: var(--muted); }
.brandbar { display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--muted); font-size: .8rem; }
.spin { display: inline-block; width: 16px; height: 16px; border: 2px solid var(--stroke-strong); border-top-color: var(--accent2); border-radius: 50%; animation: rot .7s linear infinite; }
@keyframes rot { to { transform: rotate(360deg); } }
