Page d'inscription retravaillée

Trois étapes numérotées (formule, commerce, identifiants), cartes de
formule avec prix et « Conseillée », récapitulatif fixe sur grand écran
(prix, contenu de la formule, CGV, paiement), adaptée au mobile.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Tony AVERTY 2026-10-07 14:47:12 +02:00
parent f51920f1a6
commit 921f412d5b
7 changed files with 177 additions and 97 deletions

View file

@ -21,9 +21,9 @@ const FIELDS = [
['addressLine', 'Adresse', { autoComplete: 'street-address', maxLength: 200 }], ['addressLine', 'Adresse', { autoComplete: 'street-address', maxLength: 200 }],
['postalCode', 'Code postal', { autoComplete: 'postal-code', inputMode: 'numeric', maxLength: 5 }], ['postalCode', 'Code postal', { autoComplete: 'postal-code', inputMode: 'numeric', maxLength: 5 }],
['city', 'Ville', { autoComplete: 'address-level2', maxLength: 120 }], ['city', 'Ville', { autoComplete: 'address-level2', maxLength: 120 }],
['contactName', 'Prénom et nom du dirigeant', { autoComplete: 'name', maxLength: 120 }], ['contactName', 'Prénom et nom', { autoComplete: 'name', maxLength: 120 }],
['contactPhone', 'Téléphone', { autoComplete: 'tel', type: 'tel' }], ['contactPhone', 'Téléphone', { autoComplete: 'tel', type: 'tel' }],
['contactEmail', 'E-mail (votre identifiant)', { autoComplete: 'email', type: 'email' }], ['contactEmail', 'E-mail (votre identifiant de connexion)', { autoComplete: 'email', type: 'email' }],
] as const; ] as const;
type Values = Record<(typeof FIELDS)[number][0] | 'password', string>; type Values = Record<(typeof FIELDS)[number][0] | 'password', string>;
@ -71,85 +71,133 @@ export function SignupPage() {
} }
const current = catalog.find((c) => c.plan === plan); const current = catalog.find((c) => c.plan === plan);
const shown = catalog.length ? catalog : PLANS.map((p) => ({ plan: p, name: PLAN_LABEL[p], tagline: '', priceCents: { MONTH: 0, YEAR: 0 }, modules: [], limits: { maxStaff: null } }));
const field = (k: (typeof FIELDS)[number][0]) => {
const [, label, props] = FIELDS.find(([key]) => key === k)!;
return (
<div className="field" key={k}>
<label htmlFor={`s-${k}`}>{label}</label>
<input id={`s-${k}`} className="input" required value={v[k]} onChange={(e) => setV({ ...v, [k]: e.target.value })} {...props} />
</div>
);
};
return ( return (
<main style={{ minHeight: '100vh', padding: '32px 16px' }}> <main className="s-page">
<form onSubmit={submit} style={{ maxWidth: 720, margin: '0 auto', display: 'flex', flexDirection: 'column', gap: 24 }}> <header className="s-head">
<a href="https://monespacepro.eu/tarif/" style={{ textDecoration: 'none', color: 'inherit' }}> <a href="https://monespacepro.eu/" style={{ textDecoration: 'none', color: 'inherit' }} aria-label="MonEspacePro, accueil">
<Brand admin={false} /> <Brand admin={false} />
</a> </a>
<div> <span className="muted" style={{ fontSize: 14 }}>
<h1>Créer mon programme de fidélité</h1> Déjà inscrit ? <Link to="/espace">Se connecter</Link>
<p className="muted" style={{ margin: 0 }}>Sans engagement, résiliable à tout moment. Votre espace est prêt dès le paiement validé.</p> </span>
</div> </header>
{error && <div className="alert error" role="alert">{error}</div>}
<section className="card" style={{ display: 'flex', flexDirection: 'column', gap: 16 }}> <form onSubmit={submit} className="s-layout">
<h2>Formule</h2> <div className="s-main">
<div role="group" aria-label="Périodicité" className="row" style={{ gap: 8 }}> <div>
<button type="button" className="chip" aria-pressed={interval === 'MONTH'} onClick={() => setInterval('MONTH')}>Mensuel</button> <h1>Créer mon programme de fidélité</h1>
<button type="button" className="chip" aria-pressed={interval === 'YEAR'} onClick={() => setInterval('YEAR')}>Annuel — 2 mois offerts</button> <p className="muted" style={{ margin: '6px 0 0' }}>Trois minutes, sans engagement. Votre espace est prêt dès le paiement validé.</p>
</div> </div>
<div className="mode-cards" role="radiogroup" aria-label="Formule"> {error && <div className="alert error" role="alert">{error}</div>}
{(catalog.length ? catalog : PLANS.map((p) => ({ plan: p, name: PLAN_LABEL[p], tagline: '', priceCents: { MONTH: 0, YEAR: 0 }, modules: [], limits: { maxStaff: null } }))).map((c) => (
<label key={c.plan} className="mode-card" style={{ flexDirection: 'column', gap: 6 }}>
<span className="row" style={{ gap: 10 }}>
<input type="radio" name="plan" checked={plan === c.plan} onChange={() => setPlan(c.plan)} />
<strong style={{ fontSize: 18 }}>{c.name}</strong>
</span>
{c.priceCents[interval] > 0 && (
<span style={{ fontSize: 22, fontWeight: 800 }}>
{euros(c.priceCents[interval])}
<span className="muted" style={{ fontSize: 14, fontWeight: 500 }}> / {interval === 'YEAR' ? 'an' : 'mois'}</span>
</span>
)}
<span className="muted" style={{ fontSize: 14 }}>{c.tagline}</span>
</label>
))}
</div>
{current && (
<p className="muted" style={{ margin: 0, fontSize: 14 }}>
{current.limits.maxStaff ? `${current.limits.maxStaff} employés` : 'Employés illimités'} ·{' '}
{current.modules.length ? `Modules : ${current.modules.map((m) => m.name).join(', ')}` : 'Sans module complémentaire'}
</p>
)}
</section>
<section className="card" style={{ display: 'flex', flexDirection: 'column', gap: 16 }}> {/* 1. Formule */}
<h2>Votre commerce</h2> <section className="card s-section">
{FIELDS.map(([k, label, props]) => ( <div className="s-title"><span className="s-num">1</span><h2>Votre formule</h2></div>
<div className="field" key={k}> <div role="group" aria-label="Périodicité" className="s-seg">
<label htmlFor={`s-${k}`}>{label} *</label> <button type="button" aria-pressed={interval === 'MONTH'} onClick={() => setInterval('MONTH')}>Mensuel</button>
<input id={`s-${k}`} className="input" required value={v[k]} onChange={(e) => setV({ ...v, [k]: e.target.value })} {...props} /> <button type="button" aria-pressed={interval === 'YEAR'} onClick={() => setInterval('YEAR')}>Annuel · 2 mois offerts</button>
</div> </div>
))} <div className="s-plans" role="radiogroup" aria-label="Formule">
<div className="field"> {shown.map((c) => (
<label htmlFor="s-password">Mot de passe *</label> <label key={c.plan} className={`s-plan${plan === c.plan ? ' on' : ''}`}>
<input <input type="radio" name="plan" className="sr-only" checked={plan === c.plan} onChange={() => setPlan(c.plan)} />
id="s-password" {c.plan === 'PRO' && <span className="s-tag">Conseillée</span>}
className="input" <strong>{c.name}</strong>
type="password" {c.priceCents[interval] > 0 && (
required <span className="s-price">
minLength={10} {euros(c.priceCents[interval])}
autoComplete="new-password" <small> / {interval === 'YEAR' ? 'an' : 'mois'}</small>
value={v.password} </span>
onChange={(e) => setV({ ...v, password: e.target.value })} )}
/> <span className="muted" style={{ fontSize: 14 }}>{c.tagline}</span>
<span className="muted" style={{ fontSize: 14 }}>10 caractères minimum. Il ouvre votre espace web et l’app MonEspacePro.</span> </label>
</div> ))}
</section> </div>
</section>
<label className="row" style={{ gap: 10, alignItems: 'flex-start' }}> {/* 2. Commerce */}
<input type="checkbox" required checked={cgv} onChange={(e) => setCgv(e.target.checked)} style={{ marginTop: 4 }} /> <section className="card s-section">
<span> <div className="s-title"><span className="s-num">2</span><h2>Votre commerce</h2></div>
J’accepte les <a href="https://monespacepro.eu/cgv/" target="_blank" rel="noreferrer">conditions générales de vente</a> et la{' '} {field('name')}
<a href="https://monespacepro.eu/confidentialite/" target="_blank" rel="noreferrer">politique de confidentialité</a>. {field('siret')}
</span> {field('addressLine')}
</label> <div className="s-two">
<button className="btn" disabled={busy}>{busy ? 'Redirection vers le paiement…' : 'Continuer vers le paiement'}</button> {field('postalCode')}
<p className="muted" style={{ margin: 0, fontSize: 14, textAlign: 'center' }}> {field('city')}
Paiement sécurisé par Stripe (carte ou prélèvement SEPA). Déjà inscrit ? <Link to="/espace">Se connecter</Link> </div>
</p> </section>
{/* 3. Identifiants */}
<section className="card s-section">
<div className="s-title"><span className="s-num">3</span><h2>Vos identifiants</h2></div>
<div className="s-two">
{field('contactName')}
{field('contactPhone')}
</div>
{field('contactEmail')}
<div className="field">
<label htmlFor="s-password">Mot de passe</label>
<input
id="s-password"
className="input"
type="password"
required
minLength={10}
autoComplete="new-password"
value={v.password}
onChange={(e) => setV({ ...v, password: e.target.value })}
/>
<span className="muted" style={{ fontSize: 14 }}>10 caractères minimum. Il ouvre votre espace web et l’app MonEspacePro.</span>
</div>
</section>
</div>
{/* Récapitulatif, fixe sur grand écran */}
<aside className="s-side">
<section className="card s-summary">
<span className="muted" style={{ fontSize: 13, textTransform: 'uppercase', letterSpacing: '.05em' }}>Récapitulatif</span>
<div className="row between" style={{ alignItems: 'baseline' }}>
<strong style={{ fontSize: 20 }}>Formule {current?.name ?? PLAN_LABEL[plan]}</strong>
{current && (
<span style={{ fontSize: 22, fontWeight: 800 }}>
{euros(current.priceCents[interval])}
<span className="muted" style={{ fontSize: 14, fontWeight: 500 }}> / {interval === 'YEAR' ? 'an' : 'mois'}</span>
</span>
)}
</div>
{current && (
<ul className="s-list">
<li>Carte dans Apple Wallet et Google Wallet</li>
<li>{current.limits.maxStaff ? `${current.limits.maxStaff} employés` : 'Employés illimités'}</li>
{current.modules.map((m) => <li key={m.id}>{m.name}</li>)}
</ul>
)}
<label className="row" style={{ gap: 10, alignItems: 'flex-start', flexWrap: 'nowrap', fontSize: 14 }}>
<input type="checkbox" required checked={cgv} onChange={(e) => setCgv(e.target.checked)} style={{ marginTop: 3 }} />
<span>
J’accepte les <a href="https://monespacepro.eu/cgv/" target="_blank" rel="noreferrer">CGV</a> et la{' '}
<a href="https://monespacepro.eu/confidentialite/" target="_blank" rel="noreferrer">politique de confidentialité</a>.
</span>
</label>
<button className="btn" disabled={busy} style={{ width: '100%' }}>{busy ? 'Redirection vers le paiement…' : 'Continuer vers le paiement'}</button>
<ul className="s-trust">
<li>🔒 Paiement sécurisé par Stripe</li>
<li>💳 Carte bancaire ou prélèvement SEPA</li>
<li>↩︎ Sans engagement, résiliable à tout moment</li>
</ul>
</section>
</aside>
</form> </form>
</main> </main>
); );

