{% extends 'dating_app/base_dating.html' %}
{% block title %}Dating Partner Sign In{% endblock %}

{% block content %}

<style>
    .login-hero {
        position: relative;
        min-height: 100vh;
        padding: 6rem 0;
        background:
            radial-gradient(circle at top left, rgba(255, 193, 7, 0.18), transparent 34%),
            radial-gradient(circle at bottom right, rgba(255, 77, 136, 0.20), transparent 34%),
            linear-gradient(135deg, #2a0d1f 0%, #4b1235 52%, #c2185b 100%);
        color: #fff;
        overflow: hidden;
    }

    .login-hero::before {
        content: "";
        position: absolute;
        inset: 0;
        background:
            linear-gradient(
                90deg,
                rgba(36, 9, 27, 0.88) 0%,
                rgba(36, 9, 27, 0.68) 48%,
                rgba(194, 24, 91, 0.30) 100%
            ),
            radial-gradient(circle at 82% 18%, rgba(255, 255, 255, 0.10), transparent 28%);
        z-index: 0;
    }

    .login-hero::after {
        content: "";
        position: absolute;
        width: 430px;
        height: 430px;
        right: -150px;
        top: -130px;
        border-radius: 50%;
        background: rgba(255, 193, 7, 0.13);
        filter: blur(8px);
        z-index: 0;
    }

    .login-hero > .container {
        position: relative;
        z-index: 2;
    }

    .login-hero h1 {
        color: #fff;
        letter-spacing: -0.035em;
        line-height: 1.05;
        text-shadow: 0 14px 36px rgba(0, 0, 0, 0.24);
    }

    .login-hero .lead {
        color: rgba(255, 255, 255, 0.84) !important;
    }

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

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

    .login-hero .login-info-list {
        margin: 26px 0 22px;
    }

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

    .login-hero .login-info-item i {
        width: 34px;
        height: 34px;
        min-width: 34px;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.10);
        border: 1px solid rgba(255, 255, 255, 0.14);
        color: #ffc107;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: 1rem;
        backdrop-filter: blur(8px);
    }

    .login-hero .login-note-box {
        background: rgba(255, 255, 255, 0.10);
        border: 1px solid rgba(255, 193, 7, 0.26);
        border-left: 4px solid #ffc107;
        color: rgba(255, 255, 255, 0.92);
        padding: 17px 20px;
        border-radius: 18px;
        display: flex;
        gap: 12px;
        align-items: flex-start;
        box-shadow: 0 18px 42px rgba(0, 0, 0, 0.12);
        backdrop-filter: blur(10px);
    }

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

    .login-form-card {
        position: relative;
        background: #fff;
        border-radius: 32px;
        box-shadow: 0 30px 80px rgba(0, 0, 0, 0.26);
        overflow: hidden;
        transition: 0.22s ease;
        border: 1px solid rgba(255, 255, 255, 0.22);
    }

    .login-form-card:hover {
        transform: translateY(-3px);
        box-shadow: 0 36px 90px rgba(0, 0, 0, 0.32);
    }

    .login-form-card::before {
        content: "";
        position: absolute;
        inset: 0 0 auto 0;
        height: 6px;
        background: linear-gradient(90deg, #ffc107, #ff4d88, #c2185b);
        z-index: 2;
    }

    .login-form-header {
        background:
            radial-gradient(circle at 90% 10%, rgba(255, 193, 7, 0.14), transparent 34%),
            linear-gradient(135deg, #ffffff 0%, #fff1f6 100%);
        padding: 30px 32px 28px;
        color: #2a0d1f;
        text-align: center;
        border-bottom: 1px solid rgba(194, 24, 91, 0.10);
    }

    .login-form-header h3 {
        margin: 0;
        font-weight: 900;
        color: #2a0d1f;
        letter-spacing: -0.02em;
    }

    .login-form-header p {
        color: #756a77 !important;
        font-size: 0.92rem;
        margin-top: 8px;
    }

    .login-form-body {
        padding: 32px;
        background: linear-gradient(180deg, #ffffff 0%, #fffafd 100%);
    }

    .login-form-body .form-label {
        color: #2a0d1f;
        font-weight: 800;
        font-size: 0.9rem;
    }

    .login-form-body .form-control {
        border-radius: 16px;
        border: 1px solid rgba(42, 13, 31, 0.14);
        padding: 0.78rem 0.98rem;
        box-shadow: 0 8px 18px rgba(42, 13, 31, 0.035);
        color: #2a0d1f;
        background-color: #fff;
    }

    .login-form-body .form-control:focus {
        border-color: rgba(194, 24, 91, 0.55);
        box-shadow: 0 0 0 0.22rem rgba(194, 24, 91, 0.12);
    }

    .forgot-password-link {
        color: #c2185b;
        text-decoration: none;
        font-weight: 800;
        font-size: 0.85rem;
    }

    .forgot-password-link:hover {
        text-decoration: underline;
        color: #9b1b60;
    }

    .login-form-body .btn-dark {
        background: linear-gradient(135deg, #2a0d1f, #c2185b);
        border: none;
        border-radius: 999px;
        padding: 0.82rem 1rem;
        font-weight: 900;
        color: #fff;
        box-shadow: 0 16px 32px rgba(194, 24, 91, 0.24);
        transition: all 0.22s ease;
    }

    .login-form-body .btn-dark:hover {
        background: linear-gradient(135deg, #1b0714, #ff4d88);
        transform: translateY(-2px);
        box-shadow: 0 20px 38px rgba(194, 24, 91, 0.32);
    }

    .login-form-footer {
        border-top: 1px solid rgba(194, 24, 91, 0.10);
        padding-top: 24px;
        margin-top: 10px;
    }

    .login-form-footer .text-muted {
        color: #756a77 !important;
    }

    .login-form-footer .btn-outline-primary {
        border: 2px solid rgba(194, 24, 91, 0.55);
        color: #c2185b;
        background: #fff;
        font-weight: 800;
        border-radius: 999px;
        padding: 10px;
        transition: all 0.22s ease;
    }

    .login-form-footer .btn-outline-primary:hover {
        background: #c2185b;
        color: #fff;
        border-color: #c2185b;
        transform: translateY(-2px);
        box-shadow: 0 14px 28px rgba(194, 24, 91, 0.20);
    }

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

        .login-hero h1 {
            font-size: 2rem;
        }

        .login-form-body {
            padding: 24px;
        }

        .login-form-header {
            padding: 24px 22px;
        }

        .login-form-card {
            border-radius: 26px;
        }
    }
</style>

<section class="login-hero">
    <div class="container">
        <div class="row align-items-center g-5 justify-content-center">
            <div class="col-lg-5">
                <span class="section-mini-title">Partner Access</span>
                <h1 class="fw-bold mb-3">Dating Partner Sign In</h1>
                <p class="lead text-muted mb-4">
                    Sign in to manage your dating partner profile, update your personal details, and monitor your profile approval status.
                </p>

                <div class="login-info-list">
                    <div class="login-info-item">
                        <i class="bi bi-check-circle-fill"></i>
                        <span>Access your dating partner dashboard</span>
                    </div>
                    <div class="login-info-item">
                        <i class="bi bi-check-circle-fill"></i>
                        <span>Update and manage your partner profile</span>
                    </div>
                    <div class="login-info-item">
                        <i class="bi bi-check-circle-fill"></i>
                        <span>Track profile review and visibility status</span>
                    </div>
                </div>

                <div class="login-note-box mt-4">
                    <i class="bi bi-info-circle-fill"></i>
                    <div>
                        This sign-in area is for approved or registered local dating partner candidates who already have an 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">Partner 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>

                        <div class="d-flex justify-content-end mb-4">
                            <a href="{% url 'dating_app:dating_password_reset' %}"
                            class="forgot-password-link">
                                <i class="bi bi-key-fill me-1"></i>
                                Forgot your password?
                            </a>
                        </div>

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

                        <button type="submit" class="btn btn-dark btn-lg w-100">
                            Sign In as Dating Partner
                        </button>
                    </form>

                    <div class="login-form-footer text-center mt-3 px-4 pb-4">
                        <p class="small text-muted mb-2">
                            Do not have a dating partner account yet?
                        </p>
                        <a href="{% url 'dating_app:partner_register' %}" class="btn btn-outline-primary w-100">
                            Dating Partner Signup
                        </a>
                    </div>
                </div>
            </div>
        </div>
    </div>
</section>

{% endblock %}