<?php

declare(strict_types=1);
?>
<div class="darlink-page-heading">
    <div>
        <span class="darlink-page-kicker">Sécurisation finale</span>
        <h2>Finaliser l’installation</h2>
        <p>
            Cette opération crée le rapport, verrouille l’assistant
            et nettoie les données temporaires.
        </p>
    </div>

    <div class="darlink-readiness is-ready">
        <i class="bi bi-shield-lock-fill"></i>
        <div>
            <strong>Prêt à verrouiller</strong>
            <span>L’installation technique est terminée.</span>
        </div>
    </div>
</div>

<?php if (!empty($finalizationError)): ?>
    <div class="darlink-notice darlink-notice-danger">
        <i class="bi bi-x-circle-fill"></i>
        <span><?= htmlspecialchars((string)$finalizationError, ENT_QUOTES, 'UTF-8') ?></span>
    </div>
<?php endif; ?>

<div class="darlink-notice darlink-notice-warning">
    <i class="bi bi-exclamation-triangle-fill"></i>
    <span>
        Après validation, l’assistant sera verrouillé par
        <code>storage/install.lock</code>.
    </span>
</div>

<form method="post" action="index.php?step=8" class="darlink-install-form">
    <label class="darlink-confirmation-item">
        <input type="checkbox" name="confirm_finalization" value="1" required>
        <span>Je confirme vouloir finaliser et verrouiller l’installation.</span>
    </label>

    <div class="darlink-install-actions">
        <a href="index.php?step=7" class="btn darlink-install-btn-secondary">
            <i class="bi bi-arrow-left me-2"></i>Retour
        </a>

        <button type="submit" class="btn darlink-install-btn-primary">
            <i class="bi bi-lock-fill me-2"></i>Finaliser l’installation
        </button>
    </div>
</form>
