/**
 * OBSERVAFEN Login Styles - Screen
 * Formulario sobre la derecha del split-screen (init.css maneja el layout).
 * Paleta institucional: primario #003366, hover #0a4d8f, accent #2fa4e7.
 */

/* ── Tipografía de campos ──────────────────────────────────────── */

input,
label,
button {
	font-family: 'Inter', 'Segoe UI', Helvetica, Arial, sans-serif;
}

/* ── Etiquetas sobre los campos (siempre visibles) ────────────── */

.login-form .input-group {
	margin-bottom: 1.1rem;
	position: relative;
}

.login-form .input-group label {
	display: block;
	font-size: 0.8rem;
	font-weight: 500;
	color: #4B5563;
	margin: 0 0 0.35rem 2px;
	visibility: visible !important;
	opacity: 1 !important;
	transition: none !important;
}

/* ── Campos de entrada: borde, 8px, Inter ─────────────────────── */

.login-form .content .input {
	width: 100%;
	box-sizing: border-box;
	padding: 0.72rem 0.85rem;
	color: #111827;
	background: #ffffff;
	border: 1px solid #D8DADC;
	border-radius: 8px;
	font-size: 0.9rem;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.login-form .content .input::placeholder {
	color: #9ca3af;
}

.login-form .content input[type="text"]:hover,
.login-form .content input[type="password"]:hover {
	border-color: #b6c2cf;
}

.login-form .content input[type="text"]:focus,
.login-form .content input[type="password"]:focus {
	border-color: #003366;
	outline: none;
	box-shadow: 0 0 0 3px rgba(0, 51, 102, 0.14);
}

/* Neutraliza el float-label: el label queda fijo y el placeholder visible */
.fadeOutLabel,
.fadeInLabel {
	visibility: visible !important;
	opacity: 1 !important;
	transition: none !important;
}

.fadeOutInput::placeholder,
.fadeInInput::placeholder {
	visibility: visible !important;
	opacity: 1 !important;
	transition: none !important;
}

/* ── Botón Iniciar Sesión (primario, jerarquía) ───────────────── */

.login-form .footer input[type="submit"],
.login-form .footer #submit {
	width: 100%;
	height: 46px;
	color: #ffffff;
	background: #003366;
	border-radius: 8px;
	cursor: pointer;
	line-height: 46px;
	text-align: center;
	font-size: 0.95rem;
	font-weight: 600;
	letter-spacing: 0.01em;
	border: 1px solid #003366;
	transition: background-color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, transform 0.12s ease;
	box-shadow: 0 2px 6px rgba(0, 51, 102, 0.22);
}

.login-form .footer input[type="submit"]:hover,
.login-form .footer #submit:hover {
	background: #0a4d8f;
	border-color: #0a4d8f;
	box-shadow: 0 4px 12px rgba(0, 51, 102, 0.30);
}

.login-form .footer input[type="submit"]:active,
.login-form .footer #submit:active {
	transform: translateY(1px);
	box-shadow: 0 1px 3px rgba(0, 51, 102, 0.25);
}

.login-form .footer input[type="submit"]:disabled,
.login-form .footer #submit:disabled {
	background: #b6c2d1;
	border-color: #b6c2d1;
	cursor: not-allowed;
	box-shadow: none;
}

.submit-button {
	transition: opacity 0.25s ease, transform 0.25s ease;
}

/* ── Spinner de carga ─────────────────────────────────────────── */

.login-form .footer .icon-load {
	margin-top: 0.5rem;
}

.spinner {
	margin: 0 auto;
	width: auto;
	text-align: center;
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 5px;
}

.spinner > div {
	width: 14px;
	height: 14px;
	background-color: #003366;
	border-radius: 50%;
	display: inline-block;
	-webkit-animation: sk-bouncedelay 1.4s infinite ease-in-out both;
	animation: sk-bouncedelay 1.4s infinite ease-in-out both;
}

.spinner .bounce1 { -webkit-animation-delay: -0.32s; animation-delay: -0.32s; }
.spinner .bounce2 { -webkit-animation-delay: -0.16s; animation-delay: -0.16s; }

@keyframes sk-bouncedelay {
	0%, 80%, 100% {
		-webkit-transform: scale(0);
		transform: scale(0);
	}
	40% {
		-webkit-transform: scale(1);
		transform: scale(1);
	}
}

/* ── Mensajes de error (institucional, sobrios) ───────────────── */

