* { box-sizing: border-box; }

:root {
  --bg: #0b0e13;
  --surface: #12161d;
  --surface-2: #171c24;
  --border: #232a35;
  --text: #eef1ee;
  --text-dim: #9aa5a0;
  --navy: #1F3864;
  --teal: #2A9D8F;
  --amber: #e0a94a;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  overflow: hidden;
  padding: 4.5rem 1.5rem 5rem;
  text-align: center;
  border-bottom: 1px solid var(--border);
}
.hero-bg {
  position: absolute;
  inset: 0;
  background-image: url("/static/hero-background.jpg");
  background-size: cover;
  background-position: center 30%;
  opacity: 0.28;
}
.hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(11, 14, 19, 0.55) 0%, var(--bg) 92%);
}
.hero-content {
  position: relative;
  max-width: 640px;
  margin: 0 auto;
}
.eyebrow {
  display: inline-block;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--teal);
  font-weight: 700;
  margin-bottom: 1rem;
}
.hero h1 {
  margin: 0 0 0.9rem;
  font-size: clamp(1.6rem, 4vw, 2.15rem);
  font-weight: 700;
  letter-spacing: -0.01em;
}
.hero .subtitle {
  color: var(--text-dim);
  margin: 0;
  font-size: 1rem;
  max-width: 56ch;
  margin-inline: auto;
}

/* ---------- Layout ---------- */

.container {
  max-width: 560px;
  margin: 0 auto;
  padding: 0 1rem 4rem;
  margin-top: -2.5rem;
  position: relative;
}

/* ---------- Steps strip ---------- */

.steps-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}
@media (max-width: 640px) {
  .steps-strip { grid-template-columns: 1fr; }
}
.step {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem;
}
.step-num {
  flex-shrink: 0;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--navy), var(--teal));
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.step b { font-size: 0.85rem; display: block; margin-bottom: 0.15rem; }
.step p { margin: 0; font-size: 0.78rem; color: var(--text-dim); line-height: 1.35; }

/* ---------- Card ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
}
.hidden { display: none; }

.file-drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  border: 2px dashed var(--border);
  border-radius: 10px;
  padding: 2.25rem 1rem;
  margin-bottom: 1.25rem;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.file-drop:hover {
  border-color: var(--teal);
  background: rgba(42, 157, 143, 0.05);
}
.file-drop input[type="file"] { display: none; }
.file-drop-icon { color: var(--teal); margin-bottom: 0.3rem; }
#fileNameDisplay { color: var(--text); font-size: 0.92rem; font-weight: 600; }
.file-drop-hint { color: var(--text-dim); font-size: 0.78rem; }

button, .btn {
  display: block;
  width: 100%;
  padding: 0.85rem;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--navy), var(--teal));
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: filter 0.15s ease;
}
button:hover:not(:disabled), .btn:hover { filter: brightness(1.1); }
button:disabled { background: var(--border); color: var(--text-dim); cursor: not-allowed; filter: none; }
#resetBtn, #errorResetBtn { background: var(--surface-2); border: 1px solid var(--border); margin-top: 1rem; }

.progress-bar-track {
  width: 100%;
  height: 10px;
  background: var(--surface-2);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 0.75rem;
}
.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--navy), var(--teal));
  transition: width 0.2s ease;
}
#percentageText { font-weight: 700; margin: 0 0 0.25rem; }
#currentStep { color: var(--text-dim); margin: 0; font-size: 0.9rem; }

#statsList { list-style: none; padding: 0; margin: 0 0 1.5rem; color: #cdd6d1; font-size: 0.9rem; }
#statsList li { padding: 0.35rem 0; border-bottom: 1px solid var(--border); }
#errorMessage { color: #cdd6d1; margin-bottom: 0; }

.failed-records {
  margin-top: 1.5rem;
  padding: 1rem 1.1rem;
  background: rgba(224, 169, 74, 0.1);
  border: 1px solid rgba(224, 169, 74, 0.35);
  border-radius: 8px;
}
.failed-records h3 { margin: 0 0 0.6rem; font-size: 0.95rem; color: var(--amber); }
.failed-records ul { list-style: none; padding: 0; margin: 0; font-size: 0.85rem; color: #cdd6d1; }
.failed-records li { padding: 0.3rem 0; border-bottom: 1px solid rgba(224, 169, 74, 0.15); }
.failed-records li:last-child { border-bottom: none; }

footer {
  text-align: center;
  color: var(--text-dim);
  font-size: 0.78rem;
  padding: 0 1rem 3rem;
}
