/* ===== CSS VARIABLES & RESET ===== */
:root {
    --neon-cyan: #00fff2;
    --neon-green: #39ff14;
    --neon-purple: #b537f2;
    --neon-red: #ff073a;
    --dark-bg: #0a0e1a;
    --darker-bg: #050810;
    --terminal-bg: rgba(10, 14, 26, 0.95);
    --input-bg: rgba(20, 25, 40, 0.8);
    --text-primary: #e0e0e0;
    --text-secondary: #a0a0a0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Courier New', monospace;
    background: var(--darker-bg);
    color: var(--text-primary);
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
}

/* ===== MATRIX BACKGROUND ===== */
.matrix-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    opacity: 0.3;
    background: var(--darker-bg);
}

/* ===== SCANLINE EFFECT ===== */
.scanline {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to bottom,
        transparent 50%,
        rgba(0, 255, 242, 0.02) 50%
    );
    background-size: 100% 4px;
    z-index: 999;
    pointer-events: none;
    animation: scanline 8s linear infinite;
}

@keyframes scanline {
    0% { transform: translateY(0); }
    100% { transform: translateY(4px); }
}

/* ===== AUTH CONTAINER ===== */
.auth-container {
    position: relative;
    z-index: 10;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

/* ===== TERMINAL WINDOW ===== */
.terminal-window {
    width: 100%;
    max-width: 550px;
    background: var(--terminal-bg);
    border: 2px solid var(--neon-cyan);
    border-radius: 8px;
    box-shadow: 
        0 0 20px rgba(0, 255, 242, 0.3),
        0 0 40px rgba(0, 255, 242, 0.1),
        inset 0 0 60px rgba(0, 255, 242, 0.05);
    animation: terminalGlow 3s ease-in-out infinite alternate;
}

.terminal-window.dashboard {
    max-width: 700px;
}

@keyframes terminalGlow {
    0% { box-shadow: 0 0 20px rgba(0, 255, 242, 0.3), 0 0 40px rgba(0, 255, 242, 0.1), inset 0 0 60px rgba(0, 255, 242, 0.05); }
    100% { box-shadow: 0 0 30px rgba(0, 255, 242, 0.4), 0 0 60px rgba(0, 255, 242, 0.15), inset 0 0 80px rgba(0, 255, 242, 0.08); }
}

/* ===== TERMINAL HEADER ===== */
.terminal-header {
    background: rgba(20, 25, 40, 0.9);
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    border-bottom: 1px solid var(--neon-cyan);
    border-radius: 6px 6px 0 0;
}

.terminal-buttons {
    display: flex;
    gap: 8px;
}

.terminal-buttons span {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: block;
}

.btn-close {
    background: var(--neon-red);
    box-shadow: 0 0 5px var(--neon-red);
}

.btn-minimize {
    background: #ffa500;
    box-shadow: 0 0 5px #ffa500;
}

.btn-maximize {
    background: var(--neon-green);
    box-shadow: 0 0 5px var(--neon-green);
}

.terminal-title {
    flex: 1;
    font-size: 13px;
    font-weight: bold;
    color: var(--neon-cyan);
    letter-spacing: 2px;
    text-shadow: 0 0 10px var(--neon-cyan);
}

/* ===== TERMINAL BODY ===== */
.terminal-body {
    padding: 30px;
}

/* ===== GLITCH TEXT ===== */
.glitch-text {
    font-size: 28px;
    font-weight: bold;
    text-align: center;
    color: var(--neon-cyan);
    text-shadow: 0 0 10px var(--neon-cyan);
    margin-bottom: 20px;
    position: relative;
    animation: glitch 3s infinite;
}

@keyframes glitch {
    0%, 90%, 100% {
        transform: translate(0);
    }
    92% {
        transform: translate(-2px, 2px);
    }
    94% {
        transform: translate(2px, -2px);
    }
    96% {
        transform: translate(-2px, -2px);
    }
    98% {
        transform: translate(2px, 2px);
    }
}

.glitch-text::before,
.glitch-text::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.8;
}

