# Build a membership form with the Relay theme

You are building one page in an existing project: a page to join a sports club, with three kinds of membership to choose from as radio cards, a form for the new member's details, an emergency contact and consent that is checked in code, and a confirmation that replaces the form. Follow this brief closely. `DESIGN.md` decides the tokens: colors, type, spacing steps and corners. This brief decides the layout, its widths included, and which token goes where. If this brief names a color, a type size, a spacing step or a corner that `DESIGN.md` does not have, `DESIGN.md` wins.

## Before you start

1. **Check the theme is installed.** The project should have `DESIGN.md` in its root and the Relay variables in its global CSS. If not, run `npx shadcn@latest add https://strictthemes.com/r/relay.json` and save https://strictthemes.com/themes/relay/DESIGN.md as `DESIGN.md` in the project root. In a project without shadcn, use https://strictthemes.com/themes/relay/tailwind.css instead. If the global CSS still imports a font the theme does not use (a new shadcn project imports Geist), remove that import, and uninstall its package if nothing else uses it. Keep every font import the theme's install added, also one for a style no page uses yet.
2. **Read `DESIGN.md` from start to finish.** It is the source of truth for every visual decision.
3. **Look at the project before writing code.** Use its framework, router and file layout. For controls (buttons, inputs, tabs, menus, dialogs, accordions, data tables) use the components in `components/ui`, and add a missing one with `npx shadcn@latest add <name>` rather than writing your own, unless this brief names a plain element. Layout is plain elements with theme classes: sections, panels, figures and lists need no component.
4. **Teach `cn()` the theme's type classes.** shadcn's class merger does not know `text-display` or `text-h1`. It takes them for colors, so `cn("text-label text-muted-foreground")` silently drops one of the two, and a type class passed to a stock component does not replace its size. In a new shadcn project, `lib/utils.ts` only passes `cn` on from the `cn` package. Unless the file already holds the lines below, change it to:

   ```ts
   import { createCn } from "cn/config"

   // The theme's type classes are font sizes, not colors.
   export const cn = createCn({
     extend: {
       classGroups: {
         "font-size": [{ text: ["display", "h1", "h2", "body", "label"] }],
       },
     },
   })
   ```

   Then make every file in `components/ui` use it: where one has `import { cn } from "cn"`, change that line to import `cn` from the project's utils file (`@/lib/utils` in a default setup). Do the same for each component you add later. If the project uses `tailwind-merge` instead of the `cn` package, its components already import from the utils file: pass the same object to `extendTailwindMerge` and keep `clsx`.
5. **Write real content.** If the user gave you details about their product, use them. Otherwise use the sample product in this brief and write the rest of the copy yourself: specific and plain, the way the samples read. Invent the company and people names; do not use real ones. Never use lorem ipsum. A link with no destination yet points to `#`. Set the page's `<title>` and meta description.

## The theme in short

- **Fonts:** Saira for headings, Rubik for body text, Kode Mono for labels and code.
- **Type scale** (size/weight; each class also sets line height and tracking): `text-display` 64px/800, `text-h1` 40px/800, `text-h2` 24px/700, `text-body` 16px/400, `text-label` 13px/500.
- **Font per size:** a type class does not set the font family. Headings (`<h1>` to `<h6>`) get the heading font on their own; on any other element add the font class: `font-heading` with `text-display`, `text-h1`, `text-h2`; `font-mono` with `text-label`.
- **Spacing scale**, with the Tailwind step in brackets: 4px (`1`), 8px (`2`), 12px (`3`), 20px (`5`), 32px (`8`), 72px (`18`).
- **Corners:** `rounded-sm` 3px, `rounded-md` 6px, `rounded-xl` 10px (the `lg` corner in `DESIGN.md`). `rounded-lg` is 6px as well: it is shadcn's name for the base corner, the one its stock buttons and inputs use.
- **Colors (light mode):** primary #FFB703, on-primary #023047, secondary #023047, on-secondary #FFFFFF, tertiary #FB8500, on-tertiary #023047, neutral #3F6377, background #F5FAFC, surface #FFFFFF, foreground #023047, border #C5E1EE, error #B3261E, ring #023047, navy #023047, on-navy #FFFFFF, ice #8ECAE6, on-ice #023047.

### How Relay pages are laid out

