/* ==========================================================================
   SIS GLOBALITY - AUTH / LOGIN SYSTEM (SUPER PREMIUM)
   ========================================================================== */

/* Importar el Core UI Kit */
@import url('core.css');

body {
    min-height: 100dvh;
    display: flex;
    overflow: hidden;
    background-color: var(--bg-body);
}

/* --- Split Screen Layout --- */
.split-layout {
    display: flex;
    width: 100vw;
    height: 100vh;
}

/* ==========================================================================
   LEFT SIDE: Cinematic Hero
   ========================================================================== */
.hero-section {
    flex: 1.2;
    position: relative;
    background-color: #000;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: var(--space-3xl);
    color: white;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
    opacity: 0.85;
    transform: scale(1.02);
    animation: cinematicZoom 30s ease-out forwards;
}

@keyframes cinematicZoom {
    0% { transform: scale(1.1); opacity: 0; filter: blur(10px); }
    5% { opacity: 0.85; filter: blur(0); }
    100% { transform: scale(1); }
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        180deg, 
        rgba(0, 0, 0, 0.1) 0%, 
        rgba(15, 23, 42, 0.4) 40%, 
        rgba(15, 23, 42, 0.95) 100%
    );
    z-index: 2;
}

.hero-content {
    position: relative;
    z-index: 3;
    max-width: 500px;
    animation: fadeUp var(--transition-slow) 0.5s both;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 6px 16px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: var(--space-lg);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.hero-badge .dot {
    width: 6px;
    height: 6px;
    background: var(--success);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--success);
    animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
    70% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: var(--space-md);
    text-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.hero-subtitle {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.6;
}

/* ==========================================================================
   RIGHT SIDE: Glass Form
   ========================================================================== */
.form-section {
    width: 100%;
    max-width: 580px;
    background: var(--bg-card);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: var(--space-3xl) var(--space-2xl);
    position: relative;
    z-index: 4;
    box-shadow: -30px 0 60px rgba(0,0,0,0.03);
}

.form-container {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    animation: fadeLeft var(--transition-slow) 0.2s both;
}

.form-scrollable {
    max-height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 10px;
}

.logo-container {
    margin-bottom: var(--space-xl);
}

.logo-img {
    height: 140px;
    max-width: 100%;
    object-fit: contain;
    transition: transform var(--transition-base);
}
.logo-img:hover {
    transform: scale(1.05);
}

.form-header {
    margin-bottom: var(--space-xl);
}

.form-title {
    font-size: 2rem;
    margin-bottom: var(--space-xs);
}

.form-subtitle {
    font-size: 1rem;
    color: var(--text-muted);
}

/* --- Floating Label Inputs (Premium touch) --- */
.input-group {
    position: relative;
    margin-bottom: var(--space-lg);
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 16px;
    color: var(--text-light);
    font-size: 1.1rem;
    pointer-events: none;
    transition: color var(--transition-fast);
    z-index: 2;
}

.input-field {
    width: 100%;
    background: var(--bg-body);
    border: 1px solid var(--border, #E2E8F0);
    border-radius: var(--radius-md);
    padding: 24px 16px 10px 46px; /* Espacio para el floating label */
    font-size: 1rem;
    font-family: var(--font-body);
    color: var(--text-main);
    transition: all var(--transition-fast);
    outline: none;
    font-weight: 500;
}

.input-label {
    position: absolute;
    left: 46px;
    top: 18px;
    color: var(--text-muted);
    font-size: 1rem;
    font-family: var(--font-body);
    pointer-events: none;
    transition: all var(--transition-fast);
    z-index: 2;
    transform-origin: left top;
}

/* Floating Label Logic */
.input-field:focus,
.input-field:not(:placeholder-shown) {
    background: var(--bg-card);
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-light);
}

.input-field:focus ~ .input-label,
.input-field:not(:placeholder-shown) ~ .input-label {
    top: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary);
}

.input-field:not(:placeholder-shown):not(:focus) ~ .input-label {
    color: var(--text-muted);
}

.input-field:focus ~ .input-icon {
    color: var(--primary);
}

.password-toggle {
    position: absolute;
    right: 16px;
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    font-size: 1.1rem;
    transition: color var(--transition-fast);
    z-index: 2;
}

.password-toggle:hover {
    color: var(--primary);
}

/* --- Options Row --- */
.options-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: var(--space-md);
    margin-bottom: var(--space-xl);
    font-size: 0.9rem;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: var(--text-muted);
    font-weight: 500;
    transition: color var(--transition-fast);
}

.remember-me:hover {
    color: var(--text-main);
}

