/**
 * Nova Septem ERP - Login Page
 * 🌌 PHOTOREALISTIC DEEP SPACE EDITION 🌌
 * NASA/Hubble Inspired - Pure CSS
 */

/* ===========================================
   🎨 RESET & VARIABLES
   =========================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    /* Deep Space Colors - Realistic palette */
    --space-void: #000000;
    --space-deep: #0a0a12;
    --space-blue: #0d1117;
    
    /* Nebula Colors - Hubble inspired */
    --nebula-red: rgba(180, 60, 50, 0.15);
    --nebula-orange: rgba(200, 100, 50, 0.12);
    --nebula-gold: rgba(180, 140, 80, 0.1);
    --nebula-teal: rgba(40, 120, 140, 0.12);
    --nebula-blue: rgba(30, 80, 160, 0.15);
    --nebula-purple: rgba(80, 40, 120, 0.12);
    
    /* Star Colors - Real stellar classification */
    --star-O: #9bb0ff;  /* Blue giants */
    --star-B: #aabfff;  /* Blue-white */
    --star-A: #cad7ff;  /* White */
    --star-F: #f8f7ff;  /* Yellow-white */
    --star-G: #fff4ea;  /* Yellow (Sun-like) */
    --star-K: #ffd2a1;  /* Orange */
    --star-M: #ffcc6f;  /* Red giants */
    
    /* UI Colors */
    --nova-500: #0077B6;
    --nova-400: #33A7CF;
    --accent-cyan: #22D3EE;
    --accent-purple: #8B5CF6;
    --error: #EF4444;
    --warning: #F59E0B;
}

html { font-size: 16px; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    background: var(--space-void);
}

/* ===========================================
   🌌 DEEP SPACE VOID
   =========================================== */
.login-universe {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--space-void);
    overflow: hidden;
}

/* Multi-layer space gradient - subtle and realistic */
.space-gradient {
    position: absolute;
    inset: 0;
    background: 
        /* Subtle vignette */
        radial-gradient(ellipse at center, transparent 0%, rgba(0,0,0,0.4) 100%),
        /* Deep blue cosmic glow */
        radial-gradient(ellipse 120% 80% at 30% 20%, rgba(15, 25, 55, 0.8) 0%, transparent 50%),
        radial-gradient(ellipse 100% 60% at 70% 80%, rgba(20, 15, 40, 0.6) 0%, transparent 50%),
        /* Base */
        linear-gradient(180deg, #05050a 0%, #0a0a15 50%, #050508 100%);
}

/* ===========================================
   ✨ PHOTOREALISTIC STAR FIELD
   =========================================== */
.stars-back,
.stars-mid,
.stars-front {
    position: absolute;
    inset: 0;
}

/* Individual star styling */
.star {
    position: absolute;
    border-radius: 50%;
}

/* Deep field stars - tiny, numerous */
.star--deep {
    width: 1px;
    height: 1px;
    background: rgba(255, 255, 255, 0.6);
}

/* Mid-distance stars */
.star--mid {
    width: 1.5px;
    height: 1.5px;
    background: white;
    box-shadow: 0 0 2px rgba(255, 255, 255, 0.5);
}

/* Foreground bright stars */
.star--bright {
    width: 2px;
    height: 2px;
    background: white;
    box-shadow: 
        0 0 3px rgba(255, 255, 255, 0.8),
        0 0 6px rgba(255, 255, 255, 0.4);
    animation: star-flicker var(--flicker-duration, 4s) ease-in-out infinite;
    animation-delay: var(--flicker-delay, 0s);
}

/* Star color variations based on stellar classification */
.star--O { background: var(--star-O); box-shadow: 0 0 4px var(--star-O), 0 0 8px rgba(155, 176, 255, 0.3); }
.star--B { background: var(--star-B); box-shadow: 0 0 4px var(--star-B), 0 0 8px rgba(170, 191, 255, 0.3); }
.star--A { background: var(--star-A); box-shadow: 0 0 3px var(--star-A); }
.star--F { background: var(--star-F); box-shadow: 0 0 3px var(--star-F); }
.star--G { background: var(--star-G); box-shadow: 0 0 4px var(--star-G), 0 0 8px rgba(255, 244, 234, 0.3); }
.star--K { background: var(--star-K); box-shadow: 0 0 4px var(--star-K), 0 0 8px rgba(255, 210, 161, 0.3); }
.star--M { background: var(--star-M); box-shadow: 0 0 5px var(--star-M), 0 0 10px rgba(255, 204, 111, 0.4); }

@keyframes star-flicker {
    0%, 100% { opacity: 0.7; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.2); }
}

/* ===========================================
   💫 BRIGHT STARS WITH DIFFRACTION SPIKES
   =========================================== */
.bright-star {
    position: absolute;
    width: 3px;
    height: 3px;
    background: white;
    border-radius: 50%;
    box-shadow:
        0 0 10px 2px rgba(255, 255, 255, 0.9),
        0 0 20px 4px rgba(200, 220, 255, 0.6),
        0 0 40px 8px rgba(150, 180, 255, 0.3);
    animation: bright-pulse var(--pulse-duration, 6s) ease-in-out infinite;
}

