/* Variables CSS */
:root {
	--primary-green: #8FBC3B;
	--dark-blue: #064A82;
	--app-bg: #F7F9FC;
	--border-color: #E5EAF1;
	--card-bg: #FFFFFF;
	--secondary-blue-1: #1472AE;
	--secondary-blue-2: #1784CA;
	--secondary-blue-3: #1792E1;
	--text-primary: #212529;
	--text-secondary: #6c757d;
	--text-light: #ffffff;

	/* Scale (desktop) */
	--login-title-size: 40px;
	--login-text-size: 14px;
	--login-panel-pad: 30px;
	--welcome-pad-y: 46px;
	--welcome-pad-x: 40px;
	--control-height: 46px;
	--logo-height: 56px;
	--logo-subtitle-size: 21px;
}

/* Reset y Base */
* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

html, body {
	margin: 0;
	padding: 0;
	overflow: hidden;
	height: 100%;
	width: 100%;
}

body {
	font-family: 'Poppins', sans-serif;
	background: #c0c0c0;
	position: relative;
	width: 100vw;
	height: 100vh;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px 20px 60px 20px;
	box-sizing: border-box;
	overflow: hidden;
}

body.with-banner {
	margin-top: 40px;
	height: calc(100vh - 40px);
	padding-top: 50px;
	padding-bottom: 60px;
}

/* Toast/Mensajes (MostrarMensaje -> #msj_php) */
#msj_php{
	z-index: 999999;
	display: none;
	position: fixed;
	top: 20px;
	right: 20px;
	left: auto;
	padding: 14px 16px;
	max-width: 520px;
	border-radius: 12px;
	background: rgba(255, 255, 255, 0.98);
	border: 1px solid rgba(229, 234, 241, 0.9);
	box-shadow: 0 14px 40px rgba(0, 0, 0, 0.18);
	color: #1f2d3d;
	font-size: 14px;
	line-height: 1.5;
	font-weight: 500;
}

body.with-banner #msj_php{
	top: 70px; /* evita tapar el banner */
}

#msj_php i{
	margin-right: 10px;
	opacity: 0.9;
}

#msj_php.btn-info{
	border-left: 4px solid var(--secondary-blue-2);
}

#msj_php.btn-success{
	border-left: 4px solid #28a745;
}

#msj_php.btn-danger{
	border-left: 4px solid #dc3545;
	background: rgba(255, 245, 246, 0.98);
}

/* Contenedor Principal */
.login-container {
	display: flex;
	width: 90%;
	max-width: 1200px;
	height: 80vh;
	max-height: 630px;
	position: relative;
	z-index: 1;
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
	border-radius: 24px;
	overflow: hidden;
	background: var(--card-bg);
}

/* Panel Izquierdo - Bienvenida (imagen de fondo dentro de la sección) */
.welcome-panel {
	flex: 1;
	display: flex;
	align-items: flex-start;
	justify-content: flex-start;
	position: relative;
	overflow: hidden;
	background: url('../imagenes/fondo.png') center center / cover no-repeat;
	padding: 28px var(--welcome-pad-x) var(--welcome-pad-y);
}

.welcome-panel::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0, 0, 0, 0.12);
	z-index: 0;
}

.welcome-content {
	position: relative;
	z-index: 2;
	color: var(--text-light);
	max-width: 100%;
	text-align: left;
	width: 100%;
	display: flex;
	flex-direction: column;
	justify-content: flex-start;
	padding-top: 8px;
}

.welcome-title {
	font-size: var(--login-title-size);
	font-weight: 700;
	margin-bottom: 22px;
	line-height: 1.2;
	color: #fff;
	text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 2px 8px rgba(0, 0, 0, 0.35), 0 0 20px rgba(0, 0, 0, 0.2);
}

.welcome-text {
	font-size: 15px;
	line-height: 1.7;
	margin-bottom: 0;
	font-weight: 500;
	max-width: 400px;
	color: #fff;
	text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45), 0 2px 6px rgba(0, 0, 0, 0.35), 0 0 16px rgba(0, 0, 0, 0.25);
}

.welcome-footer {
	position: absolute;
	bottom: 16px;
	left: var(--welcome-pad-x);
	right: var(--welcome-pad-x);
	font-size: 12px;
	font-weight: 500;
	color: rgba(255, 255, 255, 0.95);
	text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5), 0 2px 8px rgba(0, 0, 0, 0.35);
	text-align: left;
	z-index: 2;
}

