<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.w3.org/1999/xhtml" xmlns:sec="http://www.thymeleaf.org/extras/spring-security">
    <head>
        <th:block th:insert="~{fragments/head}"></th:block>
        <link rel="stylesheet" href="/static/css/login.css">
    </head>
    <body class="d-flex align-items-center py-4 bg-body-tertiary">
        <main class="form-signin w-100 m-auto">
            <div th:if="${param.error}">
                <div class="alert alert-danger" role="alert">Error
                </div>
            </div>
            <div th:if="${error}">
                <div class="alert alert-danger" role="alert">Error
                </div>
            </div>

            <form method="post" th:action="@{/login}">
                <h1 class="h3 mb-3 fw-normal">Login</h1>

                <div class="form-floating">
                    <input type="text" name="username" class="form-control" id="floatingInput" placeholder="Username">
                    <label for="floatingInput">Nickname</label>
                </div>
                <div class="form-floating">
                    <input type="password" name="password" class="form-control" id="floatingPassword" placeholder="Password">
                    <label for="floatingPassword">Password</label>
                </div>

                <button class="btn btn-primary w-100 py-2" type="submit">Login</button>

                <p class="mt-3"><a th:href="@{/signup}" class="link-primary">Signup</a></p>
            </form>
        </main>
        <th:block th:insert="~{fragments/essentials}"></th:block>
    </body>
</html>