- **Page:** kit white, dense and squared up, with navy bands. The outermost element is a `<div>` with `flex min-h-svh flex-col bg-background text-body text-foreground`, holding `<header>`, `<main>` (`flex-1`) and `<footer>`.
- **Container:** the header's row, the content of `<main>` and the footer each sit in a centered container `<div>`, `mx-auto w-full max-w-[1240px] px-5`: a 20px gutter at every width. This width is the one arbitrary value allowed.
- **Stock components:** these pages use two, `Button` and `Input`. Everything else is plain elements with the classes these notes give: tables, badges, radios, checkboxes and cards included. Do not add the shadcn `Table`, `Badge`, `Card`, `Checkbox`, `RadioGroup`, `Switch` or `Tabs`.
- **Today:** the sample's now is Tuesday 8 June 2027 at 20:05, fixed in code, never the device clock. Nothing on these pages ticks: no timers.
- **Sample organisation:** "Wendmoor Football Club", written "Wendmoor FC" everywhere but the home page's `<h1>` and the footer's small print: an invented amateur club, founded in 1921, with 140 members and three teams (first team, reserves, under 18s). It plays at Millrace Park in Wendmoor, an invented town. The first team plays in the Kestrel Valley League, Division One: twelve invented clubs who meet twice, 22 matches each, on Saturdays at 15:00 from 6 March to 31 July 2027. After 14 matches Wendmoor FC are third with 27 points. Their last match was a 3–1 home win over Otterby Town on Saturday 5 June; the next is away to the leaders, Castlebrook United, on Saturday 12 June. Membership for the season costs £95 (Playing), £45 (Junior) or £30 (Social). The same figures appear on every page; this brief gives the ones it needs.
- **Clubs:** the twelve clubs, each with the letters of its crest and its ground: Wendmoor FC (`W`, Millrace Park), Castlebrook United (`CU`, Castle Meadow), Dunmarsh Athletic (`DA`, The Saltings), Otterby Town (`OT`, Weir Lane), Stenwick Albion (`SA`, Albion Field), Kirkfen Rangers (`KR`, Fen Road), Lowmere Welfare (`LW`, Welfare Ground), Pellow Green (`PG`, The Green), Hollinvale (`H`, Hollin Bank), Tarrowby United (`TU`, Station Road), Sedgeholme (`S`, Sedge Lane), Eastlow Wanderers (`EW`, Quarry Lane). A reserve or under 18 side has its club's letters and ground.
- **Vertical rhythm:** every vertical distance between siblings comes from a `gap-*` on their parent, a `flex flex-col` or a grid. Never use `space-y-*`, and no margins but the two these notes name: `mt-0.5` on a checkbox and `mt-1` on an icon beside body text. Rows and cells use padding. The container inside `<main>` is `flex flex-col gap-18 pt-8 pb-18`: its items are the page's sections, 72px apart, and this brief says what the items are. The other steps: `gap-1` between a figure and the label under it, and between the lines of one row; `gap-2` between a field's label, the field, its helper text and its error, and between an icon and its word; `gap-3` between a label and the heading under it, between a heading and its paragraph, between paragraphs, and between buttons in a row; `gap-5` inside a card, between cards, between the fields of a form and between grid columns; `gap-8` between a section's heading and its content where this brief says so, and between the blocks of one section. Where a page's own section gives another value, the page wins.
- **Grid:** where this brief puts things side by side, they are items of a 12-column grid, `grid grid-cols-1 gap-5 lg:grid-cols-12`, a single column below `lg`. "Eight columns" means `lg:col-span-8`, and so on; give every item `min-w-0`. A column of several cards is `flex flex-col gap-5`.
- **Bands:** a band is a block of the theme's `navy`: `bg-navy text-navy-foreground`, navy with white text in both modes, with no shadow. It is not `bg-secondary`, which turns ice blue in dark mode and is for buttons only. Write no `dark:` class. Three things are bands: the header, a scoreboard, and a table's head.
  - Everything on a band inherits the white of `text-navy-foreground` from the band. No element on a band gets `text-foreground`, `text-card-foreground`, `text-muted-foreground`, `text-secondary-foreground` or `text-primary`.
  - A label on a band is `text-ice`, ice blue, the one text color class a piece of text on a band may get. (A crest and the badge bring their own fill and text color.)
  - A rule drawn on a band, to divide two parts of it, is a 1px `border-ice` line.
  - The edge of a band: in dark mode a card is the band's own navy and the page is only a little darker, so a band gets a hairline of the theme's border color, written once for both modes. In light mode that hairline is a pale edge that hardly shows, and that is fine. A band that is a block of its own (a scoreboard) is `rounded-xl border border-border`. The header, across the full width with square corners, has `border-b border-border`. A table's head has no border of its own: the card's border and the rule on the first row under it frame it.
  - The focus outline on a band is `focus-visible:outline-navy-foreground` in place of `focus-visible:outline-ring`, with the rest of the outline classes from the rules unchanged: white on navy in both modes. The `ring` color is navy in light mode, the band's own color, and would not show.
  - A band holds text, crests, the one orange badge and text links. Never a button of any kind (the amber one included), a field, a card or an ice panel. A band is never inside a card; a table's head is part of its table, not a band put into a card.
