:root {
  color-scheme: dark;
  --bg: #080a0f;
  --surface: #11151d;
  --line: #293141;
  --text: #f7f8fa;
  --muted: #9ca6b8;
  --accent: #ff3b4f;
  --accent-hover: #ff6170;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 15% 10%, rgba(255, 59, 79, .16), transparent 32rem),
    var(--bg);
  color: var(--text);
  font: 16px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

.shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.card {
  width: min(100%, 620px);
  padding: clamp(28px, 6vw, 52px);
  background: rgba(17, 21, 29, .94);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, .42);
}

.mark {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  background: var(--accent);
  font-size: 28px;
  font-weight: 800;
  box-shadow: 0 10px 30px rgba(255, 59, 79, .3);
}

.eyebrow {
  margin: 26px 0 6px;
  color: var(--accent-hover);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .15em;
}

h1 { margin: 0; font-size: clamp(2rem, 7vw, 3.4rem); line-height: 1.05; letter-spacing: -.045em; }
.intro { margin: 14px 0 32px; color: var(--muted); }
label { display: block; margin-bottom: 8px; font-weight: 700; }

input[type="url"], select {
  width: 100%;
  min-height: 52px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #0b0e14;
  color: var(--text);
  font: inherit;
  outline: none;
}

input:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255, 59, 79, .16); }
.options { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: end; margin: 20px 0; }
.check { min-height: 52px; display: flex; align-items: center; gap: 10px; margin: 0; color: var(--muted); }
.check input { width: 20px; height: 20px; accent-color: var(--accent); }
.ssl-option { margin: -4px 0 20px; min-height: auto; }
.ssl-option small { color: #737f92; font-size: .8rem; }

button, .download-link {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  border: 0;
  border-radius: 12px;
  background: var(--accent);
  color: white;
  font: 800 1rem/1 inherit;
  text-decoration: none;
  cursor: pointer;
  transition: transform .15s ease, background .15s ease;
}

button:hover, .download-link:hover { background: var(--accent-hover); transform: translateY(-1px); }
button:disabled { opacity: .55; cursor: wait; transform: none; }
.download-link[aria-disabled="true"] {
  opacity: .4;
  pointer-events: none;
  cursor: not-allowed;
  transform: none;
  background: #596171;
}
.status { margin-top: 24px; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: #0b0e14; }
.status-row { display: flex; justify-content: space-between; gap: 16px; color: var(--muted); }
.status-message { margin: 0; color: #b8c4d8; overflow-wrap: anywhere; }
.progress { position: relative; height: 8px; margin-top: 12px; overflow: hidden; border-radius: 999px; background: #252c38; }
#progress-bar { width: 0; height: 100%; background: var(--accent); transition: width .3s ease; }
.progress-meta { display: flex; justify-content: space-between; gap: 16px; margin-top: 7px; color: var(--muted); font-size: .875rem; font-variant-numeric: tabular-nums; }
#progress-label { color: var(--text); font-weight: 700; }
.progress.is-processing::after { content: ""; position: absolute; inset: 0; width: 38%; background: linear-gradient(90deg, transparent, rgba(255,255,255,.55), transparent); animation: processing-sheen 1.35s linear infinite; }
.background-badge { display: flex; align-items: center; gap: 8px; margin: 11px 0 0; color: #86efac; font-size: .875rem; font-weight: 700; }
.background-badge[hidden] { display: none; }
.background-badge span { width: 8px; height: 8px; border-radius: 50%; background: #4ade80; animation: status-blink 1.2s ease-in-out infinite; }
@keyframes processing-sheen { from { transform: translateX(-110%); } to { transform: translateX(300%); } }
@keyframes status-blink { 50% { opacity: .3; } }
.activity { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.activity-title { display: flex; align-items: center; gap: 9px; margin: 0 0 10px; color: var(--muted); font-size: .875rem; font-weight: 700; }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 0 0 rgba(74, 222, 128, .55); animation: pulse 1.6s infinite; }
#activity-log { max-height: 160px; margin: 0; padding: 0; overflow-y: auto; list-style: none; }
#activity-log li { display: grid; grid-template-columns: 66px 1fr; gap: 9px; padding: 5px 0; color: #c8cfda; font-size: .875rem; }
#activity-log time { color: #737f92; font-variant-numeric: tabular-nums; }
#activity-log .activity-success { color: #86efac; }
#activity-log .activity-error { color: #fda4af; }
@keyframes pulse { 70% { box-shadow: 0 0 0 7px rgba(74, 222, 128, 0); } 100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); } }
.download-link { margin-top: 16px; }
.download-transfer { margin-top: 14px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: #111722; }
.note { margin: 24px 0 0; color: var(--muted); font-size: .875rem; text-align: center; }

@media (max-width: 560px) {
  .shell { padding: 12px; }
  .card { border-radius: 18px; }
  .options { grid-template-columns: 1fr; }
}
