/* ===================================================================
   GESTIA ERP — UI PRO MAX CINEMATIC LOGIN
   Mode: Multi-Theme Cinematic (Light + Dark)
   =================================================================== */

:root {
    /* Transitions */
    --theme-transition: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    --ease-expo: cubic-bezier(0.16, 1, 0.3, 1);
}

/* THEME: DARK (DEFAULT CINEMA) */
body[data-theme="dark"] {
    --color-background: #0A0F1C; 
    --color-bg-grad-start: #111827;
    --color-bg-grad-end: #030712;
    --color-primary: #1E3A5F;
    --color-accent: #059669;
    --color-accent-glow: rgba(5, 150, 105, 0.6);
    --color-text-main: #F8FAFC;
    --color-text-muted: #64748B;
    --color-text-cinematic: #94A3B8;
    
    --glass-bg-form: rgba(10, 15, 28, 0.75);
    --glass-bg-side: rgba(15, 23, 42, 0.5);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-input: rgba(15, 23, 42, 0.5);
    
    --blob-1-color: #1E3A8A;
    --blob-2-color: #065F46;
    --blob-3-color: #4C1D95;
    --shadow-premium: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
    
    --text-contrast-var: #F8FAFC;
    --btn-grad-start: #065f46;
    --btn-grad-end: #047857;
    --icon-color-inactive: rgba(255, 255, 255, 0.25);
    
    --toggle-bg: rgba(255, 255, 255, 0.1);
    --toggle-text: #FFF;
}

/* THEME: LIGHT (LIQUID PREMIUM) */
body[data-theme="light"] {
    --color-background: #F8FAFC;
    --color-bg-grad-start: #F1F5F9;
    --color-bg-grad-end: #E2E8F0;
    --color-primary: #0F172A;
    --color-accent: #0D9488; /* Slightly more visible teal */
    --color-accent-glow: rgba(13, 148, 136, 0.3);
    --color-text-main: #1E293B;
    --color-text-muted: #64748B;
    --color-text-cinematic: #475569;
    
    --glass-bg-form: rgba(255, 255, 255, 0.85);
    --glass-bg-side: rgba(241, 245, 249, 0.6);
    --glass-border: rgba(0, 0, 0, 0.08);
    --glass-input: rgba(255, 255, 255, 0.9);
    
    --blob-1-color: #BFDBFE; /* Soft Blue */
    --blob-2-color: #A7F3D0; /* Soft Mint */
    --blob-3-color: #DDD6FE; /* Soft Purple */
    --shadow-premium: 0 25px 50px -12px rgba(0, 0, 0, 0.1);
    
    --text-contrast-var: #0F172A;
    --btn-grad-start: #0d9488;
    --btn-grad-end: #0f766e;
    --icon-color-inactive: rgba(0, 0, 0, 0.35);
    
    --toggle-bg: rgba(0, 0, 0, 0.05);
    --toggle-text: #1E293B;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    transition: background-color var(--theme-transition), border-color var(--theme-transition), color var(--theme-transition);
}

body.login-body {
    font-family: 'Inter', sans-serif;
    background-color: var(--color-background);
    background-image: radial-gradient(circle at center, var(--color-bg-grad-start) 0%, var(--color-bg-grad-end) 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    color: var(--color-text-main);
}

/* FLOATING THEME TOGGLE */
.theme-toggle-btn {
    position: fixed;
    top: 2rem;
    right: 2rem;
    z-index: 100;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: var(--toggle-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: var(--toggle-text);
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s var(--ease-expo), background 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.theme-toggle-btn:hover {
    transform: scale(1.1) rotate(5deg);
    background: var(--glass-border);
}

.theme-toggle-btn:active {
    transform: scale(0.95);
}

/* Ambient Cinematic Background Blobs */
.ambient-container {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.4;
    animation: blobMovement 25s infinite alternate var(--ease-expo);
    transition: background 1s ease;
}

body[data-theme="light"] .blob {
    opacity: 0.6; /* Higher opacity for light blobs to show up */
}

.blob-1 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--blob-1-color) 0%, transparent 70%);
    top: -10%;
    left: -10%;
    animation-duration: 20s;
}

