/* =====================================================================
   Design tokens — teal brand palette (from example.html)
   ===================================================================== */
:root {
  /* Brand — teal */
  --brand:         #0d9488;
  --brand-dark:    #0f766e;
  --brand-hover:   #115e59;
  --brand-light:   #f0fdfa;
  --brand-muted:   #ccfbf1;
  --brand-glow:    rgba(13, 148, 136, 0.22);
  --accent:        #14b8a6;

  /* Status */
  --success:       #10b981;
  --success-dark:  #059669;
  --success-light: #d1fae5;
  --error:         #ef4444;
  --error-light:   #fef2f2;
  --warning:       #f59e0b;
  --warning-light: #fffbeb;
  --info:          #06b6d4;

  /* Surfaces */
  --bg:            #f0fdfa;
  --surface:       #ffffff;
  --surface-2:     #f5fffe;
  --surface-3:     #e6faf7;
  --border:        #b2e8e0;
  --border-subtle: #e0f7f3;
  --border-focus:  #0d9488;

  /* Text */
  --text:          #0f172a;
  --text-2:        #134e4a;
  --text-muted:    #5eada4;

  /* Dark surfaces (sidebar / header) */
  --dark-bg:       #020617;
  --dark-surface:  #0f172a;
  --dark-mid:      #1e3a5f;
  --dark-border:   rgba(13,148,136,0.3);
  --dark-text:     rgba(255,255,255,0.92);
  --dark-text-2:   rgba(153,246,228,0.85);
  --dark-text-3:   rgba(255,255,255,0.45);

  /* Shape */
  --radius:        14px;
  --radius-sm:     9px;
  --radius-xs:     6px;

  /* Elevation */
  --shadow:        0 1px 3px rgba(0,0,0,.04), 0 6px 18px rgba(13,148,136,.07);
  --shadow-lg:     0 4px 8px rgba(0,0,0,.05), 0 20px 56px rgba(13,148,136,.12);
  --shadow-brand:  0 4px 14px rgba(13, 148, 136, 0.32);

  /* Motion */
  --ease:          cubic-bezier(.4, 0, .2, 1);
  --transition:    0.16s cubic-bezier(.4, 0, .2, 1);
  --font:          'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --brand:         #14b8a6;
    --brand-dark:    #0d9488;
    --brand-hover:   #0f766e;
    --brand-light:   rgba(20, 184, 166, 0.13);
    --brand-muted:   rgba(20, 184, 166, 0.08);
    --brand-glow:    rgba(20, 184, 166, 0.22);
    --accent:        #2dd4bf;

    --success:       #34d399;
    --success-light: rgba(52, 211, 153, 0.12);
    --error:         #f87171;
    --error-light:   rgba(248, 113, 113, 0.12);
    --warning:       #fbbf24;
    --warning-light: rgba(251, 191, 36, 0.12);

    --bg:            #020617;
    --surface:       #0f172a;
    --surface-2:     #0a1a2e;
    --surface-3:     #020617;
    --border:        #1a3a4a;
    --border-subtle: #112233;
    --border-focus:  #14b8a6;

    --text:          #e0faf7;
    --text-2:        #99f6e4;
    --text-muted:    #3a7068;

    --dark-bg:       #000d1a;
    --dark-surface:  #0a1525;
    --dark-mid:      #0f1f3a;
    --dark-border:   rgba(20,184,166,0.25);
    --dark-text:     rgba(255,255,255,0.93);
    --dark-text-2:   rgba(153,246,228,0.8);
    --dark-text-3:   rgba(255,255,255,0.4);

    --shadow:        0 1px 3px rgba(0,0,0,.4), 0 6px 18px rgba(0,0,0,.5);
    --shadow-lg:     0 4px 8px rgba(0,0,0,.5), 0 20px 56px rgba(0,0,0,.65);
    --shadow-brand:  0 4px 14px rgba(20, 184, 166, 0.2);
  }
}

/* =====================================================================
   Reset & base
   ===================================================================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

body {
  font-family: var(--font);
  background-color: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.55;
}

/* =====================================================================
   Header
   ===================================================================== */
.header {
  background: linear-gradient(135deg, var(--dark-bg) 0%, var(--dark-surface) 50%, var(--dark-mid) 100%);
  border-bottom: 3px solid var(--brand);
  padding: 0 28px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--dark-text);
}

.header-logo {
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, var(--brand), var(--accent));
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: -0.5px;
  box-shadow: 0 2px 8px var(--brand-glow);
}

.header-name {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.4px;
  color: var(--dark-text);
}

