15:if ($_SERVER['REQUEST_METHOD'] === 'POST') {
16:    $action = $_POST['action'] ?? '';
17:    if ($action === 'login') {
18:        $result = $auth->login(trim($_POST['username'] ?? ''), $_POST['password'] ?? '');
21:    } elseif ($action === 'register') {
23:            trim($_POST['username'] ?? ''),
24:            trim($_POST['email']    ?? ''),
25:            $_POST['password'] ?? ''
32:$activeTab = (isset($_POST['action']) && $_POST['action'] === 'register') ? 'register' : 'login';
64:    <form class="auth-form <?= $activeTab==='login' ? 'active':'' ?>" id="form-login" method="POST">
65:      <input type="hidden" name="action" value="login">
69:               value="<?= htmlspecialchars($_POST['username'] ?? '') ?>"
86:    <form class="auth-form <?= $activeTab==='register' ? 'active':'' ?>" id="form-register" method="POST">
87:      <input type="hidden" name="action" value="register">
91:               value="<?= htmlspecialchars($_POST['username'] ?? '') ?>"
98:               value="<?= htmlspecialchars($_POST['email'] ?? '') ?>"
