<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>用户登录 - 图书管理系统</title>
    <link rel="stylesheet" href="{{ url_for('static', filename='css/login.css') }}">
</head>
<body>
    <div class="overlay"></div>

    <div class="theme-toggle" id="theme-toggle">☀️</div>

    <div class="main-container">
        <div class="login-container">
            <div class="logo">
                <img src="{{ url_for('static', filename='images/logo.png') }}" alt="Logo">
            </div>
            <h1>图书管理系统</h1>
            <p class="subtitle">欢迎回来，请登录您的账户</p>

            <div id="account-login">
                <form id="login-form" action="{{ url_for('user.login') }}" method="post">
                    <div class="form-group">
                        <label for="username">用户名/邮箱</label>
                        <div class="input-with-icon">
                            <span class="input-icon">👤</span>
                            <input type="text" id="username" name="username" class="form-control" placeholder="请输入账号">
                        </div>
                        <div class="validation-message" id="username-error"></div>
                    </div>

                    <div class="form-group">
                        <label for="password">密码</label>
                        <div class="input-with-icon">
                            <span class="input-icon">🔒</span>
                            <input type="password" id="password" name="password" class="form-control" placeholder="请输入密码">
                            <span class="password-toggle" id="password-toggle">👁️</span>
                        </div>
                        <div class="validation-message" id="password-error"></div>
                    </div>

                    <div class="remember-forgot">
                        <label class="custom-checkbox">
                            <input type="checkbox" name="remember_me">
                            <span class="checkmark"></span>
                            记住我 (7天内免登录)
                        </label>
                        <div class="forgot-password">
                            <a href="#">忘记密码？</a>
                        </div>
                    </div>

                    {% if error %}
                    <div class="alert alert-danger">{{ error }}</div>
                    {% endif %}

                    <button type="submit" class="btn-login" id="login-button">
                        <span>登录</span>
                        <span class="loading">⟳</span>
                    </button>
                </form>

                <div class="signup">
                    还没有账号？ <a href="{{ url_for('user.register') }}">立即注册</a>
                </div>

                <div class="features">
                    <div class="feature-item">
                        <span class="feature-icon">🔒</span>
                        <span>安全登录</span>
                    </div>
                    <div class="feature-item">
                        <span class="feature-icon">🔐</span>
                        <span>数据加密</span>
                    </div>
                    <div class="feature-item">
                        <span class="feature-icon">📚</span>
                        <span>图书管理</span>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <footer>
        <p>©  施琦图书管理系统 - 版权所有</p>
    </footer>

    <script src="{{ url_for('static', filename='js/main.js') }}"></script>
</body>
</html>
