/**
 * Brand 2026 — visual parity layer
 * =============================================================================
 *
 * Brings the surviving pages of this legacy install up to the visual identity
 * of alphafmc.com. Every value here is taken from the new theme's `theme.json`
 * as it compiles today.
 *
 * WHY THIS FILE EXISTS
 * The theme's own CSS cannot be recompiled: `dist/assets/css/*.css` is Vite
 * output and the `fe-src/` tree that built it was never committed. So this is
 * an additive layer, hand-authored, queued last. Nothing in `dist/` is edited.
 *
 * HOW IT WINS THE CASCADE
 * Source order, almost everywhere. It is enqueued at `wp_enqueue_scripts`
 * priority 9999 (see `vite-incs/vite-setup-assets.php`), so it prints after
 * both compiled stylesheets, after Formidable and after MemberPress's UI CSS.
 *
 * `!important` is used in exactly four places (7 declarations), each because
 * the rule it beats is itself `!important`, and each explained where it appears:
 *   §2  the global font-family reset
 *   §6  Formidable's current-step circle
 *   §7  ReadyLaunch's chrome bar and account nav
 *   §7  ReadyLaunch's account-row action links
 * Nothing else in the file needs one — everywhere else source order or
 * specificity is enough.
 *
 * SYNTAX
 * Native CSS nesting throughout. Baseline: Chrome 112, Safari 16.5,
 * Firefox 117 (all 2023). Older browsers ignore the nested rules and get the
 * pre-existing appearance — the file is additive, so nothing breaks.
 *
 * CONTENTS
 *   §1  Tokens
 *   §2  Typography
 *   §3  Header
 *   §4  Hero — .general-header
 *   §5  Footer
 *   §6  Buttons, form controls, Formidable
 *   §7  MemberPress ReadyLaunch (/account/ + pricing)
 *   §7a Active surveys — theme block on /account/
 *   §7b Account nav — hiding Payments and Subscriptions
 *   §8  Cookie bar
 *   §9  Palette utilities
 */

/* =============================================================================
 * §1  TOKENS
 * ========================================================================== */

:root {
	/* Palette — theme.json settings.color.palette */
	--brand-1: #503af5;
	--brand-1-tint-20: #dcd8fd;
	--brand-1-tint-10: #eeebfe;
	--brand-1-tint-5: #eaeef2;
	--brand-2: #7e8aff;
	--brand-3: #59f7b1;
	--base: #ffffff;
	--base-alt: #e0ebd4;
	--contrast: #2a2723;
	--monotone-warm: #bbc1b2;

	/* State — theme.json settings.custom.color.palette.state */
	--focus: #9c0de9;
	--negative: #9b0f0f;

	/* Type + layout */
	--sans: "quire-sans", "Helvetica Neue", Helvetica, sans-serif;
	--content: 1512px;

	/* theme.json "Fluid 30 | Gutter": 15px → 30px between 375 and 1360 */
	--gutter: clamp(0.9375rem, calc(0.9375rem + 15 * ((100vw - 375px) / 985)), 1.875rem);

	/* Hairline on dark grounds, as used by the new footer's column rules */
	--rule-on-dark: rgb(255 255 255 / 24%);
}

/* =============================================================================
 * §2  TYPOGRAPHY
 *
 * The families to replace are IntroRegular / IntroSemiBold / IntroBold /
 * MetaSerifBook / MetaSerifBold (theme) plus "Lucida Grande" (Formidable) and
 * "Helvetica Neue" (theme default + MemberPress).
 *
 * WHY A GLOBAL !IMPORTANT AND NOT A SELECTOR LIST
 * Aliasing the families with `@font-face { src: local("quire-sans") }` was the
 * tidy option and it does not work: `local()` only matches system-installed
 * fonts, and quire-sans is a web font. Tested in Chrome — the alias silently
 * falls back to serif.
 *
 * The alternative is overriding the rules that set those families. There are
 * 362 unique such selectors in the compiled CSS, with specificities from
 * (0,0,1) to (0,3,2); no single non-!important selector beats them all, and a
 * hand-picked subset would be tuned to today's six pages and would rot as new
 * survey pages are added. So: one `!important`, on one property, applied once.
 *
 * SAFETY — measured, not assumed. An audit of every element and pseudo-element
 * on all six live pages found no icon fonts in use (no FontAwesome, dashicons
 * or icomoon glyphs computed anywhere). The exclusions below are defensive,
 * for content added later. The rule deliberately targets elements only, never
 * ::before/::after, so icon glyphs — which set their family on the pseudo —
 * are untouched either way.
 * ========================================================================== */

html {
	color: var(--contrast);
	font-family: var(--sans);
}

:is(body, body *):not(
	/* icon fonts */
	.fa, .fas, .far, .fal, .fab, .fad, [class*="fa-"],
	.dashicons, [class*="dashicons-"],
	.frmfont, [class*="frm_icon"], [class*="frm-icon"],
	[class*="icomoon"], [class*="icon-"],
	/* deliberate monospace */
	code, kbd, pre, samp, tt, var
) {
	font-family: var(--sans) !important;
}

