:root {
  --bg: #0f172a;
  --bg2: #1e293b;
  --card: #ffffff;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --brand: #4f46e5;
  --brand-dark: #4338ca;
  --ok: #16a34a;
  --ok-bg: #dcfce7;
  --warn: #b45309;
  --warn-bg: #fef3c7;
  --err: #dc2626;
  --err-bg: #fee2e2;
  --radius: 16px;
  --shadow: 0 10px 40px rgba(2, 6, 23, 0.25);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 32px 16px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  /* Tiled pinball-playfield collage, darkened so the card and text stay readable. */
  background-color: var(--bg);
  background-image:
    linear-gradient(rgba(15, 23, 42, 0.62), rgba(15, 23, 42, 0.62)),
    url('images/bg.webp');
  background-repeat: repeat;
  background-attachment: fixed;
}

.card {
  width: 100%;
  max-width: 560px;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 36px 32px 32px;
  text-align: center;
}

.head .logo { display: block; width: 260px; max-width: 82%; height: auto; margin: 0 auto 6px; }
.head h1 { margin: 8px 0 6px; font-size: 26px; }
.tagline { margin: 0 auto; max-width: 44ch; color: var(--muted); font-size: 15px; line-height: 1.5; }

.panel { margin-top: 28px; }
.panel[hidden] { display: none; }

/* Steps list */
.steps { list-style: none; padding: 0; margin: 0 0 24px; text-align: left; }
.steps li {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; margin-bottom: 8px;
  background: #f8fafc; border: 1px solid var(--line); border-radius: 12px;
  font-size: 15px;
}
.steps .num {
  flex: 0 0 auto; width: 26px; height: 26px; border-radius: 50%;
  background: var(--brand); color: #fff; font-weight: 700; font-size: 14px;
  display: grid; place-items: center;
}

/* Buttons */
.btn {
  font: inherit; font-weight: 600; cursor: pointer;
  border-radius: 12px; padding: 14px 22px; border: 1px solid transparent;
  transition: background .15s, border-color .15s, opacity .15s;
}
.btn.primary { background: var(--brand); color: #fff; font-size: 17px; width: 100%; }
.btn.primary:hover { background: var(--brand-dark); }
.btn.ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { background: #f8fafc; }
.btn:disabled { opacity: .55; cursor: default; }
.btn-row { display: flex; flex-direction: column; gap: 10px; margin-top: 20px; }

.fineprint { margin-top: 16px; color: var(--muted); font-size: 13px; }

/* Big status icons */
.big-icon { font-size: 52px; line-height: 1; margin-bottom: 4px; }
.big-icon.spin { animation: spin 1.4s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .big-icon.spin { animation: none; } }

.panel h2 { font-size: 21px; margin: 10px 0 8px; }
.panel p { color: var(--muted); line-height: 1.5; margin: 6px 0; }

/* Confirm */
.confirm-name strong { color: var(--ink); }
.warn-box {
  background: var(--warn-bg); color: var(--warn); border: 1px solid #fcd34d;
  border-radius: 12px; padding: 12px 14px; font-size: 14px; text-align: left; margin: 14px 0;
}
.warn-box code, .steps code { background: rgba(0,0,0,.06); padding: 1px 5px; border-radius: 5px; }
.confirm-sub { margin-top: 14px; font-weight: 600; color: var(--ink); }
.entry-list {
  list-style: none; padding: 8px; margin: 8px 0 0; text-align: left;
  max-height: 140px; overflow-y: auto;
  background: #f8fafc; border: 1px solid var(--line); border-radius: 12px;
  font-size: 14px; color: var(--ink);
}
.entry-list li { padding: 3px 6px; }
.entry-list li::before { content: "📁 "; }

/* Progress */
.progress {
  height: 14px; background: var(--line); border-radius: 999px; overflow: hidden; margin: 18px 0 8px;
}
.progress-fill {
  height: 100%; width: 0%; background: linear-gradient(90deg, var(--brand), #6366f1);
  border-radius: 999px; transition: width .2s ease;
}
.progress-detail { font-size: 14px; min-height: 20px; }

/* Checklist */
.checklist { list-style: none; padding: 0; margin: 20px 0 0; text-align: left; }
.checklist li {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; margin-bottom: 6px; border-radius: 10px;
  background: #f8fafc; border: 1px solid var(--line);
  font-size: 14px; color: var(--muted);
}
.checklist li em { color: #94a3b8; font-style: normal; margin-left: auto; font-size: 13px; }
.checklist .tick {
  flex: 0 0 auto; width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid var(--line); background: #fff;
  display: grid; place-items: center; font-size: 12px;
}
.checklist li.done { color: var(--ink); background: var(--ok-bg); border-color: #86efac; }
.checklist li.done .tick { border-color: var(--ok); background: var(--ok); color: #fff; }
.checklist li.done .tick::after { content: "✓"; }
.checklist li.active .tick { border-color: var(--brand); animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .4; } }

/* Success / error accents */
#panel-success h2 { color: var(--ok); }
#panel-error h2 { color: var(--err); }
#error-body {
  background: var(--err-bg); color: #991b1b; border: 1px solid #fca5a5;
  border-radius: 12px; padding: 12px 14px; font-size: 15px;
}

.foot { color: #94a3b8; font-size: 13px; text-align: center; }

@media (max-width: 480px) {
  .card { padding: 28px 20px 24px; }
  .head h1 { font-size: 22px; }
}
