/*
 * BM Penca — wp-login.php styles.
 *
 * Replaces WP's default blue/grey login page with the same visual language
 * as the site: primary #162883, accent #e20019, warm off-white background,
 * Barlow Condensed display font, Inter body font.
 */

/* ── Page shell ───────────────────────────────────────────────── */
body.login {
	background-color: #162883;
	/* background-image: inyectada vía wp_add_inline_style desde la biblioteca de medios */
	background-size: cover;
	background-position: center center;
	background-repeat: no-repeat;
	background-attachment: fixed;
	font-family: "Inter", system-ui, -apple-system, sans-serif;
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
}

/* ── Hide native WP logo <h1> — replaced by .bm-login-header ─── */
.login h1 {
	display: none !important;
}

/* ── Branded header panel (injected via login_header action) ──── */
/* login_header fires before <div id="login">, so it's a sibling.
 * Give it the same width + centering as #login and zero bottom margin
 * so the card sits flush below. */
.bm-login-header {
	width: 340px;
	max-width: calc(100% - 32px);
	margin: 6% auto 0;
	background-color: #162883;
	border-radius: 12px 12px 0 0;
	padding: 20px 28px;
	border-bottom: 4px solid #e20019;
	box-sizing: border-box;
	display: flex;
	justify-content: center;
	align-items: center;
}
.bm-login-header__logo {
	display: block;
	max-width: 100%;
	height: auto;
}

/* ── Card ─────────────────────────────────────────────────────── */
#loginform,
#registerform,
#lostpasswordform,
#resetpassform,
.login form {
	border: none !important;
	border-radius: 0 !important;
	box-shadow: none !important;
	padding: 8px 0 4px !important;
	background: transparent !important;
	margin-top: 0 !important;
}

/* ── Labels ───────────────────────────────────────────────────── */
.login label {
	font-size: 12px !important;
	font-weight: 600 !important;
	color: #3b4055 !important;
	letter-spacing: 0.03em;
	text-transform: uppercase;
}

/* ── Inputs ───────────────────────────────────────────────────── */
.login input[type="text"],
.login input[type="email"],
.login input[type="password"] {
	border: 1.5px solid #e4e1d8 !important;
	border-radius: 8px !important;
	padding: 10px 14px !important;
	font-size: 15px !important;
	font-family: "Inter", sans-serif !important;
	color: #141622 !important;
	background: #fff !important;
	box-shadow: none !important;
	transition: border-color 0.15s;
	height: auto !important;
}
.login input[type="text"]:focus,
.login input[type="email"]:focus,
.login input[type="password"]:focus {
	border-color: #162883 !important;
	box-shadow: 0 0 0 3px rgba(22, 40, 131, 0.10) !important;
	outline: none !important;
}

/* ── Submit button ────────────────────────────────────────────── */
.login .button-primary,
.login input[type="submit"] {
	background: #e20019 !important;
	border: none !important;
	border-radius: 8px !important;
	padding: 12px 28px !important;
	font-family: "Barlow Condensed", "Arial Narrow", Arial, sans-serif !important;
	font-size: 16px !important;
	font-weight: 700 !important;
	letter-spacing: 0.06em !important;
	text-transform: uppercase !important;
	color: #fff !important;
	box-shadow: none !important;
	height: auto !important;
	line-height: 1.3 !important;
	transition: background 0.15s, transform 0.1s;
	width: 100%;
	display: block;
}
.login .button-primary:hover,
.login input[type="submit"]:hover {
	background: #b5001a !important;
	transform: translateY(-1px);
}
.login .button-primary:active,
.login input[type="submit"]:active {
	transform: translateY(0);
}

/* ── "Remember me" checkbox ───────────────────────────────────── */
.login .forgetmenot {
	margin-top: 4px;
}
.login .forgetmenot label {
	font-size: 13px !important;
	text-transform: none !important;
	letter-spacing: 0 !important;
	color: #6b6f82 !important;
	font-weight: 400 !important;
}

/* ── Nav links (Lost password / Back to login) ────────────────── */
#nav,
#backtoblog {
	text-align: center;
	margin-top: 14px;
}
#nav a,
#backtoblog a {
	color: #162883 !important;
	font-size: 13px;
	text-decoration: none;
}
#nav a:hover,
#backtoblog a:hover {
	color: #e20019 !important;
	text-decoration: underline;
}
/* "Registro" is the first link in #nav — make it stand out as a button */
#nav a:first-child {
	display: inline-block;
	background-color: #162883;
	color: #fff !important;
	font-family: "Barlow Condensed", "Arial Narrow", Arial, sans-serif;
	font-size: 16px;
	font-weight: 700;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	padding: 10px 28px;
	border-radius: 8px;
	margin-bottom: 10px;
	text-decoration: none !important;
	transition: background 0.15s;
}
#nav a:first-child:hover {
	background-color: #0f1c5e !important;
	color: #fff !important;
	text-decoration: none !important;
}
/* Separator "|" between links — hide it and put the second link on its own line */
#nav {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
	font-size: 0 !important; /* hides the plain-text "|" node — WP core overrides without !important */
}
#nav a {
	font-size: 13px !important; /* restore for actual links */
}

/* ── Error / message notices ──────────────────────────────────── */

