/* Page de connexion — mobile first */

.dm-login {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 100vh;
	padding: var(--dm-space-lg) var(--dm-space-md);
	background: linear-gradient(160deg, #13473e 0%, #1e7c6e 100%);
	box-sizing: border-box;
}

/*
 * Diaporama et formulaire forment un seul bloc : aucune gouttière entre les deux,
 * les arrondis sont portés par le conteneur qui rogne ses enfants.
 */
.dm-login__inner {
	display: grid;
	grid-template-columns: 1fr;
	gap: 0;
	align-items: stretch;
	width: 100%;
	max-width: 420px;
	border-radius: var(--dm-radius-lg);
	overflow: hidden;
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
}

/* Diaporama de présentation ------------------------------------------------ */

.dm-login__showcase {
	display: none; /* masqué en mobile : le formulaire prime */
	position: relative;
	overflow: hidden;
	background: var(--dm-dark);
	min-height: 460px;
}

.dm-slide {
	position: absolute;
	inset: 0;
	margin: 0;
	opacity: 0;
	transition: opacity 0.6s ease;
	pointer-events: none;
}

.dm-slide.is-active {
	opacity: 1;
	pointer-events: auto;
}

/* Préfixé body.dm-page pour rester au-dessus du reset de thème de base.css. */
body.dm-page .dm-slide__img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
	object-position: center;
}

/* Le padding bas réserve la bande des pastilles : le texte ne peut pas la
   recouvrir, quelle que soit sa longueur. */
body.dm-page .dm-slide__caption {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	padding: var(--dm-space-xl) var(--dm-space-lg) 72px;
	background: linear-gradient(to top, rgba(19, 71, 62, 0.94) 0%, rgba(19, 71, 62, 0.75) 55%, rgba(19, 71, 62, 0) 100%);
	color: var(--dm-neutral);
	text-align: center;
}

.dm-slide__title {
	display: block;
	font-family: Oswald, Montserrat, sans-serif;
	font-size: 1.5rem;
	font-weight: 500;
	line-height: 1.25;
	margin-bottom: var(--dm-space-sm);
}

.dm-slide__text {
	display: block;
	max-width: 34ch;
	margin: 0 auto;
	font-size: 0.9375rem;
	line-height: 1.5;
	color: rgba(255, 255, 255, 0.88);
}

.dm-slide__dots {
	position: absolute;
	left: 0;
	right: 0;
	bottom: var(--dm-space-sm);
	display: flex;
	justify-content: center;
	gap: var(--dm-space-xs);
	z-index: 2;
}

body.dm-page .dm-slide__dot {
	position: relative;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: none;
	box-shadow: none;
	cursor: pointer;
}

body.dm-page .dm-slide__dot:hover,
body.dm-page .dm-slide__dot:focus {
	background: none;
	box-shadow: none;
}

.dm-slide__dot::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 10px;
	height: 10px;
	border-radius: var(--dm-radius-pill);
	background: rgba(255, 255, 255, 0.45);
	transition: background-color 0.2s ease, width 0.2s ease;
}

.dm-slide__dot.is-active::after {
	background: var(--dm-neutral);
	width: 26px;
}

/* Sans image : le dégradé de marque tient lieu de visuel. */
.dm-slide:not(:has(.dm-slide__img)) {
	background: linear-gradient(150deg, #1e7c6e 0%, #13473e 100%);
}

body.dm-page .dm-slide:not(:has(.dm-slide__img)) .dm-slide__caption {
	position: static;
	display: flex;
	flex-direction: column;
	justify-content: center;
	height: 100%;
	background: none;
	box-sizing: border-box;
}

@media (prefers-reduced-motion: reduce) {
	.dm-slide {
		transition: none;
	}
}

.dm-login__logo-link {
	display: inline-block;
	line-height: 0;
}

.dm-login__card {
	width: 100%;
	max-width: 420px;
	padding: var(--dm-space-lg) var(--dm-space-lg) var(--dm-space-md);
	background: var(--dm-neutral);
	text-align: center;
}

body.dm-page .dm-login__logo {
	display: block;
	width: 150px;
	max-width: 60%;
	height: auto;
	margin: 0 auto var(--dm-space-md);
}

.dm-login__card h1 {
	font-size: 1.75rem;
	margin-bottom: var(--dm-space-xs);
}

.dm-login__intro {
	margin: 0 0 var(--dm-space-lg);
	color: var(--dm-muted);
	font-size: 0.9375rem;
}

.dm-login__card .dm-btn {
	margin-top: var(--dm-space-sm);
}

/* Markup natif de wp_login_form() */

#dm-login-form p {
	margin: 0 0 var(--dm-space-md);
	text-align: left;
}

