/* ========================================================================= */
/* ===         LOGIN_PAGE.CSS - ВСЕ СТИЛИ ДЛЯ СТРАНИЦЫ ВХОДА (FIXED)     === */
/* ========================================================================= */

#login-page-wrapper,
.main-container {
    display: none;
}


/* Когда пользователь НЕ вошел (класс на body) */
body.not-logged-in {
    overflow: hidden; /* Запрещаем прокрутку всей страницы */
}
body.not-logged-in #login-page-wrapper {
    display: flex; /* Показываем страницу входа */
}

body.is-logged-in .main-container {
    display: flex; /* Показываем основное приложение */
}

body.is-logged-in #login-page-wrapper {
    display: none;
}
/* Конец исправленной логики */


#login-page-wrapper {
    justify-content: center;
    align-items: center;
    gap: 4rem; /* Расстояние между колонками */
    width: 100%;
    height: 100vh;
    padding: 2rem;
    position: fixed; /* Чтобы быть поверх фона с частицами */
    top: 0;
    left: 0;
    z-index: 10;
}

/* --- СТИЛИ ДЛЯ ЛЕВОЙ ПРОМО-КОЛОНКИ --- */
.login-promo-panel {
    max-width: 800px; /* Ограничиваем ширину */
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
    max-height: calc(100vh - 4rem); /* Высота минус отступы */
    overflow-y: auto;
    padding: 1rem;
}
/* Стилизация скроллбара для левой колонки */
.login-promo-panel::-webkit-scrollbar { width: 8px; }
.login-promo-panel::-webkit-scrollbar-track { background: transparent; }
.login-promo-panel::-webkit-scrollbar-thumb { background-color: var(--border-color); border-radius: 4px; }
.login-promo-panel::-webkit-scrollbar-thumb:hover { background-color: var(--accent-color); }

/* --- СТИЛИ ДЛЯ ПРАВОЙ КОЛОНКИ С ФОРМОЙ --- */
.login-form-panel {
    flex: 0 0 400px;
    width: 400px;
    height: auto;
    max-height: 90vh;
    padding: 2.5rem;
    background-color: rgba(26, 26, 26, 0.2);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.3);
}

/* --- СТИЛИ КОНТЕНТА ВНУТРИ ПРОМО-КОЛОНКИ --- */
.promo-features-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 1.5rem; }
.promo-features-list li { display: flex; align-items: flex-start; gap: 1.5rem; }
.promo-features-list .feature-icon {
    flex-shrink: 0; width: 48px; height: 48px; display: flex; align-items: center;
    justify-content: center; font-size: 1.75rem; border-radius: 50%;
    background-color: rgba(255, 153, 0, 0.1); border: 1px solid rgba(255, 153, 0, 0.2);
}
.promo-features-list p { font-size: 0.9rem; color: var(--text-secondary); margin: 0; }
.promo-info-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.promo-gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.promo-gallery img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 0.5rem; opacity: 0.7; transition: opacity 0.3s ease, transform 0.3s ease; }
.promo-gallery img:hover { opacity: 1; transform: scale(1.05); }

/* --- ИСПОЛЬЗОВАНИЕ ФИРМЕННОГО ШРИФТА BOWLER --- */
.login-promo-panel h2 { font-family: 'Bowler', sans-serif; font-size: 2.5rem; color: var(--text-primary); }
.promo-features-list h5 { font-family: 'Bowler', sans-serif; font-size: 1.2rem; color: var(--text-primary); margin-bottom: 0.25rem; }
.promo-telegram-block h4, .promo-warning-block h5 { font-family: 'Bowler', sans-serif; font-size: 1.2rem; color: var(--text-primary); margin-bottom: 0.5rem; }
.login-form-panel .logo-container { margin-bottom: 2rem; text-align: center; }
.login-form-panel .logo-text-main { font-family: 'Bowler', sans-serif; font-size: 2.2rem; letter-spacing: 2px; margin: 0; color: var(--accent-color); }
.login-form-panel .logo-text-sub { font-family: 'Bowler', sans-serif; font-size: 0.9rem; letter-spacing: 4px; text-transform: uppercase; margin: 0; color: var(--text-secondary); }

/* --- СТИЛИ ДЛЯ РАЗДЕЛИТЕЛЯ "ИЛИ" --- */
.auth-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin: 1.5rem 0;
    color: var(--text-secondary); /* Цвет текста */
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background-color: var(--border-color); /* Цвет линии */
    opacity: 0.3;
}

.auth-divider::before { margin-right: 1rem; }
.auth-divider::after { margin-left: 1rem; }

/* Убираем старый спан с фоном, если он был */
.auth-divider span {
    background: transparent !important; 
    padding: 0;
}

