import { test, expect } from '@playwright/test';

test.describe('Admin Navigation & Protected Routes', () => {
  test('redirects unauthenticated user to login', async ({ page }) => {
    await page.goto('/');
    await expect(page).toHaveURL(/\/login/);
  });

  test('login page is responsive on mobile viewport', async ({ page }) => {
    await page.setViewportSize({ width: 375, height: 667 });
    await page.goto('/login');
    await expect(page.getByText('Platform Admin')).toBeVisible();
    await expect(page.getByLabel('Email')).toBeVisible();
  });

  test('admin login page has correct title', async ({ page }) => {
    await page.goto('/login');
    await expect(page).toHaveTitle(/admin/i);
  });
});
