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

:root {
    --primary-bg: #0a0e1a;
    --secondary-bg: #151b2d;
    --tertiary-bg: #1e2a42;
    --accent-blue: #00d4ff;
    --accent-cyan: #00ffff;
    --accent-green: #00ff88;
    --accent-orange: #ff8800;
    --accent-red: #ff4444;
    --text-primary: #ffffff;
    --text-secondary: #b8c6db;
    --text-muted: #6b7280;
    --border-color: #2d3748;
    --glow-color: rgba(0, 212, 255, 0.5);
    --success-color: #10b981;
    --error-color: #ef4444;
    --warning-color: #f59e0b;
}

body {
    font-family: 'Rajdhani', sans-serif;
    background: var(--primary-bg);
    color: var(--text-primary);
    min-height: 100vh;
    overflow: hidden;
}

.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: 
        radial-gradient(circle at 20% 80%, rgba(0, 212, 255, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(0, 255, 255, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(0, 255, 136, 0.1) 0%, transparent 50%),
        linear-gradient(135deg, var(--primary-bg) 0%, var(--secondary-bg) 100%);
}

/* Background Animation */
.bg-animation {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    z-index: 1;
}

.grid-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        linear-gradient(rgba(0, 212, 255, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 212, 255, 0.1) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: gridMove 20s linear infinite;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--accent-cyan);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--accent-cyan);
    animation: float var(--duration) ease-in-out infinite var(--delay);
}

.particle:nth-child(2) {
    top: 20%;
    left: 10%;
    background: var(--accent-blue);
    box-shadow: 0 0 10px var(--accent-blue);
}

.particle:nth-child(3) {
    top: 60%;
    right: 15%;
    background: var(--accent-green);
    box-shadow: 0 0 10px var(--accent-green);
}

.particle:nth-child(4) {
    bottom: 30%;
    left: 20%;
    background: var(--accent-orange);
    box-shadow: 0 0 10px var(--accent-orange);
}

.particle:nth-child(5) {
    top: 40%;
    right: 30%;
    background: var(--accent-cyan);
    box-shadow: 0 0 10px var(--accent-cyan);
}

/* Login Panel */
.login-panel {
    background: rgba(21, 27, 45, 0.95);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    width: 100%;
    max-width: 450px;
    margin: 2rem;
    position: relative;
    z-index: 10;
    backdrop-filter: blur(20px);
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(0, 212, 255, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.login-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        var(--accent-blue) 20%, 
        var(--accent-cyan) 50%, 
        var(--accent-blue) 80%, 
        transparent 100%);
    border-radius: 16px 16px 0 0;
    animation: scanLine 3s ease-in-out infinite;
}

/* Panel Header */
.panel-header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(45, 55, 72, 0.5);
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.logo-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(45deg, var(--accent-blue), var(--accent-cyan));
    border-radius: 12px;
    position: relative;
    animation: pulse 2s infinite;
}

.logo-icon::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60%;
    height: 60%;
    background: var(--primary-bg);
    border-radius: 6px;
}

.logo h1 {
    font-family: 'Orbitron', monospace;
    font-size: 2rem;
    font-weight: 900;
    letter-spacing: 3px;
    background: linear-gradient(45deg, var(--accent-blue), var(--accent-cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.version {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 400;
}

.system-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--accent-green);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-green);
    animation: pulse 1.5s infinite;
}

/* Access Form */
.access-form {
    margin-bottom: 2rem;
}

.access-form h2 {
    font-family: 'Orbitron', monospace;
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 0.5rem;
    color: var(--accent-cyan);
    letter-spacing: 2px;
}

.access-subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 2rem;
    font-weight: 500;
}

.login-form {
    margin-bottom: 1.5rem;
}

.input-group {
    margin-bottom: 2rem;
}

.input-group label {
    display: block;
    margin-bottom: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.85rem;
}

.input-wrapper {
    position: relative;
}

.input-wrapper input {
    width: 100%;
    padding: 1rem 1.25rem;
    background: rgba(10, 14, 26, 0.8);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    font-family: 'Rajdhani', sans-serif;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    z-index: 2;
}

.input-wrapper input:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 2px rgba(0, 212, 255, 0.2);
    background: rgba(10, 14, 26, 0.95);
}

.input-wrapper input::placeholder {
    color: var(--text-muted);
    font-style: italic;
}