/* Panel Derecho - Formulario */
.login-panel {
	flex: 1;
	background: var(--card-bg);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: var(--login-panel-pad);
	position: relative;
	overflow: hidden;
}

.login-content {
	width: 100%;
	max-width: 450px;
	overflow-y: auto;
	max-height: 100%;
	padding-right: 5px;
}

.login-content::-webkit-scrollbar {
	width: 4px;
}

.login-content::-webkit-scrollbar-track {
	background: transparent;
}

.login-content::-webkit-scrollbar-thumb {
	background: #ccc;
	border-radius: 2px;
}

/* Header del Login */
.login-header {
	text-align: center;
	margin-bottom: 34px;
}

.logo-section {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
}

.logo-container {
	margin-bottom: 16px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.logo-image {
	width: auto;
	height: var(--logo-height);
	max-height: calc(var(--logo-height) + 12px);
	object-fit: contain;
	display: block;
	flex-shrink: 0;
}

.logo-subtext {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
}

.logo-pms {
	font-size: var(--logo-subtitle-size);
	font-weight: 700;
	color: #064A82;
	letter-spacing: 0.5px;
	line-height: 1.2;
}


/* Formulario */
.login-form-wrapper {
	margin-top: 14px;
}

.form-group-custom {
	margin-bottom: 16px;
	gap: 20px;
}

.form-label {
	display: none;
}

.input-wrapper {
	position: relative;
	display: flex;
	align-items: center;
	min-height: var(--control-height);
}

.input-icon {
	position: absolute;
	left: 18px;
	z-index: 2;
	color: var(--text-secondary);
	font-size: 16px;
	pointer-events: none;
}

.input-icon-combo {
	position: relative;
}

.input-icon-combo .fa-user {
	font-size: 16px;
}

.input-icon-small {
	font-size: 10px !important;
	position: absolute;
	top: 2px;
	left: 2px;
	z-index: 3;
}

/* Select wrapper */
.select-wrapper {
	position: relative;
}

.form-select {
	appearance: none;
	-webkit-appearance: none;
	-moz-appearance: none;
	padding-right: 45px;
	cursor: pointer;
	height: 52px;
	box-sizing: border-box;
}

.select-arrow {
	position: absolute;
	right: 18px;
	top: 50%;
	transform: translateY(-50%);
	color: var(--text-secondary);
	pointer-events: none;
	z-index: 2;
	font-size: 14px;
}

.form-input,
.form-select {
	width: 100%;
	height: var(--control-height);
	padding: 14px 16px 14px 50px;
	border: 1px solid var(--border-color);
	border-radius: 12px;
	font-size: 14px;
	font-family: 'Poppins', sans-serif;
	color: var(--text-primary);
	background: var(--card-bg);
	transition: all 0.3s ease;
	box-sizing: border-box;
}

.form-input:focus {
	outline: none;
	border-color: var(--secondary-blue-2);
	box-shadow: 0 0 0 3px rgba(23, 132, 202, 0.1);
}

.form-input::placeholder {
	color: #adb5bd;
}

.form-input[readonly] {
	background: #f8f9fa;
	cursor: not-allowed;
}

/* Password toggle */
.password-toggle {
	position: absolute;
	right: 18px;
	background: none;
	border: none;
	color: var(--text-secondary);
	cursor: pointer;
	font-size: 16px;
	z-index: 2;
	padding: 0;
	display: flex;
	align-items: center;
	justify-content: center;
}

.password-toggle:hover {
	color: var(--text-primary);
}

/* PIN - Vigencia */
.pin-field{
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.expiry-badge{
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin-left: 50px; /* alinear con el texto del input (por el icono) */
	padding: 6px 10px;
	border-radius: 10px;
	font-size: 12px;
	line-height: 1.2;
	font-weight: 600;
	border: 1px solid rgba(229, 234, 241, 1);
	background: rgba(247, 249, 252, 0.95);
	color: #334155;
	width: fit-content;
	max-width: calc(100% - 50px);
}

.expiry-badge i{
	opacity: 0.9;
}

.expiry-badge--ok{
	background: rgba(23, 132, 202, 0.10);
	border-color: rgba(23, 132, 202, 0.25);
	color: #064A82;
}

.expiry-badge--warn{
	background: rgba(255, 193, 7, 0.14);
	border-color: rgba(255, 193, 7, 0.35);
	color: #7a4b00;
}

.expiry-badge--danger{
	background: rgba(220, 53, 69, 0.10);
	border-color: rgba(220, 53, 69, 0.30);
	color: #9b1c1c;
}

/* Form Options */
.form-options {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 25px;
	margin-top: 10px;
}

.checkbox-label {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 14px;
	color: var(--text-primary);
	cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
	width: 18px;
	height: 18px;
	cursor: pointer;
	accent-color: var(--dark-blue);
}

.forgot-password {
	font-size: 14px;
	color: var(--secondary-blue-2);
	text-decoration: none;
	transition: color 0.3s ease;
}

.forgot-password:hover {
	color: var(--dark-blue);
	text-decoration: underline;
}

/* Botón Login */
.btn-login {
	width: 100%;
	height: var(--control-height);
	padding: 14px 22px;
	background: var(--dark-blue);
	color: var(--text-light);
	border: none;
	border-radius: 12px;
	font-size: 16px;
	font-weight: 600;
	font-family: 'Poppins', sans-serif;
	cursor: pointer;
	transition: transform 0.12s ease, box-shadow 0.18s ease, background-color 0.18s ease, filter 0.18s ease;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	position: relative;
	overflow: hidden;
	user-select: none;
}

.btn-login:hover {
	background: var(--secondary-blue-2);
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(6, 74, 130, 0.3);
}

.btn-login:active {
	transform: translateY(1px) scale(0.99);
	background: #053d6c; /* un toque más oscuro que --dark-blue */
	box-shadow: 0 2px 8px rgba(6, 74, 130, 0.22), inset 0 2px 0 rgba(255,255,255,0.08);
}

.btn-login:focus-visible {
	outline: none;
	box-shadow: 0 0 0 4px rgba(23, 132, 202, 0.22), 0 6px 18px rgba(6, 74, 130, 0.22);
}

/* Ripple sutil (solo visual) */
.btn-login::after {
	content: '';
	position: absolute;
	inset: 0;
	background: radial-gradient(circle at center, rgba(255,255,255,0.22) 0%, rgba(255,255,255,0) 55%);
	opacity: 0;
	transform: scale(0.85);
	transition: opacity 0.22s ease, transform 0.22s ease;
	pointer-events: none;
}

.btn-login:active::after {
	opacity: 1;
	transform: scale(1.05);
}

/* Footer Copyright */
.copyright-footer {
	position: fixed;
	bottom: 0;
	left: 0;
	right: 0;
	background: #2c3e50;
	color: #ffffff;
	padding: 8px 16px;
	text-align: center;
	font-size: 9px;
	line-height: 1.4;
	z-index: 100;
	width: 100%;
	box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
	height: auto;
	max-height: 50px;
	overflow: hidden;
}

.copyright-footer p {
	margin: 0;
}

/* Responsive */
@media (max-width: 968px) {
	.login-container {
		flex-direction: column;
		width: 95%;
		height: auto;
		max-height: none;
	}

	.welcome-panel {
		flex: 0 0 auto;
		min-height: 300px;
		padding: 40px 30px;
	}

	.welcome-content {
		padding: 0;
	}

	.login-panel {
		padding: 40px 30px;
	}

	.logo-image {
		height: 55px;
		max-height: 55px;
	}

	.logo-pms {
		font-size: 20px;
	}
}

@media (max-width: 640px) {
	body {
		padding: 15px 15px 60px 15px;
	}

	.login-container {
		width: 95%;
		border-radius: 16px;
	}

	.welcome-panel {
		padding: 30px 20px;
	}

	.login-panel {
		padding: 30px 20px;
	}

	.welcome-title {
		font-size: 28px;
	}

	.welcome-text {
		font-size: 14px;
		max-width: 100%;
	}

	.app-title {
		font-size: 24px;
	}

	.form-input,
	.btn-login {
		height: 48px;
		font-size: 14px;
		padding: 12px 14px 12px 45px;
	}

	.btn-login {
		padding: 14px 20px;
	}
}