:is(h1, h2, h3, h4, h5, h6) {
	font-family: var(--sans);
	font-weight: 400;
	letter-spacing: -0.03em;
	line-height: calc(1em + 0.25rem);
}

/* theme.json styles.elements.h3 is the one heading that carries weight. */
h3 {
	font-weight: 600;
}

/* Body links. The theme colours them with `p a { color: #00AECB }` (0,0,2) and
   a matching darker hover; the new site uses brand-1 for both, with the
   underline appearing only on hover.
   Scoped inside `main` on purpose: `:is(…)` takes the weight of its heaviest
   argument, so an unscoped version lands at (0,1,1) and outranks §5's
   `footer a` (0,0,2) — which turned the footer address violet. */
main :is(p, li, td, dd, .wysiwyg) a {
	color: var(--brand-1);
	text-decoration: none;

	&:hover {
		color: var(--brand-1);
		text-decoration: underline;
	}
}

/* Accent headings — the theme's teal/dark-teal pair. */
.default-header .accent-color:is(.blue, .light-blue) h2 {
	color: var(--brand-1);

	&::before {
		background-color: var(--brand-1);
	}
}

/* The theme has no visible focus style at all. */
:where(a, button, input, select, textarea, [tabindex]):focus-visible {
	outline: 2px solid var(--focus);
	outline-offset: 2px;
}

/* =============================================================================
 * §3  HEADER
 *
 * Was: a #28343D bar with a white parallelogram behind the old logo (built
 * from `.home-link` plus a skewed ::after) and a teal angled sliver beneath.
 * Now: a flat #2A2723 bar with the white lockup sitting directly on it.
 *
 * Header height is left alone — 75px below 1200px, 100px above. The new site
 * computes to 88px; the delta is imperceptible between tabs, and changing it
 * would mean chasing every `padding-top: 100px` that exists to clear the
 * fixed header.
 * ========================================================================== */

header {
	background: var(--contrast);
	border-bottom: 0;

	/* Compiled CSS sets `header .desktop .container { max-width: 1750px }`. */
	.desktop .container,
	.container {
		max-width: var(--content);
		padding-inline: var(--gutter);
	}

	.home-link {
		width: auto;
		background: transparent;

		/* The white parallelogram and its bleed, retired. */
		&::before,
		&::after {
			display: none;
		}

		a {
			left: 0;
			width: 128px;
			height: 40px;
			margin-block: 17px; /* 17 + 40 + 17 ≈ 75px bar */
			background: url(../img/alpha-logo-white.png) left center / contain no-repeat;
		}
	}

	/* Search is retired. It is NOT CMS-driven — the form is hard-coded in
	   header.php lines 55–60 — so the tidier fix is to delete that block from
	   the template. Hidden here so the CSS-only layer stands on its own; if
	   the markup goes, this rule is simply inert and can come out with it. */
	.search {
		display: none;
	}
}

/* The angled sliver has no counterpart in the new identity. */
.primary-nav-decoration-el {
	display: none;
}

/* Off-canvas nav panel. Carries #28343D so it reads as a solid overlay on
   mobile; at ≥1200px it becomes a relative flex item next to the logo and the
   compiled CSS never resets the colour, so against the new #2A2723 bar it
   showed as a lighter panel. Re-point it rather than clear it — it still needs
   to be opaque when open on mobile. */
.primary-navigation,
.menu-child-wrapper {
	background-color: var(--contrast);
}

@media (min-width: 1200px) {
	header .home-link a {
		left: 0;
		width: 160px;
		height: 48px;
		margin-block: 26px; /* 26 + 48 + 26 = 100px bar */
	}
}

/* =============================================================================
 * §4  HEROES
 *
 * Two hero components, and the new site has two matching treatments. Which one
 * a page gets depends on whether there is an image to show, not on which
 * component renders it:
 *
 *   SOLID  — as on alphafmc.com/privacy-policy/: #2A2723 ground, no
 *            photograph, heading bottom-left, 360px band. The default, and
 *            what the utility pages (login, sign-up, privacy-policy) keep.
 *
 *   MEDIA  — as on alphafmc.com/insights/: the page's own featured image (or
 *            ACF `intro_image`) multiplied under brand-1, 440px band. Applied
 *            wherever `.background-image` actually contains an <img>.
 *
 * `.main-intro` (posts) always outputs that image, so survey posts get MEDIA.
 * `.general-header` (pages, via index.php) outputs it only on pages that carry
 * a survey form — see `alpha_brand_2026_has_survey_form()` in
 * vite-incs/vite-setup-assets.php. So a survey page picks up MEDIA the moment
 * an editor sets a featured image, while login keeps SOLID even though it has
 * a stray one.
 *
 * Both carry the heading alone — no breadcrumb, no standfirst.
 * ========================================================================== */

/* ── §4a  Solid hero — the default ───────────────────────────────────────── */

