:root {
  --brand: #6d28d9;
  --brand-dark: #4c1d95;
  --bad-bg: #fee2e2;
  --bad: #dc2626;
  --bg: #0f0f13;
  --surface: #18181f;
  --text: #f5f5f7;
  --muted: #9ca3af;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  overflow: hidden;
}

.hidden { display: none !important; }

.screen {
  display: none;
  height: 100%;
  width: 100%;
  flex-direction: column;
  align-items: center;
}
.screen.active { display: flex; }

/* ---------- Splash ---------- */
.splash {
  justify-content: center;
  align-items: center;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
}
.splash-logo { max-width: 60%; max-height: 140px; }
.splash-fallback {
  display: none;
  font-size: 34px;
  font-weight: 800;
  color: white;
  letter-spacing: 0.5px;
}

/* ---------- Barra superior (scan) ---------- */
.topbar {
  width: 100%;
  display: flex;
  align-items: center;
  padding: 14px 16px;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
}
.logo { height: 30px; }
.logo-fallback { display: none; font-weight: 800; font-size: 18px; color: white; }

.camera-wrap {
  position: relative;
  width: 100%;
  max-width: 480px;
  aspect-ratio: 1 / 1;
  background: black;
  border-radius: 20px;
  overflow: hidden;
  margin: 20px auto 0;
}
#video { width: 100%; height: 100%; object-fit: cover; }

.scan-frame {
  position: absolute;
  inset: 12%;
  border: 3px solid rgba(255,255,255,0.85);
  border-radius: 18px;
  box-shadow: 0 0 0 2000px rgba(0,0,0,0.35);
  pointer-events: none;
}

.hint { color: var(--muted); margin-top: 18px; font-size: 15px; text-align: center; padding: 0 20px; }

.cam-error {
  margin: 16px 20px 0;
  background: var(--bad-bg);
  color: var(--bad);
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px;
  text-align: center;
}







/* ---------- Botón / aviso para agregar acceso directo ---------- */
.install-btn {
  margin-left: auto;
  background: rgba(255,255,255,0.18);
  color: white;
  border: none;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.ios-install-hint {
  margin-top: 14px;
  background: var(--surface);
  color: var(--muted);
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 13px;
  text-align: center;
  max-width: 380px;
}