/* Diffraction spikes - realistic telescope artifact */
.bright-star::before,
.bright-star::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.1) 20%,
        rgba(255, 255, 255, 0.6) 45%,
        white 50%,
        rgba(255, 255, 255, 0.6) 55%,
        rgba(255, 255, 255, 0.1) 80%,
        transparent 100%
    );
}

.bright-star::before {
    width: 60px;
    height: 1px;
    transform: translate(-50%, -50%);
}

.bright-star::after {
    width: 1px;
    height: 60px;
    transform: translate(-50%, -50%);
}

/* Larger bright stars get longer spikes */
.bright-star--large::before { width: 100px; }
.bright-star--large::after { height: 100px; }
.bright-star--large {
    width: 4px;
    height: 4px;
    box-shadow:
        0 0 15px 3px rgba(255, 255, 255, 0.95),
        0 0 30px 6px rgba(200, 220, 255, 0.7),
        0 0 60px 12px rgba(150, 180, 255, 0.4);
}

@keyframes bright-pulse {
    0%, 100% { opacity: 0.85; filter: brightness(1); }
    50% { opacity: 1; filter: brightness(1.3); }
}

/* ===========================================
   🌫️ REALISTIC NEBULAE - HUBBLE STYLE
   =========================================== */
.nebulae {
    position: absolute;
    inset: 0;
    opacity: 0.9;
    mix-blend-mode: screen;
}

.nebula {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    animation: nebula-drift 120s ease-in-out infinite;
}

/* Emission nebula - reds and oranges */
.nebula--emission {
    width: 800px;
    height: 500px;
    top: -10%;
    left: -5%;
    background: radial-gradient(ellipse at 40% 50%,
        rgba(180, 60, 50, 0.25) 0%,
        rgba(150, 40, 40, 0.15) 30%,
        rgba(100, 30, 30, 0.08) 50%,
        transparent 70%
    );
    transform: rotate(-15deg);
}

/* Reflection nebula - blues */
.nebula--reflection {
    width: 600px;
    height: 700px;
    top: 50%;
    right: -10%;
    background: radial-gradient(ellipse at 60% 40%,
        rgba(40, 80, 160, 0.2) 0%,
        rgba(30, 60, 140, 0.12) 30%,
        rgba(20, 40, 100, 0.06) 50%,
        transparent 70%
    );
    animation-delay: -40s;
    animation-duration: 150s;
}

/* Planetary nebula glow */
.nebula--planetary {
    width: 400px;
    height: 400px;
    bottom: 10%;
    left: 15%;
    background: radial-gradient(circle,
        rgba(60, 180, 180, 0.15) 0%,
        rgba(40, 140, 160, 0.1) 30%,
        rgba(80, 60, 140, 0.08) 60%,
        transparent 80%
    );
    animation-delay: -80s;
    animation-duration: 100s;
}

/* Dark nebula / dust lane */
.nebula--dark {
    width: 1200px;
    height: 300px;
    top: 40%;
    left: -20%;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(0, 0, 0, 0.3) 20%,
        rgba(0, 0, 0, 0.5) 50%,
        rgba(0, 0, 0, 0.3) 80%,
        transparent 100%
    );
    filter: blur(40px);
    transform: rotate(-5deg);
    mix-blend-mode: multiply;
    animation: none;
}

/* Golden dust region */
.nebula--dust {
    width: 500px;
    height: 600px;
    top: 20%;
    right: 20%;
    background: radial-gradient(ellipse at 30% 70%,
        rgba(180, 140, 80, 0.12) 0%,
        rgba(140, 100, 60, 0.08) 40%,
        transparent 70%
    );
    animation-delay: -60s;
}

@keyframes nebula-drift {
    0%, 100% { transform: translate(0, 0) rotate(var(--rotation, 0deg)); }
    25% { transform: translate(20px, -15px) rotate(calc(var(--rotation, 0deg) + 2deg)); }
    50% { transform: translate(-15px, 20px) rotate(calc(var(--rotation, 0deg) - 1deg)); }
    75% { transform: translate(15px, 10px) rotate(calc(var(--rotation, 0deg) + 1deg)); }
}

/* ===========================================
   🌀 DISTANT GALAXIES
   =========================================== */
.galaxies {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.galaxy {
    position: absolute;
    border-radius: 50%;
    opacity: 0.6;
}

/* Spiral galaxy - edge on */
.galaxy--spiral {
    width: 80px;
    height: 15px;
    top: 25%;
    left: 12%;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(255, 240, 220, 0.3) 20%,
        rgba(255, 250, 240, 0.5) 50%,
        rgba(255, 240, 220, 0.3) 80%,
        transparent 100%
    );
    filter: blur(1px);
    transform: rotate(25deg);
}

/* Elliptical galaxy */
.galaxy--elliptical {
    width: 40px;
    height: 30px;
    bottom: 30%;
    right: 18%;
    background: radial-gradient(ellipse,
        rgba(255, 245, 230, 0.5) 0%,
        rgba(255, 240, 220, 0.3) 40%,
        transparent 70%
    );
    filter: blur(2px);
}

