<?php use App\Core\Csrf; ?>
<link rel="stylesheet" href="/public/assets/css/axiom-ui.css">
<link rel="stylesheet" href="/public/assets/css/axiom-identity.css">
<main class="axiom-identity">
 <div class="axiom-page-nav"><div class="axiom-page-nav__trail"><a href="/public/administration/axiom">AXIOM Studio</a><span>›</span><a href="/public/administration/axiom/identites">Identity Engine</a><span>›</span><strong>Nouvelle identité</strong></div><div class="axiom-page-nav__actions"><a class="axiom-btn-back" href="/public/administration/axiom/identites">← Retour aux identités</a></div></div>
 <header class="identity-hero compact"><div><span class="identity-kicker">CRÉATION</span><h2>Nouvelle identité</h2></div><a class="btn-back" href="/public/administration/axiom/identites">← Retour</a></header>
 <form class="identity-form" method="post" action="/public/administration/axiom/identites/enregistrer"><?= Csrf::field() ?>
  <section><h3>Type et identité</h3><div class="form-grid"><label>Type<select name="type_identite" id="identity-type"><option value="personne">Personne</option><option value="organisation">Organisation</option></select></label><label class="person-field">Civilité<select name="civilite"><option value="">Non renseignée</option><option>Mme</option><option>M.</option></select></label><label class="person-field">Nom *<input name="nom"></label><label class="person-field">Prénom<input name="prenom"></label><label class="person-field">Date de naissance<input type="date" name="date_naissance"></label><label class="organisation-field">Raison sociale *<input name="raison_sociale"></label><label>Identifiant externe<input name="identifiant_externe" placeholder="Code adhérent, matricule…"></label></div></section>
  <section><h3>Coordonnées</h3><div class="form-grid"><label>Email<input type="email" name="email"></label><label>Téléphone<input name="telephone"></label><label class="wide">Adresse<input name="ligne1"></label><label class="wide">Complément<input name="ligne2"></label><label>Code postal<input name="code_postal"></label><label>Ville<input name="ville"></label><label>Pays<input name="pays" value="France"></label></div></section>
  <section><h3>Rôles</h3><div class="role-grid"><?php foreach(['adherent'=>'Adhérent','parent'=>'Parent / responsable','professeur'=>'Professeur','intervenant'=>'Intervenant','salarie'=>'Salarié','benevole'=>'Bénévole','partenaire'=>'Partenaire','contact'=>'Contact'] as $code=>$label): ?><label><input type="checkbox" name="roles[]" value="<?= $code ?>"> <?= $label ?></label><?php endforeach; ?></div></section>
  <section><h3>Notes</h3><textarea name="notes" rows="4"></textarea></section>
  <div class="form-actions"><a class="btn-back" href="/public/administration/axiom/identites">Annuler</a><button class="btn-primary">Enregistrer l’identité</button></div>
 </form>
</main>
<script>const t=document.getElementById('identity-type');function toggle(){document.querySelectorAll('.person-field').forEach(e=>e.style.display=t.value==='personne'?'flex':'none');document.querySelectorAll('.organisation-field').forEach(e=>e.style.display=t.value==='organisation'?'flex':'none')}t.addEventListener('change',toggle);toggle();</script>
