<!DOCTYPE html>
<html lang="en">
    <head>
        <%- include("partials/meta.ejs")  %> 
        <title>RecipEasy: Login</title>
    </head>
    <body>
        <div class="container">
            <%- include('partials/header-nav.ejs') %> 
            <main>
                <section class="login_page">
                    <form name="loginform" action="/login" method="post">
                        <% if(typeof(message)!="undefined"){%> 
                            <p><%= message  %> </p>
                        <% } %> 
                        <h2>Login</h2>
                        <div class="labelwrapper">
                            <div class="fieldwrapper">
                                <label for="aUserName"><i class="fa-solid fa-user"></i> Username:</label>
                                <input id="aUserName" name="aUserName" type="text"/>
                            </div>
                            <div class="fieldwrapper">
                                <label for="apass"><i class="fa-solid fa-key"></i> Password:</label>
                                <div>
                                    <input id="aPass" name="aPass" type="password"/>
                                    <% if(typeof(errors)!="undefined"){%> 
                                        <p>Invalie Username or Password</p>
                                    <% } %> 
                                </div>
                            </div>
                        </div>
                        <div class="submission">
                            <input type="submit" value="Login">
                        </div>
                        <a href="/register">Create an account</a>
                    </form>
                </section>
            </main>
            <%- include("partials/footer.ejs")  %> 
        </div>
    </body>
</html>