/* ============================================================
   Softnet Front — Login (scoped .sf-login)
   Split-screen: panel degradado + formulario blanco.
   Responsive: móvil, tablet y escritorio.
   ============================================================ */

.sf-login-body {
	--sfl-primary: #1c3f82;
	--sfl-primary-mid: #2b5cb8;
	--sfl-accent: #3598dc;
	--sfl-ink: #1a2333;
	--sfl-muted: #6b7789;
	--sfl-field-bg: #eef2fb;
	--sfl-field-focus: #ffffff;
	--sfl-danger: #d64545;
	--sfl-radius: 12px;

	margin: 0;
	min-height: 100vh;
	font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
	color: var(--sfl-ink);
	background: #ffffff;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

.sf-login-body *,
.sf-login-body *::before,
.sf-login-body *::after {
	box-sizing: border-box;
}

/* ---------- Layout ---------- */
.sf-login {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(440px, 640px);
	min-height: 100vh;
}

/* ---------- Panel degradado ---------- */
.sf-login__panel {
	position: relative;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	padding: 40px 56px 32px;
	color: #fff;
	background: linear-gradient(165deg, #16336b 0%, #1c3f82 38%, #2b5cb8 78%, #3598dc 120%);
}

/* Círculos decorativos sutiles, como la referencia */
.sf-login__panel-deco {
	position: absolute;
	inset: 0;
	pointer-events: none;
}

.sf-login__panel-deco::before,
.sf-login__panel-deco::after {
	content: '';
	position: absolute;
	border-radius: 50%;
	border: 2px solid rgba(255, 255, 255, 0.10);
}

.sf-login__panel-deco::before {
	width: 420px;
	height: 420px;
	top: -140px;
	left: -120px;
}

.sf-login__panel-deco::after {
	width: 560px;
	height: 560px;
	bottom: -220px;
	right: -160px;
	border-width: 60px;
	border-color: rgba(255, 255, 255, 0.05);
}

.sf-login__brand {
	position: relative;
	align-self: flex-start;
}

.sf-login__brand img {
	display: block;
	height: 42px;
	width: auto;
}

.sf-login__claim {
	position: relative;
	max-width: 520px;
}

.sf-login__claim h2 {
	margin: 0 0 16px;
	font-size: 38px;
	line-height: 1.18;
	font-weight: 800;
	letter-spacing: -0.8px;
}

.sf-login__claim p {
	margin: 0 0 28px;
	font-size: 15.5px;
	line-height: 1.65;
	font-weight: 400;
	color: rgba(255, 255, 255, 0.85);
}

.sf-login__panel-footer {
	position: relative;
	margin: 0;
	font-size: 12.5px;
	color: rgba(255, 255, 255, 0.65);
}

/* ---------- Columna del formulario ---------- */
.sf-login__main {
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	padding: 40px 32px;
	background: #ffffff;
}

.sf-login__card {
	width: 100%;
	max-width: 380px;
}

.sf-login__card-logo {
	margin-bottom: 22px;
}

.sf-login__card-logo img {
	height: 34px;
	width: auto;
}

.sf-login__title {
	margin: 0 0 8px;
	font-size: 26px;
	font-weight: 800;
	letter-spacing: -0.5px;
	color: #101828;
}

.sf-login__subtitle {
	margin: 0 0 28px;
	font-size: 14.5px;
	line-height: 1.5;
	color: var(--sfl-muted);
}

/* ---------- Campos ---------- */
.sf-login__field {
	margin-bottom: 16px;
}

.sf-login__label {
	display: block;
	margin-bottom: 6px;
	font-size: 13px;
	font-weight: 600;
	color: #344054;
}

.sf-login__control {
	position: relative;
	display: flex;
	align-items: center;
}

.sf-login__input {
	width: 100%;
	height: 46px;
	padding: 0 52px 0 14px;
	font: inherit;
	font-size: 14.5px;
	font-weight: 500;
	color: var(--sfl-ink);
	background: var(--sfl-field-bg);
	border: 1.5px solid transparent;
	border-radius: 10px;
	outline: none;
	transition: border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
	-webkit-appearance: none;
}

.sf-login__input::placeholder {
	color: #98a2b3;
	font-weight: 400;
}

.sf-login__input:focus {
	background: var(--sfl-field-focus);
	border-color: var(--sfl-primary-mid);
	box-shadow: 0 0 0 4px rgba(43, 92, 184, 0.12);
}

.sf-login__field.has-error .sf-login__input {
	border-color: var(--sfl-danger);
	background: #fff;
}

.sf-login__field-error {
	display: none;
	margin-top: 5px;
	font-size: 12.5px;
	color: var(--sfl-danger);
}

.sf-login__field.has-error .sf-login__field-error {
	display: block;
}

/* Ver / ocultar clave (texto, como la referencia) */
.sf-login__toggle-pass {
	position: absolute;
	right: 6px;
	padding: 6px 10px;
	border: 0;
	border-radius: 8px;
	background: transparent;
	color: var(--sfl-primary-mid);
	font-family: inherit;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
}

.sf-login__toggle-pass:hover {
	background: rgba(43, 92, 184, 0.08);
}

/* ---------- Recordar ---------- */
.sf-login__row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin: 4px 0 20px;
}

.sf-login__remember {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: 13.5px;
	font-weight: 500;
	color: #344054;
	cursor: pointer;
	user-select: none;
}

.sf-login__remember input {
	width: 17px;
	height: 17px;
	margin: 0;
	accent-color: var(--sfl-primary-mid);
	cursor: pointer;
}

/* ---------- Botón ---------- */
.sf-login__submit {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	width: 100%;
	height: 48px;
	border: 0;
	border-radius: 10px;
	font: inherit;
	font-size: 15px;
	font-weight: 700;
	letter-spacing: 0.1px;
	color: #fff;
	background: var(--sfl-primary-mid);
	cursor: pointer;
	transition: background 0.15s ease, transform 0.12s ease, box-shadow 0.15s ease;
	box-shadow: 0 8px 18px -8px rgba(43, 92, 184, 0.55);
}

.sf-login__submit:hover {
	background: var(--sfl-primary);
	transform: translateY(-1px);
}

.sf-login__submit:active {
	transform: translateY(0);
}

.sf-login__submit[disabled] {
	opacity: 0.75;
	cursor: wait;
	transform: none;
}

.sf-login__spinner {
	width: 17px;
	height: 17px;
	border: 2.5px solid rgba(255, 255, 255, 0.4);
	border-top-color: #fff;
	border-radius: 50%;
	animation: sfl-spin 0.7s linear infinite;
}

@keyframes sfl-spin {
	to { transform: rotate(360deg); }
}

/* ---------- Links bajo el botón ---------- */
.sf-login__links {
	margin-top: 18px;
	text-align: center;
}

.sf-login__forgot {
	border: 0;
	padding: 0;
	background: none;
	font-family: inherit;
	font-size: 13.5px;
	font-weight: 600;
	color: var(--sfl-primary-mid);
	cursor: pointer;
}

.sf-login__forgot:hover {
	color: var(--sfl-primary);
	text-decoration: underline;
}

/* ---------- Redes / footer ---------- */
.sf-login__social {
	display: flex;
	justify-content: center;
	gap: 12px;
	margin-top: 30px;
}

.sf-login__social a {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	color: var(--sfl-primary-mid);
	background: var(--sfl-field-bg);
	transition: background 0.16s ease, color 0.16s ease;
}

.sf-login__social a:hover {
	background: var(--sfl-primary-mid);
	color: #fff;
}

.sf-login__social svg {
	width: 16px;
	height: 16px;
}

.sf-login__footer {
	margin-top: 18px;
	font-size: 12px;
	color: #98a2b3;
	text-align: center;
}

/* ---------- Alerta superior (errores de login) ---------- */
.sf-login__alert {
	display: none;
	align-items: flex-start;
	gap: 10px;
	margin-bottom: 20px;
	padding: 12px 14px;
	border-radius: 10px;
	border: 1px solid #f3c2c2;
	background: #fdf1f1;
	color: #9b2c2c;
	font-size: 13.5px;
	font-weight: 500;
	line-height: 1.45;
}

.sf-login__alert.is-visible {
	display: flex;
}

.sf-login__alert svg {
	flex: 0 0 auto;
	width: 18px;
	height: 18px;
	margin-top: 1px;
}

/* ---------- Modal recuperar clave ---------- */
.sf-login__modal-backdrop {
	position: fixed;
	inset: 0;
	z-index: 40;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 20px;
	background: rgba(16, 24, 40, 0.55);
	backdrop-filter: blur(3px);
}

.sf-login__modal-backdrop.is-open {
	display: flex;
}

.sf-login__modal {
	width: 100%;
	max-width: 420px;
	max-height: calc(100vh - 40px);
	overflow: auto;
	background: #fff;
	border-radius: 14px;
	box-shadow: 0 24px 60px -18px rgba(9, 30, 66, 0.45);
	padding: 26px 26px 24px;
	animation: sfl-pop 0.22s ease;
}

@keyframes sfl-pop {
	from { opacity: 0; transform: translateY(14px) scale(0.98); }
	to   { opacity: 1; transform: translateY(0) scale(1); }
}

.sf-login__modal-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 6px;
}

