/**
 * cmz-account — My Account login restyle (ui-dev, M4). Enqueued ONLY for logged-out visitors
 * in the My Account context (includes/frontend.php), media=screen — nothing here can leak to
 * any other page. Loads regardless of the Google toggle (the restyle stands on its own).
 *
 * Spec (plan.md + competitor survey): a single centered card, Google button ABOVE the
 * password fields with an "or" divider, ONE form at a time via login.js's presentation-only
 * toggle. HARD RULES honoured throughout:
 *  - Both WC forms stay in the DOM unchanged; nothing is hidden by CSS ALONE — the
 *    html.cmz-account-jsok class gates every display:none, so with JS off both forms render
 *    stacked and fully usable (the account-first checkout resume depends on these exact
 *    forms). That class is set by an inline <head> script (includes/frontend.php), NOT by
 *    login.js: a deferred script cannot land before the first paint, which is why both cards
 *    used to flash in (founder, Chrome, 2026-08-16).
 *  - CSS + WC hooks only: no Extra theme edits, no template copies.
 *  - Live markup verified 2026-08-10 (curl of /my-account/): #customer_login > .u-column1
 *    (login form) + .u-column2 (register form, email-only — "link to set a new password"),
 *    WC's own woocommerce.css / -layout / -smallscreen all still enqueued, so the col2-set
 *    float layout is overridden defensively below.
 *
 * Dark mode = :root[data-theme="dark"] attribute (absent in light); --cmz-* tokens with
 * literal fallbacks everywhere (dark-mode.css may not load). Colours/weights answer
 * !important per the site policy — Extra's customizer chains (1,3,0) and dark-mode's link
 * catch-all both reach into page content.
 */

/* ===========================================================================
 * 1. Tokens — one set on the WC wrapper, swapped wholesale in dark.
 * ======================================================================== */

