@extends('layouts.app')

@section('content')

<div class="auth-page">

    <div class="auth-card">

        <div class="auth-logo">

            <img
                src="{{ asset('images/logo.png') }}"
                alt="High Court of Madhya Pradesh"
            >

        </div>

        <h3>
            Login
        </h3>

        <p class="auth-subtitle">
            Case Management System
        </p>


        @if(session('success'))

            <div class="alert alert-success">
                {{ session('success') }}
            </div>

        @endif


        @if($errors->any())

            <div class="alert alert-danger">

                {{ $errors->first() }}

            </div>

        @endif


        <form method="POST" action="{{ route('login.submit') }}">

            @csrf


            <div class="mb-3">

                <label class="form-label">
                    Email Address
                </label>

                <input
                    type="email"
                    name="email"
                    class="form-control"
                    value="{{ old('email') }}"
                    placeholder="Enter your email"
                    required
                    autofocus
                >

            </div>


            <div class="mb-3">

                <label class="form-label">
                    Password
                </label>

                <input
                    type="password"
                    name="password"
                    class="form-control"
                    placeholder="Enter your password"
                    required
                >

            </div>


            <div class="form-check mb-4">

                <input
                    type="checkbox"
                    name="remember"
                    value="1"
                    class="form-check-input"
                    id="remember"
                >

                <label
                    class="form-check-label"
                    for="remember"
                >
                    Remember me
                </label>

            </div>


            <button
                type="submit"
                class="btn auth-btn w-100"
            >

                <i class="bi bi-box-arrow-in-right me-2"></i>

                Login

            </button>

        </form>


        <div class="auth-footer">

            Don't have an account?

            <a href="{{ route('register') }}">
                Create Account
            </a>

        </div>

    </div>

</div>


<style>

.auth-page {
    min-height: calc(100vh - 120px);

    display: flex;
    justify-content: center;
    align-items: center;

    background: #f6f7f9;

    padding: 40px 20px;
}

.auth-card {
    width: 100%;
    max-width: 430px;

    background: #fff;

    border: 1px solid #e5e7eb;

    border-radius: 14px;

    padding: 35px;

    box-shadow: 0 8px 30px rgba(0,0,0,.07);
}

.auth-logo {
    text-align: center;
    margin-bottom: 20px;
}

.auth-logo img {
    width: 75px;
    height: 75px;
    object-fit: contain;
}

.auth-card h3 {
    text-align: center;
    font-weight: 700;
    color: #17212b;
}

.auth-subtitle {
    text-align: center;
    color: #718096;
    margin-bottom: 28px;
}

.auth-btn {
    background: #3f302b;
    border-color: #3f302b;
    color: #fff;
    padding: 11px;
    font-weight: 600;
}

.auth-btn:hover {
    background: #2f2420;
    color: #fff;
}

.auth-footer {
    text-align: center;
    margin-top: 22px;
    color: #64748b;
    font-size: 14px;
}

.auth-footer a {
    color: #3f302b;
    font-weight: 600;
    text-decoration: none;
}

</style>

@endsection