<?php
function login_form($error_msg = '')
{
    $form = '
        <div class="form_card">
            <h3 class="underline">Log In</h3>
            <form method="post" id="login_form">
                <input type="hidden" name="form_id" value="login_form">
                <input type="hidden" name="password_hash" value="" id="password_hash">

                <label for="username">Username / Email</label>
                <input id="username" name="username" spellcheck="false" required autofocus>

                <label for="password">Password</label>
                <input id="password" name="password" type="password" spellcheck="false" required>

                <label class="form_checkbox_container">Stay Logged In?
                    <input name="stay_logged_in" type="checkbox" value="true">
                    <span class="checkmark"></span>
                </label>

                <input class="button" type="submit" value="Log In">
                ' . $error_msg . '
            </form>

            <script src="js/login.js" defer></script>
        </div>
    ';

    return $form;
}
