<!DOCTYPE html>
<html lang="id">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Login - AppSuper PKLK</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
    <link href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.10.0/font/bootstrap-icons.css" rel="stylesheet">
    <link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap" rel="stylesheet">
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }
        
        body {
            font-family: 'Poppins', sans-serif;
            background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 50%, #a5d6a7 100%);
            min-height: 100vh;
            display: flex;
            align-items: center;
            justify-content: center;
            overflow-x: hidden;
        }
        
        /* Animated Background Shapes */
        .bg-shape {
            position: fixed;
            border-radius: 50%;
            opacity: 0.1;
            z-index: 0;
        }
        
        .shape-1 {
            width: 300px;
            height: 300px;
            background: #4caf50;
            top: -100px;
            right: -100px;
            animation: float 6s ease-in-out infinite;
        }
        
        .shape-2 {
            width: 200px;
            height: 200px;
            background: #66bb6a;
            bottom: -50px;
            left: -50px;
            animation: float 8s ease-in-out infinite reverse;
        }
        
        .shape-3 {
            width: 150px;
            height: 150px;
            background: #81c784;
            top: 50%;
            right: 10%;
            animation: float 7s ease-in-out infinite;
        }
        
        @keyframes float {
            0%, 100% { transform: translateY(0) rotate(0deg); }
            50% { transform: translateY(-20px) rotate(10deg); }
        }
        
        .login-container {
            position: relative;
            z-index: 1;
            width: 100%;
            max-width: 1200px;
            margin: 0 auto;
            padding: 2rem;
        }
        
        .login-wrapper {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 0;
            background: white;
            border-radius: 24px;
            overflow: hidden;
            box-shadow: 0 20px 60px rgba(76, 175, 80, 0.15);
        }
        
        /* Left Side - Welcome Section */
        .welcome-section {
            background: linear-gradient(135deg, #4caf50 0%, #66bb6a 100%);
            padding: 4rem 3rem;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            text-align: center;
            color: white;
            position: relative;
            overflow: hidden;
        }
        
        .welcome-section::before {
            content: '';
            position: absolute;
            width: 400px;
            height: 400px;
            background: rgba(255, 255, 255, 0.1);
            border-radius: 50%;
            top: -200px;
            left: -200px;
        }
        
        .welcome-section::after {
            content: '';
            position: absolute;
            width: 300px;
            height: 300px;
            background: rgba(255, 255, 255, 0.08);
            border-radius: 50%;
            bottom: -150px;
            right: -150px;
        }
        
        .welcome-content {
            position: relative;
            z-index: 1;
        }
        
        .welcome-icon {
            font-size: 5rem;
            margin-bottom: 1.5rem;
            animation: pulse 2s ease-in-out infinite;
        }
        
        @keyframes pulse {
            0%, 100% { transform: scale(1); }
            50% { transform: scale(1.05); }
        }
        
        .welcome-section h1 {
            font-size: 2.5rem;
            font-weight: 700;
            margin-bottom: 1rem;
            text-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
        }
        
        .welcome-section p {
            font-size: 1.1rem;
            font-weight: 300;
            line-height: 1.8;
            margin-bottom: 2rem;
            opacity: 0.95;
        }
        
        .features {
            display: grid;
            gap: 1rem;
            margin-top: 2rem;
            text-align: left;
        }
        
        .feature-item {
            display: flex;
            align-items: center;
            gap: 1rem;
            background: rgba(255, 255, 255, 0.15);
            padding: 1rem 1.5rem;
            border-radius: 12px;
            backdrop-filter: blur(10px);
        }
        
        .feature-item i {
            font-size: 1.5rem;
        }
        
        .feature-item span {
            font-size: 0.95rem;
            font-weight: 400;
        }
        
        /* Right Side - Login Form */
        .form-section {
            padding: 4rem 3rem;
            display: flex;
            flex-direction: column;
            justify-content: center;
        }
        
        .form-header {
            text-align: center;
            margin-bottom: 2.5rem;
        }
        
        .form-header h2 {
            color: #2e7d32;
            font-size: 2rem;
            font-weight: 600;
            margin-bottom: 0.5rem;
        }
        
        .form-header p {
            color: #757575;
            font-size: 0.95rem;
        }
        
        .form-group {
            margin-bottom: 1.5rem;
        }
        
        .form-label {
            display: block;
            color: #424242;
            font-weight: 500;
            margin-bottom: 0.5rem;
            font-size: 0.9rem;
        }
        
        .form-control {
            width: 100%;
            padding: 0.875rem 1rem;
            padding-left: 3rem;
            border: 2px solid #e0e0e0;
            border-radius: 12px;
            font-size: 0.95rem;
            transition: all 0.3s ease;
            background: #fafafa;
        }
        
        .form-control:focus {
            outline: none;
            border-color: #4caf50;
            background: white;
            box-shadow: 0 0 0 4px rgba(76, 175, 80, 0.1);
        }
        
        .input-group {
            position: relative;
        }
        
        .input-icon {
            position: absolute;
            left: 1rem;
            top: 50%;
            transform: translateY(-50%);
            color: #9e9e9e;
            font-size: 1.1rem;
            z-index: 5;
        }
        
        .form-control:focus + .input-icon {
            color: #4caf50;
        }
        
        .btn-login {
            width: 100%;
            padding: 1rem;
            background: linear-gradient(135deg, #4caf50 0%, #66bb6a 100%);
            color: white;
            border: none;
            border-radius: 12px;
            font-size: 1rem;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s ease;
            box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
        }
        
        .btn-login:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
        }
        
        .btn-login:active {
            transform: translateY(0);
        }
        
        .remember-me {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            margin: 1rem 0;
        }
        
        .remember-me input[type="checkbox"] {
            width: 18px;
            height: 18px;
            cursor: pointer;
            accent-color: #4caf50;
        }
        
        .remember-me label {
            color: #616161;
            font-size: 0.9rem;
            cursor: pointer;
            margin: 0;
        }
        
        .divider {
            display: flex;
            align-items: center;
            text-align: center;
            margin: 2rem 0;
            color: #9e9e9e;
            font-size: 0.85rem;
        }
        
        .divider::before,
        .divider::after {
            content: '';
            flex: 1;
            border-bottom: 1px solid #e0e0e0;
        }
        
        .divider span {
            padding: 0 1rem;
        }
        
        .test-credentials {
            background: #f1f8f4;
            border: 1px solid #c8e6c9;
            border-radius: 12px;
            padding: 1.25rem;
            margin-top: 1.5rem;
        }
        
        .test-credentials .header {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            color: #2e7d32;
            font-weight: 600;
            margin-bottom: 1rem;
            font-size: 0.9rem;
        }
        
        .badge-container {
            display: flex;
            flex-wrap: wrap;
            gap: 0.5rem;
        }
        
        .test-badge {
            padding: 0.5rem 1rem;
            border-radius: 8px;
            font-size: 0.85rem;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.3s ease;
            border: none;
        }
        
        .test-badge:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        }
        
        .badge-superadmin { background: #ef5350; color: white; }
        .badge-admin-dinas { background: #42a5f5; color: white; }
        .badge-admin-kcd { background: #66bb6a; color: white; }
        .badge-pengawas { background: #26c6da; color: white; }
        .badge-admin-sekolah { background: #ffa726; color: white; }
        .badge-guru { background: #9e9e9e; color: white; }
        
        .password-hint {
            text-align: center;
            color: #757575;
            font-size: 0.85rem;
            margin-top: 0.75rem;
        }
        
        .password-hint strong {
            color: #2e7d32;
        }
        
        .alert {
            border-radius: 12px;
            padding: 1rem;
            margin-bottom: 1.5rem;
            border: none;
        }
        
        .alert-danger {
            background: #ffebee;
            color: #c62828;
        }
        
        /* Responsive */
        @media (max-width: 992px) {
            .login-wrapper {
                grid-template-columns: 1fr;
            }
            
            .welcome-section {
                padding: 3rem 2rem;
            }
            
            .welcome-section h1 {
                font-size: 2rem;
            }
            
            .form-section {
                padding: 3rem 2rem;
            }
        }
        
        @media (max-width: 576px) {
            .login-container {
                padding: 1rem;
            }
            
            .welcome-section,
            .form-section {
                padding: 2rem 1.5rem;
            }
            
            .badge-container {
                flex-direction: column;
            }
            
            .test-badge {
                width: 100%;
            }
        }
    </style>
</head>
<body>
    <!-- Background Shapes -->
    <div class="bg-shape shape-1"></div>
    <div class="bg-shape shape-2"></div>
    <div class="bg-shape shape-3"></div>
    
    <div class="login-container">
        <div class="login-wrapper">
            <!-- Left Side - Welcome Section -->
            <div class="welcome-section">
                <div class="welcome-content">
                    <div class="welcome-icon">
                        <i class="bi bi-mortarboard-fill"></i>
                    </div>
                    <h1>Selamat Datang</h1>
                    <p>Sistem Informasi Pendidikan Khusus<br>Dinas Pendidikan Jawa Barat</p>
                    
                    <div class="features">
                        <div class="feature-item">
                            <i class="bi bi-shield-check"></i>
                            <span>Multi-Role Access Control</span>
                        </div>
                        <div class="feature-item">
                            <i class="bi bi-graph-up"></i>
                            <span>Real-time Monitoring</span>
                        </div>
                        <div class="feature-item">
                            <i class="bi bi-speedometer2"></i>
                            <span>Optimized Performance</span>
                        </div>
                    </div>
                </div>
            </div>
            
            <!-- Right Side - Login Form -->
            <div class="form-section">
                <div class="form-header">
                    <h2>Masuk ke Akun</h2>
                    <p>Silakan login untuk melanjutkan</p>
                </div>
                
                @if($errors->any())
                <div class="alert alert-danger" role="alert">
                    <i class="bi bi-exclamation-triangle-fill"></i>
                    {{ $errors->first() }}
                </div>
                @endif
                
                <form method="POST" action="{{ route('login.post') }}">
                    @csrf
                    
                    <div class="form-group">
                        <label for="login" class="form-label">Email / NPSN</label>
                        <div class="input-group">
                            <input 
                                type="text" 
                                class="form-control @error('login') is-invalid @enderror" 
                                id="login" 
                                name="login" 
                                value="{{ old('login') }}"
                                placeholder="Email atau NPSN sekolah"
                                required 
                                autofocus
                            >
                            <i class="bi bi-envelope input-icon"></i>
                        </div>
                        @error('login')
                            <div class="invalid-feedback d-block">{{ $message }}</div>
                        @enderror
                        <small class="text-muted mt-1 d-block">
                            <i class="bi bi-info-circle"></i> Admin Sekolah gunakan NPSN, yang lain gunakan Email
                        </small>
                    </div>
                    
                    <div class="form-group">
                        <label for="password" class="form-label">Password</label>
                        <div class="input-group">
                            <input 
                                type="password" 
                                class="form-control" 
                                id="password" 
                                name="password"
                                placeholder="Masukkan password"
                                required
                            >
                            <i class="bi bi-lock input-icon"></i>
                        </div>
                    </div>
                    
                    <div class="remember-me">
                        <input type="checkbox" id="remember" name="remember">
                        <label for="remember">Ingat saya</label>
                    </div>
                    
                    <button type="submit" class="btn-login">
                        <i class="bi bi-box-arrow-in-right"></i> Masuk
                    </button>
                </form>
                
                <div class="divider">
                    <span>Akun Testing</span>
                </div>
                
                <div class="test-credentials">
                    <div class="header">
                        <i class="bi bi-info-circle-fill"></i>
                        <span>Klik role untuk quick login:</span>
                    </div>
                    <div class="badge-container">
                        <button class="test-badge badge-superadmin" onclick="fillLogin('superadmin@appsuper.test')">
                            Superadmin
                        </button>
                        <button class="test-badge badge-admin-dinas" onclick="fillLogin('admin.dinas@appsuper.test')">
                            Admin Dinas
                        </button>
                        <button class="test-badge badge-admin-kcd" onclick="fillLogin('admin.kcd1@appsuper.test')">
                            Admin KCD
                        </button>
                        <button class="test-badge badge-pengawas" onclick="fillLogin('pengawas.a@appsuper.test')">
                            Pengawas
                        </button>
                        <button class="test-badge badge-admin-sekolah" onclick="fillLogin('admin.slb@appsuper.test')">
                            Admin Sekolah
                        </button>
                        <button class="test-badge badge-guru" onclick="fillLogin('guru.pk@appsuper.test')">
                            Guru
                        </button>
                    </div>
                    <div class="password-hint">
                        Password semua akun: <strong>password123</strong>
                    </div>
                </div>
            </div>
        </div>
    </div>
    
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
    <script>
        function fillLogin(email) {
            document.getElementById('login').value = email;
            document.getElementById('password').value = 'password123';
            document.getElementById('password').focus();
        }
    </script>
</body>
</html>