<!DOCTYPE html>
<html lang="id">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Masuk Admin - SILAPOR Wonosalam</title>
    <link rel="icon" type="image/png" href="{{ asset('favicon.png') }}">

    <!-- Google Fonts -->
    <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=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap" rel="stylesheet">

    <!-- CSS Premium Dark Glassmorphism -->
    <style>
        :root {
            --bg-base: #09090b;
            --bg-surface: #121214;
            --bg-surface-elevated: #1a1a1e;
            
            --color-primary: #6366f1;
            --color-primary-glow: rgba(99, 102, 241, 0.15);
            --color-secondary: #ec4899;
            
            --text-main: #f4f4f5;
            --text-muted: #a1a1aa;
            
            --border-glow: rgba(255, 255, 255, 0.06);
            --border-focus: rgba(99, 102, 241, 0.4);
            
            --radius-sm: 8px;
            --radius-md: 16px;
            --radius-lg: 24px;
            
            --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
            --font-display: 'Outfit', sans-serif;
        }

        * {
            box-sizing: border-box;
            margin: 0;
            padding: 0;
        }

        body {
            background-color: var(--bg-base);
            color: var(--text-main);
            font-family: var(--font-sans);
            display: flex;
            min-height: 100vh;
            align-items: center;
            justify-content: center;
            overflow: hidden;
            position: relative;
        }

        /* Ambient Glow effect background */
        .ambient-glow-1 {
            position: absolute;
            width: 400px;
            height: 400px;
            border-radius: 50%;
            background: radial-gradient(circle, rgba(99, 102, 241, 0.12) 0%, rgba(0,0,0,0) 70%);
            top: -100px;
            left: -100px;
            filter: blur(40px);
            z-index: -1;
        }

        .ambient-glow-2 {
            position: absolute;
            width: 450px;
            height: 450px;
            border-radius: 50%;
            background: radial-gradient(circle, rgba(236, 72, 153, 0.08) 0%, rgba(0,0,0,0) 70%);
            bottom: -150px;
            right: -150px;
            filter: blur(40px);
            z-index: -1;
        }

        /* Login Card */
        .login-card {
            width: 420px;
            background: var(--bg-surface);
            border: 1px solid var(--border-glow);
            border-radius: var(--radius-lg);
            padding: 40px;
            box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
            backdrop-filter: blur(8px);
            z-index: 10;
        }

        .logo-group {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 12px;
            text-decoration: none;
            margin-bottom: 28px;
        }

        .logo-icon {
            width: 40px;
            height: 40px;
            object-fit: contain;
            border-radius: var(--radius-sm);
            box-shadow: 0 4px 15px rgba(99, 102, 241, 0.35);
        }

        .logo-text {
            display: flex;
            flex-direction: column;
            align-items: flex-start;
        }

        .logo-title {
            font-family: var(--font-display);
            font-weight: 700;
            font-size: 20px;
            color: #fff;
            letter-spacing: -0.5px;
        }

        .logo-sub {
            font-size: 11px;
            color: var(--text-muted);
            font-weight: 500;
            letter-spacing: 0.5px;
            text-transform: uppercase;
        }

        .card-heading {
            font-family: var(--font-display);
            font-weight: 700;
            font-size: 20px;
            text-align: center;
            margin-bottom: 8px;
            color: #fff;
        }

        .card-sub {
            font-size: 13px;
            color: var(--text-muted);
            text-align: center;
            margin-bottom: 28px;
        }

        /* Form Controls */
        .form-group {
            display: flex;
            flex-direction: column;
            gap: 8px;
            margin-bottom: 20px;
        }

        .form-group label {
            font-size: 13px;
            font-weight: 600;
            color: #fff;
        }

        .form-input {
            background: var(--bg-surface-elevated);
            border: 1px solid var(--border-glow);
            border-radius: var(--radius-sm);
            color: #fff;
            padding: 12px 16px;
            font-size: 14px;
            font-family: var(--font-sans);
            transition: var(--transition-smooth);
            width: 100%;
        }

        .form-input:focus {
            outline: none;
            border-color: var(--color-primary);
            box-shadow: 0 0 0 3px var(--color-primary-glow);
        }

        .remember-flex {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 24px;
            font-size: 13px;
        }

        .remember-checkbox {
            display: flex;
            align-items: center;
            gap: 8px;
            color: var(--text-muted);
            cursor: pointer;
        }

        .remember-checkbox input {
            cursor: pointer;
            accent-color: var(--color-primary);
        }

        .btn-submit {
            background: linear-gradient(135deg, var(--color-primary), #4f46e5);
            border: none;
            color: #fff;
            padding: 12px 24px;
            border-radius: var(--radius-sm);
            font-size: 14px;
            font-weight: 600;
            cursor: pointer;
            transition: var(--transition-smooth);
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
            width: 100%;
        }

        .btn-submit:hover {
            transform: translateY(-1px);
            box-shadow: 0 6px 18px rgba(99, 102, 241, 0.35);
        }

        /* Errors Alert */
        .alert {
            background: rgba(239, 68, 68, 0.08);
            border: 1px solid rgba(239, 68, 68, 0.2);
            color: #fecaca;
            padding: 12px 16px;
            border-radius: var(--radius-sm);
            font-size: 13px;
            margin-bottom: 20px;
            display: flex;
            align-items: flex-start;
            gap: 8px;
        }

        .alert-success {
            background: rgba(16, 185, 129, 0.08);
            border: 1px solid rgba(16, 185, 129, 0.2);
            color: #a7f3d0;
        }
    </style>
</head>
<body>

    <div class="ambient-glow-1"></div>
    <div class="ambient-glow-2"></div>

    <div class="login-card">
        <div class="logo-group">
            <img src="{{ asset('logo.png') }}" class="logo-icon" alt="SILAPOR Logo">
            <div class="logo-text">
                <span class="logo-title">SILAPOR</span>
                <span class="logo-sub">Kec. Wonosalam, Demak</span>
            </div>
        </div>

        <h2 class="card-heading">Portal Petugas Admin</h2>
        <p class="card-sub">Silakan masuk untuk mengelola pengaduan rakyat.</p>

        <!-- FLASH NOTIFICATION -->
        @if(session('success'))
            <div class="alert alert-success">
                <svg fill="currentColor" viewBox="0 0 20 20" width="16" height="16" style="margin-top:1px;"><path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z" clip-rule="evenodd" /></svg>
                <span>{{ session('success') }}</span>
            </div>
        @endif

        @if($errors->any())
            <div class="alert">
                <svg fill="currentColor" viewBox="0 0 20 20" width="16" height="16" style="margin-top:1px; flex-shrink:0;"><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7 4a1 1 0 11-2 0 1 1 0 012 0zm-1-9a1 1 0 00-1 1v4a1 1 0 102 0V6a1 1 0 00-1-1z" clip-rule="evenodd" /></svg>
                <div>
                    @foreach($errors->all() as $err)
                        <p>{{ $err }}</p>
                    @endforeach
                </div>
            </div>
        @endif

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

            <div class="form-group">
                <label for="email">Alamat Email</label>
                <input type="email" name="email" id="email" class="form-input" placeholder="admin@silapor.com" value="{{ old('email') }}" required autofocus>
            </div>

            <div class="form-group">
                <label for="password">Kata Sandi</label>
                <input type="password" name="password" id="password" class="form-input" placeholder="Masukkan password" required>
            </div>

            <div class="remember-flex">
                <label class="remember-checkbox">
                    <input type="checkbox" name="remember">
                    <span>Ingat Saya</span>
                </label>
                <a href="/" style="color: var(--color-primary); text-decoration: none; font-weight: 500;">Halaman Depan</a>
            </div>

            <button type="submit" class="btn-submit">
                Masuk ke Panel
                <svg fill="currentColor" viewBox="0 0 20 20" width="16" height="16"><path fill-rule="evenodd" d="M3 3a1 1 0 011 1v12a1 1 0 11-2 0V4a1 1 0 011-1zm10.293 9.293a1 1 0 001.414 1.414l3-3a1 1 0 000-1.414l-3-3a1 1 0 10-1.414 1.414L14.586 9H7a1 1 0 100 2h7.586l-1.293 1.293z" clip-rule="evenodd" /></svg>
            </button>
        </form>
    </div>

</body>
</html>
