/* Paradox - download gate
   Apple-style: restrained palette, large type, soft depth, deliberate motion. */

:root {
  --bg: #000000;
  --bg-elev: #0a0a0b;
  --panel: rgba(255, 255, 255, 0.055);
  --panel-border: rgba(255, 255, 255, 0.09);
  --panel-border-hover: rgba(255, 255, 255, 0.16);
  --ink: #f5f5f7;
  --ink-dim: #a1a1a6;
  --ink-faint: #6e6e73;
  --accent: #ffffff;
  --accent-ink: #000000;
  --danger: #ff6b6b;
  --success: #32d74b;
  --radius-lg: 22px;
  --radius-md: 14px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, "SF Pro Display", "SF Pro Text", "Inter", "Segoe UI", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* ---------- ambient background ---------- */

.glow {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 60% 40% at 50% 0%, rgba(255,255,255,0.09), transparent 60%),
    radial-gradient(ellipse 50% 35% at 85% 100%, rgba(255,255,255,0.04), transparent 65%),
    radial-gradient(ellipse 50% 35% at 10% 95%, rgba(255,255,255,0.03), transparent 65%);
}

.noise {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.035;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

/* ---------- topbar ---------- */

.topbar {
  position: relative;
  z-index: 2;
  width: 100%;
}

.topbar-inner {
  max-width: 980px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  width: 22px;
  height: 22px;
  object-fit: contain;
  filter: drop-shadow(0 0 10px rgba(255,255,255,0.25));
}

.brand-name {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.topbar-link {
  font-size: 13.5px;
  color: var(--ink-dim);
  text-decoration: none;
  transition: color 0.2s var(--ease);
}

.topbar-link:hover { color: var(--ink); }

/* ---------- stage ---------- */

.stage {
  position: relative;
  z-index: 2;
  min-height: calc(100vh - 68px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 20px 48px;
}

.panel {
  position: relative;
  width: 100%;
  max-width: 420px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
  padding: 44px 36px 36px;
  backdrop-filter: blur(28px) saturate(140%);
  -webkit-backdrop-filter: blur(28px) saturate(140%);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.06) inset,
    0 30px 60px -20px rgba(0,0,0,0.7);
  overflow: hidden;
  transition: border-color 0.3s var(--ease);
}

.panel:hover { border-color: var(--panel-border-hover); }

.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.step-key { display: none; }
.step-ready { display: none; }
.step.is-active { display: flex; }

.mark {
  width: 46px;
  height: 46px;
  object-fit: contain;
  margin-bottom: 20px;
  filter: drop-shadow(0 0 18px rgba(255,255,255,0.3));
}

h1 {
  margin: 0 0 10px;
  font-size: 25px;
  font-weight: 650;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.sub {
  margin: 0 0 28px;
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--ink-dim);
  max-width: 300px;
}

/* ---------- key form ---------- */

.key-form { width: 100%; }

.field {
  display: flex;
  align-items: stretch;
  gap: 8px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-md);
  padding: 5px 5px 5px 18px;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.field:focus-within {
  border-color: rgba(255,255,255,0.4);
  background: rgba(255,255,255,0.08);
  box-shadow: 0 0 0 4px rgba(255,255,255,0.06);
}

.field.is-error {
  border-color: rgba(255,107,107,0.6);
  animation: shake 0.42s var(--ease);
}

@keyframes shake {
  10%, 90% { transform: translateX(-1px); }
  20%, 80% { transform: translateX(2px); }
  30%, 50%, 70% { transform: translateX(-4px); }
  40%, 60% { transform: translateX(4px); }
}

#keyInput {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  color: var(--ink);
  font-family: "SF Mono", "JetBrains Mono", ui-monospace, Menlo, monospace;
  font-size: 15px;
  letter-spacing: 0.04em;
  padding: 12px 0;
}

#keyInput::placeholder {
  color: var(--ink-faint);
  letter-spacing: 0.04em;
}

/* ---------- buttons ---------- */

.btn {
  appearance: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
  transition: transform 0.15s var(--ease), background 0.2s var(--ease), opacity 0.2s var(--ease);
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  border-radius: 10px;
  padding: 12px 18px;
}

.btn-primary:hover { background: #e9e9ec; }
.btn-primary:active { transform: scale(0.97); }

.btn-primary:disabled {
  opacity: 0.55;
  cursor: default;
  transform: none;
}

.btn-spinner {
  display: none;
  animation: spin 0.8s linear infinite;
}

.btn-spinner circle {
  stroke: currentColor;
  stroke-dasharray: 46;
  stroke-dashoffset: 30;
  stroke-linecap: round;
}

.is-loading .btn-label { display: none; }
.is-loading .btn-spinner { display: block; }

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

.btn-download {
  width: 100%;
  padding: 14px 18px;
  font-size: 15px;
  margin-top: 4px;
}

/* ---------- status / feedback ---------- */

.status-msg {
  min-height: 18px;
  margin: 14px 0 0;
  font-size: 13px;
  color: var(--danger);
  opacity: 0;
  transform: translateY(-2px);
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
}

.status-msg.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.meta-links {
  margin-top: 22px;
  font-size: 13px;
  color: var(--ink-faint);
}

.meta-links a {
  color: var(--ink-dim);
  text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,0.15);
}

.meta-links a:hover { color: var(--ink); }

/* ---------- success state ---------- */

.check-ring {
  width: 52px;
  height: 52px;
  margin-bottom: 20px;
}

.check-ring-circle {
  stroke: rgba(50, 215, 75, 0.35);
}

.check-ring-tick {
  stroke: var(--success);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 36;
  stroke-dashoffset: 36;
  animation: tick 0.5s 0.15s var(--ease) forwards;
}

@keyframes tick {
  to { stroke-dashoffset: 0; }
}

.license-chip {
  font-family: "SF Mono", ui-monospace, Menlo, monospace;
  font-size: 12.5px;
  letter-spacing: 0.03em;
  color: var(--ink-faint);
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 999px;
  padding: 6px 14px;
  margin-bottom: 24px;
}

/* ---------- step transition ---------- */

.step {
  animation: rise 0.42s var(--ease);
}

@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- responsive ---------- */

@media (max-width: 480px) {
  .panel { padding: 36px 24px 28px; }
  h1 { font-size: 22px; }
}