/* Tiny distant galaxy smudges */
.galaxy--distant {
    width: 8px;
    height: 5px;
    background: radial-gradient(ellipse,
        rgba(255, 250, 245, 0.4) 0%,
        transparent 70%
    );
    filter: blur(1px);
}

/* ===========================================
   ✴️ LENS FLARES
   =========================================== */
.lens-flare {
    position: absolute;
    pointer-events: none;
    opacity: 0.4;
}

.lens-flare::before {
    content: '';
    position: absolute;
    width: 200px;
    height: 2px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(100, 180, 255, 0.3) 30%,
        rgba(150, 200, 255, 0.5) 50%,
        rgba(100, 180, 255, 0.3) 70%,
        transparent 100%
    );
    transform: rotate(var(--flare-angle, 45deg));
}

.lens-flare::after {
    content: '';
    position: absolute;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: radial-gradient(circle,
        rgba(100, 150, 255, 0.3) 0%,
        transparent 70%
    );
    transform: translate(var(--flare-offset-x, 50px), var(--flare-offset-y, 50px));
}

/* ===========================================
   🌊 COSMIC DUST PARTICLES
   =========================================== */
.particles {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    animation: float-particle linear infinite;
}

@keyframes float-particle {
    0% {
        transform: translateY(100vh) translateX(0);
        opacity: 0;
    }
    10% { opacity: 0.6; }
    90% { opacity: 0.6; }
    100% {
        transform: translateY(-10vh) translateX(20px);
        opacity: 0;
    }
}

/* Particle variations */
.particle:nth-child(1) { left: 5%; animation-duration: 25s; animation-delay: 0s; }
.particle:nth-child(2) { left: 12%; animation-duration: 30s; animation-delay: -5s; }
.particle:nth-child(3) { left: 20%; animation-duration: 22s; animation-delay: -10s; }
.particle:nth-child(4) { left: 28%; animation-duration: 28s; animation-delay: -3s; }
.particle:nth-child(5) { left: 35%; animation-duration: 26s; animation-delay: -8s; }
.particle:nth-child(6) { left: 42%; animation-duration: 24s; animation-delay: -15s; }
.particle:nth-child(7) { left: 50%; animation-duration: 32s; animation-delay: -2s; }
.particle:nth-child(8) { left: 58%; animation-duration: 27s; animation-delay: -12s; }
.particle:nth-child(9) { left: 65%; animation-duration: 23s; animation-delay: -7s; }
.particle:nth-child(10) { left: 72%; animation-duration: 29s; animation-delay: -18s; }
.particle:nth-child(11) { left: 80%; animation-duration: 25s; animation-delay: -4s; }
.particle:nth-child(12) { left: 88%; animation-duration: 31s; animation-delay: -14s; }
.particle:nth-child(13) { left: 95%; animation-duration: 26s; animation-delay: -9s; }
.particle:nth-child(14) { left: 8%; animation-duration: 28s; animation-delay: -20s; }
.particle:nth-child(15) { left: 45%; animation-duration: 24s; animation-delay: -11s; }

/* ===========================================
   🔭 FILM GRAIN OVERLAY
   =========================================== */
.noise-overlay {
    position: absolute;
    inset: 0;
    opacity: 0.03;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}

/* ===========================================
   🎨 LOGO SECTION
   =========================================== */
.logo-section {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    margin-bottom: 1.5rem !important;
    animation: logo-fade-in 1s ease-out forwards;
}

@keyframes logo-fade-in {
    0% { opacity: 0; transform: translateY(-20px); }
    100% { opacity: 1; transform: translateY(0); }
}

.logo-image {
    display: block !important;
    width: 64px !important;
    height: 64px !important;
    max-width: 64px !important;
    max-height: 64px !important;
    min-width: 64px !important;
    min-height: 64px !important;
    border-radius: 16px !important;
    background: transparent !important;
    box-shadow: none !important;
    object-fit: contain !important;
}

@keyframes logo-glow {
    0%, 100% { box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4), 0 0 40px rgba(0, 119, 182, 0.25); }
    50% { box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4), 0 0 60px rgba(0, 119, 182, 0.4); }
}

/* ===========================================
   📦 LOGIN CONTAINER
   =========================================== */
.login-wrapper {
    position: relative;
    z-index: 100;
    width: 100%;
    max-width: 440px;
    padding: 2rem;
}

/* ===========================================
   🃏 GLASSMORPHISM CARD
   =========================================== */
.login-card {
    position: relative;
    background: rgba(10, 15, 25, 0.7);
    backdrop-filter: blur(40px) saturate(150%);
    -webkit-backdrop-filter: blur(40px) saturate(150%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    padding: 2.5rem;
    animation: card-appear 0.8s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    opacity: 0;
    box-shadow:
        0 25px 50px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

@keyframes card-appear {
    from { opacity: 0; transform: translateY(30px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Subtle animated border */
.login-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 24px;
    padding: 1px;
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.1) 0%,
        transparent 50%,
        rgba(255, 255, 255, 0.05) 100%
    );
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0.5;
}

/* ===========================================
   📝 HEADER
   =========================================== */
.card-header {
    text-align: center;
    margin-bottom: 2rem;
}

.card-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: white;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.card-subtitle {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.5);
}

/* ===========================================
   ❌ ERROR MESSAGE
   =========================================== */
.error-message {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.25);
    border-radius: 12px;
    margin-bottom: 1.5rem;
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-4px); }
    40%, 80% { transform: translateX(4px); }
}