.general-header,
.main-intro {
	position: relative;
	z-index: 10;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;

	/* 360px, not 440px. The new site's solid heroes use the `fixed-small`
	   dimension preset (its /about/ page is the reference) and 440px only where
	   a breadcrumb fills the upper half. With the heading alone, the taller band
	   reads as empty rather than generous. */
	min-height: 435px; /* 75px header + 360px visible band */
	background-color: var(--contrast);
	color: var(--base);

	/* `width: 100%` is load-bearing. `.container` carries `margin: 0 auto`, and
	   an auto cross-axis margin on a flex item suppresses `align-items:
	   stretch` — so without it the container shrink-wraps to its content
	   (measured 1198px) and `max-width` never comes into play. */
	.container {
		width: 100%;
		max-width: var(--content);
	}

	.wrapper {
		padding: var(--gutter);

		:is(h1, h2) {
			margin: 0;
			padding: 0;
			font-size: clamp(1.744rem, 1.744rem + ((1vw - 0.2rem) * 1.571), 3rem);
			font-weight: 400;
			letter-spacing: -0.03em;
			line-height: calc(1em + 0.25rem);
		}
	}
}

/* ── §4b  Shared structure for the components that carry media ───────────── */

.main-intro {
	/* Was #C1C0BE with the text pushed down by `padding-top: 480px`. The band
	   is now sized by min-height and the text bottom-aligned by flex, so that
	   push-down has to go or the section grows to ~1000px. */
	.text {
		padding-top: 0;
	}

	.container,
	.container.small {
		width: 100%;
		max-width: var(--content);
	}

	.text .wrapper {
		padding: var(--gutter);
	}

	h1 {
		margin: 0;
		font-size: clamp(1.744rem, 1.744rem + ((1vw - 0.2rem) * 1.571), 3rem);
		font-weight: 400;
		letter-spacing: -0.03em;
		line-height: calc(1em + 0.25rem);

		/* `.text-highlight-lg span` paints a tiled translucent backing behind
		   each line. The new hero sets its heading straight on the image. */
		span {
			padding: 0;
			background-image: none;
		}
	}

	.author {
		margin-top: 0.75rem;
		color: var(--base);
		font-size: 1rem;
		line-height: 1.5;
	}

	/* The angled diagonals have no counterpart in the new identity. */
	.angle-sliver,
	> .angle-section {
		display: none;
	}
}

/* ── §4c  Media hero — wherever there is an image to show ────────────────────
 * Reproduces the new Insights hero exactly: #2A2723 ground, image at .72, then
 * a brand-1 multiply overlay.
 *
 * The multiply has to live on an overlay rather than on the <img> itself:
 * `.background-image` carries the `rellax` parallax script, which sets a
 * transform on it, and a transformed element is its own stacking context — so
 * an image blending inside it would composite against its transparent parent
 * instead of this section's ground.
 *
 * `:has()` is what makes this content-driven rather than component-driven: an
 * empty `.background-image` (no featured image set) simply keeps the solid hero
 * from §4a. Supported from Chrome 105 / Safari 15.4 / Firefox 121 — that last
 * one is slightly later than the nesting baseline in the file header. If
 * Firefox 117–120 matters, this whole block can be dropped and every hero falls
 * back to solid; nothing breaks.
 */
:is(.general-header, .main-intro):has(.background-image img) {
	isolation: isolate; /* keeps the multiply on this section's own ground */
	min-height: 515px; /* 75px header + 440px visible band */
	background-color: var(--contrast);

	.background-image img {
		opacity: 0.72;
	}

	&::after {
		position: absolute;
		z-index: 1;
		background: var(--brand-1);
		mix-blend-mode: multiply;
		content: "";
		inset: 0;
	}

	/* Lift the content clear of that overlay. `.main-intro .text` already
	   carries z-index 10 from the compiled CSS, which is why the post heroes
	   looked right; `.general-header`'s container has no z-index, so the
	   multiply was landing on the heading and turning white text violet. */
	> :is(.container, .text) {
		position: relative;
		z-index: 2;
	}
}

@media (min-width: 1200px) {
	.general-header,
	.main-intro {
		min-height: 460px; /* 100px header + 360px visible band */
	}

	:is(.general-header, .main-intro):has(.background-image img) {
		min-height: 540px; /* 100px header + 440px visible band */
	}
}

/* NOT DONE ON PURPOSE: widening `.container` globally to 1512px.
   The 1512px frame is applied to the header, heroes and footer only. Taking it
   into the body as well was tried and reverted — the legacy theme gives each
   section its own measure (1200px default, 1000px `.small`, 850px
   `.extra-small`), so no single hero width aligns with all of them, and
   widening the body stretched survey prose to a 1452px line, which is both
   unreadable and less like the new site than 1200px is. The new site aligns
   its hero and body because everything sits in one 1512px frame with prose
   constrained separately inside it; matching that means normalising the
   containers and capping prose width — a layout change, not a colour one. */

/* =============================================================================
 * §5  FOOTER
 *
 * Was: three decorative 4px bars (#00AECB, #80D7E5, #006579), teal column
 * headings, teal links on navy.
 * Now: warm near-black, a hairline above each column, white headings,
 * near-white links — the new footer's "line above" treatment.
 * ========================================================================== */

