<?php $pageTitle = 'Two-Factor Authentication'; ?>
<div class="auth-card">
  <div class="auth-logo">
    <div class="logo" style="background:#2563eb;font-size:22px">🔐</div>
    <h1>Verify Identity</h1>
    <p>Enter the 6-digit code sent to your email</p>
  </div>
  <?php $err = \Core\Session::getFlash('errors'); if($err): ?>
  <div class="alert alert-danger"><?= htmlspecialchars(array_values($err)[0][0] ?? '') ?></div>
  <?php endif; ?>
  <form method="POST" action="<?= \Core\View::url('2fa') ?>">
    <?= \Core\View::csrf() ?>
    <div class="form-group">
      <label>Verification Code</label>
      <div class="input-wrap">
        <i class="bi bi-shield-check"></i>
        <input type="text" name="code" placeholder="000000" maxlength="6" pattern="\d{6}" required autofocus
          style="letter-spacing:8px;font-size:20px;text-align:center;padding-left:13px">
      </div>
    </div>
    <button type="submit" class="btn-login">Verify &amp; Login</button>
  </form>
  <p style="text-align:center;margin-top:16px;font-size:13px;color:#6b7280">
    <a href="<?= \Core\View::url('login') ?>" style="color:#1a7f5a">← Back to Login</a>
  </p>
</div>
