{% extends "base.html" %}
{% load static %}

{% block content %}
<style>
    .login-page {
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: 80vh;
        background-color: #f8f9fa;
    }
    .login-container {
        display: flex;
        width: 100%;
        max-width: 900px;
        box-shadow: 0 4px 20px rgba(0,0,0,0.1);
        border-radius: 12px;
        overflow: hidden;
    }
    .login-branding {
        background: linear-gradient(to right, #6a11cb, #2575fc);
        color: white;
        padding: 40px;
        width: 45%;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }
    .login-branding h1 {
        font-size: 2.5rem;
        font-weight: bold;
        margin-bottom: 1rem;
    }
    .login-form-wrapper {
        background: white;
        padding: 40px;
        width: 55%;
    }
    .form-control {
        height: 48px;
        border-radius: 8px;
    }
    .btn-primary {
        background-color: #6a11cb;
        border-color: #6a11cb;
        padding: 12px;
        border-radius: 8px;
        font-weight: bold;
    }
</style>

<div class="login-page">
    <div class="container">
        <div class="row justify-content-center">
            <div class="col-md-10">
                <div class="card shadow-lg border-0 rounded-lg mt-5">
                    <div class="card-body p-0">
                        <div class="row m-0">
                            <div class="col-lg-6 d-none d-lg-flex align-items-center justify-content-center bg-primary text-white flex-column p-5" style="border-top-left-radius: 0.5rem; border-bottom-left-radius: 0.5rem;">
                                <h1 class="h2 font-weight-bold">Welcome Back</h1>
                                <p class="text-white-75">Sign in to access your student dashboard and continue your learning journey.</p>
                            </div>
                            <div class="col-lg-6 p-5">
                                <h3 class="font-weight-light mb-4">Student Login</h3>
                                <form method="post">
                                    {% csrf_token %}
                                    <div class="form-group mb-3">
                                        {{ form.username.label_tag }}
                                        <input type="text" name="username" class="form-control" placeholder="Enter your username">
                                    </div>
                                    <div class="form-group mb-4">
                                        {{ form.password.label_tag }}
                                        <input type="password" name="password" class="form-control" placeholder="Enter your password">
                                    </div>
                                    
                                    {% if form.errors %}
                                        <div class="alert alert-danger mb-3">
                                            Your username and password didn't match. Please try again.
                                        </div>
                                    {% endif %}
                                    
                                    <button type="submit" class="btn btn-primary btn-block w-100">Sign In</button>
                                </form>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
{% endblock %}