footer {
	background-color: var(--contrast);
	color: var(--brand-1-tint-5);
	font-size: 14px;

	/* The 4px cyan bar. */
	&::before {
		display: none;
	}

	/* The two quarter-width bars either side of it. */
	.wrapper {
		&::before,
		&::after {
			display: none;
		}
	}

	.container {
		max-width: var(--content);
		padding-inline: var(--gutter);
	}

	a {
		color: var(--brand-1-tint-5);

		&:hover {
			color: var(--base);
			text-decoration: underline;
		}
	}

	/* Column headings. `.offices` wraps its heading in a link, hence `a`. */
	:is(.address, .offices, .navigation, .footer-brands-navigation) > b {
		display: block;
		margin-bottom: 0.75rem;
		padding-top: 0.75rem;
		border-top: 1px solid var(--rule-on-dark);
		color: var(--base);
		font-weight: 600;

		a {
			color: inherit;
		}
	}

	/* Beats the compiled `footer .offices a` on source order at equal weight. */
	.offices a {
		color: var(--brand-1-tint-5);

		&:is(:hover, .active) {
			color: var(--base);
		}
	}

	.tagline {
		color: var(--base);
		font-family: var(--sans);
	}

	/* Was absolutely positioned inside a fixed 100px box. Made a flex row so
	   copyright and social sit on one line, as they do on the new footer. */
	.subfooter {
		display: flex;
		align-items: center;
		justify-content: space-between;
		flex-wrap: wrap;
		gap: 0.75rem 1.5rem;
		height: auto;
		padding-top: 1rem;
		border-top: 1px solid var(--rule-on-dark);

		.copyright {
			position: static;
			padding: 0;
			color: var(--brand-1-tint-5);
			font-size: 12px;
		}

		.social {
			position: static;
			top: auto;
			right: auto;

			a {
				color: var(--base);
			}
		}
	}
}

/* =============================================================================
 * §6  BUTTONS, FORM CONTROLS, FORMIDABLE
 *
 * The survey is the reason this install is still online, and on that page the
 * form *is* the page. Formidable drives its entire appearance from custom
 * properties on `.with_frm_style`, so this is a token swap rather than a
 * selector fight.
 * ========================================================================== */

/* Theme default was a square #00AECB button with black text. */
:is(button, [type="button"], [type="reset"], [type="submit"]) {
	border-radius: 999px;
	background-color: var(--brand-1);
	color: var(--base);
	font-family: var(--sans);

	&:hover {
		background-color: var(--brand-1);
		color: var(--base);
	}

	&:disabled:hover {
		background-color: var(--brand-1);
	}
}

.with_frm_style {
	--font: var(--sans);
	--text-color: var(--contrast);
	--label-color: var(--contrast);
	--check-label-color: var(--contrast);
	--section-color: var(--contrast);
	--title-color: var(--contrast);
	--form-desc-color: var(--contrast);
	--description-color: var(--contrast);
	--fieldset-color: var(--contrast);

	/* Fields — see the note on §6b: these four are restated at higher
	   specificity there, because the per-style block overrides them. */
	--border-color: var(--monotone-warm);
	--border-color-active: var(--brand-1);
	--required-color: var(--negative);
	--border-color-error: var(--negative);
	--error-text: var(--negative);
	--box-shadow: none;

	/* Submit / Next */
	--submit-bg-color: var(--brand-1);
	--submit-border-color: transparent;
	--submit-text-color: var(--base);
	--submit-border-radius: 999px;
	--submit-padding: 0.75em 1.5em;
	--submit-shadow-color: transparent;
	--submit-hover-bg-color: var(--brand-1);
	--submit-hover-color: var(--base);
	--submit-hover-border-color: transparent;
	--submit-active-bg-color: var(--brand-1);
	--submit-active-color: var(--base);
	--submit-active-border-color: transparent;

	/* Progress rootline — the sixteen-step bar at the top of the survey */
	--progress-active-bg-color: var(--brand-1);
	--progress-active-color: var(--base);
	--progress-color: var(--monotone-warm);
	--progress-bg-color: var(--brand-1-tint-20);
	--progress-border-color: var(--brand-1-tint-20);

	/* Toggles, sliders, date picker */
	--toggle-on-color: var(--brand-1);
	--slider-color: var(--brand-1);
	--slider-bar-color: var(--brand-1);
	--date-head-bg-color: var(--brand-1);
	--date-band-color: var(--brand-1-tint-20);
}

/* The variables above cover hover, focus, fields and progress labels. They do
 * NOT cover the resting state of the submit button or the current-step circle:
 * Formidable writes those as literals (#579AF6 / #4386E2) in rules scoped to
 * the form's style slug, e.g.
 *
 *     .frm_style_same-html-font.with_frm_style .frm_submit button       (0,3,1)
 *     .frm_style_same-html-font.with_frm_style .frm_rootline
 *         .frm_current_page input[type="button"]            (0,5,1) !important
 *
 * `[class*="frm_style_"]` stands in for that slug so these overrides survive a
 * form built on a different Formidable style — the container always carries
 * one — and supplies the class-level weight needed to match those selectors.
 */
