:root {
    --bg-primary: #0a0000;
    --terminal-bg: rgba(15, 0, 0, 0.85);
    --accent: #ff2020;
    --accent-glow: rgba(255, 32, 32, 0.5);
    --danger: #ff4444;
    --text-main: #f0f0f0;
    --text-dim: #888;
    --border-color: rgba(255, 32, 32, 0.2);
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
    --font-display: 'Orbitron', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-main);
    font-family: var(--font-mono);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ===== CRT EFFECTS ===== */
body::before {
    content: " ";
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%),
        linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
    z-index: 9999;
    background-size: 100% 2px, 3px 100%;
    pointer-events: none;
    opacity: 0.3;
}

body::after {
    content: " ";
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: rgba(18, 16, 16, 0.1);
    opacity: 0;
    z-index: 9999;
    pointer-events: none;
    animation: flicker 0.15s infinite;
}

@keyframes flicker {
    0% {
        opacity: 0.27;
    }

    5% {
        opacity: 0.31;
    }

    10% {
        opacity: 0.29;
    }

    15% {
        opacity: 0.33;
    }

    20% {
        opacity: 0.28;
    }

    25% {
        opacity: 0.35;
    }

    30% {
        opacity: 0.32;
    }

    35% {
        opacity: 0.36;
    }

    40% {
        opacity: 0.34;
    }

    45% {
        opacity: 0.37;
    }

    50% {
        opacity: 0.35;
    }
}

/* ===== BOOT ANIMATION OVERLAY ===== */
#boot-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.8s ease, transform 0.8s ease;
}

#boot-overlay.hidden,
#login-screen.hidden {
    opacity: 0;
    transform: scale(1.1);
    pointer-events: none;
}

#boot-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: contrast(1.2) brightness(0.8);
}

#register-btn-wrapper {
    position: absolute;
    bottom: 15%;
    opacity: 0;
    transform: translateY(30px);
    transition: all 1s cubic-bezier(0.19, 1, 0.22, 1);
}

#register-btn-wrapper.visible {
    opacity: 1;
    transform: translateY(0);
}

.btn-register {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 900;
    letter-spacing: 6px;
    padding: 24px 64px;
    background: linear-gradient(135deg, #8b0000, #ff0000);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.3);
    cursor: pointer;
    text-transform: uppercase;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.5);
    box-shadow: 0 0 40px rgba(255, 0, 0, 0.4), inset 0 0 20px rgba(0, 0, 0, 0.4);
}

.btn-register:hover {
    transform: scale(1.05) translateY(-5px);
    box-shadow: 0 0 70px rgba(255, 0, 0, 0.7), inset 0 0 30px rgba(255, 255, 255, 0.2);
    letter-spacing: 8px;
}

.btn-register::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transform: translateX(-100%);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    100% {
        transform: translateX(100%);
    }
}

/* ===== IDENTITY VERIFICATION SCREEN ===== */
#login-screen {
    position: fixed;
    inset: 0;
    z-index: 900;
    background: radial-gradient(circle at center, #1a0000 0%, #050000 100%);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

#login-screen:not(.hidden) {
    display: flex;
}

.auth-terminal {
    width: 100%;
    max-width: 550px;
    background: var(--terminal-bg);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 32, 32, 0.4);
    box-shadow: 0 0 50px rgba(255, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.auth-body {
    padding: 60px 40px;
    text-align: center;
    position: relative;
}

.scanner-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: rgba(255, 0, 0, 0.8);
    box-shadow: 0 0 15px #ff0000, 0 0 30px #ff0000;
    z-index: 5;
    animation: scan 3s infinite linear;
}

@keyframes scan {
    0% {
        top: 0;
    }

    100% {
        top: 100%;
    }
}

.auth-prompt {
    margin-bottom: 40px;
}

.prompt-danger {
    display: block;
    font-family: var(--font-display);
    color: var(--danger);
    font-size: 1.2rem;
    font-weight: 900;
    margin-bottom: 20px;
    letter-spacing: 4px;
    animation: glitchText 2s infinite;
}

@keyframes glitchText {
    0% {
        transform: translate(0);
    }

    2% {
        transform: translate(-2px, 2px);
    }

    4% {
        transform: translate(2px, -2px);
    }

    6% {
        transform: translate(0);
    }
}

.auth-prompt p {
    color: var(--text-dim);
    font-size: 0.9rem;
    letter-spacing: 1px;
    text-transform: uppercase;
}

#btn-google-auth {
    display: inline-flex;
    align-items: center;
    gap: 20px;
    padding: 16px 40px;
    background: #fff;
    color: #1a1a1a;
    border: none;
    font-family: var(--font-display);
    font-weight: 900;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
}

#btn-google-auth:hover {
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.4);
}

#btn-google-auth .icon {
    font-size: 1.4rem;
    color: #4285F4;
    font-weight: bold;
}

/* ===== REGISTRATION FORM ===== */
#form-screen {
    display: none;
    min-height: 100vh;
    padding: 60px 20px;
    background: radial-gradient(circle at top, #150000 0%, #0a0000 100%);
}

#form-screen.active {
    display: block;
}

.terminal-window {
    max-width: 1000px;
    margin: 0 auto;
    background: var(--terminal-bg);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border-color);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

.terminal-titlebar {
    background: rgba(40, 0, 0, 0.9);
    padding: 12px 20px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}

