/* Login Page - Cyberpunk Theme */
:root {
    --cyber-primary: #00D4FF;
    --cyber-secondary: #0099CC;
    --cyber-accent: #33E6FF;
    --cyber-dark: #0A0F1C;
    --cyber-darker: #050914;
    --cyber-light: rgba(0, 212, 255, 0.1);
    --cyber-glow: rgba(0, 212, 255, 0.3);
    --cyber-glow-strong: rgba(0, 212, 255, 0.6);
    --cyber-success: #00ff88;
    --cyber-warning: #ff9500;
    --cyber-error: #ff4757;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--cyber-darker);
    color: white;
    overflow: hidden;
    height: 100vh;
}

/* ========== BACKGROUND ELEMENTS ========== */
.login-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: 
        linear-gradient(135deg, var(--cyber-darker) 0%, var(--cyber-dark) 50%, var(--cyber-darker) 100%),
        radial-gradient(circle at 20% 20%, rgba(0, 212, 255, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(51, 230, 255, 0.05) 0%, transparent 50%);
}

.cyber-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    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: gridPulse 4s ease-in-out infinite;
}

.cyber-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: var(--cyber-primary);
    border-radius: 50%;
    box-shadow: 0 0 6px var(--cyber-glow);
    animation: float linear infinite;
}

@keyframes gridPulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.1; }
}

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

/* ========== MAIN CONTAINER ========== */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    position: relative;
}

.login-panel {
    background: linear-gradient(135deg, rgba(10, 15, 28, 0.95) 0%, rgba(5, 9, 20, 0.98) 100%);
    border: 1px solid var(--cyber-primary);
    border-radius: 16px;
    padding: 40px;
    max-width: 450px;
    width: 100%;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.8),
        inset 0 1px 0 rgba(0, 212, 255, 0.2),
        0 0 40px rgba(0, 212, 255, 0.1);
    position: relative;
    backdrop-filter: blur(10px);
    animation: panelEntry 1s ease-out;
}

.login-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 10% 10%, rgba(0, 212, 255, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 90% 90%, rgba(51, 230, 255, 0.05) 0%, transparent 50%);
    border-radius: 16px;
    pointer-events: none;
}

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

/* ========== LOGO SECTION ========== */
.logo-section {
    text-align: center;
    margin-bottom: 32px;
    position: relative;
}

.logo {
    max-width: 280px;
    width: 100%;
    height: auto;
    filter: brightness(1.1) contrast(1.1);
    transition: all 0.3s ease;
    position: relative;
    z-index: 2;
}

.logo:hover {
    filter: brightness(1.3) contrast(1.2);
    transform: scale(1.02);
}

.logo-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 300px;
    height: 60px;
    background: radial-gradient(ellipse, rgba(0, 212, 255, 0.2) 0%, transparent 70%);
    filter: blur(20px);
    animation: logoGlow 3s ease-in-out infinite;
}

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

/* ========== FORM STYLING ========== */
.form-header {
    text-align: center;
    margin-bottom: 32px;
}

.form-title {
    color: var(--cyber-accent);
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 8px;
    text-shadow: 0 0 10px rgba(51, 230, 255, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.form-title i {
    color: var(--cyber-primary);
    text-shadow: 0 0 12px var(--cyber-glow);
}

.form-subtitle {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    font-weight: 400;
}

.cyber-form {
    position: relative;
    z-index: 1;
}

.form-group {
    margin-bottom: 24px;
}

.form-label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--cyber-primary);
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
    text-shadow: 0 0 6px var(--cyber-glow);
}

.form-label i {
    font-size: 12px;
}

.input-wrapper {
    position: relative;
    transition: all 0.3s ease;
}

.form-input {
    width: 100%;
    padding: 14px 16px;
    background: rgba(0, 212, 255, 0.05);
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 15px;
    outline: none;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
}

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

.form-input:focus {
    border-color: var(--cyber-primary);
    background: rgba(0, 212, 255, 0.08);
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.2);
    transform: translateY(-1px);
}

.input-wrapper.focused .input-border {
    transform: scaleX(1);
}

.input-border {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--cyber-primary), var(--cyber-accent));
    transform: scaleX(0);
    transition: transform 0.3s ease;
    border-radius: 0 0 8px 8px;
}

.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    padding: 4px;
    transition: all 0.3s ease;
    z-index: 2;
}

.password-toggle:hover {
    color: var(--cyber-primary);
    text-shadow: 0 0 8px var(--cyber-glow);
}

/* ========== FORM OPTIONS ========== */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.checkbox-wrapper input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 18px;
    height: 18px;
    border: 1px solid rgba(0, 212, 255, 0.4);
    border-radius: 3px;
    background: rgba(0, 212, 255, 0.05);
    position: relative;
    transition: all 0.3s ease;
}

.checkbox-wrapper input[type="checkbox"]:checked + .checkmark {
    background: var(--cyber-primary);
    border-color: var(--cyber-primary);
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
}

.checkbox-wrapper input[type="checkbox"]:checked + .checkmark::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--cyber-darker);
    font-size: 12px;
    font-weight: bold;
}

.checkbox-text {
    color: rgba(255, 255, 255, 0.8);
    font-size: 13px;
}