.woocommerce {
	--cmz-lg-surface: #fff;
	--cmz-lg-text: #14171a;
	--cmz-lg-muted: #5c6570;
	--cmz-lg-heading: #14171a;
	--cmz-lg-border: rgba( 0, 0, 0, 0.12 );
	--cmz-lg-input-bg: #fff;
	--cmz-lg-input-border: rgba( 0, 0, 0, 0.18 );
	/* Button fill: the ratified accent pair (mini-cart, 5.05:1 white-on-#1e7d60). */
	--cmz-lg-accent: #1e7d60;
	--cmz-lg-accent-hover: #1a6d54;
	--cmz-lg-accent-ink: #fff;
	/* Text links on the card surface. */
	--cmz-lg-link: #1e7d60;
	--cmz-lg-focus-ring: rgba( 35, 147, 113, 0.22 );
	--cmz-lg-shadow: 0 10px 30px rgba( 0, 0, 0, 0.07 );
	--cmz-lg-error: #b3261e;
	--cmz-lg-error-bg: #fdecea;
	--cmz-lg-error-border: rgba( 179, 38, 30, 0.3 );
	--cmz-lg-ok: #1e7d60;
	--cmz-lg-ok-bg: #e9f6f1;
	--cmz-lg-ok-border: rgba( 30, 125, 96, 0.3 );
	/* Password-strength "weak" band — deliberately NOT the error red: WC labels strength 1 and
	   strength 2 with the SAME "bad" class, and only strength 1 is refused (minimum is 2 —
	   includes/passwords.php). Amber says "weak" without claiming the form is broken.
	   #8a5a00 on white measures ~5.9:1. */
	--cmz-lg-warn: #8a5a00;
	--cmz-lg-warn-bg: #fdf4e3;
	--cmz-lg-warn-border: rgba( 138, 90, 0, 0.3 );
}
:root[data-theme="dark"] .woocommerce {
	--cmz-lg-surface: var( --cmz-surface, #1f1f22 );
	--cmz-lg-text: var( --cmz-text, #c9c6c1 );
	--cmz-lg-muted: var( --cmz-muted, #96938e );
	--cmz-lg-heading: var( --cmz-heading, #e4e0da );
	--cmz-lg-border: rgba( 255, 255, 255, 0.13 );
	--cmz-lg-input-bg: var( --cmz-inset, #111113 );
	--cmz-lg-input-border: rgba( 255, 255, 255, 0.2 );
	--cmz-lg-accent: var( --cmz-accent-fill, #1d7c60 );
	--cmz-lg-accent-hover: var( --cmz-accent-fill-hover, #26956f );
	--cmz-lg-accent-ink: #fff;
	--cmz-lg-link: var( --cmz-link, #5dc49e );
	--cmz-lg-focus-ring: rgba( 93, 196, 158, 0.25 );
	--cmz-lg-shadow: 0 10px 30px rgba( 0, 0, 0, 0.45 );
	--cmz-lg-error: #ff7a6b; /* light's #b3261e measures ~3:1 on the dark surface */
	--cmz-lg-error-bg: rgba( 255, 122, 107, 0.12 );
	--cmz-lg-error-border: rgba( 255, 122, 107, 0.35 );
	--cmz-lg-ok: var( --cmz-link, #5dc49e );
	--cmz-lg-ok-bg: rgba( 93, 196, 158, 0.12 );
	--cmz-lg-ok-border: rgba( 93, 196, 158, 0.35 );
	--cmz-lg-warn: #f0b95e; /* light's #8a5a00 is unreadable on the dark surface */
	--cmz-lg-warn-bg: rgba( 240, 185, 94, 0.12 );
	--cmz-lg-warn-border: rgba( 240, 185, 94, 0.35 );
}

/* ===========================================================================
 * 2. Page frame. This page's Extra layout carries an EMPTY sidebar column (verified on the
 *    live markup) that would center the card on the main column, not the page — reclaim the
 *    width. body.woocommerce-account scopes it to WC account pages, and this stylesheet only
 *    loads on the logged-out ones.
 * ======================================================================== */

body.woocommerce-account .et_pb_extra_column_main {
	width: 100% !important;
}
body.woocommerce-account .et_pb_extra_column_sidebar {
	display: none;
}

/*
 * THE SLAB BEHIND THE CARD (founder, 2026-08-17: "make this grayish background black").
 * Extra wraps page content in <article class="… hentry"> and paints it as a content sheet
 * — style.css `.page article { background:#fff; border-radius:3px; … }`. On a normal page
 * that sheet IS the content surface; on this page the card is the content, so the sheet is
 * a second, lighter slab between the card and the page ground. Measured on staging, 1440,
 * logged out, pixel-sampled beside the card vs. outside the wrapper:
 *
 *   dark  — slab rgb(31,31,34) (dark-mode.css repaints the article --cmz-surface) against a
 *           rgb(22,22,24) (--cmz-bg) ground: the visibly lighter grey block he screenshotted.
 *   light — slab #fff against a #fff #page-container ground: already invisible (body is
 *           #ecf0f5, but page-container covers it full-bleed), so light is a no-op here and
 *           was re-measured after the change to confirm it stayed one flat #fff.
 *
 * Dropping the sheet in BOTH themes lets the ground show through — one backdrop colour,
 * whatever the theme's ground token is. `transparent` rather than a restated colour is the
 * whole point: no hex to drift out of sync with --cmz-bg, and no dark-scoped twin of this
 * rule to keep in step.
 *
 * The box-shadow line is ARMOUR, not a fix, and is redundant TODAY: Extra's Customizer
 * inline CSS already sets `box-shadow:none` on `.page article` site-wide, so the computed
 * shadow is none in both themes before and after this change (verified — the first draft of
 * this comment claimed a stray shadow and was wrong). It stays only so that a transparent
 * sheet can never regain an outline around nothing if that Customizer value is ever changed.
 *
 * NOTHING MOVES: the article's own padding is 0 (measured) — the page's inset comes from
 * .post-wrap's `padding: 40px 60px` INSIDE it, which is untouched here — so the card keeps
 * its exact position. Only the article's paint is removed.
 *
 * SPECIFICITY IS LOAD-BEARING, and the playbook's exact trap. dark-mode.css's
 * `:root[data-theme="dark"] .page article` is (0,3,1) !important — `:root` counts as a
 * pseudo-class and `[data-theme]` as an attribute, so a plain
 * `body.woocommerce-account article.hentry` (0,2,2) LOSES to it even with !important. The
 * #main-content id takes this to (1,2,2) and settles it in both themes at once.
 *
 * SCOPE: body.woocommerce-account (WC account pages only) AND this stylesheet is enqueued
 * only for logged-OUT visitors in the account context (includes/frontend.php,
 * cmz_account_is_login_context) — so it cannot reach the signed-in account pages, courses,
 * lessons or the blog, which keep Extra's sheet exactly as it is. Belt and braces: the
 * selector names no post id, so it survives staging↔prod page-id differences.
 */
body.woocommerce-account #main-content article.hentry {
	background: transparent !important;
	box-shadow: none !important;
}

/* ===========================================================================
 * 3. The card(s). Each WC column is styled as the SAME centered card; login.js shows one at
 *    a time. JS off: both render, stacked — two cards, everything usable.
 * ======================================================================== */

.woocommerce #customer_login {
	display: block;
	float: none;
	width: 100%;
	max-width: 440px;
	margin: 24px auto 48px;
}
/* WC's own layout CSS floats the two columns side by side at ≥768px — retired here. */
.woocommerce #customer_login .u-column1,
.woocommerce #customer_login .u-column2 {
	float: none !important;
	width: 100% !important;
	max-width: none !important;
	margin: 0 !important;
	box-sizing: border-box;
	padding: 28px 26px !important;
	border: 1px solid var( --cmz-lg-border );
	border-radius: 14px;
	background: var( --cmz-lg-surface ) !important;
	box-shadow: var( --cmz-lg-shadow );
}
/* Breathing room between the two stacked cards in the no-JS state… */
.woocommerce #customer_login .u-column2 {
	margin-top: 24px !important;
}
/* …removed whenever the toggle owns visibility (only one card renders at a time). Keyed on the
   head-script class, not on login.js's, so a register-first card never starts 24px low. */
html.cmz-account-jsok .woocommerce #customer_login .u-column2 {
	margin-top: 0 !important;
}

/* ---------------------------------------------------------------------------
 * THE TOGGLE — presentation only, gated on a JS-ONLY signal so JS-off keeps both forms.
 *
 * THE GATE IS html.cmz-account-jsok, SET IN <head> — not by login.js. Founder defect
 * 2026-08-16 (Chrome): login.js is deferred, so until it ran nothing matched and BOTH cards
 * rendered stacked — a flash on every slow load. A class added by an inline head script lands
 * before the first paint; a deferred one cannot (includes/frontend.php,
 * cmz_account_login_head_boot). Do not move this gate back onto a class login.js adds.
 *
 * Three states, in cascade order:
 *   1. JS on, nothing decided yet → login card only. The default for everyone.
 *   2. JS on + buy-intent cookie  → register card, from the head script's hint on <html>,
 *                                   still before the first paint.
 *   3. login.js has decided       → its data-cmz-show on #customer_login wins outright (it also
 *                                   knows about failed-registration re-renders, which no cookie
 *                                   can tell you).
 *   JS off → the class never lands, none of this matches, both cards render and both work.
 * ------------------------------------------------------------------------ */

/* 1. Default under JS: the login card. */
html.cmz-account-jsok .woocommerce #customer_login .u-column2 {
	display: none;
}

/*
 * 2. The head script's buy-intent hint, honoured only until login.js writes its own attribute.
 *    :has( .u-column2 ) is a GUARD, not decoration: if registration is ever switched off WC
 *    renders no second column, and hiding the first one unguarded would leave the page with no
 *    form at all. A browser without :has() drops these two blocks and falls back to state 1 —
 *    the login card, which is the safe answer. Hence separate blocks: an unsupported selector
 *    must not take any other rule down with it.
 */
html.cmz-account-jsok[data-cmz-show="register"] .woocommerce #customer_login:not( [data-cmz-show] ):has( .u-column2 ) .u-column1 {
	display: none;
}
html.cmz-account-jsok[data-cmz-show="register"] .woocommerce #customer_login:not( [data-cmz-show] ):has( .u-column2 ) .u-column2 {
	display: block;
}

/* 3. login.js's decision. Both cases spelled out — these have to UNDO the rules above, so
      "display: block" is written, never merely left unset. */
html.cmz-account-jsok .woocommerce #customer_login[data-cmz-show="login"] .u-column1 {
	display: block;
}
html.cmz-account-jsok .woocommerce #customer_login[data-cmz-show="login"] .u-column2 {
	display: none;
}
html.cmz-account-jsok .woocommerce #customer_login[data-cmz-show="register"] .u-column1 {
	display: none;
}
html.cmz-account-jsok .woocommerce #customer_login[data-cmz-show="register"] .u-column2 {
	display: block;
}

