/*
 * Auth screen styling (`add-marketing-site` §6).
 *
 * Fourth pass (2026-07-30, client-directed): rebuilt on an explicit token scale rather than
 * ad-hoc per-rule values. The previous pass had the right *layout* — full-viewport split,
 * inset fields — but every dimension in it was a one-off literal (12px here, 14px there,
 * 28px somewhere else), which is what made the result read as assembled rather than
 * designed. The tokens below are the whole design system for both this file and
 * `dashboard.css`, which loads after it and inherits them:
 *
 *   - A 4px spacing scale (`--wcai-space-*`). Every margin/padding/gap in both files
 *     resolves to one of these, so vertical rhythm is consistent by construction instead of
 *     by eye.
 *   - A neutral ramp (`--wcai-ink-*`, `--wcai-line-*`, `--wcai-surface-*`) with a slight
 *     blue cast (hue 222) so greys sit in the same family as the brand rather than looking
 *     muddy beside it.
 *   - A brand ramp derived from the site's existing `#1b1aff` anchor (client's call: keep
 *     the brand, rebuild the ramp around it) — 50/100/500/600/700 steps, so tints and hover
 *     states are related values, not separately-guessed hex codes.
 *   - Layered shadows (`--wcai-shadow-*`): two stacked shadows each (a tight contact shadow
 *     plus a wide ambient one) instead of the single wide blur the previous pass used, which
 *     is the difference between an element that looks attached to the page and one that
 *     looks pasted onto it.
 *   - A type ramp (`--wcai-text-*`) with paired line-heights and one tracking value for
 *     display sizes, since tight tracking on large text is what stops big headings looking
 *     loose.
 *
 * Tokens are declared on `:root` so `dashboard.css` (enqueued with `wcai-auth` as a
 * dependency — see `Assets.php`) resolves them without redeclaring a parallel palette.
 */

:root {
	/* -- Brand ramp, anchored on the site's existing #1b1aff ------------------------ */
	--wcai-brand-50: #eef0ff;
	--wcai-brand-100: #dfe2ff;
	--wcai-brand-200: #c3c7ff;
	--wcai-brand-500: #1b1aff;
	--wcai-brand-600: #1512d6;
	--wcai-brand-700: #110fa8;
	--wcai-primary: var(--wcai-brand-500);

	/* -- Neutrals. Hue 222, low saturation: greys that belong beside the brand blue. */
	--wcai-ink-900: #0d1220;
	--wcai-ink-800: #1a2036;
	--wcai-ink-700: #2f374f;
	--wcai-ink-500: #5b657f;
	/* 4.54:1 on white — the lightest this ramp step can be while still clearing WCAG AA's
	   4.5:1 for normal-size text. It was #7b849b (3.74:1), which failed: the token is used
	   only for secondary *text* (field labels, meta lines, empty-state copy, table headers),
	   all of it at 11-14px, so the large-text 3:1 exception never applies. Darkening the
	   token fixes all ~20 usages at once rather than patching each call site, and keeps the
	   visual hierarchy — it still reads clearly lighter than `ink-500`.
	   This also closes the §8.4 WCAG gap for these screens: that finding was about
	   `--wcai-body-text` (#7c878e, 3.68:1) on the old palette, which the fourth-pass ramp
	   replaced with `ink-500` at 5.81:1. */
	--wcai-ink-400: #6b7590;
	--wcai-line-200: #e4e8f2;
	--wcai-line-100: #eef1f8;
	--wcai-surface-0: #ffffff;
	--wcai-surface-50: #f7f9fd;
	--wcai-surface-100: #f1f4fb;

	/* Legacy aliases — kept so any selector still referencing the third-pass token names
	   resolves to the new ramp instead of breaking. */
	--wcai-body-text: var(--wcai-ink-500);
	--wcai-heading-text: var(--wcai-ink-900);
	--wcai-section-bg: var(--wcai-surface-50);

	/* -- Status ---------------------------------------------------------------------- */
	--wcai-error: #d92d20;
	--wcai-error-bg: #fef3f2;
	--wcai-error-line: #fecdc9;
	--wcai-success: #067647;
	--wcai-success-bg: #ecfdf3;
	--wcai-success-line: #abefc6;
	--wcai-warning: #b54708;
	--wcai-warning-bg: #fffaeb;
	--wcai-warning-line: #fedf89;

	/* -- 4px spacing scale ----------------------------------------------------------- */
	--wcai-space-1: 4px;
	--wcai-space-2: 8px;
	--wcai-space-3: 12px;
	--wcai-space-4: 16px;
	--wcai-space-5: 20px;
	--wcai-space-6: 24px;
	--wcai-space-8: 32px;
	--wcai-space-10: 40px;
	--wcai-space-12: 48px;
	--wcai-space-16: 64px;

	/* -- Type ramp ------------------------------------------------------------------- */
	--wcai-text-xs: 12px;
	--wcai-text-sm: 13px;
	--wcai-text-base: 14px;
	--wcai-text-md: 15px;
	--wcai-text-lg: 18px;
	--wcai-text-xl: 22px;
	--wcai-text-2xl: 28px;
	--wcai-text-3xl: 34px;
	--wcai-leading-tight: 1.25;
	--wcai-leading-normal: 1.5;
	--wcai-leading-relaxed: 1.65;
	/* Negative tracking on display sizes only — large type set at default tracking reads
	   loose, small type set tight reads cramped. */
	--wcai-tracking-display: -0.02em;

	/* -- Radii ----------------------------------------------------------------------- */
	--wcai-radius-sm: 8px;
	--wcai-radius-md: 10px;
	--wcai-radius-lg: 14px;
	--wcai-radius-xl: 20px;
	--wcai-radius-pill: 999px;
	--wcai-card-radius: var(--wcai-radius-lg);
	--wcai-button-radius: var(--wcai-radius-md);

	/* -- Layered shadows: contact + ambient, never a single wide blur ----------------- */
	--wcai-shadow-xs: 0 1px 2px rgba(13, 18, 32, 0.04);
	--wcai-shadow-sm: 0 1px 2px rgba(13, 18, 32, 0.05), 0 1px 3px rgba(13, 18, 32, 0.05);
	--wcai-shadow-md: 0 2px 4px rgba(13, 18, 32, 0.04), 0 6px 16px rgba(13, 18, 32, 0.07);
	--wcai-shadow-lg: 0 4px 8px rgba(13, 18, 32, 0.04), 0 16px 40px rgba(13, 18, 32, 0.09);
	--wcai-shadow-brand: 0 1px 2px rgba(17, 15, 168, 0.2), 0 8px 20px rgba(27, 26, 255, 0.24);

	--wcai-ring: 0 0 0 4px var(--wcai-brand-100);
	--wcai-ring-error: 0 0 0 4px var(--wcai-error-line);

	--wcai-font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	--wcai-font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

	--wcai-ease: cubic-bezier(0.4, 0, 0.2, 1);
}

