/*
 * Public registration form.
 *
 * Navy and quiet, with colour arriving only where something good happens: a
 * completed step, a waived fee, the confirmation screen. Colour is earned, the
 * way it is on the course.
 *
 * All colours come from CSS custom properties written by Settings > Branding.
 * Nothing here hardcodes a hex value.
 */

.ea-scope {
	--ea-radius: 12px;
	--ea-gap: 1rem;
	font-family: var(--ea-font-body);
	color: var(--ea-ink);
	font-size: 17px;
	line-height: 1.55;
	max-width: 720px;
	margin: 0 auto;
	padding: 0 1rem 8rem;
	-webkit-text-size-adjust: 100%;
}

.ea-scope *,
.ea-scope *::before,
.ea-scope *::after { box-sizing: border-box; }

/*
 * Make the `hidden` attribute mean something.
 *
 * Browsers honour `hidden` through their default stylesheet's
 * [hidden] { display: none } -- the lowest-priority rule in the cascade. Any
 * author rule that sets `display` beats it, and this file sets display on
 * buttons, chips, choice groups, and layout wrappers. Without this line,
 * `element.hidden = true` from JavaScript silently does nothing, and the form
 * shows Back, Continue, and Complete registration all at once.
 *
 * Scoped to .ea-scope so it cannot reach the surrounding theme.
 */
.ea-scope [hidden] { display: none !important; }

/* --- Masthead ---------------------------------------------------------- */

.ea-masthead { text-align: center; padding: 1.5rem 0 1rem; }
.ea-masthead__logo { max-width: 220px; height: auto; margin: 0 auto 1rem; display: block; }
.ea-masthead__art  { max-width: 100%; height: auto; margin: 0 auto 1rem; display: block; }

.ea-masthead__title {
	font-family: var(--ea-font-display);
	font-weight: 800;
	font-size: 1.9rem;
	line-height: 1.15;
	color: var(--ea-navy);
	text-transform: var(--ea-heading-transform);
	letter-spacing: var(--ea-heading-tracking);
	margin: 0 0 .4rem;
}

.ea-masthead__facts { color: var(--ea-muted); font-size: .95rem; margin: 0; }

/* --- Step indicator ------------------------------------------------------
   One colour per kilometre. The dot fills as you pass each step, so the
   progress bar assembles the course palette as you go. */

.ea-steps {
	display: flex;
	justify-content: space-between;
	list-style: none;
	margin: 1.5rem 0 2rem;
	padding: 0;
	position: relative;
}

.ea-steps::before {
	content: "";
	position: absolute;
	top: 9px;
	left: 8%;
	right: 8%;
	height: 2px;
	background: var(--ea-rule);
}

.ea-steps__item {
	position: relative;
	flex: 1;
	text-align: center;
	font-size: .72rem;
	letter-spacing: .04em;
	text-transform: uppercase;
	color: var(--ea-muted);
}

.ea-steps__dot {
	display: block;
	width: 20px;
	height: 20px;
	margin: 0 auto .45rem;
	border-radius: 50%;
	background: var(--ea-white);
	border: 2px solid var(--ea-rule);
	transition: background-color .18s ease, border-color .18s ease, transform .18s ease;
}

.ea-steps__item.is-current .ea-steps__dot,
.ea-steps__item.is-done .ea-steps__dot {
	background: var(--step-color);
	border-color: var(--step-color);
}

.ea-steps__item.is-current .ea-steps__dot { transform: scale(1.2); }
.ea-steps__item.is-current .ea-steps__label { color: var(--ea-navy); font-weight: 600; }

@media (prefers-reduced-motion: reduce) {
	.ea-steps__dot { transition: none; }
	.ea-steps__item.is-current .ea-steps__dot { transform: none; }
}

/* --- Steps and fields ---------------------------------------------------- */

.ea-step { border: 0; margin: 0 0 2rem; padding: 0; }

