/* LEOS Mission Ready Professional Login Interface */

/* Full-Screen Login Interface */
.login-interface {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1002;
    padding: 20px 20px 40px 20px;
    box-sizing: border-box;
    overflow: hidden;
    /* Ensure visibility */
    opacity: 1 !important;
    visibility: visible !important;
}

/* Top Branding Section */
.login-header {
    text-align: center;
    margin-bottom: 20px;
    animation: fadeInDown 1s ease-out;
    flex-shrink: 0;
    /* Ensure visibility */
    opacity: 1 !important;
    z-index: 1003;
}

.cyberrts-logo-link {
    display: inline-block;
    text-decoration: none;
    cursor: pointer;
}

.cyberrts-logo {
    max-height: 120px;
    width: auto;
    margin-top: 20px;
    margin-bottom: 0;
    opacity: 0.9;
    transition: all 0.3s ease;
    cursor: pointer;
}

.cyberrts-logo:hover {
    opacity: 1;
    transform: scale(1.05);
}

.leos-branding {
    margin-top: 5px;
}

.leos-title {
    font-size: 36px;
    font-weight: 700;
    margin: 0;
    color: #e2e8f0;
    letter-spacing: -1px;
    text-shadow: 0 0 20px rgba(0, 212, 255, 0.3);
}

.leos-highlight {
    background: linear-gradient(45deg, #00d4ff, #0099ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.leos-tagline {
    font-size: 16px;
    color: #94a3b8;
    margin: 0;
    font-weight: 400;
    letter-spacing: 0.5px;
}

/* Main Login Card */
.login-card {
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 24px;
    padding: 20px;
    width: 100%;
    max-width: 440px;
    margin: 0 auto;
    backdrop-filter: blur(20px);
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.1) inset,
        0 0 30px rgba(0, 212, 255, 0.1);
    animation: slideUp 0.8s ease-out 0.3s both;
    flex-shrink: 0;
    max-height: 90vh;
    overflow-y: auto;
}

.login-card-header {
    text-align: center;
    margin-bottom: 20px;
}

