{% extends 'base.html' %}

{% block content %}
<div class="row justify-content-center align-items-center" style="min-height: 70vh;">
    <div class="col-md-6 text-center mb-5">
        <h1 class="display-3 fw-bold mb-4">Bem-vindo ao <span class="text-info">Futuro</span></h1>
        <p class="lead text-secondary">Acesse os melhores jogos gerados por IA. Gere seu código de acesso único e comece a jogar agora.</p>
    </div>
    <div class="col-md-5">
        <div class="glass-card shadow-lg">
            <ul class="nav nav-pills mb-4 justify-content-center" id="authTab" role="tablist">
                <li class="nav-item" role="presentation">
                    <button class="nav-link active" id="generate-tab" data-bs-toggle="pill" data-bs-target="#generate" type="button">Gerar Novo Código</button>
                </li>
                <li class="nav-item" role="presentation">
                    <button class="nav-link" id="recover-tab" data-bs-toggle="pill" data-bs-target="#recover" type="button">Recuperar Código</button>
                </li>
            </ul>
            <div class="tab-content" id="authTabContent">
                <div class="tab-pane fade show active" id="generate" role="tabpanel">
                    <form action="{% url 'generate_code' %}" method="POST">
                        {% csrf_token %}
                        <div class="mb-4">
                            <label class="form-label">Número de Telefone (Opcional para recuperação)</label>
                            <input type="text" name="phone" class="form-control bg-dark text-white border-secondary" placeholder="+55 11 99999-9999">
                        </div>
                        <button type="submit" class="btn btn-primary w-100 py-3 rounded-pill">GERAR MEU ACESSO</button>
                    </form>
                </div>
                <div class="tab-pane fade" id="recover" role="tabpanel">
                    <form action="{% url 'recover_code' %}" method="POST">
                        {% csrf_token %}
                        <div class="mb-4">
                            <label class="form-label">Digite seu Telefone Vinculado</label>
                            <input type="text" name="phone" class="form-control bg-dark text-white border-secondary" required placeholder="+55 11 99999-9999">
                        </div>
                        <button type="submit" class="btn btn-outline-info w-100 py-3 rounded-pill">RECUPERAR CÓDIGO</button>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
{% endblock %}
