/* Motion Pass registration, opened on the fan's own phone.
   Every size, colour and type style is taken from the Figma frames ("1 · Registration desk", 1080×1920)
   and written in design pixels times --u, so 1 design pixel = 1/1080 of the screen width.
   Phones taller than 9:16 get extra room between the content and the bottom button. */
@font-face {
  font-family: "Inter";
  src: url("fonts/Inter.ttf") format("truetype");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --navy-deep: #040a26;
  --royal: #1859a9;
  --cool: #0075c9;
  --cool-pressed: #0068b3;
  --red: #e32726;
  --white-70: rgb(255 255 255 / .7);
  /* "Input" and "Pass card" glass styles */
  --glass-input: linear-gradient(135deg, rgb(255 255 255 / .2), rgb(255 255 255 / .14));
  --glass-card: linear-gradient(135deg, rgb(255 255 255 / .16), rgb(255 255 255 / .05));
  --glass-line: rgb(255 255 255 / .2);
  --u: min(calc(100vw / 1080), calc(100vh / 1920));
}
@supports (height: 100lvh) {
  :root { --u: min(calc(100vw / 1080), calc(100lvh / 1920)); }
}

*, *::before, *::after { box-sizing: border-box; }
html { height: 100%; background: var(--navy-deep); }
body.motion {
  min-height: 100%; margin: 0; overflow-x: hidden; background: var(--navy-deep); color: #fff;
  font-family: "Inter", system-ui, sans-serif;
  font-optical-sizing: none; font-variation-settings: "opsz" 14; /* Figma renders Inter at its text optical size */
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%; text-size-adjust: 100%;
}
button, input { font: inherit; color: inherit; }
[hidden] { display: none !important; }

.stage {
  position: relative; margin: 0 auto; overflow: hidden;
  width: calc(1080 * var(--u)); height: max(calc(1920 * var(--u)), 100vh);
  background: var(--navy-deep);
}
@supports (height: 100svh) {
  .stage { height: max(calc(1920 * var(--u)), 100svh); }
}
.screen {
  position: absolute; inset: 0; overflow: hidden; padding: calc(120 * var(--u)) calc(72 * var(--u)) 0;
  animation: enter .28s ease both;
}
@keyframes enter { from { opacity: 0; transform: translateY(calc(16 * var(--u))); } }

/* Step screens: frame gradient, then the blurred track photo (exported from Figma with its blur,
   exposure and saturation applied), then the navy tint. */