.ea-step__title {
	font-family: var(--ea-font-display);
	font-weight: 800;
	font-size: 1.35rem;
	color: var(--ea-navy);
	text-transform: var(--ea-heading-transform);
	letter-spacing: var(--ea-heading-tracking);
	padding: 0;
	margin-bottom: .5rem;
}

.ea-step__intro { color: var(--ea-muted); margin: 0 0 1.25rem; }

.ea-field { margin-bottom: 1.25rem; }

.ea-field > label,
.ea-choice__legend {
	display: block;
	font-weight: 600;
	color: var(--ea-navy);
	margin-bottom: .35rem;
	font-size: .95rem;
}

.ea-req { color: var(--ea-error); }

.ea-help { color: var(--ea-muted); font-size: .85rem; margin: .35rem 0 0; }

.ea-field input[type="text"],
.ea-field input[type="email"],
.ea-field input[type="tel"] {
	width: 100%;
	min-height: 48px;
	padding: .7rem .85rem;
	font-family: inherit;
	font-size: 17px; /* 16px minimum stops iOS zooming on focus. */
	color: var(--ea-ink);
	background: var(--ea-field);
	border: 1px solid var(--ea-rule);
	border-radius: 8px;
}

.ea-field input:focus-visible,
.ea-chip input:focus-visible + span,
.ea-btn:focus-visible {
	outline: 3px solid var(--ea-blue);
	outline-offset: 2px;
}

.ea-field--check label {
	display: flex;
	gap: .6rem;
	align-items: flex-start;
	font-weight: 400;
	color: var(--ea-ink);
	cursor: pointer;
}

.ea-field--check input { width: 22px; height: 22px; margin-top: 2px; flex: none; }

/* Emergency contact and bib dedication: present, clearly optional, visually
   subordinate to the answers we actually need. */
.ea-field--secondary {
	padding-left: .85rem;
	border-left: 3px solid var(--ea-rule);
}

.ea-field--secondary > label,
.ea-field--secondary .ea-choice__legend { font-weight: 500; color: var(--ea-muted); }

/* --- Tap targets, replacing dropdowns ------------------------------------ */

.ea-choice { border: 0; padding: 0; margin: 0 0 1.25rem; }

.ea-choice__group {
	display: block;
	font-size: .78rem;
	text-transform: uppercase;
	letter-spacing: .06em;
	color: var(--ea-muted);
	margin: .6rem 0 .3rem;
}

.ea-choice__options { display: flex; flex-wrap: wrap; gap: 8px; }

.ea-chip { position: relative; }

.ea-chip input {
	position: absolute;
	opacity: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	cursor: pointer;
}

.ea-chip span {
	display: flex;
	align-items: center;
	justify-content: center;
	min-width: 52px;
	min-height: 48px;
	padding: 0 .9rem;
	border: 2px solid var(--ea-rule);
	border-radius: 8px;
	background: var(--ea-white);
	font-weight: 600;
	color: var(--ea-ink);
	transition: border-color .12s ease, background-color .12s ease;
}

.ea-chip input:checked + span {
	border-color: var(--ea-blue);
	background: var(--ea-blue-050);
	color: var(--ea-navy);
}

.ea-chip.is-sold-out span { opacity: .45; text-decoration: line-through; cursor: not-allowed; }
.ea-chip__note {
	position: absolute;
	left: 0; right: 0; bottom: -1.1rem;
	font-size: .7rem;
	font-style: normal;
	text-align: center;
	color: var(--ea-muted);
}

/* --- Participant cards ---------------------------------------------------- */

.ea-card {
	background: var(--ea-white);
	border: 1px solid var(--ea-rule);
	border-radius: var(--ea-radius);
	padding: 1.1rem;
	margin-bottom: 1rem;
}

.ea-card__head { display: flex; align-items: center; gap: .6rem; margin-bottom: 1rem; }

.ea-card__number {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 26px;
	height: 26px;
	border-radius: 50%;
	background: var(--ea-navy);
	color: var(--ea-white);
	font-family: var(--ea-font-mono);
	font-size: .8rem;
	flex: none;
}