.error-icon { width: 20px; height: 20px; color: #FCA5A5; flex-shrink: 0; }
.error-text { color: #FCA5A5; font-size: 0.875rem; }

/* ===========================================
   📋 FORM
   =========================================== */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group { position: relative; }

.form-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 0.5rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.input-container { position: relative; }

.form-input {
    width: 100%;
    padding: 0.875rem 1rem 0.875rem 2.75rem;
    font-size: 0.95rem;
    font-family: inherit;
    color: white;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    outline: none;
    transition: all 0.3s ease;
}

.form-input::placeholder { color: rgba(255, 255, 255, 0.3); }

.form-input:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.15);
}

.form-input:focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--nova-500);
    box-shadow: 0 0 0 3px rgba(0, 119, 182, 0.15);
}

.input-icon {
    position: absolute;
    left: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: rgba(255, 255, 255, 0.4);
    pointer-events: none;
    transition: color 0.3s ease;
}

.form-input:focus ~ .input-icon { color: var(--nova-400); }

.password-toggle {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    padding: 6px;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.password-toggle:hover { color: white; background: rgba(255, 255, 255, 0.1); }
.password-toggle svg { width: 18px; height: 18px; }

.caps-warning {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.25);
    border-radius: 8px;
    font-size: 0.75rem;
    color: #FCD34D;
    opacity: 0;
    transform: translateY(-5px);
    transition: all 0.2s ease;
}

.caps-warning.visible { opacity: 1; transform: translateY(0); }
.caps-warning svg { width: 14px; height: 14px; }

/* ===========================================
   ☑️ CHECKBOX
   =========================================== */
.remember-row { display: flex; align-items: center; gap: 0.75rem; }

.checkbox-wrapper { position: relative; width: 20px; height: 20px; }
.checkbox-wrapper input { position: absolute; inset: 0; opacity: 0; cursor: pointer; z-index: 1; }

.checkbox-visual {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    transition: all 0.2s ease;
}

.checkbox-visual::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg) scale(0);
    transition: transform 0.2s ease;
}

.checkbox-wrapper input:checked ~ .checkbox-visual {
    background: var(--nova-500);
    border-color: var(--nova-500);
}

.checkbox-wrapper input:checked ~ .checkbox-visual::after { transform: rotate(45deg) scale(1); }

.remember-label {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    user-select: none;
}

/* ===========================================
   🚀 SUBMIT BUTTON
   =========================================== */
.submit-button {
    position: relative;
    width: 100%;
    padding: 1rem 1.5rem;
    margin-top: 0.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    color: white;
    background: linear-gradient(135deg, var(--nova-500) 0%, #005a8c 100%);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.3s ease;
}

.submit-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 119, 182, 0.3);
}

.submit-button:active { transform: translateY(0); }
.submit-button:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.button-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: opacity 0.2s ease;
}

.button-arrow { width: 18px; height: 18px; transition: transform 0.2s ease; }
.submit-button:hover .button-arrow { transform: translateX(4px); }

.button-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 22px;
    height: 22px;
    animation: spin 0.8s linear infinite;
    display: none;
}

@keyframes spin { to { transform: translate(-50%, -50%) rotate(360deg); } }

.submit-button.loading .button-content { opacity: 0; }
.submit-button.loading .button-spinner { display: block; }

.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: scale(0);
    animation: ripple 0.5s ease-out;
}

@keyframes ripple { to { transform: scale(4); opacity: 0; } }

/* ===========================================
   📄 FOOTER
   =========================================== */
.login-footer {
    text-align: center;
    margin-top: 2rem;
    animation: fade-in 0.8s ease 0.3s forwards;
    opacity: 0;
}

@keyframes fade-in { to { opacity: 1; } }

.login-footer p {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.3);
}

/* ===========================================
   🕳️ BLACK HOLE - CINEMATIC EDITION
   Interstellar-inspired, photorealistic
   =========================================== */
.black-hole-container {
    position: fixed;
    inset: 0;
    z-index: 9999;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.black-hole-container.active { opacity: 1; }

/* Gravitational Lensing Field */
.lensing-field {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 500px;
    height: 500px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    opacity: 0;
    z-index: 5;
    background: radial-gradient(circle,
        transparent 0%,
        transparent 25%,
        rgba(255, 200, 150, 0.03) 35%,
        rgba(255, 150, 100, 0.05) 45%,
        rgba(200, 100, 80, 0.04) 55%,
        rgba(100, 80, 120, 0.03) 65%,
        transparent 75%
    );
    filter: blur(20px);
}

.lensing-field.active {
    animation: lensing-appear 1s ease-out forwards, lensing-breathe 3s ease-in-out 1s infinite;
}

@keyframes lensing-appear {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.3); }
    100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

@keyframes lensing-breathe {
    0%, 100% { filter: blur(20px) brightness(1); }
    50% { filter: blur(25px) brightness(1.2); }
}

