/* Переменные для тем (как в каталоге) */
:root {
    /* Светлая тема */
    --bg-color: #ffffff;
    --surface-color: #f8f9fa;
    --text-primary: #212529;
    --text-secondary: #6c757d;
    --text-muted: #868e96;
    --border-color: #e9ecef;
    --border-light: #f1f3f4;
    --primary-color: #007bff;
    --primary-hover: #0056b3;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --shadow-light: rgba(0, 0, 0, 0.05);
    --shadow-medium: rgba(0, 0, 0, 0.1);
    --shadow-heavy: rgba(0, 0, 0, 0.15);
    --backdrop-color: rgba(0, 0, 0, 0.5);
}

[data-theme="dark"], .dark {
    /* Тёмная тема */
    --bg-color: #000;
    --surface-color: #1c1c1c;
    --text-primary: #ffffff;
    --text-secondary: #828282;
    --text-muted: #888888;
    --border-color: #404040;
    --border-light: #333333;
    --primary-color: #438ef4;
    --primary-hover: #357ABD;
    --success-color: #4CAF50;
    --danger-color: #F44336;
    --warning-color: #FF9800;
    --shadow-light: rgba(0, 0, 0, 0.2);
    --shadow-medium: rgba(0, 0, 0, 0.3);
    --shadow-heavy: rgba(0, 0, 0, 0.4);
    --backdrop-color: rgba(0, 0, 0, 0.7);
}

/* Базовые стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
    position: fixed;
    width: 100%;
}

/* Шапка как в каталоге */
.main-header {
    background-color: var(--surface-color);
    border-bottom: 1px solid var(--border-color);
    padding: 0 20px;
    height: 60px;
    position: sticky;
    top: 0;
    z-index: 100;
    transition: all 0.3s ease;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.header-left {
    display: flex;
    align-items: center;
}

.logo-container {
    display: flex;
    align-items: center;
}

.logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 700;
    font-size: 20px;
    transition: color 0.3s ease;
}

.logo-link:hover {
    color: var(--primary-color);
}

.logo-icon {
    margin-right: 10px;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
}

.logo-text {
    font-size: 20px;
    font-weight: 700;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* Переключатель темы */
.theme-switcher {
    display: flex;
    align-items: center;
}

.theme-btn {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
}

.theme-btn:hover {
    background-color: var(--border-light);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.theme-icon {
    transition: opacity 0.3s ease;
}

.dark .sun-icon {
    opacity: 0;
    position: absolute;
}

.dark .moon-icon {
    opacity: 1;
}

:root .sun-icon {
    opacity: 1;
}

:root .moon-icon {
    opacity: 0;
    position: absolute;
}

/* Курсы валют */
.exchange-rates {
    display: flex;
    gap: 15px;
}

.rate {
    font-size: 14px;
    color: var(--text-secondary);
    padding: 6px 12px;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-weight: 500;
}

/* Основной контент */
.auth-main-page {
    display: flex;
    justify-content: center;
    padding: 120px 20px;
}

.auth-content {
    text-align: center;
    max-width: 600px;
    width: 100%;
}

/* Приветственная секция */
.welcome-section {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.welcome-icon {
    margin-bottom: 30px;
    padding: 20px;
    background: var(--surface-color);
    border-radius: 20px;
    border: 1px solid var(--border-color);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px var(--shadow-light);
}

.welcome-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
    line-height: 1.2;
}

.welcome-text {
    font-size: 18px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 40px;
}

/* Сетка преимуществ */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
    max-width: 500px;
    width: 100%;
}

.feature-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 15px;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    transition: all 0.3s ease;
    cursor: default;
}

.feature-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--shadow-medium);
    border-color: var(--primary-color);
}

.feature-icon {
    margin-bottom: 10px;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--bg-color);
    border-radius: 10px;
    border: 1px solid var(--border-color);
}

.feature-card span {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    text-align: center;
}

/* Кнопки авторизации */
.auth-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
    max-width: 400px;
}

.auth-main-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 24px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    min-height: 56px;
}

.auth-main-btn.primary {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
}

.auth-main-btn.primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 123, 255, 0.4);
}

.auth-main-btn.secondary {
    background: var(--surface-color);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.auth-main-btn.secondary:hover {
    background: var(--border-light);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px var(--shadow-medium);
}

/* Мобильное меню снизу */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--surface-color);
    border-top: 1px solid var(--border-color);
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    padding: 8px 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 4px;
    text-decoration: none;
    color: var(--text-secondary);
    transition: all 0.3s ease;
    border: none;
    background: none;
    cursor: pointer;
    position: relative;
}

.nav-item:hover,
.nav-item.active {
    color: var(--primary-color);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 3px;
    background: var(--primary-color);
    border-radius: 2px;
}

.nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
    position: relative;
}

.nav-label {
    font-size: 12px;
    font-weight: 500;
    text-align: center;
}

/* Модальные окна */
.auth-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: var(--backdrop-color);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 1000;
    overflow-y: auto;
}

