<?php if (!function_exists('avatar_img')) { @include_once '../../helpers.php'; } ?>
<div class="grid" style="margin-top:40px;max-width:480px;margin-left:auto;margin-right:auto">
  <?php if($m = flash('error')): ?>
    <div class="alert alert-error">
      <i class="fas fa-exclamation-circle"></i>
      <div><?php echo h($m); ?></div>
    </div>
  <?php endif; ?>
  
  <?php if($m = flash('success')): ?>
    <div class="alert alert-success">
      <i class="fas fa-check-circle"></i>
      <div><?php echo h($m); ?></div>
    </div>
  <?php endif; ?>
  
  <form class="card" method="post">
<?= csrf_field() ?>

    <h2 style="margin-top:0"><i class="fas fa-key"></i> Recuperar contraseña</h2>
    <div class="muted" style="margin-bottom:16px">Ingresa tu email y te enviaremos instrucciones para resetear tu contraseña.</div>
    
    <div class="grid">
      <div>
        <label for="email" style="display:block;margin-bottom:8px;font-weight:500">Email</label>
        <input id="email" name="email" placeholder="tu@email.com" type="email" required>
      </div>
      
      <button class="btn primary" type="submit"><i class="fas fa-paper-plane"></i> Enviar instrucciones</button>
    </div>
  </form>
  
  <div class="muted" style="margin-top:16px;text-align:center">
    <p>¿Recordaste tu contraseña? <a href="./?r=login" style="color:var(--accent);">Inicia sesión aquí</a></p>
  </div>
</div>