/* ==========================================================================
   Infomatika - Login del panel de administracion
   Hoja independiente: solo la usa /admin/vistas/index.htm (index.php y cambiopass.php).
   Convive con bootstrap.min.css (v3.1) y font-awesome. No depende de sb-admin.css.
   ========================================================================== */

:root {
	--lg-brand: #4c57a3;
	--lg-brand-deep: #2f3a7d;
	--lg-brand-ink: #1c2350;
	--lg-brand-soft: #eef0fa;
	--lg-brand-ring: rgba(76, 87, 163, 0.22);

	--lg-ink: #1f2140;
	--lg-muted: #6b6f8a;
	--lg-line: #e1e3ee;
	--lg-line-strong: #c9cce0;
	--lg-surface: #ffffff;
	--lg-surface-alt: #f7f8fc;

	--lg-danger: #c62e21;
	--lg-danger-bg: #fdecea;
	--lg-danger-line: #f3b6b0;

	--lg-facebook: #1877f2;

	--lg-radius-xl: 22px;
	--lg-radius: 14px;
	--lg-radius-sm: 10px;

	--lg-shadow-card: 0 30px 60px -20px rgba(14, 18, 60, 0.55), 0 12px 24px -12px rgba(14, 18, 60, 0.35);
	--lg-shadow-soft: 0 10px 30px -12px rgba(14, 18, 60, 0.35);

	--lg-font: "Nunito", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

	--lg-ease: cubic-bezier(0.16, 1, 0.3, 1);
	--lg-fast: 150ms;
	--lg-normal: 320ms;
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */

html.login-html {
	height: 100%;
	-webkit-text-size-adjust: 100%;
}

body.login-body {
	min-height: 100vh;
	min-height: 100dvh;
	margin: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 24px 16px;
	font-family: var(--lg-font);
	font-size: 15px;
	line-height: 1.5;
	color: var(--lg-ink);
	background-color: var(--lg-brand-deep);
	background-image:
		radial-gradient(1100px 700px at 8% 0%, rgba(120, 132, 220, 0.55), transparent 60%),
		radial-gradient(900px 600px at 100% 100%, rgba(30, 40, 110, 0.9), transparent 60%),
		linear-gradient(160deg, #545fae 0%, var(--lg-brand) 45%, var(--lg-brand-deep) 100%);
	background-attachment: fixed;
}

/* Grano sutil sobre el fondo, sin imagenes externas */
body.login-body::before {
	content: "";
	position: fixed;
	inset: 0;
	pointer-events: none;
	opacity: 0.35;
	background-image:
		repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 3px),
		repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.03) 0 1px, transparent 1px 3px);
	mix-blend-mode: overlay;
}

.login-body a {
	color: var(--lg-brand);
}
.login-body a:hover,
.login-body a:focus {
	color: var(--lg-brand-deep);
	text-decoration: underline;
}

/* --------------------------------------------------------------------------
   Shell y tarjeta
   -------------------------------------------------------------------------- */

.lg-shell {
	position: relative;
	width: 100%;
	max-width: 1040px;
	z-index: 1;
}

.lg-card {
	display: grid;
	grid-template-columns: 1fr;
	background: var(--lg-surface);
	border-radius: var(--lg-radius-xl);
	box-shadow: var(--lg-shadow-card);
	overflow: hidden;
	animation: lg-rise var(--lg-normal) var(--lg-ease) both;
}

@keyframes lg-rise {
	from {
		opacity: 0;
		transform: translateY(14px) scale(0.985);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

/* --------------------------------------------------------------------------
   Panel de marca (logo del instituto)
   -------------------------------------------------------------------------- */

.lg-brand {
	position: relative;
	display: flex;
	align-items: center;
	gap: 16px;
	padding: 20px 22px;
	color: #fff;
	background-color: var(--lg-brand-deep);
	background-position: center;
	background-size: cover;
	isolation: isolate;
}

/* Velo de marca sobre la foto: la imagen es textura, el color manda */
.lg-brand::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background:
		linear-gradient(135deg, rgba(76, 87, 163, 0.92) 0%, rgba(47, 58, 125, 0.86) 60%, rgba(28, 35, 80, 0.94) 100%);
}

.lg-brand::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	pointer-events: none;
	background: radial-gradient(420px 260px at 20% 0%, rgba(255, 255, 255, 0.16), transparent 70%);
}

