{#if loginErrorNotice}
{t('auth.login_error_title', 'Sign-in failed')}
{loginErrorNotice}
{:else}
{#if mode === 'login'}
{t('auth.sign_in', 'Sign in')}
{:else if mode === 'register'}
{t('auth.register', 'Create account')}
{:else}
{t('auth.setup_title', 'Initial setup')}
{/if}
{#if sessionExpiredNotice}
{t('auth.session_expired', 'Your session expired. Please sign in again.')}
{/if}
{#if loggedOutNotice}
{t('auth.logged_out', 'Successfully signed out.')}
{/if}
{#if postRegisterNotice && mode === 'login'}
{postRegisterNotice}
{/if}
{#if mode === 'login'}
{#if passwordLoginEnabled || magicLinkLoginEnabled}
{#if error}
{error}
{/if}
{#if magicStatus}
{magicStatus.text}
{/if}
{/if}
{#if oidc.enabled}
{#if passwordLoginEnabled}
{t('auth.or', 'or')}
{/if}
{t(
'auth.sso_login_provider',
{ provider: oidc.provider_name ?? 'SSO' },
'Sign in with {{provider}}'
)}
{/if}
{#if passwordLoginEnabled}
{t('auth.no_account', 'No account?')}
{/if}
{#if setupAvailable}
{t('auth.admin_setup', 'First time?')}
{/if}
{:else if mode === 'register'}
{#if regError}
{regError}
{/if}
{t('auth.have_account', 'Already have an account?')}
{:else}
1
{t('auth.setup_step1', 'Admin')}
2
{t('auth.setup_step2', 'System')}
3
{t('auth.setup_step3', 'Completed')}
{#if setupError}
{setupError}
{/if}
{#if setupSuccess}
{setupSuccess}
{/if}
{t('auth.back_to_login', 'Already configured?')}
{/if}
{/if}