<!DOCTYPE html>
<html lang="en">

{{ template "head.tpl.html" . }}

<body class="bg-background text-muted p-4 pt-10 flex flex-col min-h-screen max-w-screen-lg mx-auto justify-center">

{{ template "header.tpl.html" . }}

{{ template "alerts.tpl.html" . }}

<main class="mt-10 grow flex justify-center w-full">
    <div class="grow max-w-lg mt-10">
        <div class="mb-8">
            <h1 class="h1">Welcome!</h1>
            <span class="h1-subcaption">Log in to continue using Wakapi</span>
        </div>
        <form action="login" method="post">
            <div class="mb-4">
                <input class="input-default"
                       type="text" id="username" autocomplete="username"
                       name="username" placeholder="Username" minlength="1" required autofocus>
            </div>
            <div class="mb-4">
                <input class="input-default"
                       type="password" id="password" autocomplete="current-password"
                       name="password" placeholder="Password" minlength="6" required>
            </div>
            <div class="flex justify-between items-center">
                <a href="reset-password" class="text-muted text-sm">
                    Forgot password?
                </a>
                <div class="flex space-x-2">
                    {{ if .AllowSignup }}
                    <a href="signup">
                        <button type="button" class="btn-default">Sign up</button>
                    </a>
                    {{ else }}
                    <a title="The administrator of this instance has disabled sign up.">
                        <button type="button" class="btn-disabled" disabled> Sign up </button>
                    </a>
                    {{ end }}
                    <button type="submit" class="btn-primary">Log in</button>
                </div>
            </div>
        </form>
    </div>
</main>

{{ template "footer.tpl.html" . }}

{{ template "foot.tpl.html" . }}
</body>

</html>
