/* ============================================================
   SIINGMI — Pantalla de carga post-login
   Overlay fullscreen que se muestra mientras el dashboard carga.
   ============================================================ */

/* ── Animaciones ── */
@keyframes loadingPulse {
	0%, 100% { transform: scale(1); opacity: 1; }
	50% { transform: scale(1.02); opacity: 0.92; }
}

@keyframes loadingSlide {
	0% { transform: translateX(-100%); }
	100% { transform: translateX(300%); }
}

@keyframes loadingFadeIn {
	from { opacity: 0; }
	to { opacity: 1; }
}

@keyframes loadingTextSwap {
	0% { opacity: 1; transform: translateY(0); }
	40% { opacity: 0; transform: translateY(-6px); }
	60% { opacity: 0; transform: translateY(6px); }
	100% { opacity: 1; transform: translateY(0); }
}

@keyframes loadingEcgDash {
	0% { stroke-dashoffset: 800; }
	100% { stroke-dashoffset: 0; }
}

@keyframes loadingEcgFade {
	0%, 100% { opacity: 0.08; }
	50% { opacity: 0.18; }
}

/* ── Overlay principal ── */
.siingmi-loading-overlay {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 99999;
	display: none;
	align-items: center;
	justify-content: center;
	flex-direction: column;
	background: linear-gradient(135deg, #E84926 0%, #c93a1b 50%, #a82e14 100%);
	opacity: 0;
	transition: opacity 300ms cubic-bezier(0.23, 1, 0.32, 1);
}

.siingmi-loading-overlay.active {
	opacity: 1;
}

/* ── Contenido central ── */
.siingmi-loading-content {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 28px;
	z-index: 2;
}

/* ── Logo ── */
.siingmi-loading-logo {
	max-width: 180px;
	height: auto;
	animation: loadingPulse 2.4s cubic-bezier(0.23, 1, 0.32, 1) infinite;
	filter: drop-shadow(0 2px 12px rgba(0, 0, 0, 0.15));
}

/* ── Barra de progreso indeterminada ── */
.siingmi-loading-progress {
	width: 220px;
	height: 3px;
	background: rgba(255, 255, 255, 0.2);
	border-radius: 2px;
	overflow: hidden;
	position: relative;
}

.siingmi-loading-bar {
	position: absolute;
	top: 0;
	left: 0;
	width: 40%;
	height: 100%;
	background: rgba(255, 255, 255, 0.85);
	border-radius: 2px;
	animation: loadingSlide 1.6s cubic-bezier(0.23, 1, 0.32, 1) infinite;
}

/* ── Texto de estado ── */
.siingmi-loading-text {
	color: rgba(255, 255, 255, 0.9);
	font-family: AvenirNextRegular, -apple-system, 'Segoe UI', Helvetica, Arial, sans-serif;
	font-size: 14px;
	letter-spacing: 0.3px;
	margin: 0;
	min-height: 20px;
	text-align: center;
	transition: opacity 300ms cubic-bezier(0.23, 1, 0.32, 1);
}

.siingmi-loading-text.changing {
	animation: loadingTextSwap 500ms cubic-bezier(0.23, 1, 0.32, 1);
}

/* ── Línea ECG decorativa ── */
.siingmi-loading-ecg {
	position: fixed;
	bottom: 40px;
	left: 0;
	right: 0;
	height: 50px;
	z-index: 1;
	animation: loadingEcgFade 3s ease-in-out infinite;
}

.siingmi-loading-ecg svg {
	width: 100%;
	height: 100%;
}

.siingmi-loading-ecg path {
	fill: none;
	stroke: rgba(255, 255, 255, 0.3);
	stroke-width: 1.5;
	stroke-linecap: round;
	stroke-linejoin: round;
	stroke-dasharray: 800;
	animation: loadingEcgDash 4s linear infinite;
}

/* ── Responsive ── */
@media (max-width: 480px) {
	.siingmi-loading-logo {
		max-width: 140px;
	}

	.siingmi-loading-progress {
		width: 180px;
	}

	.siingmi-loading-text {
		font-size: 13px;
		padding: 0 20px;
	}

	.siingmi-loading-ecg {
		bottom: 20px;
		height: 35px;
	}
}
