:root {
  --bg: #0b1120;
  --panel: #111c30;
  --panel-2: #16233b;
  --border: #243450;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --faint: #64748b;
  --accent: #38bdf8;
  --accent-2: #2563eb;
  --green: #22c55e;
  --amber: #f59e0b;
  --amber-bg: #3a2a07;
  --red: #ef4444;
  --radius: 12px;
  --mono: "SFMono-Regular", "JetBrains Mono", Consolas, "Courier New", monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: radial-gradient(1200px 600px at 70% -10%, #16233b 0%, var(--bg) 55%);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---------- Top bar ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 28px;
  border-bottom: 1px solid var(--border);
  background: rgba(11, 17, 32, 0.7);
  backdrop-filter: blur(6px);
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  font-size: 22px; color: var(--accent);
  text-shadow: 0 0 18px rgba(56, 189, 248, 0.6);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-size: 16px; letter-spacing: 0.3px; }
.brand-text span { font-size: 12px; color: var(--muted); }
.topbar-note { font-size: 12px; color: var(--faint); }

/* ---------- Shell ---------- */
.shell {
  width: 100%;
  max-width: 920px;
  margin: 28px auto;
  padding: 0 20px;
  flex: 1;
}

/* ---------- Progress ---------- */
.progress { margin-bottom: 22px; }
.progress ol {
  list-style: none; display: flex; gap: 6px; padding: 0; margin: 0 0 12px;
  flex-wrap: wrap;
}
.progress li {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--faint);
  padding: 6px 10px; border-radius: 999px; border: 1px solid transparent;
}
.progress li .dot {
  width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--panel-2); border: 1px solid var(--border);
  font-size: 12px; font-weight: 700; color: var(--muted);
}
.progress li.active { color: var(--text); border-color: var(--border); background: var(--panel); }
.progress li.active .dot { background: var(--accent-2); color: #fff; border-color: var(--accent-2); }
.progress li.done .dot { background: var(--green); color: #04210f; border-color: var(--green); }
.progress-track { height: 4px; background: var(--panel-2); border-radius: 999px; overflow: hidden; }
.progress-fill { height: 100%; width: 14%; background: linear-gradient(90deg, var(--accent-2), var(--accent)); transition: width .25s ease; }

/* ---------- Steps ---------- */
.step { display: none; animation: fade .25s ease; }
.step.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.step h2 { margin: 0 0 4px; font-size: 22px; }
.step-sub { margin: 0 0 20px; color: var(--muted); font-size: 14px; }

/* ---------- Fields ---------- */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid.hidden { display: none; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field.wide { grid-column: 1 / -1; }
.field > span { font-size: 13px; color: var(--text); font-weight: 600; }
.field > span em { color: var(--accent); font-style: normal; }
.field small { font-size: 12px; color: var(--faint); }
.field input, .field select {
  background: var(--panel); border: 1px solid var(--border); color: var(--text);
  border-radius: 9px; padding: 11px 12px; font-size: 14px; font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field select:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
}
.field input.invalid { border-color: var(--red); box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15); }
.field.toggle {
  flex-direction: row; align-items: center; justify-content: space-between;
  background: var(--panel); border: 1px solid var(--border); border-radius: 9px;
  padding: 12px 14px; margin-bottom: 16px;
}
.field.toggle > span { font-weight: 600; }
.field.toggle select { max-width: 160px; }
code { font-family: var(--mono); background: rgba(56,189,248,.1); color: var(--accent); padding: 1px 5px; border-radius: 4px; font-size: .9em; }

/* ---------- Advanced ---------- */
.advanced {
  margin-top: 18px; border: 1px dashed var(--border); border-radius: 10px; padding: 0 14px;
  background: rgba(22, 35, 59, 0.4);
}
.advanced.wide { grid-column: 1 / -1; }
.advanced summary {
  cursor: pointer; padding: 12px 0; font-size: 13px; color: var(--muted); font-weight: 600;
  user-select: none;
}
.advanced summary:hover { color: var(--text); }
.advanced[open] { padding-bottom: 16px; }

/* ---------- Callouts ---------- */
.callout {
  margin-top: 20px; padding: 14px 16px; border-radius: 10px;
  background: var(--panel); border: 1px solid var(--border); font-size: 13px; color: var(--muted);
}
.callout.warn { background: var(--amber-bg); border-color: #a16207; color: #fde68a; }
.callout strong { color: inherit; }
.callout pre { margin: 8px 0 0; }

/* ---------- Nav ---------- */
.nav { display: flex; align-items: center; gap: 12px; margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--border); }
.nav-spacer { flex: 1; }
.btn {
  background: var(--panel-2); color: var(--text); border: 1px solid var(--border);
  border-radius: 9px; padding: 11px 20px; font-size: 14px; font-weight: 600; cursor: pointer;
  transition: background .15s, border-color .15s, transform .05s;
}
.btn:hover { background: #1d2d49; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn.primary, #btn-next { background: var(--accent-2); border-color: var(--accent-2); color: #fff; }
.btn.primary:hover, #btn-next:hover { background: #1d4ed8; }
.btn.ghost { background: transparent; }
.btn.hidden { display: none; }

/* ---------- Tabs / output ---------- */
.tabs { display: flex; gap: 8px; margin-bottom: 14px; }
.tab {
  background: var(--panel); border: 1px solid var(--border); color: var(--muted);
  padding: 9px 16px; border-radius: 9px 9px 0 0; cursor: pointer; font-size: 13px; font-weight: 600;
}
.tab.active { color: var(--text); border-bottom-color: var(--accent-2); background: var(--panel-2); }
.tab .tag { font-size: 10px; background: var(--accent-2); color: #fff; padding: 1px 6px; border-radius: 6px; margin-left: 6px; }
.tab:not(.active) .tag { background: var(--border); color: var(--muted); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.panel-actions { display: flex; gap: 8px; justify-content: flex-end; margin-bottom: 8px; }
pre {
  background: #060b16; border: 1px solid var(--border); border-radius: 10px;
  padding: 16px; overflow: auto; max-height: 420px; margin: 0;
}
.code { font-family: var(--mono); font-size: 12.5px; line-height: 1.55; color: #cbd5e1; white-space: pre; }
.code.small { font-size: 12px; max-height: 200px; }
.run-hint { margin-top: 10px; font-size: 13px; color: var(--muted); }

/* ---------- Direct install ---------- */
.card-deploy {
  margin-top: 22px; padding: 20px; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--panel-2);
}
.card-deploy h3 { margin: 0 0 6px; font-size: 16px; }
.card-deploy h3 .tag {
  font-size: 10px; background: var(--green); color: #04210f;
  padding: 1px 7px; border-radius: 6px; margin-left: 6px; vertical-align: middle;
}
.deploy-state {
  font-size: 13px; font-weight: 600; align-self: center; padding: 4px 10px; border-radius: 8px;
}
.deploy-state.running { color: var(--accent); }
.deploy-state.ok { color: var(--green); }
.deploy-state.warn { color: var(--amber); }
.deploy-state.error { color: var(--red); }
.console {
  margin-top: 12px; font-family: var(--mono); font-size: 12px; line-height: 1.5;
  color: #cbd5e1; white-space: pre-wrap; word-break: break-word; max-height: 360px;
}
.result-frame {
  width: 100%; height: 520px; border: 1px solid var(--border);
  border-radius: 10px; background: #0f172a;
}
.hidden { display: none; }

/* ---------- Footer ---------- */
.footer {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 16px 28px; border-top: 1px solid var(--border); color: var(--faint); font-size: 12px;
}

/* ---------- Responsive ---------- */
@media (max-width: 680px) {
  .grid { grid-template-columns: 1fr; }
  .progress li .label { display: none; }
  .topbar-note { display: none; }
}
