:root {
  --canvas: #050914;
  --canvas-soft: #0a1121;
  --surface: rgba(15, 24, 43, 0.92);
  --surface-strong: #111d33;
  --surface-soft: rgba(255, 255, 255, 0.045);
  --gold: #f7b500;
  --amber: #f59e0b;
  --text: #f8fafc;
  --muted: #a8b4c9;
  --line: rgba(255, 255, 255, 0.11);
  --success: #3ddc97;
  --warning: #ffd36a;
  --danger: #ff7b86;
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.45);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 14px;
}
* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--canvas);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 15% 0%, rgba(247, 181, 0, 0.12), transparent 34rem),
    radial-gradient(circle at 100% 70%, rgba(22, 121, 160, 0.13), transparent 32rem),
    linear-gradient(180deg, #040711 0%, #08101e 52%, #050914 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
  overflow-x: hidden;
}

button,
select,
a {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

[hidden] {
  display: none !important;
}

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

.ambient {
  position: fixed;
  z-index: -1;
  border-radius: 999px;
  filter: blur(80px);
  pointer-events: none;
}

.ambient-one {
  width: 18rem;
  height: 18rem;
  top: -10rem;
  left: -6rem;
  background: rgba(247, 181, 0, 0.12);
}

.ambient-two {
  width: 22rem;
  height: 22rem;
  right: -14rem;
  bottom: 2rem;
  background: rgba(21, 118, 163, 0.12);
}

.site-header {
  width: min(100% - 2rem, 38rem);
  margin: 0 auto;
  padding: max(0.75rem, env(safe-area-inset-top)) 0 0.55rem;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: clamp(0.35rem, 2vw, 0.75rem);
}

.brand {
  position: relative;
  flex: 0 1 clamp(7.25rem, 35vw, 10rem);
  display: inline-flex;
  width: clamp(7.25rem, 35vw, 10rem);
  min-width: 0;
  align-items: center;
  overflow: hidden;
  border-radius: 8px;
}

.brand img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 6px;
}

.brand::after {
  content: "";
  position: absolute;
  inset: -80% -35%;
  background: linear-gradient(105deg, transparent 38%, rgba(255, 255, 255, 0.46) 49%, transparent 60%);
  transform: translateX(-75%) rotate(4deg);
  animation: logo-shine 5.8s ease-in-out infinite;
  pointer-events: none;
  mix-blend-mode: screen;
}

.language-picker {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(0.18rem, 1vw, 0.35rem);
}

.language-option {
  display: inline-grid;
  width: clamp(2rem, 10vw, 2.5rem);
  height: clamp(2rem, 10vw, 2.5rem);
  padding: 0;
  place-items: center;
  color: var(--muted);
  background: rgba(15, 24, 43, 0.78);
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 160ms ease, color 160ms ease, background 160ms ease, border-color 160ms ease;
}

.language-option:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-1px);
}

.language-option.is-active {
  color: var(--gold);
  background: rgba(247, 181, 0, 0.1);
  border-color: rgba(247, 181, 0, 0.42);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), 0 8px 22px rgba(0, 0, 0, 0.18);
}

.language-flag {
  font-size: clamp(1rem, 4.4vw, 1.25rem);
  line-height: 1;
}

.language-code {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.shell {
  width: min(100% - 2rem, 38rem);
  margin: 0 auto;
  padding: 0.25rem 0 max(2rem, env(safe-area-inset-bottom));
}

.main-card {
  position: relative;
  padding: clamp(1.4rem, 5vw, 2.35rem);
  overflow: hidden;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.055), transparent 34%),
    var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.main-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: 0.9;
}

.eyebrow {
  display: inline-flex;
  margin-bottom: 1rem;
  color: var(--gold);
  font-size: 0.75rem;
  font-weight: 850;
  letter-spacing: 0.14em;
}

h1 {
  margin: 0;
  max-width: 15ch;
  font-size: clamp(2rem, 8vw, 3.2rem);
  line-height: 1.04;
  letter-spacing: -0.045em;
}

.lead {
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 3.5vw, 1.12rem);
}

.steps {
  display: grid;
  gap: 0.7rem;
  margin: 1.6rem 0;
  padding: 0;
  list-style: none;
}

.steps li {
  display: grid;
  grid-template-columns: 2.45rem 1fr;
  gap: 0.85rem;
  align-items: center;
  padding: 0.8rem;
  background: var(--surface-soft);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--radius-md);
}

