/* KTM 2026 public visitor registration.
   Colours are the official KTM 2026 palette (see lib/common/widgets/brand_decorations.dart
   in the app) plus the poster purple sampled from the splash artwork. */

@font-face {
  font-family: "Aqum";
  src: url("assets/fonts/aqum.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Metropolis";
  src: url("assets/fonts/metropolis-regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Metropolis";
  src: url("assets/fonts/metropolis-medium.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "Metropolis";
  src: url("assets/fonts/metropolis-semibold.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: "Metropolis";
  src: url("assets/fonts/metropolis-bold.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

:root {
  --cyan: #14afe6;
  --magenta: #eb0a73;
  --magenta-deep: #c9085f;
  --lime: #d7de23;
  --purple: #502d91;
  --poster: #5a3492;
  --pink: #f073aa;
  --green: #00af6e;

  --ink: #24173f;
  --muted: #5e5872;
  --line: #d8d1e6;
  --line-strong: #8e84a6;
  --canvas: #f5f2fa;
  --surface: #ffffff;
  --tint: #f1ecfa;

  --danger: #b6242d;
  --danger-bg: #fdebed;
  --notice-bg: #f7f9d6;
  --notice-ink: #4a4d05;

  --radius-card: 24px;
  --radius-control: 14px;
  --shadow-card: 0 1px 2px rgba(36, 23, 63, 0.06), 0 18px 48px -18px rgba(36, 23, 63, 0.35);
  --focus: 0 0 0 3px #fff, 0 0 0 6px var(--purple);

  --display: "Aqum", "Arial Black", system-ui, sans-serif;
  --body: "Metropolis", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  color-scheme: light;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
  color: inherit;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

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

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 10;
  padding: 12px 16px;
  border-radius: 10px;
  background: var(--lime);
  color: var(--purple);
  font-weight: 700;
  text-decoration: none;
  transition: top 0.15s ease;
}
.skip-link:focus {
  top: 12px;
}

/* ---------------------------------------------------------------- hero */

.hero {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background: var(--poster);
  color: #fff;
  /* The painting is anchored to the bottom, so the hero needs room for the
     text plus a band of sunset before the card overlaps it. */
  --art-height: 330px;
  padding: max(20px, env(safe-area-inset-top)) 20px 250px;
}

.hero-art {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--art-height);
  z-index: -1;
}
.hero-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center bottom;
  /* The painting's sky is the poster purple, so fading its top edge makes
     it melt into the flat hero colour where the text sits. */
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 28%);
  mask-image: linear-gradient(180deg, transparent 0, #000 28%);
}

.hero-inner {
  max-width: 560px;
  margin: 0 auto;
}

.hero-logo {
  display: block;
  width: max-content;
  border-radius: 12px;
}
.hero-logo img {
  width: 64px;
  height: auto;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 22px 0 10px;
  padding: 6px 12px 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  font-family: var(--display);
  font-size: 13px;
  letter-spacing: 0.12em;
  color: #fff;
}
.hero-eyebrow::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--lime);
}

.hero-title {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(30px, 8.6vw, 44px);
  line-height: 1.02;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: var(--lime);
}
.hero-title span {
  display: block;
}

.hero-sub {
  margin: 14px 0 0;
  max-width: 34ch;
  font-size: 16px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.92);
}

.hero-sub,
.hero-facts {
  text-shadow: 0 1px 14px rgba(45, 20, 90, 0.55);
}

.hero-facts {
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.hero-facts li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 15px;
  line-height: 1.35;
}
.hero-facts svg {
  flex: none;
  width: 20px;
  height: 20px;
  margin-top: -1px;
  fill: none;
  stroke: var(--lime);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.hero-facts strong {
  font-weight: 600;
}

/* ---------------------------------------------------------------- card */

.content {
  display: flex;
  flex-direction: column;
}

.main {
  position: relative;
  z-index: 1;
  padding: 0 16px;
  margin-top: -120px;
}

.card {
  max-width: 560px;
  margin: 0 auto;
  background: var(--surface);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

/* The five-colour rule from the 2026 creatives. */
.stripe {
  display: flex;
  height: 6px;
}
.stripe i {
  flex: 1;
}
.stripe i:nth-child(1) { background: var(--cyan); }
.stripe i:nth-child(2) { background: var(--green); }
.stripe i:nth-child(3) { background: var(--lime); }
.stripe i:nth-child(4) { background: var(--magenta); }
.stripe i:nth-child(5) { background: var(--purple); }

.card-body {
  padding: 26px 20px 24px;
}

.card-head {
  margin-bottom: 20px;
}

.card-title {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  font-size: 24px;
  line-height: 1.1;
  text-transform: uppercase;
  color: var(--purple);
}
.card-title:focus {
  outline: none;
}

.card-lead {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 15px;
}

.req {
  color: var(--magenta-deep);
  font-weight: 700;
}
.optional {
  color: var(--muted);
  font-weight: 500;
}

/* ---------------------------------------------------------------- banners */

.notice,
.alert {
  display: flex;
  gap: 10px;
  margin: 0 0 18px;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 15px;
  line-height: 1.45;
}
.notice {
  background: var(--notice-bg);
  color: var(--notice-ink);
  border: 1px solid #dfe47a;
}
.notice strong {
  color: var(--ink);
}
.alert {
  background: var(--danger-bg);
  color: #7a1420;
  border: 1px solid #f3b9c0;
}
.alert:focus {
  outline: none;
}
.notice::before,
.alert::before {
  flex: none;
  content: "";
  width: 20px;
  height: 20px;
  margin-top: 1px;
  border-radius: 50%;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M10 0a10 10 0 1 1 0 20 10 10 0 0 1 0-20Zm0 13.5a1.25 1.25 0 1 0 0 2.5 1.25 1.25 0 0 0 0-2.5ZM11 4H9v8h2V4Z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M10 0a10 10 0 1 1 0 20 10 10 0 0 1 0-20Zm0 13.5a1.25 1.25 0 1 0 0 2.5 1.25 1.25 0 0 0 0-2.5ZM11 4H9v8h2V4Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* ---------------------------------------------------------------- fields */

.field {
  margin: 0 0 18px;
  padding: 0;
  border: 0;
  min-width: 0;
}

.field > label,
.field > legend {
  display: block;
  margin-bottom: 8px;
  padding: 0;
  font-weight: 600;
  font-size: 15px;
  color: var(--ink);
}

.control {
  position: relative;
}
.control-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  width: 22px;
  height: 22px;
  transform: translateY(-50%);
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
  transition: stroke 0.15s ease;
}

.control input {
  display: block;
  width: 100%;
  min-height: 54px;
  padding: 14px 16px 14px 46px;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-control);
  background: var(--surface);
  font-size: 16px; /* 16px keeps iOS from zooming on focus */
  line-height: 1.3;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  -webkit-appearance: none;
  appearance: none;
}
.control input::placeholder {
  color: #9c95ad;
}
.control input:hover {
  border-color: var(--purple);
}
.control input:focus {
  outline: none;
  border-color: var(--purple);
  box-shadow: 0 0 0 4px rgba(20, 175, 230, 0.35);
}
.control:focus-within .control-icon {
  stroke: var(--purple);
}

.control input[aria-invalid="true"] {
  border-color: var(--danger);
  background: #fffafa;
}
.control input[aria-invalid="true"]:focus {
  box-shadow: 0 0 0 4px rgba(182, 36, 45, 0.18);
}
.control:has(input[aria-invalid="true"]) .control-icon {
  stroke: var(--danger);
}

.hint {
  margin: 6px 0 0;
  font-size: 13.5px;
  color: var(--muted);
}

.err {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--danger);
}
.err:not(:empty) {
  margin-top: 6px;
}
.err:not(:empty)::before {
  content: "! ";
  font-weight: 700;
}

/* ---------------------------------------------------------------- chips */

.chips {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.chip {
  position: relative;
  display: block;
  cursor: pointer;
}
.chip input {
  position: absolute;
  opacity: 0;
  inset: 0;
  margin: 0;
  cursor: pointer;
}
.chip span {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 50px;
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  font-weight: 500;
  font-size: 15px;
  line-height: 1.2;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.chip span::before {
  flex: none;
  content: "";
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--line-strong);
  border-radius: 50%;
  background: #fff;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.chip:hover span {
  border-color: var(--purple);
}
.chip input:checked + span {
  border-color: var(--purple);
  background: var(--purple);
  color: #fff;
  font-weight: 600;
}
.chip input:checked + span::before {
  border-color: var(--lime);
  background: var(--lime) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Cpath d='M5 9.4l2.6 2.6L13 6.4' fill='none' stroke='%23502d91' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 100% no-repeat;
}
.chip input:focus-visible + span {
  box-shadow: var(--focus);
}
.field[aria-invalid="true"] .chip span {
  border-color: #e7a2a8;
}

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

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 54px;
  padding: 14px 22px;
  border: 0;
  border-radius: 999px;
  font-weight: 700;
  font-size: 16px;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:active {
  transform: translateY(1px);
}
.btn svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.btn-primary {
  width: 100%;
  margin-top: 6px;
  background: var(--magenta);
  color: #fff;
  font-size: 17px;
  letter-spacing: 0.01em;
  box-shadow: 0 10px 22px -12px rgba(235, 10, 115, 0.8);
}
.btn-primary:hover {
  background: var(--magenta-deep);
}
.btn-primary .btn-arrow {
  transition: transform 0.15s ease;
}
.btn-primary:hover .btn-arrow {
  transform: translateX(3px);
}
.btn-primary[aria-busy="true"] {
  cursor: progress;
  background: var(--magenta-deep);
}
.btn-primary[aria-busy="true"] .btn-arrow {
  display: none;
}

.spinner {
  display: none;
  width: 20px;
  height: 20px;
  border: 2.5px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.btn[aria-busy="true"] .spinner {
  display: block;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.btn-secondary {
  background: var(--purple);
  color: #fff;
}
.btn-secondary:hover {
  background: #40237a;
}

.btn-ghost {
  background: transparent;
  color: var(--purple);
  box-shadow: inset 0 0 0 1.5px var(--line-strong);
}
.btn-ghost:hover {
  background: var(--tint);
  box-shadow: inset 0 0 0 1.5px var(--purple);
}

.fine {
  margin: 16px 0 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
  text-align: center;
}

.hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

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

.done {
  padding-top: 34px;
  text-align: center;
}

.stamp {
  width: 104px;
  height: 104px;
  margin: 0 auto 18px;
}
.stamp svg {
  width: 100%;
  height: 100%;
}
.stamp-edge {
  fill: var(--lime);
  transform-origin: 60px 60px;
  animation: stamp-in 0.5s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}
.stamp-check {
  fill: none;
  stroke: var(--purple);
  stroke-width: 9;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 70;
  stroke-dashoffset: 70;
  animation: draw 0.4s 0.3s ease-out forwards;
}
@keyframes stamp-in {
  from {
    transform: scale(0.4) rotate(-40deg);
    opacity: 0;
  }
}
@keyframes draw {
  to {
    stroke-dashoffset: 0;
  }
}

.done-title {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  font-size: 26px;
  line-height: 1.1;
  text-transform: uppercase;
  color: var(--purple);
}
.done-title:focus {
  outline: none;
}

.done-text {
  max-width: 38ch;
  margin: 12px auto 0;
  color: var(--ink);
}
.done-small {
  font-size: 14px;
  color: var(--muted);
}

.ref {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin: 20px auto 0;
  padding: 16px 18px;
  max-width: 340px;
  border: 2px dashed var(--purple);
  border-radius: 16px;
  background: var(--tint);
}
.ref-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.ref-code {
  font-family: var(--display);
  font-size: 26px;
  letter-spacing: 0.06em;
  color: var(--purple);
  word-break: break-all;
}

.done-actions {
  display: grid;
  gap: 10px;
  margin-top: 24px;
}

/* ---------------------------------------------------------------- footer */

.footer {
  max-width: 592px;
  width: 100%;
  margin: 0 auto;
  padding: 32px 16px max(28px, env(safe-area-inset-bottom));
  color: var(--muted);
  font-size: 14px;
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}
.footer-brand img {
  width: 44px;
  height: auto;
}
.footer-name {
  margin: 0;
  font-weight: 700;
  color: var(--ink);
}
.footer-meta {
  margin: 2px 0 0;
}
.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px 20px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 13px;
}
.powered {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  border-radius: 6px;
}
.powered img {
  width: 22px;
  height: auto;
}
.powered strong {
  color: var(--ink);
}
.powered:hover strong {
  text-decoration: underline;
}

.noscript {
  margin: 16px;
  padding: 14px;
  border-radius: 12px;
  background: var(--danger-bg);
  color: #7a1420;
  text-align: center;
}

/* ---------------------------------------------------------------- larger phones / tablets */

@media (min-width: 480px) {
  .hero {
    padding-left: 28px;
    padding-right: 28px;
  }
  .card-body {
    padding: 32px 32px 28px;
  }
  .chips {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .done-actions {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 700px) {
  .hero {
    --art-height: 440px;
    padding-top: 40px;
    padding-bottom: 330px;
  }
  .hero-logo img {
    width: 80px;
  }
  .main {
    margin-top: -180px;
  }
}

/* ---------------------------------------------------------------- desktop: poster beside the form */

@media (min-width: 1024px) {
  .page {
    display: grid;
    grid-template-columns: minmax(420px, 44%) 1fr;
    min-height: 100vh;
  }

  .hero {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 48px clamp(32px, 4vw, 64px);
  }
  .hero {
    --art-height: 50vh;
  }
  .hero-inner {
    max-width: 480px;
    margin: 0;
  }
  .hero-logo img {
    width: 96px;
  }
  .hero-eyebrow {
    margin-top: 36px;
  }
  .hero-title {
    font-size: clamp(40px, 3.6vw, 58px);
  }
  .hero-sub {
    font-size: 17px;
  }

  .content {
    min-height: 100vh;
    justify-content: center;
  }
  .main {
    margin: 0;
    padding: 56px clamp(24px, 4vw, 64px) 0;
  }
  .card {
    max-width: 580px;
  }
  .footer {
    max-width: 580px;
    padding-left: 0;
    padding-right: 0;
  }
}

/* Short, wide laptop screens: keep the headline clear of the painting. */
@media (min-width: 1024px) and (max-height: 760px) {
  .hero-sub {
    display: none;
  }
}

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