<?= $this->extend('layouts/guest') ?>

<?= $this->section('content') ?>
<?php
$company = company_profile();
$brandLogoUrl = company_brand_asset_url('logo');
?>
<section class="login-card">
    <div class="login-brand">
        <?php if ($brandLogoUrl): ?>
            <img src="<?= esc($brandLogoUrl) ?>" alt="<?= esc($company['name']) ?>" class="brand-logo brand-logo-login">
        <?php endif; ?>
        <div>
            <h1><?= esc($company['name']) ?></h1>
            <p>Acceso administrativo</p>
        </div>
    </div>

    <?= $this->include('partials/flash') ?>

    <form method="post" action="<?= site_url('login') ?>" class="stack-md">
        <?= csrf_field() ?>

        <div>
            <label for="email">Correo</label>
            <input id="email" name="email" type="email" value="<?= esc(old('email')) ?>" required>
        </div>

        <div>
            <label for="password">Contraseña</label>
            <input id="password" name="password" type="password" required>
        </div>

        <button class="btn btn-primary btn-block" type="submit">Entrar</button>
    </form>

    <div class="login-hint">
        <span>Acceso privado</span>
        <strong>Ingresa con tu usuario administrador</strong>
    </div>
</section>
<?= $this->endSection() ?>
