/**
 * Form Auth — estilos de Login / Registro / Recuperación de contraseña.
 * Header mínimo reutilizado del flujo de carrito (checkout-header).
 * Tokens de theme.json: deep-blue, navy, CTA azul #0070CC, border, muted, crimson.
 */

/* ============ Header (copia de cart.css para reutilizar el mismo header) ============ */

.checkout-header {
	height: 64px;
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0 24px;
	border-bottom: 1px solid var(--wp--preset--color--border, #e8eaf0);
	box-sizing: border-box;
}

.continue-shopping {
	position: absolute;
	left: 24px;
	display: flex;
	align-items: center;
	gap: 10px;
	font-size: 14px;
	font-weight: 500;
	color: var(--wp--preset--color--navy, #172044);
	text-decoration: none;
}


@media (hover: hover) {
	.continue-shopping:hover {
		text-decoration: underline;
}
}

.checkout-brand {
	display: inline-flex;
	align-items: center;
}

.checkout-brand img {
	width: 180px;
	height: auto;
	display: block;
}

/* ============ Shell ============ */

/* Insurance responsive: cualquier margin/padding anidado se calcula dentro
   del shell aunque el CSS base de Woo o del tema inyecte widths/margins. */
.auth-shell,
.auth-shell *,
.auth-shell *::before,
.auth-shell *::after {
	box-sizing: border-box;
}

.auth-shell {
	--auth-cta: #0070cc;
	--auth-cta-hover: #005fae;
	--auth-border: var(--wp--preset--color--border, #e8eaf0);
	--auth-muted: var(--wp--preset--color--muted, #687080);
	--auth-faint: var(--wp--preset--color--gray-muted, #f3f5f5);
	--auth-red: var(--wp--preset--color--crimson-red, #dc2626);
	--auth-amber: #b45309;
	--auth-green: var(--wp--preset--color--promo-green, #12ba00);

	font-family: Lato, sans-serif;
	color: var(--wp--preset--color--black-hole, #010101);
}

/* Login/registro: card en columna, pegada arriba (no centrada verticalmente) */
.auth-shell.auth--splitless {
	max-width: min(520px, 94vw);
	margin: 20px auto 0;
	padding: 0 16px 56px;
	display: block;
}

/* Recuperar / reset: card única centrada arriba */
.auth-shell.auth--single {
	display: block;
	margin: 28px auto 0;
	padding: 0 16px 56px;
	max-width: min(560px, 94vw);
}

.auth-panel {
	display: block;
}

/* ============ Card ============ */

.auth-card {
	width: 100%;
	background: var(--wp--preset--color--starlight, #fff);
	border: 1px solid var(--auth-border);
	border-radius: 22px;
	padding: clamp(26px, 3vw, 40px);
	box-shadow: 0 20px 48px -28px rgba(15, 30, 63, 0.25);
	box-sizing: border-box;
}

.auth-card--narrow {
	max-width: 560px;
	margin-inline: auto;
}

/* Notices de WooCommerce (renderizados dentro de la card por el hook) */

.auth-card .woocommerce-message,
.auth-card .woocommerce-error,
.auth-card .woocommerce-info {
	list-style: none;
	margin: 0 0 10px;
	padding: 10px 12px;
	border-radius: 10px;
	font-size: 13px;
	line-height: 1.4;
	background: var(--auth-faint);
	border: 1px solid var(--auth-border);
}

.auth-card .woocommerce-message {
	border-color: rgba(18, 186, 0, 0.35);
	background: rgba(18, 186, 0, 0.07);
}

.auth-card .woocommerce-info {
	border-color: rgba(0, 112, 204, 0.35);
	background: rgba(0, 112, 204, 0.06);
}

.auth-card .woocommerce-error {
	border-color: rgba(220, 38, 38, 0.35);
	background: rgba(220, 38, 38, 0.05);
	color: var(--auth-red);
}

.auth-card .woocommerce-error li {
	margin: 0;
}

.auth-card .woocommerce-error::before,
.auth-card .woocommerce-message::before,
.auth-card .woocommerce-info::before {
	background: none;
	height: auto;
	width: auto;
	float: none;
	display: inline;
}

/* Notices formato nuevo de Woo 9+ (banner de bloques). Sin esto el banner
   hereda estilos brutos por defecto: mucho padding, tipografía del tema y
   borde grueso de color plano. Mismo look compacto que el legacy de arriba. */
.auth-card .wc-block-components-notice-banner {
	margin: 0 0 10px;
	padding: 10px 12px;
	border-radius: 10px;
	font-size: 13px;
	line-height: 1.4;
	border: 1px solid var(--auth-border);
	border-left: 3px solid var(--auth-cta);
	background: var(--auth-faint);
	box-shadow: none;
}

.auth-card .wc-block-components-notice-banner > svg {
	display: none;
}

.auth-card .wc-block-components-notice-banner__content {
	font-size: 13px;
	line-height: 1.4;
	padding: 0;
}

.auth-card .wc-block-components-notice-banner__content ul,
.auth-card .wc-block-components-notice-banner__content li {
	margin: 0;
	padding: 0;
	list-style: none;
}

.auth-card .wc-block-components-notice-banner.is-error {
	border-color: rgba(220, 38, 38, 0.35);
	border-left-color: var(--auth-red);
	background: rgba(220, 38, 38, 0.05);
	color: var(--auth-red);
}

.auth-card .wc-block-components-notice-banner.is-success,
.auth-card .wc-block-components-notice-banner.is-notice,
.auth-card .wc-block-components-notice-banner.is-info {
	border-color: rgba(0, 112, 204, 0.35);
	border-left-color: var(--auth-cta);
	background: rgba(0, 112, 204, 0.06);
	color: var(--wp--preset--color--navy, #172044);
}

/* El botón dismiss del banner queda accesible pero discreto. */
.auth-card .wc-block-components-notice-banner .wc-block-components-notice-banner__dismiss {
	color: var(--auth-muted);
	padding: 0 2px;
	align-self: flex-start;
}

/* ============ Paneles Ingresar / Crear cuenta ============ */

.auth-pane-head {
	margin-bottom: 20px;
}

.auth-pane-kicker {
	display: inline-block;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.14em;
	color: var(--auth-muted);
	margin-bottom: 8px;
}

.auth-pane-title {
	font-size: clamp(22px, 2.2vw, 27px);
	font-weight: 800;
	margin: 0 0 8px;
	letter-spacing: -0.01em;
}

.auth-pane-sub {
	margin: 0;
	font-size: 14.5px;
	line-height: 1.55;
	color: var(--auth-muted);
}

.auth-pane[hidden] {
	display: none !important;
}

.auth-title-alone {
	font-size: 26px;
	font-weight: 800;
	margin: 0 0 22px;
	letter-spacing: -0.01em;
}

/* ============ Campos ============ */

/* Reseteo del estilo base de Woo en .woocommerce-form (border/padding
   innecesarios dentro de nuestra card). Scoped al flujo auth por seguridad. */

.auth-card .woocommerce-form {
	border: 0 !important;
	padding: 0 !important;
	margin: 0 !important;
	background: transparent !important;
	box-shadow: none !important;
}

/* El wrapper .woocommerce del shortcode hereda max-width:1000px de
   .woocommerce-account main .woocommerce (Woo base). En login-page.php el div
   .woocommerce es PADRE de .auth-shell y vive dentro de main.checkout-main:
   el reset va en ese nivel, subido a (0,3,1) para ganarle siempre a Woo. */
.woocommerce-account main.checkout-main .woocommerce {
	max-width: 100% !important;
	width: 100% !important;
}

.auth-note-admin {
	color: #b45309;
	background: #fffbeb;
	border: 1px solid #fde68a;
	border-radius: 10px;
	padding: 10px 12px;
}

.auth-form {
	display: block;
}

.auth-form p,
.auth-form .auth-field {
	margin: 0 0 16px;
}

.auth-field label {
	display: block;
	font-size: 14px;
	font-weight: 700;
	margin-bottom: 7px;
	color: var(--wp--preset--color--black-hole, #010101);
}

.auth-field .required {
	color: var(--auth-red);
}

.auth-input-wrap {
	position: relative;
	display: block;
}

.auth-input-wrap input[type='text'],
.auth-input-wrap input[type='email'],
.auth-input-wrap input[type='password'] {
	width: 100%;
	height: 48px;
	padding: 0 14px;
	border: 1.5px solid var(--auth-border);
	border-radius: 11px;
	background: #fff;
	color: var(--wp--preset--color--black-hole, #010101);
	font-family: inherit;
	font-size: 15px;
	line-height: normal;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
	box-sizing: border-box;
}

.auth-input-wrap.has-toggle input[type='password'] {
	padding-right: 46px;
}


@media (hover: hover) {
	.auth-input-wrap input:hover {
		border-color: #c9d2de;
}
}

.auth-input-wrap input:focus {
	outline: none;
	border-color: var(--auth-cta);
	box-shadow: 0 0 0 3px rgba(0, 112, 204, 0.16);
}

.auth-input-wrap.is-invalid input {
	border-color: var(--auth-red);
	box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.auth-field-error,
.auth-hint {
	display: block;
	margin-top: 6px;
	font-size: 12.5px;
	line-height: 1.4;
	color: var(--auth-red);
}

.auth-hint:not(.auth-field-error) {
	color: var(--auth-muted);
	font-size: 12px;
}

/* Cuando el error del campo está visible, el hint estático sobra: el error manda. */
.auth-field:has(.auth-field-error:not(:empty)) .auth-hint:not(.auth-field-error) {
	display: none;
}

.auth-field-error:empty {
	display: none;
}

/* Medidor nativo de Woo (wc-password-strength-meter): su meter (#password_strength),
   su hint largo (.woocommerce-password-hint) y el span.password-input con el que
   envuelve el input. El tema ya provee .auth-strength: el nativo no debe verse. */
.auth-shell .woocommerce-password-strength,
.auth-shell .woocommerce-password-hint {
	display: none !important;
}

.auth-shell .password-input {
	display: contents;
}

/* Toggle show/hide password */

/* Woo core inserta por JS su propio botón .show-password-input dentro de
   span.password-input — duplica el ojo del tema. Scoped al flujo auth: se
   oculta y manda el toggle propio (.auth-password-toggle + form-auth.js). */
.auth-shell .show-password-input {
	display: none !important;
}

.auth-password-toggle {
	/* Anclado al centro del input (48px), NO del wrap: los hints que aparecen
	   dentro del wrap (Bloq Mayús, etc.) pueden crecer sin desplazar el ojo. */
	position: absolute;
	top: 24px;
	right: 6px;
	transform: translateY(-50%);
	-webkit-appearance: none;
	appearance: none;
	border: 0;
	background: transparent;
	width: 36px;
	height: 36px;
	border-radius: 8px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: var(--auth-muted);
	cursor: pointer;
}

/* Solo un ojo visible a la vez (el JS invierte el aria-pressed). */
.auth-password-toggle .icon-eye-off {
	display: none !important;
}

.auth-password-toggle:not([aria-pressed="true"]) .icon-eye {
	display: block !important;
}

.auth-password-toggle[aria-pressed="true"] .icon-eye {
	display: none !important;
}

.auth-password-toggle[aria-pressed="true"] .icon-eye-off {
	display: block !important;
}


@media (hover: hover) {
	.auth-password-toggle:hover {
		color: var(--wp--preset--color--navy, #172044);
		background: var(--auth-faint);
}
}

.auth-password-toggle:focus-visible {
	outline: 2px solid var(--auth-cta);
	outline-offset: 1px;
}

.auth-capslock-hint {
	display: block;
	margin-top: 6px;
	font-size: 12.5px;
	color: var(--auth-amber);
}

.auth-capslock-hint[hidden] {
	display: none;
}

/* Medidor de fuerza */

.auth-strength {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 8px 0 2px;
}

.auth-strength-bars {
	display: flex;
	gap: 4px;
	flex: none;
}

.auth-strength-bars i {
	width: 26px;
	height: 5px;
	border-radius: 3px;
	background: #e4e8ef;
	transition: background-color 0.2s ease;
}

.auth-strength-label {
	font-size: 12.5px;
	color: var(--auth-muted);
	font-weight: 600;
}

.auth-strength[data-score='1'] .auth-strength-bars i:nth-child(1) {
	background: var(--auth-red);
}

.auth-strength[data-score='2'] .auth-strength-bars i:nth-child(-n + 2) {
	background: var(--wp--preset--color--burnt-orange, #e06217);
}

.auth-strength[data-score='3'] .auth-strength-bars i:nth-child(-n + 3) {
	background: var(--wp--preset--color--apple-green, #8ebb37);
}

.auth-strength[data-score='4'] .auth-strength-bars i {
	background: var(--auth-green);
}

/* Fila rememberme + recuperar */

.auth-login-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	flex-wrap: wrap;
	margin: 2px 0 18px;
}

/* Checkbox custom */

.auth-checkbox {
	display: inline-flex;
	align-items: center;
	gap: 9px;
	font-size: 14px;
	color: var(--wp--preset--color--black-hole, #010101);
	cursor: pointer;
	user-select: none;
}

.auth-checkbox input[type='checkbox'] {
	position: absolute;
	opacity: 0;
	width: 1px;
	height: 1px;
}

.auth-checkbox-box {
	width: 18px;
	height: 18px;
	border: 1.5px solid var(--auth-border);
	border-radius: 5px;
	background: #fff;
	position: relative;
	transition: background-color 0.15s ease, border-color 0.15s ease;
	flex: none;
}

.auth-checkbox input:checked + .auth-checkbox-box {
	background: var(--auth-cta);
	border-color: var(--auth-cta);
}

.auth-checkbox input:checked + .auth-checkbox-box::after {
	content: '';
	position: absolute;
	left: 5px;
	top: 1.5px;
	width: 5px;
	height: 9px;
	border: solid #fff;
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
}

.auth-checkbox input:focus-visible + .auth-checkbox-box {
	box-shadow: 0 0 0 3px rgba(0, 112, 204, 0.16);
}

.auth-lost-link {
	font-size: 13.5px;
	color: var(--auth-muted);
	text-decoration: none;
}


@media (hover: hover) {
	.auth-lost-link:hover {
		color: var(--auth-cta);
		text-decoration: underline;
}
}

/* Nota (modo autogeneración de contraseña) */

.auth-note {
	margin: 0 0 18px;
	padding: 12px 14px;
	background: rgba(0, 112, 204, 0.06);
	border: 1px solid rgba(0, 112, 204, 0.25);
	border-radius: 12px;
	font-size: 13.5px;
	color: var(--wp--preset--color--navy, #172044);
}

/* Aviso de privacidad de WooCommerce en el registro (texto small del theme) */

.auth-card .woocommerce-privacy-policy-text {
	margin: 0 0 16px;
	font-size: 12px;
	line-height: 1.55;
	color: var(--auth-muted);
}

.auth-card .woocommerce-privacy-policy-text p {
	margin: 0;
}

.auth-card .woocommerce-privacy-policy-link {
	color: var(--auth-cta);
	text-decoration: underline;
	text-underline-offset: 2px;
	text-decoration-color: rgba(0, 112, 204, 0.45);
}


@media (hover: hover) {
	.auth-card .woocommerce-privacy-policy-link:hover {
		color: var(--auth-cta-hover);
		text-decoration-color: currentColor;
}
}

/* ============ Switch de pregunta entre panes ============ */

.auth-switch-row {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	flex-wrap: wrap;
	border-top: 1px solid var(--auth-border);
	margin-top: 22px;
	padding-top: 18px;
	font-size: 14px;
	color: var(--auth-muted);
}

.auth-switch {
	-webkit-appearance: none;
	appearance: none;
	border: 0;
	background: transparent;
	padding: 6px 4px;
	font-family: inherit;
	font-size: 14px;
	font-weight: 700;
	color: var(--auth-cta);
	cursor: pointer;
	border-radius: 8px;
	text-decoration: none;
}


@media (hover: hover) {
	.auth-switch:hover {
		text-decoration: underline;
		color: var(--auth-cta-hover);
}
}

.auth-switch:focus-visible {
	outline: 2px solid var(--auth-cta);
	outline-offset: 2px;
}

/* ============ Submit ============ */

.auth-submit-row {
	margin: 0;
}

/* CTA con el lenguaje de botón global (v2.15.23): pill igual que el
   .primary del carrito y el #place_order del checkout — radio 28px,
   weight 500, sin sombra (antes: rect 12px con glow azul, único
   residual del diseño de botón azul). */
.auth-form .auth-submit {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 50px;
	padding: 14px 24px;
	border: 0;
	border-radius: 28px;
	background: var(--wp--preset--color--promo-amber, #FFB100);
	color: var(--wp--preset--color--navy, #172044);
	font-family: inherit;
	font-size: 15px;
	font-weight: 500;
	cursor: pointer;
	text-align: center;
	transition: var(--innova-transition, background-color 0.15s ease);
}


@media (hover: hover) {
	.auth-form .auth-submit:hover {
		filter: brightness(1.15);
}
}

.auth-form .auth-submit:active {
	transform: translateY(1px);
}

.auth-form .auth-submit:focus-visible {
	outline: 2px solid var(--wp--preset--color--navy, #172044);
	outline-offset: 2px;
}

/* Woo core flota el submit del login a la izquierda (legacy:
   "botón + ¿olvidaste tu contraseña?" en la misma línea, layout que
   este template reemplaza). Como el botón es width:100%, el float
   colapsa el <p class="auth-submit-row"> y rompe el .auth-switch-row
   siguiente en móvil (row a width 0, span y CTA apretados en columnas
   de ~50px). Se neutraliza con especificidad superior (0,4,0) a la
   regla de Woo (0,3,0): form con .woocommerce-form-login.auth-form
   (ambas clases viven en el MISMO elemento, no son ancestro/desc). */
.woocommerce .woocommerce-form-login.auth-form .woocommerce-form-login__submit {
	float: none;
	margin-right: 0;
}

.auth-form .auth-submit.is-loading {
	opacity: 0.75;
	pointer-events: none;
}

.auth-form .auth-submit.is-loading::after {
	content: '';
	width: 16px;
	height: 16px;
	margin-left: 10px;
	border: 2px solid rgba(23, 32, 68, 0.3);
	border-top-color: var(--wp--preset--color--navy, #172044);
	border-radius: 50%;
	animation: auth-spin 0.7s linear infinite;
}

@keyframes auth-spin {
	to {
		transform: rotate(360deg);
	}
}

/* ============ Lista de beneficios bajo el form ============ */

.auth-trust {
	list-style: none;
	margin: 18px 0 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.auth-trust li {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	font-size: 13.5px;
	line-height: 1.45;
	color: var(--auth-muted);
}

.auth-trust li strong {
	color: var(--wp--preset--color--navy, #172044);
	font-weight: 700;
}

.auth-trust svg {
	flex: none;
	width: 30px;
	height: 30px;
	padding: 6px;
	margin-top: -2px;
	border-radius: 8px;
	background: rgba(0, 112, 204, 0.08);
	color: var(--auth-cta);
	stroke-width: 1.8;
	box-sizing: border-box;
}

/* ============ Páginas únicas (recuperar / reset) ============ */

.auth-lockup {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 24px;
}

.auth-mini-logo {
	display: inline-flex;
}

.auth-lockup .auth-mini-logo {
	margin-left: -4px;
}

.auth-step-back {
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.08em;
	color: var(--auth-muted);
	background: var(--auth-faint);
	border: 1px solid var(--auth-border);
	border-radius: 999px;
	padding: 6px 12px;
}

.auth-card-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 42px;
	height: 42px;
	border-radius: 12px;
	background: rgba(0, 112, 204, 0.1);
	color: var(--auth-cta);
	margin-bottom: 14px;
}

.auth-form-message {
	margin: 0 0 18px;
	font-size: 14.5px;
	line-height: 1.55;
	color: var(--auth-muted);
}

.auth-back-link {
	display: inline-block;
	margin-top: 14px;
	font-size: 13.5px;
	color: var(--auth-muted);
	text-decoration: none;
}


@media (hover: hover) {
	.auth-back-link:hover {
		color: var(--auth-cta);
		text-decoration: underline;
}
}

/* Fallback si un plugin re-renderiza la estructura col2-set de Woo */
#customer_login .u-column1,
#customer_login .u-column2 {
	width: 100%;
	max-width: 480px;
}

/* ============ Responsive ============ */

@media (max-width: 700px) {
	.checkout-header {
		height: 58px;
	}

	.continue-shopping {
		left: 14px;
		font-size: 0;
	}

	.continue-shopping svg {
		width: 20px;
		height: 20px;
	}

	.checkout-brand img {
		width: 140px;
	}

	.auth-shell.auth--splitless,
	.auth-shell.auth--single {
		margin-top: 10px;
		padding-left: 14px;
		padding-right: 14px;
	}

	.auth-card {
		border-radius: 18px;
		padding: 22px 18px;
	}

	.auth-login-row {
		align-items: flex-start;
		flex-direction: column;
		gap: 10px;
	}
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
	.auth-submit.is-loading::after {
		animation: none;
	}
}