.header-tagline {
  font-size: 11px;
  color: var(--dark-text-3);
  font-weight: 400;
  padding: 2px 9px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 99px;
  letter-spacing: 0.3px;
}

.header-user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.2);
}

.header-login {
  font-size: 13px;
  color: var(--dark-text-2);
  font-weight: 500;
}

.btn-ghost {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--radius-xs);
  padding: 5px 13px;
  font-size: 12px;
  color: var(--dark-text-2);
  cursor: pointer;
  font-family: var(--font);
  font-weight: 500;
  transition: var(--transition);
}
.btn-ghost:hover {
  border-color: var(--brand);
  color: var(--brand);
  background: rgba(13,148,136,0.12);
}

/* =====================================================================
   Main content
   ===================================================================== */
.main {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 36px 16px 80px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  width: 100%;
  max-width: 680px;
  overflow: hidden;
}

/* Wide card with two-panel layout */
.card-wide {
  max-width: 980px;
}

.card-body {
  display: flex;
  min-height: 460px;
}

/* =====================================================================
   Sidebar — dark panel with step description
   ===================================================================== */
.form-sidebar {
  width: 256px;
  flex-shrink: 0;
  padding: 32px 26px;
  background: linear-gradient(160deg, var(--dark-bg) 0%, var(--dark-surface) 55%, var(--dark-mid) 100%);
  border-right: 1px solid var(--dark-border);
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
  overflow: hidden;
}

/* Subtle decorative glow behind sidebar */
.form-sidebar::after {
  content: '';
  position: absolute;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(13,148,136,0.18) 0%, transparent 70%);
  bottom: -40px;
  right: -60px;
  pointer-events: none;
}

.sidebar-icon {
  font-size: 36px;
  line-height: 1;
  margin-bottom: 2px;
}

.sidebar-step-num {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--brand);
  margin-bottom: -6px;
}

.sidebar-title {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--dark-text);
  line-height: 1.25;
}

.sidebar-desc {
  font-size: 13px;
  color: var(--dark-text-2);
  line-height: 1.7;
}

.sidebar-divider {
  width: 40px;
  height: 2px;
  background: var(--brand);
  border-radius: 1px;
  opacity: 0.6;
}

.sidebar-tips {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-tips li {
  font-size: 12px;
  color: var(--dark-text-3);
  padding-left: 14px;
  position: relative;
  line-height: 1.5;
}

.sidebar-tips li::before {
  content: '›';
  position: absolute;
  left: 0;
  color: var(--brand);
  font-weight: 700;
}

/* =====================================================================
   Form content panel (right side)
   ===================================================================== */
.form-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* =====================================================================
   Login view
   ===================================================================== */
.login-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 40px 16px;
  position: relative;
  overflow: hidden;
}

.login-wrap::before,
.login-wrap::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  pointer-events: none;
  opacity: 0.4;
}
.login-wrap::before {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, #0d9488, #065f46);
  top: -140px;
  right: -100px;
}
.login-wrap::after {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, #06b6d4, #0d9488);
  bottom: -80px;
  left: -100px;
}

@media (prefers-color-scheme: dark) {
  .login-wrap::before { opacity: 0.2; }
  .login-wrap::after  { opacity: 0.15; }
}

.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid var(--brand);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 52px 44px;
  width: 100%;
  max-width: 420px;
  text-align: center;
  position: relative;
  z-index: 1;
}

.login-logo {
  width: 68px;
  height: 68px;
  background: linear-gradient(135deg, var(--brand-hover) 0%, var(--brand) 50%, var(--accent) 100%);
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 26px;
  letter-spacing: -1px;
  margin: 0 auto 24px;
  box-shadow: 0 8px 28px rgba(13, 148, 136, 0.4);
}

.login-title {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.8px;
  margin-bottom: 10px;
  color: var(--text);
}

.login-subtitle {
  font-size: 14px;
  color: var(--text-2);
  margin-bottom: 36px;
  line-height: 1.7;
  max-width: 300px;
  margin-left: auto;
  margin-right: auto;
}

