:root {
  --bg: #0f1419;
  --card: #1a2332;
  --border: #2d3a4f;
  --text: #e8edf5;
  --muted: #8b9cb3;
  --accent: #fc3f1d;
  --accent-hover: #ff5c3d;
  --success: #22c55e;
  --error: #ef4444;
  --warning: #f59e0b;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: radial-gradient(ellipse at top, #1e2a3d 0%, var(--bg) 60%);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

.page {
  max-width: 720px;
  margin: 0 auto;
  padding: 48px 20px 32px;
}

.header {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-bottom: 32px;
}

.logo {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), #ff8a65);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 18px;
  color: #fff;
  flex-shrink: 0;
}

h1 {
  font-size: 1.5rem;
  font-weight: 700;
}

.subtitle {
  color: var(--muted);
  font-size: 0.95rem;
  margin-top: 4px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

.field-label {
  display: block;
  font-size: 0.875rem;
  color: var(--muted);
  margin-bottom: 8px;
}

#url-input {
  width: 100%;
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #111827;
  color: var(--text);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
}

#url-input:focus {
  border-color: var(--accent);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 16px;
  padding: 12px 24px;
  border: none;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s, transform 0.1s;
}

.btn:active {
  transform: scale(0.98);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  width: 100%;
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
}

.btn-success {
  background: var(--success);
  color: #fff;
  width: 100%;
}

.btn-success:hover {
  filter: brightness(1.08);
}

.status-panel {
  margin-top: 20px;
  padding: 16px;
  border-radius: 12px;
  background: #111827;
  border: 1px solid var(--border);
}

.status-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-idle {
  background: #374151;
  color: var(--muted);
}

.badge-running {
  background: rgba(245, 158, 11, 0.2);
  color: var(--warning);
}

.badge-completed {
  background: rgba(34, 197, 94, 0.2);
  color: var(--success);
}

.badge-error {
  background: rgba(239, 68, 68, 0.2);
  color: var(--error);
}

.status-count {
  font-size: 0.875rem;
  color: var(--muted);
}

.status-message {
  font-size: 0.95rem;
  color: var(--text);
  min-height: 1.5em;
}

.status-error {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(239, 68, 68, 0.12);
  color: #fca5a5;
  font-size: 0.875rem;
  word-break: break-word;
}

.progress-bar {
  margin-top: 14px;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), #ff8a65);
  border-radius: 2px;
  transition: width 0.4s ease;
}

.progress-fill.indeterminate {
  width: 40%;
  animation: indeterminate 1.4s ease-in-out infinite;
}

@keyframes indeterminate {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(350%); }
}

.download-section {
  margin-top: 16px;
}

.download-section .btn {
  width: 100%;
  margin-top: 0;
}

.hidden {
  display: none !important;
}


.footer {
  margin-top: 24px;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
}
