<?php
/**
 * Forgot Password View — Helmyx Auth Page
 */
?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Forgot Password — Helmyx</title>
    <link rel="preconnect" href="https://fonts.googleapis.com">
    <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
    <link href="https://fonts.googleapis.com/css2?family=Montserrat:wght@600;700&family=Inter:wght@300;400;500;600;700;800&display=swap" rel="stylesheet">
    <link rel="icon" type="image/png" sizes="32x32" href="<?= defined('APP_URL') ? APP_URL : '' ?>/assets/brand/favicon/helmyx-icon-32.png">
    <link rel="stylesheet" href="<?= defined('APP_URL') ? APP_URL : '' ?>/assets/css/hx-tokens.css">
    <link rel="stylesheet" href="<?= defined('APP_URL') ? APP_URL : '' ?>/assets/css/style.css">
    <link rel="stylesheet" href="<?= defined('APP_URL') ? APP_URL : '' ?>/assets/css/auth.css">
</head>
<body class="auth-body">

<div class="auth-wrapper">
    <div class="auth-shapes">
        <div class="shape shape-1"></div>
        <div class="shape shape-2"></div>
        <div class="shape shape-3"></div>
        <div class="shape shape-4"></div>
    </div>

    <div class="auth-card">
        <div class="auth-logo">
            <img src="<?= APP_URL ?>/assets/brand/logo/helmyx-horizontal.svg" alt="Helmyx — Steer. Plan. Deliver." style="height:46px;">
        </div>

        <h1 class="auth-title">Forgot your password?</h1>
        <p class="auth-subtitle">Enter your email and we'll send you a link to reset it.</p>

        <?php if (!empty($_SESSION['flash'])): ?>
            <?php foreach ($_SESSION['flash'] as $type => $message): ?>
                <div class="alert alert-<?= htmlspecialchars($type) ?>" style="margin-bottom:16px;">
                    <span><?= htmlspecialchars($message) ?></span>
                    <button class="alert-dismiss" onclick="this.parentElement.remove()">&times;</button>
                </div>
            <?php endforeach; unset($_SESSION['flash']); ?>
        <?php endif; ?>

        <form method="POST" action="<?= APP_URL ?>/forgot-password" novalidate>
            <input type="hidden" name="csrf_token" value="<?= htmlspecialchars($_SESSION[CSRF_TOKEN_NAME] ?? '') ?>">

            <div class="form-group">
                <label class="form-label" for="email">Email Address</label>
                <input type="email" id="email" name="email" class="form-control" placeholder="you@company.com" autocomplete="email" required>
            </div>

            <button type="submit" class="btn btn-primary w-full btn-lg" style="justify-content:center;">Send Reset Link</button>
        </form>

        <p style="text-align:center;margin-top:24px;font-size:0.85rem;">
            <a href="<?= APP_URL ?>/login" style="color:var(--primary);text-decoration:none;">&larr; Back to Sign In</a>
        </p>
    </div>
</div>
</body>
</html>
