:root {
  --bg: #0f1115;
  --card: #1a1d24;
  --ink: #e8eaed;
  --muted: #9aa0aa;
  --accent: #ff7a3d;
  --accent-2: #3ddc97;
  --danger: #ff5c5c;
  --line: #2a2e37;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  background: radial-gradient(1200px 600px at 50% -10%, #1c2230, var(--bg));
  color: var(--ink);
  font: 16px/1.5 system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  padding: 2rem 1rem;
}
.card {
  width: 100%;
  max-width: 560px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}
header h1 { margin: 0 0 0.25rem; font-size: 1.5rem; }
.sub { margin: 0 0 1.5rem; color: var(--muted); }
.field { display: block; margin-bottom: 1.15rem; }
.field > span { display: block; margin-bottom: 0.4rem; font-weight: 600; }
.field em { color: var(--muted); font-weight: 400; }
input[type=file], input[type=email], input[type=text] {
  width: 100%;
  padding: 0.7rem 0.8rem;
  background: #12151b;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  font: inherit;
}
input:focus { outline: 2px solid var(--accent); border-color: transparent; }
small { display: block; margin-top: 0.35rem; color: var(--muted); font-size: 0.82rem; }
a { color: var(--accent); }
button {
  width: 100%;
  padding: 0.85rem;
  margin-top: 0.5rem;
  background: var(--accent);
  color: #1a1000;
  border: none;
  border-radius: 10px;
  font: 600 1rem system-ui;
  cursor: pointer;
}
button:hover { filter: brightness(1.08); }
button:disabled { opacity: 0.5; cursor: default; }
details { margin: -0.4rem 0 1.15rem; border: 1px solid var(--line); border-radius: 10px; padding: 0.6rem 0.9rem; }
summary { cursor: pointer; font-weight: 600; }
details ol { margin: 0.6rem 0 0.3rem; padding-left: 1.2rem; }
details li { margin-bottom: 0.35rem; }
.note { color: var(--muted); font-size: 0.85rem; }
.bar { height: 12px; background: #12151b; border-radius: 999px; overflow: hidden; margin: 1rem 0 0.5rem; }
.bar-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width 0.2s ease; }
.counter { font-variant-numeric: tabular-nums; color: var(--muted); }
.hint { color: var(--muted); font-size: 0.85rem; }
#result-counts { list-style: none; padding: 0; }
#result-counts li { display: flex; justify-content: space-between; padding: 0.4rem 0; border-bottom: 1px solid var(--line); }
#result-counts b { color: var(--accent-2); font-variant-numeric: tabular-nums; }
#error-list li { color: var(--danger); font-size: 0.85rem; }
footer { color: var(--muted); font-size: 0.8rem; }
h2 { margin-top: 0; }

/* preflight app-password check */
.preflight {
  border: 1px solid var(--accent);
  background: rgba(255, 122, 61, 0.08);
  border-radius: 12px;
  padding: 1rem 1.1rem;
  margin-bottom: 1.5rem;
}
.preflight strong { color: var(--accent); }
.preflight-btn {
  display: inline-block;
  margin: 0.7rem 0 0.2rem;
  padding: 0.55rem 0.9rem;
  background: var(--accent);
  color: #1a1000;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
}
.preflight-btn:hover { filter: brightness(1.08); }

/* unlock step */
.big { font-size: 1.15rem; font-weight: 600; margin: 0 0 0.4rem; }
.ok-line { color: var(--accent-2); margin: 0 0 1.25rem; }
.or { text-align: center; color: var(--muted); margin: 1.4rem 0 0.8rem; font-size: 0.9rem; }
button.secondary { background: transparent; color: var(--ink); border: 1px solid var(--line); }
button.secondary:hover { border-color: var(--accent); filter: none; }
.err { color: var(--danger); margin-top: 0.8rem; }

/* indeterminate scan bar */
.bar-fill.indeterminate {
  width: 40% !important;
  animation: slide 1.1s ease-in-out infinite;
}
@keyframes slide {
  0% { margin-left: -40%; }
  100% { margin-left: 100%; }
}
