<UserControl xmlns="https://github.com/avaloniaui"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:vm="using:DodoSSH.Client.Shell.ViewModels"
             x:Class="DodoSSH.Client.Android.Views.EnrollScreen"
             x:DataType="vm:MainWindowViewModel"
             Background="{StaticResource Canvas}">

  <!--
    ShellState.NeedsEnrollment — signed in, but the account has no vault key yet. Step 2 of the three the
    recovery screen counts.

    The warning is above the boxes rather than below them, and that is the whole design of this screen: it
    is the only moment where telling someone the passphrase cannot be recovered can still change what they
    type. Underneath the button it would be a receipt.
  -->

  <ScrollViewer>
    <StackPanel Margin="24,40,24,32" Spacing="0">

      <TextBlock Classes="label" Text="ENROLLMENT · STEP 2 OF 3" Foreground="{StaticResource TextFaint}" />
      <TextBlock Classes="title" Text="CHOOSE A PASSPHRASE" FontSize="17" Margin="0,10,0,0" />

      <TextBlock Classes="body" Margin="0,10,0,0"
                 Text="This passphrase encrypts your vault on this phone and on the server. Nothing can recover it — not the operator, not a reset link. A recovery code follows, and losing both makes the vault unopenable." />

      <TextBlock Classes="label" Text="PASSPHRASE" Margin="0,20,0,0" />
      <TextBox Classes="field secret" Margin="0,6,0,0" Text="{Binding Passphrase}"
               IsEnabled="{Binding !IsBusy}" />

      <TextBlock Classes="label" Text="CONFIRM" Margin="0,14,0,0" />
      <TextBox Classes="field secret" Margin="0,6,0,0" Text="{Binding ConfirmPassphrase}"
               IsEnabled="{Binding !IsBusy}">
        <TextBox.KeyBindings>
          <KeyBinding Gesture="Enter" Command="{Binding EnrollCommand}" />
        </TextBox.KeyBindings>
      </TextBox>

      <Button Classes="primary" Content="CREATE THE VAULT" Margin="0,18,0,0"
              Command="{Binding EnrollCommand}" IsEnabled="{Binding !IsBusy}" />

      <TextBlock Classes="body" Margin="0,14,0,0" TextAlignment="Center" Text="{Binding StatusMessage}" />

    </StackPanel>
  </ScrollViewer>

</UserControl>
