:root {
	--lm-auth-bg: #080706;
	--lm-auth-panel: rgba(17, 13, 11, 0.88);
	--lm-auth-panel-solid: #110d0b;
	--lm-auth-line: rgba(240, 232, 219, 0.1);
}

body.lm-auth-page {
	background: var(--lm-auth-bg);
	overflow-x: clip;
}

.lm-auth-page #main-content {
	display: block;
	overflow: visible;
}

.lm-auth-page .footer {
	position: relative;
	border-top: 1px solid rgba(237, 42, 28, 0.16);
	background: #070605;
	z-index: 2;
}

/* ============ Sección raíz ============ */
.lm-auth {
	position: relative;
	width: 100%;
	min-height: 100vh;
	padding: clamp(132px, 10vw, 164px) clamp(22px, 5vw, 86px) 140px;
	background:
		radial-gradient(circle at 84% 9%, rgba(181, 25, 17, 0.16), transparent 27%),
		radial-gradient(circle at 10% 46%, rgba(112, 14, 10, 0.1), transparent 30%),
		linear-gradient(180deg, #0d0908 0%, var(--lm-auth-bg) 34%, #090706 100%);
	color: var(--lm-ivory);
	isolation: isolate;
}

.lm-auth::before {
	content: '';
	position: absolute;
	inset: 0;
	background-image:
		linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
		linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
	background-size: 88px 88px;
	mask-image: linear-gradient(to bottom, #000, transparent 76%);
	pointer-events: none;
	z-index: -2;
}

.lm-auth::after {
	content: '';
	position: absolute;
	left: clamp(22px, 5vw, 86px);
	right: clamp(22px, 5vw, 86px);
	top: 0;
	height: 1px;
	background: linear-gradient(90deg, transparent, rgba(237, 42, 28, 0.72), transparent);
	pointer-events: none;
}

/* ============ Ambient ============ */
.lm-auth__ambient {
	position: absolute;
	right: -8vw;
	top: 96px;
	width: min(620px, 46vw);
	aspect-ratio: 1;
	border: 1px solid rgba(237, 42, 28, 0.07);
	border-radius: 50%;
	box-shadow:
		0 0 0 76px rgba(237, 42, 28, 0.023),
		0 0 0 152px rgba(237, 42, 28, 0.014);
	pointer-events: none;
	z-index: -1;
}

.lm-auth__ambient::before {
	content: '';
	position: absolute;
	inset: 13%;
	background: url('../img/logo.webp') center / contain no-repeat;
	background: image-set(url('../img/logo.avif') type('image/avif') 1x, url('../img/logo.webp') type('image/webp') 1x) center / contain no-repeat;
	filter: grayscale(1) brightness(1.18) contrast(0.88);
	mix-blend-mode: luminosity;
	opacity: 0.06;
}

/* ============ Layout ============ */
.lm-auth__layout {
	width: min(440px, 100%);
	margin-inline: auto;
}

/* ============ Header ============ */
.lm-auth__header {
	margin-bottom: clamp(32px, 4vw, 44px);
	text-align: center;
}

.lm-auth__kicker {
	display: block;
	color: var(--lm-red-bright);
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.22em;
	text-transform: uppercase;
}

.lm-auth__header h1 {
	margin: 14px 0 0;
	color: var(--lm-ivory);
	font-family: var(--lm-serif);
	font-size: clamp(38px, 5vw, 62px);
	font-weight: 600;
	letter-spacing: -0.03em;
	line-height: 1;
}

.lm-auth__header::after {
	content: '';
	display: block;
	width: 64px;
	height: 2px;
	margin: 22px auto 0;
	background: linear-gradient(90deg, transparent, var(--lm-red-bright), transparent);
	opacity: 0.6;
}

/* ============ Card ============ */
.lm-auth__card {
	position: relative;
	padding: clamp(26px, 3.4vw, 42px);
	border-top: 2px solid var(--lm-red-bright);
	border-right: 1px solid var(--lm-auth-line);
	border-bottom: 1px solid var(--lm-auth-line);
	border-left: 1px solid var(--lm-auth-line);
	background:
		linear-gradient(145deg, rgba(255, 255, 255, 0.025), transparent 38%),
		var(--lm-auth-panel);
	box-shadow: 0 28px 70px rgba(0, 0, 0, 0.3);
	backdrop-filter: blur(18px);
}

.lm-auth__card form {
	margin: 0;
}

/* ============ Campos ============ */
.lm-auth__field {
	margin-bottom: 24px;
}

.lm-auth__field>label {
	display: block;
	margin-bottom: 8px;
	color: rgba(240, 232, 219, 0.72);
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.lm-auth__control {
	position: relative;
}

.lm-auth__control i {
	position: absolute;
	left: 16px;
	top: 50%;
	transform: translateY(-50%);
	color: rgba(237, 42, 28, 0.72);
	font-size: 13px;
	pointer-events: none;
	z-index: 2;
}

.lm-auth__control .form-control {
	height: 52px;
	padding: 0 16px 0 44px;
	border: 1px solid rgba(240, 232, 219, 0.16);
	border-radius: 0;
	background: rgba(0, 0, 0, 0.28);
	color: var(--lm-ivory);
	font-family: var(--lm-display);
	font-size: 16px;
	font-weight: 500;
	transition: border-color 200ms ease, background-color 200ms ease, box-shadow 200ms ease;
}

.lm-auth__control .form-control::placeholder {
	color: rgba(240, 232, 219, 0.32);
	font-weight: 400;
}

.lm-auth__control .form-control:focus {
	border-color: var(--lm-red-bright);
	background: rgba(0, 0, 0, 0.4);
	box-shadow: 0 0 0 3px rgba(237, 42, 28, 0.12);
	outline: none;
}

.lm-auth__control .form-control.is-invalid,
.lm-auth__card .was-validated .form-control:invalid {
	border-color: var(--lm-red-bright);
}

.lm-auth__hint {
	display: block;
	margin-top: 7px;
	font-family: 'Montserrat', sans-serif;
	font-size: 11px;
	letter-spacing: 0.02em;
}

/* ============ Divisores ============ */
.lm-auth__divider {
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	align-items: center;
	gap: 16px;
	margin: 30px 0 22px;
	color: rgba(240, 232, 219, 0.4);
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.18em;
	text-transform: uppercase;
}

.lm-auth__divider::before,
.lm-auth__divider::after {
	content: '';
	height: 1px;
	background: var(--lm-auth-line);
}

/* ============ Fila extra (login) ============ */
.lm-auth__row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-top: -6px;
	margin-bottom: 22px;
}

.lm-auth__forgot {
	color: rgba(240, 232, 219, 0.55);
	font-size: 12px;
	text-decoration: none;
	transition: color 200ms ease;
}

.lm-auth__forgot:hover {
	color: var(--lm-red-bright);
}

/* ============ reCaptcha ============ */
.lm-auth__recaptcha {
	display: flex;
	justify-content: center;
	margin-bottom: 8px;
}

/* ============ Reglamento ============ */
.lm-auth__check {
	margin: 14px 0 26px;
	padding-left: 1.6em;
}

.lm-auth__check .form-check-label {
	color: rgba(240, 232, 219, 0.62);
	font-family: 'Montserrat', sans-serif;
	font-size: 12px;
	line-height: 1.5;
}

.lm-auth__check .form-check-label a {
	color: var(--lm-red-bright);
	text-decoration: none;
}

.lm-auth__check .form-check-input {
	border: 1px solid rgba(240, 232, 219, 0.28);
	border-radius: 0;
	background: transparent;
}

.lm-auth__check .form-check-input:checked {
	border-color: var(--lm-red-bright);
	background-color: var(--lm-red-bright);
}

.lm-auth__check .form-check-input:focus {
	border-color: var(--lm-red-bright);
	box-shadow: none;
}

/* ============ Botón ============ */
.lm-auth__btn {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 16px;
	align-items: center;
	width: 100%;
	min-height: 54px;
	padding: 0 22px;
	border: 1px solid rgba(237, 42, 28, 0.6);
	background:
		linear-gradient(90deg, rgba(183, 25, 18, 0.35), rgba(183, 25, 18, 0.12)),
		rgba(0, 0, 0, 0.2);
	color: var(--lm-ivory);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-align: center;
	text-transform: uppercase;
	cursor: pointer;
	transition: border-color 200ms ease, background-color 200ms ease, box-shadow 200ms ease;
}

.lm-auth__btn i {
	font-size: 12px;
}

.lm-auth__btn:hover,
.lm-auth__btn:focus-visible {
	border-color: var(--lm-red-bright);
	background:
		linear-gradient(90deg, rgba(183, 25, 18, 0.55), rgba(183, 25, 18, 0.2)),
		rgba(0, 0, 0, 0.24);
	box-shadow: 0 0 0 3px rgba(237, 42, 28, 0.14);
	outline: none;
}

/* Mensajes de error (WebEngine) */
.lm-auth__card .alert {
	margin: 0 0 24px;
	padding: 14px 16px;
	border: 1px solid rgba(237, 42, 28, 0.35);
	border-left: 3px solid rgba(237, 42, 28, 0.9);
	border-radius: 0;
	background: linear-gradient(90deg, rgba(183, 25, 18, 0.16), rgba(13, 10, 9, 0.42));
	color: var(--lm-ivory);
	font-family: 'Montserrat', sans-serif;
	font-size: 12px;
	line-height: 1.55;
	letter-spacing: 0.02em;
}

.lm-auth__card .alert i {
	margin-right: 8px;
	color: rgba(237, 42, 28, 0.9);
}

/* Mensajes emitidos fuera de la card (success de registro, módulo
   deshabilitado, etc.): se reposicionan para quedar visibles debajo
   del navbar fijo en vez de ocultarse bajo él. */
.lm-auth-page #main-content > .alert {
	margin: 96px auto 0;
	padding: 16px 22px;
	width: min(440px, calc(100% - 44px));
	border: 1px solid var(--lm-auth-line);
	border-left: 3px solid rgba(237, 42, 28, 0.9);
	border-radius: 0;
	background: linear-gradient(90deg, rgba(183, 25, 18, 0.14), rgba(13, 10, 9, 0.42));
	color: var(--lm-ivory);
	font-family: 'Montserrat', sans-serif;
	font-size: 13px;
	line-height: 1.55;
	letter-spacing: 0.02em;
}

.lm-auth-page #main-content > .alert-success {
	border-left-color: rgba(85, 214, 101, 0.9);
	border-color: rgba(85, 214, 101, 0.35);
	background: linear-gradient(90deg, rgba(85, 214, 101, 0.1), rgba(13, 10, 9, 0.42));
}