/*
 * THE FORM ITSELF IS NOT A BOX (M7 founder round — "strange looking on the dark theme").
 * MEASURED on staging: form.woocommerce-form computes
 *     border: 1px solid rgb(207, 200, 216);  padding: 20px
 * from the theme's global form styling. On the white card that hairline is nearly invisible;
 * on the dark card rgb(207,200,216) is a near-WHITE frame drawn around the whole form —
 * which, because the Google mount renders at woocommerce_login_form_start (inside the form),
 * reads as a white box around the Google button. It is not the GIS button at all.
 * The same rule also stole 42px of usable width at every breakpoint (2px border + 40px
 * padding): inputs measured 344 inside a 440 card. The card owns the padding and the border;
 * the form is a transparent wrapper.
 * Scoped to #customer_login on purpose — form.lost_reset_password IS its own card on the
 * lost/reset pages and declares its own border/padding in section 5.
 */
.woocommerce #customer_login form {
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	background: none !important;
	box-shadow: none !important;
}

/*
 * Card titles. WC's own column h2s ("Login" / "Register") are HIDDEN, not removed — the
 * plugin renders warmer headings inside each form (frontend.php, founder wording: "Welcome
 * back to Code Maze" / "Getting Started") and this keeps the mechanism untouched. The
 * :not() keeps our own .cmz-account-card-title (also an h2 inside #customer_login) alive.
 */
.woocommerce #customer_login h2:not( .cmz-account-card-title ) {
	display: none !important;
}
.woocommerce #customer_login h2.cmz-account-card-title {
	margin: 0 0 18px !important;
	padding: 0 !important;
	text-align: center;
	font-size: 22px !important;
	line-height: 1.25;
	font-weight: 700 !important;
	color: var( --cmz-lg-heading ) !important;
	text-transform: none !important;
	letter-spacing: normal !important;
}

/*
 * The theme's page header above the card ("My account" + its rule) says nothing a visitor
 * at the login card needs — founder: "My account text shouldn't be there". This stylesheet
 * loads ONLY logged-out in the account context, so the logged-in account pages keep their
 * title untouched.
 */
.woocommerce-account .entry-title {
	display: none !important;
}

/* ===========================================================================
 * 4. "Continue with Google" mount + the "or" divider (markup from includes/frontend.php,
 *    rendered inside BOTH forms; absent entirely when the kill switch is off).
 * ======================================================================== */

/*
 * SHOWN ONLY WHERE SCRIPTING IS ON — and from the FIRST PAINT, on the same head-script class as
 * the card toggle above (it used to wait for a class login.js added, which is one more thing
 * that popped in late). The button navigates from a click handler, so with JS off the whole
 * mount — button, terms notice, "or" divider — stays out of the layout and the password form is
 * the page's whole story.
 *
 * Accepted edge: if scripting is on but login.js itself never arrives (network error), the
 * button paints and does nothing. That is a strictly smaller failure than the flash: the same
 * broken load also leaves both cards stacked, and the password form beside it is untouched.
 * The click is not duplicated into the head script to cover it — one owner for that logic.
 */
.woocommerce .cmz-account-google {
	display: none;
}
html.cmz-account-jsok .woocommerce .cmz-account-google {
	display: block;
	margin: 0 0 18px;
}
/* login.js still hides the mount outright if the markup ever arrives without its URL. */
.woocommerce .cmz-account-google[hidden] {
	display: none !important;
}
/*
 * THE BUTTON IS OURS, AND IT IS A REAL BUTTON (2026-08-16).
 *
 * It used to be a wrapper around Google's own button — a cross-origin iframe, scaled to
 * opacity 0 over our painted "face", serving as the hit target. In Firefox that click did
 * nothing at all: tracking protection partitions the accounts.google.com frame's storage and
 * hit-tests transparent cross-origin frames differently. There is no iframe here any more, so
 * every rule below is about a <button> the browser owns: no z-index stack, no overflow clip,
 * no pointer-events games.
 *
 * The armour (appearance/font/letter-spacing/text-transform/box-shadow resets) answers the
 * theme's global button styling — Extra reaches into content buttons the same way it reaches
 * into content links. Height, border and radius still pair it with the submit button below.
 */
.woocommerce .cmz-account-google-btn {
	-webkit-appearance: none;
	appearance: none;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	width: 100%;
	box-sizing: border-box;
	height: 44px; /* matches the submit button below, so the two primary actions pair up */
	margin: 0 !important;
	padding: 0 14px !important;
	border: 1px solid var( --cmz-lg-input-border ) !important;
	border-radius: 8px !important;
	background: var( --cmz-lg-input-bg ) !important;
	color: var( --cmz-lg-text ) !important;
	font-family: inherit;
	box-shadow: none !important;
	text-transform: none !important;
	letter-spacing: normal !important;
	cursor: pointer;
	transition: border-color 0.15s ease, background-color 0.15s ease;
}
.woocommerce .cmz-account-google-btn:hover {
	border-color: var( --cmz-lg-accent ) !important;
	background: var( --cmz-lg-input-bg ) !important;
}
/* A real focus ring on a real button — :focus-visible, so a mouse click doesn't paint one
   (the old :focus-within existed only to mirror focus out of Google's iframe). */