.btn-github {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 13px 20px;
  background: linear-gradient(135deg, #1a1f2e, #0d1117);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: var(--transition);
  letter-spacing: -0.1px;
}
.btn-github:hover {
  background: linear-gradient(135deg, #0d1117, #020617);
  box-shadow: 0 4px 18px rgba(0,0,0,.35);
  transform: translateY(-1px);
}
.btn-github svg { flex-shrink: 0; }
.btn-github-loading { opacity: 0.65; cursor: not-allowed; transform: none !important; }

.login-error {
  margin-top: 16px;
  padding: 10px 14px;
  background: var(--error-light);
  border: 1px solid var(--error);
  border-radius: var(--radius-xs);
  font-size: 13px;
  color: var(--error);
  text-align: left;
  line-height: 1.5;
}

/* =====================================================================
   Step indicator
   ===================================================================== */
.steps-header {
  padding: 24px 32px 0;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 20px;
}

.steps-nav {
  display: flex;
  align-items: center;
  margin-bottom: 6px;
}

.step-item {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
}
.step-item:last-child { flex: 0; }

.step-dot {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
  transition: background var(--transition), border-color var(--transition), box-shadow var(--transition);
  border: 2px solid var(--border);
  background: var(--surface-2);
  color: var(--text-muted);
}
.step-dot.active {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
  box-shadow: 0 0 0 4px var(--brand-muted), var(--shadow-brand);
}
.step-dot.done {
  border-color: var(--success);
  background: var(--success);
  color: #fff;
}

.step-line {
  flex: 1;
  height: 2px;
  background: var(--border);
  border-radius: 1px;
  transition: background 0.35s var(--ease);
}
.step-line.done { background: var(--success); }

.steps-labels {
  display: flex;
  margin-top: 8px;
}
.step-label {
  font-size: 10.5px;
  color: var(--text-muted);
  font-weight: 500;
  flex: 1;
  text-align: center;
}
.step-label:first-child { text-align: left; }
.step-label:last-child  { text-align: right; }
.step-label.active { color: var(--brand); font-weight: 700; }
.step-label.done   { color: var(--success); }

/* =====================================================================
   Form sections
   ===================================================================== */
.form-body {
  padding: 28px 32px;
  flex: 1;
}

.form-section-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.4px;
  margin-bottom: 20px;
  color: var(--text);
}

.field { margin-bottom: 16px; }

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 6px;
}

.label-hint {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 400;
  margin-left: 4px;
}

input[type="text"],
input[type="password"],
select,
textarea {
  width: 100%;
  padding: 10px 13px;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-family: var(--font);
  color: var(--text);
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
  outline: none;
}
input[type="text"]:hover,
input[type="password"]:hover,
select:hover { border-color: var(--brand-dark); }
input:focus, select:focus, textarea:focus {
  border-color: var(--brand);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--brand-muted);
}
input.error, select.error { border-color: var(--error); }
input.error:focus { box-shadow: 0 0 0 3px var(--error-light); }

.field-error {
  font-size: 11.5px;
  color: var(--error);
  margin-top: 5px;
  font-weight: 500;
}

input[type="password"] { font-family: monospace; letter-spacing: 0.5px; }

/* =====================================================================
   Toggle (single/multi)
   ===================================================================== */
.radio-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 22px;
}

.radio-card { position: relative; cursor: pointer; }
.radio-card input { position: absolute; opacity: 0; pointer-events: none; }

.radio-card-inner {
  padding: 14px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
  background: var(--surface-2);
}
.radio-card:hover .radio-card-inner {
  border-color: var(--brand);
  background: var(--brand-light);
}
.radio-card input:checked + .radio-card-inner {
  border-color: var(--brand);
  background: var(--brand-light);
  box-shadow: 0 0 0 3px var(--brand-muted);
}

.radio-card-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  display: block;
  margin-bottom: 2px;
}
.radio-card-desc {
  font-size: 11.5px;
  color: var(--text-2);
  line-height: 1.4;
}

/* =====================================================================
   Account sections
   ===================================================================== */
.account-section {
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 18px;
  margin-bottom: 14px;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.account-section:hover { border-color: var(--brand-dark); }
.account-section.module-selected {
  border-color: var(--brand);
  background: var(--brand-light);
  box-shadow: 0 0 0 3px var(--brand-muted);
}

.account-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.account-section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 99px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}
.badge-blue  { background: var(--brand-muted); color: var(--brand-dark); }
.badge-gray  { background: transparent; color: var(--text-muted); border: 1px solid var(--border); }

.btn-remove {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 16px;
  line-height: 1;
  padding: 3px 6px;
  border-radius: var(--radius-xs);
  transition: var(--transition);
  font-family: var(--font);
}
.btn-remove:hover { color: var(--error); background: var(--error-light); }

