/* Глобальные переменные стилей */
:root {
    --primary: #0A7AFF;
    --primary-dark: #0066cc;
    --primary-light: rgba(10, 122, 255, 0.1);
    --secondary: #6A11CB;
    --accent: #9637FA;
    --accent-light: rgba(150, 55, 250, 0.2);
    --text: #EAE1DF;
    --text-muted: rgba(234, 225, 223, 0.7);
    --text-dark: #b8b0ae;
    --bg: #0C0C0C;
    --bg-dark: #080808;
    --panel: #191919;
    --panel-dark: #121212;
    --panel-light: rgba(25, 25, 25, 0.7);
    --success: #50B34E;
    --error: #E74C3C;
    --warning: #F39C12;
    --info: #3498DB;
    --border: rgba(10, 122, 255, 0.2);
    --border-light: rgba(234, 225, 223, 0.1);
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    --shadow-primary: 0 4px 12px rgba(106, 17, 203, 0.3);
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    --transition-fast: all 0.15s cubic-bezier(0.25, 0.8, 0.25, 1);
    --transition-slow: all 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
    --console-cursor: rgba(255, 255, 255, 0.75);
}

/* Базовые стили */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: 'Courier New', 'Minecraft', monospace;
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* Эффекты фона */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    pointer-events: none;
    overflow: hidden;
}

.particles.hidden {
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
}

.particles.visible {
    visibility: visible;
    opacity: 1;
}        

.particle {
    position: absolute;
    color: rgba(10, 122, 255, 0.5);
    font-size: 1rem;
    font-family: 'Courier New', monospace;
    user-select: none;
    animation: float 15s infinite linear;
}

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

.scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%),
        linear-gradient(90deg, rgba(255, 0, 0, 0.03), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.03));
    background-size: 100% 4px, 3px 100%;
    z-index: -1;
    pointer-events: none;
    animation: scanline 8s linear infinite;
    opacity: 0.7;
}

@keyframes scanline {
    0% { background-position: 0 0, 0 0; }
    100% { background-position: 0 100%, 0 0; }
}

/* --- Логотип страницы входа (уникальные классы) --- */
.login-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text);
    text-decoration: none;
    margin-bottom: 40px;
    text-shadow: 0 0 10px var(--primary);
    animation: loginLogoPulse 3s infinite alternate;
    position: fixed;
    top: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1001;
}
/* Header на странице входа */
header {
    background-color: transparent !important;  /* Делаем header прозрачным */
    border-bottom: none !important;  /* Убираем границу */
    backdrop-filter: none !important;  /* Убираем размытие */
}

/* Убираем стандартный логотип из header на странице входа */
header .logo {
    display: none !important;
}
@keyframes loginLogoPulse {
    0% {
        text-shadow: 0 0 10px var(--primary);
        opacity: 0.8;
    }
    100% {
        text-shadow: 0 0 20px var(--primary), 0 0 30px rgba(10, 122, 255, 0.5);
        opacity: 1;
    }
}

.login-logo-icon {
    width: 40px;
    height: 40px;
    filter: drop-shadow(0 0 5px var(--primary));
}

/* Консоль подключения */
.connecting-console {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.5rem;
    text-align: center;
    width: 100%;
    max-width: 800px;
    padding: 20px;
    opacity: 1;
    transition: opacity 0.5s ease;
}

.connecting-console.hidden {
    opacity: 0;
    pointer-events: none;
}

.console-text {
    border-right: 2px solid var(--console-cursor);
    white-space: nowrap;
    overflow: hidden;
    display: inline-block;
    animation: typing 3.5s steps(40, end), blink-caret 0.75s step-end infinite;
}

@keyframes typing {
    from { width: 0 }
    to { width: 100% }
}

@keyframes blink-caret {
    from, to { border-color: transparent }
    50% { border-color: var(--console-cursor) }
}

.console-dot {
    display: inline-block;
    margin-left: 4px;
    animation: blink-dot 1s infinite;
}            