/* ── §6b  Field metrics ──────────────────────────────────────────────────────
 * These have to live at this specificity, not with the rest of the variables
 * above. Formidable emits a second, per-form-style block —
 * `.frm_style_same-html-font.with_frm_style` (0,2,0) — which beats a plain
 * `.with_frm_style` (0,1,0), and for this form it contains:
 *
 *     --field-pad: undefined;
 *
 * literally the string "undefined", because the form's saved style has no
 * field padding set. `padding: undefined` is invalid, so the browser dropped
 * it and the inputs collapsed to 30px tall with no padding at all. Restating
 * the metrics here — same specificity, later source — is what fixes it.
 *
 * Values from the new theme's theme.json settings.custom.form.input:
 * padding .75em/1em, line-height 1.563, radius `small` (1rem).
 */
.with_frm_style[class*="frm_style_"] {
	--field-pad: 0.75em 1em;
	--field-height: auto;
	--field-font-size: 16px;
	--line-height: 1.563;
	--border-radius: 1rem;
	--field-border-width: 1px;

	:is(.frm-edit-page-btn, input[type="submit"]),
	.frm_submit :is(button, input[type="submit"], input[type="button"]) {
		border-color: transparent;
		border-radius: 999px;
		background: var(--brand-1);
		color: var(--base);
		padding: 0.75em 1.5em;
		font-weight: 400;
	}

	/* "Previous" reads as the secondary action. */
	.frm_submit button.frm_prev_page {
		border-color: var(--brand-1);
		background: transparent;
		color: var(--brand-1);
	}

	/* Formidable marks the current step !important, so this must too. */
	.frm_rootline .frm_current_page input[type="button"],
	.frm_page_bar input.frm_rootline_show_more_btn.active {
		border-color: var(--brand-1) !important;
		background-color: var(--brand-1) !important;
	}
}

/* Ranking options are draggable controls, not question headings. Keep their
 * text compact without changing the field's label. */
.with_frm_style .frm-ranking-field-option label {
	font-size: 0.875rem;
	line-height: 1.4;
	margin-bottom: 0;
}

/* MemberPress's own login/signup forms on the theme-rendered pages. */
.mp_wrapper {
	:is(input[type="text"], input[type="email"], input[type="password"], select, textarea) {
		padding: 0.75em 1em;
		border-radius: 1rem;
	}

	:is(input[type="submit"], button.mepr-share-button) {
		border-radius: 999px;
		background-color: var(--brand-1);
		color: var(--base);
	}
}

/* =============================================================================
 * §7  MEMBERPRESS READYLAUNCH — /account/ and the pricing template
 *
 * ReadyLaunch stays enabled and no MemberPress setting is changed, so
 * everything here is done in CSS — including the missing logo.
 *
 * WHY !IMPORTANT HERE.
 * MemberPress prints an inline <style> at `wp_head` priority 10 — after our
 * stylesheet, which prints at priority 8 — setting its chrome colours
 * `!important`:
 *
 *     .app-layout .site-header, .guest-layout .site-header { … !important }   (0,2,0)
 *     #mepr-account-nav                                    { … !important }   (1,0,0)
 *
 * Between two `!important` declarations the cascade compares specificity
 * before source order, so one extra `body.mepr-pro-template` step wins:
 * (0,3,1) and (1,1,1) respectively. Do not "tidy" the extra selector away.
 *
 * MAINTENANCE: this section rides on MemberPress's own class names. A
 * ReadyLaunch update that renames `.app-layout` or `#mepr-account-nav` will
 * quietly restore the teal bar — check /account/ after plugin updates.
 * ========================================================================== */

