<!DOCTYPE html>
<html lang="ja">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>パスワードリセット - Focomy</title>
    <script src="https://cdn.tailwindcss.com"></script>
</head>
<body class="bg-gray-100 min-h-screen flex items-center justify-center">
    <div class="bg-white p-8 rounded-lg shadow-md w-full max-w-md">
        <h1 class="text-2xl font-bold text-center mb-6">新しいパスワードを設定</h1>

        {% if error %}
        <div class="bg-red-100 border border-red-400 text-red-700 px-4 py-3 rounded mb-4">
            {{ error }}
        </div>
        {% endif %}

        <form method="post" action="/admin/reset-password">
            <input type="hidden" name="csrf_token" value="{{ csrf_token }}">
            <input type="hidden" name="token" value="{{ token }}">

            <div class="mb-4">
                <label for="password" class="block text-sm font-medium text-gray-700 mb-1">
                    新しいパスワード
                </label>
                <input
                    type="password"
                    id="password"
                    name="password"
                    required
                    minlength="12"
                    class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"
                    placeholder="12文字以上"
                >
                <p class="text-sm text-gray-500 mt-1">12文字以上で設定してください</p>
            </div>

            <div class="mb-6">
                <label for="password_confirm" class="block text-sm font-medium text-gray-700 mb-1">
                    パスワード（確認）
                </label>
                <input
                    type="password"
                    id="password_confirm"
                    name="password_confirm"
                    required
                    minlength="12"
                    class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"
                    placeholder="もう一度入力"
                >
            </div>

            <button
                type="submit"
                class="w-full bg-blue-600 text-white py-2 px-4 rounded-md hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500"
            >
                パスワードを変更
            </button>
        </form>

        <div class="mt-6 text-center">
            <a href="/admin/login" class="text-blue-600 hover:underline">
                ログインに戻る
            </a>
        </div>
    </div>
</body>
</html>
