/*
 * Public site. Tokens come from tokens.css (loaded first). Mobile first: most
 * visitors arrive from a WhatsApp link on a phone.
 *
 * Visual language: black club header and footer, light-grey page with white
 * blocks, Bebas Neue headings, black buttons with yellow text. The signature
 * is the diagonal yellow "sash" of the kit (.sash, homepage hero, thank-you).
 * The homepage breaks out of the white blocks: full-width colour bands like a
 * supporters' scarf (§ 3).
 * Status is never colour alone: text + icon everywhere.
 *
 * Sections: 1 shell · 2 shared components · 3 homepage · 4 form page ·
 * 5 availability check · 6 waitlist · 7 thank-you / messages · 8 footer
 */

/* ── 1. Shell ─────────────────────────────────────────────────────────────── */

/* Focused elements never end up under the sticky preview bar (WCAG 2.4.11). */
html {
  scroll-padding-top: 4.5rem;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.skip-link {
  position: absolute;
  left: var(--space-3);
  top: -4rem;
  z-index: 20;
  padding: var(--space-2) var(--space-3);
  background: var(--color-yellow);
  color: var(--color-black);
  font-weight: 700;
  border-radius: var(--radius);
}
.skip-link:focus {
  top: var(--space-2);
}

.site-header {
  background: var(--color-black);
  color: var(--color-white);
  border-bottom: 6px solid var(--color-yellow);
}
.site-header :focus-visible {
  outline-color: var(--color-yellow);
}
.site-header__inner {
  max-width: var(--wide-width);
  margin: 0 auto;
  padding: var(--space-2) var(--space-3);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.site-header__logo {
  display: inline-flex;
  flex: none;
}
.site-header__logo img {
  display: block;
  width: 48px;
  height: 48px;
}
.site-header__home {
  display: flex;
  flex-direction: column;
  min-height: 2.75rem;
  justify-content: center;
  color: var(--color-white);
  text-decoration: none;
  font-family: var(--font-heading);
  line-height: 0.95;
}
.site-header__club {
  font-size: 1.5rem;
  letter-spacing: 0.03em;
}
.site-header__app {
  font-size: 1.125rem;
  color: var(--color-yellow);
  letter-spacing: 0.06em;
}
.site-header__inner {
  flex-wrap: wrap;
}
/* Mobile: the menu gets its own row under the logo. */
.site-nav {
  flex-basis: 100%;
  padding-bottom: var(--space-2);
}
.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}
.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 2.5rem;
  padding: 0 var(--space-3);
  border: 2px solid rgb(255 255 255 / 0.45);
  border-radius: 999px;
  color: var(--color-white);
  font-weight: 600;
  text-decoration: none;
  transition: border-color 0.15s, background-color 0.15s;
}
.site-nav a:hover {
  border-color: var(--color-white);
}
.site-nav a[aria-current="page"] {
  background: var(--color-yellow);
  border-color: var(--color-yellow);
  color: var(--color-black);
}
.site-nav__back-item {
  margin-left: auto;
}
.site-nav .site-nav__back {
  padding: 0;
  border: 0;
  border-radius: 0;
  color: var(--color-yellow);
  font-size: 0.9375rem;
  white-space: nowrap;
}
.site-nav .site-nav__back:hover {
  text-decoration: underline;
}
@media (min-width: 48rem) {
  .site-header__inner {
    flex-wrap: nowrap;
    padding-block: var(--space-3);
  }
  .site-header__logo img {
    width: 56px;
    height: 56px;
  }
  .site-header__club {
    font-size: 1.75rem;
  }
  .site-header__app {
    font-size: 1.25rem;
  }
  .site-nav {
    flex-basis: auto;
    margin-left: auto;
    padding: 0;
  }
  .site-nav__back-item {
    margin-left: var(--space-3);
  }
}

/* Draft preview (src/forms/public-routes.tsx): always visible, never mistaken for the live site. */
.preview-bar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--color-yellow);
  color: var(--color-black);
  font-weight: 700;
  text-align: center;
  padding: var(--space-2) var(--space-3);
  border-bottom: 3px solid var(--color-black);
}
.preview-bar p {
  margin: 0;
}
.preview-bar .preview-bar__hint {
  font-weight: 400;
}

.site-main {
  flex: 1 0 auto;
  width: 100%;
  max-width: var(--content-width);
  margin: 0 auto;
  padding: var(--space-4) var(--space-3) var(--space-6);
}
.site-main:focus {
  outline: none;
}
@media (min-width: 48rem) {
  .site-main {
    padding-top: var(--space-5);
  }
}

/* ── 2. Shared components ─────────────────────────────────────────────────── */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* White block on the grey page. */
.page-intro,
.form-page {
  background: var(--color-white);
  border-radius: var(--radius-block);
  box-shadow: var(--shadow-block);
  padding: var(--space-4) var(--space-3);
}
@media (min-width: 36rem) {
  .page-intro,
  .form-page {
    padding: var(--space-5);
  }
}

