{% extends "base.html" %}

{% block title %}Login - Code of Conquest{% endblock %}

{% block content %}
<div class="auth-container">
    <h1 class="page-title">Login</h1>
    <p class="page-subtitle">Enter the realm, brave adventurer</p>

    <div class="decorative-line"></div>

    <!-- Error display area -->
    {% if error %}
    <div class="error-message">{{ error }}</div>
    {% endif %}

    <form
        id="login-form"
        method="POST"
        action="{{ url_for('auth_views.login') }}"
    >
        <div class="form-group">
            <label class="form-label" for="email">Email Address</label>
            <input
                type="email"
                id="email"
                name="email"
                class="form-input"
                placeholder="adventurer@realm.com"
                required
                autocomplete="email"
            >
        </div>

        <div class="form-group">
            <label class="form-label" for="password">Password</label>
            <input
                type="password"
                id="password"
                name="password"
                class="form-input"
                placeholder="Enter your secret passphrase"
                required
                autocomplete="current-password"
            >
        </div>

        <div class="checkbox-group">
            <input type="checkbox" id="remember_me" name="remember_me" class="checkbox-input">
            <label for="remember_me" class="checkbox-label">Remember me for 30 days</label>
        </div>

        <button type="submit" class="btn btn-primary">
            Enter the Realm
            <span class="htmx-indicator loading-spinner"></span>
        </button>
    </form>

    <div class="form-links">
        <a href="{{ url_for('auth_views.forgot_password') }}" class="form-link">Forgot your password?</a>
        <div class="divider">or</div>
        <a href="{{ url_for('auth_views.register') }}" class="form-link">Don't have an account? Register here</a>
    </div>
</div>
{% endblock %}

{% block scripts %}
{% endblock %}