.blob-2 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, var(--blob-2-color) 0%, transparent 70%);
    bottom: -10%;
    right: 10%;
    animation-duration: 30s;
    animation-delay: -5s;
}

.blob-3 {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, var(--blob-3-color) 0%, transparent 70%);
    top: 40%;
    left: 60%;
    opacity: 0.2;
    animation-duration: 25s;
}

@keyframes blobMovement {
    0% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -50px) scale(1.1); }
    66% { transform: translate(-20px, 20px) scale(0.9); }
    100% { transform: translate(0, 0) scale(1); }
}

/* Layout Structure */
.split-login-container {
    display: flex;
    width: 100%;
    max-width: 1000px;
    min-height: 620px;
    z-index: 10;
    background: transparent;
    border-radius: 24px;
    overflow: hidden;
    position: relative;
    box-shadow: var(--shadow-premium);
    transition: box-shadow 0.5s ease;
}

/* Dynamic Ring Highlight effect */
.split-login-container::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: 25px;
    background: linear-gradient(145deg, rgba(255,255,255,0.2), transparent 40%, rgba(255,255,255,0.05));
    z-index: -1;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

body[data-theme="light"] .split-login-container::before {
    background: linear-gradient(145deg, rgba(0,0,0,0.1), transparent 40%, rgba(0,0,0,0.02));
}

/* Animations */
.animate-fade-in {
    animation: slideUpEntrance 1s var(--ease-expo) forwards;
    opacity: 0;
}

@keyframes slideUpEntrance {
    from { opacity: 0; transform: translateY(40px); filter: blur(10px); }
    to { opacity: 1; transform: translateY(0); filter: blur(0); }
}

/* Brand Side - Cinematic Aesthetics */
.brand-side {
    flex: 1.1;
    padding: 4rem 3rem;
    display: flex;
    flex-direction: column;
    position: relative;
    background: linear-gradient(180deg, #064e3b 0%, #059669 100%); /* Match sidebar Emerald gradient */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-right: 1px solid var(--glass-border);
    color: white;
}

.brand-side::before {
    content: '';
    position: absolute;
    inset: 0;
    background: 
        radial-gradient(circle at 0% 0%, rgba(30, 58, 95, 0.3) 0%, transparent 50%),
        url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23888888' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.8;
    z-index: 0;
}

body[data-theme="dark"] .brand-side::before {
    background: 
        radial-gradient(circle at 0% 0%, rgba(30, 58, 95, 0.4) 0%, transparent 50%),
        url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.02'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

body[data-theme="light"] .brand-side .text-muted-cinematic {
    color: #94A3B8;
}

.brand-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.logo-mark i {
    filter: drop-shadow(0 0 15px var(--color-accent-glow));
    color: var(--color-accent) !important;
}

.fw-extrabold {
    font-weight: 800;
    letter-spacing: -1px;
}

.text-accent {
    color: var(--color-accent);
}

.text-muted-cinematic {
    color: var(--color-text-cinematic);
}

.text-contrast-var {
    color: var(--text-contrast-var);
}

.text-white {
    color: #FFF !important;
}

.lead {
    font-size: 1.1rem;
    font-weight: 300;
    opacity: 0.8;
}

/* Info Card Inside Glass */
.company-info-card {
    margin-top: auto;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    backdrop-filter: blur(5px);
    transition: transform 0.3s ease, background 0.3s ease;
}

.company-info-card:hover {
    background: rgba(255, 255, 255, 0.06);
    transform: translateY(-2px);
}

.status-dot {
    width: 8px;
    height: 8px;
    background: var(--color-accent);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--color-accent);
}

.pulse {
    animation: pulseGreen 2s infinite;
}

@keyframes pulseGreen {
    0% { box-shadow: 0 0 0 0 rgba(5, 150, 105, 0.7); }
    70% { box-shadow: 0 0 0 6px rgba(5, 150, 105, 0); }
    100% { box-shadow: 0 0 0 0 rgba(5, 150, 105, 0); }
}

.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.2rem 1rem;
    border-top: 1px solid rgba(255,255,255,0.05);
    padding-top: 1.2rem;
}

.info-item.info-full {
    grid-column: span 2;
}

.small-address {
    line-height: 1.4;
    opacity: 0.9;
    display: block;
    margin-top: 2px;
}