/* Einstein Ring - Light bent around the black hole */
.einstein-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 280px;
    height: 280px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    opacity: 0;
    z-index: 6;
    border: 1px solid rgba(255, 220, 180, 0.4);
    box-shadow:
        0 0 40px 10px rgba(255, 200, 150, 0.15),
        0 0 80px 20px rgba(255, 150, 100, 0.1),
        inset 0 0 40px 10px rgba(255, 200, 150, 0.05);
}

.einstein-ring.active {
    animation: ring-appear 0.8s ease-out forwards;
}

@keyframes ring-appear {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.5); }
    100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* Accretion Disk - DISABLED */
.accretion-disk {
    display: none !important;
}

.accretion-disk.active {
    animation: disk-materialize 0.8s ease-out forwards, disk-consume 0.5s ease-in 0.8s forwards;
}

@keyframes disk-materialize {
    0% { opacity: 0; transform: translate(-50%, -50%) rotateX(75deg) scale(0.3); }
    100% { opacity: 0.7; transform: translate(-50%, -50%) rotateX(75deg) scale(1); }
}

@keyframes disk-consume {
    0% { opacity: 0.7; transform: translate(-50%, -50%) rotateX(75deg) scale(1); }
    100% { opacity: 0; transform: translate(-50%, -50%) rotateX(75deg) scale(0); }
}

/* Inner disk - hot plasma, approaching side blueshifted */
.accretion-disk::before {
    content: '';
    position: absolute;
    inset: 80px;
    border-radius: 50%;
    background: conic-gradient(
        from 180deg,
        /* Approaching - blueshifted (left side) */
        rgba(200, 220, 255, 0.95) 0deg,
        rgba(255, 240, 220, 0.9) 45deg,
        /* Top */
        rgba(255, 200, 150, 0.85) 90deg,
        /* Receding - redshifted (right side) */
        rgba(255, 150, 100, 0.8) 135deg,
        rgba(255, 100, 80, 0.75) 180deg,
        rgba(200, 80, 60, 0.7) 225deg,
        /* Bottom */
        rgba(255, 150, 100, 0.75) 270deg,
        rgba(255, 200, 150, 0.8) 315deg,
        rgba(200, 220, 255, 0.95) 360deg
    );
    mask: radial-gradient(circle, transparent 35%, black 42%, black 85%, transparent 92%);
    -webkit-mask: radial-gradient(circle, transparent 35%, black 42%, black 85%, transparent 92%);
    animation: disk-rotate 8s linear infinite;
    filter: blur(1px);
}

/* Outer disk - cooler material */
.accretion-disk::after {
    content: '';
    position: absolute;
    inset: 40px;
    border-radius: 50%;
    background: conic-gradient(
        from 180deg,
        rgba(180, 200, 255, 0.4) 0deg,
        rgba(255, 220, 180, 0.35) 90deg,
        rgba(255, 150, 100, 0.3) 180deg,
        rgba(200, 100, 80, 0.25) 270deg,
        rgba(180, 200, 255, 0.4) 360deg
    );
    mask: radial-gradient(circle, transparent 55%, black 60%, black 92%, transparent 97%);
    -webkit-mask: radial-gradient(circle, transparent 55%, black 60%, black 92%, transparent 97%);
    animation: disk-rotate 15s linear infinite reverse;
    filter: blur(3px);
}

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

/* Disk glow - light scatter */
.disk-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 500px;
    height: 120px;
    transform: translate(-50%, -50%) rotateX(75deg);
    border-radius: 50%;
    background: radial-gradient(ellipse,
        rgba(255, 180, 120, 0.3) 0%,
        rgba(255, 150, 100, 0.15) 40%,
        transparent 70%
    );
    filter: blur(15px);
    opacity: 0;
    z-index: 6;
}

.disk-glow.active {
    animation: glow-appear 1s ease-out 0.3s forwards;
}

@keyframes glow-appear {
    to { opacity: 1; }
}

/* Photon Ring - Light at the edge of no return */
.photon-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 180px;
    height: 180px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    opacity: 0;
    z-index: 8;
    background: transparent;
    border: 2px solid rgba(255, 240, 220, 0.7);
    box-shadow:
        0 0 30px 5px rgba(255, 220, 180, 0.4),
        0 0 60px 10px rgba(255, 180, 140, 0.2),
        inset 0 0 30px 5px rgba(255, 220, 180, 0.2);
}

.photon-ring.active {
    animation: photon-appear 0.6s ease-out 0.4s forwards, photon-shimmer 2s ease-in-out 1s 2, photon-consume 0.8s ease-in 2s forwards;
}

@keyframes photon-appear {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.8); }
    100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

@keyframes photon-consume {
    0% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(0); }
}

@keyframes photon-shimmer {
    0%, 100% { opacity: 0.8; box-shadow: 0 0 30px 5px rgba(255, 220, 180, 0.4), 0 0 60px 10px rgba(255, 180, 140, 0.2), inset 0 0 30px 5px rgba(255, 220, 180, 0.2); }
    50% { opacity: 1; box-shadow: 0 0 40px 8px rgba(255, 220, 180, 0.5), 0 0 80px 15px rgba(255, 180, 140, 0.3), inset 0 0 40px 8px rgba(255, 220, 180, 0.3); }
}

