{% extends "base.html" %}

{% block title %}Setup 2FA - Finance Tracker{% endblock %}

{% block content %}
<div class="auth-container">
    <div class="glass-card auth-card">
        <h1>🔐 Setup Two-Factor Authentication</h1>
        <p class="subtitle">Scan this QR code with your authenticator app</p>
        
        <div class="qr-container">
            <img src="data:image/png;base64,{{ qr_code }}" alt="QR Code" class="qr-code">
        </div>
        
        <div class="secret-container">
            <p><strong>Manual Entry Key:</strong></p>
            <code class="secret-key">{{ secret }}</code>
        </div>
        
        <p class="info-text">Use Google Authenticator, Authy, or any TOTP app</p>
        
        <form method="POST" action="{{ url_for('auth.verify_2fa') }}" class="auth-form">
            <input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
            
            <div class="form-group">
                <label for="token">Enter 6-digit code</label>
                <input type="text" id="token" name="token" required pattern="[0-9]{6}" maxlength="6" autofocus>
            </div>
            
            <button type="submit" class="btn btn-primary">Verify & Complete Setup</button>
        </form>
    </div>
</div>
{% endblock %}
