{% load static %}
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Forget Password</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
    <link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600&display=swap" rel="stylesheet">

    <style>
        body {
            font-family: 'Poppins', sans-serif;
            background-color: #f8f9fa;
            min-height: 100vh;
            display: flex;
            justify-content: center;
            align-items: center;
        }

        .container {
            max-width: 900px;
            background: #fff;
            box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
            border-radius: 15px;
            overflow: hidden;
        }

        .row {
            display: flex;
            align-items: stretch;
        }

        /* Left Section - Background Image */
        .left-section {
            background: url("{% static 'img/login2.jpg' %}") no-repeat center center/cover;
            min-height: 400px;
            display: flex;
            justify-content: center;
            align-items: center;
            color: #fff;
            padding: 40px;
        }

        .right-section {
            padding: 60px;
        }

        .title {
            font-weight: bold;
            font-size: 24px;
            color: #333;
            text-align: center;
        }

        .form-control {
            background: rgba(0, 0, 0, 0.05);
            border: none;
            padding: 10px;
            font-size: 16px;
        }

        .form-control:focus {
            box-shadow: none;
            border: 2px solid #6e8efb;
        }

        .btn-primary {
            background: #6e8efb;
            border: none;
            padding: 12px;
            font-size: 16px;
            width: 100%;
            transition: 0.3s;
        }

        .btn-primary:hover {
            background: #5a78e3;
        }

        .text-primary {
            color: #6e8efb;
            text-decoration: none;
        }

        .text-primary:hover {
            text-decoration: underline;
        }
    </style>
</head>
<body>

<div class="container">
    <div class="row">
        <!-- Left Section (Background Image) -->
        <div class="col-md-6 left-section">
        </div>

        <!-- Right Section (Forget Password Form) -->
        <div class="col-md-6 right-section">
            <h3 class="title mb-4">Reset Password</h3>
            <p class="text-center text-muted">Enter your new password below.</p>

            {% if messages %}
                {% for message in messages %}
                    <div class="alert {% if message.tags == 'error' %}alert-danger{% else %}alert-success{% endif %} text-center" role="alert">
                        {{ message }}
                    </div>
                {% endfor %}
            {% endif %}

            <form method="POST">
                {% csrf_token %}
                <div class="mb-3">
                    <label for="password" class="form-label">New Password</label>
                    <input type="password" class="form-control" id="password" name="password" placeholder="Enter new password" required>
                </div>
                <div class="mb-3">
                    <label for="confirm_password" class="form-label">Confirm Password</label>
                    <input type="password" class="form-control" id="confirm_password" name="confirm_password" placeholder="Confirm new password" required>
                </div>
                <button type="submit" class="btn btn-primary">Reset Password</button>
            </form>

            <p class="mt-3 text-center">
                <a href="{% url 'loginview' %}" class="text-primary">Back to Login</a>
            </p>
        </div>
    </div>
</div>

<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>
