/* --- ATMOSPHERE & BACKGROUND --- */
body { transition: background-color 0.5s ease; overflow: hidden; }

/* Dark Mode: Cosmic Void */
html.dark body { 
    background-color: #020014;
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(99, 102, 241, 0.18) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(139, 92, 246, 0.12) 0%, transparent 40%);
    background-attachment: fixed;
}

/* Light Mode: CLINICAL SLATE */
html:not(.dark) body {
    background-color: #f1f5f9; 
    background-image: none;
}

/* --- THE GLASS MONOLITH (Identity Check) --- */
.glass-monolith {
    position: relative;
    width: 100%;
    max-width: 400px;
    padding: 3rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    border-radius: 2rem;
    overflow: hidden;
    transition: all 0.5s ease;
}

html.dark .glass-monolith {
    background: linear-gradient(225deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.01) 100%);
    backdrop-filter: blur(40px); -webkit-backdrop-filter: blur(40px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

html:not(.dark) .glass-monolith {
    background: linear-gradient(225deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0.5) 100%);
    backdrop-filter: blur(40px); -webkit-backdrop-filter: blur(40px);
    border: 1px solid rgba(255, 255, 255, 1);
    box-shadow: 0 20px 40px -10px rgba(148, 163, 184, 0.2);
}

.glass-monolith::after {
    content: ""; position: absolute; top: 0; left: -100%; width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transform: skewX(-25deg); animation: sheen 6s infinite; pointer-events: none;
}

/* Minimal Input Underline */
.input-minimal {
    width: 100%; background: transparent; border: none;
    border-bottom: 2px solid rgba(148, 163, 184, 0.3);
    color: inherit; padding: 1rem 0; text-align: center;
    font-family: 'Inter', sans-serif; font-size: 1.25rem; font-weight: 500;
    outline: none; transition: all 0.3s ease;
}
.input-minimal:focus { border-bottom-color: #6366f1; }
html.dark .input-minimal { color: white; }
html:not(.dark) .input-minimal { color: #0f172a; }

/* --- QUANTUM PRELOADER --- */
#preloader { position: fixed; inset: 0; z-index: 10000; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; opacity: 0; transition: opacity 0.5s; }
html.dark #preloader { background: #020014; }
html:not(.dark) #preloader { background: #f1f5f9; }

@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

.quantum-container { position: relative; width: 160px; height: 160px; display: flex; align-items: center; justify-content: center; margin-bottom: 2rem; }
.ring-outer {
    position: absolute; inset: 0; border-radius: 50%;
    border: 2px solid transparent;
    border-top-color: #6366f1; border-bottom-color: rgba(99, 102, 241, 0.3);
    animation: spin 2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}
.ring-inner {
    position: absolute; inset: 15px; border-radius: 50%;
    border: 2px solid transparent;
    border-left-color: #8b5cf6; border-right-color: rgba(139, 92, 246, 0.3);
    animation: spin 1.5s linear infinite reverse;
}

/* --- DASHBOARD GLASS ENGINE --- */
.glass-capsule { position: relative; border-radius: 3rem; transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1); }

/* DARK MODE */
html.dark .glass-capsule {
    backdrop-filter: blur(50px) saturate(180%); -webkit-backdrop-filter: blur(50px) saturate(180%);
    background: linear-gradient(225deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0.01) 100%);
    border: 1px solid rgba(255, 255, 255, 0.08); border-top: 1px solid rgba(255, 255, 255, 0.2); border-right: 1px solid rgba(255, 255, 255, 0.15); 
    box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.05), 0 20px 40px -10px rgba(0, 0, 0, 0.6);
}
html.dark .glass-capsule::before {
    content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.0) 45%); border-radius: 3rem;
}

/* LIGHT MODE */
html:not(.dark) .glass-capsule {
    background: linear-gradient(225deg, rgba(255, 255, 255, 1.0) 0%, rgba(255, 255, 255, 0.4) 100%);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border: 1px solid #ffffff; box-shadow: none;
}

/* Interactive Hover */
.glass-capsule.interactive:hover { transform: translateY(-4px) scale(1.01); z-index: 10; }

html.dark .glass-capsule.interactive:hover { 
    border-color: rgba(99, 102, 241, 0.5); 
    background: linear-gradient(225deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.02) 100%);
    box-shadow: 0 40px 80px -12px rgba(0, 0, 0, 0.8), 0 0 40px rgba(99, 102, 241, 0.2); 
}

html:not(.dark) .glass-capsule.interactive:hover { 
    background: linear-gradient(225deg, rgba(255, 255, 255, 1.0) 0%, rgba(255, 255, 255, 0.7) 100%); 
    box-shadow: 0 20px 40px -10px rgba(99, 102, 241, 0.15), 0 5px 10px -5px rgba(99, 102, 241, 0.1); 
}

/* UI Helpers */
.widget-chassis { overflow: hidden; border-radius: 3rem; width: 100%; height: 100%; position: relative; }
html.dark .widget-chassis { background: linear-gradient(180deg, rgba(255,255,255,0.02) 0%, rgba(99, 102, 241, 0.2) 100%); }
html:not(.dark) .widget-chassis { background: linear-gradient(180deg, rgba(255,255,255,0.6) 0%, rgba(99, 102, 241, 0.1) 100%); }
.status-glow { position: absolute; bottom: -20px; left: 0; right: 0; height: 80px; background: #6366f1; filter: blur(40px); opacity: 0.6; pointer-events: none; }

.btn-liquid { background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%); color: white; font-family: 'Orbitron', sans-serif; font-weight: 700; font-size: 11px; letter-spacing: 0.1em; border: none; box-shadow: 0 10px 25px -5px rgba(99, 102, 241, 0.4); transition: all 0.3s; }
.btn-liquid:hover { transform: translateY(-2px); box-shadow: 0 15px 35px -5px rgba(99, 102, 241, 0.6); filter: brightness(1.15); }

.theme-switch { display: inline-block; height: 24px; position: relative; width: 44px; }
.theme-switch input { display:none; }
.slider { background-color: #cbd5e1; bottom: 0; cursor: pointer; left: 0; position: absolute; right: 0; top: 0; transition: .4s; border-radius: 34px; border: 2px solid #94a3b8; }
.slider:before { background-color: #fff; bottom: 2px; content: ""; height: 16px; left: 3px; position: absolute; transition: .4s; width: 16px; border-radius: 50%; box-shadow: 0 2px 4px rgba(0,0,0,0.1); }
input:checked + .slider { background-color: #1e1b4b; border-color: #6366f1; }
input:checked + .slider:before { transform: translateX(20px); background-color: #818cf8; }

.card-overflow-fix { overflow: hidden; }
.tilt-card { transform-style: preserve-3d; }