/* The auth root — the whole page, not a block inside a themed one. `min-height` rather than
   `height` so a tall form (register with four fields plus stacked validation notices)
   scrolls instead of overflowing a clipped viewport. */
.wcai-auth {
	display: flex;
	box-sizing: border-box;
	min-height: 100vh;
	font-family: var(--wcai-font);
	color: var(--wcai-ink-500);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

/* Base card box — the `--split` modifier below layers geometry on top of this. */
.wcai-auth__card {
	width: 100%;
	background: var(--wcai-surface-0);
	padding: var(--wcai-space-10) var(--wcai-space-8);
}

/* Neutralizes the Sierra/Elementor theme's `.woocommerce-account form.login, form.register`
   rule (keydesign-woocommerce.css), which paints bare <form> elements with the theme's own
   light-blue card background, padding and max-width. Defensive: `.woocommerce-account` is
   not among the body classes on these routes, but this keeps the form's presentation
   independent of whatever classes WooCommerce adds on a future POST/redisplay. */
.wcai-page .wcai-auth__card form.login,
.wcai-page .wcai-auth__card form.register {
	background: transparent;
	border: none;
	padding: 0;
	margin: 0;
	max-width: none;
}

.wcai-auth__title {
	font-family: var(--wcai-font);
	font-weight: 700;
	font-size: var(--wcai-text-2xl);
	line-height: var(--wcai-leading-tight);
	letter-spacing: var(--wcai-tracking-display);
	color: var(--wcai-ink-900);
	margin: 0 0 var(--wcai-space-2);
}

.wcai-auth__subtitle {
	font-size: var(--wcai-text-md);
	line-height: var(--wcai-leading-relaxed);
	color: var(--wcai-ink-500);
	margin: 0 0 var(--wcai-space-8);
}

.wcai-auth__field {
	margin-bottom: var(--wcai-space-4);
}

.wcai-auth__label {
	display: block;
	font-weight: 500;
	font-size: var(--wcai-text-base);
	color: var(--wcai-ink-800);
	margin-bottom: var(--wcai-space-2);
}

.wcai-auth__input {
	width: 100%;
	box-sizing: border-box;
	/* The theme (`keydesign-framework.css`) pins every text input to
	   `height: var(--component-height, 50px)`, which silently overrides the padding below —
	   the field would render at the theme's height, not the one this padding describes.
	   Reset to `auto` so padding is what actually sizes the control. */
	height: auto;
	padding: var(--wcai-space-3) var(--wcai-space-4);
	font-size: var(--wcai-text-md);
	font-family: var(--wcai-font);
	color: var(--wcai-ink-900);
	background: var(--wcai-surface-0);
	border: 1px solid var(--wcai-line-200);
	border-radius: var(--wcai-radius-md);
	transition: border-color 0.15s var(--wcai-ease), box-shadow 0.15s var(--wcai-ease);
}

.wcai-auth__input::placeholder {
	color: var(--wcai-ink-400);
}

.wcai-auth__input:focus {
	outline: none;
	border-color: var(--wcai-brand-500);
	box-shadow: var(--wcai-ring);
}

/* WooCommerce injects its own paragraphs into these forms through
   `woocommerce_register_form` (the privacy-policy notice on /register) and
   `woocommerce_login_form` — they arrive with the theme's own default margins, which on
   /register collapsed to nothing above the submit button and left the privacy text touching
   it. Given a consistent gap here rather than per-hook, since any future hook output lands
   in the same place. */
.wcai-auth__card form > p:not([class]),
.wcai-auth__card .woocommerce-privacy-policy-text {
	margin: 0 0 var(--wcai-space-6);
}

.wcai-auth__card form > p:not([class]),
.wcai-auth__card .woocommerce-privacy-policy-text p {
	font-size: var(--wcai-text-sm);
	line-height: var(--wcai-leading-relaxed);
	color: var(--wcai-ink-400);
	/* The inner <p> carries the theme's own bottom margin; the wrapper above supplies the
	   single gap, so this one is zeroed. */
	margin: 0;
}

.wcai-auth__card .woocommerce-privacy-policy-text a {
	color: var(--wcai-ink-500);
	text-decoration: underline;
	text-underline-offset: 2px;
}

.wcai-auth__button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	box-sizing: border-box;
	min-height: 48px;
	padding: var(--wcai-space-3) var(--wcai-space-6);
	font-family: var(--wcai-font);
	font-weight: 600;
	font-size: var(--wcai-text-md);
	letter-spacing: 0;
	text-align: center;
	color: #ffffff;
	background: var(--wcai-brand-500);
	border: none;
	border-radius: var(--wcai-button-radius);
	box-shadow: var(--wcai-shadow-brand);
	cursor: pointer;
	/* `opacity` on hover (the previous pass's approach) fades the button against the page
	   and reads as "disabled" rather than "interactive" — a darker brand step plus a small
	   lift is the standard affordance and keeps contrast. */
	transition: background 0.15s var(--wcai-ease), box-shadow 0.15s var(--wcai-ease), transform 0.15s var(--wcai-ease);
}