.woocommerce .cmz-account-google-btn:focus-visible {
	outline: 2px solid var( --cmz-lg-accent );
	outline-offset: 2px;
	border-color: var( --cmz-lg-accent ) !important;
	box-shadow: 0 0 0 3px var( --cmz-lg-focus-ring ) !important;
}
.woocommerce .cmz-account-google-btn:active {
	border-color: var( --cmz-lg-accent ) !important;
}
/* Set the moment the click starts the navigation to Google — the page is on its way out. */
.woocommerce .cmz-account-google-btn[disabled] {
	opacity: 0.6;
	cursor: default;
}
.woocommerce .cmz-account-google-g {
	flex: none;
	display: block;
}
.woocommerce .cmz-account-google-label {
	font-size: 15px;
	font-weight: 600;
	line-height: 1;
	color: var( --cmz-lg-text ) !important;
	text-transform: none !important;
	letter-spacing: normal !important;
}
.woocommerce .cmz-account-google-status {
	margin-top: 10px;
	font-size: 13px;
	line-height: 1.45;
	text-align: center;
	color: var( --cmz-lg-muted ) !important;
}
.woocommerce .cmz-account-google-status[hidden] {
	display: none !important;
}
.woocommerce .cmz-account-google-status.cmz-account-google-status-error {
	color: var( --cmz-lg-error ) !important;
}
.woocommerce .cmz-account-or {
	display: flex;
	align-items: center;
	gap: 12px;
	margin: 18px 0 0;
	font-size: 12px;
	color: var( --cmz-lg-muted ) !important;
}
.woocommerce .cmz-account-or::before,
.woocommerce .cmz-account-or::after {
	content: "";
	flex: 1 1 auto;
	height: 1px;
	background: var( --cmz-lg-border );
}

/* Acceptance-by-notice under the Google button (the Google path can create an account and
   cannot host a checkbox mid-popup). */
.woocommerce .cmz-account-google-terms {
	margin: 10px 0 0 !important;
	font-size: 12px;
	line-height: 1.5;
	text-align: center;
	color: var( --cmz-lg-muted ) !important;
}
.woocommerce .cmz-account-google-terms a,
.woocommerce .cmz-account-terms-label a {
	color: var( --cmz-lg-link ) !important;
	text-decoration: underline;
	text-underline-offset: 2px;
}

/* Required ToS/Privacy checkbox on the register card (frontend.php renders it in WC's own
   woocommerce_register_form slot; the server rejects the post without it).
   SPECIFICITY IS LOAD-BEARING (M7 round 4 D2): section 5's shared field-label rule is
   `:is( .woocommerce #customer_login form, … ) label { font-weight: 600 !important }` at
   (1,1,1). A bare `.woocommerce .cmz-account-terms-label` (0,2,0) loses to it even with
   !important, so the row read as a bold field label. Spelled out to (1,2,2)+ so it reads
   as body copy. */
.woocommerce #customer_login .cmz-account-terms-row {
	margin: 4px 0 16px !important;
	padding: 0 !important;
}
/* Exactly TWO flex children — the checkbox and one text span (frontend.php wraps the
   sentence). Bare text nodes + inline anchors as direct flex items were the columns bug. */
.woocommerce #customer_login form label.cmz-account-terms-label {
	display: flex !important;
	align-items: flex-start;
	gap: 10px;
	margin: 0 !important;
	font-size: 14px !important;
	font-weight: 400 !important;
	line-height: 1.5;
	color: var( --cmz-lg-text ) !important;
	text-transform: none !important;
	cursor: pointer;
}
.woocommerce #customer_login form label.cmz-account-terms-label input[type="checkbox"] {
	flex: none;
	width: 18px;
	height: 18px;
	margin: 2px 0 0 !important;
	accent-color: var( --cmz-lg-accent );
	cursor: pointer;
}
/* The sentence: one inline-flowing block that wraps naturally, links inline. */
.woocommerce #customer_login form label.cmz-account-terms-label .cmz-account-terms-text {
	display: inline;
	flex: 1 1 auto;
	min-width: 0;
	font-weight: 400 !important;
}
.woocommerce #customer_login form label.cmz-account-terms-label a {
	display: inline;
	font-weight: 500 !important;
}

/* ===========================================================================
 * 5. Form internals. Field NAMES/IDS/mechanism untouched — presentation only.
 *
 * The :is() lists below carry the lost-password AND reset-password forms too (both render
 * as form.lost_reset_password, one click from this card — leaving them theme-styled was a
 * style cliff). WC floats their .form-row-first/-last at ~47% width; the shared .form-row
 * rule retires that with the rest of the float layout. :is() takes its most specific
 * argument, so every rule lands at the same strength in both contexts and the two pages
 * can never drift (notifications-CSS precedent).
 * ======================================================================== */

/* The lost/reset form IS the card on its page — same box as the login/register columns. */
.woocommerce form.lost_reset_password {
	display: block;
	float: none;
	width: 100%;
	max-width: 440px;
	box-sizing: border-box;
	margin: 24px auto 48px;
	padding: 28px 26px;
	border: 1px solid var( --cmz-lg-border );
	border-radius: 14px;
	background: var( --cmz-lg-surface ) !important;
	box-shadow: var( --cmz-lg-shadow );
}

:is( .woocommerce #customer_login form, .woocommerce form.lost_reset_password ) .form-row {
	float: none !important;
	width: 100% !important;
	margin: 0 0 14px !important;
	padding: 0 !important;
}
:is( .woocommerce #customer_login form, .woocommerce form.lost_reset_password ) label {
	display: block;
	margin: 0 0 6px;
	font-size: 13px;
	font-weight: 600 !important;
	color: var( --cmz-lg-text ) !important;
}
:is( .woocommerce #customer_login form, .woocommerce form.lost_reset_password ) .required {
	color: var( --cmz-lg-error ) !important;
	text-decoration: none !important;
}
:is( .woocommerce #customer_login form, .woocommerce form.lost_reset_password ) .input-text {
	display: block;
	width: 100% !important;
	box-sizing: border-box;
	margin: 0;
	padding: 11px 12px !important;
	border: 1px solid var( --cmz-lg-input-border ) !important;
	border-radius: 9px !important;
	background: var( --cmz-lg-input-bg ) !important;
	color: var( --cmz-lg-text ) !important;
	font-size: 15px;
	line-height: 1.4;
	box-shadow: none;
	-webkit-appearance: none;
	appearance: none;
	transition: border-color 120ms ease, box-shadow 120ms ease;
}
:is( .woocommerce #customer_login form, .woocommerce form.lost_reset_password ) .input-text:focus {
	outline: none;
	border-color: var( --cmz-lg-accent ) !important;
	box-shadow: 0 0 0 3px var( --cmz-lg-focus-ring );
}

