<?= $this->layout('_layout', ['title' => $title]); ?>

<main class="main">
    <?= $this->insert('includes/aside_info') ?>
    <div class="content">
        <div class="h2-title h2-title-content flex-s-c">
            <span>Register</span>
        </div>

        <form action="<?= __redirect("auth/register") ?>" method="post">
            <?= __csrf(); ?>
            <div class="fields">
                <div class="fieldGroup">
                    <span>Name</span>
                    <input type="text" name="name" required autocomplete="off" maxlength="10">
                </div>
                <div class="fieldGroup">
                    <span>User</span>
                    <input type="text" name="user" required autocomplete="off" maxlength="10" style="text-transform: lowercase;" oninput="this.value = this.value.toLowerCase();">

                </div>
                <div class="fieldGroup">
                    <span>Password</span>
                    <input type="password" name="passwd" required autocomplete="off" maxlength="10">
                </div>
                <div class="fieldGroup">
                    <span>Re Password</span>
                    <input type="password" name="repasswd" required autocomplete="off" maxlength="10">
                </div>
                <div class="fieldGroup">
                    <span>Mail</span>
                    <input type="text" name="email" required autocomplete="off">
                </div>
                <div class="fieldGroup">
                    <span>Re Mail</span>
                    <input type="text" name="reemail" required autocomplete="off">
                </div>
                <div class="fieldGroup">
                    <span>Personal ID</span>
                    <input type="text" name="pid" required autocomplete="off" maxlength="7">
                </div>

                <div class="terms-use">
                    <input type="checkbox" name="terms" id="terms" required>
                    <label for="terms">
                        I accept the terms of use
                    </label>
                </div>

                <?php if ($idRef) : ?>
                    <input type="hidden" name="id_ref" value="<?= $idRef ?>">
                <?php endif ?>

                <div class="enter flex-s-c">
                    <button type="submit" class="big-button-blue">Confirm Register</button>
                </div>
            </div>
        </form>

    </div>
</main>