.wcai-auth__button:hover {
	background: var(--wcai-brand-600);
	transform: translateY(-1px);
	box-shadow: 0 1px 2px rgba(17, 15, 168, 0.2), 0 12px 24px rgba(27, 26, 255, 0.28);
}

.wcai-auth__button:active {
	background: var(--wcai-brand-700);
	transform: translateY(0);
	box-shadow: var(--wcai-shadow-xs);
}

.wcai-auth__button:focus-visible {
	outline: none;
	box-shadow: var(--wcai-ring), var(--wcai-shadow-brand);
}

.wcai-auth__footer {
	margin-top: var(--wcai-space-6);
	font-size: var(--wcai-text-base);
	text-align: center;
	color: var(--wcai-ink-500);
}

.wcai-auth__footer a,
.wcai-auth__link {
	color: var(--wcai-brand-500);
	font-weight: 600;
	text-decoration: none;
	border-radius: var(--wcai-radius-sm);
}

.wcai-auth__footer a:hover,
.wcai-auth__link:hover {
	color: var(--wcai-brand-600);
	text-decoration: underline;
	text-underline-offset: 2px;
}

.wcai-auth__footer a:focus-visible,
.wcai-auth__link:focus-visible {
	outline: 2px solid var(--wcai-brand-500);
	outline-offset: 2px;
}

/* -- Notices --------------------------------------------------------------------------- */

/* NOT `display: flex`. WooCommerce's own notice strings contain inline markup — the
   wrong-password error is "The password you entered for the username <strong>x</strong> is
   incorrect. <a>Lost your password?</a>" — and a flex container makes every one of those
   inline elements a separate flex *item*, so the sentence rendered as three narrow stacked
   columns instead of a paragraph. Block layout with a floated marker keeps the text as
   normal inline flow, which is what a sentence containing arbitrary markup needs. */
.wcai-auth__notice {
	display: block;
	padding: var(--wcai-space-3) var(--wcai-space-4);
	padding-left: var(--wcai-space-8);
	position: relative;
	border-radius: var(--wcai-radius-md);
	font-size: var(--wcai-text-base);
	line-height: var(--wcai-leading-normal);
	margin-bottom: var(--wcai-space-5);
}

/* Leading dot as a status marker rather than an icon font or an SVG per notice: it carries
   the status colour at a glance without adding an asset dependency. Absolutely positioned
   so it sits in the gutter the `padding-left` above reserves, and takes no part in the
   text's own layout. The notice's `role="alert"`/`role="status"` (set in
   `templates/partials/notices.php`) is what conveys status non-visually. */
.wcai-auth__notice::before {
	content: "";
	position: absolute;
	left: var(--wcai-space-4);
	top: 15px;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: currentColor;
}

/* WooCommerce notice strings arrive as a bare text node plus inline elements, with no
   wrapping <p>; when a theme's global <p> margins do apply to injected markup, this keeps
   the notice from growing an extra blank line. */
.wcai-auth__notice p {
	margin: 0;
	color: inherit;
}

.wcai-auth__notice--error {
	background: var(--wcai-error-bg);
	color: var(--wcai-error);
	border: 1px solid var(--wcai-error-line);
}

.wcai-auth__notice--success {
	background: var(--wcai-success-bg);
	color: var(--wcai-success);
	border: 1px solid var(--wcai-success-line);
}

/* WooCommerce notices arrive as markup with their own link colours; keep them legible
   against the tinted notice background rather than inheriting the brand blue. */
.wcai-auth__notice a {
	color: inherit;
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 2px;
}

.wcai-auth__field-error {
	display: block;
	margin-top: var(--wcai-space-2);
	font-size: var(--wcai-text-sm);
	color: var(--wcai-error);
}

