:root {
  color-scheme: dark;
  --bg: #0e1014;
  --panel: rgba(23, 27, 35, 0.92);
  --panel-border: rgba(255, 255, 255, 0.08);
  --text: #f6f7fb;
  --muted: #aab2c5;
  --accent: #43d36b;
  --accent-strong: #2eb85a;
  --danger: #ff6b6b;
  --idle: #7d869c;
  --queued: #ffd166;
  --processing: #7cc6fe;
  --done: #43d36b;
  --failed: #ff7d7d;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top, rgba(67, 211, 107, 0.18), transparent 30%),
    linear-gradient(180deg, #0f131a 0%, #0a0d12 100%);
  color: var(--text);
}

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

.card {
  width: min(100%, 560px);
  padding: 28px;
  border-radius: 24px;
  border: 1px solid var(--panel-border);
  background: var(--panel);
  backdrop-filter: blur(16px);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.28);
}

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

h1 {
  margin: 0 0 10px;
  font-size: clamp(2rem, 5vw, 2.6rem);
  line-height: 1.05;
}

.description {
  margin: 0 0 24px;
  color: var(--muted);
  line-height: 1.55;
}

.upload-form {
  display: grid;
  gap: 16px;
}

.file-field {
  display: grid;
  gap: 10px;
  padding: 18px;
  border-radius: 18px;
  border: 1px dashed rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
}

.file-field input {
  width: 100%;
  color: var(--muted);
}

.selected-file {
  font-size: 0.95rem;
  color: var(--muted);
  min-height: 1.5em;
}

button {
  border: 0;
  border-radius: 16px;
  padding: 16px 18px;
  font-size: 1rem;
  font-weight: 600;
  color: #061109;
  background: var(--accent);
  cursor: pointer;
  transition: transform 120ms ease, background 120ms ease;
}

button:hover:enabled {
  transform: translateY(-1px);
  background: var(--accent-strong);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.status-panel,
.result-panel {
  margin-top: 22px;
  padding: 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.status-label {
  color: var(--muted);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 96px;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 700;
  text-transform: lowercase;
}

.status-idle { background: rgba(125, 134, 156, 0.18); color: var(--idle); }
.status-uploading,
.status-queued { background: rgba(255, 209, 102, 0.15); color: var(--queued); }
.status-processing { background: rgba(124, 198, 254, 0.15); color: var(--processing); }
.status-done { background: rgba(67, 211, 107, 0.16); color: var(--done); }
.status-failed { background: rgba(255, 125, 125, 0.15); color: var(--failed); }

.status-message,
.error-message {
  margin: 14px 0 0;
  line-height: 1.5;
}

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

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

.result-panel {
  display: grid;
  gap: 16px;
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.result-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 140px;
  padding: 12px 16px;
  border-radius: 14px;
  background: rgba(67, 211, 107, 0.16);
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
}

.result-link.secondary {
  background: rgba(255, 255, 255, 0.08);
}

.job-id-panel,
.qr-panel {
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.job-id-panel {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.job-id-label,
.qr-title {
  margin: 0 0 6px;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.job-id-value {
  margin: 0;
  font-family: ui-monospace, SFMono-Regular, SFMono-Regular, Menlo, monospace;
  font-size: 0.96rem;
  line-height: 1.45;
  word-break: break-all;
}

.job-id-actions {
  display: grid;
  justify-items: end;
  gap: 8px;
}

.secondary-button {
  min-width: 128px;
  padding: 12px 14px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
}

.secondary-button:hover:enabled {
  background: rgba(255, 255, 255, 0.14);
}

.copy-feedback {
  min-height: 1.2em;
  font-size: 0.84rem;
  color: var(--muted);
}

.qr-panel {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.qr-description {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.qr-code {
  display: grid;
  place-items: center;
  width: 144px;
  min-height: 144px;
  padding: 10px;
  border-radius: 18px;
  background: white;
}

.qr-code svg {
  width: 100%;
  height: auto;
}

.qr-code-error {
  font-size: 0.88rem;
  color: #111827;
  text-align: center;
  line-height: 1.4;
}

@media (max-width: 600px) {
  .card {
    padding: 22px;
    border-radius: 20px;
  }

  .job-id-panel,
  .qr-panel {
    grid-template-columns: 1fr;
  }

  .job-id-actions {
    justify-items: stretch;
  }

  .qr-code {
    width: 100%;
    max-width: 220px;
  }
}
