{{-- resources/views/auth/super-admin-login.blade.php --}}
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Super Admin Login · WEPESI HOTEL MANAGEMENT SOULUTION</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <style>
        :root {
            --super-admin-green: #0b8f58;
            --super-admin-dark: #065f3b;
            --super-admin-glow: #1bbf77;
            --super-admin-soft: #e7f8ef;
        }

        body {
            background: #ffffff;
            min-height: 100vh;
            display: flex;
            align-items: center;
            justify-content: center;
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            padding: 20px;
        }

        .login-container {
            max-width: 450px;
            width: 100%;
        }

        .login-card {
            background: white;
            border-radius: 24px;
            border: 1px solid rgba(11, 143, 88, 0.2);
            box-shadow: 0 22px 60px rgba(6, 95, 59, 0.28);
            padding: 40px;
            animation: fadeInUp 0.5s ease;
        }

        @keyframes fadeInUp {
            from {
                opacity: 0;
                transform: translateY(30px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        .super-admin-icon {
            width: 80px;
            height: 80px;
            background: linear-gradient(135deg, var(--super-admin-green), var(--super-admin-dark));
            border-radius: 20px;
            display: flex;
            align-items: center;
            justify-content: center;
            margin: 0 auto 25px;
            font-size: 2.5rem;
            color: white;
            transform: rotate(0deg);
            transition: transform 0.3s;
        }

        .login-card:hover .super-admin-icon {
            transform: rotate(5deg) scale(1.05);
        }

        h2 {
            color: var(--super-admin-dark);
            font-weight: 700;
            text-align: center;
            margin-bottom: 10px;
        }

        .subtitle {
            color: #6c757d;
            text-align: center;
            margin-bottom: 30px;
            font-size: 0.95rem;
        }

        .badge {
            background: var(--super-admin-soft);
            color: var(--super-admin-dark);
            padding: 8px 16px;
            border-radius: 30px;
            display: inline-block;
            font-size: 0.8rem;
            font-weight: 600;
            margin-bottom: 25px;
        }

        .form-floating {
            margin-bottom: 20px;
        }

        .form-control:focus {
            border-color: var(--super-admin-green);
            box-shadow: 0 0 0 0.25rem rgba(11, 143, 88, 0.2);
        }

        .btn-login {
            background: linear-gradient(90deg, var(--super-admin-green), var(--super-admin-glow));
            color: white;
            border: none;
            padding: 14px;
            border-radius: 12px;
            font-weight: 600;
            width: 100%;
            font-size: 1.1rem;
            transition: all 0.3s;
            margin-top: 10px;
        }

        .btn-login:hover {
            transform: translateY(-2px);
            box-shadow: 0 12px 26px rgba(6, 95, 59, 0.36);
            background: linear-gradient(90deg, var(--super-admin-glow), #27d488);
        }

        .back-link {
            text-align: center;
            margin-top: 25px;
        }

        .back-link a {
            color: var(--super-admin-dark);
            text-decoration: none;
            font-size: 0.9rem;
            transition: color 0.2s;
        }

        .back-link a:hover {
            color: var(--super-admin-green);
        }

        .alert {
            border-radius: 12px;
            border: none;
        }

        .password-field-wrapper {
            position: relative;
        }

        .password-toggle {
            position: absolute;
            right: 15px;
            top: 50%;
            transform: translateY(-50%);
            background: none;
            border: none;
            color: #999;
            cursor: pointer;
            z-index: 10;
        }

        .password-toggle:hover {
            color: var(--super-admin-green);
        }
    </style>
</head>
<body>
    <div class="login-container">
        <div class="login-card">
            <div class="super-admin-icon">
                <i class="fas fa-shield-halved"></i>
            </div>

            <h2>WEPESI HOTEL MANAGEMENT SOULUTION</h2>
            <div class="subtitle">Super Admin · System Administrator Access</div>
            
            <div class="text-center mb-3">
                <span class="badge">
                    <i class="fas fa-crown me-1"></i> Central Command Center
                </span>
            </div>

            @if ($errors->any())
                <div class="alert alert-danger" role="alert">
                    <i class="fas fa-exclamation-circle me-2"></i>
                    <ul class="mb-0">
                        @foreach ($errors->all() as $error)
                            <li>{{ $error }}</li>
                        @endforeach
                    </ul>
                </div>
            @endif

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

                <div class="form-floating password-field-wrapper">
                    <input type="email" class="form-control @error('email') is-invalid @enderror" 
                           id="email" name="email" placeholder="admin@{{ request()->getHost() }}" 
                           value="{{ old('email') }}" required autofocus>
                    <label for="email"><i class="fa-regular fa-envelope me-1 text-secondary"></i> Admin Email</label>
                    @error('email')
                        <span class="invalid-feedback" role="alert">
                            <strong>{{ $message }}</strong>
                        </span>
                    @enderror
                </div>

                <div class="form-floating password-field-wrapper">
                    <input type="password" class="form-control @error('password') is-invalid @enderror" 
                           id="password" name="password" placeholder="Password" required>
                    <label for="password"><i class="fa-regular fa-key me-1 text-secondary"></i> Password</label>
                    <button type="button" class="password-toggle" onclick="togglePasswordVisibility()">
                        <i class="fa-regular fa-eye" id="toggleIcon"></i>
                    </button>
                    @error('password')
                        <span class="invalid-feedback" role="alert">
                            <strong>{{ $message }}</strong>
                        </span>
                    @enderror
                </div>

                <div class="form-check mb-3">
                    <input class="form-check-input" type="checkbox" name="remember" id="remember" {{ old('remember') ? 'checked' : '' }}>
                    <label class="form-check-label" for="remember">
                        Keep me signed in
                    </label>
                </div>

                <button type="submit" class="btn-login">
                    <i class="fas fa-sign-in-alt me-2"></i>
                    Access Dashboard
                </button>
            </form>

            <div class="back-link">
                <a href="{{ route('login') }}">
                    <i class="fas fa-arrow-left me-1"></i> Back to Staff Login
                </a>
            </div>
        </div>

        <div class="text-center mt-4">
            <small class="text-muted">
                <i class="fas fa-database me-1"></i> Manage Hotels · Subscriptions · System Settings
            </small>
        </div>
    </div>

    <script>
        function togglePasswordVisibility() {
            const passwordField = document.getElementById('password');
            const toggleIcon = document.getElementById('toggleIcon');
            
            if (passwordField.type === 'password') {
                passwordField.type = 'text';
                toggleIcon.classList.remove('fa-eye');
                toggleIcon.classList.add('fa-eye-slash');
            } else {
                passwordField.type = 'password';
                toggleIcon.classList.remove('fa-eye-slash');
                toggleIcon.classList.add('fa-eye');
            }
        }
    </script>
</body>
</html>