/* Inner Photon Ring - Sharper, brighter */
.photon-ring-inner {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 160px;
    height: 160px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    opacity: 0;
    z-index: 9;
    border: 1px solid rgba(255, 255, 240, 0.9);
    box-shadow: 0 0 20px 3px rgba(255, 255, 240, 0.5);
}

.photon-ring-inner.active {
    animation: photon-appear 0.5s ease-out 0.5s forwards;
}

/* Event Horizon - The Point of No Return */
.event-horizon {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 140px;
    height: 140px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: #000;
    opacity: 0;
    z-index: 100;
    box-shadow:
        0 0 80px 30px rgba(0, 0, 0, 0.95),
        0 0 120px 50px rgba(0, 0, 0, 0.8),
        inset 0 0 100px 50px #000;
}

.event-horizon.active {
    animation: horizon-emerge 1s cubic-bezier(0.22, 1, 0.36, 1) forwards,
               horizon-consume 2.5s cubic-bezier(0.4, 0, 0.2, 1) 1.5s forwards;
}

@keyframes horizon-emerge {
    0% { opacity: 0; width: 20px; height: 20px; }
    100% { opacity: 1; width: 140px; height: 140px; }
}

@keyframes horizon-consume {
    0% { width: 140px; height: 140px; }
    100% { width: 500vmax; height: 500vmax; }
}

/* Gravitational Waves - Subtle ripples in spacetime */
.grav-waves {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 4;
}

.grav-wave {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    border: 1px solid rgba(150, 170, 200, 0.2);
    opacity: 0;
}

.grav-wave.active {
    animation: wave-ripple 3s ease-out infinite;
}

.grav-wave:nth-child(1) { animation-delay: 0s; }
.grav-wave:nth-child(2) { animation-delay: 0.5s; }
.grav-wave:nth-child(3) { animation-delay: 1s; }
.grav-wave:nth-child(4) { animation-delay: 1.5s; }
.grav-wave:nth-child(5) { animation-delay: 2s; }

@keyframes wave-ripple {
    0% { width: 200px; height: 200px; opacity: 0.4; border-width: 2px; }
    100% { width: 1200px; height: 1200px; opacity: 0; border-width: 0.5px; }
}

/* Hawking Radiation - DISABLED */
.hawking-radiation {
    display: none !important;
}

.hawking-radiation.active { 
    animation: hawking-fade 2.5s ease-in-out forwards;
}

@keyframes hawking-fade {
    0% { opacity: 0; }
    20% { opacity: 1; }
    80% { opacity: 1; }
    100% { opacity: 0; }
}

.hawking-particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    box-shadow: 0 0 6px 2px rgba(255, 255, 255, 0.6);
}

.hawking-particle:nth-child(1) { animation: hawking-emit 1.5s ease-out 0s 2; }
.hawking-particle:nth-child(2) { animation: hawking-emit 1.5s ease-out 0.2s 2; transform: rotate(60deg); }
.hawking-particle:nth-child(3) { animation: hawking-emit 1.5s ease-out 0.4s 2; transform: rotate(120deg); }
.hawking-particle:nth-child(4) { animation: hawking-emit 1.5s ease-out 0.6s 2; transform: rotate(180deg); }
.hawking-particle:nth-child(5) { animation: hawking-emit 1.5s ease-out 0.8s 2; transform: rotate(240deg); }
.hawking-particle:nth-child(6) { animation: hawking-emit 1.5s ease-out 1.0s 2; transform: rotate(300deg); }

@keyframes hawking-emit {
    0% { transform: translateY(0) scale(1); opacity: 0; }
    20% { opacity: 1; }
    100% { transform: translateY(-150px) scale(0.3); opacity: 0; }
}

/* ===========================================
   🌀 UNIVERSE COLLAPSE - Realistic Suck
   =========================================== */

/* Stars accelerate toward center with stretching */
.login-universe.sucked-in .star {
    animation: star-fall var(--fall-duration, 2s) cubic-bezier(0.4, 0, 1, 1) forwards;
    animation-delay: var(--fall-delay, 0s);
}

@keyframes star-fall {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }
    70% {
        opacity: 1;
    }
    85% {
        transform: translate(
            calc((50vw - var(--star-x, 50vw)) * 0.9),
            calc((50vh - var(--star-y, 50vh)) * 0.9)
        ) scale(1.5, 0.5);
        opacity: 0.8;
    }
    100% {
        transform: translate(
            calc(50vw - var(--star-x, 50vw)),
            calc(50vh - var(--star-y, 50vh))
        ) scale(0);
        opacity: 0;
    }
}

/* Bright stars get dramatic stretch */
.login-universe.sucked-in .bright-star {
    animation: bright-star-fall 2.2s cubic-bezier(0.4, 0, 1, 1) forwards;
}

@keyframes bright-star-fall {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 1;
        filter: blur(0);
    }
    60% {
        opacity: 1;
        filter: blur(0);
    }
    80% {
        filter: blur(2px);
    }
    100% {
        transform: translate(
            calc(50vw - var(--star-x, 50vw)),
            calc(50vh - var(--star-y, 50vh))
        ) scale(3, 0.2);
        opacity: 0;
        filter: blur(4px);
    }
}