.ea-card__name { font-weight: 700; color: var(--ea-navy); flex: 1; }

.ea-card__remove {
	background: none;
	border: 0;
	font-size: 1.5rem;
	line-height: 1;
	color: var(--ea-muted);
	cursor: pointer;
	padding: .25rem .5rem;
	min-width: 44px;
	min-height: 44px;
}

.ea-card__price {
	font-family: var(--ea-font-mono);
	font-size: .95rem;
	margin: 1rem 0 0;
	padding-top: .8rem;
	border-top: 1px solid var(--ea-rule);
	color: var(--ea-navy);
}

/* The one place colour interrupts the navy: a family being told their child
   registers free. This is the emotional centre of the flow, not a generic
   success alert. */
.ea-card__price.is-waived { color: var(--ea-waived); font-weight: 600; }

.ea-card__price.is-waived::before {
	content: "";
	display: inline-block;
	width: 10px;
	height: 10px;
	margin-right: .5rem;
	border-radius: 50%;
	background: var(--ea-k3-teal);
	box-shadow: 0 0 0 4px color-mix(in srgb, var(--ea-k3-teal) 22%, transparent);
}

.ea-card__price small { display: block; font-family: var(--ea-font-body); font-size: .85rem; font-weight: 400; }

/* --- Buttons -------------------------------------------------------------- */

.ea-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 52px;
	padding: 0 1.6rem;
	border: 0;
	border-radius: 8px;
	background: var(--ea-blue);
	color: var(--ea-white);
	font-family: inherit;
	font-size: 1rem;
	font-weight: 700;
	cursor: pointer;
}

.ea-btn--ghost { background: transparent; color: var(--ea-navy); border: 2px solid var(--ea-rule); }
.ea-btn--add   { background: transparent; color: var(--ea-blue); border: 2px dashed var(--ea-rule); width: 100%; }

.ea-link {
	background: none;
	border: 0;
	padding: .5rem 0;
	color: var(--ea-blue);
	font-family: inherit;
	font-size: .9rem;
	text-decoration: underline;
	cursor: pointer;
}

.ea-nav { display: flex; gap: .75rem; margin-top: 1.5rem; }
.ea-nav .ea-btn { flex: 1; }

/* --- Errors --------------------------------------------------------------- */

.ea-errors {
	border-left: 4px solid var(--ea-error);
	background: color-mix(in srgb, var(--ea-error) 7%, transparent);
	padding: .9rem 1rem;
	border-radius: 6px;
	margin-bottom: 1.5rem;
}

.ea-errors h2 { font-size: 1rem; margin: 0 0 .4rem; color: var(--ea-error); }
.ea-errors ul { margin: 0; padding-left: 1.1rem; }
.ea-errors a  { color: var(--ea-error); }

.ea-field.has-error input { border-color: var(--ea-error); background: var(--ea-white); }
.ea-field__error { color: var(--ea-error); font-size: .85rem; margin: .3rem 0 0; }

/* --- Review and totals ---------------------------------------------------- */

.ea-review table { width: 100%; border-collapse: collapse; margin-bottom: 1.5rem; }
.ea-review th, .ea-review td { text-align: left; padding: .6rem .4rem; border-bottom: 1px solid var(--ea-rule); font-size: .92rem; }
.ea-review th { color: var(--ea-muted); font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; }
.ea-review td:last-child { text-align: right; font-family: var(--ea-font-mono); }

.ea-waiver {
	background: var(--ea-field);
	border-radius: var(--ea-radius);
	padding: 1rem;
	margin-bottom: 1.5rem;
}

.ea-waiver__title { font-size: 1rem; color: var(--ea-navy); margin: 0 0 .5rem; }
.ea-waiver__text  { font-size: .85rem; color: var(--ea-muted); max-height: 12rem; overflow-y: auto; }

.ea-total {
	font-family: var(--ea-font-mono);
	font-size: 1.5rem;
	font-weight: 600;
	color: var(--ea-navy);
	padding: 1rem 0;
}

