/* Страницы входа и регистрации */
/* ============================================ */
/* === ПРИНУДИТЕЛЬНАЯ СВЕТЛАЯ ТЕМА === */
/* ============================================ */
:root {
    color-scheme: light only !important;
}

html {
    color-scheme: light only !important;
}

/* Страницы входа и регистрации - всегда светлые */
body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 0 !important;
}

.login-card,
.register-card,
.verify-card {
    background: #ffffff !important;
    color: #212529 !important;
}

/* Переопределение тёмной темы */
@media (prefers-color-scheme: dark) {
    body {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    }
    
    .login-card,
    .register-card,
    .verify-card {
        background: #ffffff !important;
        color: #212529 !important;
    }
    
    .form-control,
    .form-select {
        background-color: #ffffff !important;
        color: #212529 !important;
        border-color: #ced4da !important;
    }
    
    .alert {
        background-color: #f8f9fa !important;
        color: #212529 !important;
    }
}

/* ============================================ */
/* Страницы входа и регистрации */
/* ============================================ */
body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 0 !important;
}

.login-card,
.register-card,
.verify-card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    padding: 40px;
    width: 100%;
    max-width: 450px;
    position: relative; /* Для абсолютного позиционирования крестика */
}

.login-card h2,
.register-card h2,
.verify-card h2 {
    color: #667eea;
}

.success-icon {
    font-size: 60px;
    text-align: center;
    margin-bottom: 20px;
}

.form-text {
    font-size: 0.85em;
    color: #6c757d;
}

/* ✅ БЛОК СЧЁТЧИКА ПОЛЬЗОВАТЕЛЕЙ - С ОТСТУПОМ */
.user-count-block {
    text-align: center;
    margin-bottom: 20px !important; /* Отступ до логотипа */
    padding-bottom: 10px;
    border-bottom: 1px solid #e0e0e0;
}

.user-count-block .text-muted.small {
    font-size: 0.85rem;
    opacity: 0.9;
    font-weight: 500;
}

/* Счётчик пользователей на странице входа */
.login-card .text-muted.small {
    font-size: 0.8rem;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.login-card .text-muted.small:hover {
    opacity: 1;
}

/* ============================================ */
/* === МОДАЛЬНОЕ ОКНО ДЛЯ ПРАВОВЫХ ДОКУМЕНТОВ === */
/* ============================================ */
.legal-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    padding: 20px;
    overflow-y: auto;
}

.legal-modal.show {
    display: flex;
}

.legal-modal-content {
    background: white;
    border-radius: 15px;
    max-width: 800px;
    width: 100%;
    max-height: 85vh;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
    margin: auto;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.legal-modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 32px;
    font-weight: bold;
    color: #999;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 10;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.legal-modal-close:hover {
    color: #333;
    background: rgba(0, 0, 0, 0.1);
}

.legal-modal-body {
    padding: 40px;
    overflow-y: auto;
    max-height: 85vh;
}

.legal-modal-header h2 {
    color: #667eea;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 3px solid #667eea;
    font-size: 1.8rem;
}

.legal-modal-text {
    line-height: 1.8;
    color: #333;
    font-size: 1rem;
}

.legal-modal-text h3 {
    color: #667eea;
    margin-top: 30px;
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.legal-modal-text p {
    margin-bottom: 15px;
}

.legal-modal-text ul {
    margin-bottom: 15px;
    padding-left: 25px;
}

.legal-modal-text li {
    margin-bottom: 8px;
}

/* ============================================ */
/* === ССЫЛКИ НА ПРАВОВЫЕ ДОКУМЕНТЫ - В ДВЕ СТРОКИ === */
/* ============================================ */
.legal-links {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}

.legal-link {
    color: #667eea;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
    padding: 5px 10px;
}

.legal-link:hover {
    color: #5568d3;
    text-decoration: underline;
}

/* Разделитель (если нужен) */
.legal-link-separator {
    display: none;
}

/* Адаптивность для мобильных */
@media (max-width: 768px) {
    .legal-modal-content {
        max-width: 95%;
        max-height: 90vh;
    }
    
    .legal-modal-body {
        padding: 25px;
    }
    
    .legal-modal-header h2 {
        font-size: 1.4rem;
    }
    
    .legal-modal-text {
        font-size: 0.9rem;
    }
    
    .legal-modal-text h3 {
        font-size: 1.1rem;
    }
}

/* Адаптивность для очень маленьких экранов */
@media (max-width: 400px) {
    .legal-modal-body {
        padding: 20px;
    }
    
    .legal-modal-header h2 {
        font-size: 1.2rem;
    }
    
    .legal-modal-text {
        font-size: 0.85rem;
    }
}

/* ============================================ */
/* === ЛОГОТИП - АДАПТИВНОСТЬ === */
/* ============================================ */
/* Логотип на страницах входа/регистрации/верификации */
.login-logo,
.register-logo,
.verify-logo {
    max-width: 200px;
    height: auto;
    margin-bottom: 20px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

/* Для планшетов */
@media (max-width: 768px) {
    .login-logo,
    .register-logo,
    .verify-logo {
        max-width: 150px;
    }
}

/* Для смартфонов */
@media (max-width: 576px) {
    .login-logo,
    .register-logo,
    .verify-logo {
        max-width: 120px;
    }
    
    .login-card,
    .register-card,
    .verify-card {
        padding: 20px;
    }
}

/* Для очень маленьких экранов */
@media (max-width: 400px) {
    .login-logo,
    .register-logo,
    .verify-logo {
        max-width: 100px;
    }
}

/* Чекбокс принятия условий */
.form-check-label .legal-link {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
}

.form-check-label .legal-link:hover {
    text-decoration: underline;
    color: #5568d3;
}

/* Адаптивность для чекбокса на мобильных */
@media (max-width: 576px) {
    .form-check-label {
        font-size: 0.85rem !important;
        line-height: 1.4;
    }
    
    .form-check-input {
        margin-top: 0.2rem !important;
    }
}

/* ============================================ */
/* === КНОПКА ЗАКРЫТЬ (КРЕСТИК) === */
/* ============================================ */
.close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 32px;
    font-weight: bold;
    color: #999;
    text-decoration: none;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
    line-height: 1;
    z-index: 10;
}

.close-btn:hover {
    color: #333;
    background: rgba(0, 0, 0, 0.1);
    transform: rotate(90deg);
}

.close-btn span {
    display: block;
    margin-top: -3px;
}

/* Адаптивность для мобильных */
@media (max-width: 576px) {
    .close-btn {
        top: 10px;
        right: 15px;
        font-size: 28px;
        width: 35px;
        height: 35px;
    }
}

/* Убедимся, что карточка имеет relative позиционирование */
.login-card,
.register-card,
.verify-card {
    position: relative;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    padding: 40px;
    width: 100%;
    max-width: 450px;
}