@jskit-ai/auth-web 0.2.15 → 0.2.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,298 +1,299 @@
1
1
  <template>
2
- <div class="login-screen" :class="{ 'login-screen--mobile': isMobileViewport }">
3
- <v-container
4
- fluid
5
- class="login-shell fill-height d-flex"
6
- :class="[
7
- isMobileViewport
8
- ? 'login-shell--mobile align-stretch justify-stretch pa-0'
9
- : 'align-center justify-center py-8'
10
- ]"
2
+ <AuthScreen class="login-screen" :class="{ 'login-screen--mobile': isMobileViewport }">
3
+ <template v-if="$slots.brand" #brand="brand">
4
+ <slot name="brand" v-bind="brand" />
5
+ </template>
6
+ <v-card
7
+ class="auth-card"
8
+ :class="{ 'auth-card--mobile': isMobileViewport }"
9
+ variant="flat"
10
+ :rounded="isMobileViewport ? false : undefined"
11
11
  >
12
- <v-card
13
- class="auth-card"
14
- :class="{ 'auth-card--mobile': isMobileViewport }"
15
- :rounded="isMobileViewport ? false : undefined"
16
- :elevation="isMobileViewport ? 0 : 1"
17
- >
18
- <v-card-text class="auth-content" :class="{ 'auth-content--mobile': isMobileViewport }">
19
- <div v-if="authTitle || authSubtitle" class="auth-header mb-5">
20
- <div>
21
- <h1 v-if="authTitle" class="auth-title text-headline-medium">{{ authTitle }}</h1>
22
- <p v-if="authSubtitle" class="on-surface-variant mb-0">{{ authSubtitle }}</p>
23
- </div>
12
+ <v-card-text class="auth-content" :class="{ 'auth-content--mobile': isMobileViewport }">
13
+ <div v-if="authTitle || authSubtitle" class="auth-header mb-5">
14
+ <div>
15
+ <h1 v-if="authTitle" class="auth-title text-headline-medium">{{ authTitle }}</h1>
16
+ <p v-if="authSubtitle" class="on-surface-variant mb-0">{{ authSubtitle }}</p>
24
17
  </div>
18
+ </div>
19
+
20
+ <!-- Sign in and Register: a Material 3 segmented button, offered only when both are. -->
21
+ <div
22
+ v-if="!isForgot && !isOtp && !isEmailConfirmationPending && !showRememberedAccount && canRegister"
23
+ class="mode-switch mb-5"
24
+ role="radiogroup"
25
+ :aria-label="t('jskit.auth.login.mode.label')"
26
+ data-testid="auth-mode-switch"
27
+ >
28
+ <v-btn
29
+ data-testid="auth-mode-sign-in"
30
+ class="mode-switch__segment text-none"
31
+ role="radio"
32
+ :aria-checked="isLogin ? 'true' : 'false'"
33
+ :active="isLogin"
34
+ :prepend-icon="isLogin ? '$complete' : undefined"
35
+ variant="text"
36
+ rounded="0"
37
+ @click="switchMode('login')"
38
+ >
39
+ {{ t("jskit.auth.login.mode.signIn") }}
40
+ </v-btn>
41
+ <v-btn
42
+ data-testid="auth-mode-register"
43
+ class="mode-switch__segment text-none"
44
+ role="radio"
45
+ :aria-checked="isRegister ? 'true' : 'false'"
46
+ :active="isRegister"
47
+ :prepend-icon="isRegister ? '$complete' : undefined"
48
+ variant="text"
49
+ rounded="0"
50
+ @click="switchMode('register')"
51
+ >
52
+ {{ t("jskit.auth.login.mode.register") }}
53
+ </v-btn>
54
+ </div>
55
+
56
+ <v-form @submit.prevent="submitAuth" novalidate>
57
+ <template v-if="isEmailConfirmationPending">
58
+ <div class="email-confirmation-state mb-5">
59
+ <p class="email-confirmation-message text-body-medium mb-0">
60
+ {{ emailConfirmationMessage }}
61
+ </p>
62
+ </div>
25
63
 