/* Nebulae twist and compress */
.login-universe.sucked-in .nebula {
    animation: nebula-collapse 2.5s cubic-bezier(0.4, 0, 1, 1) forwards;
}

@keyframes nebula-collapse {
    0% {
        transform: translate(0, 0) scale(1) rotate(0deg);
        opacity: 0.9;
        filter: blur(80px);
    }
    50% {
        filter: blur(40px);
    }
    100% {
        transform: translate(
            calc(50vw - var(--nebula-x, 50vw)),
            calc(50vh - var(--nebula-y, 50vh))
        ) scale(0) rotate(180deg);
        opacity: 0;
        filter: blur(10px);
    }
}

/* Galaxies spiral in */
.login-universe.sucked-in .galaxy {
    animation: galaxy-spiral 2s cubic-bezier(0.4, 0, 1, 1) forwards;
}

@keyframes galaxy-spiral {
    0% {
        transform: translate(0, 0) rotate(0deg) scale(1);
        opacity: 0.6;
    }
    100% {
        transform: translate(
            calc(50vw - var(--galaxy-x, 50vw)),
            calc(50vh - var(--galaxy-y, 50vh))
        ) rotate(720deg) scale(0);
        opacity: 0;
    }
}

/* Particles accelerate */
.login-universe.sucked-in .particle {
    animation: particle-accelerate 1.5s cubic-bezier(0.55, 0.055, 0.675, 0.19) forwards !important;
}

@keyframes particle-accelerate {
    0% { transform: translateY(0) scale(1); opacity: 0.6; }
    100% { transform: translateY(calc(50vh - 50%)) scale(0); opacity: 0; }
}

/* Lens flares intensify then vanish */
.login-universe.sucked-in .lens-flare {
    animation: flare-burst 1s ease-out forwards;
}

@keyframes flare-burst {
    0% { opacity: 0.4; transform: scale(1); }
    30% { opacity: 1; transform: scale(1.5); }
    100% { opacity: 0; transform: scale(0); }
}

/* Login card - dramatic spaghettification */
.login-universe.sucked-in .login-wrapper {
    animation: card-spaghettify 2.2s cubic-bezier(0.4, 0, 1, 1) forwards;
    animation-delay: 0.5s;
    transform-origin: center center;
}

/* Logo gets sucked in first */
.login-universe.sucked-in .logo-section {
    animation: logo-suck 1.8s cubic-bezier(0.4, 0, 1, 1) forwards;
    animation-delay: 0.3s;
}

@keyframes logo-suck {
    0% {
        transform: translateY(0) scale(1);
        opacity: 1;
        filter: blur(0);
    }
    50% {
        transform: translateY(15vh) scale(0.5);
        opacity: 0.7;
        filter: blur(3px);
    }
    100% {
        transform: translateY(40vh) scale(0);
        opacity: 0;
        filter: blur(10px);
    }
}

@keyframes card-spaghettify {
    0% {
        transform: translate(0, 0) scale(1, 1) rotate(0deg);
        opacity: 1;
        filter: blur(0) brightness(1);
    }
    20% {
        transform: translate(0, 0) scale(1.02, 0.98) rotate(0deg);
        filter: blur(0) brightness(1);
    }
    40% {
        transform: translate(0, 5vh) scale(0.8, 1.2) rotate(2deg);
        opacity: 1;
        filter: blur(1px) brightness(1.1);
    }
    60% {
        transform: translate(0, 15vh) scale(0.5, 1.8) rotate(-5deg);
        opacity: 0.9;
        filter: blur(3px) brightness(1.3);
    }
    80% {
        transform: translate(0, 30vh) scale(0.2, 2.5) rotate(10deg);
        opacity: 0.6;
        filter: blur(8px) brightness(1.5);
    }
    100% {
        transform: translate(0, 45vh) scale(0, 4) rotate(20deg);
        opacity: 0;
        filter: blur(15px) brightness(2);
    }
}

/* Time dilation effect on card content */
.login-universe.sucked-in .login-card {
    animation: time-slow 2s ease-in forwards;
    animation-delay: 0.5s;
}

@keyframes time-slow {
    0% { filter: hue-rotate(0deg) saturate(1); }
    70% { filter: hue-rotate(10deg) saturate(1.2); }
    100% { filter: hue-rotate(-20deg) saturate(0.5) brightness(2); }
}

/* ===========================================
   💥 SCREEN EFFECTS - Cinematic Finale
   =========================================== */

/* Light compression at center */
.light-compression {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: white;
    z-index: 10000;
    opacity: 0;
    box-shadow: 0 0 100px 50px rgba(255, 255, 255, 0.8);
}

.light-compression.active {
    animation: light-burst 0.5s ease-out 3.2s forwards;
}

@keyframes light-burst {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0); }
    50% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(50); }
}

/* Final flash */
.screen-flash {
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at center,
        rgba(255, 255, 255, 1) 0%,
        rgba(255, 240, 220, 0.9) 30%,
        rgba(255, 200, 150, 0.5) 60%,
        transparent 100%
    );
    z-index: 10001;
    opacity: 0;
    pointer-events: none;
}

