* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    opacity: 0;
    transition: opacity 0.3s ease;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #000000;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    padding: 20px 0;
    position: relative;
}

body.loaded {
    opacity: 1;
}

/* Cosmic Void Background */
.bg-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    background: radial-gradient(ellipse at center, #0a0015 0%, #000000 70%);
    overflow: hidden;
}

/* Floating particles/stars */
.bg-animation::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(2px 2px at 20% 30%, white, transparent),
        radial-gradient(2px 2px at 60% 70%, white, transparent),
        radial-gradient(1px 1px at 50% 50%, white, transparent),
        radial-gradient(1px 1px at 80% 10%, white, transparent),
        radial-gradient(2px 2px at 90% 60%, white, transparent),
        radial-gradient(1px 1px at 33% 80%, white, transparent),
        radial-gradient(1px 1px at 15% 75%, white, transparent);
    background-size: 200% 200%;
    background-position: 0% 0%;
    animation: stars 60s linear infinite;
    opacity: 0.5;
}

@keyframes stars {
    from { background-position: 0% 0%; }
    to { background-position: 100% 100%; }
}

/* Void portals/orbs */
.void-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.6;
    animation: float-void 25s ease-in-out infinite;
}

.void-orb1 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(102, 51, 153, 0.4) 0%, transparent 70%);
    top: 10%;
    left: 5%;
    animation-delay: 0s;
}

.void-orb2 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(20, 20, 60, 0.5) 0%, transparent 70%);
    top: 50%;
    right: 10%;
    animation-delay: -8s;
}

.void-orb3 {
    width: 450px;
    height: 450px;
    background: radial-gradient(circle, rgba(75, 0, 130, 0.3) 0%, transparent 70%);
    bottom: 15%;
    left: 40%;
    animation-delay: -15s;
}

@keyframes float-void {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    33% {
        transform: translate(80px, -100px) scale(1.15);
    }
    66% {
        transform: translate(-60px, 80px) scale(0.9);
    }
}

.logo-img {
    width: 150px;
    height: 150px;
    border-radius: 75%;
    box-shadow: 0 8px 30px rgba(157, 78, 221, 0.6);
    transition: transform 0.3s ease;
    margin-bottom: -75px;
    position: relative;
    z-index: 2;
    border: 2px solid rgba(157, 78, 221, 0.3);
}

.logo-img:hover {
    transform: scale(1.05);
    box-shadow: 0 12px 40px rgba(157, 78, 221, 0.8);
}

.container {
    text-align: center;
    background: rgba(10, 0, 21, 0.7);
    border: 1px solid rgba(157, 78, 221, 0.4);
    padding-top: 100px;
    padding-left: 50px;
    padding-right: 50px;
    padding-bottom: 50px;
    border-radius: 20px;
    backdrop-filter: blur(15px);
    box-shadow: 0 8px 40px rgba(157, 78, 221, 0.3);
    max-width: 450px;
    width: 90%;
    flex-shrink: 0;
    margin-top: auto;
    margin-bottom: auto;
    position: relative;
    z-index: 2;
}