body.mepr-pro-template {
	&:is(.mepr-app-layout, .mepr-guest-layout) .site-header {
		background: var(--contrast) !important;
	}

	&.mepr-guest-layout {
		background: var(--contrast) !important;
	}

	#mepr-account-nav {
		background: var(--contrast) !important;
	}

	/* `design_logo_img` is empty, so ReadyLaunch emits <img src="">. Hide it
	   and paint the lockup on the parent link — this also removes the
	   broken-image icon. */
	.site-branding {
		a {
			display: block;
			width: 160px;
			height: 40px;
			background: url(../img/alpha-logo-white.png) left center / contain no-repeat;
		}

		.site-branding__logo {
			display: none;
		}
	}

	/* ReadyLaunch hard-codes #06429E on links, in `theme.css` as a bare `a`
	   and again in `account.css` as `.mepr-account-container a`.
	   Scoped to the content regions rather than written as a bare `a`: an
	   unscoped version lands at (0,2,1) and would outrank §8's
	   `.cookie-consent a` (0,1,1), turning the cookie bar's link violet.
	   This selector is deliberately kept LOW — (0,2,2). Two things were removed
	   after an audit found the account nav rendering brand-1 on the dark chrome
	   bar at 2.31:1:
	     - `#mepr-template-login` inside the `:is()`. `:is()` takes the weight of
	       its heaviest argument, so one id dragged the whole rule to (1,2,1) and
	       it started beating MemberPress's own inline
	       `#mepr-account-nav .mepr-nav-item a` (also (1,2,1), and later in the
	       head). `.mepro-boxed` already covers the login form.
	     - `a:visited`. It added a class-worth of weight AND routed the colour
	       through the browser's visited-link pass, which overrode MemberPress
	       even at equal specificity — so the nav went violet for visited URLs
	       only. Plain `a` covers visited links anyway.
	   Net effect: the nav keeps its white-on-dark treatment, content links still
	   beat `.mepr-account-container a` (0,2,0). */
	:is(.site-main, .mepr-account-container, .mepro-boxed) a {
		color: var(--brand-1);
	}

	/* Row actions ("Renew", "Cancel"). MemberPress paints these #06429E from
	   `.mepr-account-container #mepr-account-content button.mepr-account-row-action`
	   — (1,3,1) and !important — so the id has to be matched to beat it. They
	   pass contrast either way at 9.2:1; this is a palette fix, not a legibility
	   one. */
	.mepr-account-container #mepr-account-content button.mepr-account-row-action {
		color: var(--brand-1) !important;
	}

	/* The welcome banner ships as a success-green notice (#E6F7ED / #339A6B).
	   Re-pointed to the brand's own tint pair; contrast goes 11.3:1 → 12.6:1. */
	.mepr-account-welcome-message {
		border-color: var(--brand-1-tint-20);
		background-color: var(--brand-1-tint-10);
		color: var(--contrast);
	}

	/* ReadyLaunch hard-codes #06429E on its buttons, and login.css paints the
	   Log In button grey (#737373) from `#mepr-template-login .mepro-form
	   input[type="submit"]` — (1,1,2), so an ID is needed to outrank it
	   without !important.
	   Two kinds of button must NOT become pills:
	     .mp-hide-pw   the show/hide-password toggle inside the field
	     .btn-link     MemberPress's borderless text/icon buttons. The profile
	                   card's four edit controls are `button.btn-link` wrapping a
	                   15×16 SVG, so pilling them turned each one into a 44px
	                   violet disc sitting on top of its own field label — with
	                   the pencil invisible, because that SVG's path is
	                   hard-coded `fill="#777777"`.
	     .btn-outline  the secondary variant, painted just below. Excluded rather
	                   than out-ranked: adding `:not()` to this rule pushed it to
	                   (0,4,2), which beat the outline rule's (0,4,0) on element
	                   count and turned "View Payments / Subscriptions / Change
	                   Password" into solid pills. Keeping the variants out of
	                   this selector entirely means neither has to win a
	                   specificity race with the other. */
	:is(
		.mepr-button:not(.btn-link, .btn-outline),
		.mepr-account-container :is(button, input[type="submit"]):not(.btn-link, .btn-outline)
	),
	#mepr-template-login .mepro-form :is(input[type="submit"], button):not(.mp-hide-pw, .btn-link, .btn-outline) {
		border-color: transparent;
		border-radius: 999px;
		background: var(--brand-1);
		color: var(--base);
	}

	/* The edit pencils. Left borderless by the exclusion above; this only
	   re-points the hard-coded grey to brand-1 — 4.48:1 → 6.43:1 on white. */
	.mepr-profile-details__icon path {
		fill: var(--brand-1);
	}

	/* Secondary variant. Carries its own radius now that it is excluded from the
	   pill rule above — that rule was the only thing rounding it. */
	.mepr-button.btn-outline,
	.mepr-account-container .mepr-button.btn-outline {
		border-color: var(--brand-1);
		border-radius: 999px;
		background: transparent;
		color: var(--brand-1);
	}

	.mepro-boxed {
		border-radius: 1rem;
	}

	:is(input[type="text"], input[type="email"], input[type="password"], select, textarea) {
		padding: 0.75em 1em;
		border-radius: 1rem;
	}
}

/* =============================================================================
 * §7a  ACTIVE SURVEYS — the theme's own block on /account/
 *
 * Markup comes from inc/account-active-surveys.php: the listing renders in its
 * own "Surveys" tab (via `mepr_account_nav_content`, which MemberPress wraps in
 * .mepr-surveys-wrapper), and a one-line pointer to it sits under the profile
 * card. It is our markup, so these are plain class selectors — the !important
 * gymnastics of §7 are only needed where MemberPress's inline <style> is
 * competing.
 *
 * The nav item itself needs no CSS: it reuses MemberPress's .mepr-nav-item and
 * its active class comes from MeprAccountHelper::active_nav().
 *
 * Still nested under `body.mepr-pro-template` for one reason: ReadyLaunch owns
 * the page and #mepr-account-content is a flex child, so the section needs its
 * own width handling rather than inheriting the theme's .container.
 * ========================================================================== */

/* The pointer under the profile card, not part of the listing itself. */
body.mepr-pro-template .alpha-active-surveys__pointer {
	margin-top: 2rem;
	padding-top: 1.25rem;
	border-top: 1px solid var(--brand-1-tint-20);

	a {
		margin-left: 0.25rem;
		font-weight: 600;
	}
}

