/*
 * Mi cuenta, visiteur non connecté (connexion, inscription, mot de passe oublié).
 * Chargé seulement sur ces pages (mi-cuenta.php). Champs et bouton : mêmes styles que la page
 * de paiement (extension spirfix-checkout-v2, assets/sfx-checkout.css).
 */
body.spx-auth-page {
	--sfx-blue: #0474F2;
	--sfx-blue-dark: #035EC4;
	--sfx-blue-soft: #F2F7FE;
	--sfx-green: #00865A;
	--sfx-cream: #F7F7F1;
	--sfx-line: #DEDED9;
	--sfx-line-soft: #E8E8E2;
	--sfx-muted: #595959;
	--sfx-radius: 10px;
}

/* Le titre « Mi cuenta » de la page fait doublon avec la carte. */
body.spx-auth-page .entry-header,
body.spx-auth-page .entry-content > .woocommerce > h2,
body.spx-auth-page #comments { display: none; }

/* ---------- Mise en page : carte + encart ---------- */
body.spx-auth-page .spx-auth {
	display: grid;
	grid-template-columns: minmax(0, 520px) minmax(0, 340px);
	justify-content: center;
	align-items: start;
	gap: 32px;
	max-width: 920px;
	margin: 12px auto 56px;
}
body.spx-auth-page .spx-auth--simple { grid-template-columns: minmax(0, 480px); }
body.spx-auth-page .spx-auth__card {
	background: #fff;
	border: 1px solid var(--sfx-line-soft);
	border-radius: 16px;
	box-shadow: 0 8px 28px rgba(17, 24, 39, .06);
	padding: 32px;
	min-width: 0;
}
body.spx-auth-page .spx-auth__head { margin-bottom: 20px; }
body.spx-auth-page .spx-auth__title { margin: 0 0 6px; font-size: 24px; font-weight: 700; line-height: 1.25; }
body.spx-auth-page .spx-auth__intro { margin: 0; font-size: 14px; color: var(--sfx-muted); }

/* ---------- Onglets ---------- */
body.spx-auth-page .spx-auth__tabs {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 4px;
	padding: 4px;
	margin-bottom: 24px;
	background: var(--sfx-cream);
	border: 1px solid var(--sfx-line-soft);
	border-radius: 12px;
}
body.spx-auth-page .spx-auth__tab {
	appearance: none;
	border: 0;
	border-radius: 9px;
	background: transparent;
	padding: 10px 12px;
	font: inherit;
	font-size: 14px;
	font-weight: 600;
	color: var(--sfx-muted);
	cursor: pointer;
	transition: background .15s, color .15s, box-shadow .15s;
}
body.spx-auth-page .spx-auth__tab:hover { color: #1a1a1a; }
body.spx-auth-page .spx-auth__tab.is-active {
	background: #fff;
	color: #1a1a1a;
	box-shadow: 0 1px 3px rgba(17, 24, 39, .12);
}
body.spx-auth-page .spx-auth__tab:focus-visible { outline: 2px solid var(--sfx-blue); outline-offset: 2px; }

/* Un seul formulaire visible à la fois. */
body.spx-auth-page .spx-auth[data-onglet="acceso"] #customer_login .col-2,
body.spx-auth-page .spx-auth[data-onglet="registro"] #customer_login .col-1,
body.spx-auth-page .spx-auth[data-onglet="acceso"] .spx-auth__intro--registro,
body.spx-auth-page .spx-auth[data-onglet="registro"] .spx-auth__intro--acceso,
body.spx-auth-page .spx-auth[data-onglet="acceso"] .spx-auth__switch--registro,
body.spx-auth-page .spx-auth[data-onglet="registro"] .spx-auth__switch--acceso { display: none; }

/* ---------- Neutralise la grille WooCommerce à deux colonnes ---------- */
/* Shoptimizer fait flotter #customer_login (float:left) : on le remet dans le flux. */
body.spx-auth-page #customer_login { display: block; float: none !important; width: auto !important; margin: 0; }
body.spx-auth-page #customer_login::before,
body.spx-auth-page #customer_login::after { content: none; }
body.spx-auth-page #customer_login .col-1,
body.spx-auth-page #customer_login .col-2 {
	float: none !important;
	width: auto !important;
	max-width: none !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	background: none !important;
}
body.spx-auth-page #customer_login h2 { display: none; }
body.spx-auth-page .spx-auth form.login,
body.spx-auth-page .spx-auth form.register,
body.spx-auth-page .spx-auth form.lost_reset_password {
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	background: none !important;
	box-shadow: none !important;
}

/* Inscription : prénom et nom côte à côte. */
body.spx-auth-page .spx-auth form.register {
	display: grid;
	grid-template-columns: 1fr 1fr;
	column-gap: 14px;
}
body.spx-auth-page .spx-auth form.register > * { grid-column: 1 / -1; }
body.spx-auth-page .spx-auth form.register > .field-width-50 { grid-column: auto; }
/* Ordre espagnol : Nombre puis Apellidos (le formulaire de l'extension met le nom en premier). */
body.spx-auth-page .spx-auth form.register > #billing_first_name_field { order: -2; }
body.spx-auth-page .spx-auth form.register > #billing_last_name_field { order: -1; }
body.spx-auth-page .spx-auth form.register > p.wp-block-paragraph:empty { display: none; }

