<?php
/** @var array $legalDoc */
/** @var string $legalIcon */
$legalIcon=$legalIcon??'📄';
$legalBack=$legalBack??SITE_URL.'/';
?>
<header class="app-header legal-app-header"><a href="<?=esc($legalBack)?>" class="btn-back">← Voltar</a><div class="logo-inline"><span class="logo-main">AURA</span><span class="logo-sub">FARMING</span></div><a class="privacy-center-mini" href="<?=SITE_URL?>/pages/central-privacidade.php">Privacidade</a></header>
<main class="legal-page page-content">
  <section class="legal-hero card card--glow">
    <span class="legal-hero-icon"><?=$legalIcon?></span>
    <div><small>DOCUMENTO LEGAL • VERSÃO <?=esc((string)($legalDoc['version_key']??$legalDoc['version']??'1.0'))?></small><h1><?=esc((string)$legalDoc['title'])?></h1><p><?=esc((string)($legalDoc['summary']??''))?></p></div>
  </section>
  <article class="legal-content card"><?= $legalDoc['content_html'] ?? $legalDoc['body'] ?? '' ?></article>
  <div class="legal-actions"><a class="btn btn-outline-cyan" href="<?=SITE_URL?>/pages/central-privacidade.php">🛡️ CENTRAL DE PRIVACIDADE</a><?php if(isLoggedIn()):?><a class="btn btn-secondary" href="<?=SITE_URL?>/pages/perfil.php">Voltar ao perfil</a><?php endif;?></div>
</main>