body.mepr-pro-template .alpha-active-surveys {
	width: 100%;

	:is(.alpha-active-surveys__intro, .alpha-active-surveys__empty) {
		margin: 0 0 1.25rem;
		max-width: 60ch;
	}

	.alpha-active-surveys__list {
		margin: 0;
		padding: 0;
		list-style: none;
	}

	/* Row rather than card: the list sits directly under MemberPress's own
	   boxed profile block, and a second run of boxes reads as clutter. */
	.alpha-active-surveys__item {
		display: flex;
		flex-wrap: wrap;
		gap: 0.75rem 1.5rem;
		align-items: center;
		justify-content: space-between;
		padding: 1rem 0;
		border-top: 1px solid var(--brand-1-tint-20);

		&:last-child {
			border-bottom: 1px solid var(--brand-1-tint-20);
		}
	}

	.alpha-active-surveys__detail {
		display: flex;
		flex-direction: column;
		gap: 0.125rem;

		/* Leaves the Continue pill on the same row down to ~360px. */
		flex: 1 1 16rem;
	}

	.alpha-active-surveys__title {
		font-weight: 600;
	}

	.alpha-active-surveys__saved {
		font-size: 0.875rem;
		color: color-mix(in srgb, var(--contrast) 65%, transparent);
	}

	/* Set apart from the date it sits beside — it is a caveat about what
	   Continue will do, not more metadata. */
	.alpha-active-surveys__locked {
		margin-left: 0.5rem;
		padding: 0.0625rem 0.5rem;
		border-radius: 999px;
		background: var(--brand-1-tint-10);
		color: var(--brand-1);
		font-size: 0.8125rem;
		white-space: nowrap;
	}

	/* The pill itself is already painted by §7's .mepr-button rules — the
	   button classes on the link are there to inherit exactly that. This only
	   stops it stretching in the flex row. */
	.mepr-button {
		flex: 0 0 auto;
	}
}

/* =============================================================================
 * §7b  ACCOUNT NAV — hiding Payments and Subscriptions
 *
 * This install sells nothing. There is one membership ("Alpha FMC - Sign Up"),
 * it is free, and the numbers bear that out: 4,167 transactions of which none
 * carry an amount, and zero subscriptions. So both tabs can only ever show a
 * member an empty table, and the same two links appear again as buttons under
 * the profile card.
 *
 * WHY CSS AND NOT A FILTER
 * MemberPress hard-codes these items in its nav views (readylaunch/account/
 * nav.php and account/nav.php). It filters their labels and their hrefs —
 * `mepr_account_nav_payments_label`, `…_link` — but offers no hook to drop an
 * item, and blanking a label leaves an empty <li> behind. `display: none` takes
 * them out of the tab order and the accessibility tree too, so keyboard and
 * screen-reader users do not meet a hidden tab.
 *
 * The URLs still work if typed — /account/?action=payments renders its empty
 * table. Harmless here, but see the note in inc/account-active-surveys.php if
 * you would rather they redirect.
 *
 * The nav <li> classes come from MeprAccountHelper::active_nav(), which prints
 * `mepr-<tab>` on every item. The profile buttons carry no distinguishing class
 * of their own, so those are matched on their href instead.
 *
 * MAINTENANCE: as with §7, this rides on MemberPress's own class names. If a
 * ReadyLaunch update renames them the two tabs will quietly reappear.
 * ========================================================================== */

body.mepr-pro-template {
	#mepr-account-nav :is(.mepr-payments, .mepr-subscriptions) {
		display: none;
	}

	/* Two rules for one job. The :has() one removes the whole <li> so the flex
	   row closes up; the second is the fallback for anything predating :has()
	   (Chrome 105 / Safari 15.4 / Firefox 121 — the same baseline §4c relies
	   on), where the link goes but an empty <li> may leave a gap. */
	.mepr-profile-wrapper__footer li:has(
		> a[href*="action=payments"],
		> a[href*="action=subscriptions"]
	) {
		display: none;
	}

	.mepr-profile-wrapper__footer :is(
		a[href*="action=payments"],
		a[href*="action=subscriptions"]
	) {
		display: none;
	}
}

/* =============================================================================
 * §8  COOKIE BAR
 *
 * Injected at runtime by `dist/legacyUiScripts.js`, so the markup is fixed:
 *   .cookie-consent > .container > p, button.dismiss, button.reject
 * Was teal Accept + orange Reject. Now a violet pill and a ghost pill.
 * ========================================================================== */

.cookie-consent {
	background-color: var(--contrast);
	color: var(--base);

	/* The layout is restated rather than inherited: on the ReadyLaunch pages
	   ReadyLaunch dequeues the theme CSS that centres this bar, so without it
	   the buttons stack against the left edge. */
	.container {
		display: flex;
		align-items: center;
		justify-content: center;
		flex-wrap: wrap;
		gap: 0.5rem 1rem;
		max-width: var(--content);
		margin-inline: auto;
		padding: 1rem var(--gutter);
	}

	p {
		margin: 0;
	}

	a {
		color: var(--brand-3);
	}

	button {
		border: 1px solid transparent;
		border-radius: 999px;
		padding: 0.5em 1.25em;

		&.dismiss {
			background-color: var(--brand-1);
			color: var(--base);

			&:hover {
				background-color: var(--brand-1);
				color: var(--base);
			}
		}

		&.reject {
			border-color: var(--rule-on-dark);
			background-color: transparent;
			color: var(--base);

			&:hover {
				border-color: var(--base);
				background-color: transparent;
				color: var(--base);
			}
		}
	}
}

