// AK-P16b · public booking page (M06 Block G) — interim S04-style look (AD-28) // matching the PublicFormRenderer target screens: centered card with accent bar, // slot pills, themed submit and centered success state. Kept as plain `tcbook-*` // CSS (no `~/ui`, no Tailwind) so the `/embed` iframe variant stays // dependency-free — same documented deviation as PublicFormRenderer. The bespoke // Calendly-polish screen still follows David D-BOOK/D-P16 (design-nachzug). // Single-page flow: pick a slot → fill the mini-form (GDPR required) → // confirmation with an "add to calendar" (.ics) download. The component reads // route-injected data only (no DB import); useLoaderData is allowed here. import { Form, useActionData, useLoaderData, useNavigation } from "react-router"; import { useTranslation } from "react-i18next"; import type { PublicBookingLoaderData, PublicBookingActionData } from "../routes/PublicBooking.server"; /** * Self-contained styles mirroring TCFORM_CSS (S04 public form, V01 success, * V03 submit error) with booking-specific slot pills. Driven by the same CSS * variable names' booking twins so a tenant theme can restyle both surfaces. */ const TCBOOK_CSS = ` .tcbook-root { font-family: var(--tcbook-font, system-ui, -apple-system, "Segoe UI", sans-serif); color: var(--tcbook-text, #16232e); box-sizing: border-box; padding: 16px; } .tcbook-root *, .tcbook-root *::before, .tcbook-root *::after { box-sizing: border-box; } .tcbook-root--page { min-height: 100vh; background: #f2f4f7; padding: 48px 16px; } .tcbook-shell { max-width: 576px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; } .tcbook-brand { display: flex; justify-content: center; } .tcbook-brand-badge { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 50%; border: 1px solid #e0e5eb; background: #eef2f7; background: color-mix(in srgb, var(--tcbook-primary, #2563eb) 10%, #ffffff); color: var(--tcbook-primary, #2563eb); font-size: 1.15rem; font-weight: 700; } .tcbook-card { background: var(--tcbook-bg, #ffffff); border: 1px solid #e0e5eb; border-top: 4px solid var(--tcbook-primary, #2563eb); border-radius: var(--tcbook-radius, 10px); box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 8px 24px rgba(16, 24, 40, 0.06); padding: 32px 28px; } .tcbook-root h1 { font-size: 1.35rem; line-height: 1.3; margin: 0 0 6px; font-weight: 700; } .tcbook-tenant { margin: 0 0 4px; font-size: 0.8rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; opacity: 0.6; } .tcbook-root p.tcbook-description { margin: 0; font-size: 0.9rem; line-height: 1.5; opacity: 0.72; } .tcbook-duration { margin: 8px 0 0; font-size: 0.85rem; opacity: 0.72; } .tcbook-divider { border: 0; height: 1px; background: #e7ebef; margin: 20px 0; } .tcbook-legend { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 8px; padding: 0; } .tcbook-slots { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; border: 0; } .tcbook-slot { position: relative; } .tcbook-slot input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; margin: 0; } .tcbook-slot span { display: inline-flex; align-items: center; justify-content: center; min-width: 72px; padding: 9px 14px; border: 1px solid #cfd6dd; border-radius: var(--tcbook-radius, 8px); font-size: 0.92rem; font-weight: 500; background: #fff; transition: border-color 120ms ease, background 120ms ease, color 120ms ease; } .tcbook-slot input:checked + span { border-color: var(--tcbook-primary, #2563eb); background: var(--tcbook-primary, #2563eb); color: #fff; } .tcbook-slot input:focus-visible + span { outline: 2px solid var(--tcbook-primary, #2563eb); outline-offset: 2px; } .tcbook-slot input:hover:not(:checked) + span { border-color: var(--tcbook-primary, #2563eb); } .tcbook-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; } .tcbook-row { display: block; margin-bottom: 14px; } .tcbook-root input[type=text], .tcbook-root input[type=email], .tcbook-root input[type=tel] { width: 100%; padding: 10px 12px; border: 1px solid #cfd6dd; border-radius: var(--tcbook-radius, 8px); font: inherit; font-size: 0.95rem; color: inherit; background: #fff; transition: border-color 120ms ease, box-shadow 120ms ease; } .tcbook-root input:focus { outline: none; border-color: var(--tcbook-primary, #2563eb); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15); box-shadow: 0 0 0 3px color-mix(in srgb, var(--tcbook-primary, #2563eb) 18%, transparent); } .tcbook-root input::placeholder { color: inherit; opacity: 0.45; } .tcbook-root input[type=checkbox] { width: 16px; height: 16px; margin: 2px 0 0; accent-color: var(--tcbook-primary, #2563eb); flex: none; } .tcbook-consent { border: 1px solid #e0e5eb; border-radius: var(--tcbook-radius, 8px); background: #fbfcfd; padding: 12px 14px; margin-bottom: 14px; } .tcbook-consent label { display: flex; align-items: flex-start; gap: 10px; font-weight: 500; font-size: 0.875rem; line-height: 1.45; margin: 0; cursor: pointer; } .tcbook-error { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border: 1px solid #fecaca; border-radius: var(--tcbook-radius, 8px); background: #fef2f2; color: #991b1b; font-size: 0.9rem; line-height: 1.45; margin: 16px 0 0; } .tcbook-error svg { flex: none; margin-top: 2px; } .tcbook-empty { padding: 12px 14px; border: 1px dashed #cfd6dd; border-radius: var(--tcbook-radius, 8px); background: #fbfcfd; font-size: 0.9rem; line-height: 1.45; margin-top: 16px; opacity: 0.85; } .tcbook-root button.tcbook-submit { display: block; width: 100%; background: var(--tcbook-primary, #2563eb); color: #fff; border: 0; padding: 12px 18px; border-radius: var(--tcbook-radius, 8px); cursor: pointer; font: inherit; font-size: 0.95rem; font-weight: 600; transition: filter 120ms ease; } .tcbook-root button.tcbook-submit:hover:not([disabled]) { filter: brightness(0.92); } .tcbook-root button.tcbook-submit:focus-visible { outline: 2px solid var(--tcbook-primary, #2563eb); outline-offset: 2px; } .tcbook-root button.tcbook-submit[disabled] { opacity: 0.6; cursor: progress; } .tcbook-success { display: flex; flex-direction: column; align-items: center; gap: 16px; text-align: center; padding: 16px 0; } .tcbook-success-icon { display: inline-flex; align-items: center; justify-content: center; width: 56px; height: 56px; border-radius: 50%; background: #ecfdf5; color: #059669; } .tcbook-success-message { margin: 0; font-size: 1.1rem; font-weight: 600; line-height: 1.4; } .tcbook-success-body { margin: 0; font-size: 0.92rem; line-height: 1.5; opacity: 0.78; } .tcbook-ics { display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: var(--tcbook-primary, #2563eb); color: #fff; text-decoration: none; padding: 11px 18px; border-radius: var(--tcbook-radius, 8px); font-size: 0.92rem; font-weight: 600; transition: filter 120ms ease; } .tcbook-ics:hover { filter: brightness(0.92); } @media (max-width: 520px) { .tcbook-card { padding: 24px 16px; } .tcbook-root--page { padding: 24px 12px; } .tcbook-grid-2 { grid-template-columns: 1fr; } } `; function IconCheck(): React.JSX.Element { return ( ); } function IconAlert(): React.JSX.Element { return ( ); } function BookingShell({ isEmbed, tenantName, children }: { isEmbed: boolean; tenantName: string; children: React.ReactNode }): React.JSX.Element { return (