<!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.super.name') }}</title>
    @include('partials.mexco-favicon')
    <link href="https://fonts.googleapis.com/css2?family=Inter: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">
    @include('partials.mexco-admin-theme')
    <style>
        body {
            font-family: Inter, system-ui, sans-serif;
            min-height: 100vh; display: grid; place-items: center;
            background: linear-gradient(160deg, var(--mexco-primary), var(--mexco-primary-dark) 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; }
        .login-kicker {
            text-align: center; font-size: .7rem; font-weight: 700; letter-spacing: .08em;
            text-transform: uppercase; color: var(--mexco-primary); margin-bottom: .35rem;
        }
        .form-control:focus {
            border-color: var(--mexco-primary); box-shadow: 0 0 0 .22rem rgba(124,58,237,.15);
        }
        .btn-primary {
            --bs-btn-bg: var(--mexco-primary); --bs-btn-border-color: var(--mexco-primary);
            --bs-btn-hover-bg: var(--mexco-primary-dark); --bs-btn-hover-border-color: var(--mexco-primary-dark);
        }
        .login-note {
            margin-top: 1rem; padding: .85rem .95rem; border-radius: 10px;
            background: var(--primary-soft); border: 1px solid #DDD6FE;
            font-size: .8rem; color: var(--mexco-primary-dark); line-height: 1.45;
        }
        .mono { font-family: ui-monospace, monospace; }
    </style>
</head>
<body>
<div class="card login-card shadow-lg p-4 p-md-5">
    @include('partials.mexco-brand', ['app' => 'super', 'class' => 'login-logo'])
    <div class="login-kicker">{{ config('mexco.platform') }}</div>
    <h1 class="text-center fw-bold mb-1" style="font-size:1.5rem">{{ config('mexco.apps.super.name') }}</h1>
    <p class="text-center text-secondary mb-4" style="font-size:.9rem">Sign in to manage events and grant organiser capabilities.</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.super.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>
            @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>
            @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>

    <div class="login-note">
        Demo: <span class="mono">admin@meetup.com</span> · password <span class="mono">superadmin</span>
    </div>
    <p class="text-center mt-3 mb-0">
        <a href="{{ route('mexco.admin.login') }}" class="text-secondary" style="font-size:.82rem">
            {{ config('mexco.apps.organizer.name') }} sign in →
        </a>
    </p>
</div>
</body>
</html>