26
- <div v-if="!isForgot && !isOtp && !isEmailConfirmationPending" class="mode-switch d-flex ga-2 pa-1 mb-5">
27
- <v-btn
28
- data-testid="auth-mode-sign-in"
29
- class="text-none"
30
- :variant="isLogin ? 'flat' : 'text'"
31
- :color="isLogin ? 'secondary-container' : undefined"
32
- @click="switchMode('login')"
33
- >
34
- {{ t("jskit.auth.login.mode.signIn") }}
35
- </v-btn>
36
- <v-btn
37
- v-if="!showRememberedAccount && canRegister"
38
- data-testid="auth-mode-register"
39
- class="text-none"
40
- :variant="isRegister ? 'flat' : 'text'"
41
- :color="isRegister ? 'secondary-container' : undefined"
42
- @click="switchMode('register')"
43
- >
44
- {{ t("jskit.auth.login.mode.register") }}
45
- </v-btn>
46
- </div>
47
-
48
- <v-form @submit.prevent="submitAuth" novalidate>
49
- <template v-if="isEmailConfirmationPending">
50
- <div class="email-confirmation-state mb-5">
51
- <p class="email-confirmation-message text-body-medium mb-0">
52
- {{ emailConfirmationMessage }}
53
- </p>
54
- </div>
55
-
56
- <div v-if="confirmationUrl" class="email-confirmation-dev-link mb-5" data-testid="auth-confirmation-dev-link">
57
- <p class="text-body-medium on-surface-variant mb-2">{{ t("jskit.auth.login.confirmEmail.devLink") }}</p>
58
- <p class="email-confirmation-url text-body-small mb-3">{{ confirmationUrl }}</p>
59
- <v-btn
60
- class="text-none"
61
- variant="flat"
62
- color="primary"
63
- data-testid="auth-confirmation-dev-confirm"
64
- :loading="registrationConfirmPending"
65
- @click="confirmRegistrationFromLink"
66
- >
67
- {{ t("jskit.auth.login.confirmEmail.useDevLink") }}
68
- </v-btn>
69
- </div>
70
-
71
- <div v-if="canEnterConfirmationCode" class="email-confirmation-code d-flex align-start ga-2 mb-5">
72
- <v-text-field
73
- v-model="confirmationCode"
74
- data-testid="auth-confirmation-code"
75
- :label="t('jskit.auth.login.field.confirmationCode')"
76
- variant="outlined"
77
- density="comfortable"
78
- autocomplete="off"
79
- hide-details="auto"
80
- />
81
- <v-btn
82
- class="text-none mt-1"
83
- variant="tonal"
84
- color="primary"
85
- size="large"
86
- type="submit"
87
- data-testid="auth-confirmation-submit"
88
- :disabled="!confirmationCode.trim()"
89
- :loading="registrationConfirmPending"
90
- >
91
- {{ t("jskit.auth.login.confirmEmail.confirm") }}
92
- </v-btn>
93
- </div>
94
-
95
- <div class="switch-row d-flex align-center justify-space-between ga-3">
96
- <v-btn class="text-none" variant="tonal" color="primary" @click="goToMainScreen">
97
- {{ t("jskit.auth.login.confirmEmail.goToMainScreen") }}
98
- </v-btn>
99
- <v-btn
100
- v-if="canResendEmailConfirmation"
101
- class="text-none"
102
- variant="outlined"
103
- color="secondary"
104
- :loading="registerConfirmationResendPending"
105
- @click="resendRegisterConfirmationEmail"
106
- >
107
- {{ t("jskit.auth.login.confirmEmail.resend") }}
108
- </v-btn>
109
- <v-btn variant="text" color="secondary" @click="switchMode('login')">
110
- {{ t("jskit.auth.login.backToSignIn") }}
111
- </v-btn>
112
- </div>
113
- </template>
114
-
115
- <template v-else>
116
- <div
117
- v-if="showRememberedAccount"
118
- class="remembered-account d-flex align-center justify-space-between ga-3 mb-4"
119
- >
120
- <div class="remembered-copy flex-grow-1">
121
- <p class="remembered-title text-title-small">
122
- {{ t("jskit.auth.login.rememberedAccount.welcomeBack", { name: rememberedAccountDisplayName }) }}
123
- </p>
124
- <p class="remembered-email text-body-small">{{ rememberedAccountMaskedEmail }}</p>
125
- </div>
126
- <v-btn variant="text" color="secondary" class="text-none" @click="switchAccount">
127
- {{ rememberedAccountSwitchLabel }}
128
- </v-btn>
129
- </div>
130
-
131
- <div
132
- v-if="isRegister && needsFirstAccountSetupCode"
133
- class="first-account-setup mb-4"
134
- data-testid="auth-first-account-setup"
64
+ <div v-if="confirmationUrl" class="email-confirmation-dev-link mb-5" data-testid="auth-confirmation-dev-link">
65
+ <p class="text-body-medium on-surface-variant mb-2">{{ t("jskit.auth.login.confirmEmail.devLink") }}</p>
66
+ <p class="email-confirmation-url text-body-small mb-3">{{ confirmationUrl }}</p>
67
+ <v-btn
68
+ class="text-none"
69
+ variant="flat"
70
+ color="primary"
71
+ data-testid="auth-confirmation-dev-confirm"
72
+ :loading="registrationConfirmPending"
73
+ @click="confirmRegistrationFromLink"
135
74
  >
