/* ============================================
   Custom Login Styles - Optimizado
   ============================================ */

/* IMPORTANTE: Remover el fondo del body para que no compita con ::after */
body[data-path="login"] {
    background: #000 !important; /* Fondo sólido oscuro */
    min-height: 100vh !important;
    position: relative;
    overflow: hidden;
}

body[data-path="login"] .page-content-wrapper {
    min-height: 100vh !important;
    position: relative;
}

/* Capa 1: Imagen con blur (más atrás) */
body[data-path="login"]::before {
    content: '';
    position: fixed;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    width: calc(100% + 20px);
    height: calc(100% + 20px);
    background-image: url('/assets/custom_login/images/wallpaper.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    filter: blur(8px);
    -webkit-filter: blur(8px);
    z-index: -2;
    transform: scale(1.1); /* Evita bordes blancos del blur */
}

/* Capa 2: Overlay oscuro (encima del blur) */
body[data-path="login"]::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5); /* Ajusta la opacidad aquí */
    z-index: -1;
    pointer-events: none;
}

/* Centrado general */
body[data-path="login"] .page-content-wrapper {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 100vh !important;
    position: relative;
    z-index: 1;
}

body[data-path="login"] .page-content-wrapper main.container {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    margin: 0 !important;
    width: 100% !important;
    position: relative;
    z-index: 2;
}

/* Contenedor principal del login */
body[data-path="login"] .page_content {
    display: flex !important;
    justify-content: center !important;
    width: 100% !important;
    max-width: 450px !important;
    position: relative;
    z-index: 3;
}

body[data-path="login"] .page_content > div {
    width: 100% !important;
}

/* Tarjeta del login con efecto glassmorphism */
body[data-path="login"] .login-content.page-card {
    background: rgba(255, 255, 255, 0.9) !important;
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 16px;
    position: relative;
    z-index: 4;
}

/* Mensaje de Sign up */
body[data-path="login"] .sign-up-message {
    position: relative;
    z-index: 3;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

body[data-path="login"] .sign-up-message a {
    color: #fff;
    font-weight: 600;
    text-decoration: underline;
}

/* Encabezado */
body[data-path="login"] .page-card-head {
    padding: 2rem 0;
    margin: 0 auto;
    text-align: center;
    font-size: 1.25rem;
    font-weight: 600;
}

/* Logo */
body[data-path="login"] .app-logo {
    max-width: 200px;
    max-height: 80px;
    height: auto;
    object-fit: contain;
    margin-bottom: 1rem;
}

/* Botones */
body[data-path="login"] .btn-login.btn-primary {
    background-color: #ff6b15 !important;
    border-color: #ff6b15 !important;
    transition: all 0.3s ease;
    font-weight: 600;
}

body[data-path="login"] .btn-login.btn-primary:hover {
    background-color: #e65f12 !important;
    border-color: #e65f12 !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 107, 21, 0.4);
}

body[data-path="login"] .btn-login.btn-primary:active,
body[data-path="login"] .btn-login.btn-primary:focus {
    background-color: #cc5410 !important;
    border-color: #cc5410 !important;
    box-shadow: 0 0 0 0.2rem rgba(255, 107, 21, 0.25) !important;
    transform: translateY(0);
}

/* Accesibilidad */
body[data-path="login"] .btn-login.btn-primary:focus-visible {
    outline: 2px solid #ff6b15;
    outline-offset: 2px;
}

/* Links */
body[data-path="login"] .forgot-password-message a {
    color: #ff6b15;
    font-weight: 500;
}

body[data-path="login"] .forgot-password-message a:hover {
    color: #e65f12;
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
    body[data-path="login"] .page_content {
        max-width: 95% !important;
        padding: 0 15px;
    }

    body[data-path="login"] .login-content.page-card {
        margin: 20px 0;
        border-radius: 12px;
    }

    body[data-path="login"] .app-logo {
        max-width: 150px;
        max-height: 60px;
    }

    body[data-path="login"] .page-card-head {
        padding: 1.5rem 0;
    }
}

/* Optimización de rendimiento */
body[data-path="login"]::before,
body[data-path="login"]::after {
    will-change: transform;
}

/* Fix para navegadores que no soportan backdrop-filter */
@supports not (backdrop-filter: blur(16px)) {
    body[data-path="login"] .login-content.page-card {
        background: rgba(255, 255, 255, 0.95) !important;
    }
}