<!DOCTYPE html>
<html lang="ja">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="{{ url_for('static', filename='style.css') }}">
    <title>Login and Registration</title>
</head>
<body>
    <div class="container">
        <h2>ログイン</h2>
        {% if login_message %}
            <p class="error">{{ login_message }}</p>
        {% endif %}
        <form method="POST" action="{{ url_for('login') }}">
            <label for="username">ユーザー名:</label>
            <input type="text" id="username" name="username" required>
            <label for="password">パスワード:</label>
            <input type="password" id="password" name="password" required>
            <button type="submit">ログイン</button>
        </form>

        <h2>新規登録</h2>
        {% if registration_message %}
            <p class="error">{{ registration_message }}</p>
        {% endif %}
        <form method="POST" action="{{ url_for('register') }}">
            <label for="new_username">新しいユーザー名:</label>
            <input type="text" id="new_username" name="new_username" required>
            <label for="new_password">新しいパスワード:</label>
            <input type="password" id="new_password" name="new_password" required>
            <!-- 新しい名前の入力欄を追加 -->
            <label for="new_name">名前:</label>
            <input type="text" id="new_name" name="new_name" required>
            <button type="submit">新規登録</button>
        </form>
    </div>
</body>
</html>