.glitch-text::before {
    color: var(--neon-purple);
    animation: glitchBefore 3s infinite;
    clip-path: polygon(0 0, 100% 0, 100% 45%, 0 45%);
}

.glitch-text::after {
    color: var(--neon-green);
    animation: glitchAfter 3s infinite;
    clip-path: polygon(0 55%, 100% 55%, 100% 100%, 0 100%);
}

@keyframes glitchBefore {
    0%, 90%, 100% { transform: translate(0); }
    92% { transform: translate(-3px, 0); }
}

@keyframes glitchAfter {
    0%, 90%, 100% { transform: translate(0); }
    92% { transform: translate(3px, 0); }
}

/* ===== TERMINAL PROMPT ===== */
.terminal-prompt {
    font-size: 14px;
    color: var(--neon-green);
    margin-bottom: 25px;
    font-family: 'Courier New', monospace;
}

.prompt-symbol {
    color: var(--neon-purple);
    margin-right: 5px;
    text-shadow: 0 0 5px var(--neon-purple);
}

.prompt-text {
    color: var(--neon-green);
    text-shadow: 0 0 5px var(--neon-green);
}

/* ===== FLASH MESSAGES ===== */
.flash-messages {
    margin-bottom: 20px;
}

.flash-message {
    padding: 12px 15px;
    border-radius: 4px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    border-left: 3px solid;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(-20px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.flash-error {
    background: rgba(255, 7, 58, 0.1);
    border-color: var(--neon-red);
    color: var(--neon-red);
}

.flash-success {
    background: rgba(57, 255, 20, 0.1);
    border-color: var(--neon-green);
    color: var(--neon-green);
}

.flash-info {
    background: rgba(0, 255, 242, 0.1);
    border-color: var(--neon-cyan);
    color: var(--neon-cyan);
}

.flash-icon {
    font-size: 16px;
    font-weight: bold;
}

/* ===== FORM STYLES ===== */
.auth-form {
    margin-bottom: 25px;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 12px;
    color: var(--neon-cyan);
    margin-bottom: 8px;
    letter-spacing: 1px;
    text-shadow: 0 0 5px var(--neon-cyan);
}

.label-symbol {
    color: var(--neon-purple);
    margin-right: 5px;
}

.form-input {
    width: 100%;
    padding: 12px 15px;
    background: var(--input-bg);
    border: 1px solid rgba(0, 255, 242, 0.3);
    border-radius: 4px;
    color: var(--text-primary);
    font-family: 'Courier New', monospace;
    font-size: 14px;
    transition: all 0.3s ease;
    outline: none;
}

.form-input:focus {
    border-color: var(--neon-cyan);
    box-shadow: 0 0 10px rgba(0, 255, 242, 0.3);
    background: rgba(20, 25, 40, 0.9);
}

.form-input::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

/* ===== CHECKBOX ===== */
.checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--neon-cyan);
}

.checkbox-label {
    font-size: 12px;
    color: var(--text-secondary);
    cursor: pointer;
    letter-spacing: 1px;
}

/* ===== PASSWORD STRENGTH ===== */
.password-strength {
    margin-top: 10px;
}

.strength-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 5px;
}

.strength-fill {
    height: 100%;
    width: 0%;
    transition: all 0.3s ease;
    border-radius: 3px;
}

.strength-text {
    font-size: 11px;
    color: var(--text-secondary);
    letter-spacing: 1px;
}

#strengthLevel {
    font-weight: bold;
}

/* ===== FIELD ERRORS ===== */
.field-errors {
    margin-top: 8px;
}

.error-text {
    display: block;
    font-size: 11px;
    color: var(--neon-red);
    margin-top: 4px;
}

/* ===== BUTTONS ===== */
.form-actions {
    margin-top: 25px;
}

