<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Reset Password</title>
    <style>
        body { font-family: sans-serif; background-color: #1a1a1a; color: #f0f0f0; display: flex; justify-content: center; align-items: center; height: 100vh; margin: 0; }
        .container { background-color: #2a2a2a; padding: 2rem; border-radius: 8px; box-shadow: 0 4px 8px rgba(0,0,0,0.3); width: 100%; max-width: 400px; }
        h1 { text-align: center; color: #fff; }
        form { display: flex; flex-direction: column; gap: 1rem; }
        label { font-weight: bold; }
        input[type="password"] { padding: 0.75rem; border-radius: 4px; border: 1px solid #444; background-color: #333; color: #f0f0f0; }
        button { padding: 0.75rem; border: none; border-radius: 4px; background-color: #007bff; color: white; font-size: 1rem; cursor: pointer; }
        button:hover { background-color: #0056b3; }
        .error { color: #ff4d4d; background-color: #402a2a; padding: 1rem; border-radius: 4px; text-align: center; }
        .success { color: #4dff4d; background-color: #2a402a; padding: 1rem; border-radius: 4px; text-align: center; }
    </style>
</head>
<body>
    <div class="container">
        <h1>Reset Your Password</h1>
        {% if success %}
            <div class="success">Your password has been reset successfully. You can now <a href="/login">log in</a> with your new password.</div>
        {% else %}
            <form method="post">
                <label for="password">New Password</label>
                <input type="password" id="password" name="password" required minlength="8">
                <label for="confirm_password">Confirm New Password</label>
                <input type="password" id="confirm_password" name="confirm_password" required minlength="8">
                <button type="submit">Reset Password</button>
            </form>
            {% if error %}
                <p class="error">{{ error }}</p>
            {% endif %}
        {% endif %}
    </div>
</body>
</html>
