{% extends 'rental_app/base_rental.html' %}

{% block title %}Reset Rental Owner Password | Rent in Sri Lanka{% endblock %}

{% block content %}

<style>
    .rental-reset-hero {
        position: relative;
        min-height: 100vh;
        padding: 6rem 0;
        background:
            radial-gradient(circle at top left, rgba(251, 191, 36, 0.18), transparent 34%),
            radial-gradient(circle at bottom right, rgba(59, 130, 246, 0.16), transparent 32%),
            linear-gradient(135deg, #082f49 0%, #075985 52%, #164e63 100%);
        color: #fff;
        overflow: hidden;
    }

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

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

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

    .rental-reset-hero .section-mini-title {
        display: inline-block;
        background: rgba(255, 255, 255, 0.16);
        color: #fde68a;
        border: 1px solid rgba(255, 255, 255, 0.24);
        font-weight: 800;
        font-size: 0.8rem;
        text-transform: uppercase;
        letter-spacing: 0.06em;
        padding: 6px 14px;
        border-radius: 40px;
        margin-bottom: 16px;
    }

    .rental-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;
    }

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

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

    .rental-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;
    }

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

    .rental-reset-note-box {
        background: rgba(255, 251, 235, 0.14);
        border-left: 4px solid #fde68a;
        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;
    }

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

    .rental-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);
    }

    .rental-reset-card-header {
        background: linear-gradient(135deg, #ffffff 0%, #eff6ff 100%);
        padding: 28px 32px;
        color: #0f172a;
        text-align: center;
        border-bottom: 1px solid #e2e8f0;
    }

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

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

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

    .rental-reset-card-body .form-label {
        color: #0f172a;
        font-weight: 700;
    }

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

    .rental-reset-card-body .form-control:focus {
        border-color: #075985;
        box-shadow: 0 0 0 0.22rem rgba(7, 89, 133, 0.13);
    }

    .rental-reset-submit-btn {
        background: linear-gradient(135deg, #075985, #0f766e);
        border: none;
        border-radius: 48px;
        padding: 0.85rem 1rem;
        font-weight: 800;
        box-shadow: 0 16px 32px rgba(7, 89, 133, 0.24);
    }

    .rental-reset-submit-btn:hover {
        background: linear-gradient(135deg, #0369a1, #0d9488);
    }

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

    .rental-reset-footer .btn-outline-primary {
        border: 2px solid #075985;
        color: #075985;
        font-weight: 700;
        border-radius: 48px;
        padding: 10px;
    }

    .rental-reset-footer .btn-outline-primary:hover {
        background: #075985;
        color: #fff;
        border-color: #075985;
    }

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

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

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

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

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

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

<section class="rental-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">Rental Owner Recovery</span>

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

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

                <div class="rental-reset-info-list">
                    <div class="rental-reset-info-item">
                        <i class="bi bi-shield-lock-fill"></i>
                        <span>Secure recovery for Rental Owner accounts</span>
                    </div>

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

                    <div class="rental-reset-info-item">
                        <i class="bi bi-house-door-fill"></i>
                        <span>Return safely to your property listing dashboard</span>
                    </div>
                </div>

                <div class="rental-reset-note-box mt-4">
                    <i class="bi bi-info-circle-fill"></i>
                    <div>
                        This reset form is only for registered
                        <strong>Rental Owner accounts</strong> in the Rent in Sri Lanka portal.
                    </div>
                </div>
            </div>


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

                    <div class="rental-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="rental-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="rental-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 Rental Owner email"
                            >

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

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

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

                            <a href="{% url 'rental_app:rental_owner_login' %}"
                               class="btn btn-outline-primary w-100">
                                Back to Rental Owner Sign In
                            </a>
                        </div>
                    </form>

                </div>
            </div>

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

{% endblock %}