- **Ice:** the theme's own color fills quiet panels and marked rows: `bg-ice text-ice-foreground`, the pair always together on the panel or the row itself. Ice blue and the navy text on it are the same in both modes. As a text color, `text-ice` is only for labels on a band. A panel is `rounded-xl bg-ice p-5 text-ice-foreground` with `flex flex-col gap-5` inside, no border and no shadow; a marked row (the club's own row in a table, the next match in a list) gets the two classes and keeps its row padding. Everything on ice inherits the navy: no element there gets a text color class of its own, also not the labels and small print that these notes make muted elsewhere. Ice holds text only: nothing that takes focus (the focus outline is amber in dark mode and would vanish on it), so no link, button or field, and no badge. A list on an ice panel has no rules between its rows. An ice panel sits on the page, never inside a card, and a card is never inside it.
- **Amber:** `bg-primary` is a fill for one thing, the main action: the default `Button`, navy text on amber in both modes. Each page has exactly one amber button, which this brief names, and it sits on the page or on a card. Amber is never text and never a thin mark, because it cannot be read on kit white: never write `text-primary`, `border-primary`, `decoration-primary`, `accent-primary` or `outline-primary`, never color an icon amber, and never use the `link` variant of the stock `Button`. Do not use the `chart-*` colors.
- **Orange:** `bg-tertiary` is the fill of one badge and nothing else. Never `text-tertiary`.
- **Focus:** the theme has a `ring` color, navy in light mode and amber in dark mode, and the outline from the rules uses it (`focus-visible:outline-ring`): it shows on the page and on a card in both modes. It does not show on a band in light mode or on ice in dark mode, which is why a band has an outline color of its own, white, and ice holds nothing that takes focus.
- **Header:** a `<header>` that is a band: `border-b border-border bg-navy text-navy-foreground`, full width. Its container is the row, `flex flex-wrap items-center justify-between gap-x-8 gap-y-1 py-3`, with two items:
  - The club's name, a link to `/`, `inline-flex items-center gap-3`: a crest (`size-10`, the letter `W`) and "Wendmoor FC" in a `<span>` with `font-heading text-h2 uppercase`. It is never marked as the current page.
  - A `<nav>` with the `aria-label` "Main", holding a `<ul>` with `flex flex-wrap gap-x-5` of four links in this order: Fixtures (`/fixtures`), Table (`/standings`), Report (`/report`) and Membership (`/membership`). This brief says which one is current. From `md` up the nav sits at the right end of the row; on a phone it wraps to a second line under the name, where the four links fit 375px. There is no "Menu" button and no button of any kind in the header.
  - A nav link is `inline-flex h-10 items-center font-mono text-label uppercase underline-offset-4 hover:underline`; the current page's link adds `underline decoration-2` and `aria-current="page"`. Every link in the header takes the band's focus outline.
