/* ChessCup public site. Fonts: Bricolage Grotesque and Inter (SIL Open Font License), self-hosted. */
@font-face {
  font-family: "Bricolage Grotesque";
  font-style: normal;
  font-weight: 600 800;
  font-display: swap;
  src: url("../fonts/bricolage-grotesque-latin.ada540c0e24a.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/inter-latin-ext.1ad231aac0a8.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/inter-latin.260c81a4759b.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --navy: #0f2a44;
  --navy-hover: #1f4d7a;
  --gold: #f2b233;
  --gold-hover: #e5a41f;
  --gold-strong: #c98a00;
  --gold-ink: #8a5a00;
  --gold-tint: #fdf1d6;
  --gold-line: #f2d89a;
  --gold-text: #5c4300;
  --bg: #f6f7f9;
  --surface: #ffffff;
  --line: #e3e7ec;
  --line-strong: #c9d2dc;
  --chip: #eef2f6;
  --text: #0f2a44;
  --text-2: #42566b;
  --muted: #5a6b7d;
  --hero-sub: #c9d6e3;
  --green: #2e8b57;
  --red: #b3261e;
  --red-tint: #fdecea;
  --radius: 14px;
  --radius-sm: 10px;
  --font-display: "Bricolage Grotesque", system-ui, sans-serif;
  --font-body: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
img, svg { max-width: 100%; }
a { color: var(--navy); }
a:hover { color: var(--navy-hover); }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.15; margin: 0; }
p { margin: 0 0 1rem; }
code { font-family: ui-monospace, "Cascadia Mono", Menlo, monospace; font-size: 0.9em; background: var(--chip); padding: 0.1em 0.35em; border-radius: 4px; word-break: break-all; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

.wrap { max-width: 1120px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }
@media (max-width: 480px) { .wrap { padding-left: 16px; padding-right: 16px; } }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Header and footer */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.site-header .wrap { padding-top: 16px; padding-bottom: 16px; display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-mark { width: 40px; height: 40px; border-radius: 10px; background: var(--navy); display: flex; align-items: center; justify-content: center; flex: none; }
.brand-text { display: flex; flex-direction: column; }
.brand-name { font-family: var(--font-display); font-weight: 800; font-size: 20px; line-height: 1.1; }
.brand-sub { font-size: 12px; color: var(--muted); }
.site-nav { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 15px; font-weight: 500; }
.site-nav a { padding: 10px 14px; border-radius: 8px; text-decoration: none; }
.site-nav a[aria-current="page"] { background: var(--chip); }
.site-nav a.nav-outline { border: 1px solid var(--line-strong); padding: 9px 16px; }
.back-link { font-size: 15px; font-weight: 500; text-decoration: none; }
.header-title { font-family: var(--font-display); font-weight: 800; font-size: 18px; }

.site-footer { border-top: 1px solid var(--line); background: var(--surface); }
.site-footer .wrap { padding-top: 24px; padding-bottom: 24px; display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; font-size: 14px; color: var(--muted); }

/* Buttons */
.btn, button, [role="button"] {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 12px 22px;
  border: 0; border-radius: var(--radius-sm);
  background: var(--navy); color: #fff;
  font: inherit; font-size: 15px; font-weight: 600; line-height: 1.2;
  text-decoration: none; cursor: pointer; text-align: center;
}
.btn:hover, button:hover, [role="button"]:hover { background: var(--navy-hover); color: #fff; }
.btn-gold { background: var(--gold); color: var(--navy); font-weight: 700; font-size: 16px; padding: 14px 24px; }
.btn-gold:hover { background: var(--gold-hover); color: var(--navy); }
.btn-ghost { background: transparent; color: var(--navy); font-weight: 500; padding: 12px 16px; }
.btn-ghost:hover { background: var(--chip); color: var(--navy); }
.btn-secondary, button.secondary { background: var(--surface); color: var(--navy); border: 1px solid var(--line-strong); }
.btn-secondary:hover, button.secondary:hover { background: var(--chip); color: var(--navy); }
.btn-block { width: 100%; }
.btn-lg { min-height: 54px; font-size: 17px; }

/* Cards, pills and the date tile */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.card > :last-child { margin-bottom: 0; }
.pill { display: inline-block; font-size: 13px; font-weight: 600; padding: 6px 10px; border-radius: 999px; background: var(--chip); color: var(--text-2); }
.pill-gold { background: var(--gold-tint); color: var(--gold-ink); }
.pill-green { background: #e3f3ea; color: #1d6b40; }

.date-tile { width: 64px; height: 68px; border-radius: 12px; background: var(--chip); display: flex; flex-direction: column; align-items: center; justify-content: center; flex: none; }
.date-tile .mon { font-size: 12px; font-weight: 600; letter-spacing: 0.08em; color: var(--muted); text-transform: uppercase; }
.date-tile .day { font-family: var(--font-display); font-size: 28px; font-weight: 800; line-height: 1; }
.date-tile.dark { background: var(--navy); color: #fff; }
.date-tile.dark .mon { color: var(--gold); }
.date-tile.lg { width: 68px; height: 72px; }
.date-tile.lg .day { font-size: 30px; }

.meter { height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; }
.meter > span { display: block; height: 100%; min-width: 4px; border-radius: 999px; background: var(--green); }
.meter.thin { height: 6px; }
.meter.full > span { background: var(--gold-strong); }
.places-label { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; margin-bottom: 6px; }
.places-label strong { font-weight: 600; }

/* Home: hero */
.hero { background: var(--navy); color: #fff; }
.hero .wrap { padding-top: 48px; padding-bottom: 56px; display: flex; flex-wrap: wrap; gap: 40px; align-items: center; }
.hero-copy { flex: 1 1 420px; min-width: 0; }
.eyebrow { margin: 0 0 12px; font-size: 14px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--gold); }
.hero h1 { margin: 0 0 16px; font-weight: 800; font-size: clamp(34px, 5vw, 48px); line-height: 1.05; }
.hero-lede { margin: 0; font-size: 18px; line-height: 1.55; color: var(--hero-sub); }
.next-card { flex: 1 1 360px; min-width: 0; background: var(--surface); color: var(--text); border-radius: 16px; padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.next-card .top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.next-card .event { display: flex; gap: 16px; align-items: center; }
.next-card h2 { margin: 0 0 4px; font-size: 24px; font-weight: 700; }
.next-card h2 a { text-decoration: none; }
.next-card .when { margin: 0; font-size: 15px; color: var(--text-2); }
.next-card .buy { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.price { font-size: 22px; font-weight: 700; }
.price small { font-size: 14px; font-weight: 400; color: var(--muted); }

/* Home: list */
.page { padding-top: 48px; padding-bottom: 56px; }
.section-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 20px; }
.section-head h2 { font-size: 30px; font-weight: 800; }
.section-head p { margin: 0; font-size: 15px; color: var(--muted); }
.event-list { display: flex; flex-direction: column; gap: 12px; }
.event-row { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 24px; display: flex; flex-wrap: wrap; gap: 20px; align-items: center; }
.event-row .info { flex: 1 1 280px; min-width: 0; }
.event-row h3 { margin: 0 0 4px; font-size: 21px; font-weight: 700; }
.event-row h3 a { text-decoration: none; }
.event-row .when { margin: 0; font-size: 15px; color: var(--text-2); }
.event-row .capacity { flex: 0 1 200px; min-width: 160px; }
.event-row .capacity .places-label { font-weight: 600; }
.event-row .actions { display: flex; gap: 8px; align-items: center; justify-content: flex-end; min-width: 190px; }
@media (max-width: 600px) {
  .event-row { padding: 18px; gap: 16px; }
  .event-row .info { flex: 1 1 0; }
  .event-row .actions { min-width: 0; width: 100%; }
  .event-row .capacity { flex-basis: 100%; }
}
.status-text { font-size: 15px; font-weight: 600; color: var(--muted); padding: 12px 0; }

.steps { margin-top: 48px; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.step-num { font-family: var(--font-display); font-size: 28px; font-weight: 800; color: var(--gold-strong); }
.steps h3 { margin: 8px 0 6px; font-family: var(--font-body); font-size: 17px; font-weight: 700; }
.steps p { margin: 0; font-size: 15px; line-height: 1.5; color: var(--text-2); }

.past { margin-top: 48px; }
.past h2 { font-size: 22px; font-weight: 700; margin-bottom: 12px; }
.past ul { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.past li { background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; font-size: 14px; color: var(--text-2); }

.empty { text-align: center; padding: 40px 24px; }
.empty h2 { font-size: 24px; margin-bottom: 8px; }

/* Entry page */
.page-tight { padding-top: 32px; padding-bottom: 56px; }
.page-title { margin: 0 0 6px; font-size: clamp(28px, 4vw, 36px); font-weight: 800; }
.page-lede { margin: 0 0 24px; font-size: 16px; color: var(--text-2); }
.entry-layout { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.entry-main { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.entry-aside { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
@media (min-width: 900px) { .entry-aside { position: sticky; top: 16px; } }

fieldset.card { margin: 0; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
fieldset.card legend { padding: 0; float: left; width: 100%; font-family: var(--font-display); font-size: 20px; font-weight: 700; }
fieldset.card legend + * { clear: both; }
.legend-num { color: var(--gold-strong); margin-right: 0.5em; }
.field-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }

.field > label, .field-label { display: block; font-size: 14px; font-weight: 600; }
.field-label { margin-bottom: 6px; }
.optional { font-weight: 400; color: var(--muted); }
input[type="text"], input[type="email"], input[type="tel"], input[type="password"], input[type="number"], input[type="date"], input:not([type]), select, textarea {
  display: block; width: 100%; margin-top: 6px;
  min-height: 48px; padding: 0 14px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text);
  font: inherit; font-size: 16px; font-weight: 400;
}
textarea { padding: 12px 14px; }
select { padding: 0 10px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(242, 178, 51, 0.45); }
input[aria-invalid="true"], select[aria-invalid="true"] { border-color: var(--red); }
.helptext { display: block; margin: 6px 0 0; font-size: 13px; color: var(--muted); font-weight: 400; }
.errorlist { list-style: none; padding: 0; margin: 6px 0 0; font-size: 14px; font-weight: 600; color: var(--red); }

.dob { display: grid; grid-template-columns: minmax(60px, 90px) minmax(120px, 1fr) minmax(76px, 120px); gap: 8px; max-width: 420px; }
@media (max-width: 480px) { .card { padding: 18px; } .dob input { padding: 0 10px; } }
.dob label { font-size: 12px; font-weight: 400; color: var(--muted); }
.dob input, .dob select { margin-top: 4px; }
.section-preview { font-size: 15px; color: var(--text-2); }
.section-preview:empty { display: none; }
.section-preview strong { color: var(--navy); }

.choices > div { display: flex; flex-wrap: wrap; gap: 8px; }
.choices > div > div { display: contents; }
.choices label { display: flex; gap: 8px; align-items: center; font-size: 15px; font-weight: 400; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 12px 16px; cursor: pointer; background: var(--surface); }
.choices label:has(input:checked) { border: 2px solid var(--navy); padding: 11px 15px; }
.choices input, .check input { accent-color: var(--navy); }
.choices input { margin: 0; width: 18px; height: 18px; }

.check { display: flex; gap: 12px; align-items: flex-start; font-size: 15px; line-height: 1.45; cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 1px 0 0; flex: none; }
.divider { border-top: 1px solid var(--chip); padding-top: 14px; }

.summary { display: flex; flex-direction: column; gap: 16px; }
.summary .event { display: flex; gap: 14px; align-items: center; }
.summary .event .date-tile { width: 60px; height: 64px; }
.summary .event .date-tile .mon { font-size: 11px; }
.summary .event .date-tile .day { font-size: 26px; }
.summary-name { font-family: var(--font-display); font-size: 19px; font-weight: 700; line-height: 1.2; }
.summary-when { font-size: 14px; color: var(--text-2); }
.facts { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: 14px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.fee-row { border-top: 1px solid var(--line); padding-top: 16px; display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.fee-row .label { font-size: 15px; font-weight: 600; }
.fee-row .amount { font-family: var(--font-display); font-size: 28px; font-weight: 800; }
.fine-print { margin: 0; font-size: 13px; line-height: 1.5; color: var(--muted); }
.sections-list { margin: 0; padding: 0; list-style: none; }
.sections-list li + li { margin-top: 2px; }

.notice { border-radius: var(--radius); padding: 18px 20px; border: 1px solid var(--gold-line); background: var(--gold-tint); color: var(--gold-text); }
.notice strong { color: var(--navy); }
.notice > :last-child { margin-bottom: 0; }
.notice-error { border-color: #f1b8b3; background: var(--red-tint); color: var(--red); }

/* Flash messages */
.flashes { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.flash { padding: 14px 18px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--navy); }
.flash-error { border-left-color: var(--red); }
.flash-success { border-left-color: var(--green); }
.flash-info, .flash-warning { border-left-color: var(--gold); }

/* Confirmation page */
.confirm-head { display: flex; gap: 16px; align-items: center; margin-bottom: 20px; }
.confirm-icon { width: 52px; height: 52px; border-radius: 50%; background: var(--green); color: #fff; display: flex; align-items: center; justify-content: center; flex: none; }
.confirm-icon.pending { background: var(--gold); color: var(--navy); }
.confirm-icon.neutral { background: var(--muted); }
.confirm-card { max-width: 720px; }
.confirm-card .facts { font-size: 15px; gap: 10px 20px; }

.status { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; background: var(--chip); color: var(--text-2); }
.status-confirmed, .status-checked_in, .status-paid, .status-needs_review { background: #e3f3ea; color: #1d6b40; }
.status-withdrawn, .status-expired { background: #eceff2; color: var(--muted); }

/* Simple content pages (privacy, staff sign-in, platform landing) */
.narrow { max-width: 720px; }
.narrow-sm { max-width: 460px; margin: 0 auto; }
.prose h1 { font-size: clamp(28px, 4vw, 36px); font-weight: 800; margin-bottom: 12px; }
.prose h2 { font-size: 22px; font-weight: 700; margin: 28px 0 8px; }
.prose ul, .prose ol { padding-left: 1.25rem; margin: 0 0 1rem; }
.prose li + li { margin-top: 4px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.button-row { display: flex; flex-wrap: wrap; gap: 8px; }
