<Window xmlns="https://github.com/avaloniaui"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:vm="using:ClawdDotNet.Desktop.ViewModels"
        mc:Ignorable="d" d:DesignWidth="520" d:DesignHeight="320"
        x:Class="ClawdDotNet.Desktop.Views.LicenseWindow"
        x:DataType="vm:LicenseViewModel"
        Icon="/Assets/app.ico"
        Title="ClawdDotNet – Lizenz"
        Width="520" SizeToContent="Height"
        CanResize="False"
        WindowStartupLocation="CenterScreen">

  <StackPanel Margin="20" Spacing="12">

    <TextBlock Classes="heading" Text="Lizenzschlüssel" />

    <!-- Nur sichtbar, wenn es einen Grund gibt -->
    <Border Classes="card"
            IsVisible="{Binding Problem, Converter={x:Static StringConverters.IsNotNullOrEmpty}}">
      <TextBlock Text="{Binding Problem}" TextWrapping="Wrap"
                 Foreground="{DynamicResource SystemFillColorCriticalBrush}" />
    </Border>

    <TextBox PlaceholderText="XXXXX-XXXXX-XXXXX-XXXXX-XXXXX"
             Text="{Binding Key}"
             FontFamily="{DynamicResource ContentControlThemeFontFamily}" />

    <StackPanel Spacing="4">
      <TextBlock Classes="caption" Text="Hardware-ID (für den Support):" />
      <SelectableTextBlock Classes="caption"
                           Text="{Binding HardwareId}"
                           TextWrapping="Wrap" />
    </StackPanel>

    <StackPanel Orientation="Horizontal" Spacing="8" HorizontalAlignment="Right">
      <Button Content="Beenden" Command="{Binding CancelCommand}" />
      <Button Content="Prüfen" Classes="accent" IsDefault="True"
              Command="{Binding ConfirmCommand}" />
    </StackPanel>

  </StackPanel>

</Window>
