/* simplified compiler page */
:root {
  --bg: #0f1115;
  --panel: #161a20;
  --panel-2: #1c2129;
  --border: #262d36;
  --text: #e6edf3;
  --text-dim: #9aa4b2;
  --muted: #6b7280;
  --blue: #1f6feb;
  --blue-hi: #2f81f7;
  --orange: #d29922;
  --orange-hi: #e3ab33;
  --green: #2ea043;
  --red: #f85149;
  --mono: 'Consolas', 'Menlo', 'SF Mono', monospace;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--bg); color: var(--text);
  font: 14px/1.5 -apple-system, 'Segoe UI', Roboto, sans-serif;
  display: flex; flex-direction: column;
  min-height: 100vh;
}
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
a { text-decoration: none; }

/* ---------- animations ---------- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes logIn {
  from { opacity: 0; transform: translateX(-4px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes pulseGreen {
  0%, 100% { box-shadow: 0 0 0 0 rgba(46,160,67,0.5); }
  50%      { box-shadow: 0 0 0 4px rgba(46,160,67,0); }
}
@keyframes stepActivate {
  from { border-color: var(--border); }
  to   { border-color: rgba(47,129,247,0.35); }
}
@keyframes btnPop {
  0%   { transform: scale(1); }
  40%  { transform: scale(0.97); }
  100% { transform: scale(1); }
}
@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.step { animation: fadeUp 0.4s ease both; }
.step:nth-of-type(1) { animation-delay: 0.02s; }
.step:nth-of-type(2) { animation-delay: 0.06s; }
.step:nth-of-type(3) { animation-delay: 0.10s; }
.step:nth-of-type(4) { animation-delay: 0.14s; }
.step:not(.disabled) { animation: stepActivate 0.5s ease both; }
.terminal { animation: fadeUp 0.5s ease 0.20s both; }
.t-line { animation: logIn 0.28s ease both; }
.dot.green { animation: pulseGreen 1.8s ease-in-out infinite; }
.btn-primary:active:not(:disabled),
.btn-orange:active:not(:disabled),
.btn-ghost:active { animation: btnPop 0.22s ease; }
.account-row.show { animation: fadeUp 0.35s ease both; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- layout ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px; background: var(--panel);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.tb-left { display: flex; align-items: center; gap: 10px; }
.tb-icon { color: var(--blue-hi); font-size: 18px; }
.tb-title { font-size: 15px; font-weight: 600; }
.tb-right { display: flex; gap: 8px; }
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px; border-radius: 999px;
  background: var(--panel-2); border: 1px solid var(--border);
  font-size: 12px; color: var(--text-dim);
}
.pill.ok { color: var(--green); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot.red { background: var(--red); }
.dot.green { background: var(--green); }

.flow {
  flex: 1;
  max-width: 760px;
  margin: 0 auto;
  padding: 32px 24px 40px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.step {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 16px;
  padding: 20px 22px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: opacity 0.2s, border-color 0.2s;
}
.step.disabled { opacity: 0.45; pointer-events: none; }
.step:not(.disabled) { border-color: rgba(47,129,247,0.25); }

.step-num {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
  transition: background 0.25s, color 0.25s;
}
.step.disabled .step-num { background: var(--panel-2); color: var(--muted); }

.step-body { min-width: 0; }
.step-body h2 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 6px;
}
.step-body p {
  color: var(--text-dim);
  font-size: 13.5px;
  margin-bottom: 14px;
  line-height: 1.5;
}

.btn-primary {
  background: var(--blue);
  color: #fff;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  transition: background 0.15s, transform 0.12s;
}
.btn-primary:hover:not(:disabled) { background: var(--blue-hi); }
.btn-primary:disabled { background: var(--panel-2); color: var(--muted); cursor: not-allowed; }

.btn-orange {
  background: var(--orange);
  color: #1a1a1a;
  padding: 10px 18px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 14px;
  transition: background 0.15s, transform 0.12s;
}
.btn-orange:not(:disabled):hover { background: var(--orange-hi); }
.btn-orange:disabled { background: var(--panel-2); color: var(--muted); cursor: not-allowed; }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.btn-ghost:hover { background: var(--bg); border-color: var(--blue); color: var(--blue-hi); }
.btn-ghost.wide { width: 100%; }

.account-row {
  display: flex; align-items: center; gap: 10px;
  margin-top: 12px;
  padding: 10px 14px;
  background: var(--panel-2);
  border-radius: 8px;
  font-size: 13px;
}
.account-row.hidden { display: none; }
.mono { font-family: var(--mono); color: var(--text); }
.bal-inline { margin-left: auto; color: var(--green); font-family: var(--mono); font-size: 12.5px; }

.editor {
  width: 100%;
  min-height: 200px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--text);
  resize: vertical;
  outline: none;
  tab-size: 4;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.editor:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(31,111,235,0.15); }

.editor-foot {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
}
.editor-foot #lineStats { font-family: var(--mono); }

.status-box {
  margin-top: 12px;
  padding: 10px 14px;
  background: var(--bg);
  border: 1px dashed var(--border);
  border-radius: 8px;
  font-size: 12.5px;
  color: var(--text-dim);
  transition: border-color 0.25s, color 0.25s;
}

.terminal {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  margin-top: 8px;
}
.term-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--panel-2);
  font-size: 12.5px;
  color: var(--text-dim);
}
.term-head button { color: var(--text-dim); font-size: 12px; transition: color 0.15s; }
.term-head button:hover { color: var(--text); }
.term-body {
  padding: 12px 16px;
  max-height: 160px;
  overflow-y: auto;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.75;
}
.t-line { display: flex; gap: 8px; }
.t-ok { color: var(--green); }
.t-err { color: var(--red); }
.t-warn { color: var(--orange); }
.t-info { color: var(--blue-hi); }