.info-item {
    display: flex;
    flex-direction: column;
}

.info-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    color: #94A3B8;
    letter-spacing: 1px;
    margin-bottom: 2px;
}

.info-value {
    font-size: 0.85rem;
    font-weight: 600;
    color: #FFF;
}

/* Badges */
.badge-glass {
    display: inline-flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.07);
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.7rem;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    letter-spacing: 0.3px;
    font-weight: 500;
}

/* Form Side Structure */
.form-side {
    flex: 1;
    background: var(--glass-bg-form);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    padding: 4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: background 0.5s ease;
}

.login-box {
    width: 100%;
    max-width: 340px;
}

.login-header h2 {
    letter-spacing: -0.5px;
}

/* Form Inputs Styling */
.input-container.glass-input {
    position: relative;
    background: var(--glass-input);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
}

body[data-theme="dark"] .input-container.glass-input {
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
}

.glass-input:focus-within {
    border-color: var(--color-accent);
    background: var(--glass-bg-form);
    box-shadow: 0 0 0 4px var(--color-accent-glow), inset 0 2px 4px rgba(0,0,0,0.02);
}

.glass-input i {
    position: absolute;
    left: 1rem;
    color: var(--icon-color-inactive);
    transition: color 0.3s ease;
}

.glass-input:focus-within i {
    color: var(--color-accent);
}

.glass-input .form-control {
    background: transparent;
    border: none;
    color: var(--color-text-main);
    padding: 0.9rem 1rem 0.9rem 2.75rem;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 0.95rem;
    width: 100%;
}

.glass-input .form-control::placeholder {
    color: var(--color-text-muted);
    opacity: 0.6;
    font-weight: 400;
}

.glass-input .form-control:focus {
    outline: none;
    box-shadow: none;
}

/* FIX: Normalizing text fields to prevent browser autofill from changing background colors */
.glass-input input:-webkit-autofill,
.glass-input input:-webkit-autofill:hover, 
.glass-input input:-webkit-autofill:focus, 
.glass-input input:-webkit-autofill:active{
    -webkit-box-shadow: 0 0 0 30px var(--glass-input) inset !important;
    -webkit-text-fill-color: var(--color-text-main) !important;
    transition: background-color 5000s ease-in-out 0s;
}

/* Fallback to ensure types remain identical */
input[type="text"].form-control,
input[type="password"].form-control {
    background-color: transparent !important;
    color: var(--color-text-main) !important;
}

/* Form Check & Native Styles */
.glass-check {
    background-color: rgba(0,0,0,0.05) !important;
    border: 1px solid var(--glass-border) !important;
    cursor: pointer;
}

body[data-theme="dark"] .glass-check {
    background-color: rgba(255,255,255,0.05) !important;
    border: 1px solid rgba(255,255,255,0.2) !important;
}

.glass-check:checked {
    background-color: var(--color-accent) !important;
    border-color: var(--color-accent) !important;
}

/* The Ultimate Cinematic Submit Button */
.btn-cinematic-submit {
    background: linear-gradient(135deg, var(--btn-grad-start) 0%, var(--btn-grad-end) 100%);
    color: white !important;
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-size: 0.85rem;
    box-shadow: 0 10px 20px -10px var(--color-accent-glow);
    transition: all 0.4s var(--ease-expo);
    position: relative;
    overflow: hidden;
}

.btn-cinematic-submit:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px -8px var(--color-accent-glow), 0 0 15px var(--color-accent-glow);
    background: linear-gradient(135deg, var(--btn-grad-end) 0%, var(--color-accent) 100%);
}

.btn-cinematic-submit:active {
    transform: translateY(-1px);
}

/* Button Shimmer Effect */
.btn-cinematic-submit::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: 0.5s;
}

.btn-cinematic-submit:hover::after {
    left: 100%;
    transition: 0.6s ease-in-out;
}

/* Error Message Container */
.error-msg {
    background: rgba(220, 38, 38, 0.1) !important;
    color: #dc2626 !important;
    border: 1px solid rgba(220, 38, 38, 0.2) !important;
    backdrop-filter: blur(4px);
    font-size: 0.85rem;
    border-radius: 8px;
}

