:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #60a5fa;
  --secondary: #06b6d4;
  --green: #22c55e;
  --yellow: #fbbf24;
  --orange: #f97316;
  --red: #ef4444;
  --ink: #1e293b;
  --muted: #64748b;
  --line: #cbd5e1;
  --card: #fff;
  --bg: #f0f4ff;
  --shadow-sm: 0 2px 8px rgba(0,0,0,.06);
  --shadow: 0 4px 16px rgba(0,0,0,.08);
  --shadow-lg: 0 8px 24px rgba(0,0,0,.12);
  --radius: 20px;
  --radius-sm: 14px;
  --transition: all .3s ease;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Prompt', sans-serif;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 40%, #0ea5e9 100%);
  color: var(--ink);
  line-height: 1.7;
  min-height: 100vh;
}
a { text-decoration: none; color: inherit; }

/* ── Navbar ──────────────────────────────────────────────────────────── */
.navbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 32px;
  background: rgba(37,99,235,.95);
  backdrop-filter: blur(10px);
  position: sticky; top: 0; z-index: 1000;
  box-shadow: 0 4px 20px rgba(37,99,235,.35);
}
.logo { font-size: 1.2rem; font-weight: 800; color: #fff; }
.nav-links { display: flex; gap: 6px; flex-wrap: wrap; }
.nav-links a {
  color: rgba(255,255,255,.9); font-weight: 600;
  padding: 8px 16px; border-radius: 50px; font-size: .9rem;
  transition: .3s; border: 1px solid rgba(255,255,255,.25);
}
.nav-links a:hover { background: rgba(255,255,255,.2); }

/* ── Page header ─────────────────────────────────────────────────────── */
.page-header {
  padding: 50px 32px 60px; text-align: center; color: #fff;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
}
.page-header h1 {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 800; margin-bottom: 10px;
}
.page-header p { opacity: .92; font-size: 1.05rem; max-width: 700px; margin: 0 auto; }

.wrap { width: min(960px, 94vw); margin: 0 auto; padding: 30px 0 50px; }

/* ── Pipeline diagram ────────────────────────────────────────────────── */
.pipeline {
  display: flex; align-items: stretch; gap: 8px; flex-wrap: wrap;
  justify-content: center; margin: 10px 0 25px; padding: 18px;
  background: rgba(255,255,255,.12); backdrop-filter: blur(10px);
  border-radius: var(--radius); border: 1px solid rgba(255,255,255,.2);
}
.pipe-step {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; background: #fff; border-radius: var(--radius-sm);
  font-size: .88rem; color: var(--ink); box-shadow: var(--shadow-sm);
}
.pipe-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff; font-weight: 800; font-size: .9rem;
}
.pipe-step small { color: var(--muted); font-size: .76rem; }
.pipe-arrow { color: #fff; align-self: center; font-size: 1.5rem; font-weight: 700; }

/* ── Card ─────────────────────────────────────────────────────────────── */
.card {
  background: #fff; border-radius: var(--radius); padding: 28px;
  margin: 18px 0; box-shadow: var(--shadow); transition: .3s;
}
.card h2 {
  font-size: 1.3rem; font-weight: 700; color: var(--primary-dark);
  margin-bottom: 18px;
}

/* ── Form ─────────────────────────────────────────────────────────────── */
.field { display: block; margin-bottom: 18px; }
.field .label {
  display: block; font-size: .92rem; font-weight: 600;
  color: var(--ink); margin-bottom: 8px;
}
.field .label em { color: var(--red); font-style: normal; }
.field .label em.muted { color: var(--muted); font-weight: 400; }
.field input[type="url"],
.field input[type="text"],
.field select {
  width: 100%; padding: 12px 14px;
  border: 2px solid var(--line); border-radius: var(--radius-sm);
  font-family: inherit; font-size: .95rem; background: #fff;
  color: var(--ink); transition: .25s;
}
.field input[type="url"]:focus,
.field input[type="text"]:focus,
.field select:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.15);
}
.field input[type="range"] {
  width: 100%; accent-color: var(--primary); height: 8px;
}
.form-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 18px;
}
@media (max-width: 640px) {
  .form-row { grid-template-columns: 1fr; }
}

.submit-btn {
  display: block; width: 100%; padding: 16px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff; border: none; border-radius: var(--radius-sm);
  font-family: inherit; font-size: 1.05rem; font-weight: 700;
  cursor: pointer; transition: .3s;
  box-shadow: 0 4px 16px rgba(37,99,235,.35);
}
.submit-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(37,99,235,.45);
}
.submit-btn:disabled { opacity: .55; cursor: not-allowed; }

