<Window x:Class="UI.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        WindowStartupLocation="CenterScreen"
        ResizeMode="NoResize"
        WindowStyle="None"
        Height="660"
        Width="1080"
        Background="#0D1117"
        MouseDown="Window_MouseDown">

    <Window.Resources>

        <!-- Animação de fade-in -->
        <Storyboard x:Key="FadeIn">
            <DoubleAnimation Storyboard.TargetProperty="Opacity"
                             From="0" To="1" Duration="0:0:0.5"
                             EasingFunction="{x:Null}"/>
        </Storyboard>

        <!-- Estilo dos itens do menu popup -->
        <Style x:Key="MenuItemStyle" TargetType="Button">
            <Setter Property="Background" Value="Transparent"/>
            <Setter Property="Foreground" Value="#8B9CC8"/>
            <Setter Property="BorderThickness" Value="0"/>
            <Setter Property="FontSize" Value="13"/>
            <Setter Property="Cursor" Value="Hand"/>
            <Setter Property="HorizontalContentAlignment" Value="Left"/>
            <Setter Property="Padding" Value="12 10"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="Button">
                        <Border x:Name="border"
                                Background="{TemplateBinding Background}"
                                CornerRadius="8"
                                Padding="{TemplateBinding Padding}">
                            <ContentPresenter/>
                        </Border>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsMouseOver" Value="True">
                                <Setter TargetName="border" Property="Background" Value="#1C2944"/>
                            </Trigger>
                            <Trigger Property="IsPressed" Value="True">
                                <Setter TargetName="border" Property="Background" Value="#131E35"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <!-- Estilo do campo de input -->
        <Style x:Key="InputFieldBorder" TargetType="Border">
            <Setter Property="Background" Value="#131E35"/>
            <Setter Property="CornerRadius" Value="12"/>
            <Setter Property="BorderThickness" Value="1"/>
            <Setter Property="BorderBrush" Value="#1E2D4A"/>
        </Style>

    </Window.Resources>

    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="1.15*"/>
            <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>

        <!-- ====================== -->
        <!-- LADO ESQUERDO          -->
        <!-- ====================== -->

        <Grid>
            <!-- Fundo com gradiente rico -->
            <Grid.Background>
                <LinearGradientBrush StartPoint="0,0" EndPoint="1,1">
                    <GradientStop Color="#0A1628" Offset="0"/>
                    <GradientStop Color="#0F1F3D" Offset="0.5"/>
                    <GradientStop Color="#0D1525" Offset="1"/>
                </LinearGradientBrush>
            </Grid.Background>

            <!-- Círculo decorativo de fundo (grande) -->
            <Ellipse Width="500" Height="500"
                     HorizontalAlignment="Left" VerticalAlignment="Bottom"
                     Margin="-150 0 0 -180"
                     Opacity="0.08">
                <Ellipse.Fill>
                    <RadialGradientBrush>
                        <GradientStop Color="#4F8EF7" Offset="0"/>
                        <GradientStop Color="Transparent" Offset="1"/>
                    </RadialGradientBrush>
                </Ellipse.Fill>
            </Ellipse>

            <!-- Círculo decorativo superior -->
            <Ellipse Width="300" Height="300"
                     HorizontalAlignment="Right" VerticalAlignment="Top"
                     Margin="0 -80 -60 0"
                     Opacity="0.06">
                <Ellipse.Fill>
                    <RadialGradientBrush>
                        <GradientStop Color="#6366F1" Offset="0"/>
                        <GradientStop Color="Transparent" Offset="1"/>
                    </RadialGradientBrush>
                </Ellipse.Fill>
            </Ellipse>

            <!-- Linha vertical decorativa -->
            <Rectangle Width="1" HorizontalAlignment="Right"
                       VerticalAlignment="Stretch" Margin="0">
                <Rectangle.Fill>
                    <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
                        <GradientStop Color="Transparent" Offset="0"/>
                        <GradientStop Color="#1E3A6E" Offset="0.4"/>
                        <GradientStop Color="#1E3A6E" Offset="0.6"/>
                        <GradientStop Color="Transparent" Offset="1"/>
                    </LinearGradientBrush>
                </Rectangle.Fill>
            </Rectangle>

            <StackPanel Margin="70 0 80 0" VerticalAlignment="Center">

                <!-- LOGO + NOME -->
                <StackPanel Orientation="Horizontal" Margin="0 0 0 10">
                    <!-- Logo recreada em XAML: 4 losangos azuis em grade 2x2 -->
                    <Viewbox Width="44" Height="44">
                        <Grid Width="100" Height="100">
                            <Grid.Effect>
                                <DropShadowEffect Color="#4F8EF7" BlurRadius="18"
                                                 ShadowDepth="0" Opacity="0.6"/>
                            </Grid.Effect>
                            <!-- Quadrante superior -->
                            <Path Fill="#3B82F6" RenderTransformOrigin="0.5,0.5">
                                <Path.Data>
                                    <PathGeometry>
                                        <PathFigure StartPoint="50,5" IsClosed="True">
                                            <LineSegment Point="78,33"/>
                                            <LineSegment Point="50,47"/>
                                            <LineSegment Point="22,33"/>
                                        </PathFigure>
                                    </PathGeometry>
                                </Path.Data>
                            </Path>
                            <!-- Quadrante direito -->
                            <Path RenderTransformOrigin="0.5,0.5">
                                <Path.Fill>
                                    <LinearGradientBrush StartPoint="0,0" EndPoint="1,1">
                                        <GradientStop Color="#60A5FA" Offset="0"/>
                                        <GradientStop Color="#3B82F6" Offset="1"/>
                                    </LinearGradientBrush>
                                </Path.Fill>
                                <Path.Data>
                                    <PathGeometry>
                                        <PathFigure StartPoint="53,50" IsClosed="True">
                                            <LineSegment Point="78,33"/>
                                            <LineSegment Point="95,50"/>
                                            <LineSegment Point="78,67"/>
                                        </PathFigure>
                                    </PathGeometry>
                                </Path.Data>
                            </Path>
                            <!-- Quadrante inferior -->
                            <Path RenderTransformOrigin="0.5,0.5">
                                <Path.Fill>
                                    <LinearGradientBrush StartPoint="0,1" EndPoint="1,0">
                                        <GradientStop Color="#2563EB" Offset="0"/>
                                        <GradientStop Color="#3B82F6" Offset="1"/>
                                    </LinearGradientBrush>
                                </Path.Fill>
                                <Path.Data>
                                    <PathGeometry>
                                        <PathFigure StartPoint="50,53" IsClosed="True">
                                            <LineSegment Point="78,67"/>
                                            <LineSegment Point="50,95"/>
                                            <LineSegment Point="22,67"/>
                                        </PathFigure>
                                    </PathGeometry>
                                </Path.Data>
                            </Path>
                            <!-- Quadrante esquerdo -->
                            <Path RenderTransformOrigin="0.5,0.5">
                                <Path.Fill>
                                    <LinearGradientBrush StartPoint="0,0" EndPoint="1,1">
                                        <GradientStop Color="#3B82F6" Offset="0"/>
                                        <GradientStop Color="#2563EB" Offset="1"/>
                                    </LinearGradientBrush>
                                </Path.Fill>
                                <Path.Data>
                                    <PathGeometry>
                                        <PathFigure StartPoint="47,50" IsClosed="True">
                                            <LineSegment Point="22,33"/>
                                            <LineSegment Point="5,50"/>
                                            <LineSegment Point="22,67"/>
                                        </PathFigure>
                                    </PathGeometry>
                                </Path.Data>
                            </Path>
                        </Grid>
                    </Viewbox>
                    <StackPanel Margin="14 0 0 0" VerticalAlignment="Center">
                        <TextBlock Text="Levelcode" Foreground="White"
                                   FontSize="22" FontWeight="Bold"/>
                        <TextBlock Text="SGI  —  Gestão Integrada"
                                   Foreground="#4F6A99" FontSize="11"
                                   Margin="1 2 0 0"/>
                    </StackPanel>
                </StackPanel>

                <!-- SEPARADOR SUTIL -->
                <Rectangle Height="1" Margin="0 22 0 28">
                    <Rectangle.Fill>
                        <LinearGradientBrush StartPoint="0,0" EndPoint="1,0">
                            <GradientStop Color="#1E3A6E" Offset="0"/>
                            <GradientStop Color="Transparent" Offset="1"/>
                        </LinearGradientBrush>
                    </Rectangle.Fill>
                </Rectangle>

                <!-- TAGLINE -->
                <TextBlock Text="Seu negócio,&#x0a;inteligente e conectado."
                           Foreground="White"
                           FontSize="30"
                           FontWeight="Bold"
                           LineHeight="42"
                           Margin="0 0 0 16"/>

                <TextBlock Text="Gerencie processos, pessoas e decisões&#x0a;com clareza e velocidade."
                           Foreground="#4F6A99"
                           FontSize="14"
                           LineHeight="24"
                           Margin="0 0 0 36"/>

                <!-- PILLS DE FEATURE -->
                <StackPanel Margin="0 0 0 40">
                    <Border Background="#101D33" CornerRadius="30"
                            Padding="14 8" HorizontalAlignment="Left"
                            Margin="0 0 0 10">
                        <Border.BorderBrush>
                            <LinearGradientBrush StartPoint="0,0" EndPoint="1,0">
                                <GradientStop Color="#1E3A6E" Offset="0"/>
                                <GradientStop Color="#1A3055" Offset="1"/>
                            </LinearGradientBrush>
                        </Border.BorderBrush>
                        <Border.BorderThickness>1</Border.BorderThickness>
                        <StackPanel Orientation="Horizontal">
                            <TextBlock Text="✦" Foreground="#4F8EF7"
                                       FontSize="10" Margin="0 0 8 0"
                                       VerticalAlignment="Center"/>
                            <TextBlock Text="Dashboards e relatórios em tempo real"
                                       Foreground="#7B93B8" FontSize="13"/>
                        </StackPanel>
                    </Border>

                    <Border Background="#101D33" CornerRadius="30"
                            Padding="14 8" HorizontalAlignment="Left">
                        <Border.BorderBrush>
                            <LinearGradientBrush StartPoint="0,0" EndPoint="1,0">
                                <GradientStop Color="#1E3A6E" Offset="0"/>
                                <GradientStop Color="#1A3055" Offset="1"/>
                            </LinearGradientBrush>
                        </Border.BorderBrush>
                        <Border.BorderThickness>1</Border.BorderThickness>
                        <StackPanel Orientation="Horizontal">
                            <TextBlock Text="✦" Foreground="#6366F1"
                                       FontSize="10" Margin="0 0 8 0"
                                       VerticalAlignment="Center"/>
                            <TextBlock Text="Gestão de pessoas e processos"
                                       Foreground="#7B93B8" FontSize="13"/>
                        </StackPanel>
                    </Border>
                </StackPanel>

                <!-- CARD PREVIEW COM BLUR/GLASS -->
                <Border CornerRadius="16" Height="180"
                        BorderThickness="1">
                    <Border.Background>
                        <LinearGradientBrush StartPoint="0,0" EndPoint="1,1">
                            <GradientStop Color="#0E1C33" Offset="0"/>
                            <GradientStop Color="#0B1525" Offset="1"/>
                        </LinearGradientBrush>
                    </Border.Background>
                    <Border.BorderBrush>
                        <LinearGradientBrush StartPoint="0,0" EndPoint="1,1">
                            <GradientStop Color="#243D6B" Offset="0"/>
                            <GradientStop Color="#1A2D50" Offset="1"/>
                        </LinearGradientBrush>
                    </Border.BorderBrush>
                    <Border.Effect>
                        <DropShadowEffect Color="#000000" Opacity="0.4"
                                         BlurRadius="20" ShadowDepth="4"/>
                    </Border.Effect>

                    <Grid Margin="24 20">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="*"/>
                        </Grid.RowDefinitions>

                        <!-- Header do card -->
                        <StackPanel Orientation="Horizontal" Margin="0 0 0 16">
                            <Ellipse Width="8" Height="8" Fill="#4F8EF7" Margin="0 0 6 0"/>
                            <Ellipse Width="8" Height="8" Fill="#6366F1" Margin="0 0 6 0"/>
                            <Ellipse Width="8" Height="8" Fill="#22C55E" Margin="0 0 0 0"/>
                            <TextBlock Text="Dashboard · Visão Geral"
                                       Foreground="#3A5480" FontSize="11"
                                       Margin="16 0 0 0" VerticalAlignment="Center"/>
                        </StackPanel>

                        <!-- Barras de preview -->
                        <StackPanel Grid.Row="1" Orientation="Horizontal"
                                    VerticalAlignment="Bottom">
                            <StackPanel Margin="0 0 8 0" VerticalAlignment="Bottom">
                                <Rectangle Width="22" Height="60" Fill="#1A3A6E"
                                           RadiusX="4" RadiusY="4"/>
                            </StackPanel>
                            <StackPanel Margin="0 0 8 0" VerticalAlignment="Bottom">
                                <Rectangle Width="22" Height="90" Fill="#1E4080"
                                           RadiusX="4" RadiusY="4"/>
                            </StackPanel>
                            <StackPanel Margin="0 0 8 0" VerticalAlignment="Bottom">
                                <Rectangle Width="22" Height="50" Fill="#1A3A6E"
                                           RadiusX="4" RadiusY="4"/>
                            </StackPanel>
                            <StackPanel Margin="0 0 8 0" VerticalAlignment="Bottom">
                                <Rectangle Width="22" Height="110" Fill="#4F8EF7"
                                           RadiusX="4" RadiusY="4">
                                    <Rectangle.Effect>
                                        <DropShadowEffect Color="#4F8EF7" BlurRadius="10"
                                                         ShadowDepth="0" Opacity="0.6"/>
                                    </Rectangle.Effect>
                                </Rectangle>
                            </StackPanel>
                            <StackPanel Margin="0 0 8 0" VerticalAlignment="Bottom">
                                <Rectangle Width="22" Height="75" Fill="#1E4080"
                                           RadiusX="4" RadiusY="4"/>
                            </StackPanel>
                            <StackPanel Margin="0 0 8 0" VerticalAlignment="Bottom">
                                <Rectangle Width="22" Height="95" Fill="#243D6B"
                                           RadiusX="4" RadiusY="4"/>
                            </StackPanel>
                            <StackPanel Margin="0 0 8 0" VerticalAlignment="Bottom">
                                <Rectangle Width="22" Height="130" Fill="#6366F1"
                                           RadiusX="4" RadiusY="4">
                                    <Rectangle.Effect>
                                        <DropShadowEffect Color="#6366F1" BlurRadius="10"
                                                         ShadowDepth="0" Opacity="0.5"/>
                                    </Rectangle.Effect>
                                </Rectangle>
                            </StackPanel>

                            <!-- Stats à direita -->
                            <StackPanel Margin="24 0 0 0" VerticalAlignment="Center">
                                <TextBlock Text="+24.5%" Foreground="#22C55E"
                                           FontSize="22" FontWeight="Bold"/>
                                <TextBlock Text="Crescimento mensal"
                                           Foreground="#3A5480" FontSize="11"
                                           Margin="0 4 0 0"/>
                                <Rectangle Height="1" Fill="#1E3A6E" Margin="0 10"/>
                                <TextBlock Text="↑ 1.284 registros"
                                           Foreground="#4F6A99" FontSize="12"/>
                            </StackPanel>
                        </StackPanel>
                    </Grid>
                </Border>

            </StackPanel>
        </Grid>

        <!-- ====================== -->
        <!-- LADO DIREITO - LOGIN    -->
        <!-- ====================== -->

        <Grid Grid.Column="1">
            <Grid.Background>
                <LinearGradientBrush StartPoint="0,0" EndPoint="1,1">
                    <GradientStop Color="#0D1117" Offset="0"/>
                    <GradientStop Color="#0A1020" Offset="1"/>
                </LinearGradientBrush>
            </Grid.Background>

            <!-- Círculo de luz suave atrás do form -->
            <Ellipse Width="420" Height="420"
                     HorizontalAlignment="Center"
                     VerticalAlignment="Center"
                     Opacity="0.04">
                <Ellipse.Fill>
                    <RadialGradientBrush>
                        <GradientStop Color="#4F8EF7" Offset="0"/>
                        <GradientStop Color="Transparent" Offset="1"/>
                    </RadialGradientBrush>
                </Ellipse.Fill>
            </Ellipse>

            <StackPanel Width="340"
                        HorizontalAlignment="Center"
                        VerticalAlignment="Center">

                <!-- AVATAR COM ANEL GRADIENTE -->
                <Grid Width="100" Height="100"
                      HorizontalAlignment="Center"
                      Margin="0 0 0 24">
                    <!-- Anel externo com gradiente -->
                    <Ellipse Width="100" Height="100">
                        <Ellipse.Fill>
                            <LinearGradientBrush StartPoint="0,0" EndPoint="1,1">
                                <GradientStop Color="#4F8EF7" Offset="0"/>
                                <GradientStop Color="#6366F1" Offset="1"/>
                            </LinearGradientBrush>
                        </Ellipse.Fill>
                        <Ellipse.Effect>
                            <DropShadowEffect Color="#4F8EF7" BlurRadius="18"
                                             ShadowDepth="0" Opacity="0.5"/>
                        </Ellipse.Effect>
                    </Ellipse>
                    <!-- Inner border -->
                    <Ellipse Width="93" Height="93" Fill="#0D1117"/>
                    <!-- Avatar: logo recreada em XAML -->
                    <Border Width="86" Height="86" CornerRadius="43" ClipToBounds="True">
                        <Border.Background>
                            <LinearGradientBrush StartPoint="0,0" EndPoint="1,1">
                                <GradientStop Color="#1A2D50" Offset="0"/>
                                <GradientStop Color="#131E35" Offset="1"/>
                            </LinearGradientBrush>
                        </Border.Background>
                        <Viewbox Width="54" Height="54"
                                 HorizontalAlignment="Center"
                                 VerticalAlignment="Center">
                            <Grid Width="100" Height="100">
                                <!-- Quadrante superior -->
                                <Path Fill="#3B82F6">
                                    <Path.Data>
                                        <PathGeometry>
                                            <PathFigure StartPoint="50,5" IsClosed="True">
                                                <LineSegment Point="78,33"/>
                                                <LineSegment Point="50,47"/>
                                                <LineSegment Point="22,33"/>
                                            </PathFigure>
                                        </PathGeometry>
                                    </Path.Data>
                                </Path>
                                <!-- Quadrante direito -->
                                <Path>
                                    <Path.Fill>
                                        <LinearGradientBrush StartPoint="0,0" EndPoint="1,1">
                                            <GradientStop Color="#60A5FA" Offset="0"/>
                                            <GradientStop Color="#3B82F6" Offset="1"/>
                                        </LinearGradientBrush>
                                    </Path.Fill>
                                    <Path.Data>
                                        <PathGeometry>
                                            <PathFigure StartPoint="53,50" IsClosed="True">
                                                <LineSegment Point="78,33"/>
                                                <LineSegment Point="95,50"/>
                                                <LineSegment Point="78,67"/>
                                            </PathFigure>
                                        </PathGeometry>
                                    </Path.Data>
                                </Path>
                                <!-- Quadrante inferior -->
                                <Path>
                                    <Path.Fill>
                                        <LinearGradientBrush StartPoint="0,1" EndPoint="1,0">
                                            <GradientStop Color="#2563EB" Offset="0"/>
                                            <GradientStop Color="#3B82F6" Offset="1"/>
                                        </LinearGradientBrush>
                                    </Path.Fill>
                                    <Path.Data>
                                        <PathGeometry>
                                            <PathFigure StartPoint="50,53" IsClosed="True">
                                                <LineSegment Point="78,67"/>
                                                <LineSegment Point="50,95"/>
                                                <LineSegment Point="22,67"/>
                                            </PathFigure>
                                        </PathGeometry>
                                    </Path.Data>
                                </Path>
                                <!-- Quadrante esquerdo -->
                                <Path>
                                    <Path.Fill>
                                        <LinearGradientBrush StartPoint="0,0" EndPoint="1,1">
                                            <GradientStop Color="#3B82F6" Offset="0"/>
                                            <GradientStop Color="#2563EB" Offset="1"/>
                                        </LinearGradientBrush>
                                    </Path.Fill>
                                    <Path.Data>
                                        <PathGeometry>
                                            <PathFigure StartPoint="47,50" IsClosed="True">
                                                <LineSegment Point="22,33"/>
                                                <LineSegment Point="5,50"/>
                                                <LineSegment Point="22,67"/>
                                            </PathFigure>
                                        </PathGeometry>
                                    </Path.Data>
                                </Path>
                            </Grid>
                        </Viewbox>
                    </Border>
                </Grid>

                <!-- SAUDAÇÃO -->
                <TextBlock HorizontalAlignment="Center" Margin="0 0 0 6">
                    <Run Text="Bem-vindo" Foreground="White"
                         FontSize="26" FontWeight="Bold"/>
                    <Run Text=" de volta!" Foreground="#4F6A99" FontSize="26"/>
                </TextBlock>
                <TextBlock Text="Faça login para continuar"
                           Foreground="#2F4570"
                           FontSize="13"
                           HorizontalAlignment="Center"
                           Margin="0 0 0 34"/>

                <!-- EMAIL -->
                <TextBlock Text="EMAIL" Foreground="#2F4570"
                           FontSize="10"
                           Margin="4 0 0 6"/>
                <Border Style="{StaticResource InputFieldBorder}"
                        Margin="0 0 0 18">
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="44"/>
                            <ColumnDefinition Width="*"/>
                        </Grid.ColumnDefinitions>
                        <TextBlock Text="✉" Foreground="#2F4570"
                                   FontSize="15"
                                   HorizontalAlignment="Center"
                                   VerticalAlignment="Center"/>
                        <TextBox x:Name="TxtEmail"
                                 Grid.Column="1" Height="46"
                                 Background="Transparent"
                                 BorderThickness="0"
                                 Padding="0 10 12 10"
                                 Foreground="White"
                                 FontSize="14"
                                 CaretBrush="#4F8EF7"
                                 VerticalContentAlignment="Center"/>
                    </Grid>
                </Border>

                <!-- SENHA -->
                <TextBlock Text="SENHA" Foreground="#2F4570"
                           FontSize="10"
                           Margin="4 0 0 6"/>
                <Border Style="{StaticResource InputFieldBorder}"
                        Margin="0 0 0 10">
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="44"/>
                            <ColumnDefinition Width="*"/>
                            <ColumnDefinition Width="44"/>
                        </Grid.ColumnDefinitions>
                        <TextBlock Text="🔒" Foreground="#2F4570"
                                   FontSize="14"
                                   HorizontalAlignment="Center"
                                   VerticalAlignment="Center"/>
                        <PasswordBox x:Name="PboxSenha"
                                     Grid.Column="1" Height="46"
                                     Background="Transparent"
                                     BorderThickness="0"
                                     Padding="0 10 12 10"
                                     Foreground="White"
                                     VerticalContentAlignment="Center"/>
                        <Button Grid.Column="2" Background="Transparent"
                                BorderThickness="0" Cursor="Hand"
                                Click="BtnMostrarSenha_Click">
                            <Button.Style>
                                <Style TargetType="Button">
                                    <Setter Property="Template">
                                        <Setter.Value>
                                            <ControlTemplate TargetType="Button">
                                                <Border Background="Transparent"
                                                        Width="44" Height="46">
                                                    <TextBlock x:Name="eyeIcon"
                                                               Text="👁" FontSize="14"
                                                               Foreground="#2F4570"
                                                               HorizontalAlignment="Center"
                                                               VerticalAlignment="Center"/>
                                                </Border>
                                                <ControlTemplate.Triggers>
                                                    <Trigger Property="IsMouseOver" Value="True">
                                                        <Setter TargetName="eyeIcon"
                                                                Property="Foreground"
                                                                Value="#4F8EF7"/>
                                                    </Trigger>
                                                </ControlTemplate.Triggers>
                                            </ControlTemplate>
                                        </Setter.Value>
                                    </Setter>
                                </Style>
                            </Button.Style>
                        </Button>
                    </Grid>
                </Border>

                <!-- ESQUECEU SENHA -->
                <TextBlock Text="Esqueceu sua senha?"
                           Foreground="#4F8EF7"
                           HorizontalAlignment="Right"
                           Cursor="Hand"
                           FontSize="12"
                           Margin="0 6 4 28"/>

                <!-- BOTÃO ENTRAR -->
                <Button Content="Entrar"
                        Height="50" FontSize="15"
                        FontWeight="SemiBold"
                        Foreground="White"
                        BorderThickness="0"
                        Cursor="Hand"
                        Click="BtnEntrar_Click">
                    <Button.Background>
                        <LinearGradientBrush StartPoint="0,0" EndPoint="1,0">
                            <GradientStop Color="#3B82F6" Offset="0"/>
                            <GradientStop Color="#6366F1" Offset="1"/>
                        </LinearGradientBrush>
                    </Button.Background>
                    <Button.Style>
                        <Style TargetType="Button">
                            <Setter Property="Template">
                                <Setter.Value>
                                    <ControlTemplate TargetType="Button">
                                        <Border x:Name="btnBorder"
                                                Background="{TemplateBinding Background}"
                                                CornerRadius="12"
                                                Height="{TemplateBinding Height}">
                                            <Border.Effect>
                                                <DropShadowEffect x:Name="btnShadow"
                                                                  Color="#3B82F6"
                                                                  BlurRadius="18"
                                                                  ShadowDepth="0"
                                                                  Opacity="0.45"/>
                                            </Border.Effect>
                                            <StackPanel Orientation="Horizontal"
                                                        HorizontalAlignment="Center"
                                                        VerticalAlignment="Center">
                                                <TextBlock Text="Entrar"
                                                           Foreground="White"
                                                           FontSize="15"
                                                           FontWeight="SemiBold"
                                                           VerticalAlignment="Center"/>
                                                <TextBlock Text=" →"
                                                           Foreground="#A5C8FF"
                                                           FontSize="15"
                                                           VerticalAlignment="Center"/>
                                            </StackPanel>
                                        </Border>
                                        <ControlTemplate.Triggers>
                                            <Trigger Property="IsMouseOver" Value="True">
                                                <Setter TargetName="btnBorder"
                                                        Property="Opacity" Value="0.88"/>
                                            </Trigger>
                                            <Trigger Property="IsPressed" Value="True">
                                                <Setter TargetName="btnBorder"
                                                        Property="Opacity" Value="0.72"/>
                                            </Trigger>
                                        </ControlTemplate.Triggers>
                                    </ControlTemplate>
                                </Setter.Value>
                            </Setter>
                        </Style>
                    </Button.Style>
                </Button>

                <!-- DIVISOR -->
                <Grid Margin="0 22 0 22">
                    <Rectangle Height="1" Fill="#131E35"/>
                    <Border Background="#0D1117"
                            HorizontalAlignment="Center"
                            Padding="12 0">
                        <TextBlock Text="ou" Foreground="#1E3050" FontSize="12"/>
                    </Border>
                </Grid>

                <!-- CRIAR CONTA -->
                <Border CornerRadius="12" BorderThickness="1"
                        Cursor="Hand" Padding="0 13">
                    <Border.BorderBrush>
                        <LinearGradientBrush StartPoint="0,0" EndPoint="1,0">
                            <GradientStop Color="#1E3A6E" Offset="0"/>
                            <GradientStop Color="#1A2D50" Offset="1"/>
                        </LinearGradientBrush>
                    </Border.BorderBrush>
                    <Border.Background>
                        <SolidColorBrush Color="#0E1828"/>
                    </Border.Background>
                    <TextBlock HorizontalAlignment="Center" FontSize="13">
                        <Run Text="Não tem conta? " Foreground="#3A5480"/>
                        <Run Text="Criar conta grátis" Foreground="#4F8EF7"
                             FontWeight="SemiBold"/>
                    </TextBlock>
                </Border>

                <!-- VERSÃO DO SISTEMA -->
                <TextBlock Text="v2.4.1 · Levelcode SGI"
                           Foreground="#1A2D45"
                           FontSize="10"
                           HorizontalAlignment="Center"
                           Margin="0 22 0 0"/>

            </StackPanel>
        </Grid>

        <!-- ====================== -->
        <!-- BOTÃO FECHAR            -->
        <!-- ====================== -->

        <Button x:Name="BtnFechar"
                Width="32" Height="32"
                HorizontalAlignment="Right" VerticalAlignment="Top"
                Margin="0 14 14 0"
                Grid.ColumnSpan="2"
                BorderThickness="0" Cursor="Hand"
                Click="BtnFechar_Click">
            <Button.Style>
                <Style TargetType="Button">
                    <Setter Property="Background" Value="Transparent"/>
                    <Setter Property="Template">
                        <Setter.Value>
                            <ControlTemplate TargetType="Button">
                                <Border x:Name="border"
                                        Background="{TemplateBinding Background}"
                                        CornerRadius="8" Width="32" Height="32">
                                    <TextBlock Text="✕" FontSize="12"
                                               Foreground="#2F4570"
                                               HorizontalAlignment="Center"
                                               VerticalAlignment="Center"/>
                                </Border>
                                <ControlTemplate.Triggers>
                                    <Trigger Property="IsMouseOver" Value="True">
                                        <Setter TargetName="border"
                                                Property="Background" Value="#C53030"/>
                                        <Setter Property="Foreground" Value="White"/>
                                    </Trigger>
                                    <Trigger Property="IsPressed" Value="True">
                                        <Setter TargetName="border"
                                                Property="Background" Value="#9B2C2C"/>
                                    </Trigger>
                                </ControlTemplate.Triggers>
                            </ControlTemplate>
                        </Setter.Value>
                    </Setter>
                </Style>
            </Button.Style>
        </Button>

        <!-- ====================== -->
        <!-- BOTÃO CONFIGURAÇÕES     -->
        <!-- ====================== -->

        <Button x:Name="BtnConfiguracoes"
                Width="36" Height="36"
                HorizontalAlignment="Right" VerticalAlignment="Bottom"
                Margin="0 0 14 14"
                Grid.ColumnSpan="2"
                BorderThickness="0" Cursor="Hand"
                Click="BtnConfiguracoes_Click">
            <Button.Style>
                <Style TargetType="Button">
                    <Setter Property="Background" Value="#101A2E"/>
                    <Setter Property="Template">
                        <Setter.Value>
                            <ControlTemplate TargetType="Button">
                                <Border x:Name="border"
                                        Background="{TemplateBinding Background}"
                                        CornerRadius="10"
                                        BorderThickness="1"
                                        BorderBrush="#1E3A6E"
                                        Width="36" Height="36">
                                    <Path x:Name="gear"
                                          Fill="#2F4570"
                                          HorizontalAlignment="Center"
                                          VerticalAlignment="Center"
                                          Width="16" Height="16"
                                          Stretch="Uniform"
                                          Data="M19.14,12.94c0.04-0.3,0.06-0.61,0.06-0.94c0-0.32-0.02-0.64-0.07-0.94l2.03-1.58
                                                c0.18-0.14,0.23-0.41,0.12-0.61l-1.92-3.32c-0.12-0.22-0.37-0.29-0.59-0.22l-2.39,0.96
                                                c-0.5-0.38-1.03-0.7-1.62-0.94L14.4,2.81c-0.04-0.24-0.24-0.41-0.48-0.41h-3.84
                                                c-0.24,0-0.43,0.17-0.47,0.41L9.25,5.35C8.66,5.59,8.12,5.92,7.63,6.29L5.24,5.33
                                                c-0.22-0.08-0.47,0-0.59,0.22L2.74,8.87C2.62,9.08,2.66,9.34,2.86,9.48l2.03,1.58
                                                C4.84,11.36,4.8,11.69,4.8,12s0.02,0.64,0.07,0.94l-2.03,1.58c-0.18,0.14-0.23,0.41-0.12,0.61
                                                l1.92,3.32c0.12,0.22,0.37,0.29,0.59,0.22l2.39-0.96c0.5,0.38,1.03,0.7,1.62,0.94l0.36,2.54
                                                c0.05,0.24,0.24,0.41,0.48,0.41h3.84c0.24,0,0.44-0.17,0.47-0.41l0.36-2.54
                                                c0.59-0.24,1.13-0.56,1.62-0.94l2.39,0.96c0.22,0.08,0.47,0,0.59-0.22l1.92-3.32
                                                c0.12-0.22,0.07-0.47-0.12-0.61L19.14,12.94z
                                                M12,15.6c-1.98,0-3.6-1.62-3.6-3.6s1.62-3.6,3.6-3.6s3.6,1.62,3.6,3.6S13.98,15.6,12,15.6z"/>
                                </Border>
                                <ControlTemplate.Triggers>
                                    <Trigger Property="IsMouseOver" Value="True">
                                        <Setter TargetName="border" Property="Background" Value="#1A2D50"/>
                                        <Setter TargetName="gear" Property="Fill" Value="#4F8EF7"/>
                                    </Trigger>
                                    <Trigger Property="IsPressed" Value="True">
                                        <Setter TargetName="border" Property="Background" Value="#0D1525"/>
                                    </Trigger>
                                </ControlTemplate.Triggers>
                            </ControlTemplate>
                        </Setter.Value>
                    </Setter>
                </Style>
            </Button.Style>
        </Button>

        <!-- ====================== -->
        <!-- POPUP CONFIGURAÇÕES     -->
        <!-- ====================== -->

        <Popup x:Name="PopupConfiguracoes"
               PlacementTarget="{Binding ElementName=BtnConfiguracoes}"
               Placement="Top"
               HorizontalOffset="-170"
               VerticalOffset="-8"
               StaysOpen="False"
               AllowsTransparency="True">

            <Border Background="#0C1628"
                    CornerRadius="14"
                    BorderBrush="#1E3A6E"
                    BorderThickness="1"
                    Width="220"
                    Padding="8">

                <Border.Effect>
                    <DropShadowEffect Color="#000000"
                                      Opacity="0.7"
                                      BlurRadius="28"
                                      ShadowDepth="6"/>
                </Border.Effect>

                <StackPanel>

                    <StackPanel Orientation="Horizontal" Margin="12 10 12 4">
                        <TextBlock Text="C O N F I G U R A Ç Õ E S"
                                   Foreground="#4F8EF7"
                                   FontSize="10"
                                   FontWeight="SemiBold"/>
                    </StackPanel>

                    <Rectangle Height="1" Margin="0 8 0 6">
                        <Rectangle.Fill>
                            <LinearGradientBrush StartPoint="0,0" EndPoint="1,0">
                                <GradientStop Color="#1E3A6E" Offset="0"/>
                                <GradientStop Color="Transparent" Offset="1"/>
                            </LinearGradientBrush>
                        </Rectangle.Fill>
                    </Rectangle>

                    <Button Style="{StaticResource MenuItemStyle}" Click="MenuAparencia_Click">
                        <StackPanel Orientation="Horizontal">
                            <TextBlock Text="🎨" FontSize="13" Margin="0 0 10 0" VerticalAlignment="Center"/>
                            <TextBlock Text="Aparência" VerticalAlignment="Center"/>
                        </StackPanel>
                    </Button>

                    <Button Style="{StaticResource MenuItemStyle}" Click="MenuIdioma_Click">
                        <StackPanel Orientation="Horizontal">
                            <TextBlock Text="🌐" FontSize="13" Margin="0 0 10 0" VerticalAlignment="Center"/>
                            <TextBlock Text="Idioma" VerticalAlignment="Center"/>
                        </StackPanel>
                    </Button>

                    <Button Style="{StaticResource MenuItemStyle}" Click="MenuConexao_Click">
                        <StackPanel Orientation="Horizontal">
                            <TextBlock Text="🔌" FontSize="13" Margin="0 0 10 0" VerticalAlignment="Center"/>
                            <TextBlock Text="Conexão com banco" VerticalAlignment="Center"/>
                        </StackPanel>
                    </Button>

                    <Button Style="{StaticResource MenuItemStyle}" Click="MenuSobre_Click">
                        <StackPanel Orientation="Horizontal">
                            <TextBlock Text="ℹ" FontSize="13" Margin="0 0 10 0" VerticalAlignment="Center"/>
                            <TextBlock Text="Sobre o sistema" VerticalAlignment="Center"/>
                        </StackPanel>
                    </Button>

                    <Rectangle Height="1" Margin="0 6">
                        <Rectangle.Fill>
                            <LinearGradientBrush StartPoint="0,0" EndPoint="1,0">
                                <GradientStop Color="#1E3A6E" Offset="0"/>
                                <GradientStop Color="Transparent" Offset="1"/>
                            </LinearGradientBrush>
                        </Rectangle.Fill>
                    </Rectangle>

                    <Button Style="{StaticResource MenuItemStyle}" Click="BtnFechar_Click">
                        <StackPanel Orientation="Horizontal">
                            <TextBlock Text="🚪" FontSize="13" Margin="0 0 10 0" VerticalAlignment="Center"/>
                            <TextBlock Text="Fechar sistema" Foreground="#FC8181" VerticalAlignment="Center"/>
                        </StackPanel>
                    </Button>

                </StackPanel>

            </Border>

        </Popup>

    </Grid>

</Window>