.sf-login__modal-title {
	margin: 0;
	font-size: 19px;
	font-weight: 800;
	letter-spacing: -0.3px;
}

.sf-login__modal-close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	border: 0;
	border-radius: 10px;
	background: var(--sfl-field-bg);
	color: #667085;
	font-size: 18px;
	line-height: 1;
	cursor: pointer;
}

.sf-login__modal-close:hover {
	background: #e2e9f4;
	color: var(--sfl-ink);
}

.sf-login__modal-desc {
	margin: 0 0 18px;
	font-size: 13.5px;
	line-height: 1.55;
	color: var(--sfl-muted);
}

.sf-login__modal-msg {
	display: none;
	margin: 0 0 16px;
	padding: 11px 13px;
	border-radius: 10px;
	font-size: 13.5px;
	line-height: 1.5;
	font-weight: 500;
}

.sf-login__modal-msg.is-visible {
	display: block;
}

.sf-login__modal-msg--ok {
	background: #ecf9f2;
	border: 1px solid #b9e6cf;
	color: #176b43;
}

.sf-login__modal-msg--error {
	background: #fdf1f1;
	border: 1px solid #f3c2c2;
	color: #9b2c2c;
}

.sf-login__modal-actions {
	display: flex;
	gap: 10px;
	margin-top: 6px;
}

