<?php
    /**
     * @var \App\View\AppView        $this
     * @var \Icing\Model\Entity\User $user
     */

    $this->assign('title', 'Sign In');
    $this->setLayout('blank');

?>

<div class="row align-items-center justify-content-center vh-100">
    <div
        class="col-11 col-sm-8 col-md-6 col-lg-5 col-xl-4 col-xxl-3 py-6"
        style="margin-bottom: 10%"
    >

        <!-- Title -->
        <h1 class="mb-2 text-center">
            Sign In
        </h1>

        <!-- Form -->
        <?= $this->Form->create(null, ['url' => $this->Url->build('Icing.Auth::login')]) ?>

        <div class="row">
            <div class="col-12">
                <div class="mb-4">
                    <label class="form-label">
                        Email Address
                    </label>

                    <input
                        type="email"
                        name="email"
                        placeholder="Your Email Address"
                        class="form-control"
                        autocomplete="off"
                    >
                </div>
            </div>

            <div class="col-12">
                <div class="mb-4">

                    <div class="row">
                        <div class="col">
                            <label class="form-label">
                                Password
                            </label>
                        </div>

                        <div class="col-auto">
                            <!-- Help text -->
                            <a
                                href="<?= $this->Url->build(['action' => 'passwordRecovery']) ?>"
                                class="form-text small text-muted link-primary"
                            >Forgot password
                            </a>
                        </div>
                    </div>

                    <div class="input-group input-group-merge">

                        <input
                            name="password"
                            type="password"
                            class="form-control"
                            autocomplete="off"
                            data-toggle-password-input
                            placeholder="Your password"
                        >

                        <button
                            type="button"
                            class="input-group-text px-4 text-secondary link-primary"
                            data-toggle-password
                        >
                        </button>
                    </div>
                </div>
            </div>
        </div>

        <?= $this->Form->control('keep_me_logged_in', [/*'id' => 'lorem-ipsum',*/ 'type' => 'checkbox', 'label' => 'Keep Me Logged In']) ?>

        <div class="row align-items-center text-center">
            <div class="col-12">
                <button
                    type="submit"
                    class="btn w-100 btn-primary mt-6 mb-2"
                >
                    Sign in
                </button>
            </div>

        </div>
        <?= $this->Form->end() ?>
    </div>
</div>