body[data-theme="dark"] .error-msg {
    background: rgba(220, 38, 38, 0.2) !important;
    color: #fca5a5 !important;
    border: 1px solid rgba(220, 38, 38, 0.3) !important;
}

/* Form Field Staggered Animations */
.login-box > * {
    opacity: 0;
    animation: staggerEntrance 0.6s var(--ease-expo) forwards;
}

.login-box > *:nth-child(1) { animation-delay: 0.2s; }
.login-box > *:nth-child(2) { animation-delay: 0.3s; }
.login-box form > *:nth-child(1) { opacity: 0; animation: staggerEntrance 0.6s var(--ease-expo) forwards; animation-delay: 0.4s; }
.login-box form > *:nth-child(2) { opacity: 0; animation: staggerEntrance 0.6s var(--ease-expo) forwards; animation-delay: 0.5s; }
.login-box form > *:nth-child(3) { opacity: 0; animation: staggerEntrance 0.6s var(--ease-expo) forwards; animation-delay: 0.6s; }
.login-box form > *:nth-child(4) { opacity: 0; animation: staggerEntrance 0.6s var(--ease-expo) forwards; animation-delay: 0.7s; }
.login-box form > *:nth-child(5) { opacity: 0; animation: staggerEntrance 0.6s var(--ease-expo) forwards; animation-delay: 0.8s; }

@keyframes staggerEntrance {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Utilities & Overrides */
.opacity-50 { opacity: 0.5; }
.cursor-pointer { cursor: pointer; }
.fs-1 { font-size: 2.5rem !important; }

/* Responsive Magic */
@media (max-width: 991px) {
    .split-login-container {
        max-width: 420px;
        min-height: auto;
        background: var(--glass-bg-form);
        backdrop-filter: blur(30px);
        border: 1px solid var(--glass-border);
    }
    
    .form-side {
        padding: 3rem 2rem;
        background: transparent;
    }
    
    .theme-toggle-btn {
        top: 1rem;
        right: 1rem;
        width: 42px;
        height: 42px;
    }
}

@media (max-width: 575px) {
    .split-login-container {
        margin: 1.5rem;
        border-radius: 20px;
    }
    .form-side {
        padding: 2.5rem 1.5rem;
    }
}

/* Common Utilities (Ensuring they are supported with custom CSS) */
.d-none { display: none !important; }
.d-lg-flex { display: none !important; }
@media (min-width: 992px) {
    .d-lg-flex { display: flex !important; }
    .d-none.d-lg-flex { display: flex !important; }
    .d-lg-none { display: none !important; }
}
.w-100 { width: 100% !important; }
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 0.25rem !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }
.mb-5 { margin-bottom: 3rem !important; }
.mt-auto { margin-top: auto !important; }
.mt-5 { margin-top: 3rem !important; }
.me-1 { margin-right: 0.25rem !important; }
.me-2 { margin-right: 0.5rem !important; }
.ms-1 { margin-left: 0.25rem !important; }
.ms-2 { margin-left: 0.5rem !important; }
.py-3 { padding-top: 1rem !important; padding-bottom: 1rem !important; }
.d-flex { display: flex !important; }
.align-items-center { align-items: center !important; }
.text-center { text-align: center !important; }
.fw-bold { font-weight: 700 !important; }
.display-5 { font-size: 2.25rem; }
.small { font-size: 0.875em !important; }
.rounded-3 { border-radius: 0.75rem !important; }
.h3 { font-size: 1.75rem; }
.form-label { display: inline-block; margin-bottom: 0.5rem; }
.form-check { display: flex; align-items: center; }
.form-check-input { margin-right: 0.5rem; width: 1.1rem; height: 1.1rem; -webkit-appearance: none; appearance: none; border-radius: 4px; display: grid; place-content: center; }
.form-check-input::before { content: ""; width: 0.65em; height: 0.65em; transform: scale(0); transition: 120ms transform ease-in-out; box-shadow: inset 1em 1em white; background-color: CanvasText; clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%); }
.form-check-input:checked::before { transform: scale(1); }
.fs-5 { font-size: 1.25rem !important; }
.alert { padding: 1rem; border-radius: 0.5rem; display: flex; align-items: center; }
.alert-danger { background-color: rgba(220,38,38,0.1); color: #b91c1c; }