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

:root {
  --bg: #0a0a0f;
  --surface: #12121a;
  --surface-hover: #1a1a26;
  --border: #1e1e2e;
  --border-hover: #2a2a40;
  --text: #e2e2e8;
  --text-muted: #6b6b80;
  --accent: #6c63ff;
  --accent-glow: rgba(108, 99, 255, 0.15);
  --accent-dim: #4a43b0;
  --success: #34d399;
  --error: #f87171;
  --radius: 12px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.container {
  width: 100%;
  max-width: 560px;
  padding: 2rem 1.5rem;
}

header {
  text-align: center;
  margin-bottom: 2rem;
}

h1 {
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.accent {
  color: var(--accent);
}

.subtitle {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-top: 0.5rem;
}

.upload-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
}

.file-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.file-drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1.5rem 1rem;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.file-drop:hover,
.file-drop.dragover {
  border-color: var(--accent);
  background: var(--accent-glow);
}

.file-drop.has-file {
  border-color: var(--success);
  border-style: solid;
  background: rgba(52, 211, 153, 0.05);
}

.drop-icon {
  color: var(--text-muted);
  transition: color 0.2s;
}

.file-drop:hover .drop-icon,
.file-drop.dragover .drop-icon {
  color: var(--accent);
}

.file-drop.has-file .drop-icon {
  color: var(--success);
}

.drop-label {
  font-weight: 600;
  font-size: 0.875rem;
}

.drop-hint {
  color: var(--text-muted);
  font-size: 0.75rem;
  word-break: break-all;
}

button[type="submit"] {
  width: 100%;
  padding: 0.85rem;
  border: none;
  border-radius: var(--radius);
  background: var(--accent);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.2s;
}

button[type="submit"]:hover:not(:disabled) {
  background: var(--accent-dim);
  transform: translateY(-1px);
  box-shadow: 0 4px 20px var(--accent-glow);
}

button[type="submit"]:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

button[type="submit"]:active:not(:disabled) {
  transform: translateY(0);
}

/* Progress */
.progress-section {
  margin-top: 1.5rem;
}

.progress-stages {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.stage {
  opacity: 0.35;
  transition: opacity 0.3s;
}

.stage.active,
.stage.done {
  opacity: 1;
}

.stage-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
  font-size: 0.8rem;
}

.stage-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  flex-shrink: 0;
  transition: background 0.3s;
}

.stage.active .stage-dot {
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  animation: pulse 1.5s ease-in-out infinite;
}

.stage.done .stage-dot {
  background: var(--success);
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.stage-label {
  flex: 1;
  color: var(--text-muted);
}

.stage.active .stage-label,
.stage.done .stage-label {
  color: var(--text);
}

.stage-percent {
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  min-width: 3ch;
  text-align: right;
}

.progress-bar {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.3s ease;
}

.stage.done .progress-fill {
  background: var(--success);
}

.status-message {
  margin-top: 1rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  min-height: 1.2em;
}

.error-message {
  margin-top: 1.25rem;
  padding: 0.85rem 1rem;
  background: rgba(248, 113, 113, 0.08);
  border: 1px solid rgba(248, 113, 113, 0.2);
  border-radius: var(--radius);
  color: var(--error);
  font-size: 0.85rem;
  text-align: center;
}

footer {
  text-align: center;
  margin-top: 2rem;
  color: var(--text-muted);
  font-size: 0.75rem;
}

@media (max-width: 480px) {
  .file-inputs {
    grid-template-columns: 1fr;
  }
}