136
- <p class="text-body-medium mb-3">{{ t("jskit.auth.login.firstAccount.explain") }}</p>
137
- <v-text-field
138
- v-model="setupCode"
139
- :label="t('jskit.auth.login.field.setupCode')"
140
- variant="outlined"
141
- density="comfortable"
142
- autocomplete="off"
143
- spellcheck="false"
144
- hide-details="auto"
145
- />
146
- </div>
75
+ {{ t("jskit.auth.login.confirmEmail.useDevLink") }}
76
+ </v-btn>
77
+ </div>
147
78
 
79
+ <div v-if="canEnterConfirmationCode" class="email-confirmation-code d-flex align-start ga-2 mb-5">
148
80
  <v-text-field
149
- v-if="!isLogin || canUsePasswordLogin"
150
- v-model="email"
151
- :label="t('jskit.auth.login.field.email')"
81
+ v-model="confirmationCode"
82
+ data-testid="auth-confirmation-code"
83
+ :label="t('jskit.auth.login.field.confirmationCode')"
152
84
  variant="outlined"
153
85
  density="comfortable"
154
- type="email"
155
- autocomplete="email"
156
- :error-messages="emailErrorMessages"
157
- @blur="emailTouched = true"
158
- class="mb-3"
86
+ autocomplete="off"
87
+ hide-details="auto"
159
88
  />
89
+ <v-btn
90
+ class="text-none mt-1"
91
+ variant="tonal"
92
+ color="primary"
93
+ size="large"
94
+ type="submit"
95
+ data-testid="auth-confirmation-submit"
96
+ :disabled="!confirmationCode.trim()"
97
+ :loading="registrationConfirmPending"
98
+ >
99
+ {{ t("jskit.auth.login.confirmEmail.confirm") }}
100
+ </v-btn>
101
+ </div>
160
102
 
161
- <v-text-field
162
- v-if="(isLogin && canUsePasswordLogin) || isRegister"
163
- v-model="password"
164
- :label="t('jskit.auth.login.field.password')"
165
- :type="showPassword ? 'text' : 'password'"
103
+ <div class="switch-row d-flex align-center justify-space-between ga-3">
104
+ <v-btn class="text-none" variant="tonal" color="primary" @click="goToMainScreen">
105
+ {{ t("jskit.auth.login.confirmEmail.goToMainScreen") }}
106
+ </v-btn>
107
+ <v-btn
108
+ v-if="canResendEmailConfirmation"
109
+ class="text-none"
166
110
  variant="outlined"
