/* ── Login / Registro (hoja COMPARTIDA por login.xhtml y register.xhtml) ──────
   Re-skin fase 1: consume tokens.css + components.css (botones, inputs y
   mensajes salen de ahi; aqui solo vive el layout propio de estas vistas).
   Pantalla dividida: panel de marca navy a la izquierda + area clara con la
   tarjeta del formulario a la derecha. */

*, *::before, *::after { box-sizing: border-box; }

body {
	margin: 0;
	padding: 0;
	font-family: var(--font-ui);
	background: var(--bg);
	color: var(--text);
	min-height: 100vh;
}

/* ── Contenedor principal ─────────────── */
.login-wrapper {
	display: flex;
	min-height: 100vh;
	width: 100%;
}

/* ── Panel izquierdo (branding sobre navy) ───────── */
.login-brand {
	flex: 1 1 46%;
	background: linear-gradient(160deg, var(--navy), var(--navy-2));
	padding: 52px 48px;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	color: #fff;
}

.brand-logo {
	display: flex;
	align-items: center;
	gap: 14px;
}

.brand-logo-icon {
	width: 52px;
	height: 52px;
	background: rgba(255, 255, 255, 0.08);
	border: 1px solid rgba(255, 255, 255, 0.22);
	border-radius: 13px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 24px;
	color: var(--gold);
}

.brand-logo-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-logo-name {
	font-family: var(--font-display);
	font-size: 19px;
	font-weight: 700;
	letter-spacing: -0.3px;
}
.brand-logo-sub {
	font-size: 11px;
	color: rgba(255, 255, 255, 0.55);
	text-transform: uppercase;
	letter-spacing: 0.8px;
	margin-top: 2px;
}

.brand-hero {
	flex: 1;
	display: flex;
	flex-direction: column;
	justify-content: center;
	padding: 32px 0;
}

.brand-hero h2 {
	font-family: var(--font-display);
	font-size: clamp(30px, 3.6vw, 44px);
	font-weight: 700;
	line-height: 1.06;
	letter-spacing: -1.5px;
	margin: 0 0 18px;
	color: #fff;
	max-width: 480px;
}

.brand-hero p {
	font-size: 14px;
	color: rgba(255, 255, 255, 0.65);
	line-height: 1.7;
	margin: 0;
	max-width: 440px;
}

