/* ═══════════════════════════════════════════════════════
   LOGIN BOOT SEQUENCE — CRT Military Terminal Init
   ═══════════════════════════════════════════════════════ */

/* ── Boot Overlay ── */
.login-boot-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: #000000;
    z-index: 100;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0 15%;
    font-family: 'Courier New', monospace;
    overflow: hidden;
    transition: opacity 0.6s ease;
}

.login-boot-overlay.boot-fade-out {
    opacity: 0;
    pointer-events: none;
}

/* ── CRT Phosphor Stabilization Flicker ── */
.login-boot-overlay.boot-flicker {
    animation: boot-crt-flicker 0.35s ease-out;
}

@keyframes boot-crt-flicker {
    0%   { filter: brightness(1); }
    15%  { filter: brightness(1.8); }
    30%  { filter: brightness(0.7); }
    50%  { filter: brightness(1.5); }
    70%  { filter: brightness(0.9); }
    85%  { filter: brightness(1.2); }
    100% { filter: brightness(1); }
}

/* ── Boot Lines ── */
.boot-line {
    font-size: 13px;
    line-height: 1.8;
    color: #00FF88;
    letter-spacing: 1px;
    text-shadow: 0 0 4px rgba(0, 255, 136, 0.4);
    white-space: pre;
    opacity: 0;
    min-height: 1.8em;
}

.boot-line.boot-visible {
    opacity: 1;
}

.boot-line .boot-cursor {
    display: inline-block;
    width: 8px;
    height: 13px;
    background: #00FF88;
    margin-left: 2px;
    vertical-align: text-bottom;
    animation: boot-cursor-blink 0.6s step-end infinite;
}

.boot-line.boot-done .boot-cursor {
    display: none;
}

/* Status suffix styling */
.boot-line .boot-ok {
    color: #00FF88;
    text-shadow: 0 0 6px rgba(0, 255, 136, 0.6);
}

.boot-line .boot-warn {
    color: #FFD700;
    text-shadow: 0 0 6px rgba(255, 215, 0, 0.4);
}

/* The final SYSTEM ONLINE line gets special treatment */
.boot-line.boot-final {
    color: #FFD700;
    font-weight: bold;
    font-size: 15px;
    letter-spacing: 3px;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.6);
    margin-top: 0.4em;
}

/* Returning-user handshake line */
.boot-line.boot-handshake {
    color: #00CCFF;
    font-size: 12px;
    letter-spacing: 1px;
    text-shadow: 0 0 6px rgba(0, 204, 255, 0.4);
    margin-top: 0.2em;
}

.boot-line.boot-handshake-unauth {
    color: #FF8844;
    font-size: 12px;
    letter-spacing: 1px;
    text-shadow: 0 0 6px rgba(255, 136, 68, 0.4);
    margin-top: 0.2em;
}

/* Live data suffix (e.g. [42 ACTIVE GAMES]) */
.boot-line .boot-live {
    color: #00CCFF;
    text-shadow: 0 0 4px rgba(0, 204, 255, 0.4);
}

@keyframes boot-cursor-blink {
    0%, 49% { opacity: 1; }
    50%, 100% { opacity: 0; }
}

/* ── Boot Scanline (separate from login-radar scanlines so it's darker) ── */
.login-boot-overlay::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 0, 0, 0.2) 2px,
        rgba(0, 0, 0, 0.2) 4px
    );
    pointer-events: none;
    z-index: 1;
}

/* ── Boot Progress Bar (optional subtle bar at bottom) ── */
.boot-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    background: #00FF88;
    box-shadow: 0 0 8px rgba(0, 255, 136, 0.6);
    width: 0%;
    transition: width 0.3s ease;
}

/* ── Skip Hint ── */
.boot-skip-hint {
    position: absolute;
    bottom: 16px;
    right: 20px;
    font-size: 10px;
    color: rgba(0, 255, 136, 0.3);
    letter-spacing: 1px;
    font-family: 'Courier New', monospace;
    z-index: 2;
}

/* ── Pre-boot hidden states ──
   When boot is active, hide login UI elements until reveal */
#login-screen.boot-active .retro-terminal {
    opacity: 0;
    transition: opacity 0.8s ease 0.1s;
}

#login-screen.boot-active .login-radar-container {
    opacity: 0;
    transition: opacity 1s ease;
}

#login-screen.boot-active .login-intel-ticker,
#login-screen.boot-active .login-featured-card,
#login-screen.boot-active .login-bulletin-list {
    opacity: 0;
    transition: opacity 0.6s ease 0.2s;
}

