@page "/admin/login"
@model TaxBaik.Web.Pages.Admin.LoginModel
@inject VersionInfo VersionInfo
@{
    Layout = "~/Pages/Shared/_AdminLayout.cshtml";
    ViewData["Title"] = "관리자 로그인";
    ViewData["Description"] = "관리자 로그인 페이지입니다.";
    ViewData["CanonicalUrl"] = $"{Request.Scheme}://{Request.Host}/admin/login";
}

<section class="admin-login-shell">
    <div class="admin-login-hero">
        <p class="admin-login-kicker">TaxBaik Admin</p>
        <h1>관리자 로그인</h1>
        <p>로그인 후 대시보드, 문의 처리, 콘텐츠 운영 화면으로 바로 이동합니다.</p>
    </div>

    <div class="card shadow-sm border-0 admin-login-card">
        <div class="card-body p-4 p-md-5">
            <div class="admin-login-summary mb-4">
                <div>
                    <p class="text-uppercase text-muted small mb-1">현재 화면</p>
                    <strong>로그인</strong>
                </div>
                <div>
                    <p class="text-uppercase text-muted small mb-1">진입 후</p>
                    <strong>대시보드 자동 이동</strong>
                </div>
            </div>

            <div class="d-flex flex-wrap justify-content-between align-items-center gap-2 mb-4 small text-muted">
                <span>현재 버전</span>
                <strong class="text-body">v@(VersionInfo.Version) · @VersionInfo.Built</strong>
            </div>

            @if (!string.IsNullOrWhiteSpace(Model.ErrorMessage))
            {
                <div class="alert alert-danger" role="alert">@Model.ErrorMessage</div>
            }

            <form id="admin-login-form" method="post" class="vstack gap-3 admin-login-form">
                @Html.AntiForgeryToken()
                <input type="hidden" id="ReturnUrl" name="ReturnUrl" value="@Model.ReturnUrl" />

                <div>
                    <label class="form-label" for="Username">사용자명</label>
                    <input class="form-control" id="Username" name="Username" value="@Model.Username" autocomplete="username" />
                    <span class="text-danger small">@(!string.IsNullOrWhiteSpace(ModelState["Username"]?.Errors.FirstOrDefault()?.ErrorMessage) ? ModelState["Username"]?.Errors.FirstOrDefault()?.ErrorMessage : "")</span>
                </div>

                <div>
                    <label class="form-label" for="Password">비밀번호</label>
                    <input class="form-control" id="Password" name="Password" type="password" autocomplete="current-password" />
                    <span class="text-danger small">@(!string.IsNullOrWhiteSpace(ModelState["Password"]?.Errors.FirstOrDefault()?.ErrorMessage) ? ModelState["Password"]?.Errors.FirstOrDefault()?.ErrorMessage : "")</span>
                </div>

                <div class="form-check">
                    <input class="form-check-input" id="RememberUsername" name="RememberUsername" type="checkbox" value="true" checked="@(Model.RememberUsername)" />
                    <label class="form-check-label" for="RememberUsername">아이디 기억하기</label>
                </div>

                <button class="btn btn-dark w-100" id="admin-login-submit" type="submit">
                    <span>로그인</span>
                </button>
            </form>

            <p class="admin-login-footnote">
                관리자 로그인에 성공하면 대시보드로 이동합니다.
            </p>
        </div>
    </div>
</section>










