﻿
/* ============================================
   Login Page - Power BI Dashboard Portal
   Estilos de Pagina de Inicio de Sesion
   ============================================ */
/* --- Variables CSS (Heredadas del panel) --- */
:root {
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --primary-light: #eff6ff;
    --sidebar-bg: #0f172a;
    --content-bg: #f1f5f9;
    --card-bg: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --radius: 0.75rem;
    --radius-sm: 0.5rem;
    --radius-lg: 1rem;
    --radius-xl: 1.25rem;
    --transition: all 0.25s ease;
}

/* --- Reset & Base --- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--content-bg);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    transition: var(--transition);
}

/* --- Scrollbar personalizado --- */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

    ::-webkit-scrollbar-thumb:hover {
        background: #94a3b8;
    }

/* ============================================
   LOGIN CONTAINER - Split Screen
   ============================================ */
.login-container {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* ============================================
   LADO IZQUIERDO - Branding/Visual
   ============================================ */
.login-branding {
    flex: 1;
    background: linear-gradient(135deg, var(--sidebar-bg) 0%, #1e3a5f 50%, #0f172a 100%);
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 3rem;
    overflow: hidden;
}

    /* Patron de fondo abstracto */
    .login-branding::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-image: radial-gradient(circle at 20% 80%, rgba(59, 130, 246, 0.15) 0%, transparent 50%), radial-gradient(circle at 80% 20%, rgba(139, 92, 246, 0.12) 0%, transparent 50%), radial-gradient(circle at 40% 40%, rgba(6, 182, 212, 0.08) 0%, transparent 40%);
        pointer-events: none;
    }

    /* Lineas decorativas animadas */
    .login-branding::after {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-image: linear-gradient(90deg, transparent 49.5%, rgba(255,255,255,0.02) 50%, transparent 50.5%), linear-gradient(0deg, transparent 49.5%, rgba(255,255,255,0.02) 50%, transparent 50.5%);
        background-size: 60px 60px;
        pointer-events: none;
    }

.branding-content {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 420px;
}

/* Logo grande */
.branding-logo {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary), #8b5cf6);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 2rem;
    box-shadow: 0 10px 40px rgba(59, 130, 246, 0.3);
}

    .branding-logo i {
        font-size: 2.2rem;
        color: #ffffff;
    }

.branding-title {
    font-size: 2rem;
    font-weight: 800;
    color: #ffffff;
    margin: 0 0 0.75rem;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.branding-subtitle {
    font-size: 1.05rem;
    color: #94a3b8;
    margin: 0 0 2.5rem;
    font-weight: 400;
    line-height: 1.6;
}

/* Decoracion - Iconos de datos flotantes */
.branding-features {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 1rem;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #64748b;
    font-size: 0.85rem;
    font-weight: 500;
}

    .feature-item i {
        color: var(--primary);
        font-size: 1rem;
    }

/* Elementos decorativos flotantes */
.floating-elements {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    overflow: hidden;
}

.floating-icon {
    position: absolute;
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.15);
    font-size: 1.2rem;
    animation: float 6s ease-in-out infinite;
}

    .floating-icon:nth-child(1) {
        top: 15%;
        left: 10%;
        animation-delay: 0s;
    }

    .floating-icon:nth-child(2) {
        top: 25%;
        right: 15%;
        animation-delay: 1s;
    }

    .floating-icon:nth-child(3) {
        bottom: 30%;
        left: 15%;
        animation-delay: 2s;
    }

    .floating-icon:nth-child(4) {
        bottom: 15%;
        right: 10%;
        animation-delay: 3s;
    }

    .floating-icon:nth-child(5) {
        top: 60%;
        left: 8%;
        animation-delay: 1.5s;
    }

@keyframes float {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
        opacity: 0.5;
    }

    50% {
        transform: translateY(-15px) rotate(5deg);
        opacity: 0.8;
    }
}

/* ============================================
   LADO DERECHO - Formulario de Login
   ============================================ */
.login-form-side {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    background: var(--content-bg);
    position: relative;
}

/* Card de Login */
.login-card {
    background: var(--card-bg);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
    border: 1px solid var(--border-color);
    position: relative;
}

/* Logo pequeno arriba del card */
.login-card-logo {
    width: 150px;
    height: 60px;
    background-color: #ffffff;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    box-shadow: var(--shadow-md);
    padding: 5px;
    overflow: hidden;
}

    .login-card-logo img {
        max-width: 100%;
        max-height: 100%;
        object-fit: contain; 
    }
    .login-card-logo i {
        font-size: 1.3rem;
        color: #ffffff;
    }

.login-card-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.5rem;
    text-align: center;
    letter-spacing: -0.02em;
}

.login-card-subtitle {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0 0 2rem;
    text-align: center;
    line-height: 1.5;
}