h1 {
    color: #c77dff;
    margin-bottom: 30px;
    font-size: 28px;
    text-shadow: 0 0 20px rgba(199, 125, 255, 0.5);
    letter-spacing: 1px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.input-group input {
    width: 100%;
    padding: 15px;
    border: 2px solid rgba(157, 78, 221, 0.4);
    border-radius: 10px;
    background: rgba(10, 0, 21, 0.5);
    color: white;
    font-size: 16px;
    outline: none;
    box-sizing: border-box;
    transition: all 0.3s ease;
}

.input-group input::placeholder {
    color: rgba(199, 125, 255, 0.5);
    transition: opacity 0.3s ease;
}

.input-group input:focus {
    background: rgba(20, 0, 40, 0.6);
    box-shadow: 0 0 25px rgba(157, 78, 221, 0.4);
    border: 2px solid #9d4edd;
    outline: none;
}

.input-group input:focus::placeholder {
    opacity: 0;
}

.input-group input:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.login-button {
    background: linear-gradient(135deg, #7209b7 0%, #9d4edd 100%);
    color: #fff;
    border: 1px solid rgba(157, 78, 221, 0.5);
    padding: 18px 40px;
    font-size: 18px;
    font-weight: bold;
    border-radius: 25px;
    cursor: pointer;
    box-shadow: 0 6px 25px rgba(114, 9, 183, 0.5);
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
}

.login-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 35px rgba(157, 78, 221, 0.7);
}

.login-button:active {
    transform: translateY(-1px);
}

.login-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.login-button span {
    position: relative;
    z-index: 1;
}

.footer {
    padding: 20px 0;
    text-align: center;
    color: white;
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-shrink: 0;
    position: relative;
    z-index: 2;
}

.footer a {
    color: #9d4edd;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s ease;
}

.footer a:hover {
    color: #c77dff;
    text-shadow: 0 0 10px rgba(199, 125, 255, 0.5);
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
}

.modal-content {
    background: linear-gradient(135deg, rgba(10, 0, 21, 0.95) 0%, rgba(20, 0, 40, 0.95) 100%);
    margin: 15% auto;
    padding: 30px;
    border-radius: 15px;
    width: 400px;
    max-width: 90%;
    box-shadow: 0 8px 40px rgba(157, 78, 221, 0.5);
    border: 1px solid rgba(157, 78, 221, 0.4);
    color: white;
    text-align: center;
}

.close {
    color: #9d4edd;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close:hover {
    color: #c77dff;
}

.modal-content h2 {
    margin-bottom: 20px;
    color: #c77dff;
}

.modal-content a {
    color: #9d4edd;
    text-decoration: none;
    transition: color 0.3s ease;
}

.modal-content a:hover {
    color: #c77dff;
}

.error-message {
    color: #ff6b6b;
    background: rgba(255, 107, 107, 0.15);
    padding: 10px;
    border-radius: 8px;
    font-size: 14px;
    display: none;
    border: 1px solid rgba(255, 107, 107, 0.3);
}

.error-message.show {
    display: block;
}

.loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 3px solid rgba(157, 78, 221, 0.3);
    border-radius: 50%;
    border-top-color: #9d4edd;
    animation: spin 1s ease-in-out infinite;
}

/* Loading Screen */
.loading-screen {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000000;
    z-index: 9999;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.loading-screen.active {
    display: flex;
}

.loading-content {
    text-align: center;
}

.loading-title {
    font-size: 36px;
    margin-bottom: 30px;
    background: linear-gradient(135deg, #9d4edd 0%, #c77dff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 3px;
    filter: drop-shadow(0 0 20px rgba(157, 78, 221, 0.6));
}

.progress-bar-container {
    width: 400px;
    height: 8px;
    background: rgba(157, 78, 221, 0.2);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 0 20px rgba(157, 78, 221, 0.3);
    border: 1px solid rgba(157, 78, 221, 0.3);
}

.progress-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #7209b7 0%, #9d4edd 50%, #c77dff 100%);
    border-radius: 10px;
    transition: width 0.3s ease;
    box-shadow: 0 0 25px rgba(157, 78, 221, 0.8);
    position: relative;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.4) 50%, 
        transparent 100%);
    animation: shimmer 1.5s infinite;
}

.success-message {
    color: #4ade80;
    background: rgba(74, 222, 128, 0.15);
    padding: 10px;
    border-radius: 8px;
    font-size: 14px;
    display: none;
    border: 1px solid rgba(74, 222, 128, 0.3);
}

.success-message.show {
    display: block;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.loading-text {
    margin-top: 20px;
    color: #9d4edd;
    font-size: 16px;
    text-shadow: 0 0 10px rgba(157, 78, 221, 0.5);
}

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

/* Responsive */
@media (max-width: 768px) {
    .progress-bar-container {
        width: 300px;
    }
    
    .container {
        padding: 80px 30px 40px;
    }
}