/* ---------------------------------------------------------------------------
 * BROWSER AUTOFILL (founder, 2026-08-18, Firefox + dark: "do something about that ugly yellow").
 *
 * The mustard is the BROWSER's, not ours, and the two engines produce it differently — which is
 * why the answer is not one declaration:
 *
 *   Firefox 86+  does not paint a yellow background any more; it applies a UA *filter* to the
 *                whole autofilled field — grayscale(21%) brightness(88%) contrast(161%)
 *                invert(10%) sepia(40%) saturate(206%). Over a white field that reads as the
 *                familiar pale yellow; over our dark field (--cmz-inset, #111113) the same
 *                filter comes out olive/mustard. A background declaration cannot answer it —
 *                the filter runs after painting and tints whatever we set. `filter: none` is
 *                the fix, and then the background/colour below are ours again.
 *   Chrome/WebKit paints a real background from an internal stylesheet that no author
 *                `background` can reach; the levers are a large INSET box-shadow (which paints
 *                over it) and -webkit-text-fill-color for the glyphs, because plain `color` is
 *                ignored on autofilled text there.
 *
 * TWO BLOCKS, DELIBERATELY. An unknown pseudo-class invalidates the entire selector list it
 * sits in, so :-webkit-autofill and :autofill must not share one list: an engine that knows
 * only one of them would drop both. MEASURED IN THE ENGINES (2026-08-18, real Gecko + headless
 * Chromium, CSS.supports('selector(…)') and a CSSOM dump):
 *   - Chromium keeps :-webkit-autofill and :autofill.
 *   - Firefox keeps BOTH TOO — and serialises :-webkit-autofill back out as :autofill.
 *   - Firefox rejects :-moz-autofill and :-moz-autofill-preview outright (supports() = false).
 *     A block on those is dead code in every current engine, so there isn't one here — the
 *     Firefox fix rides on the two selectors above, which Gecko does accept.
 * NO `transition: background-color 9999s` EITHER, though every recipe online carries it: with
 * the background repainted here it protects nothing, and in real Gecko it measurably HURT —
 * applying it in the same restyle that starts the autofill state froze background-color at the
 * transition's start value, which resolved to the UA default WHITE on a dark field (probed
 * 2026-08-18). A 9999s transition to the wrong colour is a worse bug than the mustard.
 *
 * TOKENS, NOT HEX, so one block is right in both themes: --cmz-lg-input-bg is #fff in light and
 * --cmz-inset in dark, --cmz-lg-text the matching ink. An autofilled field renders pixel-
 * identical to a typed one (verified by pixel-sampling both themes).
 *
 * SPECIFICITY: the same :is() prefix as the .input-text rules above, so these land one class
 * higher (1,3,1 vs 1,2,1) and answer their !important background/color.
 * ------------------------------------------------------------------------ */

:is( .woocommerce #customer_login form, .woocommerce form.lost_reset_password ) .input-text:-webkit-autofill,
:is( .woocommerce #customer_login form, .woocommerce form.lost_reset_password ) .input-text:-webkit-autofill:hover {
	filter: none !important;
	background-color: var( --cmz-lg-input-bg ) !important;
	color: var( --cmz-lg-text ) !important;
	-webkit-text-fill-color: var( --cmz-lg-text ) !important;
	caret-color: var( --cmz-lg-text ) !important;
	-webkit-box-shadow: 0 0 0 1000px var( --cmz-lg-input-bg ) inset !important;
	box-shadow: 0 0 0 1000px var( --cmz-lg-input-bg ) inset !important;
}

/* Focused + autofilled: the inset fill occupies box-shadow, so the focus ring has to be
   restated in the same value or focusing an autofilled field would lose its ring. */
:is( .woocommerce #customer_login form, .woocommerce form.lost_reset_password ) .input-text:-webkit-autofill:focus {
	-webkit-box-shadow: 0 0 0 3px var( --cmz-lg-focus-ring ), 0 0 0 1000px var( --cmz-lg-input-bg ) inset !important;
	box-shadow: 0 0 0 3px var( --cmz-lg-focus-ring ), 0 0 0 1000px var( --cmz-lg-input-bg ) inset !important;
}

/* The standard pseudo-class (Chrome 94+, Firefox 86+, Safari 15+), in its own list — see above. */
:is( .woocommerce #customer_login form, .woocommerce form.lost_reset_password ) .input-text:autofill,
:is( .woocommerce #customer_login form, .woocommerce form.lost_reset_password ) .input-text:autofill:hover {
	filter: none !important;
	background-color: var( --cmz-lg-input-bg ) !important;
	color: var( --cmz-lg-text ) !important;
	-webkit-text-fill-color: var( --cmz-lg-text ) !important;
	caret-color: var( --cmz-lg-text ) !important;
	box-shadow: 0 0 0 1000px var( --cmz-lg-input-bg ) inset !important;
}
:is( .woocommerce #customer_login form, .woocommerce form.lost_reset_password ) .input-text:autofill:focus {
	box-shadow: 0 0 0 3px var( --cmz-lg-focus-ring ), 0 0 0 1000px var( --cmz-lg-input-bg ) inset !important;
}

/* ---------------------------------------------------------------------------
 * First name / Last name row on the register card (includes/register-fields.php, founder
 * 2026-08-18). Side by side from 480px up, stacked below it.
 *
 * The two children are WooCommerce-shaped .form-row elements, so they arrive carrying the shared
 * rule above — `float: none !important; width: 100% !important` — which is exactly what makes this
 * safe: with `flex: 1 1 0` the used flex base size comes from flex-basis (0), not from `width`, so
 * the !important width cannot fight the split, and in the stacked state below 480px it is what
 * makes each row full width again. No !important is needed here at all.
 *
 * The wrapper's own margin replaces the rows' bottom margin so the row keeps the card's 14px
 * rhythm whether it is one column or two.
 * ------------------------------------------------------------------------ */

.woocommerce #customer_login form .cmz-account-name-row {
	margin: 0 0 14px;
}
.woocommerce #customer_login form .cmz-account-name-row .form-row.cmz-account-name-field {
	margin-bottom: 0 !important;
}