.lg-brand-logo {
	flex: 0 0 auto;
	width: 64px;
	height: 64px;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 6px;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 10px 24px -10px rgba(0, 0, 0, 0.6), 0 0 0 4px rgba(255, 255, 255, 0.14);
	overflow: hidden;
}

.lg-brand-logo img {
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	object-fit: contain;
	display: block;
}

.lg-brand-text {
	min-width: 0;
}

.lg-brand-eyebrow {
	margin: 0 0 2px;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: rgba(255, 255, 255, 0.72);
}

.login-body .lg-brand h1 {
	margin: 0;
	font-size: 18px;
	line-height: 1.2;
	font-weight: 800;
	color: #fff;
	letter-spacing: -0.01em;
	overflow-wrap: anywhere;
}

/* --------------------------------------------------------------------------
   Panel del formulario
   -------------------------------------------------------------------------- */

.lg-panel {
	display: flex;
	flex-direction: column;
	padding: 28px 22px 22px;
}

.lg-panel-body {
	flex: 1 1 auto;
}

.lg-title {
	margin: 0 0 22px;
	font-size: 22px;
	line-height: 1.2;
	font-weight: 800;
	letter-spacing: -0.015em;
	color: var(--lg-ink);
}

.lg-lead {
	margin: 0 0 18px;
	font-size: 15px;
	color: var(--lg-muted);
}

/* Alertas (sobre .alert de Bootstrap 3) */
.login-body .alert {
	position: relative;
	margin: 0 0 18px;
	padding: 12px 14px 12px 40px;
	border: 1px solid var(--lg-danger-line);
	border-radius: var(--lg-radius-sm);
	background: var(--lg-danger-bg);
	color: #7a1d15;
	font-size: 14px;
	line-height: 1.45;
}
.login-body .alert::before {
	content: "\f071";
	font-family: "Font Awesome 5 Free";
	font-weight: 900;
	position: absolute;
	left: 14px;
	top: 12px;
	color: var(--lg-danger);
}
.login-body .alert strong {
	font-weight: 800;
}
.login-body .alert br + br {
	display: none;
}

/* Campos */
.login-body fieldset {
	margin: 0;
	padding: 0;
	border: 0;
	min-width: 0;
}

.lg-field {
	margin-bottom: 16px;
}

.login-body .lg-field label {
	display: block;
	margin: 0 0 6px 2px;
	font-size: 12px;
	font-weight: 800;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--lg-muted);
}

.lg-control {
	position: relative;
}

.lg-control > .lg-icon {
	position: absolute;
	left: 16px;
	top: 50%;
	transform: translateY(-50%);
	font-size: 15px;
	color: var(--lg-muted);
	pointer-events: none;
	transition: color var(--lg-fast) ease;
}

.login-body .form-control {
	display: block;
	width: 100%;
	height: 52px;
	padding: 0 16px 0 46px;
	font-family: inherit;
	font-size: 16px; /* evita el zoom automatico en iOS */
	line-height: 50px;
	color: var(--lg-ink);
	background: var(--lg-surface);
	border: 1.5px solid var(--lg-line);
	border-radius: var(--lg-radius);
	box-shadow: none;
	transition: border-color var(--lg-fast) ease, box-shadow var(--lg-fast) ease, background-color var(--lg-fast) ease;
	-webkit-appearance: none;
	appearance: none;
}
.login-body .form-control::placeholder {
	color: #a4a7bd;
	opacity: 1;
}
.login-body .form-control:hover {
	border-color: var(--lg-line-strong);
}
.login-body .form-control:focus {
	outline: none;
	border-color: var(--lg-brand);
	box-shadow: 0 0 0 4px var(--lg-brand-ring);
}
.lg-control:focus-within > .lg-icon {
	color: var(--lg-brand);
}
.login-body .form-control[disabled] {
	background: var(--lg-surface-alt);
	color: var(--lg-muted);
	cursor: not-allowed;
}