/* ===========================================
   🎬 CINEMATIC OVERLAYS
   =========================================== */

/* Gravity Distortion Field */
.gravity-distortion {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 600px;
    height: 600px;
    transform: translate(-50%, -50%) scale(0);
    border-radius: 50%;
    background: radial-gradient(circle,
        transparent 0%,
        transparent 20%,
        rgba(255, 200, 150, 0.04) 35%,
        rgba(255, 150, 100, 0.06) 50%,
        rgba(200, 100, 80, 0.04) 65%,
        transparent 80%
    );
    filter: blur(30px);
    opacity: 0;
    z-index: 5;
}

.gravity-distortion.active {
    animation: distortion-expand 2s ease-out forwards;
}

@keyframes distortion-expand {
    0% { transform: translate(-50%, -50%) scale(0); opacity: 0; }
    30% { opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(2.5); opacity: 1; }
}

/* Light Streaks - Stars being pulled in */
.light-streaks {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    z-index: 6;
    pointer-events: none;
}

.light-streak {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 2px;
    height: 0;
    background: linear-gradient(to top,
        transparent 0%,
        rgba(255, 255, 255, 0.1) 20%,
        rgba(255, 240, 220, 0.4) 50%,
        rgba(255, 220, 180, 0.6) 70%,
        rgba(255, 200, 150, 0.3) 90%,
        transparent 100%
    );
    transform-origin: bottom center;
    opacity: 0;
}

.light-streak.active {
    animation: streak-extend 1.5s ease-out forwards;
}

@keyframes streak-extend {
    0% { height: 0; opacity: 0; }
    30% { height: 25vh; opacity: 0.6; }
    100% { height: 45vh; opacity: 0; transform: translateY(-20vh); }
}

/* Cinematic Letterbox Bars - DISABLED */
.cinematic-bars {
    display: none !important;
}

/* Time Dilation Effect - World slows down */
.time-dilation {
    position: fixed;
    inset: 0;
    z-index: 9995;
    pointer-events: none;
    backdrop-filter: blur(0) saturate(1);
    -webkit-backdrop-filter: blur(0) saturate(1);
    opacity: 0;
}

.time-dilation.active {
    animation: time-slow 3s ease-in forwards;
}

@keyframes time-slow {
    0% { 
        backdrop-filter: blur(0) saturate(1) brightness(1); 
        -webkit-backdrop-filter: blur(0) saturate(1) brightness(1);
        opacity: 1;
    }
    50% { 
        backdrop-filter: blur(1px) saturate(1.2) brightness(1.1); 
        -webkit-backdrop-filter: blur(1px) saturate(1.2) brightness(1.1);
    }
    100% { 
        backdrop-filter: blur(4px) saturate(0.8) brightness(0.6); 
        -webkit-backdrop-filter: blur(4px) saturate(0.8) brightness(0.6);
    }
}

/* Spacetime Warp - Vignette pulling inward */
.spacetime-warp {
    position: fixed;
    inset: 0;
    z-index: 9997;
    pointer-events: none;
    opacity: 0;
    background: radial-gradient(circle at center,
        transparent 0%,
        transparent 20%,
        rgba(0, 0, 0, 0.2) 40%,
        rgba(0, 0, 0, 0.5) 60%,
        rgba(0, 0, 0, 0.8) 80%,
        rgba(0, 0, 0, 0.95) 100%
    );
}

.spacetime-warp.active {
    animation: warp-intensify 2s ease-in forwards;
}

@keyframes warp-intensify {
    0% { opacity: 0; transform: scale(1); }
    50% { opacity: 0.7; }
    100% { opacity: 1; transform: scale(0.98); }
}

/* Screen Flash - Crossing the event horizon */
.screen-flash {
    position: fixed;
    inset: 0;
    z-index: 10001;
    pointer-events: none;
    opacity: 0;
    background: radial-gradient(circle at center,
        rgba(255, 255, 255, 1) 0%,
        rgba(255, 240, 220, 0.9) 20%,
        rgba(255, 200, 150, 0.6) 50%,
        rgba(255, 150, 100, 0.3) 75%,
        transparent 100%
    );
}

.screen-flash.active {
    animation: horizon-cross 0.7s ease-out forwards;
}

@keyframes horizon-cross {
    0% { opacity: 0; transform: scale(0.5); }
    40% { opacity: 1; transform: scale(1.2); }
    100% { opacity: 0; transform: scale(2); }
}

/* Final Blackout - Into the void */
.final-blackout {
    position: fixed;
    inset: 0;
    background: #000;
    z-index: 10002;
    opacity: 0;
    pointer-events: none;
}

.final-blackout.active {
    animation: eternal-darkness 0.6s ease-in forwards;
}

@keyframes eternal-darkness {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

/* ===========================================
   📱 RESPONSIVE
   =========================================== */
@media (max-width: 540px) {
    .login-wrapper { padding: 1rem; }
    .login-card { padding: 1.75rem; border-radius: 20px; }
    .card-title { font-size: 1.5rem; }
    
    .nebula { filter: blur(50px); }
    .bright-star::before { width: 40px; }
    .bright-star::after { height: 40px; }
}

/* ===========================================
   ♿ REDUCED MOTION
   =========================================== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
