:root {
  --bg: #0f1419;
  --surface: #1a2332;
  --border: #2d3a4d;
  --text: #e7ecf3;
  --muted: #9aa8bc;
  --accent: #0a66c2;
  --accent-hover: #0958ab;
  --success: #3ecf8e;
  --warn: #f5c451;
  --error: #ff6b6b;
  --info: #7db7ff;
}

* {
  box-sizing: border-box;
}

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

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
}

header h1 {
  margin: 0 0 0.25rem;
  font-size: 1.75rem;
}

.subtitle {
  margin: 0;
  color: var(--muted);
}

.warning {
  margin: 1.5rem 0;
  padding: 1rem;
  border: 1px solid #5c4a1f;
  background: #2a2315;
  border-radius: 8px;
  color: #f0dca8;
  font-size: 0.95rem;
}

form {
  display: grid;
  gap: 1rem;
}

label {
  display: grid;
  gap: 0.5rem;
  font-weight: 600;
}

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-weight: 500;
  color: var(--muted);
}

.checkbox-label input {
  margin-top: 0.2rem;
}

input[type="url"],
input[type="text"],
textarea {
  width: 100%;
  padding: 0.75rem 0.9rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

textarea {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.85rem;
  resize: vertical;
}

.drop-zone {
  border: 1px dashed var(--border);
  border-radius: 8px;
  padding: 1rem;
  text-align: center;
  background: #121a24;
}

.drop-zone.dragover {
  border-color: var(--accent);
  background: #152033;
}

button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1.1rem;
  border-radius: 8px;
  border: none;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}

button[type="submit"],
#download-btn {
  background: var(--accent);
  color: white;
}

button[type="submit"]:hover:not(:disabled),
#download-btn:hover {
  background: var(--accent-hover);
}

button.secondary {
  background: #243044;
  color: var(--text);
}

button.danger {
  background: #5c2323;
  color: #ffd7d7;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.hidden {
  display: none !important;
}

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

.progress-label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.progress-bar {
  height: 8px;
  background: var(--surface);
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #4f9cf9);
  transition: width 0.4s ease;
}

.logs-section {
  margin-top: 1.5rem;
}

.logs-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.logs-header h2 {
  margin: 0;
  font-size: 1.1rem;
}

.logs {
  height: 320px;
  overflow-y: auto;
  padding: 1rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #0b1017;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.82rem;
}

.log-line {
  margin-bottom: 0.35rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.log-line .ts {
  color: #6d7f99;
}

.log-line.info .msg { color: var(--info); }
.log-line.success .msg { color: var(--success); }
.log-line.warn .msg { color: var(--warn); }
.log-line.error .msg { color: var(--error); }
