<!doctype html>
<html lang="ko" xmlns:th="http://www.thymeleaf.org">
<head th:replace="~{fragments/layout :: head('데이터 접근 제어')}"></head>
<body class="login-body">
<main class="login-shell">
  <section class="login-panel">
    <div class="login-brand">
      <span class="login-mark">접근</span>
      <div>
        <h1>데이터 접근 제어 콘솔</h1>
      </div>
    </div>

    <div class="alert alert-danger" th:if="${param.error}">
      계정 또는 비밀번호가 올바르지 않습니다.
    </div>
    <div class="alert alert-success" th:if="${param.logout}">
      로그아웃되었습니다.
    </div>

    <form method="post" th:action="@{/login}" class="login-form">
      <input type="hidden" th:name="${_csrf.parameterName}" th:value="${_csrf.token}">
      <label>
        Admin User
        <input class="form-control" name="username" type="text" autocomplete="username" autofocus required>
      </label>
      <label>
        Admin Password
        <input class="form-control" name="password" type="password" autocomplete="current-password" required>
      </label>
      <label class="form-check" th:if="${rememberMeAvailable}">
        <!-- Persistent login is opt-out for this internal HTTPS backoffice.
             The server issues only a signed HttpOnly/Secure cookie; no password
             or bearer token is stored in browser Web Storage. -->
        <input class="form-check-input" id="remember-me" name="remember-me" type="checkbox" value="true" checked>
        <span class="form-check-label" for="remember-me">로그인 유지 <small class="text-muted" th:text="${'이 기기에서 ' + rememberMeDays + '일간 유지'}">이 기기에서 14일간 유지</small></span>
      </label>
      <button class="btn rw-btn-primary w-100" type="submit">로그인</button>
    </form>
  </section>
</main>
</body>
</html>
