<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             x:Class="WorkFlowCheck.MAUI.Pages.Security.LoginPage"
             Title="Bejelentkezés"
             BackgroundColor="#f0f0f0">

    <ScrollView>
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="*" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="*" />
            </Grid.RowDefinitions>

            <!-- Középen lévő kártya, ami mobilon is jól mutat, tableten pedig középen marad -->
            <Frame Grid.Row="1"
                   BackgroundColor="White"
                   BorderColor="#cccccc"
                   CornerRadius="20"
                   Padding="30"
                   HasShadow="True"
                   HorizontalOptions="Center"
                   VerticalOptions="Center"
                   WidthRequest="{OnPlatform Android=350, iOS=350, WinUI=400, MacCatalyst=400}"
                   MaximumWidthRequest="500">

                <VerticalStackLayout Spacing="20">

                    <Label Text="Bejelentkezés"
                           FontSize="24"
                           FontAttributes="Bold"
                           HorizontalOptions="Center"
                           TextColor="#333" />

                    <Entry x:Name="UsernameEntry"
                           Placeholder="Felhasználói név"
                           FontSize="18"
                           BackgroundColor="#f9f9f9"
                           HeightRequest="50"
                           Margin="0" />

                    <Entry x:Name="PasswordEntry"
                           Placeholder="PIN kód"
                           IsPassword="True"
                           Keyboard="Numeric"
                           FontSize="18"
                           BackgroundColor="#f9f9f9"
                           HeightRequest="50"
                           Margin="0" />

                    <Button x:Name="LoginBtn"
                            Text="Bejelentkezés"
                            FontSize="18"
                            HeightRequest="50"
                            CornerRadius="10"
                            BackgroundColor="#007aff"
                            TextColor="White"
                            Clicked="OnLoginClicked" />

                    <ActivityIndicator x:Name="LoadingIndicator"
                                       IsRunning="False"
                                       IsVisible="False"
                                       HorizontalOptions="Center" />
                </VerticalStackLayout>
            </Frame>
        </Grid>
    </ScrollView>
</ContentPage>