/* --- Sticky summary ------------------------------------------------------- */

.ea-summary {
	position: fixed;
	left: 0; right: 0; bottom: 0;
	display: none;
	justify-content: space-between;
	align-items: center;
	gap: 1rem;
	padding: .85rem 1.1rem;
	background: var(--ea-navy);
	color: var(--ea-white);
	font-family: var(--ea-font-mono);
	font-size: .95rem;
	z-index: 40;
}

.ea-summary.is-visible { display: flex; }

/* --- Honeypot ------------------------------------------------------------- */

.ea-hp {
	position: absolute !important;
	width: 1px; height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	white-space: nowrap;
}

.screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	white-space: nowrap;
}

/* --- Without JavaScript --------------------------------------------------- */

.ea-scope:not(.is-enhanced) .ea-nav__next,
.ea-scope:not(.is-enhanced) .ea-nav__back { display: none; }
.ea-scope:not(.is-enhanced) .ea-card__price { display: none; }

/* --- Wider screens -------------------------------------------------------- */

@media (min-width: 641px) {
	.ea-scope { padding-bottom: 6rem; }
	.ea-masthead__title { font-size: 2.4rem; }
	.ea-steps__item { font-size: .78rem; }
}

/* --- "Same as above" -------------------------------------------------------
   Appears only when the card above has an answer this one is missing, so it is
   absent far more often than it is present and never becomes visual noise. */

.ea-copy-above {
	display: inline-block;
	margin-top: .4rem;
	padding: .3rem .55rem;
	border: 1px solid var(--ea-rule);
	border-radius: 6px;
	background: var(--ea-white);
	color: var(--ea-blue);
	font-family: inherit;
	font-size: .8rem;
	line-height: 1.2;
	cursor: pointer;
	min-height: 34px;
}

.ea-copy-above:hover { background: var(--ea-blue-050); border-color: var(--ea-blue); }

.ea-card__copy {
	display: block;
	width: 100%;
	margin-top: .5rem;
	padding: .6rem;
	border: 1px dashed var(--ea-rule);
	border-radius: 8px;
	background: var(--ea-white);
	color: var(--ea-blue);
	font-family: inherit;
	font-size: .9rem;
	text-decoration: none;
	cursor: pointer;
	min-height: 44px;
}

.ea-card__copy:hover { background: var(--ea-blue-050); border-color: var(--ea-blue); }

.ea-deadline {
	margin: 0 0 .6rem;
	padding: .6rem .8rem;
	background: color-mix(in srgb, var(--ea-k2-yellow) 18%, transparent);
	border-left: 3px solid var(--ea-k2-yellow);
	border-radius: 0 4px 4px 0;
	font-size: .87rem;
	color: var(--ea-ink);
}

.ea-lookup__notice {
	padding: .8rem 1rem;
	background: color-mix(in srgb, var(--ea-k5-green) 15%, transparent);
	border-left: 3px solid var(--ea-k5-green);
	border-radius: 0 6px 6px 0;
	margin-bottom: 1.5rem;
}

.ea-lookup__size {
	min-height: 44px;
	padding: .4rem .5rem;
	font-family: inherit;
	font-size: 16px;
	border: 1px solid var(--ea-rule);
	border-radius: 6px;
	background: var(--ea-white);
}

.ea-donate-link { margin: -.5rem 0 1.5rem; font-size: .9rem; }
.ea-donate-link a { color: var(--ea-blue); }

.ea-donate .ea-buttongroup { display: flex; flex-wrap: wrap; gap: .5rem; }
.ea-donate .ea-choice { flex: 0 1 auto; min-width: 6.5rem; }

.ea-welcome-back {
	padding: .8rem 1rem;
	margin-bottom: 1.5rem;
	background: color-mix(in srgb, var(--ea-k5-green) 14%, transparent);
	border-left: 3px solid var(--ea-k5-green);
	border-radius: 0 6px 6px 0;
	font-size: .92rem;
}