167
- density="comfortable"
168
- :autocomplete="isRegister ? 'new-password' : 'current-password'"
169
- :error-messages="passwordErrorMessages"
170
- :append-inner-icon="showPassword ? '$visibilityOff' : '$visibility'"
171
- @click:append-inner="togglePasswordVisibility"
172
- @blur="passwordTouched = true"
173
- class="mb-3"
174
- />
111
+ color="secondary"
112
+ :loading="registerConfirmationResendPending"
113
+ @click="resendRegisterConfirmationEmail"
114
+ >
115
+ {{ t("jskit.auth.login.confirmEmail.resend") }}
116
+ </v-btn>
117
+ <v-btn variant="text" color="secondary" @click="switchMode('login')">
118
+ {{ t("jskit.auth.login.backToSignIn") }}
119
+ </v-btn>
120
+ </div>
121
+ </template>
175
122
 
176
- <v-text-field
177
- v-if="isRegister"
178
- v-model="confirmPassword"
179
- :label="t('jskit.auth.login.field.confirmPassword')"
180
- :type="showConfirmPassword ? 'text' : 'password'"
181
- variant="outlined"
182
- density="comfortable"
183
- autocomplete="new-password"
184
- :error-messages="confirmPasswordErrorMessages"
185
- :append-inner-icon="showConfirmPassword ? '$visibilityOff' : '$visibility'"
186
- @click:append-inner="toggleConfirmPasswordVisibility"
187
- @blur="confirmPasswordTouched = true"
188
- class="mb-3"
189
- />
123
+ <template v-else>
124
+ <div
125
+ v-if="showRememberedAccount"
126
+ class="remembered-account d-flex align-center justify-space-between ga-3 mb-4"
127
+ >
128
+ <div class="remembered-copy flex-grow-1">
129
+ <p class="remembered-title text-title-small">
130
+ {{ t("jskit.auth.login.rememberedAccount.welcomeBack", { name: rememberedAccountDisplayName }) }}
131
+ </p>
132
+ <p class="remembered-email text-body-small">{{ rememberedAccountMaskedEmail }}</p>
133
+ </div>
134
+ <v-btn variant="text" color="secondary" class="text-none" @click="switchAccount">
135
+ {{ rememberedAccountSwitchLabel }}
136
+ </v-btn>
137
+ </div>
190
138
 
139
+ <div
140
+ v-if="isRegister && needsFirstAccountSetupCode"
141
+ class="first-account-setup mb-4"
142
+ data-testid="auth-first-account-setup"
143
+ >
144
+ <p class="text-body-medium mb-3">{{ t("jskit.auth.login.firstAccount.explain") }}</p>
191
145
  <v-text-field
192
- v-if="isOtp"
193
- v-model="otpCode"
194
- :label="t('jskit.auth.login.field.otpCode')"
146
+ v-model="setupCode"
147
+ :label="t('jskit.auth.login.field.setupCode')"
195
148
  variant="outlined"
196
149
  density="comfortable"
197
- autocomplete="one-time-code"
198
- :error-messages="otpCodeErrorMessages"
199
- @blur="otpCodeTouched = true"
200
- class="mb-3"
150
+ autocomplete="off"
151
+ spellcheck="false"
152
+ hide-details="auto"
201
153
  />
154
+ </div>
202
155
 
