<?php /* Section Carte ISIT (accueil) : carte d'exemple recto/verso */
$taille = 25;
$modules = '';
$graine = md5('ISIT-2026-0001');
for ($l = 0; $l < $taille; $l++) {
    for ($c = 0; $c < $taille; $c++) {
        $dansRepere = ($l < 8 && $c < 8) || ($l < 8 && $c >= $taille - 8) || ($l >= $taille - 8 && $c < 8);
        if ($dansRepere) continue;
        if (hexdec($graine[($l * $taille + $c) % 32]) + $l + $c * 3 & 1) $modules .= "<rect x=\"$c\" y=\"$l\" width=\"1\" height=\"1\"/>";
    }
}
foreach ([[0, 0], [$taille - 7, 0], [0, $taille - 7]] as [$x, $y]) {
    $modules .= "<rect x=\"$x\" y=\"$y\" width=\"7\" height=\"7\"/><rect x=\"" . ($x + 1) . "\" y=\"" . ($y + 1) . "\" width=\"5\" height=\"5\" fill=\"#fff\"/><rect x=\"" . ($x + 2) . "\" y=\"" . ($y + 2) . "\" width=\"3\" height=\"3\"/>";
}
?>
<section id="carte" class="sec sec-carte">
  <div class="wrap carte-grid">
    <div>
      <span class="sur-titre">Carte ISIT</span>
      <h2>Une carte d'étudiant intelligente</h2>
      <p class="sub">Chaque étudiant reçoit à l'inscription sa carte ISIT, avec photo, matricule et filière. Son QR code permet à l'école de vérifier la carte en une seconde, depuis n'importe quel téléphone.</p>
      <ul class="carte-atouts">
        <li class="reveal"><span>📸</span><div><b>Photo et matricule</b><small>Un numéro unique attribué à l'inscription</small></div></li>
        <li class="reveal"><span>🔎</span><div><b>Vérification par QR code</b><small>Contrôle à l'entrée, aux examens et à la bibliothèque</small></div></li>
        <li class="reveal"><span>🖨️</span><div><b>Prête à imprimer</b><small>Format carte bancaire, incluse dans les frais annexes</small></div></li>
      </ul>
      <p class="small" style="margin-top:18px">Le personnel (enseignants, éducateurs, administration) reçoit aussi sa carte professionnelle.</p>
    </div>
    <div class="scene">
      <div class="paquet" id="paquet">
      <div class="carte-perso" aria-hidden="true">
        <span class="face recto">
          <span class="c-bandeau c-bandeau-perso"><img src="/assets/img/logo.jpg" alt=""><span><b>ISIT Groupe</b><small>Carte professionnelle · Personnel</small></span></span>
          <span class="c-corps">
            <span class="c-photo"><svg viewBox="0 0 24 24" fill="currentColor"><path d="M12 12a4.5 4.5 0 1 0-4.5-4.5A4.5 4.5 0 0 0 12 12Zm0 2.2c-3.6 0-8 1.8-8 4.6V21h16v-2.2c0-2.8-4.4-4.6-8-4.6Z"/></svg></span>
            <span class="c-infos">
              <small>Nom et prénoms</small><b>SORO Ibrahim</b>
              <small>Fonction</small><b>Enseignant</b>
              <small>Matricule</small><b class="c-matricule">ISIT-P-0007</b>
            </span>
          </span>
          <span class="c-pagne"></span>
        </span>
      </div>
      <button type="button" class="carte3d" id="carteIsit" aria-label="Carte d'exemple : toucher pour la retourner">
        <span class="face recto">
          <span class="c-bandeau"><img src="/assets/img/logo.jpg" alt=""><span><b>ISIT Groupe</b><small>Carte d'étudiant · 2026-2027</small></span></span>
          <span class="c-corps">
            <span class="c-photo" aria-hidden="true"><svg viewBox="0 0 24 24" fill="currentColor"><path d="M12 12a4.5 4.5 0 1 0-4.5-4.5A4.5 4.5 0 0 0 12 12Zm0 2.2c-3.6 0-8 1.8-8 4.6V21h16v-2.2c0-2.8-4.4-4.6-8-4.6Z"/></svg></span>
            <span class="c-infos">
              <small>Nom et prénoms</small><b>KONÉ Awa Mariam</b>
              <small>Filière</small><b>Finance Comptable</b>
              <small>Matricule</small><b class="c-matricule">ISIT-2026-0001</b>
            </span>
          </span>
          <span class="c-pagne"></span>
        </span>
        <span class="face verso">
          <svg class="c-qr" viewBox="-1 -1 <?= $taille + 2 ?> <?= $taille + 2 ?>" aria-hidden="true"><rect x="-1" y="-1" width="<?= $taille + 2 ?>" height="<?= $taille + 2 ?>" fill="#fff"/><g fill="#14213D"><?= $modules ?></g></svg>
          <span class="c-verso-txt"><b>Carte personnelle</b>Scannez le QR code pour vérifier la validité de la carte. En cas de perte, prévenez le secrétariat.<small>ISIT Groupe · Korhogo · +225 01 02 56 54 07</small></span>
        </span>
        <span class="reflet"></span>
      </button>
      </div>
      <p class="small scene-aide">Exemple · touchez la carte pour la retourner</p>
    </div>
  </div>
</section>