- **Footer:** a `<footer>` with `border-t border-border`, not a band. Its container is `flex flex-col gap-3 py-8`: "Wendmoor FC" in a `<p>` with `font-heading text-h2 uppercase`; a `<nav>` with the `aria-label` "Footer", a `<ul>` with `flex flex-wrap gap-x-5 gap-y-2` of four label links, Fixtures (`/fixtures`), Table (`/standings`), Report (`/report`) and Membership (`/membership`), none marked current; then a label in `text-muted-foreground`: `© 2027 WENDMOOR FOOTBALL CLUB · MILLRACE PARK, WENDMOOR · A DEMO: NOTHING IS SENT OR STORED`.
- **Page head:** the top of a page is a row, `flex flex-wrap items-end justify-between gap-5`. On the left a stack with `gap-3`: a label in `text-muted-foreground`, the `<h1>`, and, where this brief gives one, a sentence in `text-body` with `max-w-2xl`. On the right the page's one amber action: a link to `/membership` styled as the default button, "Join the club". On a phone it wraps under the stack. The membership page has no action there: its form's button is the amber one.
- **Headings:** every heading is `uppercase`, with the class on the heading element, and is set in Saira at the weight its type class gives: do not add a weight class to an `<h1>` or `<h2>`, and never slant, outline or stretch it. The `<h1>` is `text-h1` at every width. A section's or a card's `<h2>` is `text-h2`. A smaller heading (an `<h3>`, or a name set like one) is `font-heading text-body font-bold uppercase`. No word in an `<h1>` is longer than eleven letters, so it fits 375px. A section's heading row, where it also holds a link, is `flex flex-wrap items-baseline justify-between gap-3`.
- **Scores and times:** a score, a kick-off time, a position, a price or a count that stands on its own is a **figure**: `font-heading tabular-nums`, with a size: `text-h1 md:text-display` on a scoreboard, `text-h1` in a panel or a card, `text-h2` in a row. `text-display` is used for nothing else. A score is written with an en dash and no spaces, `3–1`. A figure with a name is a stack with `gap-1`, the figure above its label; in a `<dl>` the pair is a `<div>` with `flex flex-col-reverse gap-1`, the `<dt>` (the label) first in the source.
- **Labels:** dates, kick-off times in a line of text, venues, competitions, nav links, field labels, the heads of a table's columns, and button and badge text are labels: `font-mono text-label uppercase`, a short fragment and never a sentence. A label line joins its parts with ` · ` (`SAT 5 JUN · MILLRACE PARK`), unless this brief makes them separate items. A label that is a heading element needs `font-mono`, since a heading gets Saira on its own. On the page and on a card a label is `text-muted-foreground`, unless this brief says `text-foreground`; a field's label is `text-foreground`. On a band it is `text-ice`; on ice it inherits.
- **Small print:** helper text, a note under a table and a sentence of fine print are `text-label text-muted-foreground` in the body font: no `font-mono` and no `uppercase`. Only on the page or a card; on ice it inherits.
- **Text color:** headings, body text, names and figures are `text-foreground` on the page and on a card. Labels and small print are `text-muted-foreground` there, and nowhere else: muted text never sits on a band, on ice, on amber or on orange. Paragraphs are never muted.
- **Measure:** a paragraph of body text is at most `max-w-2xl` wide.
- **Dates and times:** a date in a label is `SAT 5 JUN`, in a `<time>` with `dateTime="2027-06-05"`; with its year, `SAT 5 JUN 2027`. In a sentence a date is written out, "Saturday 5 June 2027", and is not a `<time>`. A time is on the 24-hour clock, `15:00`. A minute of a match is `58'`, with a straight apostrophe.
- **Links:** a text link is `text-foreground underline underline-offset-4 hover:decoration-2` and inherits its size: links are the text color, never amber, so the hover thickens the underline and changes no color. A label link is a label in `text-foreground` with the same underline classes. A link on a band has the underline classes, no text color class, and the band's focus outline. A link whose destination this brief does not name points to `#`.
- **Buttons:** the shadcn `Button` with `className="h-auto px-5 py-2 font-mono text-label uppercase"`; it keeps its stock corner (`rounded-lg`, 6px here). The default variant (amber) is the page's one main action, "Join the club", and nothing else. Every other button is `variant="secondary"` (navy with white text; ice blue with navy text in dark mode) or, for the unchosen buttons of a group, `variant="outline"`. No `ghost`, `destructive` or `link` buttons. The stock hover of `secondary` cannot be told from its resting color: in `components/ui/button.tsx`, replace the `secondary` variant's `hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)]` with `hover:bg-secondary/80`, once, and add no hover class on the page. A link styled as a button is an `<a>` with `cn(buttonVariants({ variant }), "h-auto px-5 py-2 font-mono text-label uppercase")`: `buttonVariants` alone does not merge classes. A button that sends a form needs `type="submit"`: this `Button` is `type="button"` unless told otherwise. No button on these pages is ever disabled, so none gets `focusableWhenDisabled`, and `button.tsx` needs no `data-disabled:` classes. The stock `Button` keeps its `transition-all` and its nudge when pressed.
- **Button groups:** a set of buttons where one is chosen is a `role="group"` with an `aria-label` and `flex flex-wrap gap-2`, on the page, never on a band or on ice. The chosen button has `aria-pressed="true"` and `variant="secondary"`; the others have `aria-pressed="false"` and `variant="outline"`. Every button in it has the Buttons classes. Pressing the chosen button again changes nothing. Not `Tabs`: there are no tab panels.
- **Badges:** the one badge of a page says "Final" or "Live". It is a plain `<span>` with `inline-flex shrink-0 items-center rounded-sm bg-tertiary px-2 py-1 font-mono text-label uppercase whitespace-nowrap text-tertiary-foreground`: orange with navy text in both modes. At most one shows at a time. It may sit on the page, on a card or on a band, never on ice.
- **Crests:** a club's crest is drawn, never an image: a `<span>` with `flex shrink-0 items-center justify-center rounded-full` and `aria-hidden="true"`, holding the club's letters from the Clubs note, beside the club's written name. It is `bg-ice text-ice-foreground`, an ice blue disc with navy letters, on the page, on a card and on a band. On ice, where that would not show, it is `bg-navy text-navy-foreground` instead: a navy disc with white letters. Sizes: `size-8` in a row, with the letters in `font-mono text-label`; `size-10` in the header and `size-12` on a scoreboard, with the letters in `font-heading text-body font-extrabold`. 48px is the theme's limit for a full round. No border and no shadow.
- **Scoreboards:** a scoreboard is a band that is a block of its own: `rounded-xl border border-border bg-navy p-5 text-navy-foreground md:p-8`. A match on it is a row, `flex items-center justify-center gap-3 md:gap-8`, with three items: the home side, the score, the away side. Each side is `flex min-w-0 flex-1 flex-col items-center gap-2 text-center`: its crest (`size-12`), then its name in a `<p>` with `font-heading text-body font-bold uppercase md:text-h2`, then anything this brief puts under the name. The score is a `<p>` with `shrink-0`, a figure in `text-h1 md:text-display`. The home side is always on the left and its goals come first.
- **Cards:** a card is a plain element with `rounded-xl border border-border bg-card p-5` and `flex flex-col gap-5` inside: white with a 1px border, no shadow. Never a card inside a card, and never a bordered box with corners inside a card: divide a card's parts with a 1px rule (`border-t border-border`).
- **Cards with rows:** a card that holds a list of rows or a table has no padding and no gap of its own, and `overflow-hidden`: `overflow-hidden rounded-xl border border-border bg-card`. Each row has `px-5 py-3` and, except the card's first row, `border-t border-border`. A heading inside such a card is a row too, the first, with `px-5 py-3`; the first item of the list under it then has the rule like any other row.
- **Tables:** a table is a plain `<table>` in a card with rows, with `w-full border-collapse text-body`, a `<caption>` that is `sr-only` (the visible name is the heading above the card), and real header cells. Its rows take the cell padding below, not the row padding of the Cards with rows note.
  - The `<thead>` is a band: `bg-navy text-navy-foreground`, with no corner class and no border of its own, since the card clips and frames it. In dark mode it is the card's own navy, and its ice blue labels and the rule under it set it off. Each `<th scope="col">` is a label on a band, `px-2 py-3 font-mono text-label uppercase text-ice`, with `text-left` for a position or a name and `text-right` for a figure.
  - Each body `<tr>` has `border-t border-border`. Cells are `px-2 py-3`; the first cell of every row, the head's too, also has `pl-5` and the last `pr-5`.
  - A club's name is a `<th scope="row">` with `px-2 py-3 text-left font-normal`. A figure cell is `text-right tabular-nums` in the body font; the points are also `font-bold`. A position is a figure in `text-h2`, left-aligned.
  - The club's own row is a marked row: the `<tr>` adds `bg-ice text-ice-foreground`, the club's name is `font-bold` and is followed by a `<span>` with `sr-only`, " (this club)". So the row is marked by more than its color.
  - No hover fill, no stripes and no other colored row. A short header is an `<abbr>` with a `title` and `no-underline`.
