<!DOCTYPE html>
<html lang="ko" xmlns:th="http://www.thymeleaf.org"
      xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
      layout:decorate="~{layout/layout}">
<div layout:fragment="content" class="h-100">
  <div id="carouselExampleFade" class="carousel slide carousel-fade" data-bs-ride="carousel" style="z-index: 100">
    <div class="carousel-inner">
      <div class="carousel-item active">
        <img th:src="@{/img/img01.jpg}" class="w-100" alt="배경1">
      </div>
      <div class="carousel-item">
        <img th:src="@{/img/img02.jpg}" class="w-100" alt="배경2">
      </div>
      <!--<div class="carousel-item">
        <img th:src="@{/img/img03.jpg}"class="d-block w-100" alt="...">
      </div>-->
    </div>
    <button class="carousel-control-prev" type="button" data-bs-target="#carouselExampleFade" data-bs-slide="prev">
      <span class="carousel-control-prev-icon" aria-hidden="true"></span>
      <span class="visually-hidden">Previous</span>
    </button>
    <button class="carousel-control-next" type="button" data-bs-target="#carouselExampleFade" data-bs-slide="next">
      <span class="carousel-control-next-icon" aria-hidden="true"></span>
      <span class="visually-hidden">Next</span>
    </button>
  </div>
  <div class="form-signin text-center mt-5 rounded bg-white">
    <!-- Security config의 loginPage("url")와 action url과 동일하게 작성-->
    <form action="/user/login" method="post">
      <!-- Spring Security가 적용되면 POST 방식으로 보내는 모든 데이터는 csrf 토큰 값이 필요 -->
      <input type="hidden" name="_csrf_header" th:value="${_csrf.headerName}"/>
      <input type="hidden" th:name="${_csrf.parameterName}" th:value="${_csrf.token}"/>
      <p th:if="${loginError}" class="error text-danger">로그인에 실패하였습니다.</p>
      <!-- 로그인 시 아이디의 name 애트리뷰트 값은 username -->
      <!-- 파라미터명을 변경하고 싶을 경우 config class formlogin()에서 .usernameParameter("") 명시 -->

      <!--<img class="mb-4" th:src="@{/img/}" alt="" width="72" height="57">-->
      <h1 class="h3 mb-3 fw-normal">로그인</h1>
      <div class="form-floating py-2">
        <input type="text" class="form-control" id="username" name="username" placeholder="아이디">
        <label for="username">아이디</label>
      </div>
      <div class="form-floating py-2">
        <input type="password" class="form-control" id="password" name="password" placeholder="비밀번호">
        <label for="password">비밀번호</label>
      </div>
      <!--<div class="checkbox mb-3">
        <label>
          <input type="checkbox" class="disabled" value="remember-me"> 계정저장(비활성화)
        </label>
      </div>-->
      <button class="w-100 py-2 btn btn-lg btn-primary" type="submit">로그인</button>
    </form>
  </div>
</div>
</html>