/*
 * Capa de integración con WordPress.
 * app.css es el CSS del prototipo, intacto. Aquí solo se neutraliza el tema
 * y se añaden las piezas que el prototipo no tenía (login, barra de usuario,
 * aviso de demo), usando su misma paleta.
 */

/* --- El portal ocupa la ventana completa: el tema no debe enmarcarlo. ---- */
body.espla-portal {
	margin: 0;
	padding: 0;
	background: var(--gray-lt);
	font-family: 'Inter', Arial, sans-serif;
	color: var(--ink);
	font-size: 14px;
}

body.espla-portal #page,
body.espla-portal .site,
body.espla-portal .site-content,
body.espla-portal .entry-content,
body.espla-portal .wp-site-blocks,
body.espla-portal main {
	max-width: none;
	width: auto;
	margin: 0;
	padding: 0;
}

body.espla-portal .site-header,
body.espla-portal .site-footer,
body.espla-portal .entry-header,
body.espla-portal .wp-block-template-part,
body.espla-portal .entry-title {
	display: none !important;
}

.espla-app {
	display: flex;
	flex-direction: column;
	min-height: 100vh;
}

.espla-app #host {
	flex: 1;
	min-height: 0;
	display: flex;
	flex-direction: column;
}

/* --- Aviso permanente de entorno de demostración. ------------------------ */
.espla-demo-bar {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
	background: var(--red-lt);
	border-bottom: 2px solid var(--red);
	color: #8c0d13;
	font-size: .78rem;
	padding: 9px 26px;
	line-height: 1.4;
}

.espla-demo-bar strong {
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: .03em;
}

/* --- Usuario y salida, dentro de la barra superior del prototipo. -------- */
.espla-user {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-left: auto;
	font-size: .78rem;
	color: #fff;
}

.espla-user-name {
	font-weight: 600;
	opacity: .95;
	white-space: nowrap;
}

.espla-logout {
	color: #fff;
	text-decoration: none;
	font-weight: 700;
	border: 1px solid rgba(255, 255, 255, .5);
	border-radius: 8px;
	padding: 5px 11px;
	white-space: nowrap;
}

.espla-logout:hover {
	background: rgba(255, 255, 255, .16);
	color: #fff;
}

/* El reloj deja de empujar a la derecha: ahora lo hace .espla-user. */
.espla-app .clock {
	margin-left: 0;
}

/* --- Estado de carga y sin JS. ------------------------------------------ */
.espla-cargando,
.espla-noscript {
	margin: 40px auto;
	padding: 22px 26px;
	max-width: 420px;
	text-align: center;
	color: var(--gray);
	background: #fff;
	border: 1px solid var(--line);
	border-radius: 14px;
}

/* --- Login y pantallas de acceso. --------------------------------------- */
.espla-gate {
	min-height: 70vh;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 40px 16px;
	background: var(--gray-lt);
}

.espla-gate-box {
	width: 100%;
	max-width: 380px;
	background: #fff;
	border: 1px solid var(--line);
	border-radius: 16px;
	padding: 30px 28px;
	box-shadow: 0 4px 18px rgba(24, 95, 165, .10);
}

.espla-gate-brand {
	font-weight: 800;
	font-size: 1.15rem;
	color: var(--navy);
	margin-bottom: 8px;
}

.espla-gate-brand b {
	color: var(--red);
}

.espla-gate-text {
	color: var(--gray);
	font-size: .86rem;
	line-height: 1.5;
	margin: 0 0 18px;
}

.espla-gate .login-username,
.espla-gate .login-password {
	margin-bottom: 12px;
}

.espla-gate label {
	display: block;
	font-size: .76rem;
	font-weight: 700;
	color: var(--navy);
	margin-bottom: 5px;
}

.espla-gate input[type="text"],
.espla-gate input[type="password"] {
	width: 100%;
	font: inherit;
	padding: 10px 12px;
	border: 1px solid var(--line);
	border-radius: 10px;
	background: #fff;
	color: var(--ink);
}

.espla-gate input:focus {
	outline: none;
	border-color: var(--navy);
	box-shadow: 0 0 0 3px var(--blue-lt);
}

.espla-gate .login-remember {
	font-size: .78rem;
	color: var(--gray);
	margin-bottom: 14px;
}

.espla-gate .login-remember label {
	display: inline;
	font-weight: 400;
	color: var(--gray);
}

.espla-gate input[type="submit"] {
	width: 100%;
	font: inherit;
	font-weight: 700;
	background: var(--navy);
	color: #fff;
	border: none;
	border-radius: 10px;
	padding: 11px 16px;
	cursor: pointer;
}

.espla-gate input[type="submit"]:hover {
	background: var(--blue-dk);
}

.espla-gate-link {
	display: inline-block;
	margin-top: 14px;
	font-size: .78rem;
	color: var(--navy);
	text-decoration: none;
}

.espla-gate-link:hover {
	text-decoration: underline;
}

/* --- Móvil. ------------------------------------------------------------- */
@media (max-width: 640px) {
	.espla-demo-bar {
		padding: 9px 16px;
		font-size: .72rem;
	}

	.espla-user {
		margin-left: 0;
		width: 100%;
		justify-content: flex-end;
	}
}

/* --- Pie del menú lateral (reseteo de la demo). --------------------------- */
.espla-side-pie {
	margin-top: auto;
	padding: 14px 10px 4px;
	border-top: 1px solid var(--line);
}

.espla-side-pie .btn {
	width: 100%;
}
