*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:       #0a0d12;
  --surface:  #111827;
  --surface2: #1a2233;
  --border:   #1e3a5f;
  --accent:   #38bdf8;
  --accent2:  #34d399;
  --green:    #34d399;
  --red:      #f87171;
  --text:     #e2eaf5;
  --muted:    #6b82a0;
  --radius:   14px;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}

/* ── Card ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 100%;
  max-width: 640px;
  overflow: hidden;
  box-shadow: 0 25px 60px rgba(0,0,0,.55);
}

/* ── Header ── */
.card-header {
  background: linear-gradient(135deg, #0a1628 0%, #0d2444 50%, #0a1628 100%);
  padding: 2rem 2rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  border-bottom: 1px solid var(--border);
}
.header-icon {
  width: 52px; height: 52px;
  background: rgba(56,189,248,.15);
  border: 1.5px solid rgba(56,189,248,.4);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}
.card-header h1 { font-size: 1.25rem; font-weight: 700; letter-spacing: -.02em; }
.card-header p  { font-size: .82rem; color: var(--muted); margin-top: .2rem; }

/* ── Barra de progreso ── */
.progress-wrap { padding: 1.5rem 2rem .5rem; }
.progress-labels {
  display: flex; justify-content: space-between;
  font-size: .75rem; color: var(--muted); margin-bottom: .5rem;
}
.progress-bar-bg {
  background: var(--surface2);
  border-radius: 999px;
  height: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.progress-bar-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  transition: width .6s cubic-bezier(.4,0,.2,1);
  box-shadow: 0 0 12px rgba(56,189,248,.45);
}

/* ── Pasos ── */
.steps { padding: 1rem 2rem 2rem; display: flex; flex-direction: column; gap: .75rem; }

.step {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 1.1rem;
  display: flex;
  align-items: center;
  gap: .9rem;
  transition: border-color .4s, background .4s;
}
.step.running { border-color: var(--accent); background: rgba(56,189,248,.07); }
.step.ok      { border-color: var(--green);  background: rgba(52,211,153,.07); }
.step.error   { border-color: var(--red);    background: rgba(248,113,113,.07); }

.step-icon {
  width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; flex-shrink: 0;
  background: var(--surface);
  border: 1.5px solid var(--border);
  transition: background .4s, border-color .4s;
}
.step.running .step-icon { border-color: var(--accent); background: rgba(56,189,248,.15); }
.step.ok      .step-icon { border-color: var(--green);  background: rgba(52,211,153,.15); }
.step.error   .step-icon { border-color: var(--red);    background: rgba(248,113,113,.15); }

.step-body  { flex: 1; min-width: 0; }
.step-label { font-size: .88rem; font-weight: 600; }
.step-msg   { font-size: .78rem; color: var(--muted); margin-top: .2rem; word-break: break-word; }
.step.ok    .step-msg { color: var(--green); }
.step.error .step-msg { color: var(--red); }

.step-badge {
  font-size: .68rem; font-weight: 700; letter-spacing: .06em;
  padding: .2rem .55rem; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--muted); text-transform: uppercase; flex-shrink: 0;
  transition: background .4s, color .4s, border-color .4s;
}
.step.running .step-badge { background: rgba(56,189,248,.15);  border-color: var(--accent); color: var(--accent); }
.step.ok      .step-badge { background: rgba(52,211,153,.12);  border-color: var(--green);  color: var(--green); }
.step.error   .step-badge { background: rgba(248,113,113,.12); border-color: var(--red);    color: var(--red); }

/* ── Spinner ── */
@keyframes spin { to { transform: rotate(360deg); } }
.spinner {
  width: 18px; height: 18px;
  border: 2.5px solid rgba(56,189,248,.25);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .75s linear infinite;
  display: inline-block;
}

/* ── Banner final ── */
#final {
  display: none;
  margin: 0 2rem 2rem;
  padding: 1rem 1.2rem;
  border-radius: 10px;
  font-size: .85rem;
  font-weight: 600;
  text-align: center;
  letter-spacing: .01em;
}
#final.all-ok    { background: rgba(52,211,153,.1);  border: 1px solid var(--green); color: var(--green); }
#final.has-error { background: rgba(248,113,113,.1); border: 1px solid var(--red);   color: var(--red); }

/* ── Footer ── */
.card-footer {
  border-top: 1px solid var(--border);
  padding: .9rem 2rem;
  font-size: .73rem;
  color: var(--muted);
  display: flex; align-items: center; gap: .4rem;
}
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: pulse 1.5s ease-in-out infinite; }
@keyframes pulse { 0%,100%{ opacity:.3 } 50%{ opacity:1 } }
.dot.done { background: var(--green); animation: none; opacity: 1; }
