/* ============================================
   СТРАНИЦА АВТОРИЗАЦИИ
   ============================================ */

/* БАЗОВЫЕ СТИЛИ (общие для всех устройств) */
:root {
    --primary-color: #667eea;
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --dark-bg: #0a0a0f;
    --card-bg: rgba(255, 255, 255, 0.05);
    --border-color: rgba(255, 255, 255, 0.1);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --shadow-lg: 0 20px 40px -12px rgba(0, 0, 0, 0.5);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--dark-bg);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    padding: 2rem 1rem;
}

/* Современный анимированный фон */
.bg-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    background: 
        radial-gradient(ellipse at top left, rgba(102, 126, 234, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at top right, rgba(118, 75, 162, 0.15) 0%, transparent 50%),
        var(--dark-bg);
}

.bg-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.03;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.1) 1px, transparent 1px);
    background-size: 50px 50px;
}

/* Карточка авторизации (Glassmorphism) */
.auth-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 3rem 2.5rem 2rem;
    max-width: 440px;
    width: 90%;
    backdrop-filter: blur(24px) saturate(180%);
    box-shadow: var(--shadow-lg);
    text-align: center;
    animation: fadeIn 0.8s ease-out;
    margin: auto;
    padding-bottom: 2rem;
}

@keyframes fadeIn {
    from { 
        opacity: 0; 
        transform: translateY(20px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

.auth-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.logo-link {
    font-size: 1.8rem;
    font-weight: 800;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: opacity 0.3s ease;
}

.logo-link:hover {
    opacity: 0.8;
}

.auth-nav-links {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
}

.nav-link {
    color: #00d4aa;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    border: 1px solid rgba(0, 212, 170, 0.3);
    background: rgba(0, 212, 170, 0.08);
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-link:hover {
    color: #ffffff;
    background: linear-gradient(135deg, #00d4aa 0%, #00b894 100%);
    border-color: rgba(0, 212, 170, 0.6);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 212, 170, 0.3);
}

.auth-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.auth-subtitle {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-size: 1rem;
}

/* Разделитель "ИЛИ" */
.or-separator {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 1.5rem 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.or-separator::before,
.or-separator::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border-color);
}

.or-separator:not(:empty)::before {
    margin-right: .5em;
}

.or-separator:not(:empty)::after {
    margin-left: .5em;
}

/* Поля формы */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    font-size: 0.95rem;
    color: var(--text-primary);
    line-height: 1.6;
    margin-bottom: 0;
    padding: 0.5rem 0;
    transition: color 0.3s ease;
}

.checkbox-label:hover {
    color: var(--text-primary);
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    min-width: 20px;
    margin: 0;
    cursor: pointer;
    accent-color: var(--primary-color);
    flex-shrink: 0;
    border-radius: 4px;
}

.checkbox-label span {
    flex: 1;
    display: inline;
    word-wrap: break-word;
}

.checkbox-label a {
    color: var(--primary-color);
    text-decoration: none;
    transition: opacity 0.3s;
    font-weight: 500;
}

.checkbox-label a:hover {
    opacity: 0.8;
    text-decoration: underline;
}

.form-group {
    margin-bottom: 1.25rem;
    text-align: left;
}

/* Поля ввода (логин) */
.input-field {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.3);
    color: var(--text-primary);
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.input-field::placeholder { 
    color: var(--text-secondary); 
    opacity: 0.5;
}

.input-field:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.3);
}

/* Поля ввода (регистрация/forgot) — тот же стиль, но отдельный класс */
.auth-input {
    width: 100%;
    padding: 1rem 1.25rem;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.3);
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.auth-input::placeholder {
    color: var(--text-secondary);
    opacity: 0.5;
}

.auth-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.3);
}

/* Кнопка отправки */
.submit-btn {
    width: 100%;
    padding: 1rem;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    color: white;
    background: var(--primary-gradient);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -5px rgba(102, 126, 234, 0.5);
}

/* Ссылки под формой */
.footer-link {
    display: block;
    margin-top: 1.5rem;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.footer-link:hover {
    color: #8c71d6;
}

.footer-link-small {
    margin-top: 0.5rem;
    font-size: 0.9rem;
}

/* Модальное окно согласия */
.consent-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
}

.consent-modal-content {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 2rem;
    max-width: 500px;
    width: 100%;
    backdrop-filter: blur(24px) saturate(180%);
    box-shadow: var(--shadow-lg);
    animation: fadeIn 0.3s ease-out;
}

.consent-modal-content h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.consent-modal-content p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.consent-checkboxes {
    margin-bottom: 1.5rem;
}

.consent-checkboxes .checkbox-label {
    margin-bottom: 1rem;
}

.consent-modal-buttons {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.consent-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.consent-btn-cancel {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.consent-btn-cancel:hover {
    background: rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
}

.consent-btn-ok {
    background: var(--primary-gradient);
    color: white;
}

.consent-btn-ok:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -5px rgba(102, 126, 234, 0.5);
}

/* Кнопка входа через Telegram */
.telegram-login-btn {
    width: 100%;
    padding: 1rem;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    color: white;
    background: var(--primary-gradient);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.telegram-login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -5px rgba(102, 126, 234, 0.5);
}

.telegram-login-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.3);
}