/* ── Status panel ────────────────────────────────────────────────────── */
.status-panel h2 { color: var(--primary); }
.progress-track {
  position: relative; height: 28px; background: #e2e8f0;
  border-radius: 50px; overflow: hidden; margin: 16px 0 10px;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary), var(--green));
  transition: width .4s ease; border-radius: 50px;
}
.progress-pct {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  font-weight: 700; color: var(--ink); font-size: .88rem;
  text-shadow: 0 1px 2px rgba(255,255,255,.7);
}
.status-message {
  font-size: .96rem; color: var(--ink);
  padding: 10px 14px; background: rgba(37,99,235,.05);
  border-radius: var(--radius-sm); margin: 12px 0;
}
.status-stages {
  display: flex; gap: 6px; flex-wrap: wrap; margin: 12px 0;
}
.stage {
  display: inline-block; padding: 5px 12px; border-radius: 50px;
  background: #e2e8f0; color: var(--muted); font-size: .78rem; font-weight: 600;
  transition: var(--transition);
}
.stage.active {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
}
.stage.done {
  background: var(--green); color: #fff;
}

.error-box {
  background: #fee2e2; border-left: 5px solid var(--red);
  border-radius: var(--radius-sm); padding: 16px 20px; margin-top: 14px;
}
.error-box strong { color: var(--red); display: block; margin-bottom: 6px; }
.error-box p { color: var(--ink); font-size: .9rem; white-space: pre-wrap; }

.result-box {
  background: linear-gradient(135deg, rgba(34,197,94,.08), rgba(6,182,212,.08));
  border: 2px dashed var(--green);
  border-radius: var(--radius-sm); padding: 20px; margin-top: 14px;
}
.result-box h3 { color: var(--green); font-size: 1.05rem; margin-bottom: 12px; }
.result-box ul { list-style: none; margin-bottom: 16px; }
.result-box li {
  padding: 6px 0; border-bottom: 1px solid var(--line); font-size: .92rem;
}
.result-box li:last-child { border-bottom: none; }
.result-box li strong { color: var(--primary-dark); }

.download-btn {
  display: inline-block; padding: 14px 28px;
  background: linear-gradient(135deg, var(--green), #0ea5e9);
  color: #fff; border-radius: 50px; font-weight: 700;
  font-size: 1rem; box-shadow: 0 4px 16px rgba(34,197,94,.35); transition: .3s;
}
.download-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(34,197,94,.45); }
.reset-btn {
  display: inline-block; margin-left: 10px; padding: 14px 22px;
  background: #fff; color: var(--ink); border: 2px solid var(--line);
  border-radius: 50px; font-family: inherit; font-weight: 600;
  font-size: .92rem; cursor: pointer; transition: .3s;
}
.reset-btn:hover { background: var(--bg); border-color: var(--primary); }

/* ── Feature list ─────────────────────────────────────────────────────── */
.feature-list {
  list-style: none;
}
.feature-list li {
  padding: 10px 0; padding-left: 28px; position: relative;
  border-bottom: 1px solid var(--line); font-size: .94rem;
}
.feature-list li::before {
  content: '✅'; position: absolute; left: 0; top: 10px;
}
.feature-list li:last-child { border-bottom: none; }
.feature-list strong { color: var(--primary-dark); }

/* ── Footer ───────────────────────────────────────────────────────────── */
footer {
  color: rgba(255,255,255,.7); padding: 30px 32px;
  text-align: center; margin-top: 40px; font-size: .9rem;
}
footer a { color: #fbbf24; font-weight: 600; }
footer p { margin: 4px 0; }

/* ── Utilities ────────────────────────────────────────────────────────── */
.hidden { display: none !important; }
.fade-up { opacity: 0; transform: translateY(20px); animation: fadeUp .6s ease forwards; }
.fade-up:nth-child(1) { animation-delay: 0s; }
.fade-up:nth-child(2) { animation-delay: .1s; }
.fade-up:nth-child(3) { animation-delay: .2s; }
.fade-up:nth-child(4) { animation-delay: .3s; }
@keyframes fadeUp {
  to { opacity: 1; transform: translateY(0); }
}

/* ── Responsive ──────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .navbar { flex-direction: column; gap: 12px; padding: 12px 18px; }
  .page-header { padding: 30px 18px 40px; }
  .page-header h1 { font-size: 1.5rem; }
  .pipeline { padding: 12px; gap: 4px; }
  .pipe-step { padding: 6px 10px; font-size: .8rem; }
  .pipe-arrow { font-size: 1.2rem; }
  .card { padding: 20px; }
}
