/* =========================================================================
   HBS 2026 — page styles for the landing, the free registration forms
   (visitor / VIP), the thank-you page and the digital badge page.
   Builds on hbs.css tokens; nothing here redefines the design system.
   ========================================================================= */

/* ---------- shared bits ---------- */
.hp { position: absolute !important; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.select:disabled, .input:disabled { background-color: var(--mist); color: var(--faint); cursor: not-allowed; }
.select:disabled:hover { border-color: var(--line); }
.link { color: var(--text); font-weight: 600; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.link:hover { color: var(--red); }

/* ---------- landing ---------- */
/* The default artwork is a full campaign poster (photo + typography). Crop it to the
   portrait so the left column reads as a photograph; the right column carries the type. */
.landing-photo.is-poster { container-type: size; }
.landing-photo.is-poster img {
  --s: max(205cqw, 122cqh);           /* keeps the poster lettering out of frame (2027 art: lettering starts at 52% width) */
  inset: auto; left: 0; right: auto;
  width: var(--s); max-width: none; height: auto;
  top: clamp(calc(100cqh - .88 * var(--s)), calc(50cqh - .44 * var(--s)), 0px);
  object-fit: fill;
}
@media (max-width: 900px) {
  /* container query units need a definite height (min-height alone resolves cqh to 0) */
  .landing-photo.is-poster { height: 24vh; min-height: 170px; max-height: 300px; }
}

/* ---------- free registration form ---------- */
.reg-intro .track-tag, .result .track-tag { margin-top: 0; }
.reg-intro .lede b { color: var(--text); font-weight: 600; }
.field-mobile { max-width: 420px; }
.field .input-group .input { min-width: 0; }
.panel-lede { margin: -8px 0 18px; color: var(--muted); font-size: 15px; }
.fields .col-1 { grid-column: 1; }
.fields .col-2 { grid-column: 2; }
@media (max-width: 640px) { .fields .col-1, .fields .col-2 { grid-column: auto; } }

fieldset.field { border: 0; margin: 0; padding: 0; min-inline-size: 0; }
fieldset.field legend { padding: 0; margin-bottom: 6px; }

/* completed step */
.panel-title .step { transition: background .3s var(--ease); position: relative; }
.panel.is-done .panel-title .step { background: var(--ok); color: transparent; }
.panel.is-done .panel-title .step::after {
  content: ""; position: absolute; left: 50%; top: 45%; width: 6px; height: 11px;
  border: solid #fff; border-width: 0 2px 2px 0; transform: translate(-50%, -50%) rotate(45deg);
}

/* mobile gate status */
.gate-status:empty { display: none; }
.gate-status { margin-top: 16px; }
.gate-line { display: flex; align-items: center; gap: 10px; font-size: 15px; color: var(--muted); }
.gate-line .dot { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--accent); animation: spin .7s linear infinite; flex: none; }
.gate-line.ok { color: var(--ok); font-weight: 600; }
.gate-line.ok svg { flex: none; }
.gate-alert { display: grid; gap: 12px; }
.gate-alert p { margin: 0; }
.gate-alert .btn { justify-self: start; min-height: 44px; font-size: 16px; }
.js .gate-status > * { animation: rise .35s var(--ease) both; }

/* reveal of the rest of the form once the mobile number is checked */
.js .gate-rest {
  display: grid; grid-template-rows: 0fr; opacity: 0; visibility: hidden;
  transition: grid-template-rows .6s var(--ease), opacity .45s ease, visibility 0s linear .6s;
}
.js .gate-rest.is-open {
  grid-template-rows: 1fr; opacity: 1; visibility: visible;
  transition: grid-template-rows .6s var(--ease), opacity .5s ease .05s, visibility 0s;
}
.gate-inner { min-height: 0; padding-top: 20px; }
.js .gate-inner { overflow: hidden; margin: 0 -18px; padding: 0 18px; transition: padding .6s var(--ease); }
.js .gate-rest.is-open .gate-inner { padding: 20px 18px 28px; }
.js .gate-rest.is-settled .gate-inner { overflow: visible; }
.js .gate-rest.is-open .panel { animation: rise .55s var(--ease) both; }
.js .gate-rest.is-open .panel:nth-child(2) { animation-delay: .08s; }
.js .gate-rest.is-open .panel:nth-child(3) { animation-delay: .16s; }
.js .gate-rest.is-open .submit-bar { animation: rise .55s var(--ease) .22s both; }

.field-other[hidden] { display: none !important; }
.js .field-other:not([hidden]) { animation: rise .3s var(--ease) both; }

.submit-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; margin-top: 26px; }
.submit-bar .btn { min-width: 220px; }
.submit-bar p { margin: 0; font-size: 14px; color: var(--muted); max-width: 44ch; }
@media (max-width: 640px) { .submit-bar .btn { width: 100%; } }