/* Campo marcado como requerido por VerificarForm() */
.login-body .form-control.campoRequerido {
	border-color: var(--lg-danger);
}
.login-body .form-control.campoRequerido:focus {
	box-shadow: 0 0 0 4px rgba(198, 46, 33, 0.18);
}

/* Campos sin icono (cambio de contrasena) */
.lg-control.lg-control-plain .form-control {
	padding-left: 16px;
}

/* Boton "ver contrasena" */
.lg-eye {
	position: absolute;
	right: 6px;
	top: 50%;
	transform: translateY(-50%);
	width: 40px;
	height: 40px;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--lg-muted);
	cursor: pointer;
	transition: background-color var(--lg-fast) ease, color var(--lg-fast) ease;
}
.lg-eye:hover,
.lg-eye:focus-visible {
	background: var(--lg-brand-soft);
	color: var(--lg-brand);
	outline: none;
}
.lg-eye:focus-visible {
	box-shadow: 0 0 0 3px var(--lg-brand-ring);
}
.lg-control.has-eye .form-control {
	padding-right: 52px;
}

/* Select del espacio de trabajo */
.login-body select.form-control {
	padding-left: 16px;
	padding-right: 44px;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%236b6f8a' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round' d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 16px center;
	cursor: pointer;
}

/* Boton principal */
.login-body .lg-btn {
	display: flex;
	width: 100%;
	min-height: 52px;
	align-items: center;
	justify-content: center;
	gap: 10px;
	margin: 6px 0 0;
	padding: 12px 18px;
	font-family: inherit;
	font-size: 16px;
	line-height: 1.25;
	font-weight: 800;
	letter-spacing: 0.01em;
	text-align: center;
	color: #fff;
	background: linear-gradient(180deg, #5763b3 0%, var(--lg-brand) 100%);
	border: 0;
	border-radius: var(--lg-radius);
	box-shadow: 0 10px 22px -10px rgba(76, 87, 163, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.18);
	cursor: pointer;
	transition: transform var(--lg-fast) ease, box-shadow var(--lg-fast) ease, filter var(--lg-fast) ease;
}
.login-body .lg-btn:hover {
	filter: brightness(1.06);
	transform: translateY(-1px);
	box-shadow: 0 14px 26px -10px rgba(76, 87, 163, 0.95), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.login-body .lg-btn:active {
	transform: translateY(0) scale(0.99);
	filter: brightness(0.98);
}
.login-body .lg-btn:focus-visible {
	outline: none;
	box-shadow: 0 0 0 4px var(--lg-brand-ring), 0 10px 22px -10px rgba(76, 87, 163, 0.9);
}
.login-body .lg-btn[disabled] {
	cursor: not-allowed;
	filter: grayscale(0.4);
	opacity: 0.6;
	transform: none;
	box-shadow: none;
}

/* Enlace de recuperacion */
.lg-forgot {
	margin: 14px 0 0;
	text-align: right;
	font-size: 14px;
}
.lg-forgot a {
	font-weight: 700;
	text-decoration: none;
}

/* Boton secundario tipo enlace (cerrar / volver) */
.lg-link-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-weight: 700;
	text-decoration: none;
}
.lg-link-btn i {
	font-size: 12px;
}

/* Separador con texto */
.lg-divider {
	display: flex;
	align-items: center;
	gap: 14px;
	margin: 26px 0 16px;
	font-size: 13px;
	font-weight: 700;
	color: var(--lg-muted);
	white-space: nowrap;
}
.lg-divider::before,
.lg-divider::after {
	content: "";
	flex: 1 1 auto;
	height: 1px;
	background: var(--lg-line);
}

/* Login social */
.lg-social {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
}

.login-body .btn-social {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	height: 48px;
	padding: 0 12px;
	font-size: 15px;
	font-weight: 700;
	color: var(--lg-ink);
	background: var(--lg-surface);
	border: 1.5px solid var(--lg-line);
	border-radius: var(--lg-radius);
	text-decoration: none;
	cursor: pointer;
	user-select: none;
	transition: border-color var(--lg-fast) ease, background-color var(--lg-fast) ease, transform var(--lg-fast) ease, box-shadow var(--lg-fast) ease;
}
.login-body .btn-social i {
	font-size: 20px;
	line-height: 1;
}
.login-body .btn-social .fa-facebook-square,
.login-body .btn-social .fa-facebook {
	color: var(--lg-facebook);
}
.login-body .btn-social .fa-google {
	color: #ea4335;
}
.login-body .btn-social:hover,
.login-body .btn-social:focus-visible {
	color: var(--lg-brand-ink);
	background: var(--lg-brand-soft);
	border-color: var(--lg-brand);
	text-decoration: none;
	transform: translateY(-1px);
	box-shadow: var(--lg-shadow-soft);
	outline: none;
}
.login-body .btn-social:active {
	transform: none;
}
.login-body .btn-social .customGPlusSignIn {
	position: absolute;
	inset: 0;
}

/* Pie de la tarjeta */
.lg-foot {
	margin-top: 26px;
	padding-top: 18px;
	border-top: 1px solid var(--lg-line);
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 10px 16px;
	font-size: 12px;
	color: var(--lg-muted);
}
.lg-foot-brand {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-width: 0;
}
.lg-foot-brand img {
	width: 96px;
	height: auto;
	display: block;
}
.lg-foot .version {
	display: inline-block;
	padding: 2px 7px;
	font-size: 10px;
	font-weight: 800;
	line-height: 1.3;
	color: #fff;
	background: var(--lg-brand);
	border-radius: 999px;
	letter-spacing: 0.02em;
}
.lg-foot-slogan {
	font-style: italic;
	white-space: nowrap;
}
.lg-foot-links a {
	color: var(--lg-muted);
	font-weight: 700;
	text-decoration: none;
}
.lg-foot-links a:hover {
	color: var(--lg-brand);
	text-decoration: underline;
}

/* --------------------------------------------------------------------------
   Estados especiales
   -------------------------------------------------------------------------- */

/* Popup de Google Identity (One Tap fallback) */
#container_google_auth {
	display: none;
	position: fixed;
	top: 16px;
	right: 16px;
	z-index: 3000;
	width: min(320px, calc(100vw - 32px));
	padding: 8px 10px 14px;
	background: #fff;
	border-radius: var(--lg-radius);
	box-shadow: var(--lg-shadow-card);
}
#header_google_auth {
	display: flex;
	flex-direction: row-reverse;
	border-bottom: 1px solid var(--lg-line);
	margin-bottom: 10px;
}
#close_google_auth {
	background: transparent;
	border: 0;
	padding: 6px 8px;
	color: var(--lg-muted);
	cursor: pointer;
	border-radius: 8px;
}
#close_google_auth:hover {
	color: var(--lg-ink);
	background: var(--lg-surface-alt);
}
#body_google_auth {
	display: flex;
	justify-content: center;
	padding: 4px 0 0;
}

