<UserControl x:Class="NexusShell.Views.LoginView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             Loaded="LoginView_OnLoaded"
             KeyDown="LoginView_OnKeyDown">
    <UserControl.Resources>
        <Style x:Key="LoginFieldLabelStyle" TargetType="TextBlock">
            <Setter Property="Foreground" Value="{StaticResource NexusTextSecondaryBrush}"/>
            <Setter Property="FontSize" Value="11"/>
            <Setter Property="FontWeight" Value="SemiBold"/>
            <Setter Property="Margin" Value="2,0,0,7"/>
        </Style>

        <Style x:Key="LoginTextBoxStyle" TargetType="TextBox">
            <Setter Property="Height" Value="48"/>
            <Setter Property="Padding" Value="14,0"/>
            <Setter Property="VerticalContentAlignment" Value="Center"/>
            <Setter Property="Background" Value="#22081526"/>
            <Setter Property="Foreground" Value="{StaticResource NexusTextPrimaryBrush}"/>
            <Setter Property="CaretBrush" Value="{StaticResource NexusAccentCyanBrush}"/>
            <Setter Property="BorderBrush" Value="#4200D9FF"/>
            <Setter Property="BorderThickness" Value="1"/>
            <Setter Property="FontSize" Value="14"/>
            <Setter Property="FontWeight" Value="SemiBold"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="TextBox">
                        <Border x:Name="Root"
                                Background="{TemplateBinding Background}"
                                BorderBrush="{TemplateBinding BorderBrush}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                CornerRadius="15">
                            <ScrollViewer x:Name="PART_ContentHost"
                                          Margin="{TemplateBinding Padding}"
                                          VerticalAlignment="Center"/>
                        </Border>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsKeyboardFocused" Value="True">
                                <Setter TargetName="Root" Property="BorderBrush" Value="#AA00D9FF"/>
                                <Setter TargetName="Root" Property="Background" Value="#2800D9FF"/>
                                <Setter TargetName="Root" Property="Effect">
                                    <Setter.Value>
                                        <DropShadowEffect Color="#00D9FF" BlurRadius="18" ShadowDepth="0" Opacity="0.34"/>
                                    </Setter.Value>
                                </Setter>
                            </Trigger>
                            <Trigger Property="IsEnabled" Value="False">
                                <Setter Property="Opacity" Value="0.56"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <Style x:Key="LoginPasswordBoxStyle" TargetType="PasswordBox">
            <Setter Property="Height" Value="48"/>
            <Setter Property="Padding" Value="14,0"/>
            <Setter Property="VerticalContentAlignment" Value="Center"/>
            <Setter Property="Background" Value="#22081526"/>
            <Setter Property="Foreground" Value="{StaticResource NexusTextPrimaryBrush}"/>
            <Setter Property="CaretBrush" Value="{StaticResource NexusAccentCyanBrush}"/>
            <Setter Property="BorderBrush" Value="#4200D9FF"/>
            <Setter Property="BorderThickness" Value="1"/>
            <Setter Property="FontSize" Value="14"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="PasswordBox">
                        <Border x:Name="Root"
                                Background="{TemplateBinding Background}"
                                BorderBrush="{TemplateBinding BorderBrush}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                CornerRadius="15">
                            <ScrollViewer x:Name="PART_ContentHost"
                                          Margin="{TemplateBinding Padding}"
                                          VerticalAlignment="Center"/>
                        </Border>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsKeyboardFocused" Value="True">
                                <Setter TargetName="Root" Property="BorderBrush" Value="#AA00D9FF"/>
                                <Setter TargetName="Root" Property="Background" Value="#2800D9FF"/>
                                <Setter TargetName="Root" Property="Effect">
                                    <Setter.Value>
                                        <DropShadowEffect Color="#00D9FF" BlurRadius="18" ShadowDepth="0" Opacity="0.38"/>
                                    </Setter.Value>
                                </Setter>
                            </Trigger>
                            <Trigger Property="IsEnabled" Value="False">
                                <Setter Property="Opacity" Value="0.56"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <Style x:Key="LoginActionButtonStyle" TargetType="Button">
            <Setter Property="Height" Value="52"/>
            <Setter Property="Foreground" Value="White"/>
            <Setter Property="Background" Value="{StaticResource NexusLogoGradientBrush}"/>
            <Setter Property="BorderBrush" Value="#6600D9FF"/>
            <Setter Property="BorderThickness" Value="1"/>
            <Setter Property="FontSize" Value="14"/>
            <Setter Property="FontWeight" Value="SemiBold"/>
            <Setter Property="Cursor" Value="Hand"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="Button">
                        <Border x:Name="Root"
                                Background="{TemplateBinding Background}"
                                BorderBrush="{TemplateBinding BorderBrush}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                CornerRadius="16"
                                Padding="{TemplateBinding Padding}">
                            <ContentPresenter HorizontalAlignment="Center"
                                              VerticalAlignment="Center"
                                              RecognizesAccessKey="True"/>
                        </Border>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsMouseOver" Value="True">
                                <Setter TargetName="Root" Property="Effect">
                                    <Setter.Value>
                                        <DropShadowEffect Color="#00D9FF" BlurRadius="26" ShadowDepth="0" Opacity="0.42"/>
                                    </Setter.Value>
                                </Setter>
                            </Trigger>
                            <Trigger Property="IsKeyboardFocused" Value="True">
                                <Setter TargetName="Root" Property="BorderBrush" Value="#CCFFFFFF"/>
                            </Trigger>
                            <Trigger Property="IsEnabled" Value="False">
                                <Setter Property="Foreground" Value="#8BA0BD"/>
                                <Setter Property="Cursor" Value="Arrow"/>
                                <Setter TargetName="Root" Property="Background" Value="#2A10233A"/>
                                <Setter TargetName="Root" Property="BorderBrush" Value="#3E506885"/>
                                <Setter TargetName="Root" Property="Opacity" Value="0.92"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <Style x:Key="LoginMicroLabelStyle" TargetType="TextBlock">
            <Setter Property="Foreground" Value="{StaticResource NexusAccentCyanBrush}"/>
            <Setter Property="FontSize" Value="10"/>
            <Setter Property="FontWeight" Value="Bold"/>
        </Style>

        <Style x:Key="LoginDeckPanelStyle" TargetType="Border">
            <Setter Property="Background" Value="#6B071426"/>
            <Setter Property="BorderBrush" Value="#4A00D9FF"/>
            <Setter Property="BorderThickness" Value="1"/>
            <Setter Property="CornerRadius" Value="22"/>
            <Setter Property="Padding" Value="20"/>
        </Style>
    </UserControl.Resources>

    <Grid Background="{StaticResource NexusDesktopBackgroundBrush}">
        <Grid IsHitTestVisible="False">
            <Border VerticalAlignment="Top" Height="260" Opacity="0.62">
                <Border.Background>
                    <LinearGradientBrush StartPoint="0,0" EndPoint="1,0">
                        <GradientStop Color="#2600D9FF" Offset="0"/>
                        <GradientStop Color="#338A4FFF" Offset="0.46"/>
                        <GradientStop Color="#00000000" Offset="1"/>
                    </LinearGradientBrush>
                </Border.Background>
            </Border>
            <Border HorizontalAlignment="Right" Width="620" Opacity="0.28">
                <Border.Background>
                    <RadialGradientBrush Center="0.5,0.42" GradientOrigin="0.5,0.42" RadiusX="0.68" RadiusY="0.82">
                        <GradientStop Color="#662D9CFF" Offset="0"/>
                        <GradientStop Color="#2200D9FF" Offset="0.48"/>
                        <GradientStop Color="#00000000" Offset="1"/>
                    </RadialGradientBrush>
                </Border.Background>
            </Border>
            <Border VerticalAlignment="Bottom" Height="340" Background="{StaticResource NexusHorizonGlowBrush}" Opacity="0.48"/>

            <Canvas Opacity="0.46">
                <Line X1="78" Y1="126" X2="912" Y2="126" Stroke="#3300D9FF" StrokeThickness="1"/>
                <Line X1="1180" Y1="250" X2="1800" Y2="250" Stroke="#338A4FFF" StrokeThickness="1"/>
                <Line X1="105" Y1="786" X2="1090" Y2="786" Stroke="#2400D9FF" StrokeThickness="1"/>
                <Line X1="760" Y1="126" X2="1160" Y2="222" Stroke="#188A4FFF" StrokeThickness="1"/>
                <Path Data="M72,666 C320,570 520,694 794,590" Stroke="#2400D9FF" StrokeThickness="1" Fill="Transparent"/>
                <Path Data="M1064,122 C1272,190 1390,80 1644,160" Stroke="#208A4FFF" StrokeThickness="1" Fill="Transparent"/>
                <Path Data="M115,320 L530,238 L836,270 L968,220" Stroke="#1700D9FF" StrokeThickness="1" Fill="Transparent"/>
            </Canvas>
        </Grid>

        <Grid Margin="48,32,48,34">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="*"/>
                <RowDefinition Height="Auto"/>
            </Grid.RowDefinitions>

            <Grid Grid.Row="0" Margin="0,0,0,12">
                <StackPanel Orientation="Horizontal" VerticalAlignment="Center">
                    <Border Width="52" Height="52" CornerRadius="18" Background="{StaticResource NexusLogoGradientBrush}" Margin="0,0,14,0">
                        <TextBlock Text="N" FontSize="28" FontWeight="Bold" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                    </Border>
                    <StackPanel VerticalAlignment="Center">
                        <TextBlock Text="NINJA NEXUS OS" FontSize="17" FontWeight="SemiBold"
                                   Foreground="{StaticResource NexusTextPrimaryBrush}"/>
                        <TextBlock Text="{Binding SessionModeLabel}" FontSize="12"
                                   Foreground="{StaticResource NexusTextSecondaryBrush}"/>
                    </StackPanel>
                </StackPanel>

                <Border HorizontalAlignment="Right" VerticalAlignment="Center" CornerRadius="18"
                        Padding="16,10" Background="#1F081426" BorderBrush="#4400D9FF" BorderThickness="1">
                    <StackPanel Orientation="Horizontal">
                        <Border Width="9" Height="9" CornerRadius="4.5" Background="{StaticResource NexusLogoGradientBrush}"
                                VerticalAlignment="Center" Margin="0,0,10,0"/>
                        <StackPanel>
                            <TextBlock Text="{Binding LoginStatusLabel}" Foreground="{StaticResource NexusTextPrimaryBrush}"
                                       FontSize="12" FontWeight="SemiBold"/>
                            <TextBlock Text="{Binding LoginStatusDetail}" Foreground="{StaticResource NexusTextSecondaryBrush}"
                                       FontSize="10"/>
                        </StackPanel>
                    </StackPanel>
                </Border>
            </Grid>

            <Grid Grid.Row="1" VerticalAlignment="Center" Margin="0,10,0,24">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="1.08*"/>
                    <ColumnDefinition Width="0.92*"/>
                </Grid.ColumnDefinitions>

                <Grid Grid.Column="0" MaxWidth="820" VerticalAlignment="Center" Margin="0,0,54,0">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                    </Grid.RowDefinitions>

                    <StackPanel Grid.Row="0" Orientation="Horizontal" Margin="0,0,0,20">
                        <Border CornerRadius="999"
                                Padding="13,7" Background="#1700D9FF" BorderBrush="#4400D9FF" BorderThickness="1">
                            <StackPanel Orientation="Horizontal">
                                <TextBlock Text="SESSION NODE" Style="{StaticResource LoginMicroLabelStyle}" Margin="0,0,10,0"/>
                                <TextBlock Text="{Binding DeviceLabel}" FontSize="10" FontWeight="SemiBold"
                                           Foreground="{StaticResource NexusTextSecondaryBrush}"/>
                            </StackPanel>
                        </Border>
                        <Border CornerRadius="999"
                                Padding="13,7" Background="#158A4FFF" BorderBrush="#3F8A4FFF" BorderThickness="1" Margin="10,0,0,0">
                            <StackPanel Orientation="Horizontal">
                                <Ellipse Width="7" Height="7" Fill="{StaticResource NexusSuccessBrush}" VerticalAlignment="Center" Margin="0,0,8,0"/>
                                <TextBlock Text="{Binding WorkspaceSignalLabel}" FontSize="10" FontWeight="SemiBold"
                                           Foreground="{StaticResource NexusTextSecondaryBrush}"/>
                            </StackPanel>
                        </Border>
                    </StackPanel>

                    <StackPanel Grid.Row="1" Margin="0,0,0,24">
                        <TextBlock Text="Åbn Nexus OS arbejdsstation"
                                   FontSize="50"
                                   FontWeight="Light"
                                   Foreground="{StaticResource NexusTextPrimaryBrush}"
                                   TextWrapping="Wrap"
                                   LineHeight="56"/>
                        <TextBlock Text="{Binding SessionHintLabel}"
                                   FontSize="16"
                                   Foreground="{StaticResource NexusTextSecondaryBrush}"
                                   TextWrapping="Wrap"
                                   Margin="0,12,0,0"
                                   MaxWidth="620"/>
                    </StackPanel>

                    <Grid Grid.Row="2">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="1.2*"/>
                            <ColumnDefinition Width="0.8*"/>
                        </Grid.ColumnDefinitions>

                        <Border Style="{StaticResource LoginDeckPanelStyle}" Margin="0,0,16,0">
                            <Grid>
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="Auto"/>
                                </Grid.RowDefinitions>

                                <Grid Grid.Row="0" Margin="0,0,0,18">
                                    <StackPanel>
                                        <TextBlock Text="WORKSTATION DECK" Style="{StaticResource LoginMicroLabelStyle}"/>
                                        <TextBlock Text="{Binding WorkstationLabel}" FontSize="19" FontWeight="SemiBold"
                                                   Foreground="{StaticResource NexusTextPrimaryBrush}" Margin="0,7,0,0"
                                                   TextTrimming="CharacterEllipsis"/>
                                        <TextBlock Text="{Binding OrganizationLabel}" FontSize="12"
                                                   Foreground="{StaticResource NexusTextSecondaryBrush}" Margin="0,3,0,0"/>
                                    </StackPanel>
                                    <Border HorizontalAlignment="Right" VerticalAlignment="Top" CornerRadius="999"
                                            Padding="10,6" Background="#1D22C55E" BorderBrush="#5522C55E" BorderThickness="1">
                                        <TextBlock Text="LOCAL POC" FontSize="10" FontWeight="Bold"
                                                   Foreground="{StaticResource NexusSuccessBrush}"/>
                                    </Border>
                                </Grid>

                                <Grid Grid.Row="1">
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="*"/>
                                        <ColumnDefinition Width="*"/>
                                    </Grid.ColumnDefinitions>
                                    <Border Background="#1AFFFFFF" BorderBrush="#22FFFFFF" BorderThickness="1"
                                            CornerRadius="16" Padding="14" Margin="0,0,8,0">
                                        <StackPanel>
                                            <TextBlock Text="{Binding IdentityHandshakeLabel}" Foreground="{StaticResource NexusTextPrimaryBrush}"
                                                       FontSize="13" FontWeight="SemiBold"/>
                                            <TextBlock Text="{Binding LocalApiLabel}" Foreground="{StaticResource NexusTextSecondaryBrush}"
                                                       FontSize="11" Margin="0,4,0,0"/>
                                        </StackPanel>
                                    </Border>
                                    <Border Grid.Column="1" Background="#1AFFFFFF" BorderBrush="#22FFFFFF" BorderThickness="1"
                                            CornerRadius="16" Padding="14" Margin="8,0,0,0">
                                        <StackPanel>
                                            <TextBlock Text="{Binding PolicyModeLabel}" Foreground="{StaticResource NexusTextPrimaryBrush}"
                                                       FontSize="13" FontWeight="SemiBold"/>
                                            <TextBlock Text="{Binding PolicyModeDetail}" Foreground="{StaticResource NexusTextSecondaryBrush}"
                                                       FontSize="11" Margin="0,4,0,0"/>
                                        </StackPanel>
                                    </Border>
                                </Grid>

                                <Grid Grid.Row="2" Margin="0,16,0,0">
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="Auto"/>
                                        <ColumnDefinition Width="*"/>
                                    </Grid.ColumnDefinitions>
                                    <StackPanel Width="30" HorizontalAlignment="Left">
                                        <Ellipse Width="10" Height="10" Fill="{StaticResource NexusAccentCyanBrush}"/>
                                        <Rectangle Width="1" Height="28" Fill="#3300D9FF" HorizontalAlignment="Center"/>
                                        <Ellipse Width="10" Height="10" Fill="{StaticResource NexusPurpleBrush}"/>
                                        <Rectangle Width="1" Height="28" Fill="#338A4FFF" HorizontalAlignment="Center"/>
                                        <Ellipse Width="10" Height="10" Fill="{StaticResource NexusSuccessBrush}"/>
                                    </StackPanel>
                                    <StackPanel Grid.Column="1" Margin="8,0,0,0">
                                        <TextBlock Text="{Binding AppSurfaceLabel}" Foreground="{StaticResource NexusTextPrimaryBrush}"
                                                   FontSize="13" FontWeight="SemiBold"/>
                                        <TextBlock Text="{Binding AppSurfaceDetail}" Foreground="{StaticResource NexusTextSecondaryBrush}"
                                                   FontSize="11" Margin="0,4,0,10"/>
                                        <TextBlock Text="{Binding AccessFooterLabel}" Foreground="{StaticResource NexusTextSecondaryBrush}"
                                                   FontSize="11" TextWrapping="Wrap"/>
                                    </StackPanel>
                                </Grid>
                            </Grid>
                        </Border>

                        <StackPanel Grid.Column="1">
                            <Border Style="{StaticResource LoginDeckPanelStyle}" Padding="18" Margin="0,0,0,14">
                                <StackPanel>
                                    <TextBlock Text="IDENTITET" Style="{StaticResource LoginMicroLabelStyle}"/>
                                    <TextBlock Text="{Binding IdentityRealmLabel}" FontSize="15" FontWeight="SemiBold"
                                               Foreground="{StaticResource NexusTextPrimaryBrush}" Margin="0,8,0,0"/>
                                    <TextBlock Text="Lokalt godkendt realm" FontSize="11"
                                               Foreground="{StaticResource NexusTextSecondaryBrush}" Margin="0,4,0,0"/>
                                </StackPanel>
                            </Border>
                            <Border Style="{StaticResource LoginDeckPanelStyle}" Padding="18">
                                <StackPanel>
                                    <TextBlock Text="SESSION" Style="{StaticResource LoginMicroLabelStyle}"/>
                                    <TextBlock Text="Workspace låses op efter login" FontSize="15" FontWeight="SemiBold"
                                               Foreground="{StaticResource NexusTextPrimaryBrush}" Margin="0,8,0,0"
                                               TextWrapping="Wrap"/>
                                    <TextBlock Text="Apps og skrivebord starter samlet" FontSize="11"
                                               Foreground="{StaticResource NexusTextSecondaryBrush}" Margin="0,4,0,0"/>
                                </StackPanel>
                            </Border>
                        </StackPanel>
                    </Grid>
                </Grid>

                <Border Grid.Column="1"
                        HorizontalAlignment="Right"
                        MaxWidth="510"
                        MinWidth="430"
                        Padding="1"
                        CornerRadius="30"
                        Background="{StaticResource NexusGlassBorderGradientBrush}">
                    <Border.Effect>
                        <DropShadowEffect Color="#00D9FF" BlurRadius="42" ShadowDepth="0" Opacity="0.24"/>
                    </Border.Effect>
                    <Border Padding="34"
                            CornerRadius="29"
                            Background="#EA071224">
                        <Grid>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                            </Grid.RowDefinitions>

                            <Grid Grid.Row="0" Margin="0,0,0,24">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="*"/>
                                </Grid.ColumnDefinitions>
                                <Border Width="82" Height="82" CornerRadius="26" Background="{StaticResource NexusLogoGradientBrush}"
                                        Margin="0,0,18,0">
                                    <TextBlock Text="{Binding UserInitials}" FontSize="35" FontWeight="Bold"
                                               HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                </Border>
                                <StackPanel Grid.Column="1" VerticalAlignment="Center">
                                    <Border HorizontalAlignment="Left" CornerRadius="999"
                                            Padding="9,5" Background="#188A4FFF" BorderBrush="#408A4FFF" BorderThickness="1"
                                            Margin="0,0,0,9">
                                        <TextBlock Text="{Binding AuthGateLabel}" FontSize="10" FontWeight="Bold"
                                                   Foreground="{StaticResource NexusPurpleBrush}"/>
                                    </Border>
                                    <TextBlock Text="{Binding WelcomeLabel}"
                                               FontSize="22"
                                               FontWeight="SemiBold"
                                               Foreground="{StaticResource NexusTextPrimaryBrush}"
                                               TextWrapping="Wrap"/>
                                    <TextBlock Text="{Binding PasswordHelperLabel}"
                                               FontSize="12"
                                               Foreground="{StaticResource NexusTextSecondaryBrush}"
                                               Margin="0,5,0,0"
                                               TextWrapping="Wrap"/>
                                </StackPanel>
                            </Grid>

                            <StackPanel Grid.Row="1">
                                <TextBlock Text="EMAIL" Style="{StaticResource LoginFieldLabelStyle}"/>
                                <TextBox Text="{Binding Email, UpdateSourceTrigger=PropertyChanged}"
                                         Style="{StaticResource LoginTextBoxStyle}"
                                         IsEnabled="{Binding IsNotBusy}"
                                         Margin="0,0,0,16"/>

                                <TextBlock Text="PASSWORD" Style="{StaticResource LoginFieldLabelStyle}"/>
                                <PasswordBox x:Name="PasswordBox"
                                             Style="{StaticResource LoginPasswordBoxStyle}"
                                             IsEnabled="{Binding IsNotBusy}"
                                             PasswordChanged="PasswordBox_OnPasswordChanged"
                                             KeyDown="PasswordBox_OnKeyDown"
                                             Margin="0,0,0,14"/>

                                <Border Background="#18FF4D6D" BorderBrush="#55FF4D6D" BorderThickness="1"
                                        CornerRadius="13" Padding="12,9" Margin="0,0,0,12">
                                    <Border.Style>
                                        <Style TargetType="Border">
                                            <Setter Property="Visibility" Value="Collapsed"/>
                                            <Style.Triggers>
                                                <DataTrigger Binding="{Binding HasError}" Value="True">
                                                    <Setter Property="Visibility" Value="Visible"/>
                                                </DataTrigger>
                                            </Style.Triggers>
                                        </Style>
                                    </Border.Style>
                                    <TextBlock Text="{Binding ErrorMessage}"
                                               Foreground="{StaticResource NexusTextPrimaryBrush}"
                                               FontSize="12"
                                               TextWrapping="Wrap"/>
                                </Border>

                                <ProgressBar Height="3"
                                             IsIndeterminate="True"
                                             Visibility="{Binding IsBusy, Converter={StaticResource BoolToVisibility}}"
                                             Foreground="{StaticResource NexusAccentCyanBrush}"
                                             Background="#1800D9FF"
                                             BorderThickness="0"
                                             Margin="2,0,2,13"/>

                                <Button Content="{Binding LoginButtonLabel}"
                                        Command="{Binding LoginCommand}"
                                        IsDefault="True"
                                        Padding="12,0"
                                        Style="{StaticResource LoginActionButtonStyle}"/>
                            </StackPanel>

                            <Grid Grid.Row="2" Margin="0,16,0,0">
                                <Button Content="{Binding SwitchUserLabel}" HorizontalAlignment="Left"
                                        Style="{StaticResource NexusGlassButtonStyle}"
                                        IsEnabled="{Binding IsNotBusy}"/>
                                <Button Content="{Binding ForgotAccessLabel}" HorizontalAlignment="Right"
                                        Style="{StaticResource NexusGlassButtonStyle}"
                                        IsEnabled="{Binding IsNotBusy}"/>
                            </Grid>

                            <Border Grid.Row="3" Margin="0,22,0,0" Padding="13,11" CornerRadius="15"
                                    Background="#1500D9FF" BorderBrush="#2800D9FF" BorderThickness="1">
                                <StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
                                    <Ellipse Width="7" Height="7" Fill="{StaticResource NexusAccentCyanBrush}"
                                             VerticalAlignment="Center" Margin="0,0,9,0"/>
                                    <TextBlock Text="{Binding PocCredentialsLabel}"
                                               Foreground="{StaticResource NexusTextSecondaryBrush}"
                                               FontSize="11"
                                               TextWrapping="Wrap"
                                               TextAlignment="Center"/>
                                </StackPanel>
                            </Border>
                        </Grid>
                    </Border>
                </Border>
            </Grid>

            <Grid Grid.Row="2">
                <TextBlock Text="Nexus local POC · Identity API localhost:5050 · Login surface v2"
                           Foreground="{StaticResource NexusTextSecondaryBrush}"
                           FontSize="11"
                           HorizontalAlignment="Left"/>
                <TextBlock Text="{Binding LoginStatusLabel}"
                           Foreground="{StaticResource NexusAccentCyanBrush}"
                           FontSize="11"
                           FontWeight="SemiBold"
                           HorizontalAlignment="Right"/>
            </Grid>
        </Grid>
    </Grid>
</UserControl>
