app now responsive for mobile and small devices.

This commit is contained in:
2026-07-11 17:10:02 +03:30
parent 893cd5b128
commit 2f7df312c1
49 changed files with 1710 additions and 775 deletions

View File

@@ -99,9 +99,9 @@ function AcceptInviteContent() {
};
return (
<div className="min-h-screen app-web-bg flex items-center justify-center p-4">
<div className="w-full max-w-md surface-card p-6 space-y-5">
<h1 className="text-xl font-semibold text-text-primary">{t('acceptInviteTitle')}</h1>
<div className="min-h-[100dvh] app-web-bg flex items-center justify-center px-4 py-8">
<div className="w-full max-w-md surface-card p-4 sm:p-6 space-y-5">
<h1 className="text-lg sm:text-xl font-semibold text-text-primary">{t('acceptInviteTitle')}</h1>
{loading ? (
<p className="text-sm text-text-secondary">{t('loadingInvitation')}</p>
@@ -168,7 +168,7 @@ function AcceptInviteContent() {
function AcceptInviteFallback() {
const t = useTranslations('auth');
return (
<div className="min-h-screen app-web-bg flex items-center justify-center">
<div className="min-h-[100dvh] app-web-bg flex items-center justify-center px-4">
<p className="text-sm text-text-secondary">{t('loadingInvitation')}</p>
</div>
);

View File

@@ -9,6 +9,7 @@ import type { OrganizationDetailsFormValues } from '@/components/ui/auth/Organiz
import { zodResolver } from '@hookform/resolvers/zod';
import * as z from 'zod';
import { Lock, Mail, User } from 'lucide-react';
import { AuthPageShell } from '@/components/ui/auth/AuthPageShell';
import { Button } from '@/components/ui/shared/Button';
import { Input } from '@/components/ui/shared/Input';
import { OrganizationDetailsFields } from '@/components/ui/auth/OrganizationDetailsFields';
@@ -160,126 +161,126 @@ function AcceptOrganizationInviteContent() {
};
return (
<div className="min-h-screen app-web-bg flex flex-col justify-center py-12 sm:px-6 lg:px-8">
<div className="sm:mx-auto sm:w-full sm:max-w-md">
<Link href="/" className="flex justify-center">
<span className="text-3xl font-semibold text-text-primary">{tCommon('appName')}</span>
</Link>
<h2 className="mt-6 text-center text-2xl font-semibold text-text-primary">
{t('acceptOrganizationTitle')}
</h2>
<p className="mt-2 text-center text-sm text-text-secondary">
{t('alreadyHaveAccount')}{' '}
<Link href="/login" className="font-medium text-primary hover:opacity-90">
{t('signInLink')}
<AuthPageShell
header={
<>
<Link href="/" className="flex justify-center">
<span className="text-2xl sm:text-3xl font-semibold text-text-primary">
{tCommon('appName')}
</span>
</Link>
</p>
</div>
<h2 className="mt-4 sm:mt-6 text-center text-2xl sm:text-3xl font-semibold text-text-primary">
{t('acceptOrganizationTitle')}
</h2>
<p className="mt-2 text-center text-sm text-text-secondary">
{t('alreadyHaveAccount')}{' '}
<Link href="/login" className="font-medium text-primary hover:opacity-90">
{t('signInLink')}
</Link>
</p>
</>
}
>
<div className="surface-card py-6 sm:py-8 px-4 sm:px-10">
{loading ? (
<p className="text-sm text-text-secondary">{t('loadingInvitation')}</p>
) : (
<>
{inviteInfo && (
<div className="mb-5 sm:mb-6 rounded-[var(--radius-md)] border border-border/70 bg-background-secondary/70 px-3 py-2 text-sm text-text-secondary space-y-1">
<p>
{t('invitedBy')}{' '}
<span className="text-text-primary">{inviteInfo.inviterOrganizationName}</span>
</p>
</div>
)}
<div className="mt-8 sm:mx-auto sm:w-full sm:max-w-md">
<div className="surface-card py-8 px-4 sm:px-10">
{loading ? (
<p className="text-sm text-text-secondary">{t('loadingInvitation')}</p>
) : (
<>
{inviteInfo && (
<div className="mb-6 rounded-[var(--radius-md)] border border-border/70 bg-background-secondary/70 px-3 py-2 text-sm text-text-secondary space-y-1">
<p>
{t('invitedBy')}{' '}
<span className="text-text-primary">{inviteInfo.inviterOrganizationName}</span>
</p>
</div>
)}
{inviteInfo?.status !== 'ACCEPTED' && <RegistrationProgressSteps step={step} />}
{inviteInfo?.status !== 'ACCEPTED' && (
<RegistrationProgressSteps step={step} />
)}
{error && (
<div className="mb-4 p-3 bg-red-950/30 border border-red-600/40 rounded-[var(--radius-md)]">
<p className="text-sm text-red-400">{error}</p>
</div>
)}
{success && (
<div className="mb-4 rounded-[var(--radius-md)] border border-primary/30 bg-primary-soft/40 px-3 py-2 text-sm text-text-primary">
{success}
</div>
)}
{error && (
<div className="mb-4 p-3 bg-red-950/30 border border-red-600/40 rounded-[var(--radius-md)]">
<p className="text-sm text-red-600">{error}</p>
</div>
)}
{success && (
<div className="mb-4 rounded-[var(--radius-md)] border border-primary/30 bg-primary-soft/40 px-3 py-2 text-sm text-text-primary">
{success}
</div>
)}
{inviteInfo?.status !== 'ACCEPTED' && (
<form onSubmit={handleSubmit(onSubmit)} className="space-y-5 sm:space-y-6">
{step === 1 && (
<>
<Input
label={t('ownerEmail')}
value={inviteInfo?.ownerEmail ?? ''}
readOnly
disabled
icon={<Mail className="h-5 w-5 icon-flat" />}
/>
<Input
label={t('fullName')}
{...register('ownerName')}
placeholder={t('namePlaceholder')}
error={errors.ownerName?.message}
icon={<User className="h-5 w-5 icon-flat" />}
/>
<Input
label={t('password')}
{...register('password')}
type="password"
placeholder={t('passwordPlaceholder')}
error={errors.password?.message}
icon={<Lock className="h-5 w-5 icon-flat" />}
passwordToggleLabels={passwordToggleLabels}
/>
<Input
label={t('confirmPassword')}
{...register('confirmPassword')}
type="password"
placeholder={t('passwordPlaceholder')}
error={errors.confirmPassword?.message}
icon={<Lock className="h-5 w-5 icon-flat" />}
passwordToggleLabels={passwordToggleLabels}
/>
<Button type="button" variant="primary" onClick={() => void handleNext()} fullWidth>
{tCommon('continue')}
</Button>
</>
)}
{inviteInfo?.status !== 'ACCEPTED' && (
<form onSubmit={handleSubmit(onSubmit)} className="space-y-6">
{step === 1 && (
<>
<Input
label={t('ownerEmail')}
value={inviteInfo?.ownerEmail ?? ''}
readOnly
disabled
icon={<Mail className="h-5 w-5 icon-flat" />}
/>
<Input
label={t('fullName')}
{...register('ownerName')}
placeholder={t('namePlaceholder')}
error={errors.ownerName?.message}
icon={<User className="h-5 w-5 icon-flat" />}
/>
<Input
label={t('password')}
{...register('password')}
type="password"
placeholder={t('passwordPlaceholder')}
error={errors.password?.message}
icon={<Lock className="h-5 w-5 icon-flat" />}
passwordToggleLabels={passwordToggleLabels}
/>
<Input
label={t('confirmPassword')}
{...register('confirmPassword')}
type="password"
placeholder={t('passwordPlaceholder')}
error={errors.confirmPassword?.message}
icon={<Lock className="h-5 w-5 icon-flat" />}
passwordToggleLabels={passwordToggleLabels}
/>
<Button type="button" variant="primary" onClick={() => void handleNext()} fullWidth>
{tCommon('continue')}
{step === 2 && (
<>
<OrganizationDetailsFields
register={register as unknown as UseFormRegister<OrganizationDetailsFormValues>}
errors={errors as FieldErrors<OrganizationDetailsFormValues>}
organizationType={organizationType}
setValue={setValue as unknown as UseFormSetValue<OrganizationDetailsFormValues>}
/>
<div className="flex flex-col-reverse gap-3 sm:flex-row">
<Button type="button" variant="outline" onClick={() => setStep(1)}>
{tCommon('back')}
</Button>
</>
)}
{step === 2 && (
<>
<OrganizationDetailsFields
register={register as unknown as UseFormRegister<OrganizationDetailsFormValues>}
errors={errors as FieldErrors<OrganizationDetailsFormValues>}
organizationType={organizationType}
setValue={setValue as unknown as UseFormSetValue<OrganizationDetailsFormValues>}
/>
<div className="flex gap-3">
<Button type="button" variant="outline" onClick={() => setStep(1)}>
{tCommon('back')}
</Button>
<Button type="submit" variant="primary" isLoading={submitting} fullWidth>
{t('activateOrganization')}
</Button>
</div>
</>
)}
</form>
)}
</>
)}
</div>
<Button type="submit" variant="primary" isLoading={submitting} fullWidth>
{t('activateOrganization')}
</Button>
</div>
</>
)}
</form>
)}
</>
)}
</div>
</div>
</AuthPageShell>
);
}
function AcceptOrganizationInviteFallback() {
const t = useTranslations('auth');
return (
<div className="min-h-screen app-web-bg flex items-center justify-center">
<div className="min-h-[100dvh] app-web-bg flex items-center justify-center px-4">
<p className="text-sm text-text-secondary">{t('loadingInvitation')}</p>
</div>
);

View File

@@ -9,9 +9,9 @@ import { Link, useRouter } from '@/i18n/navigation';
import { Phone, ShieldCheck } from 'lucide-react';
import { authApi } from '@/lib/api/auth';
import { useAuth } from '@/lib/hooks/useAuth';
import { AuthPageShell } from '@/components/ui/auth/AuthPageShell';
import { Button } from '@/components/ui/shared/Button';
import { Input } from '@/components/ui/shared/Input';
import { TopBarControls } from '@/components/ui/shared/TopBarControls';
type ForgotPasswordForm = {
mobile: string;
@@ -124,83 +124,81 @@ export default function ForgotPasswordPage() {
};
return (
<div className="relative min-h-screen app-web-bg flex flex-col justify-center py-12 sm:px-6 lg:px-8">
<div className="absolute top-4 right-4">
<TopBarControls />
<AuthPageShell
header={
<>
<Link href="/" className="flex justify-center">
<span className="text-2xl sm:text-3xl font-semibold text-text-primary">
{tCommon('appName')}
</span>
</Link>
<h2 className="mt-4 sm:mt-6 text-center text-2xl sm:text-3xl font-semibold text-text-primary">
{t('forgotPasswordTitle')}
</h2>
<p className="mt-2 text-center text-sm text-text-secondary">
{step === 'mobile' ? t('forgotPasswordSubtitle') : t('codeSentHint')}
</p>
</>
}
>
<div className="surface-card py-6 sm:py-8 px-4 sm:px-10">
<form
className="space-y-5 sm:space-y-6"
onSubmit={handleSubmit(step === 'code' ? onVerify : () => undefined)}
>
{step === 'mobile' ? (
<Input
label={t('mobile')}
{...register('mobile')}
type="tel"
inputMode="tel"
autoComplete="tel"
placeholder={t('mobilePlaceholder')}
error={errors.mobile?.message}
icon={<Phone className="h-5 w-5 icon-flat" />}
/>
) : (
<Input
label={t('verificationCode')}
{...register('code')}
type="text"
inputMode="numeric"
autoComplete="one-time-code"
placeholder={t('verificationCodePlaceholder')}
error={errors.code?.message}
icon={<ShieldCheck className="h-5 w-5 icon-flat" />}
/>
)}
{error && (
<div className="p-3 bg-red-950/30 border border-red-600/40 rounded-[var(--radius-md)]">
<p className="text-sm text-red-400">{error}</p>
</div>
)}
{step === 'mobile' ? (
<Button
type="button"
variant="primary"
isLoading={isSending}
fullWidth
onClick={() => void onSendCode()}
>
{t('sendCode')}
</Button>
) : (
<Button type="submit" variant="primary" isLoading={isVerifying} fullWidth>
{t('verifyAndContinue')}
</Button>
)}
<p className="text-center text-sm text-text-secondary">
<Link href="/login" className="font-medium text-primary hover:opacity-90">
{t('backToSignIn')}
</Link>
</p>
</form>
</div>
<div className="sm:mx-auto sm:w-full sm:max-w-md">
<Link href="/" className="flex justify-center">
<span className="text-3xl font-semibold text-text-primary">{tCommon('appName')}</span>
</Link>
<h2 className="mt-6 text-center text-3xl font-semibold text-text-primary">
{t('forgotPasswordTitle')}
</h2>
<p className="mt-2 text-center text-sm text-text-secondary">
{step === 'mobile' ? t('forgotPasswordSubtitle') : t('codeSentHint')}
</p>
</div>
<div className="mt-8 sm:mx-auto sm:w-full sm:max-w-md">
<div className="surface-card py-8 px-4 sm:px-10">
<form
className="space-y-6"
onSubmit={handleSubmit(step === 'code' ? onVerify : () => undefined)}
>
{step === 'mobile' ? (
<Input
label={t('mobile')}
{...register('mobile')}
type="tel"
inputMode="tel"
autoComplete="tel"
placeholder={t('mobilePlaceholder')}
error={errors.mobile?.message}
icon={<Phone className="h-5 w-5 icon-flat" />}
/>
) : (
<Input
label={t('verificationCode')}
{...register('code')}
type="text"
inputMode="numeric"
autoComplete="one-time-code"
placeholder={t('verificationCodePlaceholder')}
error={errors.code?.message}
icon={<ShieldCheck className="h-5 w-5 icon-flat" />}
/>
)}
{error && (
<div className="p-3 bg-red-50 border border-red-200 rounded-lg">
<p className="text-sm text-red-600">{error}</p>
</div>
)}
{step === 'mobile' ? (
<Button
type="button"
variant="primary"
isLoading={isSending}
fullWidth
onClick={() => void onSendCode()}
>
{t('sendCode')}
</Button>
) : (
<Button type="submit" variant="primary" isLoading={isVerifying} fullWidth>
{t('verifyAndContinue')}
</Button>
)}
<p className="text-center text-sm text-text-secondary">
<Link href="/login" className="font-medium text-primary hover:opacity-90">
{t('backToSignIn')}
</Link>
</p>
</form>
</div>
</div>
</div>
</AuthPageShell>
);
}

View File

@@ -10,10 +10,10 @@ import { Link } from '@/i18n/navigation';
import { Mail, Lock } from 'lucide-react';
import { useAuth } from '@/lib/hooks/useAuth';
import { getRememberedEmail } from '@/lib/auth/rememberMe';
import { AuthPageShell } from '@/components/ui/auth/AuthPageShell';
import { Button } from '@/components/ui/shared/Button';
import { Checkbox } from '@/components/ui/shared/Checkbox';
import { Input } from '@/components/ui/shared/Input';
import { TopBarControls } from '@/components/ui/shared/TopBarControls';
type LoginForm = {
email: string;
@@ -74,82 +74,80 @@ export default function LoginPage() {
if (!isAuthReady) {
return (
<div className="min-h-screen app-web-bg flex items-center justify-center">
<div className="min-h-[100dvh] app-web-bg flex items-center justify-center px-4">
<p className="text-text-secondary">{tCommon('loading')}</p>
</div>
);
}
return (
<div className="relative min-h-screen app-web-bg flex flex-col justify-center py-12 sm:px-6 lg:px-8">
<div className="absolute top-4 right-4">
<TopBarControls />
</div>
<div className="sm:mx-auto sm:w-full sm:max-w-md">
<Link href="/" className="flex justify-center">
<span className="text-3xl font-semibold text-text-primary">{tCommon('appName')}</span>
</Link>
<h2 className="mt-6 text-center text-3xl font-semibold text-text-primary">
{t('signInTitle')}
</h2>
<p className="mt-2 text-center text-sm text-text-secondary">
{tCommon('or')}{' '}
<Link href="/register" className="font-medium text-primary hover:opacity-90">
{t('startTrialLink')}
<AuthPageShell
header={
<>
<Link href="/" className="flex justify-center">
<span className="text-2xl sm:text-3xl font-semibold text-text-primary">
{tCommon('appName')}
</span>
</Link>
</p>
</div>
<h2 className="mt-4 sm:mt-6 text-center text-2xl sm:text-3xl font-semibold text-text-primary">
{t('signInTitle')}
</h2>
<p className="mt-2 text-center text-sm text-text-secondary">
{tCommon('or')}{' '}
<Link href="/register" className="font-medium text-primary hover:opacity-90">
{t('startTrialLink')}
</Link>
</p>
</>
}
>
<div className="surface-card py-6 sm:py-8 px-4 sm:px-10">
<form className="space-y-5 sm:space-y-6" onSubmit={handleSubmit(onSubmit)}>
<Input
label={t('email')}
{...register('email')}
type="email"
placeholder={t('emailPlaceholder')}
error={errors.email?.message}
icon={<Mail className="h-5 w-5 icon-flat" />}
/>
<Input
label={t('password')}
{...register('password')}
type="password"
placeholder={t('passwordPlaceholder')}
error={errors.password?.message}
icon={<Lock className="h-5 w-5 icon-flat" />}
passwordToggleLabels={{
show: t('showPassword'),
hide: t('hidePassword'),
}}
/>
<div className="mt-8 sm:mx-auto sm:w-full sm:max-w-md">
<div className="surface-card py-8 px-4 sm:px-10">
<form className="space-y-6" onSubmit={handleSubmit(onSubmit)}>
<Input
label={t('email')}
{...register('email')}
type="email"
placeholder={t('emailPlaceholder')}
error={errors.email?.message}
icon={<Mail className="h-5 w-5 icon-flat" />}
<div className="flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between">
<Checkbox
checked={rememberMe}
onChange={(checked) => setValue('rememberMe', checked)}
label={t('rememberMe')}
/>
<Input
label={t('password')}
{...register('password')}
type="password"
placeholder={t('passwordPlaceholder')}
error={errors.password?.message}
icon={<Lock className="h-5 w-5 icon-flat" />}
passwordToggleLabels={{
show: t('showPassword'),
hide: t('hidePassword'),
}}
/>
<div className="flex items-center justify-between">
<Checkbox
checked={rememberMe}
onChange={(checked) => setValue('rememberMe', checked)}
label={t('rememberMe')}
/>
<div className="text-sm">
<Link href="/forgot-password" className="font-medium text-primary hover:opacity-90">
{t('forgotPassword')}
</Link>
</div>
<div className="text-sm">
<Link href="/forgot-password" className="font-medium text-primary hover:opacity-90">
{t('forgotPassword')}
</Link>
</div>
</div>
{error && (
<div className="p-3 bg-red-50 border border-red-200 rounded-lg">
<p className="text-sm text-red-600">{error}</p>
</div>
)}
{error && (
<div className="p-3 bg-red-950/30 border border-red-600/40 rounded-[var(--radius-md)]">
<p className="text-sm text-red-400">{error}</p>
</div>
)}
<Button type="submit" variant="primary" isLoading={isLoading} fullWidth>
{t('signIn')}
</Button>
</form>
</div>
<Button type="submit" variant="primary" isLoading={isLoading} fullWidth>
{t('signIn')}
</Button>
</form>
</div>
</div>
</AuthPageShell>
);
}

View File

@@ -14,26 +14,33 @@ export default function HomePage() {
const { user } = useAuth();
return (
<div className="min-h-screen app-web-bg text-text-primary">
<div className="min-h-[100dvh] app-web-bg text-text-primary">
<header className="border-b border-border/70 bg-background-secondary/65 backdrop-blur-sm fixed top-0 w-full z-10">
<div className="container mx-auto px-4 py-4 flex justify-between items-center">
<div className="text-2xl font-semibold text-text-primary">
<div className="container mx-auto px-4 py-3 sm:py-4 flex flex-wrap items-center justify-between gap-x-4 gap-y-3">
<Link href="/" className="text-xl sm:text-2xl font-semibold text-text-primary shrink-0">
{tCommon('appName')}
</div>
</Link>
<div className="flex items-center gap-3">
<div className="flex items-center gap-1.5 sm:gap-3 ml-auto shrink-0">
<TopBarControls />
{user ? (
<Link href="/today">
<Button variant="primary">{tAuth('dashboard')}</Button>
<Button variant="primary" size="sm" className="sm:px-4 sm:py-2 sm:text-sm">
{tAuth('dashboard')}
</Button>
</Link>
) : (
<>
<Link href="/login">
<Button variant="outline">{tAuth('login')}</Button>
<Link href="/login" className="hidden sm:block">
<Button variant="outline" size="sm" className="whitespace-nowrap">
{tAuth('login')}
</Button>
</Link>
<Link href="/register">
<Button variant="primary">{tAuth('startTrial')}</Button>
<Button variant="primary" size="sm" className="whitespace-nowrap">
<span className="sm:hidden">{tAuth('startTrialShort')}</span>
<span className="hidden sm:inline">{tAuth('startTrial')}</span>
</Button>
</Link>
</>
)}
@@ -41,27 +48,34 @@ export default function HomePage() {
</div>
</header>
<main className="container mx-auto px-4 pt-32 pb-20">
<main className="container mx-auto px-4 pt-28 sm:pt-32 pb-16 sm:pb-20">
<div className="max-w-4xl mx-auto text-center">
<h1 className="text-5xl md:text-6xl font-semibold mb-6 leading-tight">
<h1 className="text-3xl sm:text-4xl md:text-5xl lg:text-6xl font-semibold mb-4 sm:mb-6 leading-tight">
{t('heroTitle')}
<span className="text-primary"> {t('heroHighlight')}</span>
</h1>
<p className="text-lg text-text-secondary mb-8 max-w-2xl mx-auto">
<p className="text-base sm:text-lg text-text-secondary mb-6 sm:mb-8 max-w-2xl mx-auto">
{t('heroSubtitle')}
</p>
{!user && (
<Link href="/register">
<Button size="lg" variant="primary" className="px-8">
{tAuth('startFreeTrial')}
</Button>
</Link>
<div className="flex flex-col sm:flex-row items-stretch sm:items-center justify-center gap-3">
<Link href="/register" className="w-full sm:w-auto">
<Button size="lg" variant="primary" fullWidth className="sm:w-auto sm:px-8">
{tAuth('startFreeTrial')}
</Button>
</Link>
<Link href="/login" className="w-full sm:hidden">
<Button variant="outline" size="lg" fullWidth>
{tAuth('login')}
</Button>
</Link>
</div>
)}
</div>
<div className="mt-20 grid md:grid-cols-3 gap-6">
<div className="mt-12 sm:mt-20 grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-4 sm:gap-6">
<FeatureCard
icon={<Building2 className="h-6 w-6 icon-flat" />}
title={t('featureClinicsTitle')}

View File

@@ -8,11 +8,11 @@ import { useTranslations } from 'next-intl';
import { Link } from '@/i18n/navigation';
import { Mail, Lock, User, Phone } from 'lucide-react';
import { useAuth } from '@/lib/hooks/useAuth';
import { AuthPageShell } from '@/components/ui/auth/AuthPageShell';
import { OrganizationDetailsFields } from '@/components/ui/auth/OrganizationDetailsFields';
import { RegistrationProgressSteps } from '@/components/ui/auth/RegistrationProgressSteps';
import { Button } from '@/components/ui/shared/Button';
import { Input } from '@/components/ui/shared/Input';
import { TopBarControls } from '@/components/ui/shared/TopBarControls';
type RegisterForm = {
name: string;
@@ -121,133 +121,139 @@ export default function RegisterPage() {
};
return (
<div className="relative min-h-screen app-web-bg flex flex-col justify-center py-12 sm:px-6 lg:px-8">
<div className="absolute top-4 right-4">
<TopBarControls />
</div>
<AuthPageShell
header={
<>
<Link href="/" className="flex justify-center">
<span className="text-2xl sm:text-3xl font-semibold text-text-primary">
{tCommon('appName')}
</span>
</Link>
<h2 className="mt-4 sm:mt-6 text-center text-2xl sm:text-3xl font-semibold text-text-primary">
{t('registerTitle')}
</h2>
<p className="mt-2 text-center text-sm text-text-secondary">
{t('registerPrompt')}{' '}
<Link href="/login" className="font-medium text-primary hover:opacity-90">
{t('signInLink')}
</Link>
</p>
</>
}
>
<div className="surface-card py-6 sm:py-8 px-4 sm:px-10">
<RegistrationProgressSteps step={step} />
<div className="mb-5 sm:mb-6 p-3 sm:p-4 bg-primary-soft rounded-[var(--radius-md)] border border-primary/35">
<h3 className="text-sm font-medium text-text-primary mb-2">{t('trialIncludes')}</h3>
<ul className="text-sm text-text-secondary space-y-1">
<li className="flex items-start gap-2">
<span className="shrink-0"></span>
<span>{t('trialTeamMembers')}</span>
</li>
<li className="flex items-start gap-2">
<span className="shrink-0"></span>
<span>{t('trialFullAccess')}</span>
</li>
<li className="flex items-start gap-2">
<span className="shrink-0"></span>
<span>{t('trialNoCard')}</span>
</li>
</ul>
</div>
<div className="sm:mx-auto sm:w-full sm:max-w-md">
<Link href="/" className="flex justify-center">
<span className="text-3xl font-semibold text-text-primary">{tCommon('appName')}</span>
</Link>
<h2 className="mt-6 text-center text-3xl font-semibold text-text-primary">
{t('registerTitle')}
</h2>
<p className="mt-2 text-center text-sm text-text-secondary">
{t('registerPrompt')}{' '}
<Link href="/login" className="font-medium text-primary hover:opacity-90">
{t('signInLink')}
<form onSubmit={handleSubmit(onSubmit)} className="space-y-5 sm:space-y-6">
{step === 1 && (
<>
<Input
label={t('fullName')}
{...register('name')}
placeholder={t('namePlaceholder')}
error={errors.name?.message}
icon={<User className="h-5 w-5 icon-flat" />}
/>
<Input
label={t('email')}
{...register('email')}
type="email"
placeholder={t('emailPlaceholder')}
error={errors.email?.message}
icon={<Mail className="h-5 w-5 icon-flat" />}
/>
<Input
label={t('mobile')}
{...register('mobile')}
type="tel"
inputMode="tel"
autoComplete="tel"
placeholder={t('mobilePlaceholder')}
error={errors.mobile?.message}
icon={<Phone className="h-5 w-5 icon-flat" />}
/>
<Input
label={t('password')}
{...register('password')}
type="password"
placeholder={t('passwordPlaceholder')}
error={errors.password?.message}
icon={<Lock className="h-5 w-5 icon-flat" />}
passwordToggleLabels={passwordToggleLabels}
/>
<Input
label={t('confirmPassword')}
{...register('confirmPassword')}
type="password"
placeholder={t('passwordPlaceholder')}
error={errors.confirmPassword?.message}
icon={<Lock className="h-5 w-5 icon-flat" />}
passwordToggleLabels={passwordToggleLabels}
/>
<Button type="button" variant="primary" onClick={handleNext} fullWidth>
{tCommon('continue')}
</Button>
</>
)}
{step === 2 && (
<>
<OrganizationDetailsFields
register={register as never}
errors={errors as never}
organizationType={organizationType}
setValue={setValue as never}
/>
{error && (
<div className="p-3 bg-red-950/30 border border-red-600/40 rounded-[var(--radius-md)]">
<p className="text-sm text-red-400">{error}</p>
</div>
)}
<div className="flex flex-col-reverse gap-3 sm:flex-row">
<Button
type="button"
variant="outline"
onClick={() => setStep(1)}
className="sm:shrink-0"
>
{tCommon('back')}
</Button>
<Button type="submit" variant="primary" isLoading={isLoading} fullWidth>
{t('startMyFreeTrial')}
</Button>
</div>
</>
)}
</form>
<p className="mt-5 sm:mt-6 text-xs text-center text-text-muted leading-relaxed">
{t('termsIntro')}{' '}
<Link href="/terms" className="text-primary hover:opacity-90">
{t('termsOfService')}
</Link>{' '}
{tCommon('and')}{' '}
<Link href="/privacy" className="text-primary hover:opacity-90">
{t('privacyPolicy')}
</Link>
</p>
</div>
<div className="mt-8 sm:mx-auto sm:w-full sm:max-w-md">
<div className="surface-card py-8 px-4 sm:px-10">
<RegistrationProgressSteps step={step} />
<div className="mb-6 p-4 bg-primary-soft rounded-[var(--radius-md)] border border-primary/35">
<h3 className="text-sm font-medium text-text-primary mb-2">{t('trialIncludes')}</h3>
<ul className="text-sm text-text-secondary space-y-1">
<li className="flex items-center">
<span className="mr-2"></span> {t('trialTeamMembers')}
</li>
<li className="flex items-center">
<span className="mr-2"></span> {t('trialFullAccess')}
</li>
<li className="flex items-center">
<span className="mr-2"></span> {t('trialNoCard')}
</li>
</ul>
</div>
<form onSubmit={handleSubmit(onSubmit)} className="space-y-6">
{step === 1 && (
<>
<Input
label={t('fullName')}
{...register('name')}
placeholder={t('namePlaceholder')}
error={errors.name?.message}
icon={<User className="h-5 w-5 icon-flat" />}
/>
<Input
label={t('email')}
{...register('email')}
type="email"
placeholder={t('emailPlaceholder')}
error={errors.email?.message}
icon={<Mail className="h-5 w-5 icon-flat" />}
/>
<Input
label={t('mobile')}
{...register('mobile')}
type="tel"
inputMode="tel"
autoComplete="tel"
placeholder={t('mobilePlaceholder')}
error={errors.mobile?.message}
icon={<Phone className="h-5 w-5 icon-flat" />}
/>
<Input
label={t('password')}
{...register('password')}
type="password"
placeholder={t('passwordPlaceholder')}
error={errors.password?.message}
icon={<Lock className="h-5 w-5 icon-flat" />}
passwordToggleLabels={passwordToggleLabels}
/>
<Input
label={t('confirmPassword')}
{...register('confirmPassword')}
type="password"
placeholder={t('passwordPlaceholder')}
error={errors.confirmPassword?.message}
icon={<Lock className="h-5 w-5 icon-flat" />}
passwordToggleLabels={passwordToggleLabels}
/>
<Button type="button" variant="primary" onClick={handleNext} fullWidth>
{tCommon('continue')}
</Button>
</>
)}
{step === 2 && (
<>
<OrganizationDetailsFields
register={register as never}
errors={errors as never}
organizationType={organizationType}
setValue={setValue as never}
/>
{error && (
<div className="p-3 bg-red-950/30 border border-red-600/40 rounded-[var(--radius-md)]">
<p className="text-sm text-red-600">{error}</p>
</div>
)}
<div className="flex gap-3">
<Button type="button" variant="outline" onClick={() => setStep(1)}>
{tCommon('back')}
</Button>
<Button type="submit" variant="primary" isLoading={isLoading} fullWidth>
{t('startMyFreeTrial')}
</Button>
</div>
</>
)}
</form>
<p className="mt-6 text-xs text-center text-text-muted">
{t('termsIntro')}{' '}
<Link href="/terms" className="text-primary hover:opacity-90">
{t('termsOfService')}
</Link>{' '}
{tCommon('and')}{' '}
<Link href="/privacy" className="text-primary hover:opacity-90">
{t('privacyPolicy')}
</Link>
</p>
</div>
</div>
</div>
</AuthPageShell>
);
}