@media only screen and ( min-width: 480px ) {
	.woocommerce #customer_login form .cmz-account-name-row {
		display: flex;
		gap: 12px;
	}
	.woocommerce #customer_login form .cmz-account-name-row .form-row.cmz-account-name-field {
		flex: 1 1 0;
		min-width: 0; /* flex items default to min-width:auto — a long placeholder would overflow */
	}
}

/* Below 480px the rows stack in normal block flow; only the gap has to be re-created. */
@media only screen and ( max-width: 479px ) {
	.woocommerce #customer_login form .cmz-account-name-row .form-row.cmz-account-name-field + .form-row.cmz-account-name-field {
		margin-top: 14px !important;
	}
}

/* ---------------------------------------------------------------------------
 * Confirm password. The input itself needs no rule — it carries WC's .input-text class, so it is
 * the SAME field styling as #reg_password by construction (the same argument as the strength-meter
 * block below). Only the mismatch hint is ours.
 *
 * The hint is built by login.js and is advisory only: the server decides
 * (cmz_account_validate_registration), and with JS off nothing here exists.
 * ------------------------------------------------------------------------ */

.woocommerce #customer_login form .cmz-account-field-hint {
	display: block;
	margin: 6px 0 0;
	font-size: 12.5px;
	line-height: 1.4;
	font-weight: 500 !important;
	color: var( --cmz-lg-error ) !important;
}
.woocommerce #customer_login form .cmz-account-field-hint[hidden] {
	display: none;
}
/* Matches the strength meter's "input is wrong" language: border only, no layout shift. */
.woocommerce #customer_login form .input-text.cmz-account-field-invalid {
	border-color: var( --cmz-lg-error ) !important;
}

/* Remember me — one flex line, whole label clickable. */
.woocommerce #customer_login form .woocommerce-form-login__rememberme {
	display: flex !important;
	align-items: center;
	gap: 8px;
	margin: 0 0 14px;
	font-size: 13.5px;
	font-weight: 500 !important;
	color: var( --cmz-lg-text ) !important;
	cursor: pointer;
}
.woocommerce #customer_login form .woocommerce-form__input-checkbox {
	flex: 0 0 auto;
	width: 16px;
	height: 16px;
	margin: 0;
	accent-color: var( --cmz-lg-accent );
}

