/* ==========================================================================
   Portail CD — page de connexion
   S'appuie sur les variables et la typographie de main.css
   ========================================================================== */

body.cd-login {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	grid-template-rows: 1fr auto;
	gap: 0;
	min-height: 100vh;
	padding: var(--gutter);
}

@media (min-width: 60rem) {
	body.cd-login {
		grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
		column-gap: var(--gutter);
	}
}

.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

/* Panneau de marque
   -------------------------------------------------------------------------- */
.cd-login__aside {
	display: none;
}

@media (min-width: 60rem) {
	.cd-login__aside {
		grid-row: 1 / span 2;
		display: flex;
		flex-direction: column;
		justify-content: space-between;
		gap: 2rem;
		padding: 3rem;
		border-radius: var(--radius-2xl);
		background: var(--vin);
		color: #fff;
		overflow: hidden;
	}
}

.cd-login__logo {
	width: 12rem;
}

.cd-login__script {
	font-family: var(--font-calloveya);
	font-size: clamp(3rem, 6vw, 5.5rem);
	line-height: 1;
}

.cd-login__lead {
	margin-top: .5rem;
	font-size: clamp(1.75rem, 3vw, 2.75rem);
	font-weight: 600;
	line-height: 1.05;
}

.cd-login__baseline {
	max-width: 22rem;
	color: rgb(255 255 255 / .6);
	font-size: .875rem;
	letter-spacing: .02em;
}

/* Colonne du formulaire
   -------------------------------------------------------------------------- */
#login {
	align-self: center;
	justify-self: center;
	width: 100%;
	max-width: 24rem;
	padding: 3rem 0;
}

/* Logo cerise, seulement quand le panneau est masqué */
.wp-login-logo a {
	display: block;
	width: 10rem;
	height: 2.75rem;
	margin-bottom: 3rem;
	background: url("../img/logo-cerise.svg") no-repeat left center / contain;
	text-indent: -9999px;
	overflow: hidden;
}

@media (min-width: 60rem) {
	.wp-login-logo {
		display: none;
	}
}

.cd-login__intro {
	margin-bottom: 2rem;
}

.cd-login__intro h2 {
	font-size: 2.5rem;
	font-weight: 600;
}

.cd-login__intro p {
	margin-top: .75rem;
}

/* Formulaires */
#loginform,
#lostpasswordform,
#resetpassform,
#registerform {
	display: flex;
	flex-direction: column;
	gap: 1.25rem;
}

#login form p {
	line-height: 1.5;
}

#login label {
	display: block;
	margin-bottom: .4rem;
	font-size: .875rem;
	font-weight: 600;
}

#login form p + p {
	margin-top: 0;
}

/* Mot de passe avec bouton afficher / masquer */
.wp-pwd {
	position: relative;
}

.wp-pwd .input {
	padding-right: 3rem;
}

.wp-hide-pw {
	position: absolute;
	top: 50%;
	right: .5rem;
	width: 2.25rem;
	height: 2.25rem;
	display: grid;
	place-items: center;
	transform: translateY(-50%);
	padding: 0;
	border-radius: var(--radius-md);
	background: transparent;
	color: var(--muted);
	cursor: pointer;
	transition: color var(--transition), background-color var(--transition);
}

.wp-hide-pw:hover {
	color: var(--vin);
	background: var(--froid);
}

.wp-hide-pw .dashicons {
	width: 1.25rem;
	height: 1.25rem;
	background: currentColor;
	-webkit-mask: var(--icon) no-repeat center / contain;
	mask: var(--icon) no-repeat center / contain;
}

.dashicons-visibility {
	--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7S2 12 2 12Z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E");
}

.dashicons-hidden {
	--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9.9 4.2A10 10 0 0 1 12 4c6.5 0 10 7 10 7a17 17 0 0 1-2.2 3.2M6.6 6.6A17 17 0 0 0 2 12s3.5 7 10 7a9.7 9.7 0 0 0 5.4-1.6'/%3E%3Cpath d='M9.9 9.9a3 3 0 0 0 4.2 4.2'/%3E%3Cpath d='m2 2 20 20'/%3E%3C/svg%3E");
}

