Загрузка данных


<div class="auth-card">
    <button class="close-btn" onclick="window.history.length > 1 ? history.back() : window.location.href='index.php'">&times;</button>

    <h2 id="auth-title">Регистрация</h2>

    <div id="auth-container">
        <!-- БЛОК РЕГИСТРАЦИИ (Активен сразу) -->
        <div id="view-register" class="auth-view active">
            <!-- ... ваш существующий код формы регистрации ... -->
            <form action="vendor/signup.php" method="POST" id="reg-form">
                 <!-- Содержимое формы остается прежним из source 1 -->
                 <button type="submit" class="reg-button">Создать профиль</button>
            </form>
            
            <div class="switch-container">
                <span class="switch-text">Уже есть аккаунт?</span>
                <button type="button" class="switch-link" onclick="toggleAuth('login')">Войти</button>
            </div>
        </div>

        <!-- БЛОК ВХОДА (Скрыт принудительно через style) -->
        <div id="view-login" class="auth-view" style="display: none;">
            <form action="vendor/signin.php" method="POST" id="login-form">
                <div class="form-group">
                    <label>Электронная почта</label>
                    <input type="email" name="email" required placeholder="example@axioma.ru">
                </div>
                <div class="form-group">
                    <label>Пароль</label>
                    <input type="password" name="password" required>
                </div>
                <button type="submit" class="reg-button">Войти в аккаунт</button>
            </form>
            
            <div class="switch-container">
                <span class="switch-text">Нет аккаунта?</span>
                <button type="button" class="switch-link" onclick="toggleAuth('register')">Зарегистрироваться</button>
            </div>
        </div>
    </div>
</div>






/* Основной контейнер */
.auth-card {
    background: #1a1a1a; /* Цвет под темную тему Axioma */
    color: #ffffff;
    min-height: 550px;
    position: relative;
}

/* Стили переключателей */
.auth-view {
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.auth-view.active {
    opacity: 1;
}

/* Контейнер внизу формы */
.switch-container {
    margin-top: 25px;
    text-align: center;
    padding: 10px;
}

/* Исправление черного текста */
.switch-text {
    color: rgba(255, 255, 255, 0.7) !important; /* Светло-серый текст */
    font-size: 14px;
    margin-right: 5px;
}

/* Исправление синих подчеркнутых ссылок */
.switch-link {
    background: none;
    border: none;
    color: #007bff !important; /* Насыщенный синий цвет кнопки */
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    padding: 5px 10px; /* Увеличиваем зону нажатия */
    text-decoration: none;
    transition: all 0.2s ease;
}

.switch-link:hover {
    color: #4da3ff !important;
    text-decoration: underline;
}

/* Убеждаемся, что формы не накладываются */
.auth-view:not(.active) {
    pointer-events: none;
}





function toggleAuth(mode) {
    const regView = document.getElementById('view-register');
    const loginView = document.getElementById('view-login');
    const title = document.getElementById('auth-title');

    if (mode === 'login') {
        // Убираем регистрацию
        regView.classList.remove('active');
        regView.style.display = 'none';

        // Показываем вход
        loginView.style.display = 'block';
        setTimeout(() => {
            loginView.classList.add('active');
        }, 10);
        
        title.innerText = 'Вход';
    } else {
        // Убираем вход
        loginView.classList.remove('active');
        loginView.style.display = 'none';

        // Показываем регистрацию
        regView.style.display = 'block';
        setTimeout(() => {
            regView.classList.add('active');
        }, 10);

        title.innerText = 'Регистрация';
    }
}