{% extends 'expat_life/base.html' %}
{% block title %}Foreigner Sign In{% endblock %}

{% block content %}

<section class="login-hero py-5">
    <div class="container">
        <div class="row align-items-center g-5 justify-content-center">
            <div class="col-lg-5">
                <span class="section-mini-title">Account Access</span>
                <h1 class="fw-bold mb-3">Foreigner Sign In</h1>
                <p class="lead text-muted mb-4">
                    Sign in to access your foreigner dashboard, view your profile, and manage your approved access areas.
                </p>

                <div class="login-info-list">
                    <div class="login-info-item">
                        <i class="bi bi-check-circle-fill"></i>
                        <span>Access your dashboard</span>
                    </div>
                    <div class="login-info-item">
                        <i class="bi bi-check-circle-fill"></i>
                        <span>View consultation progress</span>
                    </div>
                    <div class="login-info-item">
                        <i class="bi bi-check-circle-fill"></i>
                        <span>Access private approved areas</span>
                    </div>
                </div>

                <div class="login-note-box mt-4">
                    <i class="bi bi-info-circle-fill"></i>
                    <div>
                        This login area is only for users who already have an approved account in the system.
                    </div>
                </div>
            </div>

            <div class="col-lg-5">
                <div class="login-form-card shadow-lg">
                    <div class="login-form-header">
                        <h3 class="fw-bold mb-2">Sign In</h3>
                        <p class="text-muted mb-0">
                            Enter your username and password to continue.
                        </p>
                    </div>

                    <form method="post" class="login-form-body">
                        {% csrf_token %}

                        {% if form.errors %}
                        <div class="alert alert-danger">
                            Invalid username or password. Please try again.
                        </div>
                        {% endif %}

                        <div class="mb-3">
                            <label for="id_username" class="form-label">Username</label>
                            <input type="text" name="username" autofocus required id="id_username" class="form-control">
                        </div>

                        <div class="mb-3">
                            <label for="id_password" class="form-label">Password</label>
                            <input type="password" name="password" required id="id_password" class="form-control">
                        </div>

                        {% if next %}
                        <input type="hidden" name="next" value="{{ next }}">
                        {% endif %}

                        <button type="submit" class="btn btn-dark btn-lg w-100">
                            Sign In
                        </button>
                    </form>
                </div>
            </div>
        </div>
    </div>
</section>

{% endblock %}