.button {
  font: inherit;
  font-weight: 700;
  font-size: 1.0625rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  min-height: 3rem;
  padding: var(--space-2) var(--space-4);
  background: var(--color-black);
  color: var(--color-yellow);
  border: 2px solid var(--color-black);
  border-radius: var(--radius);
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s var(--ease-out), box-shadow 0.15s;
}
.button:hover {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}
.button:active {
  transform: translateY(1px);
}
.button:disabled {
  cursor: progress;
  opacity: 0.75;
}
/* Arrow drawn with a mask (no glyphs), slides on hover. */
.button--arrow::after {
  content: "";
  width: 1.1em;
  height: 1.1em;
  background: currentColor;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M3 10h12M11 5l5 5-5 5' fill='none' stroke='%23000' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")
    center / contain no-repeat;
  transition: transform 0.2s var(--ease-out);
}
.button--arrow:hover::after {
  transform: translateX(3px);
}
/* On light surfaces next to a primary button. */
.button--secondary {
  background: var(--color-white);
  color: var(--color-black);
}

/* Small status label: text + dot, never colour alone. */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  align-self: flex-start;
  margin: 0;
  padding: 0.2rem 0.75rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.9375rem;
  line-height: 1.4;
}
.chip::before {
  content: "";
  width: 0.55em;
  height: 0.55em;
  border-radius: 50%;
  background: currentColor;
}
.chip--open {
  background: var(--color-yellow);
  color: var(--color-black);
}
.chip--muted {
  background: var(--color-surface-2);
  color: var(--color-text);
}
.chip--muted::before {
  background: transparent;
  border: 2px solid currentColor;
}

.rich-text > :first-child,
.form-text > :first-child {
  margin-top: 0;
}
.rich-text > :last-child,
.form-text > :last-child {
  margin-bottom: 0;
}
.rich-text p + p {
  margin-top: var(--space-2);
}
.rich-text h2,
.rich-text h3 {
  margin-top: var(--space-4);
}
.form-text blockquote,
/* Images from the media library inside rich text (alt text is required). */
.rich-text img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: var(--space-3) 0;
  border-radius: var(--radius-block);
}
.rich-text blockquote {
  margin: var(--space-3) 0;
  padding: var(--space-2) var(--space-3);
  background: var(--color-yellow-tint);
  border-radius: var(--radius);
}

/* ── 3. Homepage (src/homepage/home-view.tsx) ─────────────────────────────── */
/*
 * The supporters' scarf: full-width bands in club colours, one left edge.
 * Black band (photo + heading on a scrim, intro, one yellow stripe per form)
 * → woven motto strip → white band (body) → grey band (bodyAfter, ordered
 * lists as a step strip) → black footer. The actions sit straight under the
 * hero so a parent from WhatsApp reaches them without scrolling past text.
 * One authored motion: the kit sash sweeps up the hero while the heading
 * settles (reduced motion: static).
 */

.site-main:has(> .home) {
  max-width: none;
  padding: 0;
}
.home-band__inner {
  width: 100%;
  max-width: var(--wide-width);
  margin-inline: auto;
  padding-inline: var(--space-3);
}

/* Black band: hero + forms. Focus rings turn yellow on black. */
.home-band--black {
  background: var(--color-black);
  color: var(--color-white);
}
.home-band--black :focus-visible {
  outline-color: var(--color-yellow);
}

.home-hero__media {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  height: clamp(16.5rem, 68vw, 26rem);
  background: var(--color-ink);
}
.home-hero__image {
  position: absolute;
  inset: 0;
  z-index: -2;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 30%;
}
/* Scrim: the heading always sits on ≥ 55 % black, whatever the photo (white text ≥ 3.9:1 worst case). */
.home-hero__media::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(
    to top,
    rgb(0 0 0 / 0.92) 0%,
    rgb(0 0 0 / 0.72) 28%,
    rgb(0 0 0 / 0.55) 46%,
    rgb(0 0 0 / 0) 78%
  );
}
/* No photo yet: black pinstripes and the crest; the sash supplies the yellow. */
.home-hero__media--fallback {
  height: clamp(14rem, 54vw, 22rem);
}
.home-hero__media--fallback::after {
  display: none;
}
.home-hero__image--fallback {
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
  padding: var(--space-4) var(--space-3);
  background:
    repeating-linear-gradient(118deg, rgb(255 255 255 / 0.04) 0 2px, transparent 2px 14px),
    var(--color-black);
}
.home-hero__crest {
  width: clamp(4.5rem, 18vw, 8.5rem);
  height: auto;
}
/* The kit sash: two yellow stripes rising from the bottom-right corner. */
.home-hero__sash {
  position: absolute;
  right: -3.5rem;
  bottom: 0;
  z-index: 0;
  width: clamp(5.5rem, 15vw, 13rem);
  height: 100%;
  background: linear-gradient(90deg, var(--color-yellow) 0 58%, transparent 58% 74%, var(--color-yellow) 74% 100%);
  transform: skewX(-28deg);
  transform-origin: bottom;
  animation: sash-in 0.9s 0.1s var(--ease-out) both;
}
.home-hero__head {
  position: relative;
  z-index: 1;
  padding-bottom: var(--space-4);
}
.home-hero__title {
  margin: 0;
  max-width: 11em;
  padding-right: 3.5rem; /* room for the sash */
  color: var(--color-white);
  font-size: clamp(3rem, 13vw, 6rem);
  line-height: 0.9;
  letter-spacing: 0.01em;
  text-shadow: 0 2px 16px rgb(0 0 0 / 0.5);
  animation: title-in 0.8s 0.05s var(--ease-out) both;
}
.home-hero__intro {
  max-width: 40rem;
  margin: var(--space-4) 0;
  color: #ebebeb; /* 16:1 on black */
  font-size: 1.0625rem;
  line-height: 1.5;
}
@keyframes sash-in {
  from {
    clip-path: inset(100% 0 0 0);
  }
  to {
    clip-path: inset(0);
  }
}
@keyframes title-in {
  from {
    transform: translateY(0.25em);
  }
  to {
    transform: none;
  }
}
@media (min-width: 48rem) {
  .home-hero__media {
    height: clamp(24rem, 44vw, 36rem);
  }
  .home-hero__media--fallback {
    height: clamp(18rem, 26vw, 22rem);
  }
  .home-hero__image--fallback {
    padding: var(--space-5) calc(var(--space-5) + 12vw) var(--space-5) var(--space-5);
  }
  .home-hero__sash {
    right: -2rem;
  }
  .home-hero__head {
    padding-bottom: var(--space-5);
  }
  .home-hero__title {
    padding-right: 0;
  }
  .home-hero__intro {
    margin: var(--space-4) 0 var(--space-5);
    font-size: 1.1875rem;
  }
}