.btn-primary {
    width: 100%;
    padding: 14px 20px;
    background: linear-gradient(135deg, var(--neon-cyan), var(--neon-purple));
    border: none;
    border-radius: 4px;
    color: #fff;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    font-weight: bold;
    letter-spacing: 2px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 0 15px rgba(0, 255, 242, 0.3);
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    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 ease;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 25px rgba(0, 255, 242, 0.5);
}

.btn-primary:active {
    transform: translateY(0);
}

/* ===== TERMINAL FOOTER ===== */
.terminal-footer {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid rgba(0, 255, 242, 0.2);
}

.footer-line {
    font-size: 12px;
    margin-bottom: 8px;
}

.footer-text {
    color: var(--text-secondary);
}

.footer-link {
    color: var(--neon-cyan);
    text-decoration: none;
    text-shadow: 0 0 5px var(--neon-cyan);
    transition: all 0.3s ease;
}

.footer-link:hover {
    color: var(--neon-purple);
    text-shadow: 0 0 8px var(--neon-purple);
}

.status-line {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--neon-green);
    box-shadow: 0 0 10px var(--neon-green);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.status-text {
    color: var(--neon-green);
    font-size: 11px;
    letter-spacing: 1px;
}

/* ===== DASHBOARD STYLES ===== */
.dashboard-content {
    margin-top: 25px;
}

.user-info {
    background: rgba(20, 25, 40, 0.6);
    border: 1px solid rgba(0, 255, 242, 0.2);
    border-radius: 4px;
    padding: 20px;
    margin-bottom: 25px;
}

.info-line {
    display: flex;
    margin-bottom: 12px;
    font-size: 13px;
}

.info-line:last-child {
    margin-bottom: 0;
}

.info-label {
    color: var(--neon-cyan);
    min-width: 150px;
    text-shadow: 0 0 5px var(--neon-cyan);
}

.info-value {
    color: var(--text-primary);
}

.dashboard-actions {
    margin-bottom: 30px;
}

.logout-btn {
    background: linear-gradient(135deg, var(--neon-red), var(--neon-purple));
}

.api-info {
    background: rgba(20, 25, 40, 0.6);
    border: 1px solid rgba(181, 55, 242, 0.3);
    border-radius: 4px;
    padding: 20px;
}

.section-title {
    font-size: 14px;
    color: var(--neon-purple);
    font-weight: bold;
    margin-bottom: 15px;
    letter-spacing: 2px;
    text-shadow: 0 0 5px var(--neon-purple);
}

.section-text {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 10px;
    line-height: 1.5;
}

.api-endpoint {
    display: block;
    background: rgba(0, 0, 0, 0.4);
    padding: 8px 12px;
    border-radius: 3px;
    color: var(--neon-green);
    font-family: 'Courier New', monospace;
    font-size: 13px;
    margin: 10px 0;
    border-left: 3px solid var(--neon-green);
}

.code-block {
    display: block;
    background: rgba(0, 0, 0, 0.5);
    padding: 15px;
    border-radius: 4px;
    color: var(--neon-cyan);
    font-family: 'Courier New', monospace;
    font-size: 12px;
    margin: 10px 0;
    border: 1px solid rgba(0, 255, 242, 0.2);
    overflow-x: auto;
    line-height: 1.6;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .terminal-window {
        max-width: 100%;
    }
    
    .terminal-body {
        padding: 20px;
    }
    
    .glitch-text {
        font-size: 22px;
    }
    
    .terminal-title {
        font-size: 11px;
    }
    
    .info-label {
        min-width: 120px;
    }
}

@media (max-width: 480px) {
    .auth-container {
        padding: 10px;
    }
    
    .terminal-body {
        padding: 15px;
    }
    
    .glitch-text {
        font-size: 20px;
    }
    
    .form-input {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .info-line {
        flex-direction: column;
        gap: 5px;
    }
}