203
- <div v-if="isLogin && (canRequestPasswordRecovery || canUseOtp)" class="aux-links d-flex justify-end mb-4">
204
- <v-btn
205
- v-if="canRequestPasswordRecovery"
206
- variant="text"
207
- color="secondary"
208
- @click="switchMode('forgot')"
209
- >
210
- {{ t("jskit.auth.login.forgotPassword") }}
211
- </v-btn>
212
- <v-btn v-if="canUseOtp" variant="text" color="secondary" @click="switchMode('otp')">
213
- {{ t("jskit.auth.login.useOtp") }}
214
- </v-btn>
215
- </div>
156
+ <v-text-field
157
+ v-if="!isLogin || canUsePasswordLogin"
158
+ v-model="email"
159
+ :label="t('jskit.auth.login.field.email')"
160
+ variant="outlined"
161
+ density="comfortable"
162
+ type="email"
163
+ autocomplete="email"
164
+ :error-messages="emailErrorMessages"
165
+ @blur="emailTouched = true"
166
+ class="mb-3"
167
+ />
168
+
169
+ <v-text-field
170
+ v-if="(isLogin && canUsePasswordLogin) || isRegister"
171
+ v-model="password"
172
+ :label="t('jskit.auth.login.field.password')"
173
+ :type="showPassword ? 'text' : 'password'"
174
+ variant="outlined"
175
+ density="comfortable"
176
+ :autocomplete="isRegister ? 'new-password' : 'current-password'"
177
+ :error-messages="passwordErrorMessages"
178
+ :append-inner-icon="showPassword ? '$visibilityOff' : '$visibility'"
179
+ @click:append-inner="togglePasswordVisibility"
180
+ @blur="passwordTouched = true"
181
+ class="mb-3"
182
+ />
183
+
184
+ <v-text-field
185
+ v-if="isRegister"
186
+ v-model="confirmPassword"
187
+ :label="t('jskit.auth.login.field.confirmPassword')"
188
+ :type="showConfirmPassword ? 'text' : 'password'"
189
+ variant="outlined"
190
+ density="comfortable"
191
+ autocomplete="new-password"
192
+ :error-messages="confirmPasswordErrorMessages"
193
+ :append-inner-icon="showConfirmPassword ? '$visibilityOff' : '$visibility'"
194
+ @click:append-inner="toggleConfirmPasswordVisibility"
195
+ @blur="confirmPasswordTouched = true"
196
+ class="mb-3"
197
+ />
198
+
199
+ <v-text-field
200
+ v-if="isOtp"
201
+ v-model="otpCode"
202
+ :label="t('jskit.auth.login.field.otpCode')"
203
+ variant="outlined"
204
+ density="comfortable"
205
+ autocomplete="one-time-code"
206
+ :error-messages="otpCodeErrorMessages"
207
+ @blur="otpCodeTouched = true"
208
+ class="mb-3"
209
+ />
210
+
211
+ <div v-if="isLogin && (canRequestPasswordRecovery || canUseOtp)" class="aux-links d-flex justify-end mb-4">
212
+ <v-btn
213
+ v-if="canRequestPasswordRecovery"
214
+ variant="text"
215
+ color="secondary"
216
+ @click="switchMode('forgot')"
217
+ >
218
+ {{ t("jskit.auth.login.forgotPassword") }}
219
+ </v-btn>
220
+ <v-btn v-if="canUseOtp" variant="text" color="secondary" @click="switchMode('otp')">
221
+ {{ t("jskit.auth.login.useOtp") }}
222
+ </v-btn>
223
+ </div>
216
224
 
217
- <v-checkbox
218
- v-if="(isLogin && canUsePasswordLogin) || isOtp"
219
- v-model="rememberAccountOnDevice"
220
- :label="t('jskit.auth.login.rememberedAccount.rememberDevice')"
221
- density="compact"
222
- hide-details
223
- class="mb-4"
224
- />
225
+ <v-checkbox
226
+ v-if="(isLogin && canUsePasswordLogin) || isOtp"
227
+ v-model="rememberAccountOnDevice"
228
+ :label="t('jskit.auth.login.rememberedAccount.rememberDevice')"
229
+ density="compact"
230
+ hide-details
231
+ class="mb-4"
232
+ />
225
233
 
226
- <div v-if="isOtp" class="aux-links d-flex justify-end mb-4">
227
- <v-btn
228
- type="button"
229
- variant="tonal"
230
- color="secondary"
231
- :loading="otpRequestPending"
232
- @click="requestOtpCode"
233
- >
234
- {{ t("jskit.auth.login.sendOtp") }}
235
- </v-btn>
236
- </div>
234
+ <div v-if="isOtp" class="aux-links d-flex justify-end mb-4">
235
+ <v-btn
236
+ type="button"
237
+ variant="tonal"
238
+ color="secondary"
239
+ :loading="otpRequestPending"
240
+ @click="requestOtpCode"
241
+ >
242
+ {{ t("jskit.auth.login.sendOtp") }}
243
+ </v-btn>
244
+ </div>
237
245
 
