*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

[hidden] { display: none !important; }

:root {
  --bg:           #0a0f1a;
  --surface:      #111827;
  --border:       #1e2d40;
  --accent:       #00d4c8;
  --accent-glow:  rgba(0, 212, 200, 0.12);
  --text:         #e8eef4;
  --text-muted:   #6b7a8d;
  --error:        #ff4d6d;
  --dl-color:     #00d4c8;
  --ul-color:     #a78bfa;
}

html, body {
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.app {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  max-width: 480px;
  margin: 0 auto;
  padding: 0 20px 48px;
}

/* ── Header ─────────────────────────────────────────────── */

.header {
  text-align: center;
  padding: 44px 0 36px;
}

.logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 76px;
  height: 76px;
  border: 1.5px solid rgba(0, 212, 200, 0.2);
  border-radius: 50%;
  margin-bottom: 18px;
  background: radial-gradient(circle at 50% 60%, rgba(0, 212, 200, 0.07), transparent 70%);
}

.header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.subtitle {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 4px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ── Form fields ─────────────────────────────────────────── */

main { flex: 1; }

.field { margin-bottom: 20px; }

label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.select-wrap { position: relative; }

.select-wrap::after {
  content: '';
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid var(--text-muted);
  pointer-events: none;
}

select {
  width: 100%;
  padding: 14px 40px 14px 16px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  transition: border-color 0.15s;
  min-height: 52px;
}

select:focus {
  outline: none;
  border-color: var(--accent);
}

select option {
  background: #1a2332;
  color: var(--text);
}

/* ── Upload zone ─────────────────────────────────────────── */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.upload-zone {
  background: var(--surface);
  border: 1.5px dashed var(--border);
  border-radius: 12px;
  min-height: 168px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.15s;
  overflow: hidden;
  position: relative;
}

.upload-zone:hover {
  border-color: var(--accent);
}

.upload-prompt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: var(--text-muted);
  padding: 24px;
  pointer-events: none;
}

.upload-prompt span {
  font-size: 0.9375rem;
  font-weight: 500;
}

.upload-preview {
  width: 100%;
  max-height: 300px;
  object-fit: contain;
  display: block;
}

/* ── Submit button ───────────────────────────────────────── */

.btn-primary {
  display: block;
  width: 100%;
  padding: 16px;
  background: var(--accent);
  color: #08111e;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 700;
  font-family: inherit;
  letter-spacing: 0.03em;
  cursor: pointer;
  margin-top: 8px;
  transition: opacity 0.15s, transform 0.1s;
  min-height: 56px;
}

.btn-primary:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.btn-primary:not(:disabled):active {
  transform: scale(0.975);
}

/* ── State views ─────────────────────────────────────────── */

.state-view {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 340px;
  text-align: center;
  gap: 18px;
}

.state-label {
  color: var(--text-muted);
  font-size: 0.9375rem;
}

.state-view h2 {
  font-size: 1.375rem;
  font-weight: 700;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.status-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 700;
}

.status-icon--ok {
  background: rgba(0, 212, 200, 0.1);
  border: 2px solid var(--accent);
  color: var(--accent);
}

.status-icon--err {
  background: rgba(255, 77, 109, 0.1);
  border: 2px solid var(--error);
  color: var(--error);
}

.error-text {
  color: var(--error);
  font-size: 0.9375rem;
  max-width: 300px;
}

.state-view .btn-primary { max-width: 260px; }