/* Divisor con lineas */
.login-divider {
    display: flex;
    align-items: center;
    margin: 1.5rem 0;
    color: var(--text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

    .login-divider::before,
    .login-divider::after {
        content: '';
        flex: 1;
        height: 1px;
        background: var(--border-color);
    }

    .login-divider span {
        padding: 0 1rem;
    }

/* ============================================
   BOTON DE MICROSOFT - Estilo Oficial
   ============================================ */
.btn-microsoft {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.9rem 1.5rem;
    background: #ffffff;
    border: 1px solid #8c8c8c;
    border-radius: var(--radius-sm);
    color: #5e5e5e;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

    .btn-microsoft:hover:not(:disabled) {
        background: #f8f8f8;
        border-color: #5e5e5e;
        box-shadow: var(--shadow);
        transform: translateY(-1px);
    }

    .btn-microsoft:active:not(:disabled) {
        transform: translateY(0);
        box-shadow: var(--shadow-sm);
    }

    .btn-microsoft:disabled {
        opacity: 0.7;
        cursor: not-allowed;
    }

/* Logo de Microsoft */
.microsoft-logo {
    display: flex;
    width: 21px;
    height: 21px;
    flex-shrink: 0;
}

    .microsoft-logo svg {
        width: 100%;
        height: 100%;
    }

/* Spinner dentro del boton */
.btn-microsoft .btn-spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 2px solid #e2e8f0;
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.btn-microsoft.loading .btn-spinner {
    display: block;
}

.btn-microsoft.loading .microsoft-logo,
.btn-microsoft.loading .btn-text {
    display: none;
}

.btn-microsoft.loading::after {
    content: 'Redirigiendo...';
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-left: 0.5rem;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ============================================
   FOOTER DEL CARD
   ============================================ */
.login-card-footer {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.login-help-text {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin: 0;
}

    .login-help-text a {
        color: var(--primary);
        font-weight: 500;
    }

        .login-help-text a:hover {
            color: var(--primary-hover);
            text-decoration: underline;
        }

/* ============================================
   FOOTER GENERAL
   ============================================ */
.login-page-footer {
    position: absolute;
    bottom: 1.5rem;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 0.78rem;
    color: var(--text-muted);
}

    .login-page-footer a {
        color: var(--text-secondary);
    }

        .login-page-footer a:hover {
            color: var(--primary);
        }

/* ============================================
   ANIMACIONES DE ENTRADA
   ============================================ */
.fade-in-up {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s ease forwards;
}

.fade-delay-1 {
    animation-delay: 0.1s;
}

.fade-delay-2 {
    animation-delay: 0.2s;
}

.fade-delay-3 {
    animation-delay: 0.3s;
}

.fade-delay-4 {
    animation-delay: 0.4s;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Animacion de branding */
.slide-in-left {
    opacity: 0;
    transform: translateX(-30px);
    animation: slideInLeft 0.7s ease forwards;
}

@keyframes slideInLeft {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 991.98px) {
    .login-container {
        flex-direction: column;
    }

    .login-branding {
        flex: 0 0 auto;
        min-height: 280px;
        padding: 2rem 1.5rem;
    }

    .branding-logo {
        width: 60px;
        height: 60px;
        margin-bottom: 1.25rem;
    }

        .branding-logo i {
            font-size: 1.6rem;
        }

    .branding-title {
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
    }

    .branding-subtitle {
        font-size: 0.95rem;
        margin-bottom: 1.5rem;
    }

    .branding-features {
        flex-wrap: wrap;
        gap: 1rem;
    }

    .floating-elements {
        display: none;
    }

    .login-form-side {
        flex: 1;
        padding: 2rem 1.5rem 3rem;
    }

    .login-card {
        padding: 2rem 1.5rem;
        max-width: 100%;
    }

    .login-page-footer {
        position: relative;
        bottom: auto;
        margin-top: 1.5rem;
    }
}

@media (max-width: 575.98px) {
    .login-branding {
        min-height: 220px;
        padding: 1.5rem 1rem;
    }

    .branding-logo {
        width: 50px;
        height: 50px;
        margin-bottom: 1rem;
    }

        .branding-logo i {
            font-size: 1.4rem;
        }

    .branding-title {
        font-size: 1.25rem;
    }

    .branding-subtitle {
        font-size: 0.88rem;
    }

    .branding-features {
        display: none;
    }

    .login-form-side {
        padding: 1.5rem 1rem 2.5rem;
    }

    .login-card {
        padding: 1.75rem 1.25rem;
        border-radius: var(--radius-lg);
    }

    .login-card-logo {
        width: 42px;
        height: 42px;
    }

    .login-card-title {
        font-size: 1.3rem;
    }

    .login-card-subtitle {
        font-size: 0.85rem;
    }

    .btn-microsoft {
        padding: 0.85rem 1.25rem;
        font-size: 0.9rem;
    }
}

/* ============================================
   UTILIDADES
   ============================================ */
.text-center {
    text-align: center;
}

.mb-0 {
    margin-bottom: 0;
}

.mt-3 {
    margin-top: 1rem;
}