238
- <div v-if="canUseOAuth && (isLogin || isRegister)" class="oauth-actions d-grid ga-2 mb-4">
239
- <v-btn
240
- v-for="provider in oauthProviders"
241
- :key="provider.id"
242
- block
243
- variant="outlined"
244
- color="secondary"
245
- :disabled="loading"
246
- :prepend-icon="oauthProviderIcon(provider)"
247
- class="text-none oauth-provider-button"
248
- @click="startOAuthSignIn(provider.id)"
249
- >
250
- {{ oauthProviderButtonLabel(provider) }}
251
- </v-btn>
252
- </div>
246
+ <div v-if="canUseOAuth && (isLogin || isRegister)" class="oauth-actions d-grid ga-2 mb-4">
253
247
  <v-btn
254
- v-if="!isLogin || canUsePasswordLogin"
255
- data-testid="auth-submit"
248
+ v-for="provider in oauthProviders"
249
+ :key="provider.id"
256
250
  block
257
- color="primary"
258
- size="large"
259
- :loading="loading"
260
- :disabled="!canSubmit"
261
- type="submit"
251
+ variant="outlined"
252
+ color="secondary"
253
+ :disabled="loading"
254
+ :prepend-icon="oauthProviderIcon(provider)"
255
+ class="text-none oauth-provider-button"
256
+ @click="startOAuthSignIn(provider.id)"
262
257
  >
263
- {{ submitLabel }}
258
+ {{ oauthProviderButtonLabel(provider) }}
264
259
  </v-btn>
260
+ </div>
261
+ <v-btn
262
+ v-if="!isLogin || canUsePasswordLogin"
263
+ data-testid="auth-submit"
264
+ block
265
+ color="primary"
266
+ size="large"
267
+ :loading="loading"
268
+ :disabled="!canSubmit"
269
+ type="submit"
270
+ >
271
+ {{ submitLabel }}
272
+ </v-btn>
265
273
 
266
- <div v-if="isRegister" class="switch-row mt-4 d-flex align-center justify-space-between ga-3">
267
- <span class="on-surface-variant">{{ t("jskit.auth.login.hasAccount") }}</span>
268
- <v-btn variant="text" color="secondary" @click="switchMode('login')">
269
- {{ t("jskit.auth.login.backToSignIn") }}
270
- </v-btn>
271
- </div>
272
-
273
- <div v-else-if="isForgot" class="switch-row mt-4 d-flex align-center justify-space-between ga-3">
274
- <span class="on-surface-variant">{{ t("jskit.auth.login.rememberedPassword") }}</span>
275
- <v-btn variant="text" color="secondary" @click="switchMode('login')">
276
- {{ t("jskit.auth.login.backToSignIn") }}
277
- </v-btn>
278
- </div>
274
+ <div v-if="isForgot" class="switch-row mt-4 d-flex align-center justify-space-between ga-3">
275
+ <span class="on-surface-variant">{{ t("jskit.auth.login.rememberedPassword") }}</span>
276
+ <v-btn variant="text" color="secondary" @click="switchMode('login')">
277
+ {{ t("jskit.auth.login.backToSignIn") }}
278
+ </v-btn>
279
+ </div>
279
280
 
280
- <div v-else-if="isOtp" class="switch-row mt-4 d-flex align-center justify-space-between ga-3">
281
- <span class="on-surface-variant">{{ t("jskit.auth.login.otherMethod") }}</span>
282
- <v-btn variant="text" color="secondary" @click="switchMode('login')">
283
- {{ t("jskit.auth.login.backToSignIn") }}
284
- </v-btn>
285
- </div>
286
- </template>
287
- </v-form>
288
- </v-card-text>
289
- </v-card>
290
- </v-container>
291
- </div>
281
+ <div v-else-if="isOtp" class="switch-row mt-4 d-flex align-center justify-space-between ga-3">
282
+ <span class="on-surface-variant">{{ t("jskit.auth.login.otherMethod") }}</span>
283
+ <v-btn variant="text" color="secondary" @click="switchMode('login')">
284
+ {{ t("jskit.auth.login.backToSignIn") }}
285
+ </v-btn>
286
+ </div>
287
+ </template>
288
+ </v-form>
289
+ </v-card-text>
290
+ </v-card>
291
+ </AuthScreen>
292
292
  </template>
