* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; background: #0f1626; color: #fff; }
.muted { color: #9aa7bd; }
.hidden { display: none !important; }

/* Login */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-card { width: 100%; max-width: 360px; background: #1a2236; border: 1px solid #2a3350; border-radius: 14px; padding: 26px; }
.brand { font-size: 22px; font-weight: 800; letter-spacing: .5px; }
.login-card .muted { margin: 4px 0 20px; }
.login-card label { display: block; font-size: 13px; color: #9aa7bd; margin: 12px 0 6px; }
.login-card input { width: 100%; padding: 12px; border-radius: 8px; border: 1px solid #2a3350; background: #0f1626; color: #fff; font-size: 16px; }
.login-card button { width: 100%; margin-top: 18px; padding: 13px; border: none; border-radius: 8px; background: #2e6be6; color: #fff; font-size: 16px; font-weight: 600; }
.err { color: #ff7a6b; margin-top: 12px; font-size: 14px; min-height: 18px; }

/* App */
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; background: #1a2b49; position: sticky; top: 0; }
.topbar .brand { font-size: 18px; }
.logout { color: #9aa7bd; text-decoration: none; font-size: 14px; }
.app { padding: 16px; max-width: 560px; margin: 0 auto; }
.datastate { display: flex; align-items: center; justify-content: space-between; font-size: 13px; color: #9aa7bd; margin-bottom: 14px; gap: 10px; }
.ghost { background: transparent; border: 1px solid #2a3350; color: #cdd6e6; border-radius: 8px; padding: 8px 12px; font-size: 13px; }

.scanner { position: relative; width: 100%; aspect-ratio: 1/1; background: #000; border-radius: 14px; overflow: hidden; }
#video { width: 100%; height: 100%; object-fit: cover; }
.scan-frame { position: absolute; inset: 18%; border: 3px solid rgba(255,255,255,.7); border-radius: 16px; }
canvas { width: 1px; height: 1px; }

.actions { margin-top: 16px; }
.primary { width: 100%; padding: 15px; border: none; border-radius: 10px; background: #2e6be6; color: #fff; font-size: 17px; font-weight: 700; }
.hint { color: #7c89a3; font-size: 12px; line-height: 1.5; margin-top: 14px; }

.result { border-radius: 14px; padding: 22px; text-align: center; margin-bottom: 16px; }
.result.valid { background: #11432a; border: 1px solid #1f7a47; }
.result.invalid { background: #4a1410; border: 1px solid #a3392e; }
.result-icon { font-size: 46px; font-weight: 800; }
.result.valid .result-icon::before { content: "✓"; color: #45d483; }
.result.invalid .result-icon::before { content: "✕"; color: #ff6f5e; }
.result-text { font-size: 26px; font-weight: 800; margin-top: 4px; }
.result-sub { color: #cdd6e6; margin-top: 6px; font-size: 14px; }
