/* ============================================================
   Login · split screen, flat, auto-alojado
   Usa los tokens de public/css/tokens.css (cargado antes que este).
   Reglas: sin gradientes, sin rgba, sin sombras difusas, radios 0/2/4.
   ============================================================ */

/* --- Layout ------------------------------------------------- */
.lg-split { display: flex; min-height: 100vh; min-height: 100dvh; background: #f1f5f9; font-family: var(--ospos-font-body); }
.lg-form-side { flex: 1 1 42%; order: 2; display: flex; justify-content: center; overflow-y: auto; padding: 2rem 1.5rem; min-width: 0; background: #ffffff; }
.lg-container { width: 100%; max-width: 440px; margin: auto; }

/* --- Panel de marca (solo >= 768px) ------------------------- */
.lg-brand-side { display: none; position: relative; order: 1; overflow: hidden; }
.lg-brand-side::before { content: ""; position: absolute; top: 0; right: 0; bottom: 0; left: 0; background-image: linear-gradient(to right, rgba(255,255,255,0.05) 1px, transparent 1px), linear-gradient(to bottom, rgba(255,255,255,0.05) 1px, transparent 1px); background-size: 32px 32px; pointer-events: none; }
.lg-brand-side::after { content: ""; position: absolute; top: -80px; left: -80px; width: 384px; height: 384px; border-radius: 50%; background: rgba(37,99,235,0.3); filter: blur(80px); pointer-events: none; }
.lg-brand-content { display: flex; flex-direction: column; justify-content: space-between; width: 100%; max-width: 620px; height: 100%; text-align: left; position: relative; z-index: 1; }
.lg-brand-main { margin: auto 0; }
.lg-brand-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; width: 100%; }
.lg-brand-identity { display: flex; align-items: center; gap: 0.75rem; min-width: 0; order: 1; }
.lg-brand-id { display: grid; grid-template-columns: auto auto; align-items: center; column-gap: 0.5rem; row-gap: 0.15rem; min-width: 0; }
.lg-brand-logo { display: inline-flex; align-items: center; justify-content: center; width: 46px; height: 46px; padding: 0.4rem; background: var(--ospos-primary-active); border: 1px solid var(--ospos-panel-rule); border-radius: var(--ospos-radius); color: var(--ospos-on-dark); flex: 0 0 auto; }
.lg-brand-name { font-family: var(--ospos-font-title); font-size: var(--ospos-fs-lg); font-weight: 700; letter-spacing: -0.01em; color: var(--ospos-on-dark); text-align: left; line-height: 1.15; }
.lg-brand-tagline { font-size: var(--ospos-fs-xs); font-weight: 500; color: var(--ospos-on-dark-3); margin: 0; text-align: left; grid-column: 1 / -1; }
.lg-brand-title { font-family: var(--ospos-font-title); font-size: var(--ospos-fs-display); font-weight: 700; line-height: 1.2; margin: 0 0 0.75rem; letter-spacing: -0.02em; color: var(--ospos-on-dark); text-align: left; }
.lg-brand-hl { background: linear-gradient(to right, #93c5fd, #c7d2fe); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lg-brand-subtitle { font-size: var(--ospos-fs-lg); line-height: 1.6; margin: 0 0 1.75rem; max-width: 34em; color: var(--ospos-on-dark-2); font-weight: 400; text-align: left; }

/* --- Sectores: cuatro giros como tarjetas (icono + título + detalle) ---
   El heading lleva un filete de 1px que agrupa sin dibujar cajas. */
.lg-sectors-wrap { width: 100%; }
.lg-sectors-title { display: flex; align-items: center; gap: 0.75rem; font-size: var(--ospos-fs-sm); font-weight: 700; color: var(--ospos-on-dark-2); margin: 0 0 0.9rem; }
.lg-sectors-title::after { content: ""; flex: 1; height: 1px; background: var(--ospos-panel-rule); }
.lg-sectors { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.6rem; width: 100%; }
.lg-sector { display: flex; flex-direction: column; gap: 0.4rem; padding: 0.8rem; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); border-radius: 12px; min-width: 0; }
.lg-sector-icon { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 8px; color: var(--ospos-on-dark); margin-bottom: 0.15rem; }
.lg-sector--store .lg-sector-icon { background: var(--ospos-m-blue-bg); color: var(--ospos-m-blue-fg); }
.lg-sector--food .lg-sector-icon { background: var(--ospos-m-amber-bg); color: var(--ospos-m-amber-fg); }
.lg-sector--health .lg-sector-icon { background: var(--ospos-m-emerald-bg); color: var(--ospos-m-emerald-fg); }
.lg-sector--service .lg-sector-icon { background: var(--ospos-m-violet-bg); color: var(--ospos-m-violet-fg); }
.lg-sector-icon svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.lg-sector-title { font-size: var(--ospos-fs-sm); font-weight: 600; color: var(--ospos-on-dark); line-height: 1.2; }
.lg-sector-desc { font-size: var(--ospos-fs-xs); color: var(--ospos-on-dark-3); line-height: 1.3; }

/* --- Pie de confianza del panel ------------------------------ */
.lg-brand-foot { display: flex; flex-direction: column; align-items: flex-start; gap: 1rem; width: 100%; margin-top: 2rem; padding-top: 1.25rem; border-top: 1px solid rgba(255,255,255,0.1); }
.lg-trust { display: flex; align-items: center; gap: 0.75rem; }
.lg-avatars { display: inline-flex; }
.lg-avatar { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 50%; background: var(--ospos-primary-active); color: var(--ospos-on-dark); font-size: var(--ospos-fs-xs); font-weight: 700; border: 2px solid var(--ospos-primary-dark); }
.lg-avatar:nth-child(1) { background: var(--ospos-m-blue-fg); }
.lg-avatar:nth-child(2) { background: var(--ospos-m-indigo-fg); }
.lg-avatar:nth-child(3) { background: var(--ospos-m-sky-fg); }
.lg-avatar + .lg-avatar { margin-left: -6px; }
.lg-trust-meta { display: flex; flex-direction: column; gap: 0.1rem; }
.lg-stars { font-size: var(--ospos-fs-sm); letter-spacing: 0.1em; color: var(--ospos-star); line-height: 1; }
.lg-trust-text { font-size: var(--ospos-fs-xs); font-weight: 500; color: var(--ospos-on-dark-2); }
.lg-secure { font-size: var(--ospos-fs-xs); font-weight: 500; color: var(--ospos-on-dark-3); }

/* --- Cabecera de marca móvil (solo < 768px) ------------------ */
.lg-mobile-header { display: flex; flex-direction: column; gap: 0.85rem; background: linear-gradient(to bottom, #0b1e4f, #122e70); padding: 1.5rem 1.25rem 2.5rem; border-bottom-left-radius: 35px; border-bottom-right-radius: 35px; }
.lg-mobile-brand { display: flex; align-items: center; gap: 0.75rem; }
.lg-mobile-logo { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0.4rem; background: var(--ospos-primary-active); border: 1px solid var(--ospos-panel-rule); border-radius: var(--ospos-radius); color: var(--ospos-on-dark); flex: 0 0 auto; }
.lg-mobile-name { font-family: var(--ospos-font-title); font-size: var(--ospos-fs-lg); font-weight: 700; color: var(--ospos-on-dark); line-height: 1.15; }
.lg-mobile-tagline { margin: 0; font-size: var(--ospos-fs-xs); font-weight: 500; color: var(--ospos-on-dark-3); }

/* --- Tarjeta y cabecera del formulario ----------------------- */
.lg-card { background: transparent; border: none; border-radius: 0; box-shadow: none; padding: 0; }
.lg-header { text-align: left; margin-bottom: 1.75rem; }
.lg-terminal-chip { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.3rem 0.7rem; background: #f1f5f9; border: none; border-radius: 9999px; color: #334155; font-size: var(--ospos-fs-xs); font-weight: 600; margin-bottom: 1rem; }
.lg-terminal-chip svg { width: 15px; height: 15px; color: var(--ospos-primary); }
.lg-title { font-family: var(--ospos-font-title); font-size: var(--ospos-fs-2xl); font-weight: 600; color: var(--ospos-text); margin: 0 0 0.25rem; letter-spacing: -0.02em; }
.lg-subtitle { font-size: var(--ospos-fs-md); color: var(--ospos-text-2); margin: 0; font-weight: 400; }

/* --- Marca (logo OSPOS) ------------------------------------- */
.lg-mark-svg { width: 100%; height: 100%; display: block; }
.lg-mark-svg .lg-logo-knockout { fill: var(--ospos-primary-active); }
.lg-mark-img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }

/* --- Avisos ------------------------------------------------- */
.lg-alert { padding: 0.75rem 1rem; border-radius: var(--ospos-radius); font-size: var(--ospos-fs-sm); margin-bottom: 1rem; line-height: 1.5; }
.lg-alert-danger { background: var(--ospos-danger-bg); color: var(--ospos-danger); border: 1px solid var(--ospos-danger-border); }
.lg-alert-info { background: var(--ospos-surface); color: var(--ospos-primary-dark); border: 1px solid var(--ospos-border-soft); }

/* --- Campos ------------------------------------------------- */
.lg-field { position: relative; margin-bottom: 1.25rem; }
.lg-input { width: 100%; padding: 0.875rem 1rem 0.875rem 2.75rem; font-size: var(--ospos-fs-md); font-family: inherit; color: var(--ospos-text); background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 12px; outline: none; transition: border-color 200ms ease; }
.lg-input:focus { border-color: #2563eb; background: #ffffff; outline: none; box-shadow: 0 0 0 4px rgba(37,99,235,0.15); }
.lg-input.has-icon { padding-left: 2.75rem; }
.lg-input.has-reveal { padding-right: 2.75rem; }
.lg-input::placeholder { color: var(--ospos-text-3); opacity: 1; }
.lg-input:-ms-input-placeholder { color: var(--ospos-text-3); }
.lg-input::-ms-input-placeholder { color: var(--ospos-text-3); }

.lg-label { position: absolute; left: 2.75rem; top: 50%; transform: translateY(-50%); color: var(--ospos-text-3); font-size: var(--ospos-fs-md); pointer-events: none; transition: top 200ms ease, left 200ms ease, font-size 200ms ease, color 200ms ease; background: var(--ospos-surface); padding: 0 0.25rem; }
.lg-form-floating .lg-input { padding: 1.35rem 1rem 0.85rem 2.75rem; }
.lg-form-floating .lg-input:focus ~ .lg-label,
.lg-form-floating .lg-input:not(:placeholder-shown) ~ .lg-label { top: 0.45rem; left: 2rem; font-size: var(--ospos-fs-xs); color: var(--ospos-primary); font-weight: 500; }

.lg-field-icon { position: absolute; left: 0.875rem; top: 50%; transform: translateY(-50%); width: 1.125rem; height: 1.125rem; color: var(--ospos-text-3); pointer-events: none; transition: color 200ms ease; z-index: 2; }
.lg-field-icon.input-icon { pointer-events: auto; }
.lg-input:focus ~ .lg-field-icon,
.lg-input:focus + .lg-field-icon { color: var(--ospos-primary); }
.lg-field-icon svg { width: 100%; height: 100%; display: block; }

/* --- Mostrar/ocultar contraseña ----------------------------- */
.lg-reveal { position: absolute; right: 0.5rem; top: 50%; transform: translateY(-50%); width: 2rem; height: 2rem; display: flex; align-items: center; justify-content: center; padding: 0; background: transparent; border: none; border-radius: var(--ospos-radius); color: var(--ospos-text-3); cursor: pointer; z-index: 2; }
.lg-reveal:hover { color: var(--ospos-primary); }
.lg-reveal:focus-visible { outline: 2px solid var(--ospos-primary); outline-offset: 1px; }
.lg-reveal svg { width: 1.125rem; height: 1.125rem; }
.lg-reveal .lg-eye-off { display: none; }
.lg-reveal.is-shown .lg-eye { display: none; }
.lg-reveal.is-shown .lg-eye-off { display: block; }

/* --- Botón -------------------------------------------------- */
.lg-btn { width: 100%; padding: 0.875rem 1.5rem; font-size: var(--ospos-fs-lg); font-weight: 600; font-family: inherit; color: var(--ospos-surface); background: #2563eb; border: 1px solid #2563eb; border-radius: 12px; box-shadow: 0 4px 6px -1px rgba(37,99,235,0.3); cursor: pointer; transition: background-color 200ms ease, border-color 200ms ease; margin-top: 0.25rem; letter-spacing: 0.01em; position: relative; }
.lg-btn:hover { background: #1d4ed8; border-color: #1d4ed8; }
.lg-btn:active { background: #1e40af; border-color: #1e40af; }
.lg-btn:focus-visible { outline: 2px solid var(--ospos-primary); outline-offset: 2px; }
.lg-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.lg-btn-loader { display: none; align-items: center; justify-content: center; gap: 0.5rem; }
.lg-btn.loading .lg-btn-text { display: none; }
.lg-btn.loading .lg-btn-loader { display: flex; }
.lg-switch-form { margin: 0; }
.lg-btn-secondary { background: transparent; border: 1px solid #cbd5e1; color: #2B4A8C; box-shadow: none; margin-top: 0.5rem; }
.lg-btn-secondary:hover { background: #f1f5f9; border-color: #94a3b8; color: #1e3a8a; }
.lg-session-active { display: flex; flex-direction: column; gap: 0.75rem; margin-top: 1rem; }
.lg-session-text { font-size: var(--ospos-fs-md); color: #334155; margin: 0.5rem 0 0.75rem; text-align: center; }
.lg-session-text strong { color: #1e293b; }
/* El spinner solo gira mientras se envía (acción del usuario), no en perpetuo */
.lg-spinner { width: 18px; height: 18px; border: 2px solid var(--ospos-primary-active); border-top-color: var(--ospos-surface); border-radius: 50%; animation: lgSpin 0.8s linear infinite; }
@keyframes lgSpin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .lg-spinner { animation: none; } }

/* --- Pie ---------------------------------------------------- */
.lg-footer { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.85rem; color: var(--ospos-text-2); font-size: var(--ospos-fs-xs); margin-top: 1.75rem; }
.lg-footer-top { display: flex; align-items: center; justify-content: center; gap: 0.5rem; }
.lg-footer-top svg { opacity: 0.6; width: 20px; height: 20px; }
.lg-footer-cta { margin: 0; font-size: var(--ospos-fs-sm); font-weight: 600; color: var(--ospos-text); }
.lg-footer-wa { display: flex; justify-content: center; align-items: center; gap: 0.5rem; width: 100%; padding: 0.7rem 1rem; background: #059669; color: var(--ospos-surface); font-size: var(--ospos-fs-sm); font-weight: 600; border-radius: 12px; text-decoration: none; transition: background-color 200ms ease; }
.lg-footer-wa:hover { background: #047857; color: var(--ospos-surface); text-decoration: none; }
.lg-footer-wa svg { width: 17px; height: 17px; fill: currentColor; opacity: 1; }
.lg-footer-mail { color: var(--ospos-text-2); font-size: var(--ospos-fs-xs); text-decoration: underline; }
.lg-footer-tls { margin: 0.25rem 0 0; max-width: 30em; font-size: var(--ospos-fs-xs); line-height: 1.4; color: var(--ospos-text-3); text-align: center; }

.g-recaptcha { transform: scale(0.92); transform-origin: center; margin: 0.5rem 0 1rem; }

/* --- Adaptaciones ------------------------------------------- */
@media (min-width: 768px) {
.lg-mobile-header { display: none; }
.lg-brand-side { display: flex; flex: 1 1 58%; flex-direction: column; align-items: stretch; justify-content: center; background: linear-gradient(to bottom right, #0f172a, #1e3a8a 60%, #1e3a8a); padding: 2.5rem 3rem; overflow-y: auto; }
.lg-brand-content { flex: 1; margin: 0 auto; }
.lg-brand-foot { flex-direction: row; align-items: center; justify-content: space-between; }
.lg-form-side { background: var(--ospos-surface); }
}

@media (min-width: 992px) {
.lg-sectors { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 767px) {
.lg-form-side { padding: 0 0 1.5rem; background: #f8fafc; flex-direction: column; align-items: stretch; justify-content: flex-start; }
.lg-mobile-header { width: 100%; box-sizing: border-box; }
.lg-container { margin: 0 auto; }
.lg-footer-trust .lg-trust-text { color: var(--ospos-text-2); }
.lg-mobile-chips { flex-wrap: nowrap; }
.lg-mobile-chips .lg-chip { white-space: nowrap; }
.lg-container { padding: 0 1rem; margin-top: -1.5rem; }
.lg-card { background: var(--ospos-surface); border: 1px solid #e2e8f0; border-radius: 16px; padding: 1.25rem; box-shadow: 0 1px 2px rgba(0,0,0,0.05); }
}

@media (max-width: 480px) {
.lg-title { font-size: var(--ospos-fs-xl); }
.lg-input { padding: 0.8rem 0.875rem 0.8rem 2.5rem; font-size: var(--ospos-fs-md); }
.lg-input.has-reveal { padding-right: 2.5rem; }
.lg-form-floating .lg-input { padding: 1.2rem 0.875rem 0.75rem 2.5rem; }
.lg-label { left: 2.5rem; }
.lg-form-floating .lg-input:focus ~ .lg-label,
.lg-form-floating .lg-input:not(:placeholder-shown) ~ .lg-label { left: 1.75rem; }
.lg-field-icon { left: 0.75rem; width: 1rem; height: 1rem; }
.lg-reveal { right: 0.4rem; }
.lg-btn { padding: 0.8rem; font-size: var(--ospos-fs-md); }
.g-recaptcha { transform: scale(0.85); }
}

@media (min-width: 1200px) {
.lg-container { max-width: 440px; }
}

/* --- Piezas del mockup (desktop + móvil) ------------------------ */
.lg-brand-badge { display: inline-flex; align-items: center; align-self: flex-start; padding: 0.25rem 0.75rem; margin-bottom: 1.5rem; border-radius: 9999px; background: rgba(59,130,246,0.1); border: 1px solid rgba(96,165,250,0.2); color: #bfdbfe; font-size: var(--ospos-fs-xs); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
.lg-brand-hl { font-weight: 700; }
.lg-brand-name { white-space: nowrap; }
.lg-brand-head { flex-wrap: wrap; row-gap: 0.75rem; }
.lg-brand-secure { font-size: var(--ospos-fs-xs); font-weight: 500; color: rgba(147,197,253,0.6); }
.lg-status-chip { order: 2; display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.4rem 0.75rem; border-radius: 9999px; background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.1); color: #dbeafe; font-size: var(--ospos-fs-xs); font-weight: 600; white-space: nowrap; }
.lg-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #34d399; flex: 0 0 auto; }
.lg-badge { display: inline-flex; align-items: center; padding: 0.125rem 0.5rem; border-radius: 9999px; background: rgba(16,185,129,0.2); border: 1px solid rgba(16,185,129,0.3); color: #6ee7b7; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; white-space: nowrap; }
.lg-mobile-chips { display: flex; justify-content: space-between; gap: 0.5rem; position: relative; z-index: 1; }
.lg-chip { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.25rem 0.625rem; border-radius: 9999px; background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.1); color: #e2e8f0; font-size: 11px; font-weight: 500; }
.lg-chip-ok { background: rgba(16,185,129,0.15); border-color: rgba(52,211,153,0.25); color: #6ee7b7; }
.lg-topbar { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding-bottom: 1.5rem; }
.lg-topbar .lg-terminal-chip { margin-bottom: 0; }
.lg-ip { font-size: var(--ospos-fs-xs); font-weight: 500; color: #94a3b8; }
.lg-form-icon { display: flex; align-items: center; justify-content: center; width: 56px; height: 56px; margin-bottom: 1rem; border-radius: 16px; background: linear-gradient(to top right, #1d4ed8, #3b82f6); color: #ffffff; box-shadow: 0 4px 6px -1px rgba(59,130,246,0.2); }
.lg-form-icon svg { width: 28px; height: 28px; }
.lg-forgot-row { display: flex; justify-content: flex-end; margin: -0.75rem 0 1rem; }
.lg-forgot { font-size: var(--ospos-fs-xs); font-weight: 600; color: #2563eb; text-decoration: none; }
.lg-forgot:hover { color: #1d4ed8; text-decoration: underline; }
.lg-remember-row { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin: 0 0 1.25rem; }
.lg-remember { display: flex; align-items: center; gap: 0.5rem; margin: 0; font-size: var(--ospos-fs-xs); font-weight: 500; color: #475569; cursor: pointer; }
.lg-remember input { width: 16px; height: 16px; margin: 0; accent-color: #2563eb; }
.lg-btn-text { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; }
.lg-btn-arrow { width: 16px; height: 16px; }
.lg-pin-row { display: flex; justify-content: center; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid #f1f5f9; }
.lg-pin { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.25rem 0.5rem; background: none; border: none; border-radius: 4px; font-family: inherit; font-size: var(--ospos-fs-xs); font-weight: 600; color: #475569; cursor: pointer; }
.lg-pin svg { width: 16px; height: 16px; color: #94a3b8; }
.lg-pin:hover { color: #2563eb; }
.lg-footer-trust { display: none; align-items: center; justify-content: center; gap: 0.5rem; font-size: var(--ospos-fs-xs); }

@media (max-width: 767px) {
.lg-form-icon, .lg-ip { display: none; }
.lg-footer-trust { display: flex; }
.lg-footer-wa { background: #00a884; }
.lg-footer-wa:hover { background: #008f6f; }
}

/* Pantallas bajas: compacta el panel de marca para que quepa sin scroll */
@media (min-width: 768px) and (max-height: 860px) {
.lg-brand-side { padding: 1.5rem 3rem; justify-content: flex-start; }
.lg-brand-head { margin-bottom: 1rem; }
.lg-brand-logo { width: 46px; height: 46px; }
.lg-brand-title { font-size: var(--ospos-fs-2xl); margin: 0.6rem 0 0.4rem; }
.lg-brand-subtitle { font-size: var(--ospos-fs-md); margin-bottom: 1.1rem; }
.lg-sectors-title { margin-bottom: 0.6rem; }
.lg-sectors { gap: 0.5rem; }
.lg-sector-icon { width: 26px; height: 26px; }
.lg-sector-icon svg { width: 15px; height: 15px; }
.lg-brand-foot { margin-top: 1.25rem; padding-top: 1rem; }
}