/* ---------- Champs (styles de la page de paiement) ---------- */
body.spx-auth-page .spx-auth .form-row { margin: 0 0 16px !important; padding: 0 !important; width: auto !important; float: none !important; }
body.spx-auth-page .spx-auth .form-row label {
	display: block;
	font-size: 13px;
	font-weight: 500;
	color: #333;
	margin-bottom: 4px;
	line-height: 1.4;
}
body.spx-auth-page .spx-auth .form-row label .required { color: #c62828; text-decoration: none; border: 0; }
body.spx-auth-page .spx-auth .form-row input.input-text,
body.spx-auth-page .spx-auth .form-row select {
	width: 100%;
	height: 46px;
	border: 1px solid var(--sfx-line) !important;
	border-radius: 8px !important;
	padding: 0 12px;
	font-size: 15px;
	background: #fff;
	box-shadow: none;
}
body.spx-auth-page .spx-auth .form-row input.input-text:focus,
body.spx-auth-page .spx-auth .form-row select:focus {
	border-color: var(--sfx-blue) !important;
	outline: 2px solid rgba(4, 116, 242, .15);
}
body.spx-auth-page .spx-auth .password-input { display: block; position: relative; }
body.spx-auth-page .spx-auth .password-input input.input-text { padding-right: 44px; }
body.spx-auth-page .spx-auth .show-password-input { top: 50%; transform: translateY(-50%); right: 12px; }

/* « Recuérdame » + bouton de connexion. */
body.spx-auth-page .spx-auth form.login .form-row:has(.woocommerce-form-login__rememberme) {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 16px;
	margin-top: 4px !important;
}
body.spx-auth-page .spx-auth .woocommerce-form-login__rememberme {
	display: flex !important;
	align-items: center;
	gap: 8px;
	margin: 0 !important;
	font-size: 14px;
	font-weight: 400;
	color: #333;
	cursor: pointer;
}
body.spx-auth-page .spx-auth .woocommerce-form-login__rememberme input { width: 17px; height: 17px; margin: 0; accent-color: var(--sfx-blue); }

/* ---------- Bouton principal (comme « Pagar ») ---------- */
body.spx-auth-page .spx-auth button.button,
body.spx-auth-page .spx-auth .woocommerce-Button {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: 50px;
	margin: 0;
	padding: 12px 20px;
	border: 0;
	border-radius: var(--sfx-radius);
	background: var(--sfx-blue) !important;
	color: #fff !important;
	font-size: 16px;
	font-weight: 700;
	line-height: 1.2;
	cursor: pointer;
	transition: background .15s;
}
body.spx-auth-page .spx-auth button.button:hover,
body.spx-auth-page .spx-auth .woocommerce-Button:hover { background: var(--sfx-blue-dark) !important; }

/* ---------- Liens ---------- */
body.spx-auth-page .spx-auth .lost_password { margin: 14px 0 0; text-align: center; font-size: 14px; }
body.spx-auth-page .spx-auth a { color: var(--sfx-blue); font-weight: 600; text-decoration: none; }
body.spx-auth-page .spx-auth a:hover { color: var(--sfx-blue-dark); text-decoration: underline; }
body.spx-auth-page .spx-auth__switch {
	margin: 22px 0 0;
	padding-top: 18px;
	border-top: 1px solid var(--sfx-line-soft);
	text-align: center;
	font-size: 14px;
	color: var(--sfx-muted);
}

/* ---------- Encart des avantages ---------- */
body.spx-auth-page .spx-auth__aside {
	background: var(--sfx-cream);
	border: 1px solid var(--sfx-line-soft);
	border-radius: 16px;
	padding: 28px 26px;
	min-width: 0;
}
body.spx-auth-page .spx-auth__aside-title { margin: 0 0 16px; font-size: 17px; font-weight: 700; }
body.spx-auth-page .spx-auth__benefits { list-style: none; margin: 0 0 18px; padding: 0; display: flex; flex-direction: column; gap: 12px; }
body.spx-auth-page .spx-auth__benefits li { display: flex; align-items: flex-start; gap: 10px; margin: 0; font-size: 14px; line-height: 1.45; color: #1a1a1a; }
body.spx-auth-page .spx-auth__check {
	flex: 0 0 26px;
	height: 26px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	background: #E9F8F1;
	color: var(--sfx-green);
	margin-top: -2px;
}
body.spx-auth-page .spx-auth__guest { margin: 0 0 18px; padding-top: 16px; border-top: 1px solid var(--sfx-line); font-size: 13px; color: var(--sfx-muted); }
body.spx-auth-page .spx-auth__trust { display: block; width: 220px; max-width: 100%; height: auto; }

/* ---------- Mot de passe oublié ---------- */
body.spx-auth-page .spx-auth--simple form.lost_reset_password > p:first-child { margin: 0 0 18px; font-size: 14px; color: var(--sfx-muted); }

/* Messages WooCommerce (erreurs de connexion) alignés sur la carte. */
body.spx-auth-page .woocommerce-notices-wrapper { max-width: 920px; margin: 0 auto; }
body.spx-auth-page .woocommerce-error,
body.spx-auth-page .woocommerce-message,
body.spx-auth-page .woocommerce-info { border-radius: var(--sfx-radius); }

/* ---------- Mobile ---------- */
@media (max-width: 860px) {
	body.spx-auth-page .spx-auth { grid-template-columns: minmax(0, 1fr); gap: 20px; margin-top: 4px; }
}
@media (max-width: 480px) {
	body.spx-auth-page .spx-auth__card { padding: 22px 18px; border-radius: 14px; }
	body.spx-auth-page .spx-auth__title { font-size: 21px; }
	body.spx-auth-page .spx-auth__tab { padding: 10px 6px; font-size: 13.5px; white-space: nowrap; }
	body.spx-auth-page .spx-auth form.register { grid-template-columns: 1fr; }
	body.spx-auth-page .spx-auth__aside { padding: 22px 18px; }
}
