:root {
  --bg-start: #0f172a;
  --bg-end: #1e1b4b;
  --card-bg: #ffffff;
  --text: #1e1b2e;
  --muted: #6b7280;
  --border: #e5e7eb;
  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --danger-bg: #fef2f2;
  --danger-text: #b91c1c;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: linear-gradient(135deg, var(--bg-start), var(--bg-end));
}

.card {
  width: 100%;
  max-width: 440px;
  background: var(--card-bg);
  border-radius: 20px;
  padding: 36px 32px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

h1 {
  margin: 0 0 4px;
  font-size: 26px;
  color: var(--text);
  text-align: center;
}

.subtitle {
  margin: 0 0 24px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

.platforms {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.platform {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 8px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: #fff;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.platform:hover { border-color: #c7c9d9; }

.platform.active {
  border-color: var(--accent);
  color: var(--accent);
  background: #eef2ff;
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
}
.dot.yt { background: #ef4444; }
.dot.fb { background: #2563eb; }
.dot.tt { background: #111827; }

.field { margin-bottom: 16px; }

.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.field input,
.field select {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  color: var(--text);
  background: #fff;
}

.field input:focus,
.field select:focus {
  outline: none;
  border-color: var(--accent);
}

.download-btn {
  width: 100%;
  padding: 13px;
  border: none;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease;
}

.download-btn:hover { background: var(--accent-hover); }
.download-btn:disabled {
  background: #a5a6f0;
  cursor: not-allowed;
}

.status { margin-top: 20px; }
.status.hidden { display: none; }

.progress-track {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: #eef0f4;
  overflow: hidden;
}

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

.status-text {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}

.error {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--danger-bg);
  color: var(--danger-text);
  font-size: 13px;
}
.error.hidden { display: none; }

.file-link {
  display: block;
  margin-top: 16px;
  padding: 13px;
  border-radius: 10px;
  background: #16a34a;
  color: #fff;
  text-align: center;
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
}
.file-link:hover { background: #15803d; }
.file-link.hidden { display: none; }

@media (prefers-color-scheme: dark) {
  :root {
    --card-bg: #17172b;
    --text: #f1f1f6;
    --muted: #9497ab;
    --border: #2c2c46;
    --danger-bg: #3a1414;
    --danger-text: #fca5a5;
  }
  .platform { background: #1f1f38; }
  .platform.active { background: #262650; }
  .field input, .field select { background: #1f1f38; color: var(--text); }
}
