<!doctype html>
<html lang="id">

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>GL Asuh - Monitoring System</title>
    <link rel="icon" type="image/png" href="/assets/img/pst.png">

    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/admin-lte@3.2/dist/css/adminlte.min.css">
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.13.1/font/bootstrap-icons.min.css">
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource/source-sans-3@5.0.12/index.css">

    <style>
        :root {
            --primary-yellow: #FFD700;
            --soft-blue: #e0e7ff;
            --deep-blue: #1e3a8a;
            --light-bg: #f3f4f6;
        }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'Source Sans 3', sans-serif;
        }

        body {
            height: 100vh;
            overflow: hidden;
            background: #f5f7fb;
        }

        .container-fluid {
            display: flex;
            height: 100vh;
            padding: 0;
        }
 
        .image-side {
            flex: 7;
            position: relative;
            overflow: hidden;
            background-color: #000;
        }
 
        .image-side::before {
            content: '';
            position: absolute;
            inset: 0;
            background: linear-gradient(to right, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.5));
            z-index: 1;
        }

        .slide {
            position: absolute;
            inset: 0;
            width: 100%;
            height: 100%;
            object-fit: cover;
            object-position: center;
            opacity: 0;
            transform: scale(1.05);
            transition: opacity 2s cubic-bezier(0.4, 0, 0.2, 1),
                transform 7s cubic-bezier(0.1, 0.8, 0.3, 1);
        }

        .slide.active {
            opacity: 1;
            transform: scale(1.12);
        }
 
        .login-side {
            flex: 3;
            display: flex;
            justify-content: center;
            align-items: center;
            background: #ffffff;
            padding: 40px;
            box-shadow: -10px 0 30px rgba(0, 0, 0, 0.05);
            z-index: 2;
        }

        .login-card-custom {
            width: 100%;
            max-width: 400px;
        }
 
        .login-header-custom {
            text-align: center;
            margin-bottom: 30px;
        }

        .login-header-custom img {
            width: 85px;
            margin-bottom: 15px;
        }

        .login-header-custom h3 {
            color: var(--deep-blue);
            font-weight: 800;
            margin-bottom: 5px;
            letter-spacing: -0.5px;
            font-size: 1.75rem;
        }

        .login-header-custom p {
            color: #6b7280;
            font-weight: 500;
            font-size: 14px;
            margin: 0;
        }
 
        .form-label {
            font-size: 12px;
            font-weight: 700;
            color: var(--deep-blue);
            margin-bottom: 6px;
            margin-left: 4px;
            letter-spacing: 0.5px;
        }

        .input-group-custom {
            display: flex;
            align-items: center;
            background: #f8fafc;
            border: 1.5px solid #e2e8f0;
            border-radius: 16px;
            transition: all 0.2s ease;
            overflow: hidden;
        }

        .input-group-custom:focus-within {
            border-color: #3b82f6;
            background: #fff;
            box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
        }
 
        .input-group-custom.has-error {
            border-color: #dc3545;
            background: #fff1f2;
        }

        .input-group-text-custom {
            background: transparent;
            border: none;
            color: #64748b;
            padding-left: 18px;
            padding-right: 5px;
            font-size: 1.2rem;
            display: flex;
            align-items: center;
        }

        .form-control-custom {
            width: 100%;
            background: transparent;
            border: none;
            padding: 14px 18px 14px 8px;
            font-weight: 500;
            font-size: 15px;
            color: #1e293b;
            outline: none;
        }
 
        .btn-login {
            background-color: var(--primary-yellow);
            background-image: linear-gradient(135deg, #FFD700 0%, #FFC107 100%);
            color: #000;
            border: none;
            padding: 15px;
            border-radius: 16px;
            font-weight: 800;
            font-size: 15px;
            margin-top: 25px;
            transition: all 0.3s ease;
            box-shadow: 0 10px 15px -3px rgba(255, 193, 7, 0.25);
            width: 100%;
            display: flex;
            justify-content: center;
            align-items: center;
            cursor: pointer;
        }

        .btn-login:hover {
            transform: translateY(-2px);
            box-shadow: 0 15px 20px -5px rgba(255, 193, 7, 0.35);
            color: #000;
        }

        .btn-login i {
            margin-left: 8px;
            font-size: 1.1rem;
        }
 
        @media(max-width:992px) {
            body {
                overflow-y: auto; 
                height: auto;
                min-height: 100vh;
            }

            .container-fluid {
                position: relative;
                height: auto;
                min-height: 100vh;
                align-items: center;
                justify-content: center;
                display: flex;
            }

            .image-side {
                position: fixed; 
                inset: 0;
                width: 100%;
                height: 100%;
            }

            .image-side::after {
                content: '';
                position: absolute;
                inset: 0;
                background: rgba(15, 23, 42, 0.65); 
                z-index: 1;
            }

            .login-side {
                position: relative;
                z-index: 2;
                background: transparent;
                width: 100%;
                padding: 30px 20px; 
                box-shadow: none;
            }

            .login-card-custom { 
                background: rgba(255, 255, 255, 0.88);
                padding: 40px 24px;
                border-radius: 24px;
                backdrop-filter: blur(16px); 
                -webkit-backdrop-filter: blur(16px); 
                border: 1px solid rgba(255, 255, 255, 0.4); 
                box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
            }
        }
    </style>
</head>

<body>

    <div class="container-fluid">
        <div class="image-side" id="imageContainer"></div>

        <div class="login-side">
            <div class="login-card-custom">

                <div class="login-header-custom">
                    <img src="/assets/img/pst.png" alt="Logo">
                    <h3>GL ASUH</h3>
                    <p>Monitoring Portal Pengawas</p>
                </div>

                <form method="POST" action="{{ route('login') }}">
                    @csrf

                    <div class="mb-3">
                        <label class="form-label">NRP KARYAWAN</label>
                        <div class="input-group-custom @error('nrp') has-error @enderror">
                            <span class="input-group-text-custom">
                                <i class="bi bi-person-badge"></i>
                            </span>
                            <input type="text" class="form-control-custom" name="nrp" value="{{ old('nrp') }}"
                                placeholder="Masukkan nomor NRP" required>
                        </div>
                        @error('nrp')
                            <small class="text-danger fw-bold mt-2 d-block px-1" style="font-size: 13px;">
                                {{ $message }}
                            </small>
                        @enderror
                    </div>

                    <div class="mb-4">
                        <label class="form-label">KATA SANDI</label>
                        <div class="input-group-custom">
                            <span class="input-group-text-custom">
                                <i class="bi bi-key"></i>
                            </span>
                            <input type="password" class="form-control-custom" name="password" placeholder="••••••••"
                                required>
                        </div>
                    </div>

                    <button type="submit" class="btn-login">
                        MASUK SEKARANG <i class="bi bi-arrow-right"></i>
                    </button>
                </form>

            </div>
        </div>
    </div>

    <script> 
        const images = [
            "{{ asset('assets/img/bg-1.jpeg') }}",
            "{{ asset('assets/img/bg-2.jpeg') }}"
        ];

        const container = document.getElementById('imageContainer');
 
        images.forEach((src, index) => {
            const img = document.createElement('img');
            img.src = src;
            img.classList.add('slide');
            if (index === 0) img.classList.add('active');
            container.appendChild(img);
        });

        const slides = document.querySelectorAll('.slide');
        let currentIdx = 0;
 
        setInterval(() => {
            const currentSlide = slides[currentIdx];

            currentIdx = (currentIdx + 1) % slides.length;
            const nextSlide = slides[currentIdx];

            setTimeout(() => {
                if (!currentSlide.classList.contains('active')) {
                    currentSlide.style.transition = 'none';
                    currentSlide.style.transform = 'scale(1.05)';
                    setTimeout(() => {
                        currentSlide.style.transition =
                            'opacity 2s cubic-bezier(0.4, 0, 0.2, 1), transform 7s cubic-bezier(0.1, 0.8, 0.3, 1)';
                    }, 50);
                }
            }, 2000);

            currentSlide.classList.remove('active');
            nextSlide.classList.add('active');

        }, 6000);  
    </script>

</body>

</html>