@keyframes slideInFromTop {
	from {
		opacity: 0;
		transform: translateY(-14px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.login-error-message {
	background: linear-gradient(135deg, #fef2f2, #fee2e2);
	color: #7f1d1d;
	border: 1px solid #fecaca;
	padding: 12px 14px;
	border-radius: 8px;
	margin-bottom: 18px;
	font-size: 0.82rem;
	font-weight: 500;
	box-shadow: 0 2px 8px rgba(127, 29, 29, 0.08);
	position: relative;
	overflow: hidden;
	animation: slideInFromTop 0.4s ease-out;
}

.captcha-error {
	background: linear-gradient(135deg, #fff7ed, #ffedd5) !important;
	color: #9a3412 !important;
	border: 1px solid #fed7aa !important;
	box-shadow: 0 2px 8px rgba(154, 52, 18, 0.08) !important;
}

.error-content {
	display: flex;
	align-items: center;
	gap: 10px;
}

.error-icon {
	font-size: 15px;
	flex-shrink: 0;
}

.error-text {
	flex: 1;
	line-height: 1.4;
}

.error-close-btn {
	background: rgba(127, 29, 29, 0.12);
	border: none;
	color: #7f1d1d;
	width: 24px;
	height: 24px;
	border-radius: 50%;
	cursor: pointer;
	font-size: 14px;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

.error-close-btn:hover {
	background: rgba(127, 29, 29, 0.2);
}

.error-progress-bar {
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	height: 3px;
	background: rgba(127, 29, 29, 0.18);
	border-radius: 0 0 8px 8px;
}

/* ── Errores de validación y autenticación ────────────────────── */

.parsley-errors-list > li {
	list-style-type: none;
	color: #b91c1c;
	font-size: 0.76rem;
	font-weight: 500;
	margin-top: 4px;
}

.parsley-error {
	border-color: #f87171 !important;
}

.parsley-error:focus {
	border-color: #b91c1c !important;
	box-shadow: 0 0 0 3px rgba(185, 28, 28, 0.14) !important;
}

.login-auth-error {
	background: #f35e64;
	border: 1px solid tomato;
	border-radius: 6px;
	color: #FFF;
	margin: 0 auto;
	text-align: center;
	padding: 6px 12px;
	font-size: 0.82rem;
	font-weight: 500;
}

/* ── CAPTCHA ──────────────────────────────────────────────────── */

.captcha-group {
	margin: 0;
}

.captcha-group > label {
	font-size: 0.8rem;
	font-weight: 500;
	color: #4B5563;
	margin: 0 0 0.35rem 2px;
	visibility: visible !important;
	opacity: 1 !important;
}

.captcha-container {
	margin: 0 0 8px 0;
	display: flex;
	align-items: center;
	gap: 10px;
}

#captcha-image {
	border: 1px solid #e2e8f0;
	border-radius: 6px;
	background: #ffffff;
	height: 42px;
	overflow: hidden;
	transition: border-color 0.2s ease;
}

#captcha-image:hover {
	border-color: #003366;
}

.captcha-refresh-btn {
	background: #ffffff;
	border: 1px solid #D8DADC;
	border-radius: 8px;
	color: #4B5563;
	padding: 0 12px;
	height: 42px;
	cursor: pointer;
	font-size: 15px;
	transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.captcha-refresh-btn:hover {
	background: #f8fafc;
	border-color: #9ca3af;
	color: #111827;
}

.captcha-refresh-btn:disabled {
	background: #f1f5f9;
	cursor: not-allowed;
	color: #9ca3af;
}

.captcha-refresh-btn.refreshing {
	animation: spin 0.9s linear infinite;
}

@keyframes spin {
	from { transform: rotate(0deg); }
	to   { transform: rotate(360deg); }
}

.captcha-input {
	width: 100%;
	padding: 0.72rem 0.85rem;
	margin: 0;
	border: 1px solid #D8DADC;
	border-radius: 8px;
	font-size: 0.9rem;
	color: #111827;
	box-sizing: border-box;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.captcha-input:focus {
	outline: none;
	border-color: #003366;
	box-shadow: 0 0 0 3px rgba(0, 51, 102, 0.14);
}

/* ── Accesibilidad / movimiento ───────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
	.login-error-message,
	.captcha-refresh-btn.refreshing {
		animation: none;
		transition: none;
	}
}

@media (prefers-contrast: high) {
	.login-form {
		border-width: 2px;
		border-color: #1e293b;
	}

	.login-form .content .input,
	.captcha-input {
		border-width: 1px;
		border-color: #1e293b;
	}
}