<!DOCTYPE HTML>
<html xmlns:th="http://www.thymeleaf.org">
    <head>
        <th:block th:insert="~{fragments/header}"></th:block>
        <link rel="stylesheet" href="/static/css/util.css">
        <link href="/static/css/sign-in.css" rel="stylesheet">
    </head>
    <body class="d-flex align-items-center py-4 bg-body-tertiary">
        <div th:replace="~{fragments/floating_button}"></div>

        <main class="form-signin w-100 m-auto">
            <div th:if="${param.error}">
                <div class="alert alert-danger" role="alert" th:text="#{login_error}">
                </div>
            </div>
            <div th:if="${error}">
                <div class="alert alert-danger" role="alert" th:text="#{login_error}">
                </div>
            </div>

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

                <div class="form-floating">
                    <input type="text" name="username" class="form-control" id="floatingInput" placeholder="Username">
                    <label for="floatingInput" th:text="#{nname}"></label>
                </div>
                <div class="form-floating">
                    <input type="password" name="password" class="form-control" id="floatingPassword" placeholder="Password">
                    <label for="floatingPassword" th:text="#{pass}"></label>
                </div>

                <div class="form-check text-start my-3">
                    <input class="form-check-input" type="checkbox" value="remember-me" id="flexCheckDefault">
                    <label class="form-check-label" for="flexCheckDefault" th:text="#{remember}"></label>
                </div>
                <button class="btn btn-primary w-100 py-2" type="submit" th:text="#{signin}"></button>

                <p class="mt-3"><a th:href="@{/signup}" class="link-primary" th:text="#{signup}"></a></p>

                <p class="mb-3 text-body-secondary">&copy; alterdekim 2023</p>
            </form>
        </main>
        <div th:replace="~{fragments/footer :: div}"></div>
    </body>
</html>