/* ============================================================
   LOGIN PREMIUM — Luciesteban ERP
   Diseño: split-screen con glass-morphism, floating labels,
   micro-animaciones y paleta financiera corporativa.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ── Reset de AdminLTE para la página de login ── */
body.hold-transition {
    overflow: hidden !important;
    background: #0A1628 !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* ── Contenedor principal full-screen ── */
.lp-wrap {
    position: fixed;
    inset: 0;
    display: flex;
    font-family: 'Inter', 'Source Sans Pro', sans-serif;
    z-index: 9999;
}

/* ═══════════════════════════════════════════════════
   PANEL IZQUIERDO — Branding
   ═══════════════════════════════════════════════════ */
.lp-left {
    width: 45%;
    background: linear-gradient(145deg, #060F1E 0%, #0D1B35 45%, #0A2040 100%);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Grid de puntos sutil */
.lp-left::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle, rgba(59,130,246,0.18) 1px, transparent 1px);
    background-size: 32px 32px;
    pointer-events: none;
}

/* Rayo de luz superior */
.lp-left::after {
    content: '';
    position: absolute;
    top: -80px;
    left: -80px;
    width: 420px;
    height: 420px;
    background: radial-gradient(circle, rgba(59,130,246,0.12) 0%, transparent 70%);
    pointer-events: none;
}

/* Círculos de resplandor flotantes */
.lp-glow {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    filter: blur(60px);
}
.lp-glow-1 {
    width: 380px; height: 380px;
    background: rgba(59, 130, 246, 0.14);
    top: -100px; left: -100px;
    animation: lp-float1 9s ease-in-out infinite;
}
.lp-glow-2 {
    width: 260px; height: 260px;
    background: rgba(99, 102, 241, 0.12);
    bottom: -60px; right: -60px;
    animation: lp-float2 12s ease-in-out infinite;
}
.lp-glow-3 {
    width: 160px; height: 160px;
    background: rgba(245, 158, 11, 0.08);
    top: 55%; right: 8%;
    animation: lp-float3 8s ease-in-out infinite;
}

@keyframes lp-float1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50%       { transform: translate(25px, 35px) scale(1.06); }
}
@keyframes lp-float2 {
    0%, 100% { transform: translate(0, 0); }
    50%       { transform: translate(-20px, -30px); }
}
@keyframes lp-float3 {
    0%, 100% { transform: translateY(0) scale(1); }
    50%       { transform: translateY(-35px) scale(1.1); }
}

/* Contenido de branding */
.lp-brand {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 40px 50px;
    color: #fff;
    animation: lp-slideRight 0.75s cubic-bezier(0.22,1,0.36,1) both;
}