@keyframes blink-bar {
    0%, 100% { opacity: 0.2; }
    50% { opacity: 1; }
}   

.blinking-dot {
    animation: blink-dot 1s steps(1) infinite;
    display: inline-block;
}

@keyframes blink-dot {
    0%, 100% { opacity: 0.1; }
    50% { opacity: 1; }
}        

/* Форма входа */
.login-form {
    background-color: var(--panel-light);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 40px;
    width: 100%;
    max-width: 450px;
    box-shadow: var(--shadow-primary);
    position: relative;
    overflow: hidden;
    opacity: 0;
    transform: scale(0.98);
    transition: all 0.3s ease-in-out;
    margin-top: 20px;
}

.login-form.active {
    opacity: 1;
    transform: scale(1);
}

.login-form::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 2px solid transparent;
    border-image: linear-gradient(135deg, var(--primary), var(--secondary)) 1;
    animation: borderGlow 3s infinite alternate;
    pointer-events: none;
    z-index: -1;
}

@keyframes borderGlow {
    0% { opacity: 0.5; box-shadow: 0 0 10px rgba(10, 122, 255, 0.3); }
    100% { opacity: 1; box-shadow: 0 0 20px rgba(10, 122, 255, 0.7); }
}

.login-title {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 30px;
    text-align: center;
    position: relative;
}

.login-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 3px;
}

/* Поля ввода */
.input-group {
    margin-bottom: 25px;
    position: relative;
}

.input-label {
    display: block;
    font-size: 0.9rem;
    color: var(--primary);
    margin-bottom: 10px;
    font-weight: 600;
    letter-spacing: 1px;
    transition: var(--transition);
    transform: translateY(0);
}

.input-field {
    width: 100%;
    padding: 15px 20px 15px 40px;
    background-color: var(--panel-dark);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-size: 1rem;
    font-family: 'Courier New', monospace;
    transition: var(--transition);
    position: relative;
}

.input-field::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
    font-style: italic;
}

.input-field:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.input-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary);
    font-size: 1rem;
    transition: var(--transition);
}

.input-field:focus ~ .input-icon {
    color: var(--accent);
    transform: translateY(-50%) scale(1.2);
}

/* Кнопка входа */
.login-button {
    width: 100%;
    padding: 15px;
    border-radius: 6px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-primary);
    font-size: 1rem;
    margin-top: 10px;
    position: relative;
    overflow: hidden;
    font-family: 'Courier New', monospace;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.login-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: var(--transition-slow);
}

.login-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(106, 17, 203, 0.5);
}

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

.login-button:active {
    transform: translateY(1px);
    transition: var(--transition-fast);
}

.login-button.error {
    background: var(--error);
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-8px); }
    40%, 80% { transform: translateX(8px); }
}

.login-button.success {
    background: var(--success);
    box-shadow: 0 0 20px rgba(80, 179, 78, 0.5);
}

/* Дополнительные ссылки */
.login-links {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
    font-size: 0.85rem;
}

.login-link {
    color: var(--text-muted);
    text-decoration: none;
    transition: var(--transition);
    position: relative;
}

.login-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background-color: var(--primary);
    transition: var(--transition);
}

.login-link:hover {
    color: var(--primary);
}

.login-link:hover::after {
    width: 100%;
}

/* Сообщения об ошибке */
.error-message {
    color: var(--error);
    font-size: 0.8rem;
    margin-top: 5px;
    opacity: 0;
    height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
}

.error-message.active {
    opacity: 1;
    height: auto;
    margin-top: 10px;
}

/* Успешный вход */
.success-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background-color: var(--panel);
    padding: 30px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 0 40px rgba(10, 122, 255, 0.3);
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: all 0.5s ease, transform 0.5s ease;
    max-width: 90%;
    backdrop-filter: blur(8px);
    border: 1px solid var(--border);
}

.success-message.active {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    box-shadow: 0 0 50px rgba(10, 122, 255, 0.6), 0 0 80px rgba(10, 122, 255, 0.3);
    animation: successPulse 2s infinite alternate;
    animation: fadeInScale 0.6s ease forwards, successPulse 2s infinite alternate;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}        

