:root {
  --bg: #0f1117;
  --card: #171a23;
  --border: #262b38;
  --text: #e7e9ee;
  --muted: #9aa3b2;
  --accent: #f6821f; /* Cloudflare orange */
  --accent-hover: #ff9433;
  --error: #ff6b6b;
  --radius: 12px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: radial-gradient(1200px 600px at 50% -10%, #1b2130, var(--bg));
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.card {
  width: 100%;
  max-width: 440px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

.brand {
  margin: 0;
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
  text-decoration: none;
  display: inline-block;
}

.tagline {
  margin: 0.25rem 0 1.5rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.dropzone {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: center;
  justify-content: center;
  min-height: 140px;
  padding: 1.25rem;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.dropzone:hover,
.dropzone:focus-visible,
.dropzone.dragging {
  border-color: var(--accent);
  background: rgba(246, 130, 31, 0.06);
  outline: none;
}

.dropzone-text {
  color: var(--muted);
  font-size: 0.95rem;
}

.dropzone-text u {
  color: var(--accent);
}

.input-label {
  display: block;
  margin-top: 1rem;
  color: var(--muted);
  font-size: 0.9rem;
  text-align: left;
}

.text-input {
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  font: inherit;
}

.limit-control {
  margin-top: 1rem;
  text-align: left;
}

.limit-heading,
.range-row {
  display: flex;
  align-items: center;
}

.limit-heading {
  justify-content: space-between;
  gap: 1rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.range-row {
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.range-row input {
  width: 100%;
  accent-color: var(--accent);
}

.range-row output {
  min-width: 7rem;
  color: var(--text);
  font-size: 0.85rem;
  text-align: right;
}

.selected {
  font-weight: 600;
  word-break: break-all;
}

.button {
  display: inline-block;
  width: 100%;
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border: none;
  border-radius: var(--radius);
  background: var(--accent);
  color: #1a1206;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, opacity 0.15s;
}

.button:hover:not(:disabled) {
  background: var(--accent-hover);
}

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

.turnstile-widget {
  margin-top: 1rem;
}

.button.secondary {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

.button.secondary:hover {
  border-color: var(--accent);
  background: rgba(246, 130, 31, 0.06);
}

.button.danger {
  background: var(--error);
  color: #230808;
}

.reset-dialog {
  width: min(100% - 2rem, 380px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--text);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}

.reset-dialog::backdrop {
  background: rgba(0, 0, 0, 0.65);
}

.reset-dialog h2 {
  margin: 0;
  font-size: 1.25rem;
}

.reset-dialog p {
  color: var(--muted);
  line-height: 1.45;
}

.dialog-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}

.dialog-actions .button {
  margin-top: 0;
}

.progress {
  margin-top: 1rem;
  height: 8px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
}

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

.error {
  margin: 1rem 0 0;
  color: var(--error);
  font-size: 0.9rem;
}

.success-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 1rem;
}

.link-row {
  display: flex;
  gap: 0.5rem;
}

.share-url {
  flex: 1;
  min-width: 0;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  font-size: 0.9rem;
}

.link-row .button {
  width: auto;
  margin-top: 0;
  white-space: nowrap;
}

.download-form .button {
  margin-top: 1rem;
}

.link-button {
  margin-top: 1rem;
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.9rem;
  text-decoration: underline;
}

/* Download landing page */
.filename {
  margin: 0.75rem 0 0.25rem;
  font-size: 1.35rem;
  word-break: break-all;
}

.meta {
  margin: 0 0 1.5rem;
  color: var(--muted);
}