#dm-login-form label {
	display: block;
	margin-bottom: var(--dm-space-xs);
	font-size: 0.875rem;
	font-weight: 600;
}

#dm-login-form input[type="text"],
#dm-login-form input[type="password"] {
	display: block; /* sinon le strut de ligne décale le bouton oeil sous le champ */
	width: 100%;
	min-height: 44px;
	padding: 10px 14px;
	border: 1px solid var(--dm-tertiary);
	border-radius: var(--dm-radius-md);
	font-family: inherit;
	font-size: 1rem;
	box-sizing: border-box;
}

#dm-login-form input:focus {
	border-color: var(--dm-primary);
}

/* La case et son libellé sont dans le même <label> : c'est lui qui porte le
   flex, sinon le texte ne s'aligne pas sur la case. */
#dm-login-form .login-remember {
	font-size: 0.875rem;
}

#dm-login-form .login-remember label {
	display: flex;
	align-items: center;
	gap: var(--dm-space-sm);
	margin: 0;
	font-weight: 400;
	line-height: 1.2;
	cursor: pointer;
}

#dm-login-form .login-remember input {
	flex: 0 0 auto;
	width: 20px;
	height: 20px;
	margin: 0;
}

/* Champ mot de passe : bouton afficher/masquer ----------------------------- */

.dm-pwd {
	position: relative;
	display: block;
}

#dm-login-form .dm-pwd input[type="password"],
#dm-login-form .dm-pwd input[type="text"] {
	padding-right: 52px;
}

body.dm-page .dm-pwd__toggle {
	position: absolute;
	right: 0;
	bottom: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	background: none;
	color: var(--dm-muted);
	cursor: pointer;
}

body.dm-page .dm-pwd__toggle:hover,
body.dm-page .dm-pwd__toggle:focus {
	background: none;
	color: var(--dm-primary);
}

.dm-pwd__toggle svg {
	width: 20px;
	height: 20px;
	display: block;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.8;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.dm-pwd__toggle .dm-pwd__off {
	display: none;
}

.dm-pwd__toggle.is-visible .dm-pwd__on {
	display: none;
}

.dm-pwd__toggle.is-visible .dm-pwd__off {
	display: block;
}

#dm-login-form .login-submit input[type="submit"] {
	display: block;
	width: 100%;
	min-height: 44px;
	padding: 12px 28px;
	border: 0;
	border-radius: var(--dm-radius-pill);
	background: var(--dm-primary);
	color: var(--dm-neutral);
	font-family: inherit;
	font-size: 1rem;
	font-weight: 600;
	cursor: pointer;
	transition: background-color 0.15s ease;
}

#dm-login-form .login-submit input[type="submit"]:hover,
#dm-login-form .login-submit input[type="submit"]:focus {
	background: var(--dm-dark);
}

.dm-login__links {
	margin-top: var(--dm-space-lg);
	padding-top: var(--dm-space-md);
	border-top: 1px solid #e6eae9;
	font-size: 0.875rem;
}

.dm-login__links a {
	display: inline-block;
	min-height: 44px;
	line-height: 44px;
	color: var(--dm-primary);
	text-decoration: underline;
}

/* Spécificité égale au reset mais déclarée après : sans cette règle, le lien
   n'aurait plus aucun retour visuel au survol ni au focus. */
.dm-login__links a:hover,
.dm-login__links a:focus {
	color: var(--dm-dark);
}

@media (min-width: 600px) {
	.dm-login__card {
		padding: var(--dm-space-xl) var(--dm-space-lg) var(--dm-space-lg);
	}
}

/* Deux colonnes : diaporama à gauche, formulaire à droite. */
@media (min-width: 960px) {
	.dm-login__inner {
		grid-template-columns: minmax(320px, 1fr) 420px;
		max-width: 960px;
	}

	.dm-login__showcase {
		display: block;
	}

	.dm-login__card {
		max-width: none;
		align-self: stretch;
		display: flex;
		flex-direction: column;
		justify-content: center;
	}
}