/* Forms: one full-width yellow stripe per form. */
.home-forms {
  padding-bottom: var(--space-5);
}
.home-forms__empty {
  margin: 0;
  max-width: 40rem;
  padding: var(--space-4) var(--space-3);
  border: 2px solid #6b6b6b;
  border-radius: var(--radius);
  color: var(--color-white);
}
.form-cards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-2);
}
.form-card {
  position: relative;
  display: grid;
  overflow: hidden;
  background: var(--color-yellow);
  color: var(--color-black);
  border-radius: var(--radius);
  transition: background-color 0.2s var(--ease-out);
}
.form-card :focus-visible {
  outline-color: var(--color-black);
}
.form-card:has(.form-card__link:focus-visible) {
  outline: 3px solid var(--color-yellow);
  outline-offset: 3px;
}
.form-card:hover {
  background: #fff25a;
}
/* Woven pinstripes behind the arrow: the jacquard of the scarf. */
.form-card::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 10rem;
  pointer-events: none;
  background: linear-gradient(
    118deg,
    transparent 0 46%,
    rgb(0 0 0 / 0.09) 46% 60%,
    transparent 60% 68%,
    rgb(0 0 0 / 0.09) 68% 73%,
    transparent 73%
  );
}
.form-card__image {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 7;
  object-fit: cover;
}
.form-card__body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-2);
  padding: var(--space-4) var(--space-3) var(--space-3);
}
.form-card__title {
  margin: 0;
  font-size: clamp(2.5rem, 11vw, 4rem);
  line-height: 0.9;
}
.form-card__description {
  margin: 0;
  max-width: 38rem;
  color: #1f1f1f; /* 14:1 on yellow */
}
.form-card .chip {
  margin-top: var(--space-1);
}
.form-card .chip--open {
  background: var(--color-black);
  color: var(--color-yellow);
}
.form-card .chip--muted {
  background: var(--color-white);
  color: var(--color-black);
}
/* The action: a black bar with yellow text; the whole stripe is its hit area. */
.form-card__link {
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  min-height: 3.25rem;
  margin: 0 var(--space-3) var(--space-3);
  padding: 0 var(--space-3);
  background: var(--color-black);
  color: var(--color-yellow);
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 1.125rem;
  text-decoration: none;
}
.form-card__link::before {
  content: "";
  position: absolute;
  inset: 0;
}
.form-card__link::after {
  content: "";
  flex: none;
  width: 1.35em;
  height: 1.35em;
  background: currentColor;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M3 10h12M11 5l5 5-5 5' fill='none' stroke='%23000' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")
    center / contain no-repeat;
  transition: transform 0.25s var(--ease-out);
}
.form-card:hover .form-card__link {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}
.form-card:hover .form-card__link::after {
  transform: translateX(4px);
}
/* Not open yet / closed: a dark stripe, the status in words (chip). */
.form-card--closed {
  background: var(--color-ink);
  color: var(--color-white);
  box-shadow: inset 0 0 0 2px #5c5c5c;
}
.form-card--closed:hover {
  background: #222222;
}
.form-card--closed::after {
  display: none;
}
.form-card--closed :focus-visible {
  outline-color: var(--color-yellow);
}
.form-card--closed .form-card__description {
  color: #d9d9d9;
}
.form-card--closed .form-card__link {
  background: transparent;
  color: var(--color-white);
  box-shadow: inset 0 0 0 2px var(--color-white);
}
@media (min-width: 48rem) {
  .form-cards {
    gap: var(--space-3);
  }
  .form-card {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    min-height: 9.5rem;
  }
  .form-card--with-image {
    grid-template-columns: 15rem minmax(0, 1fr) auto;
  }
  .form-card__image {
    height: 100%;
    aspect-ratio: auto;
    clip-path: polygon(0 0, 100% 0, calc(100% - 2.75rem) 100%, 0 100%);
  }
  .form-card__body {
    padding: var(--space-4) var(--space-5);
  }
  .form-card--with-image .form-card__body {
    padding-left: var(--space-3);
  }
  .form-card__link {
    margin: var(--space-4) var(--space-5) var(--space-4) 0;
    min-height: 3.5rem;
    padding: 0 var(--space-4);
    font-size: 1.1875rem;
  }
}