.terminal-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 8px;
}

.terminal-dot.red {
    background: #ff5f56;
}

.terminal-dot.yellow {
    background: #ffbd2e;
}

.terminal-dot.green {
    background: #27c93f;
}

.terminal-title {
    margin-left: 15px;
    font-size: 0.75rem;
    color: var(--text-dim);
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.terminal-body {
    padding: 40px;
}

/* ASCII Header */
.ascii-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 50px;
    border-bottom: 1px solid rgba(255, 32, 32, 0.1);
    padding-bottom: 20px;
}

.ascii-art {
    font-family: var(--font-display);
    font-size: 3.5rem;
    font-weight: 900;
    line-height: 0.9;
    color: var(--accent);
    text-shadow: 0 0 20px var(--accent-glow);
}

.status-line {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.85rem;
    color: var(--accent);
}

.blink-dot {
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    animation: blink 1s infinite;
    box-shadow: 0 0 10px var(--accent);
}

@keyframes blink {
    50% {
        opacity: 0;
    }
}

/* Inputs */
.input-group {
    margin-bottom: 25px;
}

.input-field {
    width: 100%;
    background: rgba(20, 0, 0, 0.6);
    border: 1px solid rgba(255, 32, 32, 0.2);
    padding: 14px 18px;
    color: #fff;
    font-family: var(--font-mono);
    font-size: 0.95rem;
    transition: all 0.3s cubic-bezier(0.19, 1, 0.22, 1);
}

.input-field:focus {
    outline: none;
    border-color: var(--accent);
    background: rgba(40, 0, 0, 0.8);
    box-shadow: 0 0 20px rgba(255, 32, 32, 0.15);
}

.input-field::placeholder {
    color: rgba(255, 32, 32, 0.3);
}

.prompt-label {
    margin-bottom: 12px;
    font-size: 0.85rem;
}

.prompt-cmd {
    color: var(--accent);
    font-weight: bold;
}

.prompt-path {
    color: var(--text-dim);
    margin-right: 5px;
}

/* Grid Cards */
.members-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.member-card {
    background: rgba(30, 0, 0, 0.4);
    border: 1px solid rgba(255, 32, 32, 0.15);
    padding: 25px;
    position: relative;
    transition: all 0.3s ease;
}

.member-card:hover {
    background: rgba(50, 0, 0, 0.5);
    border-color: rgba(255, 32, 32, 0.4);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 32, 32, 0.1);
}

.card-title {
    font-family: var(--font-display);
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: 2px;
}

.card-title.leader {
    color: #fff;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

.btn-remove-member {
    background: transparent;
    border: none;
    color: var(--text-dim);
    font-size: 0.7rem;
    cursor: pointer;
    text-transform: uppercase;
    transition: color 0.2s;
}

.btn-remove-member:hover {
    color: var(--danger);
}

/* Buttons */
.add-member-wrapper {
    margin-bottom: 40px;
}

.btn-add-member {
    background: transparent;
    border: 1px dashed rgba(255, 32, 32, 0.4);
    color: var(--accent);
    padding: 15px;
    width: 100%;
    font-family: var(--font-display);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s;
    letter-spacing: 2px;
}

.btn-add-member:hover {
    background: rgba(255, 32, 32, 0.05);
    border-style: solid;
    border-color: var(--accent);
}

.btn-submit {
    width: 100%;
    padding: 20px;
    background: var(--accent);
    color: #fff;
    border: none;
    font-family: var(--font-display);
    font-weight: 900;
    font-size: 1.1rem;
    letter-spacing: 4px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 0 30px rgba(255, 0, 0, 0.3);
}

.btn-submit:hover:not(:disabled) {
    background: #ff0000;
    transform: translateY(-2px);
    box-shadow: 0 0 45px rgba(255, 0, 0, 0.5);
}

.btn-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    filter: grayscale(1);
}

/* Footer */
.status-footer {
    margin-top: 50px;
    padding-top: 25px;
    border-top: 1px solid rgba(255, 32, 32, 0.1);
}

.status-text {
    font-size: 0.85rem;
    color: var(--accent);
    margin-bottom: 15px;
}

.log-lines {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 0.75rem;
    color: var(--text-dim);
}

.log-lines span .num {
    color: var(--accent);
    margin-right: 5px;
}

/* Overlays */
#success-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(10, 0, 0, 0.98);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

#success-overlay.active {
    display: flex;
    animation: fadeIn 0.5s ease;
}

.success-icon {
    font-size: 5rem;
    color: #28cd41;
    margin-bottom: 30px;
}

.success-title {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 900;
    margin-bottom: 15px;
    letter-spacing: 4px;
}

.success-sub {
    color: var(--text-dim);
    margin-bottom: 40px;
    max-width: 400px;
}

.btn-new-team {
    padding: 15px 40px;
    background: transparent;
    border: 1px solid var(--accent);
    color: var(--accent);
    font-family: var(--font-display);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-new-team:hover {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 0 30px rgba(255, 0, 0, 0.4);
}

/* Responsive */
@media (max-width: 768px) {
    .terminal-body {
        padding: 25px;
    }

    .ascii-art {
        font-size: 2.5rem;
    }

    .members-section {
        grid-template-columns: 1fr;
    }

    .btn-register {
        padding: 20px 40px;
        font-size: 1rem;
    }
}