.step {
  isolation: isolate;
  background:
    linear-gradient(180deg, rgb(11 42 102 / .55) 0%, rgb(7 27 71 / .85) 45%, rgb(4 10 38 / .97) 100%),
    url("register/bg.jpg") center top / cover no-repeat,
    linear-gradient(127deg, #1859a9 0%, #0b2a66 55%, var(--navy-deep) 100%);
}

/* 01 · Start */
.start { padding: 0; background: var(--navy-deep); }
.start-visual {
  position: absolute; left: 0; right: 0; top: 0; height: calc(1920 * var(--u));
  background:
    linear-gradient(180deg, rgb(4 10 38 / .25) 0%, rgb(11 42 102 / 0) 35%, rgb(11 42 102 / .55) 55%, rgb(4 10 38 / .95) 68%, var(--navy-deep) 100%),
    url("register/start.jpg") center top / 100% 100% no-repeat;
}
.start-copy { position: absolute; left: calc(72 * var(--u)); right: calc(72 * var(--u)); bottom: calc(254 * var(--u)); }
.start-eyebrow { margin: 0; font-size: calc(36 * var(--u)); font-weight: 600; line-height: 1.15; }
.hero {
  margin: calc(18.6 * var(--u)) 0 0 calc(-6 * var(--u));
  font-size: calc(128 * var(--u)); font-weight: 800; line-height: 1; letter-spacing: -.01em;
}
.lede {
  width: calc(900 * var(--u)); margin: calc(28 * var(--u)) 0 0;
  font-size: calc(36 * var(--u)); font-weight: 500; line-height: 1.15; color: var(--white-70);
}

/* Step header: "Step n of 3" (32 Semi Bold) and three 80×8 bars, 16 apart. */
.steps {
  display: grid; grid-template-columns: repeat(3, calc(80 * var(--u))); column-gap: calc(16 * var(--u));
  row-gap: calc(8.8 * var(--u)); width: max-content;
}
.steps span { grid-column: 1 / -1; font-size: calc(32 * var(--u)); font-weight: 600; line-height: 1.35; }
.steps i { display: block; height: calc(8 * var(--u)); border-radius: calc(4 * var(--u)); background: rgb(255 255 255 / .08); }
.steps i.on { background: #fff; }
.title {
  margin: calc(80 * var(--u)) 0 0 calc(-6 * var(--u));
  font-size: calc(96 * var(--u)); font-weight: 800; line-height: 1; letter-spacing: -.01em;
}

/* Buttons: 112 tall, 88 above the bottom edge. */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: calc(112 * var(--u)); padding: 0 calc(56 * var(--u)); border: 0; border-radius: calc(56 * var(--u));
  font-size: calc(36 * var(--u)); font-weight: 600; line-height: 1.15; text-decoration: none; cursor: pointer;
  transition: background-color .15s ease, transform .1s ease, opacity .15s ease;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--cool); color: #fff; }
.btn.primary:active { background: var(--cool-pressed); }
.btn.secondary {
  border-radius: calc(24 * var(--u)); background: var(--glass-card); color: #fff;
  box-shadow: inset 0 0 0 calc(2 * var(--u)) var(--glass-line);
  -webkit-backdrop-filter: blur(calc(24 * var(--u))); backdrop-filter: blur(calc(24 * var(--u)));
}
.btn.small { height: calc(96 * var(--u)); font-size: calc(32 * var(--u)); }
.bottom { position: absolute; left: calc(72 * var(--u)); right: calc(72 * var(--u)); bottom: calc(88 * var(--u)); }
.btn.bottom { width: calc(936 * var(--u)); }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: calc(32 * var(--u)); }
:focus { outline: none; }
:focus-visible { outline: calc(4 * var(--u)) solid #fed10a; outline-offset: calc(4 * var(--u)); }

/* 02 · Your details */
.details-form { margin-top: calc(108 * var(--u)); }
.field {
  display: grid; gap: calc(12.9 * var(--u)); margin-bottom: calc(42 * var(--u));
  font-size: calc(26 * var(--u)); font-weight: 500; line-height: 1.35; color: var(--white-70);
}
.field input {
  width: 100%; height: calc(120 * var(--u)); margin: 0; padding: 0 calc(40 * var(--u));
  border: 0; border-radius: calc(24 * var(--u)); outline: none; appearance: none;
  background: var(--glass-input); box-shadow: inset 0 0 0 calc(2 * var(--u)) var(--glass-line);
  -webkit-backdrop-filter: blur(calc(24 * var(--u))); backdrop-filter: blur(calc(24 * var(--u)));
  font-size: calc(36 * var(--u)); font-weight: 500; line-height: 1.15; color: var(--white-70); caret-color: var(--royal);
}
.field input:focus { color: #fff; box-shadow: inset 0 0 0 calc(2 * var(--u)) rgb(255 255 255 / .45); }
.field input::placeholder { color: rgb(255 255 255 / .35); }
.field input[aria-invalid="true"] { box-shadow: inset 0 0 0 calc(3 * var(--u)) var(--red); }
/* Keep the glass look when the browser autofills a saved name or email. */
.field input:-webkit-autofill {
  -webkit-text-fill-color: #fff; caret-color: var(--royal);
  transition: background-color 100000s ease 0s;
  box-shadow: inset 0 0 0 calc(2 * var(--u)) var(--glass-line), inset 0 0 0 999px rgb(42 60 104);
}
.field-error { margin-top: calc(-4 * var(--u)); color: #ff8a89; font-size: calc(26 * var(--u)); font-weight: 500; }
.field-error:empty { display: none; }
.field:has(.field-error:not(:empty)) { margin-bottom: calc(20 * var(--u)); }
.consent {
  position: relative; display: grid; grid-template-columns: calc(56 * var(--u)) 1fr; column-gap: calc(28 * var(--u)); align-items: start;
  margin-top: calc(72 * var(--u)); padding-right: calc(12 * var(--u));
  font-size: calc(32 * var(--u)); font-weight: 400; line-height: 1.35; color: var(--white-70); cursor: pointer;
}
.consent > span:last-child { margin-top: calc(2 * var(--u)); }
.consent input { position: absolute; left: 0; top: 0; opacity: 0; width: calc(56 * var(--u)); height: calc(56 * var(--u)); margin: 0; }
.consent .tick {
  width: calc(56 * var(--u)); height: calc(56 * var(--u)); border-radius: calc(14 * var(--u));
  background: var(--glass-input); box-shadow: inset 0 0 0 calc(2 * var(--u)) var(--glass-line);
}
.consent input:checked + .tick {
  box-shadow: none;
  background: url("register/check.svg") calc(12.36 * var(--u)) calc(16.76 * var(--u)) / calc(32 * var(--u)) calc(24 * var(--u)) no-repeat, var(--royal);
}
.consent input:focus-visible + .tick { outline: calc(4 * var(--u)) solid #fed10a; outline-offset: calc(4 * var(--u)); }
.consent-error { display: block; margin: calc(14 * var(--u)) 0 0 calc(84 * var(--u)); }

/* 03–05 · Selfie: a 936×1180 frame, 40 corners. */
.visual {
  position: absolute; left: calc(72 * var(--u)); top: calc(420 * var(--u));
  width: calc(936 * var(--u)); height: calc(1180 * var(--u));
  border-radius: calc(40 * var(--u)); overflow: hidden; background: rgb(255 255 255 / .06);
}
.visual video, .visual .shot { display: block; width: 100%; height: 100%; object-fit: cover; }
.camera video { transform: scaleX(-1); }
.oval {
  position: absolute; left: calc(208 * var(--u)); top: calc(180 * var(--u));
  width: calc(520 * var(--u)); height: calc(700 * var(--u)); overflow: visible;
}
.oval ellipse { fill: none; stroke: rgb(255 255 255 / .2); stroke-width: 5; stroke-dasharray: 24 16; }
.countdown {
  position: absolute; left: 0; right: 0; top: calc(960 * var(--u)); text-align: center;
  font-size: calc(128 * var(--u)); font-weight: 800; line-height: 1; letter-spacing: -.01em;
}
.countdown:not(:empty) { animation: tick 1s ease both; }
@keyframes tick { from { transform: scale(1.4); opacity: 0; } 30% { transform: scale(1); opacity: 1; } }
.flash { position: absolute; inset: 0; background: #fff; animation: flash .35s ease forwards; pointer-events: none; }
@keyframes flash { to { opacity: 0; } }
.camera-message {
  position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: calc(40 * var(--u));
  padding: calc(80 * var(--u)); text-align: center; background: rgb(4 10 38 / .7);
}
.camera-message p { margin: 0; font-size: calc(36 * var(--u)); font-weight: 600; line-height: 1.15; }

/* 05 · Face not found: photo at 35%, 8px red frame (24 corners), red dot, centred tip. */
.warning { top: calc(480 * var(--u)); height: calc(1060 * var(--u)); background: none; }
.warning .shot { opacity: .35; }
.warning::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; /* same 40 corners as the photo */
  box-shadow: inset 0 0 0 calc(8 * var(--u)) var(--red); pointer-events: none;
}
.alert-dot {
  position: absolute; left: calc(368 * var(--u)); top: calc(280 * var(--u));
  display: grid; place-items: center; width: calc(200 * var(--u)); height: calc(200 * var(--u)); border-radius: 50%;
  background: var(--red); font-size: calc(128 * var(--u)); font-weight: 800; line-height: 1; letter-spacing: -.01em;
}
.warning p {
  position: absolute; left: calc(78 * var(--u)); top: calc(560 * var(--u)); width: calc(780 * var(--u)); margin: 0;
  text-align: center; font-size: calc(36 * var(--u)); font-weight: 600; line-height: 1.15;
}

/* 06 · Pass ready */
.pass-card {
  position: absolute; left: calc(72 * var(--u)); top: calc(560 * var(--u));
  width: calc(936 * var(--u)); height: calc(1000 * var(--u)); border-radius: calc(32 * var(--u));
  background: var(--glass-card); box-shadow: inset 0 0 0 calc(2 * var(--u)) var(--glass-line);
  -webkit-backdrop-filter: blur(calc(24 * var(--u))); backdrop-filter: blur(calc(24 * var(--u)));
}
.pass-photo {
  position: absolute; left: calc(48 * var(--u)); top: calc(48 * var(--u));
  width: calc(120 * var(--u)); height: calc(120 * var(--u)); border-radius: 50%; object-fit: cover; background: rgb(255 255 255 / .1);
}
.pass-name, .pass-driver { position: absolute; left: calc(200 * var(--u)); right: calc(48 * var(--u)); margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pass-name { top: calc(58 * var(--u)); font-size: calc(48 * var(--u)); font-weight: 700; line-height: 1.15; }
.pass-driver { top: calc(116 * var(--u)); font-size: calc(32 * var(--u)); font-weight: 500; line-height: 1.35; color: var(--white-70); }
.qr-card {
  position: absolute; left: calc(138 * var(--u)); top: calc(220 * var(--u));
  width: calc(660 * var(--u)); height: calc(660 * var(--u)); padding: calc(40 * var(--u));
  border-radius: calc(32 * var(--u)); background: #fff;
}
.qr-card img { display: block; width: 100%; height: 100%; }
.pass-caption {
  position: absolute; left: 0; right: 0; top: calc(920 * var(--u)); margin: 0; text-align: center;
  font-size: calc(32 * var(--u)); font-weight: 500; line-height: 1.35; color: var(--white-70);
}
.pass-note {
  position: absolute; left: calc(72 * var(--u)); right: calc(72 * var(--u)); bottom: calc(257 * var(--u));
  margin: 0; text-align: center; font-size: calc(32 * var(--u)); font-weight: 400; line-height: 1.35; color: var(--white-70);
}

/* The pass page the QR code opens has no button, so the note sits where Figma puts it. */
.pass-note.standalone { top: calc(1620 * var(--u)); bottom: auto; }

/* Feedback */
.toast {
  position: absolute; z-index: 10; left: calc(72 * var(--u)); right: calc(72 * var(--u)); bottom: calc(240 * var(--u));
  padding: calc(28 * var(--u)) calc(36 * var(--u)); border-radius: calc(24 * var(--u));
  background: var(--red); font-size: calc(32 * var(--u)); font-weight: 600; line-height: 1.35;
  animation: enter .2s ease both;
}
.busy { position: absolute; z-index: 9; inset: 0; display: grid; place-items: center; background: rgb(4 10 38 / .55); }
.busy span {
  width: calc(96 * var(--u)); height: calc(96 * var(--u)); border-radius: 50%;
  border: calc(8 * var(--u)) solid rgb(255 255 255 / .2); border-top-color: #fff; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------- Fan page (/<KEY>): pass, key, status, activity. Same type scale and glass as the flow. ---------- */
.fan-stage { height: auto; min-height: max(calc(1920 * var(--u)), 100vh); overflow: visible; }
.fan { position: relative; min-height: inherit; padding: calc(120 * var(--u)) calc(72 * var(--u)) calc(120 * var(--u)); background-attachment: scroll; }
.fan-eyebrow { margin: 0; font-size: calc(32 * var(--u)); font-weight: 600; line-height: 1.35; }
.fan .title { margin-top: calc(40 * var(--u)); }
.glass-card {
  margin-top: calc(48 * var(--u)); padding: calc(48 * var(--u)); border-radius: calc(32 * var(--u));
  background: var(--glass-card); box-shadow: inset 0 0 0 calc(2 * var(--u)) var(--glass-line);
  -webkit-backdrop-filter: blur(calc(24 * var(--u))); backdrop-filter: blur(calc(24 * var(--u)));
}
.fan-pass { margin-top: calc(64 * var(--u)); }
.card-title { margin: 0 0 calc(16 * var(--u)); font-size: calc(36 * var(--u)); font-weight: 700; line-height: 1.15; }
.fan-person { display: flex; align-items: center; gap: calc(32 * var(--u)); min-width: 0; }
.fan-person > div { min-width: 0; }
.fan-photo { flex: none; width: calc(120 * var(--u)); height: calc(120 * var(--u)); border-radius: 50%; object-fit: cover; background: rgb(255 255 255 / .1); }
.fan-name { margin: 0; font-size: calc(48 * var(--u)); font-weight: 700; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fan-sub { margin: calc(4 * var(--u)) 0 0; font-size: calc(32 * var(--u)); font-weight: 500; line-height: 1.35; color: var(--white-70); }
.fan-key { margin-top: calc(40 * var(--u)); padding-top: calc(40 * var(--u)); border-top: calc(2 * var(--u)) solid rgb(255 255 255 / .12); }
.fan-label, .fan-stats dt { display: block; font-size: calc(26 * var(--u)); font-weight: 500; line-height: 1.35; color: var(--white-70); }
.key-text {
  display: block; margin-top: calc(8 * var(--u)); font-size: calc(88 * var(--u)); font-weight: 800; line-height: 1;
  letter-spacing: .12em; font-variant-numeric: tabular-nums; user-select: all;
}
.fan-stats { display: grid; grid-template-columns: 1fr 1fr; gap: calc(32 * var(--u)); margin: calc(40 * var(--u)) 0 0; }
.fan-stats dd { margin: calc(12 * var(--u)) 0 0; }
.status-chip {
  display: inline-flex; align-items: center; max-width: 100%; min-height: calc(64 * var(--u)); padding: calc(8 * var(--u)) calc(28 * var(--u));
  border-radius: calc(32 * var(--u)); background: var(--royal); font-size: calc(30 * var(--u)); font-weight: 600; line-height: 1.15;
  overflow-wrap: anywhere;
}
.points { font-size: calc(56 * var(--u)); font-weight: 800; line-height: 1.15; font-variant-numeric: tabular-nums; }
.btn.wide { display: flex; width: 100%; margin-top: calc(48 * var(--u)); }
.activity { margin: 0; padding: 0; list-style: none; }
.activity li {
  display: grid; grid-template-columns: 1fr auto; column-gap: calc(24 * var(--u)); row-gap: calc(4 * var(--u));
  padding: calc(24 * var(--u)) 0; border-bottom: calc(2 * var(--u)) solid rgb(255 255 255 / .1);
}
.activity li:last-child { border-bottom: 0; padding-bottom: 0; }
.activity-message { font-size: calc(32 * var(--u)); font-weight: 500; line-height: 1.35; overflow-wrap: anywhere; }
.activity-points { font-size: calc(32 * var(--u)); font-weight: 700; line-height: 1.35; color: #7cc4ff; font-variant-numeric: tabular-nums; }
.activity time { grid-column: 1 / -1; font-size: calc(26 * var(--u)); line-height: 1.35; color: var(--white-70); }
.activity-empty { margin: calc(8 * var(--u)) 0 0; font-size: calc(32 * var(--u)); line-height: 1.35; color: var(--white-70); }
.fan-details { margin: 0; }
.fan-details > div {
  display: flex; justify-content: space-between; gap: calc(32 * var(--u)); padding: calc(20 * var(--u)) 0;
  border-bottom: calc(2 * var(--u)) solid rgb(255 255 255 / .1); font-size: calc(30 * var(--u)); line-height: 1.35;
}
.fan-details > div:last-child { border-bottom: 0; padding-bottom: 0; }
.fan-details dt { flex: none; color: var(--white-70); }
.fan-details dd { margin: 0; font-weight: 500; text-align: right; overflow-wrap: anywhere; min-width: 0; }
.fan-note { margin: calc(48 * var(--u)) 0 0; text-align: center; font-size: calc(28 * var(--u)); line-height: 1.35; color: var(--white-70); }

.qr-sheet {
  position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: calc(72 * var(--u));
  background: rgb(4 10 38 / .82); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  animation: enter .2s ease both;
}
.qr-sheet-body {
  width: min(calc(936 * var(--u)), 100%); padding: calc(56 * var(--u)) calc(48 * var(--u)); border-radius: calc(40 * var(--u));
  text-align: center; background: linear-gradient(160deg, #1859a9 0%, #0b2a66 60%, #071b47 100%);
  box-shadow: inset 0 0 0 calc(2 * var(--u)) var(--glass-line);
}
.qr-sheet .card-title { margin-bottom: calc(40 * var(--u)); }
.qr-card-big { padding: calc(40 * var(--u)); border-radius: calc(32 * var(--u)); background: #fff; }
.qr-card-big img { display: block; width: 100%; aspect-ratio: 1; }
.qr-sheet .key-text { margin-top: calc(40 * var(--u)); }
.qr-sheet .fan-sub { margin-top: calc(16 * var(--u)); }