.setup-mode-tabs {
  display: flex;
  gap: 3px;
  margin-bottom: 14px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 3px;
}
.tab-btn {
  flex: 1;
  padding: 6px;
  font-size: 12px;
  font-weight: 600;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  background: none;
  color: var(--text-2);
  font-family: var(--font);
  transition: var(--transition);
}
.tab-btn.active {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 1px 4px var(--brand-glow);
}

.trust-policy {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-top: 12px;
}
.trust-policy-label {
  font-size: 11px;
  color: var(--text-2);
  font-weight: 600;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.trust-policy pre {
  font-size: 10.5px;
  color: var(--text-2);
  white-space: pre-wrap;
  word-break: break-all;
  line-height: 1.55;
  overflow: auto;
  max-height: 200px;
}

.btn-copy {
  background: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 9px;
  font-size: 11px;
  cursor: pointer;
  color: var(--text-2);
  font-family: var(--font);
  font-weight: 500;
  transition: var(--transition);
}
.btn-copy:hover { color: var(--brand); border-color: var(--brand); background: var(--brand-light); }

/* =====================================================================
   Environment list
   ===================================================================== */
.env-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}
.env-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 13px;
  transition: border-color var(--transition);
}
.env-row:focus-within { border-color: var(--brand); }
.env-row input, .env-row select { padding: 5px 9px; font-size: 12.5px; }
.env-row input  { flex: 0 0 140px; }
.env-row select { flex: 1; }

/* =====================================================================
   Buttons
   ===================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 22px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: background var(--transition), box-shadow var(--transition), transform var(--transition), border-color var(--transition);
  border: none;
  text-decoration: none;
  letter-spacing: -0.1px;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
  color: #fff;
  box-shadow: 0 2px 8px var(--brand-glow);
}
.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--brand-dark) 0%, var(--brand-hover) 100%);
  box-shadow: 0 4px 16px var(--brand-glow);
  transform: translateY(-1px);
}
.btn-primary:active:not(:disabled) { transform: translateY(0); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-secondary {
  background: var(--surface);
  color: var(--text-2);
  border: 1.5px solid var(--border);
}
.btn-secondary:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-light); }

.btn-outline {
  background: none;
  color: var(--brand);
  border: 1.5px dashed var(--brand-dark);
  font-size: 13px;
  padding: 8px 16px;
  width: 100%;
}
.btn-outline:hover { background: var(--brand-light); border-style: solid; }

.btn-danger {
  background: linear-gradient(135deg, var(--error), #b91c1c);
  color: #fff;
}
.btn-danger:hover { box-shadow: 0 4px 14px rgba(239,68,68,.3); transform: translateY(-1px); }

/* =====================================================================
   Form footer
   ===================================================================== */
.form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px 22px;
  border-top: 1px solid var(--border-subtle);
  gap: 8px;
  background: var(--surface-2);
}
.form-footer-right {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* =====================================================================
   Review step
   ===================================================================== */
.review-section { margin-bottom: 22px; }
.review-section-title {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.review-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
}
.review-table td {
  padding: 9px 14px;
  border-bottom: 1px solid var(--border-subtle);
}
.review-table td:first-child {
  color: var(--text-2);
  width: 40%;
  font-weight: 500;
  background: var(--surface-2);
}
.review-table td:last-child {
  color: var(--text);
  font-family: 'Fira Code', 'SF Mono', monospace;
  font-size: 12px;
  word-break: break-all;
}
.review-table tr:last-child td { border-bottom: none; }

/* =====================================================================
   Processing view
   ===================================================================== */
.processing-wrap {
  padding: 56px 44px;
  text-align: center;
}
.processing-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.6px;
  margin-bottom: 8px;
}
.processing-subtitle {
  font-size: 14px;
  color: var(--text-2);
  margin-bottom: 44px;
  line-height: 1.6;
}
.processing-steps {
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
  max-width: 400px;
  margin: 0 auto;
}
.processing-step {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 16px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  transition: border-color 0.3s var(--ease), background 0.3s var(--ease);
}
.processing-step.running {
  border-color: var(--brand);
  background: var(--brand-light);
  box-shadow: 0 0 0 3px var(--brand-muted);
}
.processing-step.done {
  border-color: var(--success);
  background: var(--success-light);
}
.step-icon {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
  background: var(--border);
  color: var(--text-muted);
}
.processing-step.running .step-icon {
  background: var(--brand);
  color: #fff;
  animation: spin 1s linear infinite;
  box-shadow: 0 0 0 4px var(--brand-muted);
}
.processing-step.done .step-icon {
  background: var(--success);
  color: #fff;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.step-text { font-size: 13.5px; font-weight: 500; color: var(--text-2); }
.processing-step.running .step-text { color: var(--brand); font-weight: 600; }
.processing-step.done .step-text    { color: var(--success); }

/* =====================================================================
   Result view
   ===================================================================== */
.result-wrap { padding: 44px; }

.result-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
  background: linear-gradient(135deg, var(--success-light), rgba(16,185,129,0.06));
  border: 1.5px solid var(--success);
  border-radius: var(--radius-sm);
  margin-bottom: 32px;
  animation: fadeInUp 0.4s var(--ease);
}
.result-banner-icon { font-size: 36px; flex-shrink: 0; line-height: 1; }
.result-banner-title {
  font-size: 17px;
  font-weight: 800;
  color: var(--success);
  margin-bottom: 3px;
  letter-spacing: -0.3px;
}
.result-banner-sub { font-size: 13px; color: var(--text-2); }