View file

@ -201,3 +201,35 @@ dialog::backdrop { background: rgb(0 0 0 / 0.45); }
.m-copy { display: flex; gap: 8px; align-items: center; background: var(--surface-2); border-radius: 10px; padding: 8px 10px; font-size: 14px; word-break: break-all; } .m-copy { display: flex; gap: 8px; align-items: center; background: var(--surface-2); border-radius: 10px; padding: 8px 10px; font-size: 14px; word-break: break-all; }
.m-copy code { flex: 1; font: inherit; } .m-copy code { flex: 1; font: inherit; }
@media (max-width: 600px) { .m-top { padding: 12px 16px; } .m-hero { padding: 22px; } } @media (max-width: 600px) { .m-top { padding: 12px 16px; } .m-hero { padding: 22px; } }
/* ── Inscription en ligne (monespacepro.eu/inscription) ── */
.s-page { min-height: 100vh; padding: 0 16px 48px; }
.s-head { max-width: 1080px; margin: 0 auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 0; }
.s-layout { max-width: 1080px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: start; }
.s-main { display: flex; flex-direction: column; gap: 20px; }
.s-section { display: flex; flex-direction: column; gap: 16px; }
.s-title { display: flex; align-items: center; gap: 12px; }
.s-num { width: 30px; height: 30px; border-radius: 50%; background: var(--primary); color: #fff; font-weight: 800; display: grid; place-items: center; font-size: 15px; }
.s-seg { display: inline-flex; flex-wrap: wrap; max-width: 100%; align-self: flex-start; padding: 4px; border-radius: 12px; background: var(--surface-2); gap: 4px; }
.s-seg button { border: 0; background: transparent; font: inherit; font-weight: 700; font-size: 15px; padding: 8px 14px; border-radius: 9px; color: var(--text-3); cursor: pointer; }
.s-seg button[aria-pressed='true'] { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgb(0 0 0 / .1); }
.s-plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.s-plan { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 18px 16px 16px; border: 2px solid var(--border); border-radius: 16px; cursor: pointer; background: var(--surface); transition: border-color .15s, background .15s; }
.s-plan:hover { border-color: var(--border-strong); }
.s-plan.on { border-color: var(--primary); background: var(--primary-soft); }
.s-plan:has(input:focus-visible) { outline: 3px solid var(--primary); outline-offset: 2px; }
.s-plan strong { font-size: 18px; }
.s-price { font-size: 26px; font-weight: 800; }
.s-price small { font-size: 14px; font-weight: 500; color: var(--text-3); }
.s-tag { position: absolute; top: -11px; left: 14px; background: var(--primary); color: #fff; font-size: 12px; font-weight: 700; padding: 2px 10px; border-radius: 999px; }
.s-two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.s-side { position: sticky; top: 24px; }
.s-summary { display: flex; flex-direction: column; gap: 16px; }
.s-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.s-list li::before { content: '✓'; color: var(--primary); font-weight: 800; margin-right: 8px; }
.s-trust { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--text-3); }
@media (max-width: 860px) {
.s-layout { grid-template-columns: minmax(0, 1fr); }
.s-side { position: static; }
}
@media (max-width: 520px) { .s-two { grid-template-columns: 1fr; } }

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -8,8 +8,8 @@
<title>Affichette — MonEspacePro</title> <title>Affichette — MonEspacePro</title>
<link rel="preconnect" href="https://fonts.googleapis.com" /> <link rel="preconnect" href="https://fonts.googleapis.com" />
<link href="https://fonts.googleapis.com/css2?family=Figtree:wght@400;500;600;700;800&display=swap" rel="stylesheet" /> <link href="https://fonts.googleapis.com/css2?family=Figtree:wght@400;500;600;700;800&display=swap" rel="stylesheet" />
<script type="module" crossorigin src="/assets/espace/index-Bea8juAd.js"></script> <script type="module" crossorigin src="/assets/espace/index-fxzUSxGt.js"></script>
<link rel="stylesheet" crossorigin href="/assets/espace/index-CbAJ7a2F.css"> <link rel="stylesheet" crossorigin href="/assets/espace/index-BTYDwwaq.css">
</head> </head>
<body> <body>
<div id="root"></div> <div id="root"></div>

View file

@ -8,8 +8,8 @@
<title>Mon espace — MonEspacePro</title> <title>Mon espace — MonEspacePro</title>
<link rel="preconnect" href="https://fonts.googleapis.com" /> <link rel="preconnect" href="https://fonts.googleapis.com" />
<link href="https://fonts.googleapis.com/css2?family=Figtree:wght@400;500;600;700;800&display=swap" rel="stylesheet" /> <link href="https://fonts.googleapis.com/css2?family=Figtree:wght@400;500;600;700;800&display=swap" rel="stylesheet" />
<script type="module" crossorigin src="/assets/espace/index-Bea8juAd.js"></script> <script type="module" crossorigin src="/assets/espace/index-fxzUSxGt.js"></script>
<link rel="stylesheet" crossorigin href="/assets/espace/index-CbAJ7a2F.css"> <link rel="stylesheet" crossorigin href="/assets/espace/index-BTYDwwaq.css">
</head> </head>
<body> <body>
<div id="root"></div> <div id="root"></div>

View file

@ -7,8 +7,8 @@
<title>Créer mon programme de fidélité — MonEspacePro</title> <title>Créer mon programme de fidélité — MonEspacePro</title>
<link rel="preconnect" href="https://fonts.googleapis.com" /> <link rel="preconnect" href="https://fonts.googleapis.com" />
<link href="https://fonts.googleapis.com/css2?family=Figtree:wght@400;500;600;700;800&display=swap" rel="stylesheet" /> <link href="https://fonts.googleapis.com/css2?family=Figtree:wght@400;500;600;700;800&display=swap" rel="stylesheet" />
<script type="module" crossorigin src="/assets/espace/index-Bea8juAd.js"></script> <script type="module" crossorigin src="/assets/espace/index-fxzUSxGt.js"></script>
<link rel="stylesheet" crossorigin href="/assets/espace/index-CbAJ7a2F.css"> <link rel="stylesheet" crossorigin href="/assets/espace/index-BTYDwwaq.css">
</head> </head>
<body> <body>
<div id="root"></div> <div id="root"></div>