/* The woven motto strip between the black band and the texts. */
.home-scarf {
  overflow: hidden;
  padding-block: 1.1rem 0.95rem;
  background:
    linear-gradient(var(--color-black), var(--color-black)) 0 6px / 100% 3px no-repeat,
    linear-gradient(var(--color-black), var(--color-black)) 0 calc(100% - 6px) / 100% 3px no-repeat,
    var(--color-yellow);
  color: var(--color-black);
}
.home-scarf__row {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  width: max-content;
  margin-left: -1.5rem;
  font-family: var(--font-heading);
  font-size: clamp(1.5rem, 4vw, 2rem);
  line-height: 1;
  letter-spacing: 0.05em;
  white-space: nowrap;
}
.home-scarf__word {
  padding-top: 0.08em;
}
.home-scarf__mark {
  width: 0.9em;
  height: 0.36em;
  background: var(--color-black);
  transform: skewX(-28deg);
}

/* Text bands (CMS rich text): one left edge with the hero, a readable measure. */
.home-band--white,
.home-band--grey {
  padding-block: var(--space-5) var(--space-6);
}
.home-band--white {
  background: var(--color-white);
}
.home-band--grey {
  background: var(--color-bg);
}
.home-band .rich-text {
  font-size: 1.125rem;
}
.home-band .rich-text > :is(p, ul, blockquote, h3, h4, img) {
  max-width: 44rem;
}
.home-band .rich-text h2 {
  margin: var(--space-5) 0 var(--space-3);
  font-size: clamp(2.75rem, 10vw, 4.25rem);
  line-height: 0.92;
}
.home-band .rich-text > h2:first-child {
  margin-top: 0;
}
/* Bullets: small kit sashes. */
.home-band .rich-text ul {
  list-style: none;
  padding: 0;
}
.home-band .rich-text ul > li {
  position: relative;
  margin: var(--space-2) 0;
  padding-left: 1.75rem;
}
.home-band .rich-text ul > li::before {
  content: "";
  position: absolute;
  left: 0.15rem;
  top: 0.62em;
  width: 0.9rem;
  height: 0.4rem;
  background: var(--color-black);
  transform: skewX(-28deg);
}
.home-band .rich-text li > p {
  margin: 0;
}
/* Ordered lists read as steps: numbered sash badges joined by a line. */
.home-band .rich-text ol {
  list-style: none;
  counter-reset: step;
  display: grid;
  gap: var(--space-4);
  margin: var(--space-4) 0;
  padding: 0;
}
.home-band .rich-text ol > li {
  counter-increment: step;
  position: relative;
  min-height: 3rem;
  padding: 0.55rem 0 0 4rem;
}
.home-band .rich-text ol > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  padding-top: 0.1em;
  background: var(--color-black);
  color: var(--color-yellow);
  font-family: var(--font-heading);
  font-size: 1.875rem;
  line-height: 1;
  clip-path: polygon(14% 0, 100% 0, 86% 100%, 0 100%);
}
.home-band .rich-text ol > li:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 1.4rem;
  top: 3.5rem;
  bottom: calc(-1 * var(--space-4) + 0.5rem);
  width: 3px;
  background: var(--color-black);
}
@media (min-width: 48rem) {
  .home-band--white,
  .home-band--grey {
    padding-block: var(--space-6);
  }
  .home-band .rich-text ol {
    grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
    margin: var(--space-5) 0;
  }
  .home-band .rich-text ol > li {
    padding: 4.25rem var(--space-3) 0 0;
  }
  .home-band .rich-text ol > li:not(:last-child)::after {
    left: 3.75rem;
    right: calc(-1 * var(--space-4) + 0.5rem);
    top: 1.4rem;
    bottom: auto;
    width: auto;
    height: 3px;
  }
}
/* Wide screens: a text that opens with a heading gets the heading in its own column. */
@media (min-width: 60rem) {
  .home-band--white .rich-text:has(> h2:first-child) {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    column-gap: var(--space-6);
    align-items: start;
  }
  .home-band--white .rich-text:has(> h2:first-child) > * {
    grid-column: 2;
  }
  .home-band--white .rich-text:has(> h2:first-child) > h2 {
    grid-column: 1;
    margin-top: 0;
  }
  .home-band--white .rich-text:has(> h2:first-child) > h2 + * {
    margin-top: 0;
  }
}

