<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Sign in · {{ config('mexco.apps.organizer.name') }}</title>
    @include('partials.mexco-favicon')
    <link href="https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;600;700;800&display=swap" rel="stylesheet">
    <link href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.3.3/css/bootstrap.min.css" rel="stylesheet">
    <style>
        body {
            font-family: "Plus Jakarta Sans", system-ui, sans-serif;
            min-height: 100vh; display: grid; place-items: center;
            background: linear-gradient(160deg, #4B23D4, #2E0F8E 70%); padding: 1.5rem;
        }
        .login-card { max-width: 420px; width: 100%; border-radius: 1.25rem; border: 0; }
        .login-logo { display: block; width: min(180px, 70%); height: auto; margin: 0 auto 1.25rem; }
        .btn-primary { --bs-btn-bg: #4B23D4; --bs-btn-border-color: #4B23D4; }
    </style>
</head>
<body>
<div class="card login-card shadow-lg p-4 p-md-5">
    @include('partials.mexco-brand', ['app' => 'organizer', 'class' => 'login-logo'])
    <h1 class="text-center fw-bold mb-1" style="font-size:1.5rem">{{ config('mexco.apps.organizer.name') }}</h1>
    <p class="text-center text-secondary mb-4" style="font-size:.9rem">{{ config('mexco.apps.organizer.tagline') }}</p>

    @if(session('error'))
        <div class="alert alert-danger py-2">{{ session('error') }}</div>
    @endif
    @if(session('success'))
        <div class="alert alert-success py-2">{{ session('success') }}</div>
    @endif

    <form method="POST" action="{{ route('mexco.admin.login.submit') }}">
        @csrf
        <div class="mb-3">
            <label class="form-label fw-semibold" for="email">Email</label>
            <input type="email" name="email" id="email"
                   class="form-control @error('email') is-invalid @enderror"
                   value="{{ old('email') }}" required autofocus autocomplete="email">
            @error('email')<div class="invalid-feedback">{{ $message }}</div>@enderror
        </div>
        <div class="mb-4">
            <label class="form-label fw-semibold" for="password">Password</label>
            <input type="password" name="password" id="password"
                   class="form-control @error('password') is-invalid @enderror"
                   required autocomplete="current-password">
            @error('password')<div class="invalid-feedback">{{ $message }}</div>@enderror
        </div>
        <button type="submit" class="btn btn-primary btn-lg w-100 fw-bold">Sign in</button>
    </form>
    <p class="text-center text-secondary mt-4 mb-0" style="font-size:.82rem">
        Demo: <span class="mono">{{ config('mexco.demo_sandbox.organiser.username') }}</span>
        · password <span class="mono">{{ config('mexco.demo_sandbox.organiser.password') }}</span>
    </p>
    <p class="text-center mt-2 mb-0">
        <a href="{{ route('mexco.super.login') }}" class="text-secondary" style="font-size:.82rem">{{ config('mexco.apps.super.name') }} sign in →</a>
    </p>
    <p class="text-center mt-2 mb-0">
        <a href="{{ url('/mexco') }}" class="text-secondary" style="font-size:.82rem">← {{ config('mexco.apps.pass.name') }}</a>
    </p>
</div>
</body>
</html>
