/* ==========================================================================
   Generation Next 2026 · Portal theme
   Loaded after style.css. One font (Montserrat), light only.
   Navy carries weight, gold is the one action colour, and the header
   banners use a navy-to-blue gradient.
   Contrast (WCAG 2), measured:
     navy #0c1754 on canvas #f9f8f6 ......... 15.63:1
     muted #55596b on canvas ................. 6.54:1
     field border #8a8d99 on white ........... 3.12:1  (1.4.11 needs 3:1)
     navy on gold #e6a91f (primary button) ... 7.94:1
     white on the lightest banner blue ....... 5.29:1
     gold-300 #edc562 on #1f3fc4 ............. 4.97:1
   ========================================================================== */
@font-face {
  font-family: "Montserrat";
  src: url("/fonts/montserrat-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: light;

  /* Primitives */
  --navy: #0c1754;
  --navy-deep: #020617;
  --canvas: #f9f8f6;
  --paper: #ffffff;
  --cream: #f0e9e1;
  --lavender: #eaebf8;
  --muted-ink: #55596b;
  --field-line: #8a8d99;
  --charcoal: #171417;
  --gold-500: #e6a91f;
  --gold-600: #cc9010;
  --gold-300: #edc562;
  --gold-ink: #7a4e00;

  /* Roles used by style.css */
  --bg: var(--canvas);
  --card: var(--paper);
  --surface: var(--lavender);
  --border: var(--cream);
  --text: var(--charcoal);
  --muted: var(--muted-ink);
  --brand: var(--navy);
  --blue: var(--navy);
  --btn: var(--navy);
  --btn-hover: #16295a;
  --bar-ghost: #d9dbe8;
  --hero-from: var(--navy-deep);
  --hero-to: #1f3fc4;
  --hero-ink: #ffffff;
  --hero-muted: #dfe4fb;

  /* Roles used here */
  --heading: var(--navy);
  --field-border: var(--field-line);
  --focus-ring: var(--navy);
  --font: "Montserrat", system-ui, -apple-system, "Segoe UI", sans-serif;
  --radius-card: 16px;
  --shadow-card: 0 4px 24px rgb(12 23 84 / 0.06);
  --banner:
    radial-gradient(70% 90% at 100% 100%, rgb(91 132 242 / 0.55), transparent 70%),
    linear-gradient(160deg, var(--navy-deep) 0%, #0a1550 42%, #1f3fc4 100%);
}

body, body.reg-page {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
}
h1, h2, h3 { color: var(--heading); font-family: var(--font); }
h2, h3 { font-weight: 600; letter-spacing: -0.02em; }
input, select, textarea, button, .btn { font-family: var(--font); }

:where(a, button, input, select, textarea, summary, .opt):focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

/* ---------- Top bar ---------- */
.reg-bar { background: var(--bg); border-bottom: 1px solid var(--border); }
.reg-brand { font-weight: 700; font-size: 1.05rem; letter-spacing: -0.01em; color: var(--heading); }
.reg-brand span { color: var(--gold-ink); font-weight: 700; }
.reg-nav a { color: var(--muted); font-weight: 500; font-size: 14px; }
.reg-nav a:hover, .reg-nav a[aria-current="page"] { color: var(--heading); }
.reg-nav a[aria-current="page"] { font-weight: 600; border-bottom-color: var(--heading); }

/* ---------- Header banner ---------- */
.reg-hero {
  background: var(--banner);
  border-radius: 24px;
  box-shadow: none;
  padding: 34px 44px;
}
.reg-hero::before { display: none; }
.reg-hero h1 {
  color: #fff;
  font-weight: 700;
  font-size: clamp(2rem, 3.6vw, 3.25rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
}
.reg-hero h1 em { font-style: normal; color: var(--gold-300); }
.reg-hero .lead, .reg-hero p, .reg-venue { color: var(--hero-muted); }
.reg-facts { gap: 10px !important; }
.reg-facts li, .reg-facts li:first-child {
  color: #fff;
  font-size: 14px;
  background: rgb(255 255 255 / 0.06);
  border: 1px solid rgb(255 255 255 / 0.28);
  border-radius: 100px;
  padding: 7px 14px;
}
.reg-facts svg { color: var(--gold-300); }

/* ---------- Cards ---------- */
.reg-form .reg-sec, .reg-side .reg-sec, .staff-page .card, .stat {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
}
.reg-form .reg-sec, .reg-side .reg-sec { padding: 32px; margin: 0 0 20px; }
.reg-col > .reg-sec:last-child { border-bottom: 1px solid var(--border); margin-bottom: 20px; }

/* Numbered steps */
.reg-form { counter-reset: step; }
.reg-form .reg-sec > h2 {
  counter-increment: step;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.2rem;
  font-weight: 600;
  margin: 0 0 16px;
}
.reg-form .reg-sec > h2::before {
  content: counter(step);
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--heading);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* ---------- Fields ---------- */
.help, .hint { color: var(--muted); }
label { font-weight: 500; color: var(--text); }
input, select, textarea {
  background-color: var(--card);
  border: 1px solid var(--field-border);
  border-radius: 16px;
  font-size: 16px;
  color: var(--text);
  box-shadow: none;
}
input::placeholder, textarea::placeholder { color: var(--muted); }
input:focus-visible, select:focus-visible, textarea:focus-visible { border-color: var(--heading); }

/* Options (ticket, payment): selection is a navy edge on a lavender fill */
.opt { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-card); box-shadow: none; }
.opt:hover { border-color: var(--field-border); }
.opt:has(input:checked) {
  background: var(--surface) !important;
  border-color: var(--heading) !important;
  box-shadow: 0 0 0 0.5px var(--heading) inset;
}
.opt input[type="radio"], .check input[type="checkbox"] { accent-color: var(--heading); }
.opt-price, .opt:has(input:checked) .opt-price {
  background: var(--lavender) !important;
  color: var(--navy) !important;
  border-radius: 16px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

/* Order summary: a result, not a step */
.reg-side .reg-sec:has(.total) { background: var(--navy); border-color: transparent; box-shadow: none; color: #fff; }
.reg-side .reg-sec:has(.total) > h2 { counter-increment: none; color: #fff; }
.reg-side .reg-sec:has(.total) > h2::before { display: none; }
.reg-side .reg-sec:has(.total) .help { color: var(--lavender); }
.reg-side .reg-sec:has(.total) .total, .reg-side .reg-sec:has(.total) .total * { color: #fff; }
.reg-side .reg-sec:has(.total) #total {
  color: var(--gold-300) !important;
  font-weight: 700;
  font-size: 2rem;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

/* ---------- Buttons ---------- */
.btn { border-radius: 100px; box-shadow: none; }
.btn:not(.secondary):not(.danger) {
  background: var(--gold-500);
  color: var(--navy);
  border: 0;
  font-weight: 600;
  transition-property: background-color, scale;
  transition-duration: 150ms;
  transition-timing-function: ease-out;
}
.btn:not(.secondary):not(.danger):hover { background: var(--gold-600); }
@media (prefers-reduced-motion: no-preference) {
  .btn:not(:disabled):active { scale: 0.96; }
}
.btn.secondary {
  background: transparent;
  color: var(--heading);
  border: 1px solid var(--field-border);
  font-weight: 500;
}
.btn.secondary:hover { background: var(--surface); }
.reg-page #addAttendee { border-color: var(--field-border); color: var(--heading); }

/* Links */
.reg-page main a:not(.btn) { color: var(--heading); text-decoration: underline; text-decoration-color: var(--field-border); text-underline-offset: 3px; }
.reg-page main a:not(.btn):hover { text-decoration-color: var(--heading); }
.reg-secure svg { color: var(--muted); }

/* Sign-in page */
.login-brand { background: var(--banner); box-shadow: none; }

/* ==========================================================================
   Staff
   ========================================================================== */
.staff-page .panel > h2 { font-weight: 700; font-size: 1.75rem; letter-spacing: -0.03em; margin-top: 0; }
.staff-page .stats { gap: 14px; }
.stat b { color: var(--heading); font-weight: 600; font-variant-numeric: tabular-nums; }
.staff-page .stats > .stat:first-child { background: var(--navy); border-color: transparent; color: #fff; }
.staff-page .stats > .stat:first-child b { color: var(--gold-300); }
.sw.solid, .hbar-fill:not(.hatch) { background: var(--heading); }
table th { color: var(--muted); font-weight: 500; }
table td { border-color: var(--border); }
/* Chart labels are never cut short */
.hbar-label { overflow: visible; text-overflow: clip; white-space: normal; }
@media (min-width: 541px) {
  .hbar { grid-template-columns: max-content minmax(0, 1fr) var(--vw, auto); }
}

/* Scanner and name-tag pages keep a small logo in their banner */
.staff-page:not(.has-side) .reg-hero { padding: 22px 32px; }
.staff-page .reg-hero .reg-logo { max-height: 64px; width: auto; }

/* ---------- Side menu (staff console) ---------- */
body.has-side {
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
  min-height: 100dvh;
}
body.has-side > main.reg {
  grid-column: 2;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 24px clamp(20px, 3vw, 40px) 40px;
}
.has-side .reg-hero { display: block; padding: 22px 30px; margin-bottom: 24px; }
.has-side .reg-hero picture { display: none; }
.has-side .reg-hero h1 { font-size: 1.6rem; margin-bottom: 4px; }

.side {
  --focus-ring: var(--gold-300);
  grid-column: 1;
  position: sticky;
  top: 0;
  height: 100dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  padding: 22px 16px;
  background: var(--navy);
  color: var(--hero-muted);
}
.side-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 8px 22px;
  border-bottom: 1px solid rgb(255 255 255 / 0.1);
}
.side-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.side-brand img { width: 108px; height: auto; }
.side-brand span { color: var(--gold-300); font-weight: 700; font-size: 0.85rem; letter-spacing: 0.08em; text-transform: uppercase; }
.side-toggle { display: none; }
.side-menu { display: flex; flex-direction: column; flex: 1; }
.side-label {
  margin: 22px 12px 8px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #9ea6d6;
}
.side #tabs.tabs {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0;
  overflow: visible;
  background: none;
  border: 0;
  box-shadow: none;
  -webkit-mask-image: none;
  mask-image: none;
}
.side-links { display: flex; flex-direction: column; gap: 2px; }
.side .tab, .side-links a {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  min-height: 40px;
  padding: 9px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--hero-muted);
  font-size: 0.92rem;
  font-weight: 500;
  text-align: start;
  text-decoration: none;
  white-space: normal;
  box-shadow: none;
}
.side .tab:hover, .side-links a:hover { background: rgb(255 255 255 / 0.07); color: #fff; }
.side .tab.on, .side .tab.on:hover { background: rgb(255 255 255 / 0.09); color: var(--gold-300); font-weight: 600; }
.side .tab.on::before {
  content: "";
  position: absolute;
  inset-block: 9px;
  inset-inline-start: 0;
  width: 3px;
  border-radius: 3px;
  background: var(--gold-300);
}
.side-foot {
  display: grid;
  gap: 10px;
  margin-top: auto;
  padding: 16px 12px 0;
  border-top: 1px solid rgb(255 255 255 / 0.1);
}
.side-who { font-size: 0.82rem; color: #c3c9ea; overflow-wrap: anywhere; }
.side .signout-btn, .side-toggle {
  justify-self: start;
  padding: 7px 16px;
  border: 1px solid rgb(255 255 255 / 0.3);
  border-radius: 100px;
  background: transparent;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}
.side .signout-btn:hover, .side-toggle:hover { border-color: #fff; background: transparent; color: #fff; }

@media (max-width: 960px) {
  body.has-side { display: block; }
  body.has-side > main.reg { padding: 16px; }
  .side { z-index: 30; height: auto; max-height: 100dvh; padding: 12px 16px; }
  .side-head { padding: 0; border: 0; }
  .side-brand img { width: 84px; }
  .side-toggle { display: inline-flex; align-items: center; min-height: 40px; }
  .side-menu { display: none; padding-bottom: 8px; }
  .side-menu.open { display: flex; }
}
@media (max-width: 860px) {
  .reg-hero { padding: 24px; }
}
@media print {
  .side { display: none; }
  body.has-side { display: block; }
}

/* Banner meta (date and place): plain light-blue text, no pill.
   #b9cdff measures 5.16:1 on the lightest banner blue, 10.71:1 where it sits. */
.reg-hero .badge-gold, .reg-hero .badge-subtle, .reg-hero .side-who {
  display: inline;
  padding: 0;
  background: none;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  color: #b9cdff;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0;
}
