{% extends 'Game/index.html.twig' %}

{% block title %} - Two-Factor Authentication{% endblock %}

{% block metas %}
  <meta name="robots" content="noindex,nofollow"/>
  <meta property="og:url" content="{{ app.request.uri }}"/>
  <meta property="og:type" content="website"/>
  <meta property="og:site_name" content="MineSeeker"/>
  <meta property="og:title" content="Two-Factor Authentication · MineSeeker"/>
  <meta property="og:description" content="Verify your identity to access your MineSeeker account."/>
  <meta name="twitter:card" content="summary"/>
  <meta name="twitter:title" content="Two-Factor Authentication · MineSeeker"/>
{% endblock %}

{% block body %}
  <div class="auth-page">
    <div class="auth-card">
      <h2 class="auth-title">Two-Factor Authentication</h2>
      <p class="auth-sub">Enter the 6-digit code from your authenticator app</p>

      {% if authenticationError is defined and authenticationError %}
        <div class="auth-error">
          <i class="fas fa-triangle-exclamation"></i>
          {{ authenticationError|trans({}, 'SchebTwoFactorBundle') }}
        </div>
      {% endif %}

      <form class="auth-form" method="post" action="{{ path('2fa_login_check') }}">

        <div class="auth-field">
          <label for="auth-code" class="auth-label">Authentication Code</label>
          <div class="auth-input-wrap">
            <i class="fas fa-shield auth-input-icon"></i>
            <input
              type="text"
              id="auth-code"
              name="_auth_code"
              class="auth-input auth-input--code"
              inputmode="numeric"
              pattern="[0-9]*"
              maxlength="8"
              autocomplete="one-time-code"
              autofocus
              required
              placeholder="000000"
            />
          </div>
          <p class="auth-field-hint">Or enter one of your backup codes.</p>
        </div>

        <button type="submit" class="auth-submit">
          <i class="fas fa-check"></i> Verify
        </button>
      </form>

      <form method="post" action="{{ path('MineSeekerBundle_logout') }}" class="auth-cancel-standalone">
        <input type="hidden" name="_csrf_token" value="{{ csrf_token('logout') }}"/>
        <button type="submit" class="auth-cancel auth-cancel--block">
          <i class="fas fa-right-from-bracket"></i> Cancel
        </button>
      </form>
    </div>
  </div>
{% endblock %}
