<?php 
$pageTitle = Lang::get('register') . ' - ' . Lang::get('app_name');
$pageDescription = 'Create your free NotaphilyCatalogue account. Start organizing your banknote and coin collection with our professional cataloging tools. Join collectors worldwide.';
$robotsMeta = 'noindex, follow';
?>
<?php require APP_ROOT . '/views/layouts/header.php'; ?>

<?= Recaptcha::renderScript() ?>

<div class="min-h-[80vh] flex items-center justify-center">
    <div class="w-full max-w-md">
        <div class="bg-white dark:bg-gray-800 rounded-2xl shadow-xl p-8 border border-gray-200 dark:border-gray-700">
            <div class="text-center mb-8">
                <h1 class="text-3xl font-bold text-primary-600 dark:text-primary-400"><?= Lang::get('app_name') ?></h1>
                <p class="text-gray-500 dark:text-gray-400 mt-2"><?= Lang::get('register_welcome') ?></p>
            </div>

            <form method="POST" action="<?= APP_URL ?>/register" onsubmit="executeRecaptcha()">
                <input type="hidden" name="csrf_token" value="<?= Session::getCsrfToken() ?>">
                <?= Recaptcha::renderHiddenInput() ?>

                <div class="mb-4">
                    <label for="username" class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2"><?= Lang::get('username') ?> *</label>
                    <input type="text" id="username" name="username" required
                           class="w-full px-4 py-3 rounded-lg border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100 focus:ring-2 focus:ring-primary-500 focus:border-primary-500 outline-none transition-colors">
                </div>

                <div class="mb-4">
                    <label for="email" class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2"><?= Lang::get('email') ?> *</label>
                    <input type="email" id="email" name="email" required
                           class="w-full px-4 py-3 rounded-lg border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100 focus:ring-2 focus:ring-primary-500 focus:border-primary-500 outline-none transition-colors">
                </div>

                <div class="mb-4">
                    <label for="password" class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2"><?= Lang::get('password') ?> *</label>
                    <input type="password" id="password" name="password" required
                           class="w-full px-4 py-3 rounded-lg border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100 focus:ring-2 focus:ring-primary-500 focus:border-primary-500 outline-none transition-colors">
                </div>

                <div class="mb-6">
                    <label for="confirm_password" class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2"><?= Lang::get('confirm_password') ?> *</label>
                    <input type="password" id="confirm_password" name="confirm_password" required
                           class="w-full px-4 py-3 rounded-lg border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100 focus:ring-2 focus:ring-primary-500 focus:border-primary-500 outline-none transition-colors">
                </div>

                <button type="submit"
                        class="w-full btn-gradient btn-gradient-blue btn-gradient-lg">
                    <?= Lang::get('register_btn') ?>
                </button>
            </form>

            <p class="text-center text-sm text-gray-500 dark:text-gray-400 mt-6">
                <?= Lang::get('have_account') ?>
                <a href="<?= APP_URL ?>/login" class="text-primary-600 dark:text-primary-400 hover:underline font-medium"><?= Lang::get('login_btn') ?></a>
            </p>
        </div>
    </div>
</div>


<?= Recaptcha::renderJavaScript() ?>

<?php require APP_ROOT . '/views/layouts/footer.php'; ?>
