{% extends 'base.html' %}
{% block title %}登录{% endblock %}
{% block content %}
<div class="row justify-content-center">
  <div class="col-md-6">
    <h3 class="mb-3">登录</h3>
    <form method="post">
      {% csrf_token %}
      <div class="mb-3">
        <label class="form-label">用户名或邮箱</label>
        {{ form.login }}
      </div>
      <div class="mb-3">
        <label class="form-label">密码</label>
        {{ form.password }}
      </div>
      {% if captcha_question %}
      <div class="mb-3">
        <label class="form-label">验证码：<span class="text-primary">{{ captcha_question }}</span></label>
        {{ form.captcha }}
      </div>
      {% endif %}
      <div class="d-flex gap-2">
        <button class="btn btn-primary" type="submit">登录</button>
        <a class="btn btn-outline-secondary" href="{% url 'accounts:register' %}">注册</a>
        <a class="btn btn-outline-info" href="{% url 'accounts:password_change' %}">修改密码</a>
      </div>
    </form>
  </div>
  </div>
{% endblock %}