/* ── 4. Form page (src/forms/form-view.tsx) ───────────────────────────────── */

.form-page > h1 {
  margin-bottom: var(--space-4);
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4) var(--space-3);
}
@media (min-width: 36rem) {
  .form-grid {
    grid-template-columns: 1fr 1fr;
  }
  .form-field--full,
  .form-actions {
    grid-column: 1 / -1;
  }
}
.form-grid--closed {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
}
.form-grid--closed :disabled {
  opacity: 0.6;
}

/* Planning notices on a form page ("opens on", closed text). */
.form-notice {
  margin: 0 0 var(--space-4);
  padding: var(--space-3);
  border-radius: var(--radius);
  background: var(--color-yellow-tint);
  font-weight: 600;
}
.form-notice p {
  margin: 0;
}
.form-notice p + p {
  margin-top: var(--space-2);
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  min-width: 0;
}
.form-field label {
  font-weight: 600;
}
.form-field__required {
  font-weight: 400;
  color: var(--color-muted);
}
.form-field input,
.form-field textarea,
.form-field select {
  font: inherit;
  width: 100%;
  min-height: 3rem;
  padding: var(--space-2) 0.75rem;
  border: 2px solid var(--color-control);
  border-radius: var(--radius);
  background: var(--color-white);
  color: var(--color-text);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.form-field input:hover,
.form-field textarea:hover,
.form-field select:hover {
  border-color: var(--color-black);
}
.form-field input:focus-visible,
.form-field textarea:focus-visible,
.form-field select:focus-visible {
  border-color: var(--color-black);
  box-shadow: 0 0 0 3px var(--color-yellow);
}
.form-field textarea {
  resize: vertical;
  min-height: 7rem;
}
.form-field input::placeholder,
.form-field textarea::placeholder {
  color: #6b6b6b; /* 5.3:1 on white */
}
.form-field input[readonly] {
  background: var(--color-surface-2);
  border-style: dashed;
}
.form-field--invalid input,
.form-field--invalid textarea,
.form-field--invalid select {
  border-color: var(--color-error);
  background: var(--color-error-bg);
}
.form-field__labelrow {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.form-field__hint {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--color-muted);
}
.form-field__error {
  display: flex;
  gap: 0.4em;
  margin: 0;
  color: var(--color-error);
  font-weight: 600;
}
.form-field__error::before {
  content: "";
  flex: none;
  width: 1.1em;
  height: 1.1em;
  margin-top: 0.2em;
  background: currentColor;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='10' cy='10' r='8.5'/%3E%3Cpath d='M10 5.5v5.5M10 14.2v.1'/%3E%3C/svg%3E")
    center / contain no-repeat;
}

/* Section headings and text blocks from the form builder: full row. */
.form-heading,
.form-text,
.form-block {
  grid-column: 1 / -1;
}
.form-heading {
  margin: var(--space-4) 0 0;
  padding-top: var(--space-4);
  border-top: 1px solid var(--color-line);
  font-size: 2rem;
}
.form-heading::after {
  content: "";
  display: block;
  width: 3rem;
  height: 5px;
  margin-top: var(--space-2);
  background: var(--color-yellow);
}
.form-text a {
  color: var(--color-text);
}
/* Conditions: the browser script hides fields whose condition doesn't hold (beats display: flex). */
.form-grid [data-field][hidden] {
  display: none;
}

/* Radio and checkbox groups, consent: big tappable rows. */
.form-choice {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
}
/* Legend floats so the ⓘ button (outside the legend, to keep it out of the group's name) sits next to it. */
.form-choice legend {
  float: left;
  font-weight: 600;
  padding: 0;
  margin: 0 var(--space-2) var(--space-2) 0;
}
.form-choice > .form-tip {
  margin-top: 0.125rem;
}
.form-choice > :not(legend, .form-tip) {
  clear: both;
}
.form-choice__option {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}
.form-choice .form-choice__option {
  padding: 0.6rem 0.75rem;
  border: 2px solid var(--color-line);
  border-radius: var(--radius);
  background: var(--color-white);
  transition: border-color 0.15s, background-color 0.15s;
}
.form-choice .form-choice__option + .form-choice__option {
  margin-top: var(--space-2);
}
.form-choice .form-choice__option:hover {
  border-color: var(--color-control);
}
.form-choice .form-choice__option:has(input:checked) {
  border-color: var(--color-black);
  background: var(--color-yellow-tint);
}
.form-field .form-choice__option input {
  width: 1.375rem;
  height: 1.375rem;
  min-height: 0;
  margin: 0.125rem 0 0;
  padding: 0;
  flex: none;
  accent-color: var(--color-black);
  box-shadow: none;
}
.form-choice__option label {
  flex: 1;
  font-weight: 400;
  padding: 0.0625rem 0;
  cursor: pointer;
}
.form-consent .form-choice__option label {
  font-weight: 600;
}
.form-consent__info {
  margin-left: calc(1.375rem + 0.75rem);
  font-size: 0.9375rem;
  color: var(--color-muted);
}

/* ⓘ tooltip: shown on hover and keyboard focus (CSS), toggled on tap/click and closed with Escape (form.js). */
.form-tip {
  position: relative;
  display: inline-flex;
}
.form-tip__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  padding: 0;
  border: 2px solid var(--color-black);
  border-radius: 50%;
  background: var(--color-white);
  color: var(--color-black);
  font: italic 700 0.875rem/1 Georgia, serif;
  cursor: pointer;
}
.form-tip__button:hover,
.form-tip--open .form-tip__button {
  background: var(--color-black);
  color: var(--color-yellow);
}
/* Enlarged hit area (WCAG 2.5.8 target size). */
.form-tip__button::after {
  content: "";
  position: absolute;
  inset: -0.5rem;
}
.form-tip__bubble {
  display: none;
  position: absolute;
  z-index: 10;
  top: calc(100% + 0.6rem);
  left: -0.5rem;
  width: max-content;
  max-width: min(18rem, 78vw);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius);
  background: var(--color-black);
  color: var(--color-white);
  font-weight: 400;
  font-size: 0.9375rem;
  line-height: 1.45;
  box-shadow: var(--shadow-lift);
}
.form-tip__bubble::before {
  content: "";
  position: absolute;
  top: -6px;
  left: 0.95rem;
  border: 6px solid transparent;
  border-top: 0;
  border-bottom-color: var(--color-black);
}
/* Bridge over the gap so the pointer can move onto the bubble (WCAG 1.4.13 hoverable). */
.form-tip__bubble::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -0.6rem;
  height: 0.6rem;
}
.form-tip:hover .form-tip__bubble,
.form-tip__button:focus-visible + .form-tip__bubble,
.form-tip--open .form-tip__bubble {
  display: block;
}
.form-tip--dismissed .form-tip__bubble {
  display: none !important;
}