.wcai-auth__input--invalid {
	border-color: var(--wcai-error);
}

.wcai-auth__input--invalid:focus {
	border-color: var(--wcai-error);
	box-shadow: var(--wcai-ring-error);
}

/* -- Two-panel auth layout ------------------------------------------------------------
   Full-viewport split: the visual panel spans edge to edge and fills the viewport height,
   with no surrounding canvas, no card corners and no drop shadow (there is nothing left for
   a card to float above). Applies to every auth screen so the whole flow reads as one
   product. The shell markup lives in `templates/partials/auth-split-open.php` /
   `auth-split-close.php`. */

.wcai-auth--split {
	align-items: stretch;
	justify-content: stretch;
}

.wcai-auth__panel-wrap {
	display: flex;
	width: 100%;
	background: var(--wcai-surface-0);
	min-height: 100vh;
	/* Clips the visual panel's gradient and the decorative shapes inside it to the panel
	   box. */
	overflow: hidden;
	align-items: stretch;
}

/* -- Left visual panel ---------------------------------------------------------------
   Fourth pass (client-directed): this was an empty gradient slab carrying a bracketed
   placeholder testimonial. It is now a product preview built entirely from CSS — a
   simplified rendering of the dashboard's own Overview screen (licence row, plan badge,
   usage bars) floating over the gradient, in the manner of the client's reference mockup.

   Built in CSS rather than as an exported image on purpose: there is no real screenshot
   asset to ship yet, a placeholder image would need swapping later (the exact maintenance
   burden the previous placeholder created), and this version stays sharp at any DPI and
   picks up brand-token changes automatically. It is decorative, so the whole panel carries
   `aria-hidden="true"` in the markup — nothing in it is content a screen-reader user would
   miss. */
.wcai-auth__visual {
	flex: 0 0 44%;
	position: relative;
	isolation: isolate;
	background:
		radial-gradient(120% 100% at 85% 0%, rgba(99, 97, 255, 0.55) 0%, rgba(99, 97, 255, 0) 55%),
		linear-gradient(158deg, var(--wcai-brand-700) 0%, var(--wcai-brand-500) 52%, #3a38ff 100%);
	display: flex;
	flex-direction: column;
	/* Brand mark pinned top, copy pinned bottom, and the preview centred in whatever space
	   is left (it carries `margin: auto 0` via `.wcai-auth__preview`'s own rule below).
	   `space-between` alone left the preview hugging the brand mark with a large void
	   beneath it on a tall viewport. */
	justify-content: space-between;
	padding: var(--wcai-space-10);
	box-sizing: border-box;
	overflow: hidden;
}

/* Two soft light blooms, offset from the gradient's own highlight, so the panel has depth
   instead of reading as one flat wash of blue. Pure decoration, no markup cost. */
.wcai-auth__visual::before,
.wcai-auth__visual::after {
	content: "";
	position: absolute;
	border-radius: 50%;
	z-index: -1;
	pointer-events: none;
}

.wcai-auth__visual::before {
	width: 520px;
	height: 520px;
	top: -180px;
	right: -200px;
	background: radial-gradient(circle, rgba(255, 255, 255, 0.16) 0%, rgba(255, 255, 255, 0) 68%);
}

.wcai-auth__visual::after {
	width: 420px;
	height: 420px;
	bottom: -160px;
	left: -140px;
	background: radial-gradient(circle, rgba(0, 0, 0, 0.22) 0%, rgba(0, 0, 0, 0) 70%);
}

.wcai-auth__visual-brand {
	display: flex;
	align-items: center;
	gap: var(--wcai-space-3);
	font-family: var(--wcai-font);
	font-weight: 600;
	font-size: var(--wcai-text-md);
	letter-spacing: -0.01em;
	color: #ffffff;
}

/* The brand mark: a rounded tile with the site's initial, so the panel has an anchor in the
   top-left the way the reference mockups do, without needing a logo asset. */
.wcai-auth__visual-mark {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	width: 34px;
	height: 34px;
	border-radius: var(--wcai-radius-md);
	background: rgba(255, 255, 255, 0.16);
	border: 1px solid rgba(255, 255, 255, 0.22);
	backdrop-filter: blur(6px);
	font-weight: 700;
	font-size: var(--wcai-text-lg);
	line-height: 1;
	color: #ffffff;
}

/* -- The CSS product preview ---------------------------------------------------------- */

/* Width-capped and centred rather than stretching to the panel: at 44% of a wide viewport
   the card would otherwise grow past the point where its 11px monospace licence row and
   metric labels look like real UI. The right margin reserves the track the overlapping stat
   tile occupies, so the tile can hang off the card's corner without covering the metric
   values underneath it (the first attempt let it sit over the "Memory items" row and clip
   its number). */
.wcai-auth__preview {
	position: relative;
	width: 100%;
	max-width: 330px;
	/* `auto` top/bottom margins centre it in the flex free space between the brand mark and
	   the copy block; `0` on the right keeps it left-aligned with them. */
	margin: auto 0;
	/* Slight perspective tilt so it reads as a product shot rather than a flat inline
	   panel — the same treatment the client's reference mockup uses. */
	transform: perspective(1400px) rotateY(-9deg) rotateX(3deg);
	transform-style: preserve-3d;
}

.wcai-auth__preview-card {
	background: rgba(255, 255, 255, 0.97);
	border-radius: var(--wcai-radius-lg);
	padding: var(--wcai-space-5);
	box-shadow: 0 2px 6px rgba(8, 6, 60, 0.18), 0 24px 48px rgba(8, 6, 60, 0.28);
}

.wcai-auth__preview-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: var(--wcai-space-4);
}

