:root {
  color-scheme: light;
  --blue: #2563eb;
  --blue-strong: #146eff;
  --navy: #0a1b3d;
  --ink: #111827;
  --muted: #64748b;
  --line: #dbe4f0;
  --surface: #ffffff;
  --bg: #f6f9ff;
  --green: #16a34a;
  --amber: #d97706;
  --shadow: 0 22px 70px rgba(15, 23, 42, 0.12);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(140deg, rgba(37, 99, 235, 0.12), transparent 36%),
    linear-gradient(320deg, rgba(22, 163, 74, 0.1), transparent 34%),
    var(--bg);
  color: var(--ink);
  word-break: keep-all;
}

button,
a {
  font: inherit;
}

.shell {
  width: min(1120px, calc(100% - 40px));
  min-height: 100vh;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.75fr);
  align-items: center;
  gap: 48px;
  padding: 48px 0;
}

.brand-row {
  display: inline-flex;
  align-items: center;
  margin-bottom: 54px;
}

.brand-wordmark {
  display: block;
  width: min(360px, 72vw);
  height: auto;
}

.eyebrow,
.panel-kicker {
  margin: 0 0 12px;
  color: var(--blue);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 760px;
  margin: 0;
  color: var(--navy);
  font-size: 64px;
  line-height: 1.08;
  letter-spacing: 0;
}

.subtitle {
  max-width: 590px;
  margin: 24px 0 32px;
  color: var(--muted);
  font-size: 19px;
  line-height: 1.7;
}

.status-strip {
  width: fit-content;
  max-width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--navy);
  font-weight: 700;
}

.pair-panel {
  width: 100%;
  padding: 28px;
  border: 1px solid rgba(219, 228, 240, 0.9);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.panel-header h2 {
  margin: 0;
  color: var(--navy);
  font-size: 30px;
  line-height: 1.15;
}

.ghost-button,
.code-row button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--blue);
  cursor: pointer;
  font-weight: 800;
}

.ghost-button {
  padding: 0 16px;
}

.qr-frame {
  width: min(100%, 310px);
  aspect-ratio: 1;
  margin: 0 auto 22px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  overflow: hidden;
}

.qr-frame svg {
  width: 86%;
  height: 86%;
  display: block;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid #e5edf8;
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

.code-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
}

#sessionCode {
  color: var(--navy);
  font-size: 30px;
  font-weight: 900;
  letter-spacing: 0;
}

.code-row button {
  padding: 0 14px;
}

.timeline {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 18px 0;
}

.step {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: white;
  font-weight: 800;
}

.step span {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #cbd5e1;
  flex: 0 0 auto;
}

.step p {
  margin: 0;
}

.step.active {
  border-color: rgba(37, 99, 235, 0.45);
  color: var(--blue);
  background: #f0f6ff;
}

.step.active span {
  background: var(--blue);
}

.step.done {
  border-color: rgba(22, 163, 74, 0.45);
  color: var(--green);
  background: #f0fdf4;
}

.step.done span {
  background: var(--green);
}

.result {
  display: grid;
  gap: 10px;
  margin-top: 16px;
  padding: 16px;
  border: 1px solid rgba(22, 163, 74, 0.35);
  border-radius: 8px;
  background: #f0fdf4;
}

.result p {
  margin: 0;
  color: var(--green);
  font-weight: 900;
}

.result a {
  display: inline-flex;
  justify-content: center;
  min-height: 48px;
  align-items: center;
  border-radius: 8px;
  background: var(--blue);
  color: white;
  text-decoration: none;
  font-weight: 900;
}

.expires {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

.fallback-page {
  display: grid;
  place-items: center;
  padding: 24px;
}

.fallback {
  width: min(520px, 100%);
  padding: 28px;
  border-radius: 8px;
  background: white;
  box-shadow: var(--shadow);
  text-align: center;
}

.fallback h1 {
  margin: 0 0 18px;
  color: var(--navy);
  font-size: 30px;
}

.fallback p {
  margin: 0 0 12px;
  color: var(--muted);
}

.fallback strong {
  display: block;
  margin-bottom: 18px;
  color: var(--blue);
  font-size: 38px;
}

.fallback a {
  color: var(--blue);
  font-weight: 800;
}

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

@media (max-width: 860px) {
  .shell {
    grid-template-columns: 1fr;
    align-items: start;
    gap: 28px;
    padding: 28px 0;
  }

  .brand-row {
    margin-bottom: 28px;
  }

  .hero h1 {
    font-size: 48px;
  }

  .subtitle {
    font-size: 17px;
  }
}

@media (max-width: 520px) {
  .shell {
    width: min(100% - 24px, 1120px);
  }

  .pair-panel {
    padding: 20px;
  }

  .panel-header,
  .code-row,
  .timeline {
    grid-template-columns: 1fr;
  }

  .panel-header {
    display: grid;
  }

  #sessionCode {
    font-size: 26px;
  }

  .hero h1 {
    font-size: 40px;
  }
}