.step-number {
  display: grid;
  width: 2.45rem;
  height: 2.45rem;
  place-items: center;
  color: #111827;
  background: linear-gradient(135deg, var(--gold), #ffdb70);
  border-radius: 12px;
  font-weight: 900;
}

.steps strong,
.steps span {
  display: block;
}

.steps strong {
  font-size: 0.96rem;
}

.steps li div span {
  margin-top: 0.12rem;
  color: var(--muted);
  font-size: 0.86rem;
}

.button {
  display: inline-flex;
  min-height: 3.2rem;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.8rem 1rem;
  color: var(--text);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  font-weight: 800;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.button:active {
  transform: translateY(1px) scale(0.99);
}

.button:focus-visible,
.qr-frame:focus-visible,
.text-button:focus-visible,
.dialog-close:focus-visible,
.language-option:focus-visible {
  outline: 3px solid rgba(247, 181, 0, 0.38);
  outline-offset: 3px;
}

.button[disabled] {
  cursor: wait;
  opacity: 0.68;
}

.button-primary {
  color: #111827;
  background: linear-gradient(135deg, var(--gold), #ffd769);
  box-shadow: 0 13px 30px rgba(247, 181, 0, 0.18);
}

.button-secondary {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--line);
}

.button-large {
  width: 100%;
  min-height: 3.75rem;
  font-size: 1.02rem;
}

.button-arrow {
  font-size: 1.35rem;
}

.privacy-note {
  display: flex;
  gap: 0.55rem;
  align-items: flex-start;
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.privacy-dot {
  flex: 0 0 auto;
  width: 0.48rem;
  height: 0.48rem;
  margin-top: 0.35rem;
  background: var(--success);
  border-radius: 999px;
  box-shadow: 0 0 0 4px rgba(61, 220, 151, 0.1);
}

.status-pill {
  display: inline-flex;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 1rem;
  padding: 0.45rem 0.7rem;
  color: var(--warning);
  background: rgba(247, 181, 0, 0.09);
  border: 1px solid rgba(247, 181, 0, 0.22);
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.status-light {
  width: 0.5rem;
  height: 0.5rem;
  background: var(--warning);
  border-radius: 999px;
  box-shadow: 0 0 0 5px rgba(255, 211, 106, 0.09);
}

.issued-card h1 {
  max-width: 18ch;
  font-size: clamp(1.85rem, 7vw, 2.7rem);
}

.issued-lead {
  margin-bottom: 1.2rem;
}

.qr-frame {
  display: block;
  width: 100%;
  padding: 0.85rem;
  color: #111827;
  background: #ffffff;
  border: 0;
  border-radius: 20px;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.28);
  cursor: zoom-in;
}

.qr-frame img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
}

.expand-label {
  display: block;
  margin: 0.35rem 0 0.15rem;
  color: #4b5563;
  font-size: 0.74rem;
  font-weight: 750;
}

.action-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
  margin-top: 0.9rem;
}

.activation-card {
  display: grid;
  grid-template-columns: 2.35rem 1fr;
  gap: 0.8rem;
  margin-top: 1rem;
  padding: 1rem;
  background: rgba(247, 181, 0, 0.08);
  border: 1px solid rgba(247, 181, 0, 0.2);
  border-radius: var(--radius-lg);
}

.activation-number {
  display: grid;
  width: 2.35rem;
  height: 2.35rem;
  place-items: center;
  color: #111827;
  background: var(--warning);
  border-radius: 12px;
  font-size: 1.25rem;
  font-weight: 950;
}

.activation-card strong {
  color: var(--warning);
}

.activation-card p {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.security-note {
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: 0.8rem;
  text-align: center;
}

.replacement-panel {
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.8rem;
}

.replacement-panel summary {
  cursor: pointer;
  font-weight: 750;
}

.replacement-panel p {
  margin: 0.65rem 0;
}

.text-button {
  padding: 0;
  color: var(--warning);
  background: none;
  border: 0;
  font-weight: 800;
  cursor: pointer;
}

.loading-card {
  min-height: 22rem;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 1rem;
  color: var(--muted);
  text-align: center;
}

.loading-mark {
  width: 3.2rem;
  height: 3.2rem;
  border: 4px solid rgba(255, 255, 255, 0.11);
  border-top-color: var(--gold);
  border-radius: 999px;
  animation: spin 800ms linear infinite;
}

.error-card {
  min-height: 23rem;
  display: grid;
  place-content: center;
  justify-items: center;
  text-align: center;
}

.error-card h1 {
  margin-top: 1rem;
  font-size: 2rem;
}

.error-card p {
  max-width: 30ch;
  color: var(--muted);
}

.error-symbol {
  display: grid;
  width: 3.5rem;
  height: 3.5rem;
  place-items: center;
  color: #1f2937;
  background: var(--danger);
  border-radius: 999px;
  font-size: 1.5rem;
  font-weight: 950;
}

.site-footer {
  width: min(100% - 2rem, 38rem);
  margin: 0 auto;
  padding: 1.2rem 0 max(1.5rem, env(safe-area-inset-bottom));
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem;
  color: #7f8ba0;
  font-size: 0.72rem;
  text-align: center;
}

.qr-dialog {
  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: max(1rem, env(safe-area-inset-top)) 1rem max(1rem, env(safe-area-inset-bottom));
  color: var(--text);
  background: var(--canvas);
  border: 0;
}

.qr-dialog::backdrop {
  background: rgba(0, 0, 0, 0.9);
}

.dialog-inner {
  position: relative;
  width: min(100%, 34rem);
  min-height: 100%;
  margin: 0 auto;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 1rem;
}

.dialog-inner img {
  display: block;
  width: min(100%, 31rem);
  height: auto;
  padding: 0.7rem;
  background: #ffffff;
  border-radius: 18px;
}

.dialog-inner p {
  margin: 0;
  color: var(--muted);
  text-align: center;
}

.dialog-close {
  position: absolute;
  top: 0;
  right: 0;
  display: grid;
  width: 3rem;
  height: 3rem;
  place-items: center;
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 1.8rem;
  cursor: pointer;
}

.toast {
  position: fixed;
  z-index: 20;
  right: 1rem;
  bottom: max(1rem, env(safe-area-inset-bottom));
  left: 1rem;
  max-width: 34rem;
  margin: auto;
  padding: 0.9rem 1rem;
  color: var(--text);
  background: #17243b;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
  font-size: 0.88rem;
  text-align: center;
}

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

@keyframes logo-shine {
  0%,
  68% {
    opacity: 0;
    transform: translateX(-75%) rotate(4deg);
  }

  74% {
    opacity: 0.65;
  }

  88%,
  100% {
    opacity: 0;
    transform: translateX(75%) rotate(4deg);
  }
}

@media (min-width: 42rem) {
  .site-header {
    padding-top: 1.5rem;
  }

  .brand {
    flex-basis: 12.5rem;
    width: 12.5rem;
  }

  .language-picker {
    gap: 0.35rem;
  }

  .language-option {
    width: 2.75rem;
    height: 2.75rem;
  }

  .language-flag {
    font-size: 1.35rem;
  }

  .main-card {
    padding: 2.5rem;
  }

  .steps {
    grid-template-columns: repeat(3, 1fr);
  }

  .steps li {
    grid-template-columns: 1fr;
    align-content: start;
  }
}

@media (max-width: 41.99rem) {
  .shell {
    padding-top: 0;
  }

  .issued-card {
    padding: 1rem;
    border-radius: 20px;
  }

  .issued-card .status-pill {
    margin-bottom: 0.65rem;
    padding: 0.38rem 0.6rem;
    font-size: 0.64rem;
  }

  .issued-card h1 {
    max-width: none;
    font-size: clamp(1.55rem, 7vw, 1.85rem);
    letter-spacing: -0.035em;
  }

  .issued-lead {
    margin-top: 0.55rem;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
    line-height: 1.4;
  }

  .issued-card .qr-frame,
  .issued-card .action-grid {
    width: min(100%, 16.75rem);
    margin-right: auto;
    margin-left: auto;
  }

  .issued-card .qr-frame {
    padding: 0.55rem;
    border-radius: 16px;
  }

  .issued-card .expand-label {
    margin-top: 0.15rem;
    font-size: 0.68rem;
  }

  .issued-card .action-grid {
    gap: 0.5rem;
    margin-top: 0.65rem;
  }

  .issued-card .action-grid .button {
    min-height: 2.85rem;
    padding: 0.65rem 0.5rem;
    font-size: 0.82rem;
  }

  .issued-card .activation-card {
    margin-top: 0.75rem;
    padding: 0.8rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .brand::after {
    opacity: 0;
    animation: none !important;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