.wcai-auth__preview-title {
	font-size: var(--wcai-text-sm);
	font-weight: 600;
	color: var(--wcai-ink-900);
}

.wcai-auth__preview-badge {
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--wcai-brand-600);
	background: var(--wcai-brand-50);
	border-radius: var(--wcai-radius-pill);
	padding: 3px 9px;
}

.wcai-auth__preview-key {
	display: flex;
	align-items: center;
	gap: var(--wcai-space-2);
	background: var(--wcai-surface-100);
	border-radius: var(--wcai-radius-sm);
	padding: 9px var(--wcai-space-3);
	font-family: var(--wcai-font-mono);
	font-size: 11px;
	color: var(--wcai-ink-700);
	margin-bottom: var(--wcai-space-4);
	overflow: hidden;
	white-space: nowrap;
}

.wcai-auth__preview-key span {
	flex: 1 1 auto;
	overflow: hidden;
	text-overflow: ellipsis;
}

.wcai-auth__preview-key i {
	flex: 0 0 auto;
	font-style: normal;
	font-family: var(--wcai-font);
	font-size: 10px;
	font-weight: 700;
	color: #ffffff;
	background: var(--wcai-brand-500);
	border-radius: var(--wcai-radius-pill);
	padding: 3px 9px;
}

.wcai-auth__preview-metric + .wcai-auth__preview-metric {
	margin-top: var(--wcai-space-3);
}

.wcai-auth__preview-metric-label {
	display: flex;
	justify-content: space-between;
	font-size: 11px;
	font-weight: 500;
	color: var(--wcai-ink-500);
	margin-bottom: 5px;
}

.wcai-auth__preview-metric-label b {
	color: var(--wcai-ink-900);
	font-weight: 600;
}

.wcai-auth__preview-bar {
	height: 6px;
	border-radius: var(--wcai-radius-pill);
	background: var(--wcai-surface-100);
	overflow: hidden;
}