293
293
 
294
294
  <script setup>
295
295
  import { useDisplay } from "vuetify";
296
+ import AuthScreen from "./AuthScreen.vue";
296
297
  import { useLoginView } from "../runtime/useLoginView.js";
297
298
  import { useJskitText } from "../i18n.js";
298
299
 
@@ -367,36 +368,14 @@ function toggleConfirmPasswordVisibility() {
367
368
  </script>
368
369
 
369
370
  <style scoped>
370
- .login-screen {
371
- /* Start below shell banners shown on a surface without an app bar. */
372
- --auth-screen-height: calc(100dvh - var(--shell-error-banners-inline-height, 0px));
373
- position: fixed;
374
- inset: var(--shell-error-banners-inline-height, 0px) 0 0;
375
- z-index: 1;
376
- overflow-y: auto;
377
- min-height: var(--auth-screen-height);
378
- background-color: rgb(var(--v-theme-surface-container));
379
- }
380
-
381
- .login-screen--mobile {
382
- background-color: rgb(var(--v-theme-surface));
383
- }
384
-
385
- .login-shell {
386
- min-height: var(--auth-screen-height);
387
- }
388
-
389
- .login-shell--mobile {
390
- width: 100%;
391
- }
392
-
393
371
  .auth-card {
394
372
  width: min(520px, 100%);
395
373
  }
396
374
 
375
+ /* On a phone the card is the screen below the brand row, if any. */
397
376
  .auth-card--mobile {
377
+ flex: 1 0 auto;
398
378
  width: 100%;
399
- min-height: var(--auth-screen-height);
400
379
  }
401
380
 
402
381
  .auth-content {
@@ -404,8 +383,7 @@ function toggleConfirmPasswordVisibility() {
404
383
  }
405
384
 
406
385
  .auth-content--mobile {
407
- min-height: var(--auth-screen-height);
408
- padding: calc(24px + env(safe-area-inset-top, 0px)) 20px calc(32px + env(safe-area-inset-bottom, 0px));
386
+ padding: calc(24px + var(--auth-screen-top-inset, 0px)) 20px calc(32px + env(safe-area-inset-bottom, 0px));
409
387
  }
410
388
 
411
389
  .auth-title {
@@ -413,9 +391,35 @@ function toggleConfirmPasswordVisibility() {
413
391
  color: rgb(var(--v-theme-on-surface));
414
392
  }
415
393
 
394
+ /* Material 3's segmented button: one outline, equal segments, the selected one in secondary-container with a check. */
395
+ /* Two equal grid columns: the divider sits inside the second segment, so it can't make the segments differ. */
416
396
  .mode-switch {
397
+ display: grid;
398
+ grid-template-columns: 1fr 1fr;
399
+ height: 40px;
400
+ overflow: hidden;
401
+ border: 1px solid rgb(var(--v-theme-outline));
417
402
  border-radius: 9999px;
418
- background-color: rgb(var(--v-theme-surface-container-highest));
403
+ }
404
+
405
+ .mode-switch__segment.v-btn {
406
+ min-width: 0;
407
+ height: 100%;
408
+ color: rgb(var(--v-theme-on-surface));
409
+ }
410
+
411
+ .mode-switch__segment + .mode-switch__segment {
412
+ border-inline-start: 1px solid rgb(var(--v-theme-outline));
413
+ }
414
+
415
+ .mode-switch__segment.v-btn--active {
416
+ background-color: rgb(var(--v-theme-secondary-container));
417
+ color: rgb(var(--v-theme-on-secondary-container));
418
+ }
419
+
420
+ /* The fill marks the selection; the state layer stays for hover, focus and press. */
421
+ .mode-switch__segment.v-btn--active > .v-btn__overlay {
422
+ opacity: 0;
419
423
  }
420
424
 
421
425
  .email-confirmation-state,