.form-error-summary {
  margin: 0 0 var(--space-4);
  padding: var(--space-3);
  border: 2px solid var(--color-error);
  border-radius: var(--radius);
  background: var(--color-error-bg);
  color: var(--color-error-ink);
  font-weight: 600;
}
.form-error-summary h2 {
  font-size: 1.625rem;
  margin-bottom: var(--space-2);
}
.form-error-summary ul {
  margin: 0;
  padding-left: var(--space-4);
}
.form-error-summary li + li {
  margin-top: var(--space-1);
}
.form-error-summary a {
  color: inherit;
}

.form-actions {
  margin-top: var(--space-2);
}
.form-actions .button {
  width: 100%;
  min-height: 3.25rem;
  font-size: 1.125rem;
}
@media (min-width: 36rem) {
  .form-actions .button {
    width: auto;
    min-width: 14rem;
  }
}

/* Spam protection (src/spam/view.tsx): honeypot off-screen, Turnstile widget above the submit button. */
.form-hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.cf-turnstile {
  grid-column: 1 / -1;
  min-height: 65px;
}

/* ── 5. Availability check (src/availability/check-view.tsx) ──────────────── */

.availability {
  margin-bottom: var(--space-5);
}
.availability__season {
  font-size: clamp(1.5rem, 5vw, 1.875rem);
  color: var(--color-muted);
  margin-bottom: var(--space-3);
}

/* The check: a yellow kit panel, the page's main moment. */
.availability__check {
  position: relative;
  display: grid;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-3);
  background: var(--color-yellow);
  color: var(--color-black);
  border-radius: var(--radius-block);
  overflow: hidden;
}
.availability__check::after {
  content: "";
  position: absolute;
  top: 0;
  right: -1.25rem;
  width: 3.5rem;
  height: 4.25rem;
  background: var(--color-black);
  transform: skewX(-28deg);
  pointer-events: none;
}
.availability__check > * {
  position: relative;
  z-index: 1;
}
.availability__check h3 {
  font-size: clamp(2.25rem, 9vw, 2.75rem);
  margin: 0;
  padding-right: 2.5rem;
}
.availability__check p {
  margin: 0;
}
.availability__check .form-field__hint {
  color: var(--color-black);
}
.availability__check input[type="date"] {
  border-color: var(--color-black);
  max-width: 20rem;
}
.availability__check input[type="date"]:focus-visible {
  box-shadow: 0 0 0 3px var(--color-white);
}
.availability__check .form-error-summary {
  margin: 0;
}
.availability__check .form-actions {
  margin-top: 0;
}
@media (min-width: 36rem) {
  .availability__check {
    padding: var(--space-5);
  }
  .availability__check::after {
    right: -0.5rem;
    width: 5rem;
    height: 6rem;
  }
}

.availability__gender,
.availability__locked,
.availability__category {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
}
.availability__gender legend,
.availability__locked legend,
.availability__category legend {
  font-weight: 600;
  padding: 0;
  margin-bottom: var(--space-2);
}
.availability__locked,
.availability__category {
  display: grid;
  gap: var(--space-2);
}
/* Jongen / Meisje side by side, normal control height (3rem). The fieldset is also a
   .form-field (flex column), so the direction must be reset — otherwise flex-basis
   becomes the cards' height and they turn into tall boxes on phones. */