/* live badge preview (type sizes scale with the card, see hbs.css) */
.badge-card .b-code { color: #111; }
.aside-label { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; font-size: 14px; font-weight: 600; color: var(--muted); }
.aside-label::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); animation: live 2.4s ease-in-out infinite; }
@keyframes live { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
.aside-note b { color: var(--text); font-weight: 600; }
@media (max-width: 980px) {
  .aside-label { display: none; }
}
@media (max-width: 420px) {
  .aside-note { font-size: 13px; gap: 8px; }
}

/* registration closed */
.reg-closed { max-width: 720px; }
.reg-closed .panel-title { margin-bottom: 10px; }
.reg-closed p { margin: 0 0 18px; color: var(--muted); }

/* ---------- thank-you ---------- */
.result h1 { margin: 0 0 14px; }
.result .lede { margin: 0 0 22px; color: var(--text); }
.result .lede b { font-weight: 700; }
.code-line { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 0; }
.code-line .muted { font-size: 14px; }
.result .note { margin: 22px 0 0; padding-left: 14px; border-left: 3px solid var(--accent); color: var(--muted); font-size: 15px; max-width: 56ch; }
.result .when-line { margin: 10px 0 0; font-size: 14px; color: var(--muted); }
.result .kv { margin: 26px 0 28px; padding: 22px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.badge-out { margin: 0; }
.badge-out .badge-card { display: none; transform: none; }
.badge-out.is-fallback img { display: none; }
.badge-out.is-fallback .badge-card { display: block; }
.js .badge-out.is-fallback .badge-card { animation: print 1.1s var(--ease) .2s both; }
/* the badge "prints" once its image has arrived (badges are rendered on first request, which can
   take a moment); until then the slot stays empty instead of the animation finishing on nothing */
.js .badge-out img[data-print]:not(.is-ready),
.js .badge-out img[data-print]:not(.in-view), /* hbs.js adds .in-view when it scrolls on screen (phones) */
.js .badge-view figure img[data-print]:not(.is-ready) { animation: none; clip-path: inset(0 0 100% 0); }
.badge-out { min-height: 120px; }
.js .badge-out:not(.is-fallback):has(img[data-print]:not(.is-ready))::before {
  content: ""; position: absolute; left: 50%; top: 40px; width: 28px; height: 28px; margin-left: -14px;
  border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite;
}
@media (max-width: 520px) {
  .result .kv { grid-template-columns: 120px minmax(0, 1fr); gap: 10px 12px; }
  .result .kv dd { margin-bottom: 0; }
  .result .actions .btn { flex: 1 1 100%; } /* a tidy full-width stack instead of ragged pills */
}
.kv .kv-code { white-space: nowrap; letter-spacing: .02em; }
.badge-out figcaption { margin-top: 12px; font-size: 13px; color: var(--muted); text-align: center; }
.badge-list { margin-top: 56px; }
.badge-list h2 { margin: 0 0 20px; }
.badge-items { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 28px; }
.badge-items li { display: grid; gap: 10px; align-content: start; }
.badge-items .thumb { position: relative; border-radius: 10px; overflow: hidden; background: var(--mist); aspect-ratio: 1250 / 1667; box-shadow: var(--shadow-1); }
.badge-items .thumb img { width: 100%; height: 100%; object-fit: cover; }
.badge-items .thumb.is-missing img { display: none; }
.badge-items .thumb.is-missing::after { content: "Badge is being prepared"; position: absolute; inset: 0; display: grid; place-items: center; font-size: 13px; color: var(--muted); }
.badge-items .it-name { font-weight: 700; line-height: 1.3; }
.badge-items .it-code { font-size: 14px; color: var(--muted); }
.badge-items .it-code b { color: var(--text); letter-spacing: .04em; }
.badge-items a.link { font-size: 14px; }
.pay-due { display: flex; align-items: baseline; gap: 12px; margin: 0 0 24px; }
.pay-due strong { font-weight: 800; font-stretch: 80%; font-size: 30px; color: var(--text); }
.pay-due span { color: var(--muted); font-size: 15px; }
.pay-actions { margin-top: 28px; }
.item-lines { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.item-lines li { display: flex; justify-content: space-between; gap: 12px; }
.item-lines li span:last-child { color: var(--muted); font-weight: 500; white-space: nowrap; }
.notfound { min-height: calc(100vh - 65px - 79px); min-height: calc(100dvh - 65px - 79px); display: grid; align-content: center; }
.notfound p { color: var(--muted); max-width: 52ch; }

/* ---------- digital badge page (dark) ---------- */
.badge-view { min-height: 100vh; min-height: 100dvh; background: #0b0b0c; color: #f3f3f3; padding: 28px 0 56px; }
.badge-view .bv-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: clamp(24px, 5vw, 44px); }
.badge-view .bv-mark { font-weight: 900; font-stretch: 80%; font-size: 28px; color: var(--red); text-decoration: none; letter-spacing: -.02em; line-height: 1; }
.badge-view .bv-meta { font-size: 13px; color: #a6a9ae; text-align: right; }
.badge-view .bv-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 40px; }
.badge-view figure { margin: 0; width: min(420px, 100%); display: grid; gap: 16px; }
.badge-view figure img { width: 100%; border-radius: 14px; box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .9), 0 0 0 1px rgba(255, 255, 255, .06); }
.js .badge-view figure img { animation: print 1.1s var(--ease) .15s both; }
.badge-view figcaption { text-align: center; font-size: 14px; color: #a6a9ae; }
.badge-view figcaption b { display: block; color: #fff; font-size: 16px; letter-spacing: .06em; }
.badge-view .actions { justify-content: center; }
.badge-view .btn-ghost { color: #fff; border-color: rgba(255, 255, 255, .28); }
.badge-view .btn-ghost:hover { border-color: #fff; }
.badge-view :focus-visible { outline-color: #fff; } /* track inks are too dark on the black page */
.badge-view .bv-note { margin: 40px auto 0; max-width: 52ch; text-align: center; font-size: 14px; color: #a6a9ae; }
.badge-view .bv-note a { color: #fff; }
.badge-view .badge-card { display: none; transform: none; }
.badge-view figure.is-fallback img { display: none; }
.badge-view figure.is-fallback .badge-card { display: block; }
.badge-view .bv-pending { max-width: 520px; margin: 8vh auto 0; text-align: center; }
.badge-view .bv-pending h1 { color: #fff; margin-bottom: 14px; }
.badge-view .bv-pending p { color: #b9bcc1; margin: 0 0 24px; }
/* several badges (competition entries, delegates): a row of cards instead of a wall of posters */
.badge-view .bv-grid:has(figure + figure) { gap: 40px 32px; }
.badge-view .bv-grid:has(figure + figure) figure { width: min(262px, 100%); align-content: start; }
.badge-view .bv-grid:has(figure + figure) figcaption { min-height: 3.2em; }
.badge-view .bv-grid:has(figure + figure) .actions { gap: 8px; }
.badge-view .bv-grid:has(figure + figure) .actions .btn { flex: 1 1 auto; min-height: 42px; padding: 0 14px; font-size: 15px; }
@media (max-width: 520px) {
  .badge-view .bv-meta { display: none; }
  .badge-view .actions .btn { flex: 1 1 100%; }
  .badge-view .bv-grid:has(figure + figure) figure { width: 100%; }
}

@media print {
  .badge-view { background: #fff; color: #000; }
  .badge-view .actions, .badge-view .bv-note, .badge-view .bv-top { display: none !important; }
}
