:root {
  --bg: #f3efe7;
  --panel: rgba(255, 251, 245, 0.92);
  --text: #1e1a17;
  --muted: #63554c;
  --line: rgba(30, 26, 23, 0.12);
  --accent: #c85c2d;
  --accent-strong: #9d3d13;
  --ok: #2f6b3b;
  --ko: #8a3023;
  --shadow: 0 24px 70px rgba(75, 50, 28, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(200, 92, 45, 0.24), transparent 30%),
    radial-gradient(circle at bottom right, rgba(85, 124, 90, 0.18), transparent 28%),
    linear-gradient(145deg, #f5f1e8 0%, #efe5d4 100%);
}

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

.panel {
  width: min(100%, 720px);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 32px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.eyebrow {
  margin: 0 0 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--accent-strong);
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 3.6rem);
  line-height: 0.95;
}

.intro {
  margin: 16px 0 24px;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--muted);
}

.status-grid,
.mode-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.status-card,
.mode-option {
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.7);
}

.status-card {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.status-card span {
  color: var(--muted);
  font-size: 0.9rem;
}

.status-card.ok strong {
  color: var(--ok);
}

.status-card.ko strong {
  color: var(--ko);
}

.error {
  margin: 20px 0;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(138, 48, 35, 0.1);
  border: 1px solid rgba(138, 48, 35, 0.2);
  color: var(--ko);
}

.hidden {
  display: none;
}

.progress-modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 24px;
}

.progress-modal.hidden {
  display: none;
}

.progress-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 16, 12, 0.48);
  backdrop-filter: blur(6px);
}

.download-form {
  margin-top: 24px;
}

.download-form label {
  display: block;
  margin-bottom: 10px;
  font-weight: 700;
}

.download-form input[type="url"] {
  width: 100%;
  padding: 16px 18px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
  font: inherit;
}

.mode-grid {
  margin: 18px 0 24px;
}

.mode-option {
  position: relative;
  padding: 18px;
  cursor: pointer;
}

.mode-option input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.mode-option span {
  display: block;
  font-weight: 700;
}

.mode-option:has(input:checked) {
  border-color: rgba(200, 92, 45, 0.4);
  background: rgba(200, 92, 45, 0.08);
}

button {
  width: 100%;
  border: 0;
  border-radius: 16px;
  padding: 18px 22px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
  color: white;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease;
  box-shadow: 0 18px 30px rgba(157, 61, 19, 0.2);
}

button:hover {
  transform: translateY(-1px);
}

.progress-panel {
  position: relative;
  z-index: 1;
  width: min(100%, 560px);
  padding: 22px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: rgba(255, 250, 244, 0.96);
  box-shadow: 0 28px 80px rgba(22, 16, 11, 0.24);
}

.progress-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.progress-kicker {
  margin: 0 0 6px;
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-strong);
}

.progress-head h2 {
  margin: 0;
  font-size: 1.35rem;
}

.progress-value {
  font-size: 1.5rem;
  font-weight: 800;
}

.progress-track {
  width: 100%;
  height: 14px;
  margin-top: 18px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(30, 26, 23, 0.08);
}

.progress-bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #d7723d 0%, #a64017 100%);
  transition: width 220ms ease;
}

.progress-text {
  margin: 12px 0 0;
  color: var(--muted);
}

.download-link {
  display: inline-flex;
  margin-top: 18px;
  padding: 14px 18px;
  border-radius: 14px;
  text-decoration: none;
  font-weight: 800;
  color: white;
  background: linear-gradient(135deg, var(--ok) 0%, #1f4c29 100%);
}

.secondary-button {
  width: 100%;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--text);
  box-shadow: none;
}

@media (max-width: 640px) {
  .panel {
    padding: 24px;
    border-radius: 22px;
  }

  .status-grid,
  .mode-grid {
    grid-template-columns: 1fr;
  }
}