.wcai-auth__preview-bar span {
	display: block;
	height: 100%;
	border-radius: var(--wcai-radius-pill);
	background: linear-gradient(90deg, var(--wcai-brand-500), #6361ff);
}

/* The small stat tile that overlaps the main card's lower-right corner — the depth cue that
   makes the preview read as layered UI rather than a single flat rectangle (the reference
   mockup's "Net Savings" tile plays the same role). */
/* Anchored by its LEFT edge to ~78% across the card, so the tile hangs off the card's
   right side and only its narrow leading edge overlaps the card's corner. Offsetting the
   right edge instead (the first two attempts) is what let a ~130px-wide tile reach back
   across the metric rows and cover the "Memory items" bar — with `right` set, the tile's
   width grows leftward, into the content. */
.wcai-auth__preview-tile {
	position: absolute;
	left: 78%;
	bottom: calc(var(--wcai-space-10) * -1);
	white-space: nowrap;
	background: var(--wcai-surface-0);
	border-radius: var(--wcai-radius-md);
	padding: var(--wcai-space-3) var(--wcai-space-4);
	box-shadow: 0 2px 6px rgba(8, 6, 60, 0.16), 0 18px 36px rgba(8, 6, 60, 0.24);
	transform: translateZ(40px);
}

.wcai-auth__preview-tile-label {
	font-size: 10px;
	font-weight: 500;
	color: var(--wcai-ink-400);
	margin-bottom: 2px;
}

.wcai-auth__preview-tile-value {
	font-size: var(--wcai-text-lg);
	font-weight: 700;
	letter-spacing: var(--wcai-tracking-display);
	color: var(--wcai-ink-900);
}

.wcai-auth__preview-tile-delta {
	font-size: 10px;
	font-weight: 600;
	color: var(--wcai-success);
}

/* -- Panel copy ------------------------------------------------------------------------ */

.wcai-auth__visual-copy {
	color: #ffffff;
}

.wcai-auth__visual-headline {
	font-size: var(--wcai-text-xl);
	font-weight: 700;
	line-height: var(--wcai-leading-tight);
	letter-spacing: var(--wcai-tracking-display);
	color: #ffffff;
	margin: 0 0 var(--wcai-space-3);
}

/* `color` set explicitly rather than inherited: the theme's global paragraph colour (a
   grey) otherwise wins over the white set on the container, leaving this text
   low-contrast grey-on-blue. */
.wcai-auth__visual-text {
	font-size: var(--wcai-text-base);
	line-height: var(--wcai-leading-relaxed);
	color: rgba(255, 255, 255, 0.82);
	margin: 0;
	max-width: 42ch;
}

.wcai-auth__visual-points {
	list-style: none;
	margin: var(--wcai-space-5) 0 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: var(--wcai-space-3);
}

.wcai-auth__visual-points li {
	display: flex;
	align-items: center;
	gap: var(--wcai-space-3);
	font-size: var(--wcai-text-base);
	color: rgba(255, 255, 255, 0.92);
}

/* Checkmark as an inline-SVG data URI rather than two crossed linear-gradients (the first
   attempt): stacked gradients cannot produce the two *different-length* strokes meeting at
   a right angle that read as a tick — they rendered as a small smudge. An SVG path draws
   the real shape, still needs no icon font or external asset, and stays crisp at any DPI.
   `background-color` supplies the disc behind it. */
.wcai-auth__visual-points li::before {
	content: "";
	flex: 0 0 auto;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background-color: rgba(255, 255, 255, 0.18);
	border: 1px solid rgba(255, 255, 255, 0.3);
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
	background-size: 12px 12px;
	background-position: center;
	background-repeat: no-repeat;
}

/* -- Right form panel ------------------------------------------------------------------ */

.wcai-auth__card--split {
	flex: 1 1 56%;
	box-shadow: none;
	border-radius: 0;
	max-width: none;
	width: auto;
	padding: var(--wcai-space-12);
	/* Centers the form block in the tall panel instead of top-aligning it and leaving a
	   large empty gap under the button. */
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
}

/* The readable form column inside the wider right panel — a fixed column rather than
   fields stretched to 700px+ on a wide monitor. Direct children rather than a wrapper
   element so no markup change was needed. */
.wcai-auth__card--split > * {
	width: 100%;
	max-width: 400px;
}

/* The <form> needs its own rule at matching specificity rather than relying on the `> *`
   above: the defensive theme-reset near the top of this file
   (`.wcai-page .wcai-auth__card form.login`, specificity 0,3,1) sets `max-width: none` to
   undo the theme's own form width, and that beats `> *`'s (0,2,0) — so without this the
   form alone stretches to the full panel width while every sibling correctly holds 400px.
   Same specificity shape as the reset it has to outrank, no `!important` needed. */
.wcai-page .wcai-auth__card--split form.login,
.wcai-page .wcai-auth__card--split form.register {
	width: 100%;
	max-width: 400px;
}

/* Vertical rhythm for the two *form-less* split states — /lost-password's
   `?reset-link-sent=true` confirmation and /reset-password's invalid-key message. Both are
   heading + subtitle + a single link; the subtitle's bottom margin was sized to bracket a
   form, and with no form between them it stacks into a void that reads as a rendering
   fault. `:has()` keys off the actual absence of a form instead of adding a state-specific
   class, so there is no chance of the class and the branch drifting apart. */
.wcai-auth__card--split:not(:has(form)) .wcai-auth__subtitle {
	margin-bottom: 0;
}

/* Conversely, /reset-password's new-password form state has a heading and no subtitle, so
   the title's small bottom margin (sized as a heading-to-subtitle gap) leaves the first
   field almost touching the <h1>. Keyed on the *card* having no subtitle rather than on the
   title's adjacent sibling: a notice sits between the two on some states, which would make
   an adjacent-sibling test flip this rule on and off depending on whether a validation
   error happens to be showing. */
.wcai-auth__card--split:not(:has(.wcai-auth__subtitle)) .wcai-auth__title {
	margin-bottom: var(--wcai-space-8);
}

/* -- Inset fields ---------------------------------------------------------------------
   The label sits inside the field's border above the input, rather than above the box.
   Implemented by moving the border onto `.wcai-auth__field` itself and stripping it from
   the input, so it works with the markup already in place (label + input as siblings) — no
   JS and no placeholder-shown trickery, which means the label is always readable and never
   collides with a browser-autofilled value.

   Still a `--inset` modifier rather than folded into `.wcai-auth__field`, because the
   Account Settings screen (`templates/pages/dashboard-account.php`) reuses
   `.wcai-auth__field`/`__input`/`__label` inside the dashboard layout and deliberately keeps
   the plain stacked-label treatment there — it is a settings form in an app shell, not an
   auth screen. */
.wcai-auth__field--inset {
	position: relative;
	border: 1px solid var(--wcai-line-200);
	border-radius: var(--wcai-radius-md);
	background: var(--wcai-surface-0);
	padding: 7px var(--wcai-space-4) 8px;
	transition: border-color 0.15s var(--wcai-ease), box-shadow 0.15s var(--wcai-ease);
}

.wcai-auth__field--inset:focus-within {
	border-color: var(--wcai-brand-500);
	box-shadow: var(--wcai-ring);
}

/* `--wcai-ink-500`, not `--wcai-ink-400`. At 12px these labels are normal-size text for
   WCAG purposes, so they need 4.5:1; `ink-400` (#7b849b) measures 3.74:1 on white and
   fails, while `ink-500` (#5b657f) measures 5.81:1 and passes. Measured with a real
   contrast calculation against the computed colours, not estimated by eye. */
.wcai-auth__field--inset .wcai-auth__label {
	margin-bottom: 0;
	font-size: var(--wcai-text-xs);
	font-weight: 500;
	color: var(--wcai-ink-500);
	letter-spacing: 0.01em;
}

/* `height: auto` is the load-bearing declaration here. The theme's
   `keydesign-framework.css` sets `height: var(--component-height, 50px)` on every text
   input via a long type-selector list — so zeroing this input's padding alone would leave
   it 50px tall, and stacked on the wrapper's padding plus the label the "compact" inset
   field would measure ~81px instead of the intended ~56px. */
.wcai-auth__field--inset .wcai-auth__input {
	height: auto;
	padding: 0;
	border: none;
	border-radius: 0;
	background: transparent;
	font-size: var(--wcai-text-md);
	line-height: 24px;
	color: var(--wcai-ink-900);
}

.wcai-auth__field--inset .wcai-auth__input:focus {
	border: none;
	box-shadow: none;
}

/* Chrome's autofill repaints the input's own background a pale yellow, which inside an
   inset field shows as a coloured block that stops short of the wrapper's rounded border.
   A long inset shadow is the only reliable way to override it (the background property
   itself is locked by the UA); the text colour needs its own property for the same
   reason. */
.wcai-auth__field--inset .wcai-auth__input:-webkit-autofill,
.wcai-auth__field--inset .wcai-auth__input:-webkit-autofill:hover,
.wcai-auth__field--inset .wcai-auth__input:-webkit-autofill:focus {
	-webkit-box-shadow: 0 0 0 100px var(--wcai-surface-0) inset;
	-webkit-text-fill-color: var(--wcai-ink-900);
	caret-color: var(--wcai-ink-900);
}

/* The invalid state moves to the wrapper too — the input no longer draws a border for
   `.wcai-auth__input--invalid` to recolor. */
.wcai-auth__field--inset:has(.wcai-auth__input--invalid) {
	border-color: var(--wcai-error);
}

/* "Forgot password?" sits inline with the Password label inside the same inset box,
   right-aligned on the label's row. Padded left so a long label never runs underneath it. */
.wcai-auth__field--inset .wcai-auth__forgot-link {
	position: absolute;
	top: 6px;
	right: var(--wcai-space-4);
	margin-top: 0;
	font-size: var(--wcai-text-xs);
	font-weight: 600;
	background: var(--wcai-surface-0);
	padding-left: var(--wcai-space-2);
}

.wcai-auth__forgot-link {
	display: block;
	margin-top: var(--wcai-space-2);
	font-size: var(--wcai-text-sm);
	color: var(--wcai-brand-500);
	text-decoration: none;
	text-align: right;
}

.wcai-auth__forgot-link:hover {
	color: var(--wcai-brand-600);
	text-decoration: underline;
	text-underline-offset: 2px;
}

/* -- Password visibility toggle --------------------------------------------------------
   The eye control in the client's reference mockup. The button is real (not decorative):
   `auth.js` swaps the input's `type` between `password` and `text` and keeps
   `aria-pressed`/`aria-label` in sync. Rendered only when JS is available — see
   `auth.js` — so it can never sit inert on the page, which is this codebase's established
   rule about non-functional controls. */
.wcai-auth__field--inset:has(.wcai-auth__reveal) .wcai-auth__input {
	/* Reserves the track the button occupies so a long value never runs under it. */
	padding-right: var(--wcai-space-8);
}

.wcai-auth__reveal {
	position: absolute;
	right: 10px;
	bottom: 6px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	padding: 0;
	border: none;
	border-radius: var(--wcai-radius-sm);
	background: transparent;
	color: var(--wcai-ink-400);
	cursor: pointer;
	transition: color 0.15s var(--wcai-ease), background 0.15s var(--wcai-ease);
}

.wcai-auth__reveal:hover {
	color: var(--wcai-ink-700);
	background: var(--wcai-surface-100);
}

.wcai-auth__reveal:focus-visible {
	outline: 2px solid var(--wcai-brand-500);
	outline-offset: 1px;
	color: var(--wcai-ink-700);
}

.wcai-auth__reveal svg {
	width: 18px;
	height: 18px;
	display: block;
	pointer-events: none;
}

/* Only one of the two icons shows at a time, driven off the button's own pressed state, so
   the swap needs no JS beyond flipping the attribute. */
.wcai-auth__reveal .wcai-auth__reveal-off {
	display: none;
}

.wcai-auth__reveal[aria-pressed="true"] .wcai-auth__reveal-on {
	display: none;
}

.wcai-auth__reveal[aria-pressed="true"] .wcai-auth__reveal-off {
	display: block;
}

/* -- Password strength + match hints ---------------------------------------------------
   Both are progressive enhancement written by `auth.js`; the elements are empty and
   `hidden` in the markup until it populates them, so a JS-less visitor sees a clean form
   and the server-side confirm-password check (`RegistrationFields`) still enforces the
   real rule. */
.wcai-auth__hint {
	display: flex;
	align-items: center;
	gap: var(--wcai-space-2);
	margin: calc(var(--wcai-space-2) * -1) 0 var(--wcai-space-4);
	font-size: var(--wcai-text-xs);
	font-weight: 500;
	color: var(--wcai-ink-400);
	min-height: 16px;
}

.wcai-auth__hint[hidden] {
	display: none;
}

.wcai-auth__hint--ok {
	color: var(--wcai-success);
}

.wcai-auth__hint--bad {
	color: var(--wcai-error);
}

.wcai-auth__strength {
	display: flex;
	gap: 4px;
	flex: 0 0 auto;
	width: 76px;
}

.wcai-auth__strength i {
	flex: 1 1 0;
	height: 4px;
	border-radius: var(--wcai-radius-pill);
	background: var(--wcai-line-200);
	transition: background 0.2s var(--wcai-ease);
}

.wcai-auth__strength[data-score="1"] i:nth-child(-n + 1),
.wcai-auth__strength[data-score="2"] i:nth-child(-n + 2),
.wcai-auth__strength[data-score="3"] i:nth-child(-n + 3),
.wcai-auth__strength[data-score="4"] i:nth-child(-n + 4) {
	background: currentColor;
}

/* -- Remember-me toggle ----------------------------------------------------------------
   The real `<input type="checkbox">` stays in the DOM and is only visually hidden (not
   `display: none`), so it remains keyboard-focusable and still submits `rememberme=forever`
   to `WC_Form_Handler::process_login()` unchanged; the track/knob is drawn from the sibling
   span and driven off `:checked`. */
.wcai-auth__field--toggle {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--wcai-space-4);
	margin-bottom: var(--wcai-space-6);
}