.sf-login__btn-secondary {
	flex: 1;
	height: 46px;
	border: 1.5px solid #d5dceb;
	border-radius: 10px;
	background: #fff;
	color: #344054;
	font: inherit;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.15s ease;
}

.sf-login__btn-secondary:hover {
	background: var(--sfl-field-bg);
}

.sf-login__modal-actions .sf-login__submit {
	flex: 1.4;
	height: 46px;
	font-size: 14px;
}

/* ============================================================
   Responsive
   ============================================================ */

/* Tablet */
@media (max-width: 1180px) {
	.sf-login {
		grid-template-columns: minmax(0, 1fr) minmax(400px, 500px);
	}

	.sf-login__panel {
		padding: 32px 36px 28px;
	}

	.sf-login__claim h2 {
		font-size: 30px;
	}
}

/* Tablet vertical y móvil: una sola columna */
@media (max-width: 860px) {
	.sf-login {
		grid-template-columns: 1fr;
	}

	.sf-login__panel {
		display: none;
	}

	.sf-login__main {
		min-height: 100vh;
		padding: 32px 20px;
		/* Franja superior con el degradado corporativo para identidad en móvil */
		background:
			linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, #ffffff 220px),
			linear-gradient(165deg, #16336b 0%, #2b5cb8 60%, #3598dc 100%);
		background-repeat: no-repeat;
		background-size: 100% 260px, 100% 260px;
		background-color: #ffffff;
	}

	.sf-login__card {
		max-width: 420px;
		background: #ffffff;
		border-radius: 16px;
		box-shadow: 0 18px 44px -18px rgba(16, 24, 40, 0.28);
		border: 1px solid #eef1f6;
		padding: 28px 24px 24px;
	}

	.sf-login__card-logo {
		text-align: center;
	}

	.sf-login__title,
	.sf-login__subtitle {
		text-align: center;
	}
}

/* Móvil chico */
@media (max-width: 400px) {
	.sf-login__card {
		padding: 24px 18px 20px;
	}
}

/* Teclado en pantalla / alturas cortas */
@media (max-height: 640px) {
	.sf-login__main {
		justify-content: flex-start;
		padding-top: 20px;
	}
}
