<?php
/** @var \BotGuard\Core\View $this @var \BotGuard\Core\Csrf $csrf @var array $data */
$this->layout('install.layout');
?>
<h2 class="h4 mb-1">License</h2>
<p class="text-secondary small mb-4">Enter your license key to activate. Leave the key blank to install in
    <strong>trial/offline mode</strong> — you can activate later.</p>

<form method="post" action="/install/license" novalidate>
    <?= $csrf->field() ?>
    <div class="mb-3">
        <label class="form-label">License key <span class="text-secondary">(optional)</span></label>
        <input type="text" name="license_key" class="form-control" value="<?= e($data['license_key'] ?? '') ?>"
               placeholder="BG-XXXX-XXXX-XXXX-XXXX">
    </div>
    <div class="row g-3">
        <div class="col-md-6 mb-3">
            <label class="form-label">Registered domain</label>
            <input type="text" name="domain" class="form-control"
                   value="<?= e($data['license_domain'] ?? ($_SERVER['HTTP_HOST'] ?? '')) ?>">
        </div>
        <div class="col-md-6 mb-3">
            <label class="form-label">Customer email</label>
            <input type="email" name="email" class="form-control" value="<?= e($data['license_email'] ?? '') ?>" required>
        </div>
    </div>
    <div class="mb-3">
        <label class="form-label">Company name <span class="text-secondary">(optional)</span></label>
        <input type="text" name="company" class="form-control" value="<?= e($data['license_company'] ?? '') ?>">
    </div>
    <div class="d-flex justify-content-between mt-4">
        <a href="/install/welcome" class="btn btn-outline-secondary">Back</a>
        <button class="btn btn-primary" type="submit">Continue <i class="bi bi-arrow-right"></i></button>
    </div>
</form>