/* Avertissement « Verr. Maj » ajouté par WordPress en JS */
.wp-pwd .caps-warning {
	display: none;
	position: absolute;
	top: calc(100% + .4rem);
	left: 0;
	z-index: 1;
	align-items: center;
	gap: .4rem;
	padding: .35rem .6rem;
	border-radius: var(--radius-md);
	background: var(--vin);
	color: #fff;
	font-size: .75rem;
}

.wp-pwd .caps-warning[style*="block"] {
	display: inline-flex !important;
}

.wp-pwd .caps-icon svg {
	width: .9rem;
	height: .9rem;
	fill: currentColor;
	stroke: currentColor;
}

/* Se souvenir de moi */
.forgetmenot {
	display: flex;
	align-items: center;
	gap: .6rem;
}

#login .forgetmenot label {
	margin: 0;
	font-weight: 400;
}

.forgetmenot input[type="checkbox"] {
	appearance: none;
	flex: none;
	width: 1.1rem;
	height: 1.1rem;
	border: 1px solid var(--muted);
	border-radius: var(--radius-sm);
	display: grid;
	place-items: center;
	cursor: pointer;
	transition: background-color var(--transition), border-color var(--transition);
}

.forgetmenot input[type="checkbox"]:checked {
	border-color: var(--vin);
	background: var(--vin) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12 5 5 9-10'/%3E%3C/svg%3E") no-repeat center / 75%;
}

/* L'infobulle d'aide de WordPress n'apporte rien ici */
.wp-tooltip {
	display: none;
}

/* Bouton principal pleine largeur */
#login .submit {
	margin-top: .5rem;
}

#login .submit input[type="submit"] {
	width: 100%;
	justify-content: center;
	padding: .9rem 1.5rem;
}

/* Liens sous le formulaire */
#nav {
	margin-top: 1.5rem;
	font-size: .875rem;
	color: var(--muted);
}

#nav a {
	position: relative;
	isolation: isolate;
	display: inline-block;
	padding: 0 .25rem;
	margin-left: -.25rem;
	transition: color var(--transition);
}

#nav a::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background: var(--vin);
	transform: scaleY(0);
	transform-origin: bottom;
	transition: transform var(--transition);
}

#nav a:hover {
	color: #fff;
}

#nav a:hover::before {
	transform: scaleY(1);
}

#backtoblog,
.privacy-policy-page-link,
.language-switcher {
	display: none;
}

/* Messages et erreurs */
#login_error,
#login .message,
#login .notice,
#login .success {
	margin-bottom: 1.5rem;
	padding: .9rem 1rem;
	border-left: 3px solid var(--vin);
	border-radius: var(--radius-md);
	background: rgb(58 31 30 / .06);
	font-size: .875rem;
	line-height: 1.5;
}

#login_error,
#login .notice-error {
	border-left-color: var(--cerise);
	background: rgb(164 39 49 / .07);
	color: var(--cerise);
}

#login_error a,
#login .message a {
	text-decoration: underline;
	text-underline-offset: 2px;
}

/* Indicateur de robustesse (réinitialisation du mot de passe) */
#pass-strength-result {
	margin-top: .5rem;
	padding: .4rem .75rem;
	border-radius: var(--radius-md);
	background: var(--froid);
	font-size: .8rem;
}

#pass-strength-result.short,
#pass-strength-result.bad { background: rgb(164 39 49 / .12); color: var(--cerise); }
#pass-strength-result.good { background: rgb(58 31 30 / .08); }
#pass-strength-result.strong { background: var(--vin); color: #fff; }

.description,
.indicator-hint {
	margin-top: .5rem;
	font-size: .8rem;
	color: var(--muted);
}

/* Pied de page */
.cd-login__footer {
	align-self: end;
	justify-self: center;
	color: var(--muted);
	font-size: .75rem;
}

/* Masqué tant que JS n'a pas tourné, comme dans WordPress */
.hide-if-no-js {
	display: none;
}

.js .hide-if-no-js {
	display: revert;
}

.js .wp-hide-pw.hide-if-no-js {
	display: grid;
}
