/**
 * Authentication Styles
 * Стили для универсальной аутентификации
 */

/* Блокировка скролла */
body.no-scroll {
    overflow: hidden;
    position: fixed;
    width: 100%;
}

/* Модальное окно входа */
.auth-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
    overflow-y: auto; /* Скролл для всей модалки */
    -webkit-overflow-scrolling: touch; /* Плавный скролл на iOS */
}

.auth-modal.visible {
    opacity: 1;
}

.auth-modal-content {
    background: white;
    border-radius: 24px;
    max-width: 480px;
    width: 100%;
    max-height: none; /* Убираем ограничение высоты */
    position: relative;
    animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    margin: auto; /* Центрирование */
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Заголовок */
.auth-modal-header {
    padding: 32px 24px 24px;
    text-align: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 24px 24px 0 0;
}

.auth-modal-header h2 {
    margin: 0 0 12px 0;
    font-size: 24px;
    font-weight: 700;
}

.auth-modal-header p {
    margin: 0;
    font-size: 14px;
    opacity: 0.9;
    line-height: 1.5;
}

/* Тело */
.auth-modal-body {
    padding: 24px;
}

/* Информация о входе */
.auth-info {
    margin-bottom: 24px;
}

.auth-info-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    font-size: 14px;
    color: #666;
}

.auth-info-icon {
    font-size: 20px;
    flex-shrink: 0;
}

/* Контейнер для виджета */
.telegram-login-container {
    display: flex;
    justify-content: center;
    padding: 24px 0;
    min-height: 80px;
}

/* Альтернативный вход */
.auth-alternative {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid #eee;
    text-align: center;
}

.auth-alternative p {
    margin: 0 0 16px 0;
    color: #999;
    font-size: 14px;
}

.auth-telegram-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    background: #0088cc;
    color: white;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.auth-telegram-button:hover {
    background: #006ba1;
    transform: translateY(-2px);
}

/* Индикатор загрузки */
.auth-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.auth-loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.auth-loading-text {
    color: #666;
    font-size: 14px;
}

/* Сообщение об ошибке */
.auth-error {
    background: #ffebee;
    border-left: 4px solid #f44336;
    padding: 16px;
    border-radius: 8px;
    margin-top: 16px;
}

.auth-error-title {
    color: #c62828;
    font-weight: 600;
    margin-bottom: 8px;
}

.auth-error-message {
    color: #666;
    font-size: 14px;
    line-height: 1.5;
}

/* Сообщение об успехе */
.auth-success {
    background: #e8f5e9;
    border-left: 4px solid #4caf50;
    padding: 16px;
    border-radius: 8px;
    margin-top: 16px;
    text-align: center;
}

.auth-success-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.auth-success-title {
    color: #2e7d32;
    font-weight: 600;
    margin-bottom: 8px;
}

.auth-success-message {
    color: #666;
    font-size: 14px;
}

/* Кнопка выхода в настройках */
.logout-button {
    width: 100%;
    padding: 14px;
    background: #f44336;
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 16px;
}

.logout-button:hover {
    background: #d32f2f;
    transform: translateY(-2px);
}

.logout-button:active {
    transform: translateY(0);
}

/* Индикатор режима */
.auth-mode-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 20px;
    font-size: 12px;
    color: #667eea;
    font-weight: 600;
}

.auth-mode-indicator.telegram {
    background: rgba(0, 136, 204, 0.1);
    color: #0088cc;
}

.auth-mode-indicator.pwa {
    background: rgba(76, 175, 80, 0.1);
    color: #4caf50;
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
    .auth-modal-content {
        background: #1e1e1e;
    }
    
    .auth-info-item {
        color: #bbb;
    }
    
    .auth-alternative {
        border-top-color: #333;
    }
    
    .auth-alternative p {
        color: #999;
    }
    
    .auth-loading-text {
        color: #bbb;
    }
    
    .auth-loading-spinner {
        border-color: #333;
        border-top-color: #667eea;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .auth-modal {
        padding: 0;
        align-items: flex-end;
    }
    
    .auth-modal-content {
        max-width: none;
        border-radius: 24px 24px 0 0;
        max-height: 95vh;
    }
    
    .auth-modal-header {
        border-radius: 24px 24px 0 0;
    }
}

/* Адаптация для Telegram режима */
.telegram-mode .auth-modal {
    /* В Telegram режиме используется стандартная регистрация */
    display: none !important;
}

