{% extends 'hosting_app/base_hosting.html' %}

{% block title %}Reset Hosting Partner Password | Host in Sri Lanka{% endblock %}

{% block content %}

<style>
    .hosting-reset-hero {
        position: relative;
        min-height: 100vh;
        padding: 6rem 0;
        background:
            radial-gradient(circle at top left, rgba(255, 193, 7, 0.20), transparent 34%),
            radial-gradient(circle at bottom right, rgba(138, 57, 45, 0.20), transparent 32%),
            linear-gradient(135deg, #2d1716 0%, #743129 52%, #a7601b 100%);
        color: #fff;
        overflow: hidden;
    }

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

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

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

    .hosting-reset-hero .section-mini-title {
        display: inline-block;
        background: rgba(255, 255, 255, 0.16);
        color: #ffe7aa;
        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;
    }

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

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

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

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

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

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

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

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

    .hosting-reset-card-header {
        background: linear-gradient(135deg, #ffffff 0%, #fff4e4 100%);
        padding: 28px 32px;
        color: #2f1d18;
        text-align: center;
        border-bottom: 1px solid #efe2d3;
    }

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

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

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

    .hosting-reset-card-body .form-label {
        color: #2f1d18;
        font-weight: 700;
    }

    .hosting-reset-card-body .form-control {
        border-radius: 15px;
        border: 1px solid #eadbc9;
        padding: 0.78rem 0.95rem;
        box-shadow: none;
        color: #2f1d18;
        background: #fffaf5;
    }

    .hosting-reset-card-body .form-control:focus {
        border-color: #a7601b;
        box-shadow: 0 0 0 0.22rem rgba(167, 96, 27, 0.14);
        background: #ffffff;
    }

    .hosting-reset-submit-btn {
        background: linear-gradient(135deg, #321816, #a7601b);
        border: none;
        border-radius: 48px;
        padding: 0.85rem 1rem;
        font-weight: 800;
        box-shadow: 0 16px 32px rgba(167, 96, 27, 0.24);
        color: #fff;
    }

    .hosting-reset-submit-btn:hover {
        background: linear-gradient(135deg, #4b211d, #bd741f);
        color: #fff;
    }

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

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

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

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

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

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

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

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

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

<section class="hosting-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">Hosting Partner Recovery</span>

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

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

                <div class="hosting-reset-info-list">
                    <div class="hosting-reset-info-item">
                        <i class="bi bi-shield-lock-fill"></i>
                        <span>Secure recovery for Hosting Partner accounts</span>
                    </div>

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

                    <div class="hosting-reset-info-item">
                        <i class="bi bi-building-heart"></i>
                        <span>Return safely to your hosting partner dashboard</span>
                    </div>
                </div>

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


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

                    <div class="hosting-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="hosting-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="hosting-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 Hosting Partner email"
                            >

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

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

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

                            <a href="{% url 'hosting_app:host_login' %}"
                               class="btn btn-outline-primary w-100">
                                Back to Hosting Partner Sign In
                            </a>
                        </div>
                    </form>

                </div>
            </div>

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

{% endblock %}