<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <title>{{ BRAND_NAME }} · Verify email</title>
  <script>
    (function() {
      try { document.documentElement.dataset.theme = localStorage.getItem('cassandra.theme') || 'light'; }
      catch (e) { document.documentElement.dataset.theme = 'light'; }
    })();
  </script>
  <link rel="stylesheet" href="{{ url_for('static', path='/css/tokens.css') }}?v={{ ASSET_VERSION }}" />
  <link rel="stylesheet" href="{{ url_for('static', path='/css/layout.css') }}?v={{ ASSET_VERSION }}" />
  <link rel="stylesheet" href="{{ url_for('static', path='/css/auth.css') }}?v={{ ASSET_VERSION }}" />
</head>
<body>
<div class="auth-shell">
  <div class="auth-card">
    <div class="auth-card__brand">{{ BRAND_NAME }}</div>
    <div class="auth-card__hint">verify your email</div>

    <p class="auth-card__lede">
      We sent a {{ ttl_minutes }}-minute code to <strong>{{ email }}</strong>.
      Enter the 6 digits below to finish signing in.
    </p>

    {% if error %}<div class="auth-error">{{ error }}</div>{% endif %}
    {% if sent %}<div class="auth-info">{{ sent }}</div>{% endif %}

    <form method="post" action="/verify" autocomplete="off">
      <label>Verification code
        <input type="text" name="code" inputmode="numeric" pattern="[0-9]{6}"
               minlength="6" maxlength="6" required autofocus>
      </label>
      <button type="submit">Verify</button>
    </form>

    <form method="post" action="/verify/resend" style="margin-top:0.75rem;">
      <button type="submit" class="auth-card__resend">Resend code</button>
    </form>

    <div class="auth-card__alt">
      Wrong email? <a href="/logout">Start over →</a>
    </div>
  </div>
</div>
</body>
</html>