@keyframes lp-slideRight {
    from { opacity: 0; transform: translateX(-36px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* Logo */
.lp-logo-wrap {
    width: 88px;
    height: 88px;
    background: rgba(255,255,255,0.07);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.13);
    border-radius: 22px;
    margin: 0 auto 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 32px rgba(0,0,0,0.35), 0 0 0 1px rgba(255,255,255,0.06) inset;
    transition: transform 0.4s ease;
}
.lp-logo-wrap:hover {
    transform: scale(1.04) translateY(-2px);
}
.lp-logo-wrap img {
    width: 58px;
    height: 58px;
    object-fit: contain;
    filter: brightness(1.15) drop-shadow(0 2px 8px rgba(59,130,246,0.4));
}

/* Nombre de la empresa */
.lp-company {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.6px;
    margin: 0 0 6px;
    background: linear-gradient(135deg, #FFFFFF 0%, #93C5FD 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Badge de sistema */
.lp-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 13px;
    background: rgba(59,130,246,0.15);
    border: 1px solid rgba(59,130,246,0.3);
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
    color: rgba(255,255,255,0.65);
    letter-spacing: 0.8px;
    text-transform: uppercase;
    margin-bottom: 36px;
}
.lp-badge i {
    color: #60A5FA;
    font-size: 0.7rem;
}

/* Separador decorativo */
.lp-sep {
    width: 36px;
    height: 3px;
    background: linear-gradient(90deg, #3B82F6, #818CF8);
    border-radius: 3px;
    margin: 0 auto 32px;
}

/* Features */
.lp-features {
    display: flex;
    flex-direction: column;
    gap: 12px;
    text-align: left;
}

.lp-feature {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 13px 18px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 13px;
    transition: background 0.3s, border-color 0.3s, transform 0.3s;
    cursor: default;
}
.lp-feature:hover {
    background: rgba(59,130,246,0.1);
    border-color: rgba(59,130,246,0.2);
    transform: translateX(4px);
}

.lp-feature-icon {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, #1D4ED8, #3B82F6);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #fff;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(59,130,246,0.35);
}
.lp-feature-icon.amber {
    background: linear-gradient(135deg, #B45309, #F59E0B);
    box-shadow: 0 4px 12px rgba(245,158,11,0.3);
}
.lp-feature-icon.violet {
    background: linear-gradient(135deg, #5B21B6, #8B5CF6);
    box-shadow: 0 4px 12px rgba(139,92,246,0.3);
}

.lp-feature-text strong {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: rgba(255,255,255,0.9);
    margin-bottom: 2px;
}
.lp-feature-text span {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.45);
}

/* Año / legal */
.lp-legal {
    margin-top: 36px;
    font-size: 0.72rem;
    color: rgba(255,255,255,0.25);
    letter-spacing: 0.3px;
}

/* ═══════════════════════════════════════════════════
   PANEL DERECHO — Formulario
   ═══════════════════════════════════════════════════ */
.lp-right {
    flex: 1;
    background: #F1F5F9;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    position: relative;
    overflow: hidden;
}

/* Decoración de fondo derecho */
.lp-right::before {
    content: '';
    position: absolute;
    top: -120px; right: -120px;
    width: 350px; height: 350px;
    background: radial-gradient(circle, rgba(59,130,246,0.06) 0%, transparent 70%);
    pointer-events: none;
}

/* Tarjeta del formulario */
.lp-card {
    width: 100%;
    max-width: 420px;
    background: #FFFFFF;
    border-radius: 24px;
    padding: 44px 40px 36px;
    box-shadow:
        0 1px 3px rgba(0,0,0,0.04),
        0 8px 24px rgba(0,0,0,0.06),
        0 20px 48px rgba(0,0,0,0.04);
    border: 1px solid rgba(226,232,240,0.8);
    animation: lp-slideLeft 0.75s cubic-bezier(0.22,1,0.36,1) both;
    animation-delay: 0.05s;
}

@keyframes lp-slideLeft {
    from { opacity: 0; transform: translateX(36px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* Header del formulario */
.lp-form-header {
    margin-bottom: 36px;
}

.lp-form-kicker {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: #3B82F6;
    margin-bottom: 8px;
}

.lp-form-title {
    font-size: 1.75rem;
    font-weight: 800;
    color: #0F172A;
    margin: 0 0 6px;
    letter-spacing: -0.5px;
}

.lp-form-sub {
    font-size: 0.875rem;
    color: #94A3B8;
    margin: 0;
    font-weight: 400;
}

/* ── Grupos de input con floating label ── */
.lp-field {
    position: relative;
    margin-bottom: 20px;
}

.lp-field-icon {
    position: absolute;
    left: 17px;
    top: 50%;
    transform: translateY(-50%);
    color: #CBD5E1;
    font-size: 14px;
    z-index: 2;
    pointer-events: none;
    transition: color 0.25s;
}

.lp-input {
    width: 100%;
    height: 56px;
    padding: 18px 48px 6px 44px;
    border: 1.5px solid #E2E8F0;
    border-radius: 13px;
    font-size: 0.9rem;
    font-family: 'Inter', inherit;
    font-weight: 500;
    color: #0F172A;
    background: #FAFBFC;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.25s, box-shadow 0.25s, background 0.25s;
    appearance: none;
    -webkit-appearance: none;
}

.lp-input:hover:not(:focus) {
    border-color: #CBD5E1;
    background: #F8FAFC;
}

.lp-input:focus {
    border-color: #3B82F6;
    background: #FFFFFF;
    box-shadow: 0 0 0 4px rgba(59,130,246,0.1);
}

/* Floating label */
.lp-label {
    position: absolute;
    left: 44px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.875rem;
    font-weight: 400;
    color: #94A3B8;
    pointer-events: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    background: transparent;
    padding: 0 2px;
    z-index: 1;
}

/* Label sube cuando hay valor o hay focus */
.lp-input:focus ~ .lp-label,
.lp-input:not(:placeholder-shown) ~ .lp-label {
    top: 10px;
    transform: translateY(0);
    font-size: 0.68rem;
    font-weight: 600;
    color: #3B82F6;
    letter-spacing: 0.3px;
}

/* Ícono activo cuando hay foco */
.lp-field:focus-within .lp-field-icon {
    color: #3B82F6;
}

/* Botón mostrar/ocultar contraseña */
.lp-pwd-toggle {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: #CBD5E1;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: color 0.2s, background 0.2s;
    z-index: 2;
    font-size: 13px;
    line-height: 1;
}
.lp-pwd-toggle:hover {
    color: #64748B;
    background: #F1F5F9;
}
.lp-pwd-toggle:focus {
    outline: none;
    color: #3B82F6;
}

/* ── Checkbox recordarme ── */
.lp-remember {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 4px 0 24px;
}

.lp-remember input[type="checkbox"] {
    width: 17px;
    height: 17px;
    accent-color: #3B82F6;
    cursor: pointer;
    border-radius: 4px;
    flex-shrink: 0;
}

.lp-remember label {
    font-size: 0.82rem;
    font-weight: 500;
    color: #64748B;
    cursor: pointer;
    margin: 0;
    user-select: none;
}

/* ── Botón principal ── */
.lp-btn {
    width: 100%;
    height: 54px;
    background: linear-gradient(135deg, #1D4ED8 0%, #3B82F6 100%);
    border: none;
    border-radius: 13px;
    color: #fff;
    font-size: 0.95rem;
    font-weight: 700;
    font-family: 'Inter', inherit;
    letter-spacing: 0.2px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 16px rgba(29,78,216,0.35), 0 1px 3px rgba(29,78,216,0.2);
    position: relative;
    overflow: hidden;
}

/* Shimmer effect on hover */
.lp-btn::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.12), transparent);
    transition: left 0.5s;
}
.lp-btn:hover::before {
    left: 100%;
}

.lp-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(29,78,216,0.42), 0 2px 6px rgba(29,78,216,0.25);
}

.lp-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(29,78,216,0.3);
}

.lp-btn:disabled,
.lp-btn.is-loading {
    opacity: 0.75;
    cursor: not-allowed;
    pointer-events: none;
    transform: none;
}

.lp-btn-icon {
    width: 30px;
    height: 30px;
    background: rgba(255,255,255,0.18);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.25s;
}
.lp-btn:hover .lp-btn-icon {
    transform: translateX(3px);
}

/* Spinner dentro del botón */
.lp-spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: lp-spin 0.7s linear infinite;
}
.lp-btn.is-loading .lp-spinner {
    display: block;
}
.lp-btn.is-loading .lp-btn-text,
.lp-btn.is-loading .lp-btn-icon {
    display: none;
}

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

/* ── Zona de mensajes de error ── */
#login-mensajes {
    display: none;
    margin-top: 16px;
    padding: 12px 16px;
    background: #FEF2F2;
    border: 1px solid #FECACA;
    border-radius: 10px;
    color: #DC2626;
    font-size: 0.82rem;
    font-weight: 500;
    align-items: center;
    gap: 8px;
}
#login-mensajes.show {
    display: flex;
}
#login-mensajes i {
    flex-shrink: 0;
    font-size: 14px;
}

