{% extends 'core/mobile/base_mobile.html' %}
{% block content %}
<div class="p-3">
    <div class="text-center mb-4 mt-4">
        <h3 class="fw-bold">注册账户</h3>
        <p class="text-secondary small">加入 {{ site_settings.site_name|default:"BitCrypto" }}，开启您的交易之旅</p>
    </div>

    {% if messages %}
    <div class="mb-3">
        {% for message in messages %}
        <div class="alert alert-danger py-2 small">{{ message }}</div>
        {% endfor %}
    </div>
    {% endif %}

    <form method="POST" class="glass-card p-4">
        {% csrf_token %}
        <div class="mb-3">
            <label class="form-label small text-secondary">用户名 / 手机号</label>
            <input type="text" name="username" class="form-control" required placeholder="请输入用户名">
        </div>
        <div class="mb-3">
            <label class="form-label small text-secondary">登录密码</label>
            <input type="password" name="password" class="form-control" required placeholder="请输入密码">
        </div>
        <div class="mb-3">
            <label class="form-label small text-secondary">确认密码</label>
            <input type="password" name="password_confirm" class="form-control" required placeholder="请再次输入密码">
        </div>
        <div class="mb-4">
            <label class="form-label small text-secondary">图形验证码</label>
            <div class="input-group">
                <input type="text" name="captcha_input" class="form-control" required placeholder="结果">
                <span class="input-group-text bg-dark text-warning fw-bold">{{ captcha_text }}</span>
            </div>
        </div>
        <button type="submit" class="btn btn-warning w-100 fw-bold py-2 mb-3">立即注册</button>
        <div class="text-center small">
            <span class="text-secondary">已有账户？</span>
            <a href="{% url 'core:login' %}" class="text-warning text-decoration-none">立即登录</a>
        </div>
    </form>
</div>
{% endblock %}