/* Submit buttons — full-width accent fill, all four forms (login/register/lost/reset). */
:is( .woocommerce #customer_login form, .woocommerce form.lost_reset_password ) button[type="submit"] {
	display: block;
	position: relative; /* containing block for the busy spinner below — do not inherit WC's */
	width: 100%;
	box-sizing: border-box;
	margin: 4px 0 0;
	padding: 12px 16px !important;
	border: 0 !important;
	border-radius: 9px !important;
	background: var( --cmz-lg-accent ) !important;
	color: var( --cmz-lg-accent-ink ) !important;
	font-size: 15px;
	line-height: 1.3;
	font-weight: 600 !important;
	letter-spacing: 0.01em !important;
	text-transform: none !important;
	cursor: pointer;
	transition: background-color 120ms ease;
}
:is( .woocommerce #customer_login form, .woocommerce form.lost_reset_password ) button[type="submit"]:hover,
:is( .woocommerce #customer_login form, .woocommerce form.lost_reset_password ) button[type="submit"]:focus-visible {
	background: var( --cmz-lg-accent-hover ) !important;
	color: var( --cmz-lg-accent-ink ) !important;
}
:is( .woocommerce #customer_login form, .woocommerce form.lost_reset_password ) button[type="submit"]:focus-visible {
	outline: 2px solid var( --cmz-lg-accent );
	outline-offset: 2px;
}
/* WC's password strength meter DISABLES the submit button while the password is too weak
   (assets/js/frontend/password-strength-meter.js — it sets both [disabled] and .disabled on
   button[type=submit] inside form.register / form.lost_reset_password). Without this the
   button stayed full accent green and simply ignored clicks, which reads as a broken form
   rather than "keep typing". Both selectors, because the JS uses both. */
:is( .woocommerce #customer_login form, .woocommerce form.lost_reset_password ) button[type="submit"]:disabled,
:is( .woocommerce #customer_login form, .woocommerce form.lost_reset_password ) button[type="submit"].disabled {
	background: var( --cmz-lg-accent ) !important;
	opacity: 0.45;
	cursor: not-allowed;
}
:is( .woocommerce #customer_login form, .woocommerce form.lost_reset_password ) button[type="submit"]:disabled:hover,
:is( .woocommerce #customer_login form, .woocommerce form.lost_reset_password ) button[type="submit"].disabled:hover {
	background: var( --cmz-lg-accent ) !important;
}

/* ---------------------------------------------------------------------------
 * THE STRAY SPINNER BESIDE "LOG IN" (founder, 2026-08-18: "spinner is outside the button for
 * some reason and rendered poorly").
 *
 * IT IS NOT OURS AND IT IS NOT WOOCOMMERCE'S. It is Simba TFA, bundled inside All In One WP
 * Security — wp-content/plugins/all-in-one-wp-security-and-firewall/includes/simba-tfa/includes/
 * tfa.js:83, which does literally this:
 *
 *     $submit_button.after('<img class="simbaotp_spinner" src="…/wp-admin/images/spinner-2x.gif"
 *                           style="float:right; margin:6px 12px; width:20px; height:20px;">');
 *
 * `.after()` — so it is a SIBLING of the button, not a child: "outside the button" is exact.
 * MEASURED on staging, 1440, light (Chromium; Firefox will not launch on this workstation, and
 * nothing here is engine-specific): button rect bottom 716.5, img rect top 722.5 — the wp-ADMIN
 * grey spinner GIF floated right, 6px BELOW the green button, overlapping the "Lost your
 * password?" line. WC's own `.button.loading::after` was ruled out: the class is never added
 * here and the computed ::after content stayed `none` through a full submit.
 *
 * IT FIRES TWICE, and both are covered by the same rule:
 *   - tfa.js:356 — on BLUR of the username field, to pre-check whether that account needs an OTP
 *     (admin-ajax `simbatfa-init-otp`, measured 388ms on staging). This is what the founder saw:
 *     tab from email to password and the blob appears.
 *   - tfa.js:322 — on SUBMIT, when the blur check has not already cached an answer. tfa.js:24
 *     deliberately does NOT remove it in that branch ("the form is being submitted"), so it
 *     stays on screen until the page navigates.
 * Only the LOGIN form: tfa.js's login_form_selectors is `… .woocommerce form.login …` (read off
 * the live page), which matches form.woocommerce-form-login and nothing else — the Register and
 * lost/reset buttons are untouched by it, verified by the same probe.
 *
 * WHAT WE DO: hide the GIF (its style attribute is inline, so !important is required to beat it)
 * and draw the busy state INSIDE the button, where it belongs, from the button's own ::after.
 * :has() reads the plugin's own element as the state flag — TFA inserts and removes it at exactly
 * the right moments, so no JS of ours has to track a lifecycle it does not own, and nothing about
 * the form mechanism is touched.
 *
 * NO :has() SUPPORT ⇒ this block is dropped and the GIF stays hidden: the button simply shows no
 * spinner, which is strictly better than what it does today. Separate rule for the same reason as
 * the card toggle above: an unsupported selector must not take the `display:none` down with it.
 * ------------------------------------------------------------------------ */

.woocommerce #customer_login img.simbaotp_spinner {
	display: none !important;
}

.woocommerce #customer_login form .form-row:has( > img.simbaotp_spinner ) button[type="submit"] {
	cursor: progress;
}
/*
 * The 250ms opacity gate is the point of the two-animation shorthand, not decoration: the BLUR
 * pre-check finishes in ~390ms and would otherwise flash a spinner into the button every time
 * someone tabs out of the email field. Held invisible for 250ms, a fast check paints nothing at
 * all and only a real submit (where TFA leaves the element in place until navigation) is ever
 * seen. top/margin-top centring rather than translate(-50%): `transform` belongs to the spin.
 */
@keyframes cmz-account-spin {
	to { transform: rotate( 360deg ); }
}
@keyframes cmz-account-spin-in {
	to { opacity: 1; }
}
.woocommerce #customer_login form .form-row:has( > img.simbaotp_spinner ) button[type="submit"]::after {
	content: "";
	position: absolute;
	top: 50%;
	right: 14px;
	width: 16px;
	height: 16px;
	margin-top: -8px;
	box-sizing: border-box;
	border: 2px solid rgba( 255, 255, 255, 0.35 );
	border-top-color: var( --cmz-lg-accent-ink, #fff );
	border-radius: 50%;
	opacity: 0;
	animation: cmz-account-spin 0.7s linear infinite, cmz-account-spin-in 1ms linear 250ms forwards;
}

/* ---------------------------------------------------------------------------
 * Password strength meter + hint. WC injects BOTH at runtime, inside the field's .form-row and
 * immediately after the input:
 *     <div class="woocommerce-password-strength short|bad|good|strong" aria-live="polite">
 *     <small class="woocommerce-password-hint">
 * (password-strength-meter.js, includeMeter/checkPasswordStrength). They exist on the register
 * card's #reg_password and on the reset form's #password_1 — the same :is() scope as everything
 * else here, so the two can't drift.
 *
 * The register password INPUT itself needs no rule of its own: WC gives it class .input-text,
 * exactly like the login card's #password, so it inherits the shared field styling above by
 * construction — that is the "same input rules" requirement, met without a second selector to
 * keep in step.
 *
 * WC's own woocommerce.css paints these with its purple/yellow/green palette and a hard-coded
 * light background; retired here in favour of the card tokens, and the whole strip is answered
 * in dark mode by the tokens rather than by a second rule set.
 * ------------------------------------------------------------------------ */

:is( .woocommerce #customer_login form, .woocommerce form.lost_reset_password ) .woocommerce-password-strength {
	display: block;
	margin: 8px 0 0;
	padding: 7px 10px !important;
	border: 1px solid var( --cmz-lg-border ) !important;
	border-radius: 8px !important;
	background: none !important;
	font-size: 12.5px;
	line-height: 1.35;
	font-weight: 600 !important;
	text-align: left;
	text-transform: none !important;
	letter-spacing: normal !important;
	color: var( --cmz-lg-muted ) !important;
}
/* WC's class mapping (password-strength-meter.js, checkPasswordStrength): 0 → short,
   1 AND 2 → bad, 3 → good, 4 → strong, 5 → short ("mismatch", reset form only). Because 1 and 2
   share a class and only 1 is refused under our minimum of 2, "bad" is AMBER, not red — the
   copy WC appends (" - Please enter a stronger password", printed only below the minimum) is
   what distinguishes them, and the disabled Register button is the real signal. */
:is( .woocommerce #customer_login form, .woocommerce form.lost_reset_password ) .woocommerce-password-strength.short,
:is( .woocommerce #customer_login form, .woocommerce form.lost_reset_password ) .woocommerce-password-strength.bad {
	border-color: var( --cmz-lg-warn-border ) !important;
	background: var( --cmz-lg-warn-bg ) !important;
	color: var( --cmz-lg-warn ) !important;
}
:is( .woocommerce #customer_login form, .woocommerce form.lost_reset_password ) .woocommerce-password-strength.good,
:is( .woocommerce #customer_login form, .woocommerce form.lost_reset_password ) .woocommerce-password-strength.strong {
	border-color: var( --cmz-lg-ok-border ) !important;
	background: var( --cmz-lg-ok-bg ) !important;
	color: var( --cmz-lg-ok ) !important;
}
:is( .woocommerce #customer_login form, .woocommerce form.lost_reset_password ) .woocommerce-password-hint {
	display: block;
	margin: 6px 0 0;
	font-size: 12px;
	line-height: 1.5;
	font-weight: 400 !important;
	color: var( --cmz-lg-muted ) !important;
}

/* Lost password. */
.woocommerce #customer_login .lost_password {
	margin: 14px 0 0 !important;
	text-align: center;
	font-size: 13px;
}
.woocommerce #customer_login .lost_password a {
	color: var( --cmz-lg-link ) !important;
	font-weight: 500 !important;
	text-decoration: none !important;
}
.woocommerce #customer_login .lost_password a:hover,
.woocommerce #customer_login .lost_password a:focus-visible {
	text-decoration: underline !important;
}