/* Animación de sacudida en error */
@keyframes lp-shake {
    0%,100% { transform: translateX(0); }
    15%      { transform: translateX(-6px); }
    30%      { transform: translateX(6px); }
    45%      { transform: translateX(-5px); }
    60%      { transform: translateX(5px); }
    75%      { transform: translateX(-3px); }
    90%      { transform: translateX(3px); }
}
.lp-card.shake {
    animation: lp-shake 0.5s ease;
}

/* ── Pie del formulario ── */
.lp-form-footer {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #F1F5F9;
    text-align: center;
}

.lp-security-note {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: #94A3B8;
    font-weight: 400;
}
.lp-security-note i {
    color: #10B981;
    font-size: 12px;
}

/* ═══════════════════════════════════════════════════
   RESPONSIVE — Tablet/Móvil
   ═══════════════════════════════════════════════════ */
@media (max-width: 900px) {
    .lp-left { width: 42%; }
    .lp-brand { padding: 32px; }
    .lp-card  { padding: 36px 28px 28px; }
}

@media (max-width: 680px) {
    .lp-left { display: none; }
    .lp-right { background: linear-gradient(145deg, #060F1E 0%, #0D1B35 100%); }
    .lp-card {
        background: rgba(255,255,255,0.97);
        box-shadow: 0 20px 60px rgba(0,0,0,0.3);
        max-width: 380px;
    }
}