.wcai-auth__toggle {
	display: flex;
	align-items: center;
	gap: var(--wcai-space-3);
	font-size: var(--wcai-text-base);
	color: var(--wcai-ink-700);
	cursor: pointer;
	user-select: none;
}

/* Standard visually-hidden recipe, plus `pointer-events: none`: without it the input's 1x1
   absolutely-positioned box still sits under `.wcai-auth__toggle-track`, and a click aimed
   at the input lands on the track span instead. Clicks are meant to reach the input through
   its wrapping <label>, not by hitting the hidden box, so taking the box out of hit-testing
   removes the ambiguity without changing any real interaction — label association and
   keyboard focus both still work. */
.wcai-auth__toggle input {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: 0;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
	pointer-events: none;
}

.wcai-auth__toggle-track {
	flex: 0 0 auto;
	position: relative;
	display: inline-block;
	width: 38px;
	height: 22px;
	background: var(--wcai-line-200);
	border-radius: var(--wcai-radius-pill);
	transition: background 0.18s var(--wcai-ease);
}

.wcai-auth__toggle-track::after {
	content: "";
	position: absolute;
	top: 3px;
	left: 3px;
	width: 16px;
	height: 16px;
	background: #ffffff;
	border-radius: 50%;
	box-shadow: var(--wcai-shadow-sm);
	transition: transform 0.18s var(--wcai-ease);
}

