<?php
$error = $error ?? null;
$success = $success ?? null;
?>

<main class="login-page">
    <div class="login-container">

        <h1>Passwort vergessen</h1>

        <?php if (!empty($error)): ?>
            <p class="alert-message is-error">
                <?php echo htmlspecialchars($error); ?>
            </p>
        <?php endif; ?>

        <?php if (!empty($success)): ?>
            <p class="alert-message is-success">
                <?php echo $success; ?>
            </p>
        <?php endif; ?>

        <form method="post" action="index.php?pfad=password-forgotten">

            <p class="input-label">E-Mail-Adresse:</p>
            <input type="email"
                   name="email"
                   class="login-input"
                   placeholder="E-Mail-Adresse"
                   required>

            <p class="input-label">Neues Passwort:</p>
            <input type="password"
                   name="password"
                   class="login-input"
                   placeholder="Neues Passwort"
                   required>

            <button type="submit"
                    name="passwordForgottenSubmit"
                    class="button">
                Passwort zurücksetzen
            </button>

            <div class="register-link">
                <a href="index.php?pfad=login">
                    Zurück zum Login
                </a>
            </div>

        </form>

    </div>
</main>
