{% extends 'expat_life/base.html' %}

{% block title %}Reset Guest Password | Live in Sri Lanka{% endblock %}

{% block content %}

<style>
    .guest-reset-hero {
        position: relative;
        min-height: 100vh;
        padding: 6rem 0;
        background:
            radial-gradient(circle at top left, rgba(255, 193, 7, 0.14), transparent 34%),
            radial-gradient(circle at bottom right, rgba(32, 201, 151, 0.16), transparent 32%),
            linear-gradient(
                135deg,
                #07131c 0%,
                #0b3d91 52%,
                #0f766e 100%
            );
        color: #fff;
        overflow: hidden;
    }

    .guest-reset-hero::before {
        content: "";
        position: absolute;
        inset: 0;
        background:
            linear-gradient(120deg, rgba(255, 255, 255, 0.07), transparent 35%),
            radial-gradient(circle at 80% 10%, rgba(255, 193, 7, 0.10), transparent 28%);
        pointer-events: none;
    }

    .guest-reset-hero::after {
        content: "";
        position: absolute;
        right: -160px;
        bottom: -180px;
        width: 480px;
        height: 480px;
        border-radius: 50%;
        background: rgba(255, 193, 7, 0.08);
        pointer-events: none;
    }

    .guest-reset-hero .container {
        position: relative;
        z-index: 2;
    }

    .guest-reset-hero .section-mini-title {
        display: inline-flex;
        align-items: center;
        gap: 0.45rem;
        background: rgba(255, 193, 7, 0.16);
        color: #ffd36b;
        border: 1px solid rgba(255, 193, 7, 0.32);
        font-weight: 900;
        font-size: 0.78rem;
        text-transform: uppercase;
        letter-spacing: 0.075em;
        padding: 7px 15px;
        border-radius: 999px;
        margin-bottom: 16px;
        backdrop-filter: blur(10px);
    }

    .guest-reset-hero .section-mini-title::before {
        content: "";
        width: 7px;
        height: 7px;
        border-radius: 50%;
        background: #ffc107;
        box-shadow: 0 0 0 5px rgba(255, 193, 7, 0.14);
    }

    .guest-reset-hero h1 {
        color: #fff;
        font-size: clamp(2.35rem, 4.2vw, 4.1rem);
        font-weight: 900;
        letter-spacing: -0.045em;
        line-height: 1.06;
    }

    .guest-reset-hero .lead {
        color: rgba(255, 255, 255, 0.86) !important;
        font-size: 1.12rem;
        line-height: 1.8;
    }

    .guest-reset-info-list {
        margin: 24px 0 20px;
    }

    .guest-reset-info-item {
        display: flex;
        align-items: center;
        gap: 12px;
        margin-bottom: 14px;
        font-size: 1rem;
        color: rgba(255, 255, 255, 0.92);
        font-weight: 600;
    }

    .guest-reset-info-item i {
        color: #ffd36b;
        font-size: 1.2rem;
    }

    .guest-reset-note-box {
        background: rgba(255, 251, 235, 0.13);
        border-left: 4px solid #ffc107;
        color: rgba(255, 255, 255, 0.92);
        padding: 16px 20px;
        border-radius: 16px;
        display: flex;
        gap: 12px;
        align-items: flex-start;
        line-height: 1.65;
    }

    .guest-reset-note-box i {
        color: #ffc107;
        font-size: 1.3rem;
        margin-top: 2px;
    }

    .guest-reset-card {
        background: rgba(255, 255, 255, 0.98);
        border-radius: 32px;
        box-shadow: 0 28px 70px rgba(0, 0, 0, 0.24);
        overflow: hidden;
        border: 1px solid rgba(255, 255, 255, 0.35);
    }

    .guest-reset-card-header {
        background:
            radial-gradient(circle at top right, rgba(255, 193, 7, 0.12), transparent 34%),
            linear-gradient(135deg, #ffffff 0%, #f5f9ff 100%);
        padding: 28px 32px;
        color: #102033;
        text-align: center;
        border-bottom: 1px solid rgba(13, 110, 253, 0.10);
    }

    .guest-reset-card-header h3 {
        margin: 0;
        font-weight: 900;
        color: #102033;
        letter-spacing: -0.025em;
    }

    .guest-reset-card-header p {
        color: #64748b !important;
        font-size: 0.92rem;
        margin-top: 8px;
        margin-bottom: 0;
    }

    .guest-reset-card-body {
        padding: 32px;
    }

    .guest-reset-card-body .form-label {
        color: #102033;
        font-weight: 700;
    }

    .guest-reset-card-body .form-control {
        border-radius: 15px;
        border: 1px solid #cbd5e1;
        padding: 0.78rem 0.95rem;
        box-shadow: none;
        color: #102033;
    }

    .guest-reset-card-body .form-control:focus {
        border-color: #0d6efd;
        box-shadow: 0 0 0 0.22rem rgba(13, 110, 253, 0.12);
    }

    .guest-reset-submit-btn {
        background: linear-gradient(135deg, #07131c, #0d6efd);
        border: none;
        border-radius: 48px;
        padding: 0.85rem 1rem;
        font-weight: 800;
        color: #ffffff;
        box-shadow: 0 16px 32px rgba(13, 110, 253, 0.22);
    }

    .guest-reset-submit-btn:hover {
        background: linear-gradient(135deg, #07131c, #0f766e);
        color: #ffffff;
    }

    .guest-reset-footer {
        border-top: 1px solid #e9ecef;
        padding-top: 24px;
        margin-top: 8px;
        text-align: center;
    }

    .guest-reset-footer .btn-outline-primary {
        border: 2px solid #0d6efd;
        color: #0d6efd;
        font-weight: 700;
        border-radius: 48px;
        padding: 10px;
        background: #ffffff;
    }

    .guest-reset-footer .btn-outline-primary:hover {
        background: #0d6efd;
        color: #fff;
        border-color: #0d6efd;
    }

    .guest-form-error {
        background: #fef2f2;
        border: 1px solid #fecaca;
        color: #991b1b;
        border-radius: 18px;
        padding: 14px 16px;
        margin-bottom: 18px;
        font-weight: 600;
    }

    .guest-field-error {
        color: #b91c1c;
        font-size: 0.88rem;
        font-weight: 600;
        margin-top: 6px;
    }

    @media (max-width: 768px) {
        .guest-reset-hero {
            padding: 4rem 0;
        }

        .guest-reset-card-body {
            padding: 24px;
        }

        .guest-reset-card-header {
            padding: 22px 20px;
        }

        .guest-reset-card {
            border-radius: 26px;
        }
    }
</style>

<section class="guest-reset-hero">
    <div class="container">
        <div class="row align-items-center g-5 justify-content-center">

            <!-- LEFT CONTENT -->
            <div class="col-lg-5">
                <span class="section-mini-title">Guest Account Recovery</span>

                <h1 class="fw-bold mb-3">
                    Reset Your Guest Password
                </h1>

                <p class="lead text-muted mb-4">
                    Enter the email address linked to your Live in Sri Lanka Guest account.
                    If it matches a registered account, password reset instructions will be sent.
                </p>

                <div class="guest-reset-info-list">
                    <div class="guest-reset-info-item">
                        <i class="bi bi-shield-lock-fill"></i>
                        <span>Secure password recovery for Guest accounts</span>
                    </div>

                    <div class="guest-reset-info-item">
                        <i class="bi bi-envelope-check-fill"></i>
                        <span>Reset instructions are delivered by email</span>
                    </div>

                    <div class="guest-reset-info-item">
                        <i class="bi bi-airplane-fill"></i>
                        <span>Return safely to your Sri Lanka living journey</span>
                    </div>
                </div>

                <div class="guest-reset-note-box mt-4">
                    <i class="bi bi-info-circle-fill"></i>
                    <div>
                        This reset form is intended only for registered
                        <strong>Guest accounts</strong> in the Live in Sri Lanka platform.
                    </div>
                </div>
            </div>


            <!-- RESET FORM -->
            <div class="col-lg-5">
                <div class="guest-reset-card shadow-lg">

                    <div class="guest-reset-card-header">
                        <h3 class="fw-bold mb-2">Request Password Reset</h3>
                        <p>
                            We will email reset instructions where applicable.
                        </p>
                    </div>

                    <form method="post" class="guest-reset-card-body">
                        {% csrf_token %}

                        {% if messages %}
                            {% for message in messages %}
                                <div class="alert alert-{{ message.tags|default:'info' }} rounded-4 mb-3">
                                    {{ message }}
                                </div>
                            {% endfor %}
                        {% endif %}

                        {% if form.non_field_errors %}
                            <div class="guest-form-error">
                                {{ form.non_field_errors }}
                            </div>
                        {% endif %}

                        <div class="mb-4">
                            <label for="{{ form.email.id_for_label }}" class="form-label">
                                Email Address
                            </label>

                            <input
                                type="email"
                                name="{{ form.email.html_name }}"
                                id="{{ form.email.id_for_label }}"
                                class="form-control"
                                autocomplete="email"
                                required
                                value="{{ form.email.value|default_if_none:'' }}"
                                placeholder="Enter your registered Guest email"
                            >

                            {% if form.email.errors %}
                                <div class="guest-field-error">
                                    {{ form.email.errors|striptags }}
                                </div>
                            {% endif %}
                        </div>

                        <button type="submit" class="btn btn-dark btn-lg w-100 guest-reset-submit-btn">
                            <i class="bi bi-send-fill me-2"></i>
                            Send Reset Instructions
                        </button>

                        <div class="guest-reset-footer mt-4">
                            <p class="small text-muted mb-2">
                                Remembered your password?
                            </p>

                            <a href="{% url 'expat_life:foreigner_login' %}"
                               class="btn btn-outline-primary w-100">
                                Back to Guest Sign In
                            </a>
                        </div>
                    </form>

                </div>
            </div>

        </div>
    </div>
</section>

{% endblock %}