.telegram-login-wrapper {
    margin-bottom: 1.5rem;
    transition: opacity 0.3s ease, pointer-events 0.3s ease;
}

.telegram-login-wrapper[style*="pointer-events: none"] {
    position: relative;
}

.telegram-login-wrapper[style*="pointer-events: none"]::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    pointer-events: none;
    z-index: 1;
}

.consent-checkboxes-wrapper {
    margin-bottom: 1.5rem;
    padding: 1rem 1.25rem;
    background: var(--card-bg);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
}

.consent-checkboxes-wrapper .form-group {
    margin-bottom: 0.5rem;
}

.consent-checkboxes-wrapper .form-group:last-child {
    margin-bottom: 0;
}

.consent-checkboxes-wrapper .checkbox-label {
    padding: 0.15rem 0;
    margin-bottom: 0;
}

/* Уведомления (регистрация / восстановление пароля) */
.notification {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    text-align: left;
    border-left: 4px solid;
    color: var(--text-primary);
    display: none;
}

.notification.show {
    display: block;
}

.notification.error {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
    color: #ff6b6b;
}

.notification.success {
    border-color: #4ade80;
    background: rgba(76, 175, 80, 0.1);
    color: #4ade80;
}

/* Стили для блока ошибок (в стиле уведомлений из студии) */
.error-message {
    display: none;
    margin-bottom: 1.5rem;
    padding: 1.5rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-left: 4px solid #fa709a;
    border-radius: 16px;
    backdrop-filter: blur(20px);
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s ease-out;
    position: relative;
}

.error-message .notification-header {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.error-message .notification-body {
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--text-secondary);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   ВКЛАДКИ ДЛЯ ВЫБОРА СПОСОБА ВХОДА
   ============================================ */
.login-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    padding: 0.25rem;
    border: 1px solid var(--border-color);
}

.login-tab {
    flex: 1;
    padding: 0.875rem 1rem;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: 'Inter', sans-serif;
}

.login-tab svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
}

.login-tab:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.login-tab.tab-active {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.login-tab.tab-active svg {
    stroke: white;
}

.tab-content {
    animation: fadeIn 0.3s ease-out;
}

.tab-content[style*="display: none"] {
    display: none !important;
}

/* ============================================
   DESKTOP СТИЛИ (для компьютеров)
   ============================================ */
@media (min-width: 768px) {
    .auth-card {
        padding: 3rem 2.5rem;
    }
}

/* ============================================
   MOBILE СТИЛИ (для телефонов)
   ============================================ */
@media (max-width: 767px) {
    body {
        overflow-y: auto;
        padding: 1rem;
    }
    
    .auth-card {
        padding: 2rem 1.5rem;
        max-width: 100%;
        width: 100%;
    }
    
    .auth-header {
        margin-bottom: 1.5rem;
    }
    
    .logo-link {
        font-size: 1.5rem;
    }
    
    .auth-nav-links {
        gap: 1rem;
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .nav-link {
        font-size: 0.9rem;
        font-weight: 600;
        padding: 0.5rem 1rem;
        min-height: 44px; /* Минимальный размер для удобного нажатия на мобильных */
        justify-content: center;
        /* Точно такие же стили, как в веб-версии */
        color: #00d4aa;
        text-decoration: none;
        border-radius: 8px;
        border: 1px solid rgba(0, 212, 170, 0.3);
        background: rgba(0, 212, 170, 0.08);
        transition: all 0.3s ease;
        display: inline-flex;
        align-items: center;
        gap: 0.5rem;
    }
    
    .nav-link:active {
        transform: scale(0.95);
        background: linear-gradient(135deg, #00d4aa 0%, #00b894 100%);
        color: #ffffff;
        border-color: rgba(0, 212, 170, 0.6);
        box-shadow: 0 4px 12px rgba(0, 212, 170, 0.3);
    }
    
    /* Добавляем hover эффект для устройств с поддержкой hover (планшеты) */
    @media (hover: hover) {
        .nav-link:hover {
            color: #ffffff;
            background: linear-gradient(135deg, #00d4aa 0%, #00b894 100%);
            border-color: rgba(0, 212, 170, 0.6);
            transform: translateY(-1px);
            box-shadow: 0 4px 12px rgba(0, 212, 170, 0.3);
        }
    }
    
    .auth-title {
        font-size: 1.25rem;
    }
    
    .auth-subtitle {
        font-size: 0.9rem;
        margin-bottom: 1.5rem;
    }
    
    .input-field {
        padding: 0.875rem 1rem;
        font-size: 0.95rem;
    }
    
    .submit-btn {
        padding: 0.875rem;
        font-size: 0.95rem;
    }
    
    .footer-link {
        font-size: 0.9rem;
        margin-top: 1rem;
    }
    
    .footer-link-small {
        font-size: 0.85rem;
    }
    
    .login-tabs {
        margin-bottom: 1.25rem;
    }
    
    .login-tab {
        padding: 0.75rem 0.875rem;
        font-size: 0.875rem;
        gap: 0.375rem;
    }
    
    .login-tab svg {
        width: 16px;
        height: 16px;
    }
}