.login-card-header h2 {
    font-size: 22px;
    font-weight: 700;
    color: #e2e8f0;
    margin: 0 0 6px 0;
    background: linear-gradient(45deg, #e2e8f0, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-card-header p {
    color: #64748b;
    margin: 0;
    font-size: 14px;
}

/* Enterprise Login Options */
.enterprise-login-options {
    margin-bottom: 32px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.enterprise-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px 24px;
    border: 2px solid;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.enterprise-btn.primary {
    background: linear-gradient(45deg, #0099ff, #00d4ff);
    border-color: #0099ff;
    color: white;
}

.enterprise-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 153, 255, 0.3);
}

.enterprise-btn.secondary {
    background: rgba(15, 23, 42, 0.8);
    border-color: rgba(148, 163, 184, 0.3);
    color: #e2e8f0;
}

.enterprise-btn.secondary:hover {
    background: rgba(15, 23, 42, 0.95);
    border-color: rgba(148, 163, 184, 0.5);
    transform: translateY(-1px);
}

/* SSO Button */
.sso-btn {
    width: 100%;
    padding: 14px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(148, 163, 184, 0.3);
    border-radius: 10px;
    color: #e2e8f0;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.sso-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: #0099ff;
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(0, 153, 255, 0.2);
}

.divider {
    display: flex;
    align-items: center;
    margin: 16px 0;
    text-align: center;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(148, 163, 184, 0.2);
}

.divider span {
    padding: 0 16px;
    color: #64748b;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.demo-login-form {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid rgba(148, 163, 184, 0.2);
}

/* Login Form */
.login-form {
    margin-bottom: 20px;
}

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

.form-group label {
    display: block;
    margin-bottom: 6px;
    color: #e2e8f0;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    background: rgba(15, 23, 42, 0.8);
    border: 2px solid rgba(148, 163, 184, 0.2);
    border-radius: 10px;
    color: #e2e8f0;
    font-size: 15px;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.form-group input:focus {
    outline: none;
    border-color: #0099ff;
    background: rgba(15, 23, 42, 0.95);
    box-shadow: 0 0 0 4px rgba(0, 153, 255, 0.1);
}

.form-group input::placeholder {
    color: #64748b;
}

.login-btn {
    width: 100%;
    padding: 14px 20px;
    background: linear-gradient(45deg, #0099ff, #00d4ff);
    border: none;
    border-radius: 10px;
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(0, 153, 255, 0.4);
    background: linear-gradient(45deg, #0088ee, #00c4ee);
}

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

.auth-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
    padding: 16px 20px;
    border-radius: 12px;
    font-size: 14px;
    margin-bottom: 20px;
    text-align: center;
}

/* Demo Accounts Section */
.demo-accounts-section {
    border-top: 1px solid rgba(148, 163, 184, 0.2);
    padding-top: 20px;
}

.demo-accounts-section h3 {
    color: #e2e8f0;
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 12px 0;
    text-align: center;
}

.demo-accounts-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.demo-account-card {
    display: grid;
    grid-template-columns: 48px 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 12px 16px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.demo-account-card:hover {
    background: rgba(15, 23, 42, 0.8);
    border-color: rgba(0, 153, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 153, 255, 0.1);
}

.demo-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    background: rgba(0, 153, 255, 0.1);
    border: 2px solid rgba(0, 153, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
}

.demo-avatar img {
    width: 28px;
    height: 28px;
    filter: brightness(0) saturate(100%) invert(58%) sepia(84%) saturate(2044%) hue-rotate(178deg) brightness(102%) contrast(101%);
}

.demo-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.demo-info h4 {
    color: #e2e8f0;
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

.demo-info p {
    color: #94a3b8;
    font-size: 14px;
    margin: 0;
    font-weight: 500;
}

.demo-info .company {
    color: #64748b;
    font-size: 12px;
    font-weight: 400;
}

.demo-tier {
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.demo-tier.mission-ready {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.demo-tier.first-orbit {
    background: rgba(100, 116, 139, 0.2);
    color: #94a3b8;
    border: 1px solid rgba(100, 116, 139, 0.3);
}

/* Enterprise Features */
.enterprise-features {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid rgba(148, 163, 184, 0.2);
}

.enterprise-features h4 {
    color: #e2e8f0;
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 16px 0;
    text-align: center;
}

.enterprise-features ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.enterprise-features li {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #94a3b8;
    font-size: 13px;
    font-weight: 500;
}

.feature-icon {
    width: 16px;
    height: 16px;
    filter: brightness(0) saturate(100%) invert(58%) sepia(84%) saturate(2044%) hue-rotate(178deg) brightness(102%) contrast(101%);
}

.user-tier-badge {
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 12px;
    display: inline-block;
}

.user-tier-badge.mission-ready {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.user-tier-badge.first-orbit {
    background: rgba(100, 116, 139, 0.2);
    color: #94a3b8;
    border: 1px solid rgba(100, 116, 139, 0.3);
}

/* Footer */
.login-footer {
    text-align: center;
    margin-top: 5px;
    animation: fadeIn 1s ease-out 1s both;
    flex-shrink: 0;
}

.login-footer p {
    color: #64748b;
    font-size: 14px;
    margin: 0;
}

.login-footer a {
    color: #0099ff;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.login-footer a:hover {
    color: #00d4ff;
    text-decoration: underline;
}

.footer-secondary {
    margin-top: 8px;
    font-size: 12px;
    color: #475569;
}

/* Animations */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Welcome Flow Styles */
.welcome-flow {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    transition: opacity 0.5s ease;
}

.welcome-content {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 20px;
}

.welcome-card {
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 24px;
    padding: 48px 40px;
    width: 100%;
    max-width: 700px;
    text-align: center;
    backdrop-filter: blur(20px);
    animation: slideUp 0.8s ease-out;
    position: relative;
}

.close-welcome-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 30px;
    height: 30px;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 28px;
    line-height: 1;
    color: #94a3b8;
    font-weight: 300;
    padding: 0;
}

.close-welcome-btn:hover {
    color: #e2e8f0;
    transform: scale(1.1);
}

.welcome-header {
    margin-bottom: 40px;
}

.user-avatar-large {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin-bottom: 20px;
    filter: brightness(0) saturate(100%) invert(58%) sepia(84%) saturate(2044%) hue-rotate(178deg) brightness(102%) contrast(101%);
}

.welcome-card h1 {
    font-size: 32px;
    font-weight: 700;
    color: #e2e8f0;
    margin: 0 0 8px 0;
}

.user-role {
    color: #94a3b8;
    font-size: 16px;
    margin: 0;
}

.mission-summary h2 {
    color: #e2e8f0;
    font-size: 24px;
    font-weight: 600;
    margin: 0 0 24px 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-bottom: 40px;
}

.stat-card {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 16px;
    padding: 24px 20px;
}

.stat-number {
    font-size: 32px;
    font-weight: 700;
    color: #00d4ff;
    margin-bottom: 8px;
}

.stat-label {
    color: #94a3b8;
    font-size: 14px;
    font-weight: 500;
}

.continue-btn {
    padding: 16px 32px;
    background: linear-gradient(45deg, #0099ff, #00d4ff);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.continue-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 153, 255, 0.3);
}

/* Mission Initialization Section */
.mission-initialization {
    margin: 40px 0;
    text-align: left;
}

.mission-initialization h2 {
    color: #00d4ff;
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 20px 0;
    text-align: center;
}

.init-status {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 500px;
    margin: 0 auto;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 20px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.1);
}

.status-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.status-icon.loading {
    background: rgba(0, 212, 255, 0.2);
    border: 2px solid #00d4ff;
    position: relative;
}

.status-icon.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top-color: #00d4ff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.status-icon.complete {
    background: rgba(16, 185, 129, 0.2);
    border: 2px solid #10b981;
}

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

.status-item span:last-child {
    color: #94a3b8;
    font-size: 14px;
    font-weight: 500;
}


/* Loading Screen Override */
#loading-screen {
    display: flex !important;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    background: #000000; /* Keep black for aurora visibility */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999;
    /* Ensure children are visible */
    flex-direction: column;
}

/* Responsive Design */
@media (max-width: 768px) {
    .login-interface {
        padding: 20px 16px;
    }
    
    .login-header {
        margin-bottom: 40px;
    }
    
    .cyberrts-logo {
        height: 80px;
        margin-bottom: 20px;
    }
    
    .leos-title {
        font-size: 36px;
    }
    
    .leos-tagline {
        font-size: 16px;
    }
    
    .login-card {
        padding: 32px 24px;
        max-width: 100%;
    }
    
    .login-card-header h2 {
        font-size: 24px;
    }
    
    .demo-account-card {
        grid-template-columns: 50px 1fr auto;
        gap: 12px;
        padding: 16px;
    }
    
    .demo-avatar {
        width: 50px;
        height: 50px;
    }
    
    .demo-avatar img {
        width: 30px;
        height: 30px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}

@media (max-width: 480px) {
    .login-card {
        padding: 24px 20px;
        border-radius: 16px;
    }
    
    .leos-title {
        font-size: 28px;
    }
    
    .demo-account-card {
        grid-template-columns: 1fr;
        gap: 12px;
        text-align: center;
    }
    
    .demo-tier {
        justify-self: center;
    }
}

/* Loading overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: #000000;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.3s ease;
    overflow: hidden;
}

/* Starry background layers */
.loading-overlay::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(2px 2px at 20px 30px, #ffffff, transparent),
        radial-gradient(2px 2px at 40px 70px, #ffffff, transparent),
        radial-gradient(1px 1px at 50px 160px, #e0e0e0, transparent),
        radial-gradient(1px 1px at 130px 40px, #e0e0e0, transparent),
        radial-gradient(2px 2px at 80px 10px, #ffffff, transparent),
        radial-gradient(1px 1px at 110px 90px, #e0e0e0, transparent),
        radial-gradient(1px 1px at 140px 120px, #e0e0e0, transparent),
        radial-gradient(2px 2px at 90px 150px, #ffffff, transparent);
    background-repeat: repeat;
    background-size: 200px 200px;
    opacity: 0.7;
    animation: twinkle 8s ease-in-out infinite;
}

.loading-overlay::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(1px 1px at 15px 45px, #d0d0d0, transparent),
        radial-gradient(1px 1px at 75px 125px, #d0d0d0, transparent),
        radial-gradient(1px 1px at 165px 95px, #d0d0d0, transparent),
        radial-gradient(1px 1px at 95px 65px, #d0d0d0, transparent),
        radial-gradient(1px 1px at 125px 180px, #d0d0d0, transparent),
        radial-gradient(1px 1px at 55px 25px, #d0d0d0, transparent),
        radial-gradient(1px 1px at 185px 145px, #d0d0d0, transparent);
    background-repeat: repeat;
    background-size: 200px 200px;
    opacity: 0.5;
    animation: twinkle 12s ease-in-out infinite reverse;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.8; }
}

/* Hide time display when loading overlay or login interface is present */
body:has(.loading-overlay) #time-display,
body:has(.loading-overlay) #time-display-container,
body:has(.login-interface) #time-display,
body:has(.login-interface) #time-display-container {
    display: none !important;
}

.loading-content {
    text-align: center;
    max-width: 500px;
    padding: 60px 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
    background: radial-gradient(circle at center, rgba(0, 153, 255, 0.05) 0%, transparent 70%);
    border-radius: 50%;
}

.loading-logo {
    height: 80px;
    width: auto;
    margin-bottom: 24px;
}

.loading-text {
    font-size: 24px;
    font-weight: 600;
    color: #66d9ff;
    margin-bottom: 32px;
    letter-spacing: 0.5px;
}

.loading-progress {
    max-width: 300px;
    margin: 0 auto;
}

.progress-bar {
    width: 100%;
    height: 4px;
    background: rgba(102, 217, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 16px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #0099ff, #66d9ff);
    border-radius: 2px;
    width: 0%;
    transition: width 0.5s ease;
}

.loading-status {
    font-size: 14px;
    color: #94a3b8;
    font-weight: 500;
}