.result-repo-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 15px 20px;
  background: var(--brand-light);
  border: 1.5px solid var(--brand);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--brand-dark);
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 28px;
  transition: background var(--transition), box-shadow var(--transition), transform var(--transition);
}
.result-repo-link:hover {
  background: var(--brand);
  color: #fff;
  box-shadow: var(--shadow-brand);
  transform: translateY(-1px);
}

.result-section { margin-bottom: 22px; }
.result-section-title {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.result-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
}
.result-table th {
  text-align: left;
  padding: 8px 14px;
  background: linear-gradient(135deg, var(--dark-surface), var(--dark-mid));
  border-bottom: 1px solid var(--dark-border);
  font-weight: 700;
  color: var(--dark-text-2);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}
.result-table td {
  padding: 9px 14px;
  border-bottom: 1px solid var(--border-subtle);
  font-family: 'Fira Code', 'SF Mono', monospace;
  color: var(--text);
}
.result-table tr:last-child td { border-bottom: none; }
.result-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; }

/* =====================================================================
   Error view
   ===================================================================== */
.error-wrap { padding: 56px 44px; text-align: center; }
.error-icon { font-size: 52px; margin-bottom: 16px; }
.error-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--error);
  margin-bottom: 14px;
  letter-spacing: -0.5px;
}
.error-message {
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: 32px;
  padding: 16px 18px;
  background: var(--error-light);
  border: 1.5px solid var(--error);
  border-radius: var(--radius-sm);
  text-align: left;
  line-height: 1.65;
  font-family: 'Fira Code', 'SF Mono', monospace;
  white-space: pre-wrap;
  word-break: break-word;
}
.error-actions { display: flex; gap: 10px; justify-content: center; }

/* =====================================================================
   Utilities
   ===================================================================== */
.hidden  { display: none !important; }
.text-muted { color: var(--text-2); font-size: 12px; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.divider { border: none; border-top: 1px solid var(--border); margin: 18px 0; }

.inline-link { color: var(--brand); text-decoration: none; font-weight: 600; }
.inline-link:hover { text-decoration: underline; }

.mono { font-family: 'Fira Code', 'SF Mono', monospace; font-size: 12px; }

.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

code {
  font-family: 'Fira Code', 'SF Mono', monospace;
  font-size: 12px;
  background: var(--brand-light);
  border: 1px solid var(--brand-muted);
  border-radius: 3px;
  padding: 1px 5px;
  color: var(--brand-dark);
}

/* =====================================================================
   Responsive
   ===================================================================== */
@media (max-width: 768px) {
  .card-body { flex-direction: column; }
  .form-sidebar {
    width: 100%;
    padding: 20px 24px;
    flex-direction: row;
    gap: 16px;
    align-items: flex-start;
  }
  .form-sidebar::after { display: none; }
  .sidebar-icon { font-size: 28px; margin-bottom: 0; flex-shrink: 0; }
  .sidebar-divider, .sidebar-tips { display: none; }
  .sidebar-desc { font-size: 12px; }
}

@media (max-width: 600px) {
  .main              { padding: 12px 8px 60px; }
  .form-body         { padding: 20px 18px; }
  .steps-header      { padding: 18px 18px 16px; }
  .form-footer       { padding: 12px 18px 18px; flex-wrap: wrap; }
  .result-wrap       { padding: 28px 20px; }
  .processing-wrap   { padding: 40px 24px; }
  .error-wrap        { padding: 40px 24px; }
  .login-card        { padding: 40px 24px; }
  .field-row         { grid-template-columns: 1fr; }
  .radio-group       { grid-template-columns: 1fr; }
  .result-actions    { flex-direction: column; }
  .card              { border-radius: var(--radius-sm); }
}