.wcai-auth__toggle input:checked + .wcai-auth__toggle-track {
	background: var(--wcai-brand-500);
}

.wcai-auth__toggle input:checked + .wcai-auth__toggle-track::after {
	transform: translateX(16px);
}

/* Focus ring lives on the track, since the input it belongs to is visually hidden —
   without this the toggle would be reachable by keyboard but give no focus feedback. */
.wcai-auth__toggle input:focus-visible + .wcai-auth__toggle-track {
	outline: 2px solid var(--wcai-brand-500);
	outline-offset: 2px;
}

/* -- Responsive ------------------------------------------------------------------------ */

@media (max-width: 1100px) {
	.wcai-auth__card--split {
		padding: var(--wcai-space-10);
	}

	.wcai-auth__visual {
		padding: var(--wcai-space-8);
	}
}

@media (max-width: 900px) {
	.wcai-auth__panel-wrap {
		flex-direction: column;
	}

	/* The product preview is the panel's whole point on desktop, but stacked above a form
	   on a tablet/phone it pushes the actual fields off-screen. The panel shrinks to a
	   brand banner instead of disappearing, so the flow keeps its identity.
	   `flex-basis: auto` plus an explicit height beats the desktop `flex: 0 0 44%`, which in
	   a column flex container would otherwise mean 44% of the *height*. */
	.wcai-auth__visual {
		flex: 0 0 auto;
		min-height: 0;
		padding: var(--wcai-space-6) var(--wcai-space-6) var(--wcai-space-8);
	}

	.wcai-auth__preview,
	.wcai-auth__visual-points {
		display: none;
	}

	.wcai-auth__visual-copy {
		margin-top: var(--wcai-space-6);
	}

	.wcai-auth__visual-headline {
		font-size: var(--wcai-text-lg);
	}

	.wcai-auth__card--split {
		padding: var(--wcai-space-10) var(--wcai-space-6);
		/* Releases the desktop `flex: 1 1 56%` basis, which stacked would fight the banner
		   above for vertical space. */
		flex: 1 1 auto;
	}
}

@media (max-width: 480px) {
	.wcai-auth__card--split {
		padding: var(--wcai-space-8) var(--wcai-space-5);
	}

	.wcai-auth__visual {
		padding: var(--wcai-space-5);
	}

	.wcai-auth__title {
		font-size: var(--wcai-text-xl);
	}
}

/* Honors a system-level reduced-motion preference: the transforms above are decorative
   affordances, not information. */
@media (prefers-reduced-motion: reduce) {
	.wcai-auth *,
	.wcai-auth *::before,
	.wcai-auth *::after {
		transition-duration: 0.01ms !important;
		animation-duration: 0.01ms !important;
	}

	.wcai-auth__button:hover {
		transform: none;
	}

	.wcai-auth__preview {
		transform: none;
	}
}
