<!DOCTYPE html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}" dir="{{ app()->getLocale() === 'ar' ? 'rtl' : 'ltr' }}">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="csrf-token" content="{{ csrf_token() }}">
    <meta name="theme-color" content="#060810">
    <title>@yield('title', 'Sign In') — ALGA ARENA</title>
    <meta name="description" content="Sign in to ALGA ARENA — the next-generation esports operating system.">

    <link rel="preconnect" href="https://fonts.googleapis.com">
    <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
    <link href="https://fonts.googleapis.com/css2?family=Oxanium:wght@400;500;600;700;800&family=Rajdhani:wght@500;600;700;800&family=Space+Grotesk:wght@400;500;600;700;800;900&family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">

    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css">
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css">
    <link rel="stylesheet" href="{{ asset('assets/css/app.css') }}">
    @stack('styles')
    <link rel="icon" href="{{ asset('assets/images/brand/favicon.svg') }}" type="image/svg+xml">

    <style>
        *, *::before, *::after { box-sizing: border-box; }

        html, body { height: 100%; margin: 0; padding: 0; background: #060810; }

        /* ── Split layout ─────────────────────────────────── */
        .auth-shell {
            display: grid;
            grid-template-columns: 1fr 480px;
            min-height: 100vh;
        }

        /* ── Left panel — cinematic scene ─────────────────── */
        .auth-scene {
            position: relative;
            overflow: hidden;
            background: #030407;
        }

        .auth-scene__img {
            position: absolute;
            inset: 0;
            width: 100%;
            height: 100%;
            object-fit: cover;
            object-position: center 30%;
            opacity: 0.75;
            animation: sceneBreath 20s ease-in-out infinite alternate;
        }

        @keyframes sceneBreath {
            0%   { transform: scale(1.02) translateX(0);   }
            100% { transform: scale(1.06) translateX(-8px); }
        }

        .auth-scene__overlay {
            position: absolute;
            inset: 0;
            background:
                linear-gradient(to right, rgba(6,8,16,0.15) 0%, rgba(6,8,16,0.55) 100%),
                linear-gradient(to top,   rgba(6,8,16,0.7)  0%, transparent 50%);
        }

        /* Scan line */
        .auth-scene__scan {
            position: absolute;
            inset: 0;
            overflow: hidden;
            pointer-events: none;
            opacity: 0.25;
        }
        .auth-scene__scan::before {
            content: '';
            position: absolute;
            left: 0; right: 0;
            height: 1px;
            background: linear-gradient(90deg, transparent, rgba(0,212,255,0.7) 40%, white 50%, rgba(0,212,255,0.7) 60%, transparent);
            box-shadow: 0 0 8px rgba(0,212,255,0.6);
            animation: authScan 10s linear infinite;
        }
        @keyframes authScan {
            from { top: -1px; }
            to   { top: 100%; }
        }

        /* Content over the scene */
        .auth-scene__content {
            position: absolute;
            inset: 0;
            display: flex;
            flex-direction: column;
            justify-content: flex-end;
            padding: 48px;
            z-index: 10;
        }

        .auth-scene__badge {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            background: rgba(0,212,255,0.08);
            border: 1px solid rgba(0,212,255,0.25);
            border-radius: 100px;
            padding: 6px 14px;
            font-size: 0.7rem;
            font-weight: 700;
            color: #00d4ff;
            text-transform: uppercase;
            letter-spacing: 0.1em;
            margin-bottom: 20px;
            width: fit-content;
        }

        .auth-scene__headline {
            font-family: 'Space Grotesk', sans-serif;
            font-size: clamp(2rem, 3.5vw, 3rem);
            font-weight: 900;
            color: #fff;
            line-height: 1.08;
            letter-spacing: -0.03em;
            margin: 0 0 16px 0;
        }

        .auth-scene__headline span {
            background: linear-gradient(135deg, #fff 30%, #00d4ff 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
        }

        .auth-scene__desc {
            font-size: 0.9rem;
            color: rgba(255,255,255,0.6);
            line-height: 1.65;
            max-width: 480px;
            margin: 0 0 28px 0;
        }

        .auth-scene__stats {
            display: flex;
            gap: 12px;
            flex-wrap: wrap;
        }

        .auth-stat-pill {
            background: rgba(255,255,255,0.07);
            backdrop-filter: blur(12px);
            border: 1px solid rgba(255,255,255,0.1);
            border-radius: 8px;
            padding: 8px 14px;
            font-size: 0.75rem;
            font-weight: 600;
            color: rgba(255,255,255,0.85);
        }

        /* Energy border animation on left panel */
        .auth-scene::after {
            content: '';
            position: absolute;
            top: 0; right: 0;
            width: 1px;
            height: 100%;
            background: linear-gradient(to bottom, transparent 0%, #00d4ff 30%, #7c5cfc 70%, transparent 100%);
            animation: borderFlow 5s ease-in-out infinite alternate;
            z-index: 20;
        }
        @keyframes borderFlow {
            0%   { opacity: 0.3; transform: scaleY(0.6) translateY(-20%); }
            100% { opacity: 0.8; transform: scaleY(1)   translateY(0); }
        }

        /* ── Right panel — form ────────────────────────────── */
        .auth-form-panel {
            display: flex;
            flex-direction: column;
            justify-content: center;
            background: #080b14;
            padding: 48px 40px;
            overflow-y: auto;
            position: relative;
        }

        /* Subtle dot-grid texture */
        .auth-form-panel::before {
            content: '';
            position: absolute;
            inset: 0;
            background-image: radial-gradient(rgba(0,212,255,0.04) 1px, transparent 1px);
            background-size: 28px 28px;
            pointer-events: none;
        }

        .auth-form-inner {
            position: relative;
            z-index: 1;
            max-width: 380px;
            width: 100%;
            margin: 0 auto;
        }

        /* Logo */
        .auth-logo {
            display: inline-flex;
            align-items: center;
            gap: 10px;
            text-decoration: none;
            margin-bottom: 36px;
        }

        .auth-logo__mark {
            width: 40px;
            height: 40px;
            background: rgba(0,212,255,0.1);
            border: 1px solid rgba(0,212,255,0.25);
            border-radius: 10px;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .auth-logo__name {
            font-family: 'Space Grotesk', sans-serif;
            font-weight: 800;
            font-size: 1.15rem;
            color: #fff;
            letter-spacing: 0.06em;
        }

        /* Heading */
        .auth-heading {
            font-family: 'Space Grotesk', sans-serif;
            font-size: 1.75rem;
            font-weight: 800;
            color: #fff;
            margin: 0 0 6px 0;
            letter-spacing: -0.02em;
        }

        .auth-subheading {
            font-size: 0.85rem;
            color: rgba(180,190,210,0.7);
            margin: 0 0 28px 0;
        }

        /* Input fields */
        .auth-field {
            margin-bottom: 16px;
        }

        .auth-label {
            display: block;
            font-size: 0.72rem;
            font-weight: 600;
            color: rgba(180,190,210,0.75);
            text-transform: uppercase;
            letter-spacing: 0.08em;
            margin-bottom: 7px;
        }

        .auth-input {
            width: 100%;
            background: rgba(255,255,255,0.04);
            border: 1px solid rgba(255,255,255,0.1);
            border-radius: 10px;
            padding: 12px 16px;
            font-size: 0.88rem;
            color: #fff;
            outline: none;
            transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
            font-family: 'Inter', sans-serif;
        }

        .auth-input::placeholder { color: rgba(180,190,210,0.35); }

        .auth-input:focus {
            border-color: rgba(0,212,255,0.5);
            background: rgba(0,212,255,0.04);
            box-shadow: 0 0 0 3px rgba(0,212,255,0.1);
        }

        /* Submit button */
        .auth-btn-primary {
            width: 100%;
            background: linear-gradient(135deg, #7c5cfc, #00d4ff);
            border: none;
            border-radius: 10px;
            padding: 13px 24px;
            font-size: 0.9rem;
            font-weight: 700;
            color: #fff;
            cursor: pointer;
            margin-top: 20px;
            letter-spacing: 0.02em;
            transition: transform 0.18s, box-shadow 0.18s;
            font-family: 'Inter', sans-serif;
        }

        .auth-btn-primary:hover {
            transform: translateY(-2px);
            box-shadow: 0 8px 28px rgba(0,212,255,0.28), 0 4px 12px rgba(124,92,252,0.3);
        }

        /* Divider */
        .auth-divider {
            display: flex;
            align-items: center;
            gap: 12px;
            margin: 22px 0;
        }

        .auth-divider::before, .auth-divider::after {
            content: '';
            flex: 1;
            height: 1px;
            background: rgba(255,255,255,0.08);
        }

        .auth-divider span {
            font-size: 0.68rem;
            color: rgba(180,190,210,0.45);
            white-space: nowrap;
            font-weight: 500;
        }

        /* Social buttons */
        .auth-social-btn {
            width: 100%;
            background: rgba(255,255,255,0.04);
            border: 1px solid rgba(255,255,255,0.09);
            border-radius: 10px;
            padding: 11px 16px;
            font-size: 0.83rem;
            font-weight: 600;
            color: rgba(255,255,255,0.8);
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 9px;
            margin-bottom: 10px;
            transition: background 0.18s, border-color 0.18s;
            font-family: 'Inter', sans-serif;
        }

        .auth-social-btn:hover {
            background: rgba(255,255,255,0.07);
            border-color: rgba(255,255,255,0.15);
        }

        /* Footer link */
        .auth-footer-link {
            text-align: center;
            margin-top: 24px;
            font-size: 0.8rem;
            color: rgba(180,190,210,0.55);
        }

        .auth-footer-link a {
            color: #00d4ff;
            text-decoration: none;
            font-weight: 600;
        }

        .auth-footer-link a:hover { text-decoration: underline; }

        /* Forgot password row */
        .auth-forgot {
            text-align: right;
            margin-top: -8px;
            margin-bottom: 10px;
        }

        .auth-forgot a {
            font-size: 0.72rem;
            color: rgba(0,212,255,0.7);
            text-decoration: none;
        }

        .auth-forgot a:hover { color: #00d4ff; }

        /* Checkbox row */
        .auth-check-row {
            display: flex;
            align-items: center;
            gap: 9px;
            margin-bottom: 4px;
        }

        .auth-check-row input[type="checkbox"] {
            width: 16px; height: 16px;
            accent-color: #00d4ff;
            cursor: pointer;
        }

        .auth-check-row label {
            font-size: 0.75rem;
            color: rgba(180,190,210,0.65);
            cursor: pointer;
        }

        .auth-alert {
            border-radius: 10px;
            padding: 12px 14px;
            font-size: 0.8rem;
            margin-bottom: 18px;
        }

        .auth-alert--error {
            background: rgba(255, 80, 80, 0.1);
            border: 1px solid rgba(255, 80, 80, 0.25);
            color: #ff8a8a;
        }

        .auth-alert--success {
            background: rgba(0, 212, 255, 0.08);
            border: 1px solid rgba(0, 212, 255, 0.25);
            color: #7ee8ff;
        }

        .auth-field-error {
            display: block;
            margin-top: 6px;
            font-size: 0.72rem;
            color: #ff8a8a;
        }

        .auth-input.is-invalid {
            border-color: rgba(255, 80, 80, 0.45);
        }

        /* ── Responsive ────────────────────────────────────── */
        @media (max-width: 900px) {
            .auth-shell {
                grid-template-columns: 1fr;
            }

            .auth-scene {
                height: 240px;
            }

            .auth-scene__content {
                padding: 28px 24px;
            }

            .auth-scene__headline { font-size: 1.4rem; }
            .auth-scene__stats    { display: none; }

            .auth-form-panel {
                padding: 36px 24px;
            }
        }

        @media (max-width: 480px) {
            .auth-form-panel { padding: 28px 18px; }
            .auth-heading    { font-size: 1.4rem; }
        }
    </style>
</head>
<body>
<div class="auth-shell">

    {{-- Left: cinematic scene panel --}}
    <div class="auth-scene">
        <img class="auth-scene__img"
             src="{{ asset('assets/images/generated/heroes/auth-hero.webp') }}"
             alt=""
             onerror="this.style.opacity='0'">
        <div class="auth-scene__overlay"></div>
        <div class="auth-scene__scan"></div>

        <div class="auth-scene__content">
            <div class="auth-scene__badge">
                <span style="width:6px;height:6px;background:#00d4ff;border-radius:50%;box-shadow:0 0 6px #00d4ff;display:inline-block;animation:livePulse 1.8s ease-in-out infinite;"></span>
                Season 1 — Now Live
            </div>

            <h2 class="auth-scene__headline">
                The Arena<br>Awaits <span>Champions.</span>
            </h2>

            <p class="auth-scene__desc">
                Compete. Recruit. Climb. ALGA ARENA is where professional esports careers are built.
            </p>

            <div class="auth-scene__stats">
                <div class="auth-stat-pill">⚔️ 1,280 Scrims Today</div>
                <div class="auth-stat-pill">🏅 18,500+ Players</div>
                <div class="auth-stat-pill">🛡️ 2,100 Teams</div>
                <div class="auth-stat-pill">🏆 56 Tournaments</div>
            </div>
        </div>
    </div>

    {{-- Right: form panel --}}
    <div class="auth-form-panel">
        <div class="auth-form-inner" id="main-content" tabindex="-1">
            @yield('content')
        </div>
    </div>

</div>

<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
<script src="{{ asset('assets/js/app.js') }}"></script>
@stack('scripts')
</body>
</html>
