/**
 * Pages Mon compte hors connexion : connexion, inscription, mot de passe oublié
 * et choix d'un nouveau mot de passe.
 *
 * Chargé uniquement pour les visiteurs non connectés sur les pages du compte
 * (voir fp_enqueue_account_forms_styles()). Tout est borné par .ct-woo-unauthorized,
 * le conteneur que Blocksy ajoute à ces écrans, pour ne rien changer ailleurs.
 *
 * @since 2.3.0
 */

.ct-woo-unauthorized {
	--fp-acc-primary: var(--theme-palette-color-1, #2E8B57);
	--fp-acc-primary-dark: var(--theme-palette-color-2, #246B43);
	--fp-acc-text: var(--theme-palette-color-3, #1F2421);
	--fp-acc-muted: var(--theme-palette-color-4, #4A5568);
	--fp-acc-soft: var(--theme-palette-color-7, #F7FAF7);
	--fp-acc-border: #E2E8F0;

	max-width: 960px;
	margin: 0 auto;
	padding: 24px 16px 72px;
}

/* Le bloc d'espacement de la page (100 px) pousse les formulaires trop bas. */
body.woocommerce-account .entry-content > .wp-block-spacer:first-child {
	height: 32px !important;
}

/* ---------- Cartes ---------- */

.ct-woo-unauthorized #customer_login {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 24px;
	align-items: stretch;
	width: 100%;
	margin: 0;
}

.ct-woo-unauthorized #customer_login .u-column1,
.ct-woo-unauthorized #customer_login .u-column2 {
	float: none;
	width: auto;
	max-width: none;
	padding: 32px;
	background: #fff;
	border: 1px solid var(--fp-acc-border);
	border-radius: 16px;
	box-shadow: 0 8px 28px rgba(31, 36, 33, 0.06);
	box-sizing: border-box;
}

/* L'inscription se démarque légèrement : c'est l'appel à l'action de la page. */
.ct-woo-unauthorized #customer_login .u-column2 {
	background: var(--fp-acc-soft);
	border-color: rgba(46, 139, 87, 0.28);
}

/* Écrans à une seule carte : mot de passe oublié / nouveau mot de passe. */
.ct-woo-unauthorized > form.lost_reset_password,
.ct-woo-unauthorized > form.woocommerce-ResetPassword,
.ct-woo-unauthorized > form.woocommerce-form-login,
.ct-woo-unauthorized > form.woocommerce-form-register {
	max-width: 480px;
	margin: 0 auto;
	padding: 32px;
	background: #fff;
	border: 1px solid var(--fp-acc-border);
	border-radius: 16px;
	box-shadow: 0 8px 28px rgba(31, 36, 33, 0.06);
	box-sizing: border-box;
}

/* ---------- Titres ---------- */

.ct-woo-unauthorized h2,
.ct-woo-unauthorized .fp-account-title {
	margin: 0 0 20px;
	font-family: "Fraunces", Georgia, "Times New Roman", serif;
	font-size: 26px;
	line-height: 1.2;
	font-weight: 600;
	color: var(--fp-acc-text);
}

.ct-woo-unauthorized .fp-account-title {
	max-width: 480px;
	margin: 0 auto 16px;
	text-align: center;
}

.ct-woo-unauthorized form > p:first-child:not(.form-row) {
	margin: 0 0 20px;
	color: var(--fp-acc-muted);
	font-size: 15px;
	line-height: 1.6;
}

/* ---------- Champs ---------- */

.ct-woo-unauthorized .form-row {
	float: none;
	width: 100%;
	margin: 0 0 18px;
	padding: 0;
}

.ct-woo-unauthorized .form-row-first,
.ct-woo-unauthorized .form-row-last {
	float: none;
	width: 100%;
}

.ct-woo-unauthorized label {
	display: block;
	margin: 0 0 6px;
	font-size: 14px;
	font-weight: 600;
	color: var(--fp-acc-text);
}

.ct-woo-unauthorized label .required {
	color: #C53030;
	text-decoration: none;
}

.ct-woo-unauthorized input[type="text"],
.ct-woo-unauthorized input[type="email"],
.ct-woo-unauthorized input[type="password"] {
	width: 100%;
	height: 48px;
	padding: 0 14px;
	background: #fff;
	border: 1px solid var(--fp-acc-border);
	border-radius: 10px;
	font-size: 15px;
	color: var(--fp-acc-text);
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.ct-woo-unauthorized input[type="text"]:focus,
.ct-woo-unauthorized input[type="email"]:focus,
.ct-woo-unauthorized input[type="password"]:focus {
	outline: none;
	border-color: var(--fp-acc-primary);
	box-shadow: 0 0 0 3px rgba(46, 139, 87, 0.18);
}

.ct-woo-unauthorized .password-input {
	display: block;
	position: relative;
}

.ct-woo-unauthorized .password-input input {
	padding-right: 46px;
}

/* Le bouton « afficher le mot de passe » reste dans le champ. */
.ct-woo-unauthorized .show-password-input {
	position: absolute;
	top: 0;
	right: 4px;
	height: 48px;
	width: 42px;
	background-color: transparent;
	border: 0;
	cursor: pointer;
}

/* ---------- Se souvenir de moi ---------- */

.ct-woo-unauthorized .woocommerce-form-login__rememberme {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0 0 18px;
	font-weight: 500;
	color: var(--fp-acc-muted);
}

.ct-woo-unauthorized .woocommerce-form-login .form-row:has(.woocommerce-form-login__submit) {
	margin-bottom: 8px;
}

/* ---------- Boutons ---------- */

.ct-woo-unauthorized .button,
.ct-woo-unauthorized button[type="submit"] {
	display: block;
	width: 100%;
	height: 50px;
	margin: 0;
	padding: 0 20px;
	background: var(--fp-acc-primary);
	border: 0;
	border-radius: 10px;
	font-size: 16px;
	font-weight: 700;
	color: #fff;
	cursor: pointer;
	transition: background-color 0.15s ease, transform 0.15s ease;
}

.ct-woo-unauthorized .button:hover,
.ct-woo-unauthorized button[type="submit"]:hover {
	background: var(--fp-acc-primary-dark);
	transform: translateY(-1px);
}

.ct-woo-unauthorized .button:focus-visible,
.ct-woo-unauthorized button[type="submit"]:focus-visible {
	outline: 3px solid rgba(46, 139, 87, 0.35);
	outline-offset: 2px;
}

/* ---------- Liens et textes d'aide ---------- */

.ct-woo-unauthorized .lost_password {
	margin: 14px 0 0;
	text-align: center;
	font-size: 14px;
}

.ct-woo-unauthorized .lost_password a {
	color: var(--fp-acc-muted);
	text-decoration: underline;
	text-underline-offset: 3px;
}

.ct-woo-unauthorized .lost_password a:hover {
	color: var(--fp-acc-primary);
}

/* « Un lien permettant de définir un nouveau mot de passe… » */
.ct-woo-unauthorized .woocommerce-form-register > p:not(.form-row),
.ct-woo-unauthorized .fp-account-note {
	margin: 0 0 18px;
	padding: 12px 14px;
	background: #fff;
	border-left: 3px solid var(--fp-acc-primary);
	border-radius: 6px;
	font-size: 14px;
	line-height: 1.55;
	color: var(--fp-acc-muted);
}

/* Lien croisé connexion <-> inscription, sous la carte. */
.ct-woo-unauthorized .fp-account-switch {
	max-width: 480px;
	margin: 18px auto 0;
	text-align: center;
	font-size: 15px;
	color: var(--fp-acc-muted);
}

.ct-woo-unauthorized .fp-account-switch a {
	font-weight: 700;
	color: var(--fp-acc-primary);
	text-underline-offset: 3px;
}

/* ---------- Messages WooCommerce ---------- */

.ct-woo-unauthorized .woocommerce-notices-wrapper {
	max-width: 480px;
	margin: 0 auto 16px;
}

.ct-woo-unauthorized #customer_login ~ .woocommerce-notices-wrapper,
.ct-woo-unauthorized .woocommerce-notices-wrapper:has(+ #customer_login) {
	max-width: none;
}

.ct-woo-unauthorized .woocommerce-error,
.ct-woo-unauthorized .woocommerce-message,
.ct-woo-unauthorized .woocommerce-info {
	margin: 0 0 12px;
	padding: 14px 16px;
	border-radius: 10px;
	font-size: 14px;
	line-height: 1.5;
}

/* ---------- Mobile ---------- */

@media (max-width: 768px) {
	.ct-woo-unauthorized {
		padding: 8px 12px 48px;
	}

	.ct-woo-unauthorized #customer_login {
		grid-template-columns: 1fr;
		gap: 16px;
	}

	.ct-woo-unauthorized #customer_login .u-column1,
	.ct-woo-unauthorized #customer_login .u-column2,
	.ct-woo-unauthorized > form.lost_reset_password,
	.ct-woo-unauthorized > form.woocommerce-ResetPassword,
.ct-woo-unauthorized > form.woocommerce-form-login,
.ct-woo-unauthorized > form.woocommerce-form-register {
		padding: 22px 18px;
		border-radius: 14px;
	}

	.ct-woo-unauthorized h2,
	.ct-woo-unauthorized .fp-account-title {
		font-size: 23px;
	}
}
