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

{% block title %}Change Hosting Client Password{% endblock %}

{% block content %}

<style>
    /* =========================================================
       HOSTING CLIENT CHANGE PASSWORD — PREMIUM
    ========================================================= */

    .hosting-password-page-section {
        min-height: 100vh;
        padding: 4rem 0 5rem;
        background:
            radial-gradient(circle at top left, rgba(255, 193, 7, 0.11), transparent 28%),
            radial-gradient(circle at top right, rgba(138, 57, 45, 0.11), transparent 32%),
            linear-gradient(180deg, #fffaf5 0%, #fff4e8 44%, #ffffff 100%);
    }

    .hosting-password-hero {
        position: relative;
        overflow: hidden;
        border-radius: 38px;
        padding: 2.5rem 2.35rem;
        margin-bottom: 2rem;
        color: #ffffff;
        background:
            radial-gradient(circle at top right, rgba(255, 211, 107, 0.20), transparent 32%),
            linear-gradient(135deg, #2d1716 0%, #743129 56%, #a7601b 100%);
        box-shadow: 0 30px 68px rgba(58, 30, 24, 0.20);
    }

    .hosting-password-hero::before {
        content: "";
        position: absolute;
        top: -110px;
        right: -85px;
        width: 300px;
        height: 300px;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.07);
        pointer-events: none;
    }

    .hosting-password-hero::after {
        content: "";
        position: absolute;
        bottom: -150px;
        left: -110px;
        width: 360px;
        height: 360px;
        border-radius: 50%;
        background: rgba(255, 193, 7, 0.10);
        pointer-events: none;
    }

    .hosting-password-hero-inner {
        position: relative;
        z-index: 2;
    }

    .hosting-password-kicker {
        display: inline-flex;
        align-items: center;
        gap: 0.5rem;
        padding: 0.52rem 1rem;
        border-radius: 999px;
        background: rgba(255, 255, 255, 0.14);
        border: 1px solid rgba(255, 255, 255, 0.22);
        color: #ffe7aa;
        font-size: 0.84rem;
        font-weight: 900;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        margin-bottom: 1rem;
    }

    .hosting-password-hero h1 {
        font-size: clamp(2.1rem, 4vw, 3.35rem);
        font-weight: 950;
        line-height: 1.12;
        letter-spacing: -0.045em;
        margin-bottom: 0.8rem;
    }

    .hosting-password-hero p {
        max-width: 850px;
        margin-bottom: 0;
        color: rgba(255, 255, 255, 0.88);
        font-size: 1.03rem;
        line-height: 1.8;
    }

    .hosting-password-card {
        border: 1px solid rgba(239, 226, 211, 0.95);
        border-radius: 36px;
        box-shadow: 0 24px 56px rgba(58, 30, 24, 0.10);
        overflow: hidden;
        background: rgba(255, 255, 255, 0.98);
        height: 100%;
    }

    .hosting-password-card-header {
        padding: 1.7rem 1.8rem 1.25rem;
        border-bottom: 1px solid #efe2d3;
        background:
            radial-gradient(circle at top right, rgba(183, 106, 31, 0.06), transparent 28%),
            linear-gradient(180deg, #ffffff 0%, #fffaf5 100%);
    }

    .hosting-password-card-header h2 {
        font-weight: 950;
        color: #2f1d18;
        margin-bottom: 0.45rem;
    }

    .hosting-password-card-header p {
        color: #7a655d;
        margin-bottom: 0;
        font-size: 0.98rem;
        line-height: 1.7;
    }

    .hosting-password-card-body {
        padding: 2rem;
    }

    .hosting-form-group-custom {
        margin-bottom: 1.45rem;
    }

    .hosting-form-group-custom label {
        display: block;
        font-weight: 850;
        margin-bottom: 0.55rem;
        color: #2f1d18;
    }

    .hosting-form-group-custom input {
        width: 100%;
        border: 1px solid #eadbc9;
        border-radius: 16px;
        padding: 0.9rem 1rem;
        font-size: 0.96rem;
        background-color: #fffaf5;
        transition: all 0.2s ease;
        color: #2f1d18;
    }

    .hosting-form-group-custom input:focus {
        outline: none;
        border-color: #a7601b;
        box-shadow: 0 0 0 0.22rem rgba(167, 96, 27, 0.14);
        background-color: #fff;
    }

    .hosting-helptext {
        display: block;
        margin-top: 0.48rem;
        color: #7a655d;
        font-size: 0.88rem;
        line-height: 1.6;
    }

    .hosting-password-error {
        color: #dc2626;
        font-size: 0.88rem;
        margin-top: 0.35rem;
        font-weight: 700;
    }

    .hosting-password-note {
        margin-top: 1.6rem;
        border-radius: 22px;
        padding: 1rem 1.1rem;
        background: #fff4e4;
        border: 1px solid #efd7ae;
        color: #8a5418;
        line-height: 1.72;
    }

    .hosting-password-actions {
        margin-top: 1.8rem;
        display: flex;
        flex-wrap: wrap;
        gap: 0.85rem;
    }

    .hosting-password-actions .btn {
        min-height: 52px;
        border-radius: 999px;
        padding: 0.82rem 1.45rem;
        font-weight: 850;
    }

    .hosting-btn-password-save {
        background: linear-gradient(135deg, #321816, #a7601b);
        color: #fff;
        border: none;
    }

    .hosting-btn-password-save:hover {
        color: #fff;
        transform: translateY(-1px);
    }

    .hosting-btn-password-cancel {
        font-weight: 850;
    }

    .hosting-password-alert {
        border-radius: 20px;
        margin-top: 1.4rem;
    }

    /* =========================================================
       SIDE GUIDANCE CARD
    ========================================================= */

    .hosting-password-side-card {
        height: 100%;
        border-radius: 34px;
        background: rgba(255, 255, 255, 0.98);
        border: 1px solid rgba(239, 226, 211, 0.95);
        box-shadow: 0 24px 56px rgba(58, 30, 24, 0.10);
        overflow: hidden;
    }

    .hosting-password-side-header {
        padding: 1.6rem 1.7rem 1.15rem;
        border-bottom: 1px solid #efe2d3;
        background:
            radial-gradient(circle at top right, rgba(255, 193, 7, 0.10), transparent 28%),
            linear-gradient(180deg, #ffffff 0%, #fffaf5 100%);
    }

    .hosting-password-side-header h3 {
        color: #2f1d18;
        font-weight: 950;
        margin-bottom: 0.4rem;
    }

    .hosting-password-side-header p {
        color: #7a655d;
        line-height: 1.7;
        margin-bottom: 0;
    }

    .hosting-password-side-body {
        padding: 1.7rem;
    }

    .hosting-password-tip-list {
        display: grid;
        gap: 0.95rem;
        margin: 0;
        padding: 0;
        list-style: none;
    }

    .hosting-password-tip-item {
        display: flex;
        align-items: flex-start;
        gap: 0.75rem;
        color: #6b564d;
        line-height: 1.68;
    }

    .hosting-password-tip-item i {
        color: #a7601b;
        font-size: 1.05rem;
        margin-top: 0.2rem;
        flex-shrink: 0;
    }

    .hosting-security-highlight {
        margin-top: 1.45rem;
        border-radius: 24px;
        padding: 1.1rem;
        background:
            radial-gradient(circle at top right, rgba(255, 193, 7, 0.10), transparent 34%),
            #fffaf5;
        border: 1px solid #efe2d3;
    }

    .hosting-security-highlight h6 {
        color: #2f1d18;
        font-weight: 950;
        margin-bottom: 0.45rem;
    }

    .hosting-security-highlight p {
        color: #7a655d;
        line-height: 1.68;
        margin-bottom: 0;
        font-size: 0.94rem;
    }

    /* =========================================================
       RESPONSIVE
    ========================================================= */

    @media (max-width: 991.98px) {
        .hosting-password-page-section {
            padding-top: 2.8rem;
        }

        .hosting-password-hero {
            padding: 2rem 1.45rem;
            border-radius: 30px;
        }

        .hosting-password-card-body,
        .hosting-password-card-header,
        .hosting-password-side-header,
        .hosting-password-side-body {
            padding-left: 1.35rem;
            padding-right: 1.35rem;
        }
    }

    @media (max-width: 767.98px) {
        .hosting-password-actions {
            flex-direction: column;
            align-items: stretch;
        }

        .hosting-password-actions .btn {
            width: 100%;
        }
    }
</style>


<section class="hosting-password-page-section">
    <div class="container">

        <!-- =====================================================
             HERO
        ====================================================== -->
        <div class="hosting-password-hero">
            <div class="hosting-password-hero-inner">
                <span class="hosting-password-kicker">
                    <i class="bi bi-shield-lock-fill"></i>
                    Hosting Client Account Security
                </span>

                <h1>Change Password</h1>

                <p>
                    Update your Host in Sri Lanka Hosting Client account password
                    to protect your profile, contact details, hosting requests,
                    quotation history, and future event or venue-related arrangements.
                </p>
            </div>
        </div>


        <div class="row g-4 justify-content-center align-items-stretch">

            <!-- MAIN FORM -->
            <div class="col-lg-7">
                <div class="hosting-password-card">

                    <div class="hosting-password-card-header">
                        <h2>Update Account Password</h2>
                        <p>
                            Enter your current password and choose a stronger new password for your Hosting Client account.
                        </p>
                    </div>

                    <div class="hosting-password-card-body">
                        <form method="post">
                            {% csrf_token %}

                            {% for field in form %}
                                <div class="hosting-form-group-custom">
                                    <label for="{{ field.id_for_label }}">
                                        {{ field.label }}
                                    </label>

                                    {{ field }}

                                    {% if field.help_text %}
                                        <small class="hosting-helptext">
                                            {{ field.help_text|safe }}
                                        </small>
                                    {% endif %}

                                    {% for error in field.errors %}
                                        <div class="hosting-password-error">
                                            {{ error }}
                                        </div>
                                    {% endfor %}
                                </div>
                            {% endfor %}

                            {% if form.non_field_errors %}
                                <div class="alert alert-danger hosting-password-alert">
                                    {% for error in form.non_field_errors %}
                                        <div>{{ error }}</div>
                                    {% endfor %}
                                </div>
                            {% endif %}

                            <div class="hosting-password-note">
                                After changing your password, you will remain signed in on this device,
                                but you should use the new password for future Hosting Client logins.
                            </div>

                            <div class="hosting-password-actions">
                                <button type="submit"
                                        class="btn hosting-btn-password-save">
                                    <i class="bi bi-check-circle-fill me-2"></i>
                                    Update Password
                                </button>

                                <a href="{% url 'hosting_app:hosting_client_profile_page' %}"
                                   class="btn btn-outline-secondary hosting-btn-password-cancel">
                                    <i class="bi bi-arrow-left-circle me-2"></i>
                                    Cancel
                                </a>
                            </div>
                        </form>
                    </div>

                </div>
            </div>


            <!-- SIDE INFO -->
            <div class="col-lg-5">
                <div class="hosting-password-side-card">

                    <div class="hosting-password-side-header">
                        <h3>Password Safety Tips</h3>
                        <p>
                            A secure password helps protect your client profile,
                            personal contact details, hosting inquiries, and future booking-related activity.
                        </p>
                    </div>

                    <div class="hosting-password-side-body">
                        <ul class="hosting-password-tip-list">
                            <li class="hosting-password-tip-item">
                                <i class="bi bi-check-circle-fill"></i>
                                <span>Use a password that is not reused on other websites or systems.</span>
                            </li>

                            <li class="hosting-password-tip-item">
                                <i class="bi bi-check-circle-fill"></i>
                                <span>Combine uppercase letters, lowercase letters, numbers, and symbols where possible.</span>
                            </li>

                            <li class="hosting-password-tip-item">
                                <i class="bi bi-check-circle-fill"></i>
                                <span>Avoid including your full name, phone number, email address, city, or other obvious details.</span>
                            </li>

                            <li class="hosting-password-tip-item">
                                <i class="bi bi-check-circle-fill"></i>
                                <span>Update your password promptly if you ever suspect your login details were exposed.</span>
                            </li>
                        </ul>

                        <div class="hosting-security-highlight">
                            <h6>
                                Keep Your Hosting Client Account Protected
                            </h6>

                            <p>
                                Your account may later manage hosting inquiries, event requests,
                                selected venues, quotations, payments, and communication records.
                                A strong password helps safeguard that activity.
                            </p>
                        </div>
                    </div>

                </div>
            </div>

        </div>

    </div>
</section>

{% endblock %}