/* --- НОВЫЙ БЛОК ИНФО О СИНХРОНИЗАЦИИ (ПОД КНОПКОЙ) --- */
.sync-info-small {
    margin-top: 1rem;
    padding: 0.75rem;
    background: rgba(0, 136, 204, 0.08); /* Легкий синий фон */
    border: 1px solid rgba(0, 136, 204, 0.2);
    border-radius: 8px;
    font-size: 0.8rem;
    color: #aedff7;
    text-align: center;
    line-height: 1.4;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.sync-info-small i, 
.sync-info-small .icon {
    font-size: 1rem;
}

/* --- КНОПКА ПЕРЕХОДА В ГРУППУ (ВНИЗУ) --- */
.community-link-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 10px;
    margin-top: 1.5rem;
    background: transparent;
    border: 1px dashed var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

.community-link-btn:hover {
    border-color: #0088cc;
    color: #fff;
    background: rgba(0, 136, 204, 0.05);
    transform: translateY(-2px);
}

/* ============================================== */
/* ===    Блок синхронизации (ИСПРАВЛЕННЫЙ)   === */
/* ============================================== */

.sync-card {
    /* Размеры и фон */
    width: 100%;
    min-height: 110px; /* Даем блоку высоту, чтобы текст не резало */
    background: linear-gradient(135deg, rgba(30, 30, 30, 0.9) 0%, rgba(20, 20, 20, 0.7) 100%);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    
    /* СИНЯЯ ПОЛОСКА СЛЕВА (Теперь через тень - будет идеально ровной) */
    box-shadow: inset 6px 0 0 0 #0088cc, 0 10px 30px rgba(0,0,0,0.3);
    
    /* Отступы */
    padding: 1.5rem 2rem; /* Больше воздуха внутри */
    margin-top: 2rem;
    
    /* Выравнивание - Самое важное */
    display: flex;
    align-items: center; /* Строго по центру вертикально */
    justify-content: space-between; /* Разносим по краям */
    gap: 20px; /* Расстояние между кружками и текстом */
    
    position: relative;
    overflow: hidden;
    box-sizing: border-box; /* Чтобы padding не ломал ширину */
}

/* --- ЛЕВАЯ ЧАСТЬ (КРУЖКИ) --- */
.sync-visual {
    display: flex;
    align-items: center;
    flex-shrink: 0; /* Запрещаем сжиматься */
}

.sync-circle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Bowler', sans-serif;
    font-size: 0.9rem;
    z-index: 2;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

.sync-circle.tg {
    background: linear-gradient(145deg, #0088cc, #006699);
    color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.sync-circle.web {
    background: #222;
    color: #888;
    border: 2px solid #333;
}

/* Линия */
.sync-line-wrap {
    width: 30px;
    height: 4px;
    background: #333;
    margin: 0 -2px;
    position: relative;
    z-index: 1;
    overflow: hidden;
}

.sync-packet {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, #fff, transparent);
    transform: translateX(-100%);
    animation: syncPass 2s infinite ease-in-out;
}
@keyframes syncPass {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* --- ПРАВАЯ ЧАСТЬ (ТЕКСТ) --- */
.sync-text {
    text-align: right; /* Прижимаем вправо */
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex: 1; /* Занимает всё доступное место */
}

.sync-text h3 {
    margin: 0 0 6px 0; /* Отступ снизу */
    color: #fff;
    font-size: 1.5rem; /* Крупный заголовок */
    line-height: 1; /* Чтобы не резало верхушку */
    font-family: 'Bowler', sans-serif;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.sync-text p {
    margin: 0;
    font-size: 0.85rem;
    line-height: 1.3;
    color: #aaa;
}

/* Цвет слова "алмазы" */
.sync-text p strong {
    color: #00aaff;
}

/* --- Кнопка "Войти через Telegram" на главной --- */
.btn-telegram-login {
    background: linear-gradient(135deg, #2AABEE 0%, #229ED9 100%);
    color: white;
    font-family: 'Manrope', sans-serif;
    font-weight: 600;
    border: none;
    padding: 12px;
    border-radius: 12px; /* Скругление как у карточек */
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}
.btn-telegram-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(34, 158, 217, 0.4);
    color: white;
}

/* --- ОВЕРЛЕЙ МОДАЛЬНОГО ОКНА --- */
.tg-modal-overlay {
    display: none; /* Скрыто по умолчанию */
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(15, 23, 42, 0.85); /* Темный фон в стиле сайта */
    backdrop-filter: blur(8px); /* Размытие фона */
    z-index: 9999;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

/* --- КОНТЕНТ ОКНА --- */
.tg-modal-content {
    background: var(--background-secondary); /* Ваш цвет фона */
    border: 1px solid var(--border-color);   /* Ваша обводка */
    padding: 2.5rem;
    border-radius: 24px; /* Сильное скругление */
    width: 90%;
    max-width: 420px;
    text-align: center;
    position: relative;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    color: var(--text-primary);
    font-family: 'Manrope', sans-serif;
    
    /* Центровка всего содержимого внутри флексом */
    display: flex;
    flex-direction: column;
    align-items: center; 
}

/* --- ЗАГОЛОВОК И ОПИСАНИЕ --- */
.tg-modal-title {
    font-family: 'Manrope', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #fff;
}
.tg-modal-desc {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

/* --- КРЕСТИК ЗАКРЫТИЯ --- */
.tg-modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 28px;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}
.tg-modal-close:hover { color: #fff; }

/* --- ОБЕРТКА QR КОДА (Белая плашка) --- */
.tg-qr-wrapper {
    background: #fff;
    padding: 10px; /* Отступ внутри белой рамки */
    border-radius: 16px;
    margin-bottom: 1.5rem;
    
    /* Фиксируем размер и центруем */
    width: 220px;
    height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    
    /* Тень для объема */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* Сам QR */
#tg-qr-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* Спиннер загрузки (делаем темным, т.к. фон белый) */
#tg-qr-loader { color: #333 !important; }

/* --- ТАЙМЕР --- */
.tg-timer {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    font-weight: 500;
}
#tg-timer-count {
    color: var(--accent-color); /* Голубой цвет для цифр */
    font-weight: 700;
    margin-left: 5px;
}

/* КНОПКИ ДЕЙСТВИЙ --- */
.tg-actions {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Кнопка "Открыть Telegram" - Яркая, как активная "2K" */
.btn-tg-primary {
    background-color: var(--accent-color); /* #38BDF8 */
    color: #0F172A; /* Темный цвет текста (как на скрине), чтобы не сливался */
    font-family: 'Manrope', sans-serif;
    font-weight: 700;
    border-radius: 10px; /* Скругление как у кнопок настроек */
    padding: 14px;
    border: none;
    text-decoration: none;
    transition: all 0.2s ease;
    
    /* Добавляем фирменное свечение */
    box-shadow: 0 0 15px var(--accent-glow); 
}

.btn-tg-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 25px var(--accent-glow); /* Усиление свечения */
    background-color: #38BDF8; /* Цвет тот же, эффект за счет свечения */
    color: #0F172A;
}

/* Кнопка "Открыть Web" - Контурная, как неактивные кнопки, но с цветной обводкой */
.btn-tg-outline {
    background: transparent;
    border: 1px solid var(--border-color); /* Тонкая серая рамка */
    color: var(--text-secondary); /* Серый текст */
    font-family: 'Manrope', sans-serif;
    font-weight: 600;
    border-radius: 10px;
    padding: 14px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn-tg-outline:hover {
    border-color: var(--accent-color); /* При наведении рамка синеет */
    color: var(--accent-color);        /* Текст синеет */
    background: rgba(56, 189, 248, 0.05);
}

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

/* Кнопка Email на главной - Стиль "контурная" (как была Web Telegram), но поярче */
.btn-email-login {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-family: 'Manrope', sans-serif;
    font-weight: 600;
    border-radius: 12px;
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.btn-email-login:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
    background: rgba(56, 189, 248, 0.05);
    transform: translateY(-2px);
}

/* Инпуты внутри модального окна */
.modal-input {
    background-color: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #fff !important;
    border-radius: 10px !important;
    padding: 12px !important;
    font-size: 0.95rem !important;
}

.modal-input:focus {
    background-color: rgba(255, 255, 255, 0.1) !important;
    border-color: var(--accent-color) !important;
    box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.1) !important;
    color: #fff !important;
}

.modal-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}
/* ========================================================================= */
/* ===         АДАПТИВНЫЕ СТИЛИ ДЛЯ МОБИЛЬНЫХ УСТРОЙСТВ                  === */
/* ========================================================================= */
@media (max-width: 1200px) {
    .login-promo-panel { display: none; } /* Скрываем промо-панель на планшетах */
}

@media (max-width: 768px) {
    body.not-logged-in { overflow-y: auto; }
    #login-page-wrapper {
        flex-direction: column;
        justify-content: flex-start;
        height: auto;
        min-height: 100vh;
        padding: 2rem 1rem;
        gap: 2.5rem;
        position: relative; /* Меняем на relative для нормальной прокрутки */
    }
    .login-promo-panel {
        display: flex; /* Возвращаем промо-панель на мобильных */
        max-height: none;
        overflow-y: visible;
        padding: 0;
        order: 2; /* Ставим ее ПОСЛЕ формы входа */
        max-width: 100%;
    }
    .login-form-panel {
        flex: 0 0 auto;
        width: 100%;
        max-width: 450px;
        max-height: none;
        padding: 1.5rem;
        order: 1; /* Ставим ее ПЕРЕД промо-панелью */
    }
    .promo-info-grid { grid-template-columns: 1fr; }
    .promo-gallery { grid-template-columns: repeat(2, 1fr); }
    .login-promo-panel h2 { font-size: 2rem; text-align: center; }
    .login-form-panel .logo-text-main { font-size: 1.8rem; }
    .promo-features-list li { gap: 1rem; }
}

@media (max-width: 480px) {
    #login-page-wrapper { padding: 1.5rem 1rem; gap: 2rem; }
    .promo-gallery { grid-template-columns: 1fr; }
    .promo-features-list { gap: 1.25rem; }
}