@keyframes successPulse {
    0% { box-shadow: 0 0 30px rgba(10, 122, 255, 0.5); }
    100% { box-shadow: 0 0 50px rgba(10, 122, 255, 0.8); }
}

.success-icon {
    font-size: 3rem;
    color: var(--success);
    margin-bottom: 20px;
    animation: iconBounce 0.6s ease;
}

@keyframes iconBounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.3); }
}

.success-text {
    font-size: 1.5rem;
    margin-bottom: 20px;
}

.username {
    color: var(--primary);
    font-weight: bold;
}

/* Консоль ввода данных */
.data-console {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: rgba(8, 8, 8, 0.9);
    padding: 20px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    color: var(--text);
    border-top: 1px solid var(--border);
    transform: translateY(100%);
    transition: transform 0.5s ease;
    z-index: 10;
    max-height: 40vh;
    overflow-y: auto;
}

.data-console.active {
    transform: translateY(0);
}

.console-line {
    margin-bottom: 5px;
    opacity: 0;
    animation: consoleLineFadeIn 0.5s forwards;
}

.console-line.typing {
    display: inline-block;
    border-right: 2px solid var(--console-cursor);
    white-space: nowrap;
    overflow: hidden;
    animation: typing 1.5s steps(40, end), blink-caret 0.75s step-end infinite;
}

.console-line.fade-out {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}        

@keyframes consoleLineFadeIn {
    to { opacity: 1; }
}

.console-prompt {
    color: var(--primary);
    margin-right: 10px;
}

/* Блок подтверждения кода */
#confirmationBlock {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: var(--panel-light);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 40px;
    width: 100%;
    max-width: 450px;
    box-shadow: var(--shadow-primary);
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease-in-out;
}

#confirmationBlock.active {
    opacity: 1;
    pointer-events: auto;
}

#confirmationBlock.hidden {
    opacity: 0;
    pointer-events: none;
}

#confirmationBlock::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 2px solid transparent;
    border-image: linear-gradient(135deg, var(--primary), var(--secondary)) 1;
    animation: borderGlow 3s infinite alternate;
    pointer-events: none;
    z-index: -1;
}

#confirmationBlock .input-hint {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
    color: var(--primary);
    margin-bottom: 25px;
    text-align: center;
    justify-content: center;
}

#confirmationBlock .input-hint i {
    font-size: 1.3rem;
    color: var(--accent);
}

#confirmationCode {
    letter-spacing: 6px;
    text-align: center;
    font-size: 1.3rem;
    font-family: 'Courier New', monospace;
    padding: 15px 20px;
}

#confirmationCodeError {
    color: var(--error);
    font-size: 0.8rem;
    margin-top: 5px;
    text-align: center;
}

/* Адаптивность */
@media (max-width: 768px) {
    .login-logo {
        font-size: 1.8rem;
        top: 20px;
    }
    
    .login-logo-icon {
        width: 30px;
        height: 30px;
    }
    
    .login-form {
        padding: 30px 20px;
        max-width: 90%;
    }
    
    .login-title {
        font-size: 1.5rem;
    }
    
    .success-message {
        padding: 20px;
        font-size: 0.9rem;
    }
    
    .success-icon {
        font-size: 2rem;
    }
    
    .success-text {
        font-size: 1.2rem;
    }
    
    #confirmationBlock {
        padding: 30px 20px;
        max-width: 90%;
    }
}

@media (max-width: 480px) {
    .login-logo {
        font-size: 1.5rem;
        top: 15px;
    }
    
    .login-links {
        flex-direction: column;
        gap: 10px;
        align-items: center;
    }
    
    .input-field {
        padding: 12px 15px 12px 35px;
    }
    
    .input-icon {
        left: 12px;
        font-size: 0.9rem;
    }
    
    #confirmationCode {
        font-size: 1.1rem;
        letter-spacing: 4px;
    }
}