.availability__gender {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: stretch;
  gap: var(--space-2);
}
.availability__gender .form-field__error {
  flex-basis: 100%;
}
.availability__gender .availability__radio {
  flex: 1 1 7rem;
  max-width: 12rem;
  min-height: 3rem;
  margin: 0;
}
/* Segmented choice: Jongen / Meisje, categories. */
.availability__radio {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 3rem;
  margin: 0 var(--space-2) var(--space-2) 0;
  padding: 0 1rem 0 0.75rem;
  border: 2px solid var(--color-black);
  border-radius: var(--radius);
  background: var(--color-white);
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}
.availability__radio:has(input:checked) {
  background: var(--color-black);
  color: var(--color-white);
}
.availability__radio:has(input:focus-visible) {
  outline: 3px solid var(--color-focus);
  outline-offset: 2px;
}
.availability__check .availability__radio:has(input:focus-visible) {
  outline-color: var(--color-black);
}
.availability__radio input {
  width: 1.25rem;
  height: 1.25rem;
  min-height: 0;
  margin: 0;
  accent-color: var(--color-yellow);
}
.availability__radio input:focus-visible {
  outline: none;
}
.availability__category .availability__radio {
  border-color: var(--color-control);
}

/* Result: celebrates a place, stays kind about "vol". One authored motion: rise in. */
.availability__result {
  margin-top: var(--space-3);
  padding: var(--space-4) var(--space-3);
  border: 3px solid var(--color-black);
  border-radius: var(--radius-block);
  background: var(--color-white);
  animation: result-in 0.5s var(--ease-out) both;
}
.availability__result:focus {
  outline: none;
}
.availability__result:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 3px;
}
.availability__result--closed,
.availability__result--no_match {
  border-color: var(--color-control);
}
.availability__result p {
  margin: 0 0 var(--space-2);
}
.availability__result h4 {
  margin: var(--space-3) 0 var(--space-1);
}
.availability__title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-heading);
  font-size: clamp(2.25rem, 9vw, 3rem);
  line-height: 1;
}
.availability__party {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 1.5em;
  height: 1.5em;
  border-radius: 50%;
  background: var(--color-yellow);
  font-size: 0.8em;
  animation: party-pop 0.7s 0.15s var(--ease-out) both;
}
.availability__message {
  font-weight: 700;
  font-size: 1.1875rem;
}
.availability__result .button {
  width: 100%;
  margin-top: var(--space-2);
}
@media (min-width: 36rem) {
  .availability__result {
    padding: var(--space-4) var(--space-5) var(--space-5);
  }
  .availability__result .button {
    width: auto;
  }
}
@keyframes result-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
}
@keyframes party-pop {
  0% {
    transform: scale(0.4) rotate(-20deg);
  }
  60% {
    transform: scale(1.15) rotate(8deg);
  }
  100% {
    transform: none;
  }
}

/* Tiles: one per category. Status = icon + word; open tiles wear the club yellow. */
.availability__tiles-heading {
  margin: var(--space-5) 0 var(--space-3);
  font-size: 1.625rem;
}
.tiles {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(6.25rem, 1fr));
  gap: var(--space-2);
}
.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  padding: 0.75rem;
  border: 2px solid var(--color-line);
  border-radius: var(--radius);
  background: var(--color-white);
  transition: opacity 0.2s, border-color 0.2s, transform 0.25s var(--ease-out);
}
.tile--open {
  background: var(--color-yellow);
  border-color: var(--color-yellow);
}
.tile__label {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  line-height: 1;
}
.tile__years {
  font-size: 0.8125rem;
  color: var(--color-muted);
  line-height: 1.3;
}
.tile--open .tile__years {
  color: var(--color-black);
}
.tile__status {
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
  margin-top: auto;
  padding-top: 0.25rem;
  font-weight: 700;
  font-size: 0.9375rem;
}
.tile__icon {
  flex: none;
}
.tile--full .tile__status {
  color: var(--color-muted);
}
.tile--match {
  border-color: var(--color-black);
  border-width: 3px;
  padding: calc(0.75rem - 1px);
  transform: translateY(-2px);
  box-shadow: var(--shadow-block);
}
.tile__match {
  align-self: flex-start;
  margin-top: 0.25rem;
  padding: 0 0.4rem;
  border-radius: var(--radius);
  background: var(--color-black);
  color: var(--color-white);
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
}
/* Not matching after a check: quieter but still ≥4.5:1 text. */
.tile--dimmed {
  background: var(--color-surface-2);
  border-color: var(--color-surface-2);
}
.tile--dimmed .tile__label,
.tile--dimmed .tile__status,
.tile--dimmed .tile__years {
  color: var(--color-muted);
}