/* Error box — subtle inset card inside the unified #login card */
.login #login_error {
	border-radius: 8px !important;
	border: 1px solid rgba(226, 0, 25, 0.22) !important;
	border-left: 4px solid #e20019 !important;
	background: #fff7f7 !important;
	color: #141622 !important;
	font-family: "Inter", sans-serif !important;
	font-size: 13px !important;
	line-height: 1.55 !important;
	margin-bottom: 16px !important;
	padding: 12px 14px !important;
	box-shadow: none !important;
}
.login #login_error a {
	color: #162883 !important;
}
.login #login_error strong {
	color: #e20019 !important;
	font-weight: 600 !important;
}

/* Instruction / confirmation messages — readable body text */
.login .message {
	border: none !important;
	border-radius: 0 !important;
	background: transparent !important;
	box-shadow: none !important;
	padding: 12px 16px 16px !important;
	margin: 0 !important;
	text-align: center;
	font-family: "Inter", sans-serif !important;
	font-size: 14px !important;
	font-weight: 400 !important;
	letter-spacing: 0 !important;
	color: #6b6f82 !important;
	text-transform: none !important;
	line-height: 1.6 !important;
}
/* Inside a form, left-align (e.g. "Recibirás confirmación del registro...") */
.login form .message {
	text-align: left !important;
	padding-left: 0 !important;
	padding-right: 0 !important;
}
/* Registration page: heading "Regístrate en este sitio" — direct child of #login */
.login-action-register #login > .message {
	font-family: "Barlow Condensed", "Arial Narrow", Arial, sans-serif !important;
	font-size: 20px !important;
	font-weight: 700 !important;
	letter-spacing: 0.04em !important;
	color: #162883 !important;
	text-transform: none !important;
	padding: 8px 16px 14px !important;
}

/* Success notice — same inset style with blue accent */
.login .success {
	border-radius: 8px !important;
	border: 1px solid rgba(22, 40, 131, 0.18) !important;
	border-left: 4px solid #162883 !important;
	background: #f0f2fa !important;
	color: #141622 !important;
	font-family: "Inter", sans-serif !important;
	font-size: 13px !important;
	line-height: 1.55 !important;
	margin-bottom: 16px !important;
	padding: 12px 14px !important;
	box-shadow: none !important;
}

/* ── #login container — the unified card ─────────────────────── */
#login {
	width: 340px !important;
	padding: 20px 28px 24px !important;
	margin-top: 0 !important;
	background: #fff !important;
	border-radius: 0 0 12px 12px !important;
	box-shadow: 0 6px 24px rgba(14, 20, 54, 0.09) !important;
	box-sizing: border-box !important;
}

/* ── Footer ───────────────────────────────────────────────────── */
.login #backtoblog {
	margin-top: 20px;
}

/* ── Hide language switcher (CSS fallback — filter handles it server-side) ── */
.login .language-switcher,
#login .language-switcher,
.login #language-switcher,
.login .wp-login-language-switcher {
	display: none !important;
}

/* ── Ocultar botón OAuth original del plugin ─────────────────── */
.mo_oauth_login_button,
.login .row,
.login #loginform h4 {
	display: none !important;
}

/* ── Heading BM (inyectado por JS) ──────────────────────────── */
.bm-oauth-heading {
	margin: 0 0 12px;
	padding: 0;
	font-family: "Barlow Condensed", "Arial Narrow", Arial, sans-serif;
	font-size: 18px;
	font-weight: 700;
	letter-spacing: 0.03em;
	line-height: 1.25;
	color: #162883;
	text-align: center;
	text-transform: none;
}

/* ── Botón BM custom (inyectado por JS) ──────────────────────── */
.bm-oauth-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	width: 100%;
	padding: 13px 20px;
	margin-bottom: 20px;
	background: #162883;
	color: #fff;
	border: none;
	border-radius: 10px;
	font-family: "Barlow Condensed", "Arial Narrow", Arial, sans-serif;
	font-size: 17px;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	cursor: pointer;
	box-shadow: 0 4px 16px rgba(22, 40, 131, 0.28);
	transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
}
.bm-oauth-btn:hover {
	background: #0f1d6b;
	box-shadow: 0 6px 20px rgba(22, 40, 131, 0.38);
}
.bm-oauth-btn:active {
	transform: scale(0.97);
}
.bm-oauth-btn svg {
	flex-shrink: 0;
}

/* ── Responsive — pantallas pequeñas ────────────────────────── */
@media (max-width: 480px) {
	body.login {
		background-size: auto 100%;
		background-position: center center;
		justify-content: flex-start;
		padding-top: 16px;
	}

	.bm-login-header {
		width: calc(100% - 32px) !important;
		max-width: 100% !important;
		margin: 0 16px !important;
		padding: 16px 20px !important;
	}

	#login {
		width: calc(100% - 32px) !important;
		padding: 16px 20px 20px !important;
		margin: 0 16px !important;
		border-radius: 0 0 12px 12px !important;
	}

	.bm-oauth-heading {
		font-size: 16px;
	}

	.bm-oauth-btn {
		font-size: 15px;
		padding: 12px 16px;
	}

	.login #backtoblog,
	.login #nav {
		text-align: center;
		padding: 0 16px;
	}
}