/* Custom Checkbox */
.remember-checkbox {
    appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid var(--text-light);
    border-radius: var(--radius-sm);
    background-color: var(--bg-card);
    cursor: pointer;
    position: relative;
    transition: all var(--transition-fast);
}

.remember-checkbox:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}

.remember-checkbox:checked::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.forgot-password {
    color: var(--primary);
    font-weight: 600;
}

/* --- Buttons --- */
.btn-submit {
    width: 100%;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    padding: 16px;
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.3);
}

.btn-submit:hover {
    background: var(--primary-hover);
    box-shadow: 0 8px 25px rgba(79, 70, 229, 0.4);
    transform: translateY(-2px);
}

.btn-submit:active {
    transform: translateY(0) scale(0.98);
}

/* --- Alerts --- */
.alert {
    padding: var(--space-md);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-lg);
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    animation: fadeLeft var(--transition-fast) both;
}

.alert-error {
    background: var(--danger-light);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.alert-success {
    background: var(--success-light);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

/* --- Footer --- */
.form-footer {
    margin-top: var(--space-2xl);
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.form-footer a {
    font-weight: 600;
}

.help-fab {
    position: fixed;
    bottom: var(--space-lg);
    right: var(--space-lg);
    background: var(--bg-card);
    border: 1px solid rgba(0,0,0,0.05);
    border-radius: var(--radius-full);
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
    box-shadow: var(--shadow-floating);
    cursor: pointer;
    transition: all var(--transition-fast);
    z-index: 50;
}

.help-fab:hover {
    transform: translateY(-3px);
    box-shadow: 0 30px 60px -12px rgba(0,0,0,0.2);
    color: var(--primary);
}

/* --- Animations --- */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeLeft {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}

/* --- Mobile Responsive (Premium Bottom Sheet Design) --- */
@media (max-width: 992px) {
    body { 
        overflow: hidden; /* Prevent body scroll */
        background-color: #0f172a; 
    }
    
    .split-layout { 
        flex-direction: column; 
        height: 100dvh; /* Use dynamic viewport height */
        position: relative;
    }
    
    /* Hero Background takes upper part */
    .hero-section { 
        display: flex; 
        flex: none;
        height: 40dvh; 
        padding: var(--space-xl) var(--space-lg); 
        justify-content: center;
        align-items: center;
        text-align: center;
    }
    
    .hero-content {
        display: flex;
        flex-direction: column;
        align-items: center;
        margin-top: -30px; /* Adjust for overlap */
    }
    
    .hero-badge { margin-bottom: var(--space-md); }
    .hero-title { font-size: 2.2rem; }
    .hero-subtitle { display: none; /* Hide subtitle to save space */ }
    
    /* Form acts as an overlapping Bottom Sheet */
    .form-section { 
        position: absolute;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 65dvh; /* Overlaps hero section */
        max-width: 100%; 
        padding: var(--space-2xl) var(--space-xl) calc(var(--space-xl) + env(safe-area-inset-bottom)); 
        background: var(--bg-card); 
        border-radius: 32px 32px 0 0;
        box-shadow: 0 -15px 40px rgba(0,0,0,0.3);
        align-items: center;
        justify-content: flex-start;
        z-index: 10;
        animation: slideUpSheet 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
    }
    
    @keyframes slideUpSheet {
        from { transform: translateY(100%); }
        to { transform: translateY(0); }
    }
    
    /* Drag indicator pill */
    .form-section::before {
        content: '';
        position: absolute;
        top: 12px;
        left: 50%;
        transform: translateX(-50%);
        width: 48px;
        height: 5px;
        background: var(--border, #E2E8F0);
        border-radius: 10px;
    }
    
    .form-container { 
        max-width: 100%; 
        width: 100%;
        margin: 0; 
        padding-top: var(--space-md);
    }
    
    /* Logo hidden on mobile form since Hero has context, or make it smaller */
    .logo-container { 
        display: flex;
        justify-content: center;
        margin-bottom: var(--space-lg); 
    }
    .logo-img { height: 80px; }
    
    .form-header { text-align: center; margin-bottom: var(--space-xl); }
    .form-title { font-size: 1.6rem; }
    
    /* Full width buttons */
    .btn-submit { width: 100%; justify-content: center; padding: 16px; font-size: 1.1rem; }
    
    /* Help FAB adjustment */
    .help-fab {
        bottom: env(safe-area-inset-bottom, 20px);
        right: 20px;
        padding: 10px 16px;
        border-radius: 100px;
        z-index: 20;
    }
    
    .options-row {
        flex-direction: row;
        justify-content: space-between;
        font-size: 0.85rem;
    }
}