/* Form prose: the register "link will be sent" note, the lost-password explainer. */
:is( .woocommerce #customer_login form, .woocommerce form.lost_reset_password ) > p:not( [class] ) {
	margin: 0 0 14px;
	font-size: 13px;
	line-height: 1.5;
	color: var( --cmz-lg-muted ) !important;
}
.woocommerce #customer_login .woocommerce-privacy-policy-text p {
	margin: 0 0 14px;
	font-size: 12.5px;
	line-height: 1.5;
	color: var( --cmz-lg-muted ) !important;
}
.woocommerce #customer_login .woocommerce-privacy-policy-text a {
	color: var( --cmz-lg-link ) !important;
	text-decoration: underline !important;
}

/* ===========================================================================
 * 6. The login ↔ register switch row (login.js-built, so it simply doesn't exist without JS
 *    — which is exactly when both forms are visible and no switch is needed).
 * ======================================================================== */

.woocommerce #customer_login .cmz-account-switch {
	margin: 18px 0 0;
	padding: 14px 0 0;
	border-top: 1px solid var( --cmz-lg-border );
	text-align: center;
	font-size: 13.5px;
	color: var( --cmz-lg-muted ) !important;
}
.woocommerce #customer_login .cmz-account-switch-btn {
	-webkit-appearance: none;
	appearance: none;
	display: inline;
	margin: 0 0 0 4px;
	padding: 0;
	border: 0;
	background: none !important;
	color: var( --cmz-lg-link ) !important;
	font-family: inherit;
	font-size: inherit;
	line-height: inherit;
	font-weight: 600 !important;
	text-transform: none !important;
	letter-spacing: normal !important;
	cursor: pointer;
}
.woocommerce #customer_login .cmz-account-switch-btn:hover,
.woocommerce #customer_login .cmz-account-switch-btn:focus-visible {
	text-decoration: underline !important;
}
.woocommerce #customer_login .cmz-account-switch-btn:focus-visible {
	outline: 2px solid var( --cmz-lg-accent );
	outline-offset: 2px;
}

/* ===========================================================================
 * 7. WC notices (login errors, "password reset email sent", info) — same card language,
 *    centered on the same 440px column. WC paints its icon via an absolutely-positioned
 *    ::before and reserves padding for it; both retired.
 * ======================================================================== */

.woocommerce .woocommerce-error,
.woocommerce .woocommerce-message,
.woocommerce .woocommerce-info {
	list-style: none !important;
	width: auto;
	max-width: 440px;
	box-sizing: border-box;
	margin: 0 auto 18px !important;
	padding: 12px 14px !important;
	border: 1px solid var( --cmz-lg-border ) !important;
	border-top-width: 1px !important; /* WC ships a 3px accent border-top — flattened */
	border-radius: 10px !important;
	background: var( --cmz-lg-surface ) !important;
	color: var( --cmz-lg-text ) !important;
	font-size: 13.5px;
	line-height: 1.5;
}
.woocommerce .woocommerce-error::before,
.woocommerce .woocommerce-message::before,
.woocommerce .woocommerce-info::before {
	content: none !important;
	display: none !important;
}
.woocommerce .woocommerce-error li,
.woocommerce .woocommerce-message li,
.woocommerce .woocommerce-info li {
	list-style: none !important;
	margin: 0 !important;
	padding: 0 !important;
}
.woocommerce .woocommerce-error li + li,
.woocommerce .woocommerce-message li + li,
.woocommerce .woocommerce-info li + li {
	margin-top: 6px !important;
}
.woocommerce .woocommerce-error {
	border-color: var( --cmz-lg-error-border ) !important;
	background: var( --cmz-lg-error-bg ) !important;
}
.woocommerce .woocommerce-message {
	border-color: var( --cmz-lg-ok-border ) !important;
	background: var( --cmz-lg-ok-bg ) !important;
}
.woocommerce .woocommerce-error a,
.woocommerce .woocommerce-message a,
.woocommerce .woocommerce-info a {
	color: var( --cmz-lg-link ) !important;
	font-weight: 600 !important;
	text-decoration: underline !important;
}

/* ===========================================================================
 * 8. Small screens + reduced motion. The card is fluid (max-width) so 375/768/1024/1440 all
 *    fall out of the same rules; only the card's internal padding steps down.
 * ======================================================================== */

@media only screen and ( max-width: 480px ) {
	/*
	 * Extra pads .post-wrap by 40px a side, which at 375 leaves the card 257px of a 375px
	 * viewport (measured) — a 69%-width card with the content squeezed to 181px once the
	 * theme's form padding was still in play. The card is the page here, so the wrapper's
	 * inset steps down with it. Page-scoped twice over: body.woocommerce-account, and this
	 * stylesheet only ever loads on the logged-out My Account context.
	 */
	body.woocommerce-account .post-wrap {
		padding: 24px 12px !important;
	}
	.woocommerce #customer_login .u-column1,
	.woocommerce #customer_login .u-column2 {
		padding: 22px 16px !important;
	}
	.woocommerce form.lost_reset_password {
		padding: 22px 16px;
		margin: 16px auto 40px;
	}
	.woocommerce #customer_login {
		margin: 16px auto 40px;
	}
}

@media ( prefers-reduced-motion: reduce ) {
	.woocommerce #customer_login form .input-text,
	.woocommerce #customer_login form button[type="submit"],
	.woocommerce .cmz-account-google-btn {
		transition: none;
	}
	/*
	 * The busy ring stops turning but must still be VISIBLE — its 250ms fade-in is itself an
	 * animation, so `animation: none` alone would leave opacity at 0 and the button would show
	 * nothing at all during a submit. Both halves are replaced by hand.
	 */
	.woocommerce #customer_login form .form-row:has( > img.simbaotp_spinner ) button[type="submit"]::after {
		animation: none;
		opacity: 1;
	}
}