.auth-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-modal-content {
    background: var(--bg-color);
    border-radius: 16px;
    box-shadow: 0 20px 50px var(--shadow-heavy);
    max-width: 450px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideUp 0.4s ease-out;
    border: 1px solid var(--border-color);
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Заголовок модального окна */
.modal-header {
    padding: 25px 30px 15px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.modal-header h3 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: var(--border-light);
    color: var(--text-primary);
}

/* Модальное окно выбора */
.choice-modal {
    padding: 0 0 30px 0;
}

.choice-buttons {
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.choice-btn {
    display: flex;
    align-items: center;
    padding: 20px;
    background: var(--surface-color);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    width: 100%;
}

.choice-btn:hover {
    border-color: var(--primary-color);
    background: var(--border-light);
    transform: translateY(-2px);
}

.btn-icon {
    margin-right: 15px;
    min-width: 40px;
    color: var(--primary-color);
}

.btn-text h4 {
    margin: 0 0 5px 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.btn-text p {
    margin: 0;
    font-size: 14px;
    color: var(--text-secondary);
}

/* Формы */
.form-modal {
    padding: 0 0 30px 0;
}

.auth-form {
    padding: 30px;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-primary);
    font-size: 14px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 16px;
    color: var(--text-muted);
    z-index: 1;
    pointer-events: none;
}

.form-group input {
    width: 100%;
    padding: 14px 16px 14px 50px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: var(--bg-color);
    color: var(--text-primary);
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.form-group input:focus + .input-icon {
    color: var(--primary-color);
}

.form-group input::placeholder {
    color: var(--text-muted);
}

/* Опции формы */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 10px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-secondary);
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    margin-right: 8px;
    position: relative;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
    content: '✓';
    position: absolute;
    top: -2px;
    left: 2px;
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.forgot-link, .agreement-link {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s ease;
}

.forgot-link:hover,
.agreement-link:hover {
    text-decoration: underline;
    color: var(--primary-hover);
}

/* Соглашение */
.form-agreement {
    margin-bottom: 25px;
}

.form-agreement .checkbox-label {
    font-size: 13px;
    line-height: 1.4;
}

/* Кнопки отправки */
.submit-btn {
    width: 100%;
    padding: 14px 20px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 48px;
}

.submit-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 123, 255, 0.3);
}

.submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-loader.hidden,
.btn-text.hidden {
    display: none;
}

.btn-loader {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Переключение форм */
.form-switch {
    text-align: center;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.form-switch p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 14px;
}

.switch-link {
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    text-decoration: underline;
    padding: 0;
}

.switch-link:hover {
    color: var(--primary-hover);
}

/* Сообщения об ошибках */
.error-message {
    background: rgba(220, 53, 69, 0.1);
    color: var(--danger-color);
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid rgba(220, 53, 69, 0.2);
    display: none;
    font-size: 14px;
}

/* Адаптация для мобильных устройств */
@media (max-width: 768px) {
    body {
        padding-bottom: 80px;
    }
    
    .auth-main-page {
        height: calc(100vh - 135px);
        padding: 15px;
    }
	
    .main-header {
        padding: 0 15px;
        height: 55px;
    }
    
    .header-right .exchange-rates {
        display: none;
    }
    
    .welcome-title {
        font-size: 24px;
    }
    
    .welcome-text {
        font-size: 16px;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .feature-card {
        flex-direction: row;
        text-align: left;
        padding: 15px;
    }
    
    .feature-icon {
        margin-bottom: 0;
        margin-right: 15px;
        width: 35px;
        height: 35px;
    }
    
    .auth-modal {
        align-items: flex-end;
    }
    
    .auth-modal-content {
        width: 100%;
        max-width: 100%;
        border-radius: 16px 16px 0 0;
        max-height: 90vh;
        animation: modalSlideUpMobile 0.4s ease-out;
    }
    
    @keyframes modalSlideUpMobile {
        from {
            transform: translateY(100%);
        }
        to {
            transform: translateY(0);
        }
    }
    
    .modal-header {
        padding: 20px 20px 15px;
    }
    
    .modal-header h3 {
        font-size: 20px;
    }
    
    .auth-form {
        padding: 20px;
    }
    
    .choice-buttons {
        padding: 20px;
    }
    
    .choice-btn {
        padding: 16px;
    }
    
    .btn-text h4 {
        font-size: 16px;
    }
    
    .form-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    body {
        padding-bottom: 70px;
    }
    
    .mobile-bottom-nav {
        display: grid;
    }
}

@media (min-width: 769px) {
    .mobile-bottom-nav {
        display: none;
    }
    
    body {
        padding-bottom: 0;
    }
}

@media (max-width: 480px) {
    .auth-main-page {
    }
    
    .welcome-title {
        font-size: 20px;
    }
    
    .welcome-text {
        font-size: 15px;
    }
    
    .auth-main-btn {
        font-size: 15px;
        padding: 14px 20px;
    }
    
    .logo-text {
        font-size: 18px;
    }
}

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--surface-color);
    border-top: 1px solid var(--border-color);
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    z-index: 1000;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.bottom-nav .nav-item {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 8px;
    text-decoration: none;
    color: var(--text-secondary);
    transition: all 0.3s ease;
    border: none;
    outline: none;
    background: none;
}

.bottom-nav .nav-item:focus {
    outline: none;
    border: none;
}

.bottom-nav .nav-item svg {
    width: 24px;
    height: 24px;
}

.bottom-nav .nav-item svg {
    width: 24px;
    height: 24px;
}

.auth-main-page {
    display: flex;
    justify-content: center;
    align-items: center;
    height: calc(100vh - 60px);
    padding: 20px;
    overflow: hidden;
}

/* Убираем старые стили mobile-bottom-nav если они есть */
.mobile-bottom-nav {
    display: none !important;
}

/* Обеспечиваем отступ для body */
@media (max-width: 768px) {
    body {
        padding-bottom: 80px;
    }
    
    .bottom-nav {
        display: grid;
    }
}

@media (min-width: 769px) {
    .bottom-nav {
        display: none;
    }
    
    body {
        padding-bottom: 0;
    }
}