- **Description lists:** a list of facts is a `<dl>`. On a card each row is `flex items-baseline justify-between gap-3 py-2` with `border-t border-border` except the first: the `<dt>` a label, the `<dd>` in `text-right text-body`. On an ice panel the rows have no rules and no padding: the `<dl>` is `flex flex-col gap-2`.
- **Inputs:** the shadcn `Input` (`npx shadcn@latest add input`) with `className="h-10 px-3 text-body md:text-body"`, its stock corner (6px). In `components/ui/input.tsx`: replace `border-input` with `border-muted-foreground`, so a field's edge shows on a white card; replace the class `bg-transparent` and the class `dark:bg-input/30` with `bg-card` (`file:bg-transparent` and the `disabled:` fills stay); and delete `dark:aria-invalid:border-destructive/50`. A field is a `flex flex-col gap-2`: a visible `<label>` with `block`, a label in `text-foreground`, tied to the field with `htmlFor`; the field; its helper text, small print, where this brief gives one; and its error line when there is one. Name the helper text in the field's `aria-describedby`. Fields sit on a card.
- **Radios and checkboxes:** native `<input type="radio">` and `<input type="checkbox">`, each with `size-5 shrink-0 accent-secondary` and the focus outline from the rules written on it. `accent-secondary` draws the checked mark in the `secondary` color, navy in light mode and ice blue in dark mode, and the browser sets the tick or the dot against it: both show on a card in both modes. The shadcn `Checkbox` and `RadioGroup` fill their mark with amber and are not used. Radios of one choice share a `name`. They sit on a card or on the page, never on a band or on ice. A checkbox's row is a `<label>` with `flex items-start gap-3 text-body text-foreground`, holding the checkbox (with `mt-0.5`, 2px, so it sits on the first line) and a `<span>` with its sentence. These pages have no switch.
- **Errors:** an error line is `flex items-start gap-2 text-label text-destructive` in the body font (a sentence, so no `font-mono` and no `uppercase`), holding the `CircleAlert` icon (no margin: the line is as tall as the icon) and a sentence that says what to do. The field gets `aria-invalid` and names the line in its `aria-describedby`. Fields are checked in code on submit, with `noValidate` on the `<form>`; focus then moves to the first field with an error. Render the error lines first and move focus after: set the errors in state and focus the field in an effect that runs when they change, so the field's `aria-describedby` already points at a line that exists. An error line is removed when its own field changes (on `input` or `change`); every other error stays until the next submit. Every value is trimmed before it is checked.
- **Announcements:** a message that only tells a screen reader what changed goes into a `<p>` with `role="status"` whose only class is `sr-only`, on the page from the start, empty. It adds no gap.
- **Confirmations:** a message that replaces a form goes into a `role="status"` element that is on the page from the start, empty, or it may not be announced. That element is never hidden, has no classes, and is never an item of a `gap-*` stack: it shares one plain `<div>` with the `<form>`. The message inside it, rendered only when there is one, carries the look. Give the message's heading `tabIndex={-1}` and move focus to it, because the button that had focus is gone.
- **Icons:** from `lucide-react`, with `size-4 shrink-0`, `strokeWidth={2}`, `strokeLinecap="square"` and `aria-hidden="true"`, only where this brief or these notes name one, in the color of the text beside them. Beside a line of body text in an `items-start` row the icon gets `mt-1`, so it sits on the first line. Never amber, never emoji.
- **Corners:** `rounded-sm` (3px) for the badge and for drawn bars; `rounded-lg` (6px, what they ship with) for buttons and inputs; `rounded-xl` (10px, the spec's `lg`) for cards, bands and ice panels. `rounded-full` only for a crest, at most `size-12`. Nothing else is round: no pills, no avatars, no status dots on these pages.
- **Surfaces:** flat. No shadows, blur, gradients or glows in the code you write. The page is `bg-background`, a card is `bg-card`, a band is `bg-navy`, a quiet panel is `bg-ice`; do not use `bg-muted` or `bg-accent`. A drawn bar takes the fill this brief gives it.
- **Motion:** in the code you write, the only transition is color, `transition-colors duration-150` on links. Nothing moves on scroll, and nothing animates in. Stock components keep the motion they ship with.

## The page

Where this section and the layout notes above differ, this section wins.

Sample content, if the user gave none: "Wendmoor Football Club", which has 140 members and takes new ones all season. Three kinds of membership for the 2027 season, which ends on 31 July: Playing at £95, for adults aged 18 or over; Junior at £45, for players under 18; Social at £30, for everyone else. Adults train on Mondays and Thursdays at 19:00, juniors on Thursdays at 17:30, all at Millrace Park. Today is Tuesday 8 June 2027, so the first session for a new player is Thursday 10 June, and the next home match is against Stenwick Albion on Saturday 19 June at 15:00. A new member gets the number `WFC-27-0141`.

This page uses the stock `button` and `input`; add any the project lacks with `npx shadcn@latest add button input`. It has a date field, so set `color-scheme` as the rules say; the native radios and the checkbox follow it too.

Build these parts in order. The container inside `<main>` has one item: a `<div>` with `flex flex-col gap-8` that holds the page head and, after it, one plain `<div>` with no classes. That plain `<div>` holds the `<form>` of part 3 and, after the form, the confirmation element of part 4, on the page from the start and empty.

### 1. Header

The header from the layout notes. The current page is Membership.

### 2. Page head

The label `2027 SEASON · 140 MEMBERS`, then the `<h1>` "Join the club", then the sentence "Choose a membership, tell us who you are, and come to your first session. It takes two minutes." There is no action on the right: the form's button is the page's amber one.

### 3. The form

A `<form>` with `noValidate`, the `aria-label` "Join the club" and `flex flex-col gap-8`. It has two items: the memberships, then a grid row.

**Memberships.** A `<div>` with `role="radiogroup"`, named by its heading with `aria-labelledby`, and `flex flex-col gap-5`: an `<h2>` "Choose a membership", then a grid row of three radio cards, four columns each from `lg` up.

A radio card is a `<label>` with `flex cursor-pointer flex-col gap-3 rounded-xl border border-border bg-card p-5 has-checked:border-foreground`: a card of its own on the page, whose border turns to the text color while its radio is checked. A `<label>` may hold only inline elements, so every part of it is a `<span>`:

- A first line, `flex items-center gap-3`: the radio, with the `name` "membership", then the membership's name in `font-heading text-h2 uppercase`.
- The price, `flex flex-col gap-1`: a figure in `text-h1`, then the label `A SEASON`.
- Who it is for, one sentence, `block text-body`.
- What it includes, `flex flex-col gap-2`: three lines, each `flex items-start gap-2 text-body` with the `Check` icon and a phrase.

The radio gets `aria-labelledby` naming the `<span>` with the membership's name and `aria-describedby` naming a `<span>` that wraps the other three parts (`flex flex-col gap-3`). The three cards:

- "Playing", `£95`, chosen at the start: "For adults aged 18 or over who want to play." It includes "Training on Mondays and Thursdays at 19:00", "A place in the first team or reserves squad" and "Match kit and insurance for the season".
- "Junior", `£45`: "For players under 18." It includes "Coaching on Thursdays at 17:30", "Matches with the under 18s on Sundays" and "Match kit and insurance for the season".
- "Social", `£30`: "For supporters, parents and former players." It includes "Free entry to home league matches", "A vote at the annual meeting" and "The club newsletter each month".

**The grid row** has two items.

**Your details,** eight columns from `lg` up: a card with the `<h2>` "Your details" and three more items.

First, a grid of fields, `grid grid-cols-1 gap-5 md:grid-cols-2`, in this order; a field marked "both" spans both columns (`md:col-span-2`):

1. "Full name", an `Input` with `autoComplete="name"`, both.
2. "Email", `type="email"`, `autoComplete="email"`.
3. "Date of birth", `type="date"`, `autoComplete="bday"`, with the helper text "Playing members are 18 or over. Juniors are under 18."
4. "Emergency contact", `autoComplete="off"`, with the helper text "Someone we can call on a match day. For a junior, a parent or guardian."
5. "Emergency contact's phone", `type="tel"`, `autoComplete="off"`.

Every field starts empty.

Second, the consent: a stack with `gap-2` holding a checkbox row as the Radios and checkboxes note sets it, with the sentence "I agree to the club's code of conduct, and to the club keeping these details for the 2027 season.", and its error line when there is one. The checkbox starts clear.

Third, a row with `flex flex-wrap items-center gap-3 border-t border-border pt-5`: the default (amber) button "Join the club" with `type="submit"`, and one line of small print: "You pay at your first session. Nothing is charged here."

**What happens next,** four columns from `lg` up: an ice panel, an `<aside>` named by its `<h2>` "What happens next" in `text-h2`. Then an `<ol>` with `role="list"` and `flex flex-col gap-3` of three steps, each `flex items-baseline gap-3`: its number, `1` to `3`, a figure in `text-h2` with `w-5 shrink-0`, and a sentence in `text-body`:

1. "We email your membership number and a welcome from the club."
2. "You come to your first session at Millrace Park and pay the season's fee there."
3. "Players are registered with the league within a week, and can then be picked."

Then a `<p>` in `text-body`: "Questions? Call the club secretary, Marian Osei, on 01632 960 277." The number is plain text, not a link: nothing on an ice panel takes focus, and nothing on it has a text color class.

### 4. The confirmation

Rendered inside the confirmation element only after a good submit, when the `<form>` is gone: a card, with nothing above it in the plain `<div>`. In it:

- An `<h2>` "Welcome to Wendmoor FC", with `tabIndex={-1}` and the `focus:` outline from the rules.
- A `<p>` in `text-body`: "Thank you, Priya. Your Playing membership for the 2027 season is ready.", with the first word of the name as typed and the membership as chosen.
- A `<dl>` as the Description lists note sets it on a card, `w-full max-w-md`, with four rows: "Membership number", `WFC-27-0141`; "Membership", the kind chosen; "Fee for the season", `£95`, `£45` or `£30`; and the last row by the kind: for Playing, "First session", "Thursday 10 June, 19:00"; for Junior, "First session", "Thursday 10 June, 17:30"; for Social, "Next home match", "Saturday 19 June, 15:00".
- A `<p>` in `text-body`: "We have sent the details to" with the email address as typed, then a full stop. Then a second sentence: "This is a demo: nothing was sent or stored."
- A link styled as a `secondary` button, "See the fixtures", to `/fixtures`, at its own width (`self-start`).

### Behavior

- Choosing a radio card changes the membership; the arrow keys move between the three, as native radios do. Focus stays on the radio.
- "Join the club" checks every field in code, in the order below, and moves focus to the first one with an error once the error lines are rendered. Each error, with its text:
  - Full name empty: "Enter your full name."
  - Email empty: "Enter your email address." Anything that does not match `/^[^\s@]+@[^\s@]+\.[^\s@]+$/`: "Enter an email address such as name@example.com."
  - Date of birth empty: "Enter your date of birth." Later than 8 June 2027, or earlier than 1 January 1927: "Enter a date of birth from 1927 to today." With Playing chosen and a birthday after 8 June 2009, so under 18 today: "Playing membership is for adults. Choose Junior membership, or check the date." With Junior chosen and a birthday on or before 8 June 2009: "Junior membership is for under 18s. Choose Playing or Social membership, or check the date." Social takes any age.
  - Emergency contact empty: "Enter the name of someone we can call."
  - Emergency contact's phone: with spaces removed, anything but 10 to 15 digits with an optional `+` in front: "Enter a phone number of 10 to 15 digits."
  - Consent not ticked: "Tick the box to agree to the code of conduct." The checkbox gets `aria-invalid` and names the line, and focus can move to it like any field.
- The error under the date of birth is also removed when the membership changes, since it may no longer hold.
- With no errors, the form is removed with its cards and its panel, the confirmation fills the status element, and focus moves to its `<h2>`, so that the message is not read twice.
- The links need no behavior beyond their `href`.

## Rules

- **Colors:** only the theme's colors, through the semantic classes (`bg-background`, `text-foreground`, `bg-card`, `bg-primary`, `text-primary-foreground`, `text-muted-foreground`, `border-border` and so on). No hex, rgb or named colors in components, and no Tailwind palette classes such as `bg-blue-500` or `text-gray-600`.
- **Spacing:** padding, margin and gap use only the scale's steps (`1`, `2`, `3`, `5`, `8`, `18`) plus 0, 1px and 2px. No arbitrary values such as `p-[18px]`, and no other steps such as `p-6` or `gap-10`. `auto` margins are fine. Widths and heights such as `w-64` or `size-4` are sizes, not spacing. This applies to the code you write: a stock component keeps the spacing inside it, unless this brief changes it.
- **Type:** every piece of text you write gets its size from one of `text-display`, `text-h1`, `text-h2`, `text-body`, `text-label`, set on the element or on a parent it inherits from. Put `text-body` on the outermost element of the page you write. No other sizes. A stock shadcn component keeps the size it ships with, unless `DESIGN.md` or this brief gives that component its own style. A type class does not replace a weight class: where a stock component ships `font-medium` and the text should be regular, add `font-normal`.
- **Fonts:** only the theme's fonts, through `font-sans`, `font-heading` and `font-mono`. Do not add a font.
- **Corners:** only the `rounded-*` classes, which the theme already sets. No arbitrary radius, and `rounded-full` only where `DESIGN.md` or this brief names a full round, such as an avatar or a status dot. The theme allows a full round on a box up to 48px across; Strict Check reports a larger one, and a pill counts by its height.
- **Contrast:** all text meets WCAG AA against its background.
- **Stock components:** a component from `components/ui`, and an `<a>` styled with `buttonVariants`, keeps the hover, pressed and disabled colors and the motion it ships with, unless this brief changes them. They are the theme's colors under other names.
- **Counts:** a number with a noun reads right at one: "1 set", not "1 sets". Where this brief gives the words for only one of the two, write the other the same way.
- **Sizes from data:** a height or a width that comes from data (a chart bar, a meter) is set with an inline `style`. That is the one use for an inline style.
- **Focus:** every link and control shows a 2px outline on keyboard focus: `focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring`. Keep `focus-visible:outline-solid` in it: in Tailwind 4 an `outline-none` on the same element, which stock components carry, otherwise hides the outline. An element that only gets focus from code (a heading or a message with `tabIndex={-1}`) gets the same outline written with `focus:` in place of `focus-visible:` (`focus:outline-solid focus:outline-2 focus:outline-offset-2 focus:outline-ring`): after a mouse click, a browser does not match `:focus-visible` on an element that code focuses. A link, a button or a field that code focuses keeps the `focus-visible:` classes it has: after a mouse click it shows no outline, which is how a browser treats every control, and is right. A stock component that ships its own focus ring (`Button`, `buttonVariants`, `Input`, `Textarea`, `Checkbox`, `Switch`, `AccordionTrigger`, the close button of a `Sheet`) must lose that ring. Do it once, in the component's file in `components/ui`, which is yours to change: replace its `focus-visible:ring-*` classes with the outline classes, and in a field replace its `aria-invalid:ring-*` classes, the `dark:` ones included, with `aria-invalid:ring-0`, or a field with an error shows a tinted ring. `Button` has two more sets. Its base classes also carry `aria-invalid:ring-*` classes: replace them with `aria-invalid:ring-0`, as in a field. Its `destructive` variant carries `focus-visible:ring-*` classes of its own, the `dark:` one included: delete them and put nothing in their place, because the base classes already give every variant the outline. Wherever this rule says replace, change the classes in the file and do not add `ring-0` beside them: an added class only wins where it comes later and passes through `cn`. The stock `focus-visible:border-ring` can stay. These ring changes go only into the files of components that this page uses and that can take focus on it: a `Badge` that is not a link keeps its ring classes. The `cn` import from the setup steps is another matter and goes into every file. A box that scrolls sideways (a code block, a wide table) gets `tabIndex={0}`, `role="region"`, an `aria-label` and the same outline, also at widths where it happens to fit. Where a focusable box touches the edges of a parent that has `overflow-hidden`, draw its outline inside it: `focus-visible:-outline-offset-2` in place of `focus-visible:outline-offset-2`.
- **Not allowed:** purple or multi-color gradients; emoji used as icons or bullets; glows and colored shadows.
- **Avoid:** a card inside a card.
- **Dark mode:** the page must work with the `dark` class on `<html>`. Because every color comes from a semantic class, this needs no extra code; do not write `dark:` color overrides. A new shadcn project follows the system's mode and switches on the `d` key: leave that as it is, and add no mode switch of your own. If the page has a native `<select>` or a date or time field, tell the browser the mode, or its list and its picker stay light in dark mode: in the global CSS, give `:root` `color-scheme: light` and `.dark` `color-scheme: dark`.

From the theme's own do's and don'ts:

- Do use amber once in view, on the main action. The focus outline in dark mode does not count.
- Do set scores, times and positions large, in the heading font.
- Do keep text on a navy band white and labels on it ice blue, in both modes.
- Don't write in amber or orange on a light page, and don't use amber for a link.
- Don't slant, outline or stretch the heading font, and don't use gradients or glows.
- Don't put a card inside a card or a band inside a card.
- Don't introduce a color, size or radius that is not a token above.

## Check before you finish

Go through this list against the code you wrote, and fix anything that fails.

- [ ] The three memberships are native radios that share a name, each in a card that is a `<label>`, with Playing chosen at the start; the chosen card is marked by its radio and a darker border, never by amber.
- [ ] Every field has a visible label tied to it; sending the form with empty or wrong fields shows an error in words with an icon under each, tied with `aria-describedby`, and moves focus to the first field with an error.
- [ ] A date of birth under 18 with Playing chosen, or 18 or over with Junior chosen, gets its own error, worked out against 8 June 2027 and not the device clock.
- [ ] After Join the club the form is replaced by a confirmation with the number `WFC-27-0141` in a `role=status` element that was on the page from the start, and focus moves to its heading.
- [ ] Join the club in the form is the page's only amber button, and the radios and the checkbox show a navy mark in light mode and an ice blue one in dark mode.
- [ ] No color is written as a hex, rgb or Tailwind palette value in the page's code.
- [ ] Every padding, margin and gap in the code you wrote is a step of the spacing scale.
- [ ] Every text element you wrote gets its size from a type-scale class, its own or an inherited one. Visually hidden text is exempt.
- [ ] No file in `components/ui` imports `cn` from `"cn"` directly.
- [ ] Text contrast meets WCAG AA in light and dark mode.
- [ ] The page has one `<h1>`, headings are in order, and every image has alt text.
- [ ] Every interactive element can be reached with the keyboard and shows the focus outline from the rules.
- [ ] At 375px wide the page does not scroll sideways. Wide tables and code blocks scroll inside their own box.
- [ ] The project builds without errors or warnings.

Then tell the user which checks pass, which you could not verify, and anything in this brief you did not do and why.
