<?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="CanYouBuildIt.Views.Login"
             Title="Login"
             BackgroundColor="#26B4BE">

    <AbsoluteLayout>

        <VerticalStackLayout
                BackgroundColor="#408097"
                AbsoluteLayout.LayoutBounds="0.5,0.5,500,700"
                AbsoluteLayout.LayoutFlags="PositionProportional">
            <Image Source="logologin.png"
                   Margin="25,60,25,0"/>

            <Label Text="Connexion"
                   Margin="25,60,25,0"
                   MaximumWidthRequest="160"
                   TextColor="White"
                   FontAttributes="Bold"
                   FontSize="30"
                   WidthRequest="500"/>
            
            
            <Entry  BackgroundColor="#EEEEFF"
                    Margin="25,60,25,0"
                    x:Name="Nom"
                    Placeholder="Nom"
                    PlaceholderColor="Black"
                    HeightRequest="20"/>

            <Entry  BackgroundColor="#EEEEFF"
                    Margin="25,60,25,0"       
                    x:Name="Mdp"
                    IsPassword="True"
                    Placeholder="Mot de Passe"
                    PlaceholderColor="Black"
                    HeightRequest="20"/>

            <HorizontalStackLayout>
                <Button BackgroundColor="DimGrey"
                        Margin="212,60,0,0"
                        x:Name="BtnValider"
                        Text="LOGIN"
                        FontAttributes="Bold"
                        TextColor="White"
                        Clicked="BoutonValider"
                        HorizontalOptions="Center" />

                <Button BackgroundColor="DimGrey"
                        Margin="90,60,0,0"
                        x:Name="btn_insc"
                        Text="Inscription"
                        FontAttributes="Bold"
                        TextColor="White"
                        Clicked="BackHome"
                        HorizontalOptions="Center" />
                
            </HorizontalStackLayout>

            <VerticalStackLayout>

                <Button BackgroundColor="DimGrey"
                        Margin="0,60"
                        x:Name="annul"
                        Text="Annuler"
                        FontAttributes="Bold"
                        TextColor="White"
                        Clicked="BackHome"
                        HorizontalOptions="Center" />

                <Label Text="WARNING ! Les champs Nom et Mot de Passe sont obligatoire."
                       IsVisible="false"
                       x:Name="error"
                       BackgroundColor="Red"
                       FontAttributes="Bold"
                       Padding="30"
                       Margin="0,30,0,0"
                       HorizontalOptions="Center"
                       WidthRequest="500"/>

                <Label Text="Le Nom et/ou le mdp sont erroné."
                       IsVisible="false"
                       x:Name="wrong"
                       BackgroundColor="Red"
                       FontAttributes="Bold"
                       Padding="30"
                       Margin="0,30,0,0"
                       HorizontalOptions="Center"
                       WidthRequest="500"/>

                <Label Text="Nom et MDP valide."
                       IsVisible="false"
                       x:Name="valide"
                       BackgroundColor="Green"
                       FontAttributes="Bold"
                       Padding="30"
                       Margin="0,30,0,0"
                       HorizontalOptions="Center"
                       WidthRequest="500"/>
            </VerticalStackLayout>
        </VerticalStackLayout>
    </AbsoluteLayout>

</ContentPage>