{% extends "base.html" %}
{% block title %}Entrar — Frota Trucks{% endblock %}
{% block body %}
<main>
  <div class="card form-narrow">
    <h2 style="margin-top:0">Entrar</h2>

    <form method="post" action="/api/login">
      <label for="username">Usuário</label>
      <input type="text" id="username" name="username" value="{{ username or '' }}" required style="width:100%">

      <label for="password">Senha</label>
      <input type="password" id="password" name="password" required style="width:100%">

      <div style="margin-top:18px">
        <button type="submit">Entrar</button>
      </div>
    </form>

    {% if error %}<div class="error">{{ error }}</div>{% endif %}
  </div>
</main>
{% endblock %}
