/**
 * Ananyoo Accessible Login — WooCommerce styling bridge.
 *
 * Applies the plugin's accessible colours, focus states and target sizes to the
 * WooCommerce My Account login/registration forms. Scoped to WooCommerce's own
 * account markup; the custom properties are injected inline from settings.
 *
 * DESIGN PRINCIPLE (1.2.0): the bridge paints its own surface. The audited
 * colour pairs (text on form background, links on form background, field text
 * on field background, button text on button background) only hold when BOTH
 * halves of each pair come from the palette — so the form cards get the
 * palette's form background and text colour with !important, guaranteeing the
 * contrast whatever the active theme does. Themes that want different colours
 * override the CSS custom properties (at higher specificity), not the rules —
 * that way the accessible structure always wins and the values stay tunable.
 */

/* --- The surface: paint the form cards with the audited form background. --- */
.woocommerce-account .woocommerce form.login,
.woocommerce-account .woocommerce form.register,
.woocommerce-account .woocommerce form.woocommerce-form-login,
.woocommerce-account .woocommerce form.woocommerce-form-register,
.woocommerce-account .woocommerce .woocommerce-ResetPassword,
.woocommerce-account .woocommerce form.lost_reset_password {
	background: var(--ananyoo-bg-form, #ffffff) !important;
	color: var(--ananyoo-text-primary, #1a1f36) !important;
	border-radius: var(--ananyoo-radius, 8px);
}
.woocommerce-account .woocommerce form.login label,
.woocommerce-account .woocommerce form.register label,
.woocommerce-account .woocommerce .woocommerce-ResetPassword label,
.woocommerce-account .woocommerce form.lost_reset_password label {
	font-weight: 600;
	color: var(--ananyoo-text-primary, #1a1f36);
}
/* Helper / secondary text inside the cards. */
.woocommerce-account .woocommerce form.login .lost_password,
.woocommerce-account .woocommerce form.register .woocommerce-privacy-policy-text,
.woocommerce-account .woocommerce form.register .woocommerce-privacy-policy-text p,
.woocommerce-account .woocommerce .woocommerce-ResetPassword p:first-of-type,
.woocommerce-account .woocommerce form.lost_reset_password p:first-of-type {
	color: var(--ananyoo-text-secondary, #475569);
}

/* --- Fields. --- */
.woocommerce-account .woocommerce form.login .woocommerce-Input,
.woocommerce-account .woocommerce form.register .woocommerce-Input,
.woocommerce-account .woocommerce form.login input.input-text,
.woocommerce-account .woocommerce form.register input.input-text,
.woocommerce-account .woocommerce .woocommerce-ResetPassword input.input-text,
.woocommerce-account .woocommerce form.lost_reset_password input.input-text {
	min-height: var(--ananyoo-field-height, 48px);
	padding: 0.6rem 0.75rem;
	color: var(--ananyoo-field-text, #1f2937) !important;
	background: var(--ananyoo-field-bg, #fff) !important;
	border: 2px solid var(--ananyoo-field-border, #6b7280) !important;
	border-radius: var(--ananyoo-radius, 8px);
}
.woocommerce-account .woocommerce form.login input:focus-visible,
.woocommerce-account .woocommerce form.register input:focus-visible,
.woocommerce-account .woocommerce button:focus-visible,
.woocommerce-account .woocommerce a:focus-visible {
	outline: var(--ananyoo-focus-width, 3px) solid var(--ananyoo-focus-ring, #a16207);
	outline-offset: 2px;
}

/* --- Buttons. --- */
.woocommerce-account .woocommerce form.login .button,
.woocommerce-account .woocommerce form.register .button,
.woocommerce-account .woocommerce .woocommerce-Button {
	min-height: var(--ananyoo-target-size, 44px);
	padding: 0.65rem 1.4rem;
	font-weight: 600;
	color: var(--ananyoo-button-text, #fff) !important;
	background: var(--ananyoo-button-bg, #1d4ed8) !important;
	border: 2px solid var(--ananyoo-button-bg, #1d4ed8) !important;
	border-radius: var(--ananyoo-radius, 8px);
}
.woocommerce-account .woocommerce form.login .button:hover,
.woocommerce-account .woocommerce form.register .button:hover,
.woocommerce-account .woocommerce .woocommerce-Button:hover,
.woocommerce-account .woocommerce form.login .button:focus-visible,
.woocommerce-account .woocommerce form.register .button:focus-visible,
.woocommerce-account .woocommerce .woocommerce-Button:focus-visible {
	/* The hover pair is audited as button_text on button_hover — repeat the
	   text colour here so a theme's own button:hover text rule can never
	   bleed in and break the pair. */
	color: var(--ananyoo-button-text, #fff) !important;
	background: var(--ananyoo-button-hover, #1e40af) !important;
	border-color: var(--ananyoo-button-hover, #1e40af) !important;
}

/* --- Links. --- */
.woocommerce-account .woocommerce a {
	color: var(--ananyoo-link, #1d4ed8) !important;
}
.woocommerce-account .woocommerce a:hover,
.woocommerce-account .woocommerce a:focus-visible {
	color: var(--ananyoo-link-hover, #1e3a8a) !important;
}
/* Inside the form cards, links are also underlined so they are never
   distinguishable by colour alone (WCAG 1.4.1). */
.woocommerce-account .woocommerce form.login a,
.woocommerce-account .woocommerce form.register a,
.woocommerce-account .woocommerce .woocommerce-ResetPassword a,
.woocommerce-account .woocommerce form.lost_reset_password a {
	text-decoration: underline;
	text-underline-offset: 3px;
}

@media (forced-colors: active) {
	.woocommerce-account .woocommerce input:focus-visible,
	.woocommerce-account .woocommerce button:focus-visible,
	.woocommerce-account .woocommerce a:focus-visible { outline: 3px solid CanvasText; }
}