.brand-features {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.brand-feature {
	display: flex;
	align-items: center;
	gap: 12px;
	font-size: 13px;
	color: rgba(255, 255, 255, 0.78);
}

.brand-feature .pi {
	width: 30px;
	height: 30px;
	background: rgba(255, 255, 255, 0.08);
	border: 1px solid rgba(255, 255, 255, 0.14);
	border-radius: 8px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 13px;
	flex-shrink: 0;
	color: var(--gold);
}

/* ── Lado derecho: area clara que centra la tarjeta ───────── */
.login-form-side {
	flex: 1 1 54%;
	background: var(--bg);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 48px 28px;
}

/* Tarjeta del formulario */
.login-form-panel {
	width: 100%;
	max-width: 420px;
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: 14px;
	padding: 36px 32px;
	animation: lcpop 0.18s ease-out;
}

.login-form-panel h3 {
	font-family: var(--font-display);
	font-size: 24px;
	font-weight: 700;
	letter-spacing: -0.5px;
	color: var(--text);
	margin: 0 0 6px;
}

.login-form-panel .login-welcome {
	font-size: 13px;
	color: var(--muted);
	margin: 0 0 26px;
}

/* ── Campos: el estilo del input lo da components.css; aqui solo layout ── */
.login-field { margin-bottom: 16px; }
.login-field .ui-inputfield { width: 100%; }
/* Wrapper de p:password con toggleMask (register) */
.login-field .ui-password { width: 100%; display: block; }
.login-field .ui-password .ui-inputfield { width: 100%; }
/* Mensajes de validacion por campo (register); colores desde components.css */
.login-field .ui-message-error,
.login-field .ui-message {
	display: block;
	font-size: 12px;
	margin-top: 5px;
	padding: 5px 9px;
}

/* ── Boton principal (variante primaria global; aqui solo tamano) ── */
.login-btn.ui-button {
	width: 100%;
	margin-top: 8px;
	padding: 12px 16px;
	font-size: 14px;
}
.login-btn .ui-button-text { padding: 0; }

/* ── Pie de tarjeta ── */
.login-footer {
	text-align: center;
	margin-top: 22px;
}

.login-legal { margin: 14px 0 0; font-size: 12px; color: var(--muted, #667085); }
.login-legal a { font-size: 12px; }
.login-legal-google { text-align: center; margin-top: 8px; }
.login-terminos { display: grid; grid-template-columns: auto 1fr; gap: 6px 10px; align-items: start; }
.login-terminos .ui-message { grid-column: 1 / -1; }
.login-terminos-txt { font-size: 13px; line-height: 1.4; }

.login-footer a {
	font-size: 13px;
	color: var(--blue);
	font-weight: 500;
	text-decoration: none;
}
.login-footer a:hover { text-decoration: underline; }

/* ── "Continuar con Google" (secundario: superficie + borde) ── */
.google-divider {
	display: flex;
	align-items: center;
	gap: 12px;
	margin: 22px 0;
	color: var(--muted-2);
	font-size: 11.5px;
	text-transform: uppercase;
	letter-spacing: 0.08em;
}
.google-divider::before,
.google-divider::after {
	content: "";
	flex: 1;
	height: 1px;
	background: var(--line);
}

.google-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	width: 100%;
	min-height: 44px;
	padding: 11px;
	border: 1px solid var(--line-input);
	border-radius: 10px;
	background: var(--surface);
	color: var(--text-2);
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
	transition: border-color 0.15s, color 0.15s;
}
.google-btn:hover {
	border-color: var(--blue);
	color: var(--blue);
}
.google-btn svg { width: 18px; height: 18px; flex-shrink: 0; }

/* Banner de error del login con Google (?googleError=...) */
.google-error-banner {
	background: var(--danger-bg);
	border: 1px solid var(--danger-line);
	color: var(--danger);
	border-radius: 10px;
	padding: 12px 14px;
	font-size: 13px;
	line-height: 1.45;
	margin: 0 0 18px;
	display: flex;
	gap: 10px;
	align-items: flex-start;
}
.google-error-banner .pi {
	font-size: 16px;
	color: var(--danger);
	margin-top: 1px;
	flex-shrink: 0;
}

/* Banner "sesion cerrada por inicio en otro lugar" (kicked=1) */
.kicked-banner {
	background: var(--warn-bg);
	border: 1px solid var(--warn-line);
	color: var(--warn-text);
	border-radius: 10px;
	padding: 12px 14px;
	font-size: 13px;
	line-height: 1.45;
	margin: 0 0 18px;
	display: flex;
	gap: 10px;
	align-items: flex-start;
}
.kicked-banner .pi {
	font-size: 16px;
	color: var(--warn-strong);
	margin-top: 1px;
	flex-shrink: 0;
}

/* ── Ayuda por WhatsApp en el login (2026-10-06) ─────────────────────
   Botón secundario a todo el ancho, como "Continuar con Google", con el
   verde de WhatsApp sólo en el icono. Tras un intento fallido se resalta
   (fondo y borde verdes) y aparece la línea explicativa. */
.wa-ayuda { margin-top: 18px; }
.wa-ayuda-txt {
	display: block;
	margin: 0 0 8px;
	font-size: 13px;
	color: var(--text-2);
}
.login-footer a.wa-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	width: 100%;
	min-height: 44px;
	padding: 11px;
	border: 1px solid var(--line-input);
	border-radius: 10px;
	background: var(--surface);
	color: var(--text-2);
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
	transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.login-footer a.wa-btn .pi { font-size: 20px; color: #25D366; flex-shrink: 0; }
.login-footer a.wa-btn:hover { border-color: #25D366; color: #128C7E; text-decoration: none; }
.wa-ayuda-destacada a.wa-btn { background: var(--ok-bg); border-color: #25D366; color: #128C7E; }

/* ── Responsive movil / tablet ──────────────────────────────────────
   Compartido por login.xhtml y register.xhtml. Los dos paneles lado a
   lado no caben en pantallas angostas: se apilan en columna y el
   branding se reduce al logo (el formulario es lo que el usuario vino
   a usar; hero y features son decorativos en movil). */
@media (max-width: 900px) {
	.login-wrapper { flex-direction: column; }
	.login-brand {
		flex: 0 0 auto;
		padding: 20px 22px;
	}
	.brand-hero, .brand-features { display: none; }
	.login-form-side {
		flex: 1 1 auto;
		align-items: flex-start; /* permite scrollear cuando el teclado en pantalla acorta el viewport */
		padding: 24px 16px 32px;
	}
	.login-form-panel {
		max-width: 480px;
		padding: 28px 22px;
	}
}

/* Inputs con fuente mayor o igual a 16px en tactil: Safari iOS hace zoom
   automatico al enfocar campos con fuente menor y descoloca el layout. */
@media (hover: none) and (pointer: coarse) {
	.login-field .ui-inputfield { font-size: 16px; }
}

/* ── Clave de acceso (passkey) en el login (2026-09-09) ───────────── */
.passkey-btn .pi { font-size: 18px; color: var(--blue); }
.passkey-btn:disabled { opacity: .6; cursor: progress; }
.passkey-error { margin: 12px 0 0; }
/* El banner de error nace oculto (atributo hidden); .google-error-banner fija
   display y lo pisaría, así que se refuerza aquí. */
.passkey-error[hidden] { display: none; }