/* Reveal classes applied after boot completes */
#login-screen.boot-reveal .login-radar-container {
    opacity: 0.18;
}

#login-screen.boot-reveal .retro-terminal {
    opacity: 1;
}

#login-screen.boot-reveal .login-intel-ticker,
#login-screen.boot-reveal .login-featured-card,
#login-screen.boot-reveal .login-bulletin-list {
    opacity: 1;
}

/* ── Reduced motion: skip all animations ── */
@media (prefers-reduced-motion: reduce) {
    .login-boot-overlay {
        display: none !important;
    }
    #login-screen.boot-active .retro-terminal,
    #login-screen.boot-active .login-radar-container,
    #login-screen.boot-active .login-intel-ticker,
    #login-screen.boot-active .login-featured-card,
    #login-screen.boot-active .login-bulletin-list {
        opacity: 1 !important;
        transition: none !important;
    }
    #login-screen.boot-active .login-radar-container {
        opacity: 0.18 !important;
    }
}

/* ── Handshake Confirmation Line (ACCESS GRANTED) ── */
.boot-line.boot-handshake-confirm {
    color: #00FF88;
    font-size: 13px;
    font-weight: bold;
    letter-spacing: 2px;
    text-shadow: 0 0 8px rgba(0, 255, 136, 0.6);
    margin-top: 0.1em;
}

/* ── Post-boot Theater Status Toast ── */
.boot-post-status {
    position: absolute;
    top: 12px;
    left: 0;
    right: 0;
    text-align: center;
    font-family: 'Courier New', monospace;
    font-size: 11px;
    letter-spacing: 1px;
    color: #00FF88;
    opacity: 0;
    pointer-events: none;
    z-index: 50;
    text-shadow: 0 0 4px rgba(0, 255, 136, 0.3);
    transition: opacity 0.6s ease;
}

.boot-post-status.boot-post-status-visible {
    opacity: 0.35;
}

/* ═══════════════════════════════════════════════════════
   COMMAND OVERVIEW BRIEFING — Login Screen
   ═══════════════════════════════════════════════════════ */
/* ── Login terminal group (briefing + terminal wrapper) ── */
.login-terminal-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 2;
}

.login-briefing {
    width: 100%;
    max-width: 800px;
    padding: 10px 20px 6px;
    font-family: 'Courier New', monospace;
    color: #00FF88;
    text-align: center;
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
}

.login-briefing.briefing-visible {
    opacity: 0.8;
    pointer-events: auto;
}

.login-briefing-header {
    font-size: 14px;
    font-weight: bold;
    letter-spacing: 2px;
    text-shadow: 0 0 6px rgba(0, 255, 136, 0.5);
    margin-bottom: 4px;
    line-height: 1.6;
}

.login-briefing-line {
    font-size: 12px;
    line-height: 1.7;
    letter-spacing: 0.5px;
    text-shadow: 0 0 3px rgba(0, 255, 136, 0.25);
    white-space: pre-wrap;
    word-wrap: break-word;
}

.login-briefing-cta {
    font-size: 13px;
    font-weight: bold;
    letter-spacing: 2px;
    color: #FFD700;
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.4);
    margin-top: 6px;
    line-height: 1.8;
    transition: opacity 0.2s ease, text-shadow 0.2s ease, filter 0.2s ease;
}

.login-briefing-cta.briefing-cta-highlight {
    opacity: 1;
    text-shadow: 0 0 12px rgba(255, 215, 0, 0.7);
    filter: brightness(1.15);
}

.login-briefing-cta.briefing-cta-dimmed {
    opacity: 0.55;
    filter: brightness(0.9);
}

/* Hide briefing during boot */
#login-screen.boot-active .login-briefing {
    opacity: 0;
    transition: opacity 0.6s ease 0.2s;
}

/* Reveal during boot-reveal */
#login-screen.boot-reveal .login-briefing {
    opacity: 0.8;
}

@media (max-width: 600px) {
    .login-briefing {
        padding: 0 12px 6px;
    }
    .login-briefing-header {
        font-size: 12px;
    }
    .login-briefing-line {
        font-size: 11px;
        line-height: 1.6;
    }
    .login-briefing-cta {
        font-size: 11px;
    }
}

/* Reduced motion: show immediately */
@media (prefers-reduced-motion: reduce) {
    .login-briefing {
        transition: none !important;
    }
}
