# Standalone Login System — Option A

## Approach
Replace the Atoms OIDC OAuth login with a native email/password form. WHMCS is the single source of truth for user credentials:
- **Register**: form → backend `/api/v1/whmcs/register` → WHMCS `AddClient`
- **Login**: form → backend `/api/v1/whmcs/login` → WHMCS `ValidateLogin` → backend mints app JWT via `create_access_token` → frontend stores it in `localStorage.token` (web-sdk auto-attaches it as Bearer)
- **Session**: web-sdk's `client.auth.me()` calls `/api/v1/auth/me`, which decodes our app JWT — no changes needed there
- **Logout**: clear `localStorage.token` and redirect to `/login`
- **Forgot/Reset**: already wired to WHMCS, unchanged

## Development Tasks
- [x] Backend: add `POST /api/v1/whmcs/login` using WHMCS `ValidateLogin` + mint app JWT (pydantic schemas)
- [x] Frontend: rewrite `src/pages/Login.tsx` with email/password form + "Sign in" → calls backend, stores token, navigates to `/client`
- [x] Frontend: rewrite `src/pages/Register.tsx` to submit the form without requiring Atoms OIDC login first (registers in WHMCS, then auto-logs in via the new login endpoint)
- [x] Frontend: add a reusable auth helper (`src/lib/auth.ts`) that handles token storage, logout, and "am I signed in?" checks
- [x] Frontend: update `SiteLayout.tsx` / any "Sign out" buttons to use the new helper (clear localStorage token + redirect to /login)
- [x] Frontend: lint + build check
- [x] Backend: `python -m py_compile` on changed Python files
- [x] Backend: add SMTP-based `/api/v1/contact/get-price` and `/api/v1/contact/contact-us` endpoints
- [x] Frontend: wire hero & final-CTA buttons ("Get Prices" / "Talk to Sales") to open popup modals
- [x] Frontend: render `ContactUsModal`, `GetPriceModal`, `SupportModal` on Index page
- [x] Backend: add `smtp_settings` model + admin SMTP settings CRUD endpoints (`/api/v1/admin/smtp-settings`) with "send test email" action
- [x] Backend: update `email_sender` to load SMTP config from DB (admin panel) with env-var fallback
- [x] Frontend: wire `CmsNotifications` admin page to real backend API (replace localStorage) + working "Send Test Email" button