.input-border {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 2px solid transparent;
    border-radius: 10px;
    background: linear-gradient(45deg, var(--accent-blue), var(--accent-cyan)) border-box;
    -webkit-mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: exclude;
    mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.input-wrapper input:focus + .input-border {
    opacity: 1;
}

/* Access Button */
.access-btn {
    width: 100%;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-cyan));
    border: none;
    border-radius: 10px;
    color: var(--primary-bg);
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.access-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 212, 255, 0.4);
}

.access-btn:active {
    transform: translateY(0);
}

.access-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.access-btn:hover::before {
    left: 100%;
}

.btn-loader {
    width: 20px;
    height: 20px;
    border: 2px solid var(--primary-bg);
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: none;
}

.access-btn.loading .btn-text {
    display: none;
}

.access-btn.loading .btn-loader {
    display: block;
}

/* Security Notice */
.security-notice {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--accent-green);
    font-weight: 500;
}

.notice-icon {
    width: 16px;
    height: 16px;
    position: relative;
}

.notice-icon::before {
    content: '';
    position: absolute;
    width: 12px;
    height: 8px;
    border: 2px solid var(--accent-green);
    border-top: none;
    border-radius: 0 0 4px 4px;
    top: 6px;
    left: 2px;
}

.notice-icon::after {
    content: '';
    position: absolute;
    width: 8px;
    height: 4px;
    border: 2px solid var(--accent-green);
    border-bottom: none;
    border-radius: 4px 4px 0 0;
    top: 2px;
    left: 4px;
}

/* System Info */
.system-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(45, 55, 72, 0.5);
    font-family: 'Orbitron', monospace;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.info-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.info-label {
    font-weight: 400;
    opacity: 0.7;
}

.info-value {
    font-weight: 600;
    color: var(--text-secondary);
}

.status-online {
    color: var(--accent-green);
}

/* Error Message */
.error-message {
    position: fixed;
    top: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: rgba(239, 68, 68, 0.95);
    color: white;
    padding: 1rem 2rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 600;
    font-size: 0.9rem;
    z-index: 1000;
    backdrop-filter: blur(10px);
    border: 1px solid var(--accent-red);
    opacity: 0;
    transition: all 0.3s ease;
}

.error-message.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.error-icon {
    width: 20px;
    height: 20px;
    position: relative;
    flex-shrink: 0;
}

.error-icon::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border: 2px solid white;
    border-radius: 50%;
    top: 2px;
    left: 2px;
}

.error-icon::after {
    content: '';
    position: absolute;
    width: 2px;
    height: 8px;
    background: white;
    top: 6px;
    left: 9px;
    border-radius: 1px;
    box-shadow: 0 10px 0 white;
}

/* Animations */
@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.05); }
}

@keyframes float {
    0%, 100% { transform: translateY(0px) translateX(0px); }
    25% { transform: translateY(-20px) translateX(10px); }
    50% { transform: translateY(-10px) translateX(-5px); }
    75% { transform: translateY(-30px) translateX(-10px); }
}

@keyframes gridMove {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

@keyframes scanLine {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .login-panel {
        margin: 1rem;
        padding: 1.5rem;
        max-width: none;
    }

    .logo h1 {
        font-size: 1.5rem;
        letter-spacing: 2px;
    }

    .logo-icon {
        width: 40px;
        height: 40px;
    }

    .access-form h2 {
        font-size: 1.3rem;
        letter-spacing: 1px;
    }

    .system-info {
        flex-direction: column;
        gap: 1rem;
    }

    .info-item {
        flex-direction: row;
        gap: 0.5rem;
    }

    .particle {
        display: none;
    }
}

@media (max-width: 480px) {
    .login-panel {
        margin: 0.5rem;
        padding: 1rem;
    }

    .panel-header {
        margin-bottom: 1.5rem;
        padding-bottom: 1rem;
    }

    .logo {
        flex-direction: column;
        gap: 0.5rem;
    }

    .access-form h2 {
        font-size: 1.2rem;
    }

    .input-wrapper input {
        padding: 0.875rem 1rem;
        font-size: 0.9rem;
    }

    .access-btn {
        padding: 0.875rem 1.5rem;
        font-size: 0.9rem;
        letter-spacing: 1px;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    :root {
        --border-color: #4a5568;
        --text-muted: #a0aec0;
    }
    
    .login-panel {
        border-width: 2px;
    }
    
    .input-wrapper input {
        border-width: 2px;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .particle {
        display: none;
    }
}