/* Cartel "Espere un momento" (WaitUpload oculta #wrapper y muestra esto) */
#DivWaitUpload {
	position: relative;
	z-index: 1;
	width: min(360px, 100%);
	margin: 0 auto;
	padding: 32px 28px;
	text-align: center;
	color: var(--lg-ink);
	background: var(--lg-surface);
	border-radius: var(--lg-radius-xl);
	box-shadow: var(--lg-shadow-card);
	animation: lg-rise var(--lg-normal) var(--lg-ease) both;
}
#DivWaitUpload strong {
	font-size: 17px;
	font-weight: 800;
}
#DivWaitUpload br + br {
	display: none;
}
#DivWaitUploadSpinner {
	display: flex;
	justify-content: center;
	margin: 12px 0;
}

/* Traductor rapido de Google (si el tenant lo tiene activo) */
#google_translate_element {
	position: fixed;
	top: 12px;
	right: 12px;
	z-index: 20;
	padding: 4px 8px;
	background: rgba(255, 255, 255, 0.92);
	border-radius: 999px;
	box-shadow: var(--lg-shadow-soft);
}
#google_translate_element .goog-te-gadget {
	font-family: inherit;
	font-size: 11px;
	color: var(--lg-muted);
}
.goog-te-banner-frame {
	display: none !important;
}
body.login-body {
	top: 0 !important;
}

