# UMIS-Style Login (PHP + MySQL)

A responsive login page inspired by the provided screenshot. Built with PHP, HTML, CSS, and vanilla JS, using PDO for secure DB access.

## Features
- Mobile-first responsive split layout (form + hero image)
- Accessible form with labels, focus styles, and keyboard support
- Secure login using prepared statements and password hashing (`password_hash`/`password_verify`)
- Simple session-based auth with protected dashboard
- Input validation with helpful error messages
- Easy configuration in `config.example.php` → copy to `config.php`
- Minimal dependencies (no frameworks required)

## Quick Start

1. Copy `config.example.php` to `config.php` and fill in your MySQL credentials.
2. Create the database and table using `schema.sql` (e.g., via phpMyAdmin or MySQL CLI).
3. (Optional) Insert the sample user from `schema.sql` or create your own and hash with PHP.
4. Place this folder in your PHP server root (e.g., `htdocs/umis_login_site`) and visit `/index.php`.

### MySQL CLI Example

```bash
mysql -u root -p
# inside mysql>
CREATE DATABASE umis_demo CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
USE umis_demo;
SOURCE /path/to/schema.sql;
```

### Sample Credentials (from schema.sql)
- E-mail: `demo@example.com`
- Password: `DemoPass123!`

## Files
- `index.php` — login page
- `dashboard.php` — simple protected page after login
- `logout.php` — end the session
- `auth.php` — handles login POST
- `db.php` — database connection via PDO
- `config.example.php` — copy to `config.php` and set DB creds
- `public/css/styles.css` — styling
- `public/js/app.js` — client-side tweaks
- `schema.sql` — DB schema and seed user

## Security Notes
- For production, serve over HTTPS, set secure `session.cookie_secure`, use SameSite cookies, and consider CSRF tokens.
- This demo sets a basic Content Security Policy and HTTP security headers in PHP.