.forgot-password {
    color: var(--cyber-accent);
    font-size: 13px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.forgot-password:hover {
    color: var(--cyber-primary);
    text-shadow: 0 0 6px var(--cyber-glow);
}

/* ========== LOGIN BUTTON ========== */
.login-button {
    width: 100%;
    padding: 16px;
    background: linear-gradient(45deg, var(--cyber-primary), var(--cyber-secondary));
    border: none;
    border-radius: 8px;
    color: var(--cyber-darker);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.3);
}

.login-button:hover {
    background: linear-gradient(45deg, var(--cyber-accent), var(--cyber-primary));
    box-shadow: 0 0 30px rgba(0, 212, 255, 0.5);
    transform: translateY(-2px);
}

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

.button-text {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    position: relative;
    z-index: 1;
}

.button-glow {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.login-button:hover .button-glow {
    left: 100%;
}

/* Legacy button support */
#loginBtn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(45deg, var(--cyber-primary), var(--cyber-secondary));
    border: none;
    border-radius: 8px;
    color: var(--cyber-darker);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.3);
}

#loginBtn:hover {
    background: linear-gradient(45deg, var(--cyber-accent), var(--cyber-primary));
    box-shadow: 0 0 30px rgba(0, 212, 255, 0.5);
    transform: translateY(-2px);
}

#loginBtn:active {
    transform: translateY(0);
}

#loginBtn:disabled {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.3);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ========== MESSAGES ========== */
.message {
    margin-bottom: 20px;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 14px;
    text-align: center;
    border: 1px solid;
    display: none;
}

.message.success {
    background: rgba(0, 255, 136, 0.1);
    border-color: var(--cyber-success);
    color: var(--cyber-success);
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.2);
    display: block;
}

.message.error {
    background: rgba(255, 71, 87, 0.1);
    border-color: var(--cyber-error);
    color: var(--cyber-error);
    box-shadow: 0 0 15px rgba(255, 71, 87, 0.2);
    display: block;
}

.message.warning {
    background: rgba(255, 149, 0, 0.1);
    border-color: var(--cyber-warning);
    color: var(--cyber-warning);
    box-shadow: 0 0 15px rgba(255, 149, 0, 0.2);
    display: block;
}

.message.loading {
    background: rgba(0, 212, 255, 0.1);
    border-color: var(--cyber-primary);
    color: var(--cyber-primary);
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.2);
    display: block;
}

/* ========== SECURITY NOTICE ========== */
.security-notice {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 24px;
    padding: 12px;
    background: rgba(0, 212, 255, 0.05);
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
}

.security-notice i {
    color: var(--cyber-primary);
    text-shadow: 0 0 6px var(--cyber-glow);
}

/* ========== CYBER CORNERS ========== */
.cyber-corner {
    position: absolute;
    width: 30px;
    height: 30px;
    border: 2px solid var(--cyber-primary);
    pointer-events: none;
    opacity: 0.6;
}

.cyber-corner.top-left {
    top: 20px;
    left: 20px;
    border-right: none;
    border-bottom: none;
    animation: cornerPulse 3s ease-in-out infinite;
}

.cyber-corner.top-right {
    top: 20px;
    right: 20px;
    border-left: none;
    border-bottom: none;
    animation: cornerPulse 3s ease-in-out infinite 0.5s;
}

.cyber-corner.bottom-left {
    bottom: 20px;
    left: 20px;
    border-right: none;
    border-top: none;
    animation: cornerPulse 3s ease-in-out infinite 1s;
}

.cyber-corner.bottom-right {
    bottom: 20px;
    right: 20px;
    border-left: none;
    border-top: none;
    animation: cornerPulse 3s ease-in-out infinite 1.5s;
}

@keyframes cornerPulse {
    0%, 100% { 
        opacity: 0.6; 
        box-shadow: 0 0 5px var(--cyber-glow);
    }
    50% { 
        opacity: 1; 
        box-shadow: 0 0 15px var(--cyber-glow-strong);
    }
}

/* ========== SCANNING LINE ========== */
.scanning-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--cyber-primary), transparent);
    animation: scan 4s linear infinite;
    opacity: 0.7;
}

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

/* ========== RESPONSIVE DESIGN ========== */
@media (max-width: 768px) {
    .login-panel {
        padding: 30px 24px;
        margin: 10px;
        max-width: 100%;
    }
    
    .logo {
        max-width: 240px;
    }
    
    .form-title {
        font-size: 20px;
    }
    
    .form-options {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
    }
    
    .cyber-corner {
        width: 20px;
        height: 20px;
    }
    
    .cyber-corner.top-left,
    .cyber-corner.top-right {
        top: 10px;
    }
    
    .cyber-corner.bottom-left,
    .cyber-corner.bottom-right {
        bottom: 10px;
    }
    
    .cyber-corner.top-left,
    .cyber-corner.bottom-left {
        left: 10px;
    }
    
    .cyber-corner.top-right,
    .cyber-corner.bottom-right {
        right: 10px;
    }
}

@media (max-width: 480px) {
    body {
        overflow-y: auto;
    }
    
    .login-container {
        min-height: auto;
        padding: 20px 10px;
    }
    
    .login-panel {
        padding: 24px 20px;
    }
    
    .logo {
        max-width: 200px;
    }
    
    .form-title {
        font-size: 18px;
        flex-direction: column;
        gap: 8px;
    }
    
    .form-input {
        padding: 12px 14px;
        font-size: 14px;
    }
    
    .login-button, #loginBtn {
        padding: 14px;
        font-size: 14px;
    }
}

/* ========== LOADING STATES ========== */
.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid transparent;
    border-top: 2px solid var(--cyber-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}