:root {
  --bg-top: #f4eee5;
  --bg-bottom: #dbe8e0;
  --panel: rgba(255, 251, 246, 0.84);
  --panel-soft: rgba(255, 255, 255, 0.58);
  --ink: #1f2a2b;
  --muted: #5d6b6c;
  --accent: #c62525;
  --accent-strong: #8f1717;
  --accent-soft: rgba(198, 37, 37, 0.1);
  --border: rgba(31, 42, 43, 0.1);
  --danger: #b2412d;
  --success: #16613d;
  --shadow: 0 28px 72px rgba(24, 39, 37, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.76), transparent 34%),
    radial-gradient(circle at bottom right, rgba(198, 37, 37, 0.12), transparent 28%),
    linear-gradient(158deg, var(--bg-top), var(--bg-bottom));
}

.page {
  width: min(1140px, calc(100% - 32px));
  margin: 0 auto;
  padding: 56px 0 72px;
}

.hero {
  max-width: 700px;
  margin-bottom: 34px;
}

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

h1 {
  margin: 0;
  font-size: clamp(2.8rem, 5vw, 5rem);
  line-height: 0.92;
  letter-spacing: -0.03em;
}

.panel {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.9fr);
  gap: 26px;
  align-items: start;
}

.sidebar {
  display: flex;
  flex-direction: column;
  align-self: start;
}

.upload-form,
.status-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 28px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.upload-form {
  padding: 32px;
}

.field-group {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.field,
.picker {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.field span,
.picker span,
.selection strong,
.stats span {
  font-size: 0.92rem;
  font-weight: 700;
}

input,
textarea,
button {
  font: inherit;
}

input,
textarea {
  width: 100%;
  border: 1px solid rgba(31, 42, 43, 0.18);
  border-radius: 16px;
  padding: 15px 16px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

input:focus,
textarea:focus {
  outline: none;
  border-color: rgba(198, 37, 37, 0.45);
  box-shadow: 0 0 0 4px rgba(198, 37, 37, 0.09);
}

textarea {
  resize: vertical;
  min-height: 130px;
}

small {
  color: var(--muted);
}

.picker {
  position: relative;
  border: 1px dashed rgba(198, 37, 37, 0.32);
  border-radius: 24px;
  padding: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.48)),
    var(--accent-soft);
  overflow: hidden;
}

.picker::before {
  content: "";
  position: absolute;
  right: -40px;
  bottom: -70px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(198, 37, 37, 0.16), transparent 68%);
  pointer-events: none;
}

.picker-large strong {
  font-size: 1.35rem;
  line-height: 1.15;
}

.picker-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 10px;
  position: relative;
  z-index: 1;
}

.picker-button {
  box-shadow: none;
  padding: 13px 20px;
}

.picker-button:last-child {
  margin-left: auto;
}

.picker-button-secondary {
  background: rgba(255, 255, 255, 0.8);
  color: var(--accent-strong);
  border: 1px solid rgba(198, 37, 37, 0.18);
}

.picker-clear {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent-strong);
  box-shadow: none;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.selection-action {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  white-space: nowrap;
}

.picker-clear:hover {
  transform: none;
  box-shadow: none;
}

.selection {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 16px;
  padding: 18px;
  margin: 10px 0 28px;
  border-radius: 20px;
  background: rgba(198, 37, 37, 0.06);
  border: 1px solid rgba(198, 37, 37, 0.08);
}

.terms-box {
  margin: 14px 0 0;
  padding: 18px 20px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(31, 42, 43, 0.08);
}

.terms-box strong {
  display: block;
  margin-bottom: 10px;
  font-size: 0.98rem;
}

.terms-box p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.terms-box p + p {
  margin-top: 10px;
}

.terms-highlight {
  font-weight: 700;
  color: var(--ink);
}

.selection p,
.status-message,
.download-result {
  margin: 6px 0 0;
  color: var(--muted);
}

.actions {
  display: flex;
  justify-content: center;
}

.form-note {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

button {
  border: 0;
  border-radius: 999px;
  padding: 15px 28px;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #fff;
  cursor: pointer;
  transition: transform 160ms ease, opacity 160ms ease, box-shadow 160ms ease;
  box-shadow: 0 18px 36px rgba(143, 23, 23, 0.18);
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 22px 40px rgba(143, 23, 23, 0.22);
}

button:disabled {
  opacity: 0.6;
  cursor: wait;
}

.status-card {
  padding: 26px;
  position: sticky;
  top: 24px;
  border-radius: 28px;
}

.progress-meta,
.stats {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.progress-bar {
  width: 100%;
  height: 16px;
  margin: 18px 0;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(198, 37, 37, 0.12);
}

#progress-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-strong));
  transition: width 180ms ease;
}

.stats {
  margin-top: 18px;
}

.stats div {
  flex: 1;
  padding: 16px;
  border-radius: 18px;
  background: var(--panel-soft);
  border: 1px solid rgba(31, 42, 43, 0.06);
  text-align: center;
}

.stats strong {
  display: block;
  margin-top: 6px;
  font-size: 1.2rem;
  text-align: center;
}

.status-message.error {
  color: var(--danger);
}

.status-message.success {
  color: var(--success);
}

.download-result a {
  color: var(--accent-strong);
}

@media (max-width: 900px) {
  .panel,
  .field-group,
  .selection {
    grid-template-columns: 1fr;
  }

  .status-card {
    position: static;
    border-radius: 28px;
  }

  .terms-box {
    margin-top: 14px;
    border-radius: 20px;
  }
}