.lm-auth-page #main-content > .alert-warning {
	border-left-color: rgba(240, 173, 78, 0.9);
	border-color: rgba(240, 173, 78, 0.35);
	background: linear-gradient(90deg, rgba(240, 173, 78, 0.12), rgba(13, 10, 9, 0.42));
}

/* ============ Reveal ============ */
html.js [data-auth-reveal] {
	transition:
		opacity 700ms cubic-bezier(0.22, 0.75, 0.2, 1),
		transform 700ms cubic-bezier(0.22, 0.75, 0.2, 1);
}

html.js body.lm-auth-entering .lm-auth__layout [data-auth-reveal] {
	opacity: 0;
	transform: translateY(26px);
}

html.js .lm-auth__layout>[data-auth-reveal]:nth-child(2) {
	transition-delay: 120ms;
}

html.js .lm-auth__layout>[data-auth-reveal]:nth-child(3) {
	transition-delay: 240ms;
}

@media (prefers-reduced-motion: reduce) {
	html.js [data-auth-reveal] {
		transition: none;
	}

	html.js body.lm-auth-entering .lm-auth__layout [data-auth-reveal] {
		opacity: 1;
		transform: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	html.js .lm-auth__layout>[data-auth-reveal] {
		transition-delay: 0ms;
	}
}

/* ============ Responsive ============ */
@media (max-width: 768px) {
	.lm-inner-page .lm-brand-orbit {
		left: 50%;
		top: 47px;
		width: 86px;
	}

	.lm-auth {
		padding-top: 124px;
		padding-bottom: 92px;
	}

	.lm-auth__layout {
		width: min(400px, 100%);
	}
}

@media (max-width: 560px) {
	.lm-auth__card {
		padding: 24px 20px;
	}
}