/* Modal de politicas de privacidad (Bootstrap 3) */
.login-body .modal-dialog {
	margin: 24px auto;
	width: auto;
	max-width: 640px;
	padding: 0 16px;
}
.login-body .modal-content {
	border: 0;
	border-radius: var(--lg-radius-xl);
	box-shadow: var(--lg-shadow-card);
	font-family: var(--lg-font);
}
.login-body .modal-header {
	padding: 20px 24px 14px;
	border-bottom: 1px solid var(--lg-line);
}
.login-body .modal-title {
	font-size: 18px;
	font-weight: 800;
	color: var(--lg-ink);
}
.login-body .modal-body {
	padding: 18px 24px;
	font-size: 14px;
	color: var(--lg-ink);
	max-height: min(60vh, 460px);
	overflow: auto;
}
.login-body .modal-footer {
	padding: 14px 24px 20px;
	border-top: 1px solid var(--lg-line);
}
.login-body .modal-footer .btn {
	font-family: inherit;
	font-weight: 700;
	border-radius: var(--lg-radius-sm);
	padding: 8px 18px;
	background: var(--lg-brand-soft);
	border: 1px solid transparent;
	color: var(--lg-brand-ink);
}
.login-body .modal-footer .btn:hover {
	background: var(--lg-brand);
	color: #fff;
}
.login-body .modal-backdrop.in {
	opacity: 0.6;
}

/* --------------------------------------------------------------------------
   Responsive: a partir de 900px, dos columnas
   -------------------------------------------------------------------------- */

@media (min-width: 900px) {
	body.login-body {
		padding: 40px 24px;
	}

	.lg-card {
		grid-template-columns: minmax(300px, 5fr) 7fr;
		min-height: 600px;
	}

	.lg-brand {
		flex-direction: column;
		justify-content: center;
		text-align: center;
		gap: 22px;
		padding: 56px 36px;
	}

	.lg-brand-logo {
		width: 168px;
		height: 168px;
		padding: 14px;
		box-shadow: 0 24px 40px -18px rgba(0, 0, 0, 0.7), 0 0 0 8px rgba(255, 255, 255, 0.12);
	}

	.lg-brand-eyebrow {
		margin-bottom: 6px;
		font-size: 12px;
	}

	.login-body .lg-brand h1 {
		font-size: 26px;
	}

	.lg-panel {
		padding: 48px 52px 30px;
		justify-content: center;
	}

	.lg-title {
		font-size: 26px;
		margin-bottom: 26px;
	}
}

@media (min-width: 1200px) {
	.lg-panel {
		padding: 56px 64px 34px;
	}
}

/* Pantallas muy angostas: pie apilado y centrado (logo + version en una fila, slogan debajo) */
@media (max-width: 420px) {
	.lg-foot {
		flex-direction: column;
		align-items: center;
		text-align: center;
		gap: 8px;
	}
	.lg-foot-brand {
		flex-wrap: wrap;
		justify-content: center;
		gap: 4px 8px;
	}
	.lg-foot-slogan {
		flex-basis: 100%;
	}
}

/* Pantallas bajas en apaisado (celular horizontal) */
@media (max-height: 520px) and (max-width: 899px) {
	body.login-body {
		padding: 12px;
	}
	.lg-brand {
		padding: 12px 18px;
	}
	.lg-brand-logo {
		width: 48px;
		height: 48px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.lg-card,
	#DivWaitUpload {
		animation: none;
	}
	.login-body .lg-btn,
	.login-body .btn-social,
	.login-body .form-control,
	.lg-eye {
		transition: none;
	}
	.login-body .lg-btn:hover,
	.login-body .btn-social:hover {
		transform: none;
	}
}