.availability__form-heading {
  margin-bottom: var(--space-3);
}
.availability__form-heading:focus {
  outline: none;
}
/* Form gated by the check (ticket 12): closed notice, locked values, category choice. */
.availability__form-closed {
  display: flex;
  gap: var(--space-2);
  margin: 0;
  padding: var(--space-3);
  background: var(--color-surface-2);
  border-radius: var(--radius);
  color: var(--color-muted);
  font-weight: 600;
}
.availability__form-closed::before {
  content: "";
  flex: none;
  width: 1.25rem;
  height: 1.25rem;
  margin-top: 0.15rem;
  background: currentColor;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Crect x='4' y='9' width='12' height='9' rx='2'/%3E%3Cpath d='M7 9V6.5a3 3 0 0 1 6 0V9' fill='none' stroke='%23000' stroke-width='2'/%3E%3C/svg%3E")
    center / contain no-repeat;
}
.availability__locked legend {
  float: left;
  width: 100%;
}
.availability__locked {
  padding: var(--space-3);
  border-radius: var(--radius);
  background: var(--color-surface-2);
}
@media (min-width: 36rem) {
  .availability__locked {
    grid-template-columns: 1fr 1fr;
  }
  .availability__locked legend {
    grid-column: 1 / -1;
  }
  .availability__locked .form-field__hint {
    grid-column: 1 / -1;
  }
}

/* ── 6. Waitlist sign-up inside the check result (src/waitlist/view.tsx) ─── */

.waitlist {
  display: grid;
  gap: var(--space-3);
  margin-top: var(--space-3);
  padding: var(--space-4) var(--space-3);
  background: var(--color-surface-2);
  border-radius: var(--radius-block);
}
@media (min-width: 36rem) {
  .waitlist {
    padding: var(--space-4);
  }
}
.waitlist h3 {
  font-size: 2rem;
  margin: 0;
}
.waitlist p {
  margin: 0;
}
.waitlist__privacy {
  font-size: 0.9375rem;
  color: var(--color-muted);
}
.waitlist .form-actions .button {
  width: 100%;
}
@media (min-width: 36rem) {
  .waitlist .form-actions .button {
    width: auto;
  }
}
.waitlist-offer {
  margin-top: var(--space-3);
  border-top: 1px solid var(--color-line);
  padding-top: var(--space-2);
}
.waitlist-offer summary {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 2.75rem;
  cursor: pointer;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

/* ── 7. Thank-you and message pages ───────────────────────────────────────── */

.page-intro p {
  margin: 0;
  color: var(--color-muted);
}
.page-intro .rich-text p,
.thank-you .form-text p {
  color: var(--color-text);
  font-size: 1.125rem;
}
.thank-you {
  position: relative;
  overflow: hidden;
  text-align: left;
}
/* Kit sash across the top-right corner. */
.thank-you::after {
  content: "";
  position: absolute;
  top: -2rem;
  right: -3rem;
  width: 6rem;
  height: 9rem;
  background: var(--color-yellow);
  transform: skewX(-28deg);
}
.thank-you__badge {
  display: grid;
  place-items: center;
  width: 4.5rem;
  height: 4.5rem;
  margin-bottom: var(--space-3);
  border-radius: 50%;
  background: var(--color-black);
  color: var(--color-yellow);
  animation: party-pop 0.7s var(--ease-out) both;
}
.thank-you__badge path {
  stroke-dasharray: 40;
  stroke-dashoffset: 40;
  animation: draw-check 0.45s 0.35s var(--ease-out) forwards;
}
.thank-you__home {
  margin-top: var(--space-4) !important;
}
@keyframes draw-check {
  to {
    stroke-dashoffset: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .thank-you__badge path {
    stroke-dashoffset: 0;
  }
}

/* ── 8. Footer (src/public/layout.tsx), like the main site ────────────────── */

.site-footer {
  position: relative;
  background: var(--color-black);
  color: var(--color-white);
  padding: var(--space-5) var(--space-3) var(--space-4);
  font-size: 0.9375rem;
  border-top: 6px solid var(--color-yellow);
}
.site-footer a {
  color: var(--color-white);
}
.site-footer :focus-visible {
  outline-color: var(--color-yellow);
}
.site-footer__inner {
  position: relative;
  max-width: calc(var(--wide-width) - 2 * var(--space-3));
  margin: 0 auto;
  display: grid;
  gap: var(--space-4);
}
.site-footer__logo {
  display: inline-flex;
  justify-self: start;
}
.site-footer__logo img {
  display: block;
  width: 64px;
  height: 64px;
}
@media (min-width: 40rem) {
  .site-footer__inner {
    grid-template-columns: auto repeat(2, minmax(0, 1fr));
    gap: var(--space-5);
  }
}
.site-footer h2 {
  font-size: 1.5rem;
  color: var(--color-yellow);
  margin: 0 0 var(--space-2);
}
.site-footer__column p,
.site-footer__column .rich-text > * {
  margin: 0 0 var(--space-2);
}
.site-footer__links {
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-footer__links li {
  padding: var(--space-1) 0;
}
.site-footer__bottom {
  position: relative;
  max-width: calc(var(--wide-width) - 2 * var(--space-3));
  margin: var(--space-5) auto 0;
  padding-top: var(--space-3);
  border-top: 1px solid #5c5c5c;
  font-size: 0.875rem;
}