/* =============================================================================
 * §9  PALETTE UTILITIES
 *
 * The theme exposes its palette as composable utility classes — `.background-
 * color.dark-blue`, `.text-color.light-blue`, `.angle-section.dark-blue.after`,
 * `.angle-sliver.dark-blue` and so on. Any template can use them, and the
 * careers page does: it painted a #28343D band directly beneath the new
 * #2A2723 header, which read as a mistake rather than a design.
 *
 * This is a mechanical substitution of the two structural legacy hues and the
 * greys onto the new tokens:
 *
 *     dark-blue   #28343D  →  contrast          #2A2723
 *     blue        #006579  →  brand-1           #503AF5
 *     light-blue  #00AECB  →  brand-1           #503AF5
 *     light-grey  #C1C0BE  →  monotone-warm     #BBC1B2
 *     tint        #E3E8ED  →  brand-1-tint-20   #DCD8FD
 *     light-tint  #F3F5F7  →  brand-1-tint-10   #EEEBFE
 *
 * The decorative secondaries — pink, purple, green, orange, yellow — are
 * deliberately left alone: they have no counterpart in the new system, and on
 * the live pages they appear only on the careers CTA banner. Recolouring them
 * would be an invention, not a translation.
 * ========================================================================== */

.background-color {
	&.dark-blue { background-color: var(--contrast) }
	&.dark-blue-transparent { background-color: rgb(42 39 35 / 80%) }
	&.dark-blue-more-transparent { background-color: rgb(42 39 35 / 60%) }
	&:is(.blue, .light-blue) { background: var(--brand-1) }
	&.light-blue-transparent { background: rgb(80 58 245 / 80%) }
	&.light-grey { background: var(--monotone-warm) }
	&.tint { background-color: var(--brand-1-tint-20) }
	&.light-tint { background-color: var(--brand-1-tint-10) }

	&.light-blue a {
		color: var(--base);

		&:hover { color: var(--base) }
	}
}

.text-color {
	&.dark-blue { color: var(--contrast) }
	&:is(.blue, .light-blue) { color: var(--brand-1) }
}

/* Angled section dividers are CSS triangles, so the colour is a border. */
.angle-section {
	&.dark-blue.before { border-color: transparent transparent var(--contrast) transparent }
	&.dark-blue.after { border-color: var(--contrast) transparent transparent transparent }
	&:is(.blue, .light-blue).before { border-color: transparent transparent var(--brand-1) transparent }
	&:is(.blue, .light-blue).after { border-color: var(--brand-1) transparent transparent transparent }
	&.dark-blue-transparent.before { border-color: transparent transparent rgb(42 39 35 / 80%) transparent }
	&.dark-blue-transparent.after { border-color: rgb(42 39 35 / 80%) transparent transparent transparent }
	&.dark-blue-more-transparent.before { border-color: transparent transparent rgb(42 39 35 / 60%) transparent }
	&.dark-blue-more-transparent.after { border-color: rgb(42 39 35 / 60%) transparent transparent transparent }
	&.light-grey.before { border-color: transparent transparent var(--monotone-warm) transparent }
	&.light-grey.after { border-color: var(--monotone-warm) transparent transparent transparent }
	&.tint.before { border-color: transparent transparent var(--brand-1-tint-20) transparent }
	&.tint.after { border-color: var(--brand-1-tint-20) transparent transparent transparent }
	&.light-tint.before { border-color: transparent transparent var(--brand-1-tint-10) transparent }
	&.light-tint.after { border-color: var(--brand-1-tint-10) transparent transparent transparent }
}

.angle-sliver {
	&.dark-blue { background-color: var(--contrast) }
	&.dark-blue-transparent { background-color: rgb(42 39 35 / 80%) }
	&.dark-blue-more-transparent { background-color: rgb(42 39 35 / 60%) }
	&.light-blue { background-color: var(--brand-1) }
	&.tint { background-color: var(--brand-1-tint-20) }
}

/* Components that name the legacy navy directly rather than going through the
   utility classes above. All four are on the careers template — the one live
   page that isn't part of the survey journey — and they sat beside converted
   surfaces, so they are included for consistency rather than left half-done. */
.box-item .content,
.careers-reasons .content {
	background-color: var(--contrast);
}

/* This one paints the border navy as well as the background. */
.careers-people .content {
	border-color: var(--contrast);
	background-color: var(--contrast);
}

.team-list-content h5 {
	color: var(--contrast);
}

.careers-cta-banner {
	border-top-color: var(--contrast);

	.angle-btn:nth-child(even) .angle-btn-bg {
		background-color: var(--contrast);
	}
}
