AgPerry's picture
Add files using upload-large-folder tool
edec962 verified
Raw History Blame Contribute Delete
79.8 kB
"""Source-grounded HTML surfaces for the Curology offline clone."""
from __future__ import annotations
from html import escape
from typing import Any
from urllib.parse import quote
PURPLE = "#6c57ff"
def _e(value: Any) -> str:
return escape("" if value is None else str(value), quote=True)
def _selected(current: Any, value: Any) -> str:
return "selected" if current == value else ""
def _logo() -> str:
return """<span class="brand-mark" aria-hidden="true"><i></i></span>
<span class="brand-word">Curology</span>"""
def _shop_menu() -> str:
return """<div class="nav-item has-menu">
<button class="nav-trigger" type="button" aria-expanded="false" aria-controls="shop-menu">Shop <span class="nav-chevron" aria-hidden="true"></span></button>
<section class="mega-menu shop-menu" id="shop-menu" aria-label="Shop menu">
<div><h2>All products</h2><a href="/shop?sort=featured">Best sellers</a><a href="/shop?sort=newest">New arrivals</a><a href="/shop?category=prescription">Rx products</a><a href="/shop?category=non-rx">Non-Rx products</a><a href="/shop?category=sets">Sets</a><a class="mega-all" href="/shop">Shop all →</a></div>
<div><h2>Shop by concern</h2><a href="/shop?concern=acne">Acne</a><a href="/shop?concern=hydration">Hydration</a><a href="/shop?concern=dark-spots">Dark spots</a><a href="/shop?concern=redness">Redness &amp; rosacea</a></div>
<div><h2>For skin</h2><a href="/shop?category=prescription">Rx products</a><a href="/shop?category=cleansers">Cleansers</a><a href="/shop?category=treatments">Treatments and serums</a><a href="/shop?category=moisturizers">Moisturizers</a><a href="/shop?category=sun">Sun protection</a></div>
<div><h2>For body</h2><a href="/shop?category=body">Body care</a><h2>For hair</h2><a href="/shop?category=hair">Hair care</a></div>
</section>
</div>"""
def _skincare_menu() -> str:
return """<div class="nav-item has-menu">
<button class="nav-trigger" type="button" aria-expanded="false" aria-controls="skincare-menu">Skincare 101 <span class="nav-chevron" aria-hidden="true"></span></button>
<section class="mega-menu skincare-menu" id="skincare-menu" aria-label="Skincare 101 menu">
<div><h2>Our favorite topics</h2><a href="/skincare-101?topic=skin-concerns">Skin concerns</a><a href="/skincare-101?topic=skin-treatments">Skin treatments</a><a href="/skincare-101?topic=skincare-products">Skincare products</a><a href="/skincare-101?topic=ingredients">Ingredients</a></div>
<div><h2>More content</h2><a href="/skincare-101?topic=curology">Curology</a><a href="/skincare-101?topic=mind-body">Mind &amp; body</a><a href="/skincare-101?topic=video">Video</a><a class="mega-all" href="/skincare-101">All stories →</a></div>
<a class="menu-feature" href="/skincare-101?topic=skin-concerns"><span class="menu-feature-art" aria-hidden="true"></span><b>What is acne anyway?</b><small>A one-stop guide from skin experts</small></a>
</section>
</div>"""
def _footer() -> str:
return f"""<footer class="site-footer">
<div class="footer-brand"><a class="brand inverse" href="/">{_logo()}</a><p>Personalized skincare, made for you.</p><a class="button footer-cta" href="/sign-up/start/face">Find your Rx formula</a></div>
<nav aria-label="Footer navigation" class="footer-links">
<div><h2>Explore</h2><a href="/sign-up/start/face">Get started</a><a href="/shop">Shop products</a><a href="/why-curology">Why Curology</a><a href="/why-curology#our-story">Our story</a><a href="/reviews">Reviews</a></div>
<div><h2>Resources</h2><a href="/help">Support</a><a href="/skincare-101">Blog</a><a href="/about/careers">Careers</a><a href="/about/press">Press room</a><a href="/contact">Contact us</a></div>
</nav>
<div class="footer-social" aria-label="Social channels"><h2>Follow along</h2><div>{''.join(f'<button type="button" data-social="{name}">{name}</button>' for name in ('Instagram','TikTok','Facebook','Pinterest','LinkedIn','YouTube'))}</div></div>
<div class="footer-bottom"><p>All Rights Reserved 2014-2026 Curology, Inc.</p><nav aria-label="Legal"><a href="/terms">Terms of Service</a><a href="/privacy">Privacy Notice</a><a href="/privacy#do-not-sell">Do Not Sell or Share My Personal Information</a></nav><div><a href="/help#access">Curology Access Program</a><button type="button" data-manage-cookies>Manage Cookies</button></div><p class="offline-disclosure">Offline WebsiteBench simulation. No medical care, email, card charge, social visit, or external activation occurs.</p></div>
</footer>"""
def _cart_drawer() -> str:
return """<div class="cart-scrim" data-cart-close hidden></div><aside class="cart-drawer" id="cart-drawer" aria-labelledby="cart-heading" hidden><header><h2 id="cart-heading">Your bag</h2><button type="button" data-cart-close aria-label="Close shopping bag">×</button></header><div class="cart-items" data-cart-items><p>Your bag is empty.</p></div><div class="cart-summary"><span>Local subtotal</span><strong data-cart-total>$0.00</strong></div><a class="button full" href="/sign-up/start/face">Personalize &amp; check out</a><button class="cart-clear" type="button" data-cart-clear>Clear bag</button><p>Bag items stay in this browser. Checkout uses the existing local sandbox and never charges a card.</p></aside>"""
def layout(
title: str,
content: str,
*,
account: dict[str, Any] | None = None,
compact: bool = False,
show_offer: bool = False,
offer_copy: str | None = None,
status_code: int = 200,
) -> str:
account_link = (
'<a class="nav-link" href="/account">My account</a>'
if account
else '<a class="nav-link" href="/auth/login">Log in</a>'
)
if compact:
navigation = f"""
<header class="compact-header">
<a class="brand" href="/" aria-label="Curology home">{_logo()}</a>
<div class="compact-actions">{account_link}<a class="chat-dot" href="/contact" aria-label="Contact support">···</a></div>
</header>"""
else:
navigation = f"""
<header class="site-header">
<a class="brand" href="/" aria-label="Curology home">{_logo()}</a>
<div class="mobile-actions"><a class="button mobile-cta" href="/sign-up/start/face">Find your Rx formula</a><button class="mobile-bag" type="button" data-cart-toggle aria-controls="cart-drawer" aria-label="Shopping bag"><span data-cart-count>0</span></button><button class="menu-button" type="button" aria-expanded="false" aria-controls="primary-nav"><span class="menu-icon" aria-hidden="true"></span><span class="sr-only">Menu</span></button></div>
<nav id="primary-nav" aria-label="Primary navigation">
{_shop_menu()}
<a class="nav-link" href="/why-curology">Why Curology</a>
<a class="nav-link" href="/reviews">Reviews</a>
{_skincare_menu()}
{account_link}
<a class="button small" href="/sign-up/start/face">Find your Rx formula</a>
<button class="bag" type="button" data-cart-toggle aria-controls="cart-drawer" aria-label="Shopping bag"><span data-cart-count>0</span></button>
</nav>
</header>"""
offer = (
f'<div class="offer">{_e(offer_copy)}</div>'
if offer_copy
else '<div class="offer">Try Curology FREE* for 30 days when you subscribe—just pay $5.45 shipping &amp; handling</div>'
if show_offer else ""
)
cookie = """
<section class="cookie-banner" id="cookie-banner" role="dialog" aria-label="Cookie Consent Banner" hidden>
<button class="cookie-close" type="button" data-cookie="essential" aria-label="Close this dialog">×</button>
<div><p>This website uses cookies for essential site functionality. Optional analytics and personalization stay off in this offline clone.</p>
<a href="/privacy">Privacy Policy</a><p><a href="/privacy">Cookie Preferences</a></p>
<div class="cookie-toggles"><label><input type="checkbox" data-cookie-option="targeted">Targeted Advertising</label><label><input type="checkbox" data-cookie-option="personalization">Personalization</label><label><input type="checkbox" data-cookie-option="analytics">Analytics</label></div></div>
<div class="cookie-actions"><button type="button" data-cookie="save">Save</button><button type="button" data-cookie="all">Accept all</button><button type="button" data-cookie="essential">Reject all</button></div>
</section>"""
return f"""<!doctype html>
<html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">
<meta name="theme-color" content="{PURPLE}"><title>{_e(title)} · Curology</title>
<meta name="description" content="Explore a local, offline Curology skincare experience with products, routines, education, and account controls.">
<link rel="icon" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNk+A8AAQUBAScY42YAAAAASUVORK5CYII=">
<link rel="stylesheet" href="/static/style.css"></head>
<body data-status="{status_code}"><a class="skip-link" href="#main">Skip to main content</a>{navigation}{offer}
<main id="main">{content}</main>
{_footer()}{_cart_drawer()}
{cookie}<div class="toast" id="toast" role="status" aria-live="polite"></div><script src="/static/app.js" defer></script></body></html>"""
def home(account: dict[str, Any] | None) -> str:
return layout(
"Personalized prescription skincare",
"""
<section class="home-hero">
<div class="hero-copy"><h1>Skincare that<br>understands the<br>assignment</h1>
<p>Personalized prescription care that is designed to evolve with your skin and deliver real results.</p>
<div class="proof-row"><span><b>93%</b> report effective*</span><span><b>5M+</b> patients treated</span><span><b>9K+</b> 5-star reviews</span></div>
<a class="button" href="/sign-up/start/face">Start in minutes</a></div>
<div class="hero-art" role="img" aria-label="Two adults holding an unbranded skincare bottle in an original local editorial photograph"></div>
</section>
<section class="section formula-strip"><div><p class="eyebrow">Personalized prescription formulas</p><h2>One routine, made around your skin</h2><a class="text-link" href="/products/custom-formula-acne/">Explore Custom FormulaRx →</a></div>
<div class="mini-products"><article><div class="tube violet"></div><h3>Custom FormulaRx</h3><p>Target acne, dark spots &amp; more.</p></article><article><div class="tube blue"></div><h3>DayPrimeRx</h3><p>Target acne and prime your skin.</p></article><article><div class="tube white"></div><h3>HydroTretRx</h3><p>Target texture and hydrate.</p></article></div>
</section>
<section class="section how"><p class="eyebrow">How Curology works</p><h2>A guided routine in four clear steps</h2><div class="steps"><article><b>1</b><h3>Tell us about you</h3><p>Answer quick questions about your skin and goals.</p></article><article><b>2</b><h3>See your plan</h3><p>Review the local personalized-plan simulation.</p></article><article><b>3</b><h3>Start your routine</h3><p>Choose delivery options and review local payment.</p></article><article><b>4</b><h3>Manage anytime</h3><p>Modify, pause, skip, cancel, or reactivate locally.</p></article></div><a class="button" href="/sign-up/start/face">Get your formula</a></section>
""",
account=account,
show_offer=True,
)
PRODUCTS = [
("dayprime-rx", "DayPrimeRx", "Acne Treatment + Blurring Primer", "$29.95", "violet"),
("am-to-pm-acne-routine", "AM to PM: Acne Routine", "DayPrimeRx and Custom FormulaRx", "$59.90", "lavender"),
("am-to-pm-anti-aging-routine", "AM to PM: Anti-Aging Routine", "DayPrimeRx and HydroTretRx", "$59.90", "blue"),
("custom-formula-acne", "Custom FormulaRx for acne", "Daily acne clearing treatment", "$34.95", "white"),
("hydrotret-rx", "HydroTretRx", "Hydrating tretinoin-powered treatment", "$34.95", "blue"),
("body-cleanse-rx", "Body CleanseRx", "Prescription-powered wash for body breakouts", "$14", "violet"),
("gentle-cleanser", "Gentle Cleanser", "Lightly foaming face wash", "$12", "navy"),
("hydro-hydration-serum", "Hydro + Hydration Serum", "Support for smoother-looking skin", "$25", "blue"),
("cream-moisturizer", "Cream Moisturizer", "Rich hydration for dry skin", "$17", "navy"),
("gel-moisturizer", "Gel Moisturizer", "Lightweight daily hydration", "$9–$16", "blue"),
("hydro-gel-cream-moisturizer", "Hydro+ Gel-Cream Moisturizer", "Maximum hydration with a lightweight finish", "$21", "lavender"),
("hydro-eye-gel", "Hydro+ Eye Gel", "Hydrate, visibly depuff, and smooth", "$25", "blue"),
("daily-moisturizing-lotion-spf-30", "Daily Moisturizing Lotion SPF 30", "Moisturize while protecting against UV rays", "$18", "white"),
("micellar-makeup-remover", "Micellar Makeup Remover", "Gentle no-rinse cleansing water", "$14", "white"),
("emergency-spot-patches", "Emergency Spot Patches", "Low-profile patches for surprise spots", "$8", "lavender"),
("lip-balm", "The Lip Balm", "Nourishing vegan formula", "$8", "navy"),
]
PRODUCT_BY_SLUG = {item[0]: item for item in PRODUCTS}
PRODUCT_META: dict[str, dict[str, Any]] = {
"dayprime-rx": {"category": "prescription", "concerns": {"acne", "dark-spots", "redness"}, "rating": "4.8", "reviews": 186, "size": "30 mL", "price": 29.95, "ingredients": "Azelaic acid, niacinamide, and a provider-selected active blend.", "use": "Apply in the morning as directed in your local routine."},
"am-to-pm-acne-routine": {"category": "sets", "concerns": {"acne", "dark-spots", "redness"}, "rating": "4.8", "reviews": 324, "size": "2 treatments", "price": 59.90, "ingredients": "DayPrimeRx plus a personalized Custom FormulaRx.", "use": "Use the primer treatment in the morning and custom formula at night."},
"am-to-pm-anti-aging-routine": {"category": "sets", "concerns": {"hydration", "dark-spots"}, "rating": "4.7", "reviews": 208, "size": "2 treatments", "price": 59.90, "ingredients": "DayPrimeRx plus hydrating HydroTretRx.", "use": "Use morning and evening products in their labeled order."},
"custom-formula-acne": {"category": "prescription", "concerns": {"acne", "dark-spots", "redness"}, "rating": "4.8", "reviews": 923, "size": "30-day supply", "price": 34.95, "ingredients": "A locally simulated three-ingredient formula selected from niacinamide, azelaic acid, and clindamycin.", "use": "Apply a thin layer in the evening according to the simulated plan."},
"hydrotret-rx": {"category": "prescription", "concerns": {"hydration", "dark-spots"}, "rating": "4.7", "reviews": 274, "size": "30 mL", "price": 34.95, "ingredients": "Tretinoin-inspired local simulation with hydrating support ingredients.", "use": "Use in the evening and follow the local routine guidance."},
"body-cleanse-rx": {"category": "body", "concerns": {"acne"}, "rating": "4.7", "reviews": 164, "size": "200 mL", "price": 14.00, "ingredients": "A gently exfoliating cleanser modeled for body breakouts.", "use": "Massage onto wet body skin, rinse, and avoid the face."},
"gentle-cleanser": {"category": "cleansers", "concerns": {"acne", "hydration", "redness"}, "rating": "4.8", "reviews": 481, "size": "150 mL", "price": 12.00, "ingredients": "Glycerin and gentle cleansing agents without added fragrance.", "use": "Massage onto damp skin, rinse, and pat dry morning and night."},
"hydro-hydration-serum": {"category": "treatments", "concerns": {"hydration", "redness"}, "rating": "4.7", "reviews": 119, "size": "30 mL", "price": 25.00, "ingredients": "Hyaluronic acid, polyglutamic acid, and soothing support ingredients.", "use": "Smooth one to two pumps over clean skin before moisturizer."},
"cream-moisturizer": {"category": "moisturizers", "concerns": {"hydration", "redness"}, "rating": "4.8", "reviews": 221, "size": "50 mL", "price": 17.00, "ingredients": "Hyaluronic acid, glycerin, shea butter, squalane, allantoin, and aloe.", "use": "Apply to clean skin after treatment, morning and night. Layer more on dry areas."},
"gel-moisturizer": {"category": "moisturizers", "concerns": {"hydration", "acne"}, "rating": "4.8", "reviews": 614, "size": "50 mL", "price": 16.00, "ingredients": "Hyaluronic acid and lightweight, non-clogging hydrators.", "use": "Apply evenly after treatment whenever skin needs hydration."},
"hydro-gel-cream-moisturizer": {"category": "moisturizers", "concerns": {"hydration", "redness"}, "rating": "4.7", "reviews": 180, "size": "50 mL", "price": 21.00, "ingredients": "Hyaluronic acid-5, polyglutamic acid, ectoin, and peptides.", "use": "Smooth over face and neck after serums or treatment."},
"hydro-eye-gel": {"category": "treatments", "concerns": {"hydration"}, "rating": "4.7", "reviews": 86, "size": "15 mL", "price": 25.00, "ingredients": "Hyaluronic acid-5, polyglutamic acid, and peptides.", "use": "Use the cooling applicator around the orbital bone; avoid direct eye contact."},
"daily-moisturizing-lotion-spf-30": {"category": "sun", "concerns": {"hydration", "dark-spots"}, "rating": "4.6", "reviews": 102, "size": "50 mL", "price": 18.00, "ingredients": "Broad-spectrum SPF 30 filters with daily moisturizing ingredients.", "use": "Apply generously as the last morning step and reapply as needed."},
"micellar-makeup-remover": {"category": "cleansers", "concerns": {"acne", "redness"}, "rating": "4.7", "reviews": 74, "size": "200 mL", "price": 14.00, "ingredients": "Micellar cleansing agents and skin-comforting humectants.", "use": "Saturate a cotton pad, sweep gently, and follow with cleanser if desired."},
"emergency-spot-patches": {"category": "treatments", "concerns": {"acne"}, "rating": "4.8", "reviews": 332, "size": "20 patches", "price": 8.00, "ingredients": "Low-profile hydrocolloid patches without active medication.", "use": "Place on clean, dry skin and remove once the patch turns opaque."},
"lip-balm": {"category": "treatments", "concerns": {"hydration"}, "rating": "4.9", "reviews": 24, "size": "4 g", "price": 8.00, "ingredients": "Vegan emollients and nourishing plant-derived oils.", "use": "Swipe onto lips whenever they feel dry."},
}
CATEGORY_LABELS = {
"": "All products", "prescription": "Rx products", "non-rx": "Non-Rx products",
"sets": "Sets", "cleansers": "Cleansers", "treatments": "Treatments & serums",
"moisturizers": "Moisturizers", "sun": "Sun protection", "body": "Body care", "hair": "Hair care",
}
CONCERN_LABELS = {"": "All concerns", "acne": "Acne", "hydration": "Hydration", "dark-spots": "Dark spots", "redness": "Redness & rosacea"}
def _is_prescription(slug: str) -> bool:
return PRODUCT_META[slug]["category"] in {"prescription", "sets"} or slug == "body-cleanse-rx"
def _product_path(slug: str) -> str:
return f"/products/{slug}/" if _is_prescription(slug) else f"/shop/{slug}"
def _five_stars() -> str:
return '<span class="star-icons" aria-hidden="true">' + "<i></i>" * 5 + "</span>"
def _stars(meta: dict[str, Any]) -> str:
return f'<span class="stars" aria-label="{_e(meta["rating"])} out of 5 stars">{_five_stars()}</span><span>{_e(meta["rating"])}/5</span>'
def shop(
account: dict[str, Any] | None,
query: str = "",
category: str = "",
concern: str = "",
sort: str = "featured",
) -> str:
normalized = query.strip().casefold()
category = category if category in CATEGORY_LABELS else ""
concern = concern if concern in CONCERN_LABELS else ""
sort = sort if sort in {"featured", "newest", "price-asc", "price-desc"} else "featured"
products = [item for item in PRODUCTS if normalized in " ".join(item).casefold()]
if category == "non-rx":
products = [item for item in products if not _is_prescription(item[0])]
elif category:
products = [item for item in products if PRODUCT_META[item[0]]["category"] == category]
if concern:
products = [item for item in products if concern in PRODUCT_META[item[0]]["concerns"]]
if sort == "newest":
products = list(reversed(products))
elif sort == "price-asc":
products.sort(key=lambda item: PRODUCT_META[item[0]]["price"])
elif sort == "price-desc":
products.sort(key=lambda item: PRODUCT_META[item[0]]["price"], reverse=True)
search = f"""<form class="catalog-tools" action="/shop" method="get"><label class="catalog-search">Search products<input id="shop-search" name="q" value="{_e(query)}" placeholder="Search skincare"></label><label>Product type<select name="category">{''.join(f'<option value="{_e(value)}" {"selected" if value == category else ""}>{_e(label)}</option>' for value, label in CATEGORY_LABELS.items())}</select></label><label>Skin goal<select name="concern">{''.join(f'<option value="{_e(value)}" {"selected" if value == concern else ""}>{_e(label)}</option>' for value, label in CONCERN_LABELS.items())}</select></label><label>Sort by<select name="sort"><option value="featured" {"selected" if sort == "featured" else ""}>Featured</option><option value="newest" {"selected" if sort == "newest" else ""}>Newest</option><option value="price-asc" {"selected" if sort == "price-asc" else ""}>Price: low to high</option><option value="price-desc" {"selected" if sort == "price-desc" else ""}>Price: high to low</option></select></label><button class="filter-submit" type="submit">Apply filters</button></form>"""
if not products:
label = query or CATEGORY_LABELS.get(category) or CONCERN_LABELS.get(concern) or "these filters"
body = f"""<section class="catalog"><div class="catalog-heading"><p class="eyebrow">Shop skincare</p><h1>Products for every routine</h1></div>{search}<section class="empty-state catalog-empty"><span class="face">⌁</span><h2>No matches for “{_e(label)}”</h2><p>Try a broader search or return to all routine essentials.</p><a class="button" href="/shop">View all skincare</a><a class="text-link" href="/sign-up/start/face">Find your Rx formula</a></section></section>"""
else:
cards = "".join(
f"""<article class="product-card"><a href="{_product_path(slug)}"><div class="product-art {_e(color)}"><div class="tube {_e(color)}"></div>{'<span class="rx-card-badge">Rx</span>' if _is_prescription(slug) else ''}</div><h2>{_e(name)}</h2></a><div class="card-rating">{_stars(PRODUCT_META[slug])}<a href="{_product_path(slug)}#reviews">({_e(PRODUCT_META[slug]['reviews'])})</a></div><p>{_e(description)}</p><div class="card-buy"><strong>{_e(price)}</strong>{'<a href="/sign-up/start/face">Get formula</a>' if _is_prescription(slug) else f'<button type="button" data-cart-add="{_e(slug)}" data-product-name="{_e(name)}" data-product-price="{PRODUCT_META[slug]["price"]:.2f}">Add</button>'}</div></article>"""
for slug, name, description, price, color in products
)
body = f'<section class="catalog"><div class="catalog-heading"><p class="eyebrow">Shop skincare</p><h1>Shop skincare routine essentials</h1><p>Prescription-powered personalization and dermatologist-designed daily essentials.</p></div>{search}<div class="catalog-results"><p><b>{len(products)}</b> products</p><a href="/shop">Clear filters</a></div><div class="product-grid">{cards}</div></section>'
return layout("Shop skincare", body, account=account, show_offer=True)
def product_detail(account: dict[str, Any] | None, slug: str) -> str:
_, name, description, price, color = PRODUCT_BY_SLUG[slug]
meta = PRODUCT_META[slug]
prescription = _is_prescription(slug)
badge = (
"" if slug == "cream-moisturizer"
else '<span class="rx-badge">Rx · HSA/FSA ELIGIBLE</span>'
if prescription else '<span class="rx-badge">DERMATOLOGIST DEVELOPED</span>'
)
targets = (
'<span>Acne</span><span>Clogged pores</span><span>Skin texture</span><span>Dark spots</span>'
if prescription
else '<span>Cleanse</span><span>Hydrate</span><span>Support your routine</span>'
)
main_art = (
'<img class="product-photo" src="/static/assets/cream-moisturizer-main.png" alt="Cream Moisturizer tube on a clean white background">'
if slug == "cream-moisturizer"
else f'<div class="large-bottle {_e(color)}">Curology</div>'
)
gallery = (
'<button type="button" class="thumb selected" data-product-image="/static/assets/cream-moisturizer-main.png" aria-label="Product front view"><img src="/static/assets/cream-moisturizer-main.png" alt=""></button><button type="button" class="thumb" data-product-image="/static/assets/cream-moisturizer-texture.jpg" aria-label="Moisturizer texture view"><img src="/static/assets/cream-moisturizer-texture.jpg" alt=""></button><button type="button" class="thumb" data-product-image="/static/assets/cream-moisturizer-lifestyle.jpg" aria-label="Moisturizer lifestyle view"><img src="/static/assets/cream-moisturizer-lifestyle.jpg" alt=""></button>'
if slug == "cream-moisturizer"
else ''.join(f'<button type="button" class="thumb {"selected" if index == 0 else ""}" aria-label="{_e(name)} view {index + 1}"><span class="mini-bottle {_e(color)}"></span></button>' for index in range(3))
)
purchase = (
'<a class="button full" href="/sign-up/start/face">Get your formula</a>'
if prescription
else f'<div class="purchase-controls"><div class="quantity-control" aria-label="Quantity"><button type="button" data-quantity-decrement aria-label="Decrease quantity">−</button><output data-quantity>1</output><button type="button" data-quantity-increment aria-label="Increase quantity">+</button></div><button class="button add-to-bag" type="button" data-cart-add="{_e(slug)}" data-product-name="{_e(name)}" data-product-price="{meta["price"]:.2f}">Add to cart</button></div>'
)
review_cards = "".join(
f'<article><div class="review-stars">{_five_stars()}</div><h3>{_e(title)}</h3><p>{_e(copy)}</p><small>Local demonstration review · results vary</small></article>'
for title, copy in (
("Comforting hydration", "A rich texture that spreads easily and leaves dry areas feeling soft without a sticky finish."),
("Gentle in my routine", "This fit neatly after cleansing and before my evening treatment, even when my skin felt sensitive."),
("An everyday staple", "The finish feels balanced through the day and layers well with the rest of a simple routine."),
)
)
faq = "".join(
f'<details><summary>{_e(question)}</summary><p>{_e(answer)}</p></details>'
for question, answer in (
(f"What makes the {name} special?", "It is designed to fit a straightforward routine and pairs with personalized prescription care when appropriate."),
("How do I choose between moisturizer textures?", "Choose the richer cream for dry-feeling skin and the lighter gel texture when you prefer weightless hydration."),
("Is it designed to be non-clogging?", "The daily essentials are designed with acne-prone skin in mind, but individual reactions can vary."),
("How can I personalize my routine?", "Complete the local skin questionnaire to compare formula and routine options based on synthetic answers."),
("Are online and store products the same?", "This offline catalog models product information only and does not represent live retail availability."),
)
)
recommendation_slugs = [item for item in ("custom-formula-acne", "gel-moisturizer", "gentle-cleanser") if item != slug][:2]
recommendations = "".join(
f'<article class="recommend-card"><a href="{_product_path(item)}"><div class="product-art {PRODUCT_BY_SLUG[item][4]}"><div class="tube {PRODUCT_BY_SLUG[item][4]}"></div></div><h3>{_e(PRODUCT_BY_SLUG[item][1])}</h3><p>{_e(PRODUCT_BY_SLUG[item][2])}</p><strong>{_e(PRODUCT_BY_SLUG[item][3])}</strong></a></article>'
for item in recommendation_slugs
)
return layout(
name,
f"""
<nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span>•</span><a href="/shop?category={'prescription' if prescription else 'non-rx'}">{'Rx products' if prescription else 'Non-Rx products'}</a><span>•</span><span>{_e(name)}</span></nav>
<section class="product-detail"><div class="product-gallery"><div class="formula-stage {_e(color)}">{badge}{main_art}</div><div class="thumbnail-row">{gallery}</div></div>
<div class="detail-copy"><p class="eyebrow">{_e('Prescription skincare' if prescription else 'Routine essential')}</p><h1>{_e(name)}</h1><h2>{_e(description)}</h2><a class="product-rating" href="#reviews">{_stars(meta)} <span>({_e(meta['reviews'])} reviews)</span></a><p>{_e('A personalized treatment option designed around the goals you select in the consultation.' if prescription else 'Powered by thoughtfully selected ingredients to support your skin barrier and fit a simple daily routine.')}</p><p><i>{_e('Subject to consultation' if prescription else 'Dermatologist-designed daily care')}</i></p><div class="product-accordions"><details><summary>Ingredients</summary><p>{_e(meta['ingredients'])}</p></details><details><summary>How to use</summary><p>{_e(meta['use'])}</p></details></div><div class="price-row"><div><h3>One-time purchase</h3><small>{_e(meta['size'])}</small></div><strong>{_e(price)}</strong></div>{purchase}<div class="tags" aria-label="Designed for">{targets}</div></div></section>
<section class="section product-reviews" id="reviews"><div class="section-heading"><div><p class="eyebrow">Real routine feedback</p><h2>Customer reviews</h2></div><div class="review-score"><b>{_e(meta['rating'])}/5</b>{_five_stars()}<span>{_e(meta['reviews'])} reviews</span></div></div><div class="review-cards">{review_cards}</div><a class="text-link" href="/reviews">Read more Curology stories →</a></section>
<section class="section product-faq"><p class="eyebrow">Good to know</p><h2>Frequently asked questions</h2><div class="faq-list">{faq}</div></section>
<section class="section recommendations"><div class="section-heading"><div><p class="eyebrow">Pair it thoughtfully</p><h2>Complete your routine</h2></div><a href="/shop">Shop all products →</a></div><div class="recommend-grid">{recommendations}</div></section>
<section class="personalization-band"><div><p class="eyebrow">Prescription-powered personalization</p><h2>Care designed around your goals</h2><p>Target acne, dark spots, texture, and early signs of aging with a local plan that reflects your questionnaire answers.</p><a class="button" href="/sign-up/start/face">Start skin quiz</a></div><div class="personalization-stats"><span><b>5M+</b> served</span><span><b>9K+</b> 5-star reviews</span><span><b>93%</b> report effective*</span></div></section>
""",
account=account,
offer_copy="FREE shipping on orders $30+",
)
def formula(account: dict[str, Any] | None) -> str:
return product_detail(account, "custom-formula-acne")
def quiz_welcome(account: dict[str, Any] | None) -> str:
return layout(
"Get your personalized skincare",
"""
<section class="quiz-shell welcome"><h1>Get your personalized<br>skincare in 3 minutes<br>or less</h1><div class="welcome-art" role="img" aria-label="An adult applying skincare in an original local editorial photograph"><div class="ingredient-dots"><i></i><i></i><i></i></div><b>Formulated<br>for you</b></div><div class="carousel-dots" aria-label="Slide 1 of 3">● ○ ○</div><h2>Made-for-you,<br>Rx skincare</h2><p>Get your complete routine—personalized and simplified.</p><a class="button full" href="/quiz/questionnaire/skin-type">Get started →</a><p class="fineprint">Local questionnaire simulation. Do not enter real medical information. Subject to medical consultation on the source service.</p></section>
""",
account=account,
compact=True,
)
QUESTION_COPY = {
"skin-type": (
"How would you describe your skin?",
"Choose the answer that feels closest today.",
"skin_type",
[("dry", "Dry"), ("balanced", "Balanced"), ("combination", "Combination"), ("oily", "Oily"), ("not-sure", "Not sure")],
"/quiz/questionnaire/acne",
"/sign-up/start/face",
"1 of 3",
),
"acne": (
"How often does acne concern you?",
"A general, synthetic answer is enough for this local demo.",
"acne_concern",
[("none", "Not a concern"), ("occasional", "Occasionally"), ("mild", "Mild"), ("moderate", "Moderate"), ("severe", "Severe")],
"/quiz/questionnaire/aging",
"/quiz/questionnaire/skin-type",
"2 of 3",
),
"aging": (
"What would you most like to improve?",
"Choose one aging or texture concern.",
"aging_concern",
[("none", "No aging concern"), ("fine-lines", "Fine lines"), ("texture", "Texture"), ("dark-spots", "Dark spots"), ("firmness", "Firmness")],
"/plans",
"/quiz/questionnaire/acne",
"3 of 3",
),
}
def questionnaire(
account: dict[str, Any] | None, state: dict[str, Any], step: str
) -> str:
heading, subcopy, field, options, next_url, back_url, progress = QUESTION_COPY[step]
selected = state.get(field)
choices = "".join(
f"""<label class="choice"><input type="radio" name="value" value="{_e(value)}" {'checked' if value == selected else ''} required><span>{_e(label)}</span></label>"""
for value, label in options
)
body = f"""<section class="quiz-shell question"><div class="progress"><span style="width:{33 if step == 'skin-type' else 66 if step == 'acne' else 100}%"></span></div><p class="eyebrow">Question {progress}</p><h1>{_e(heading)}</h1><p>{_e(subcopy)}</p><form data-api="/api/questionnaire/{_e(step)}" data-redirect="{_e(next_url)}"><input type="hidden" name="idempotency_key" data-idempotency><div class="choice-grid">{choices}</div><p class="form-error" data-error></p><div class="form-nav"><a href="{_e(back_url)}">← Back</a><button class="button" type="submit">Continue</button></div></form><p class="saved-note">Answers are saved to this local browser session and survive refresh.</p></section>"""
return layout("Skin consultation", body, account=account, compact=True)
def plans(account: dict[str, Any] | None, state: dict[str, Any]) -> str:
if not state["questionnaire_complete"]:
body = '<section class="empty-state"><h1>Finish your skin questions</h1><p>Skin type, acne, and aging concerns are required before plan selection.</p><a class="button" href="/quiz/questionnaire/skin-type">Continue questionnaire</a></section>'
return layout("Personalized plans", body, account=account, compact=True)
def checked(name: str, value: Any) -> str:
return "checked" if state.get(name) == value else ""
body = f"""<section class="flow-shell"><p class="eyebrow">Your local personalized plan</p><h1>Choose the routine that fits</h1><div class="answer-summary"><span>Skin: <b>{_e(state['skin_type'])}</b></span><span>Acne: <b>{_e(state['acne_concern'])}</b></span><span>Aging: <b>{_e(state['aging_concern'])}</b></span></div>
<form data-api="/api/plan" data-redirect="/checkout/shipping"><fieldset><legend>Plan tier</legend><div class="tier-grid"><label class="tier"><input type="radio" name="plan_tier" value="custom" {checked('plan_tier','custom')} required><b>Custom Formula</b><span>$34.95 / shipment</span></label><label class="tier"><input type="radio" name="plan_tier" value="essentials" {checked('plan_tier','essentials')} required><b>Essentials</b><span>$59.90 / shipment</span></label><label class="tier"><input type="radio" name="plan_tier" value="complete" {checked('plan_tier','complete')} required><b>Complete routine</b><span>$74.90 / shipment</span></label></div></fieldset>
<div class="split-fields"><label>Quantity<select name="quantity"><option value="1" {_selected(state.get('quantity'),1)}>1 routine</option><option value="2" {_selected(state.get('quantity'),2)}>2 routines</option><option value="3" {_selected(state.get('quantity'),3)}>3 routines</option><option value="4" {_selected(state.get('quantity'),4)}>4 routines</option></select></label><label>Delivery frequency<select name="frequency"><option value="30-days" {_selected(state.get('frequency'),'30-days')}>Every 30 days</option><option value="60-days" {_selected(state.get('frequency'),'60-days')}>Every 60 days</option><option value="90-days" {_selected(state.get('frequency'),'90-days')}>Every 90 days</option></select></label></div><label>Product option<select name="product_option"><option value="custom-formula" {_selected(state.get('product_option'),'custom-formula')}>Custom formula only</option><option value="formula-cleanser" {_selected(state.get('product_option'),'formula-cleanser')}>Formula + cleanser</option><option value="complete-routine" {_selected(state.get('product_option'),'complete-routine')}>Complete routine</option></select></label><input type="hidden" name="idempotency_key" data-idempotency><p class="form-error" data-error></p><div class="form-nav"><a href="/quiz/questionnaire/aging">← Back</a><button class="button" type="submit">Continue to shipping</button></div></form></section>"""
return layout("Choose your plan", body, account=account, compact=True)
def shipping(account: dict[str, Any] | None, state: dict[str, Any]) -> str:
body = f"""<section class="flow-shell narrow"><p class="eyebrow">Checkout · 1 of 3</p><h1>Where should your routine go?</h1><p>Use synthetic details only. Nothing leaves this local clone.</p><form data-api="/api/shipping" data-redirect="/checkout/payment"><label>Full name<input name="name" autocomplete="name" value="{_e(state.get('shipping_name'))}" required></label><label>Street address<input name="address" autocomplete="street-address" value="{_e(state.get('shipping_address'))}" required></label><div class="split-fields"><label>City<input name="city" value="{_e(state.get('shipping_city'))}" required></label><label>State / region<input name="region" value="{_e(state.get('shipping_region'))}" required></label></div><div class="split-fields"><label>Postal code<input name="postal" value="{_e(state.get('shipping_postal'))}" required></label><label>Contact email<input name="email" type="email" value="{_e(state.get('shipping_email'))}" required></label></div><input type="hidden" name="idempotency_key" data-idempotency><p class="form-error" data-error></p><div class="form-nav"><a href="/plans">← Back</a><button class="button" type="submit">Continue to payment</button></div></form></section>"""
return layout("Shipping details", body, account=account, compact=True)
def payment(account: dict[str, Any] | None, state: dict[str, Any]) -> str:
if not state["shipping_complete"]:
return layout("Payment", '<section class="empty-state"><h1>Shipping details are required</h1><a class="button" href="/checkout/shipping">Add shipping</a></section>', account=account, compact=True)
bundles = {
"custom-formula": (
("Custom Formula", "rx"),
),
"formula-cleanser": (
("Deep Cleanse", "rx"),
("Custom Formula", "rx"),
),
"complete-routine": (
("Deep Cleanse", "rx"),
("Custom Formula", "rx"),
("Body Cleanse", "rx"),
("Cream Moisturizer", "cream"),
),
}
selected_bundle = bundles.get(
str(state.get("product_option")), bundles["custom-formula"]
)
product_rows = "".join(
f"""<li><span class="checkout-product-art {kind}" aria-hidden="true"></span><span><b>{_e(name)}{'<sup>Rx</sup>' if kind == 'rx' else ''}</b><small>30-day local trial supply</small></span><strong>FREE</strong></li>"""
for name, kind in selected_bundle
)
quantity = int(state.get("quantity") or 1)
item_count = len(selected_bundle) * quantity
cadence = {
"30-days": "30 days",
"60-days": "60 days",
"90-days": "90 days",
}.get(str(state.get("frequency")), "60 days")
recurring = {
"custom": 34.95,
"essentials": 59.90,
"complete": 74.90,
}.get(str(state.get("plan_tier")), 34.95) * quantity
body = f"""<div class="checkout-page"><section class="flow-shell checkout-shell"><p class="eyebrow">Checkout · 2 of 3</p><h1>Checkout</h1>
<section class="checkout-card order-total" aria-labelledby="order-total-heading"><header><span class="step-badge">1</span><h2 id="order-total-heading">Order Total</h2><strong>$5.45</strong></header><p>{item_count} item{'s' if item_count != 1 else ''}</p><ul>{product_rows}</ul><div class="checkout-total-row"><span>Shipping &amp; handling</span><b>$5.45</b></div><div class="checkout-total-row"><span>Estimated taxes</span><b>$0.00</b></div><div class="checkout-grand-total"><span>Order total</span><strong>$5.45</strong></div></section>
<section class="checkout-card payment-method" aria-labelledby="payment-method-heading"><h2 id="payment-method-heading">Payment method</h2><div class="payment-tab"><span>▣</span><b>Local card simulation</b><span class="selected-dot">✓</span></div><div class="safety-box"><b>No real card fields</b><p>Choose a local outcome below. Only an opaque scenario and sandbox fingerprint are stored; this page cannot charge a card.</p></div><form data-api="/api/payment" data-success-redirect="/checkout/review"><fieldset><legend>Choose a safe outcome</legend><label class="choice"><input type="radio" name="scenario_id" value="sandbox-approved" checked><span>Simulated approval</span></label><label class="choice"><input type="radio" name="scenario_id" value="sandbox-declined"><span>Simulated decline</span></label><label class="choice"><input type="radio" name="scenario_id" value="sandbox-retry"><span>Simulated retry</span></label></fieldset><input type="hidden" name="fingerprint" value="927b6ebdd4f6d08bf8301055370ff76a4425ed91a4e7bbfcb0f901938804dd71"><input type="hidden" name="idempotency_key" data-idempotency><p class="form-error" data-error></p><button class="button full" type="submit">Save local payment simulation</button></form><div class="payment-alternative"><b>PayPal</b><span>Unavailable offline</span></div></section>
<a class="checkout-card shipping-summary" href="/checkout/shipping"><h2>Shipping</h2><span>Edit synthetic address →</span></a><p class="checkout-renewal">After the 30-day local trial, the selected routine is modeled at <b>${recurring:.2f} every {cadence}</b>. Cancel anytime in the local account. No source subscription or charge is created.</p><div class="form-nav"><a href="/checkout/shipping">← Back to shipping</a></div></section></div>"""
return layout("Checkout", body, account=account, compact=True)
def review(account: dict[str, Any] | None, state: dict[str, Any]) -> str:
approved = state.get("payment_status") == "APPROVED"
account_prompt = "" if account else '<div class="safety-box"><b>Account required for activation</b><p>Your review is saved. <a href="/auth/login?next=/checkout/review">Log in</a> or <a href="/auth/register?next=/checkout/review">create a local account</a>.</p></div>'
activation = (
'<form data-api="/api/activate" data-redirect="/account"><input type="hidden" name="idempotency_key" data-idempotency><p class="form-error" data-error></p><button class="button full" type="submit">Activate local subscription</button></form>'
if approved and account
else '<a class="button full" href="/checkout/payment">Choose simulated approval</a>'
if not approved
else ""
)
body = f"""<section class="flow-shell review"><p class="eyebrow">Checkout · 3 of 3</p><h1>Review your routine</h1><div class="review-grid"><article><h2>Your skin profile</h2><dl><dt>Skin type</dt><dd>{_e(state.get('skin_type'))}</dd><dt>Acne concern</dt><dd>{_e(state.get('acne_concern'))}</dd><dt>Aging concern</dt><dd>{_e(state.get('aging_concern'))}</dd></dl><a href="/quiz/questionnaire/skin-type">Edit answers</a></article><article><h2>Plan</h2><dl><dt>Tier</dt><dd>{_e(state.get('plan_tier'))}</dd><dt>Quantity</dt><dd>{_e(state.get('quantity'))}</dd><dt>Delivery</dt><dd>{_e(state.get('frequency'))}</dd><dt>Product</dt><dd>{_e(state.get('product_option'))}</dd></dl><a href="/plans">Edit plan</a></article><article><h2>Shipping</h2><p>{_e(state.get('shipping_name'))}<br>{_e(state.get('shipping_address'))}<br>{_e(state.get('shipping_city'))}, {_e(state.get('shipping_region'))} {_e(state.get('shipping_postal'))}</p><a href="/checkout/shipping">Edit shipping</a></article><article><h2>Payment</h2><p class="status {_e(str(state.get('payment_status','')).lower())}">{_e(state.get('payment_status') or 'Not ready')}</p><p>Local sandbox · no real card</p><a href="/checkout/payment">Change outcome</a></article></div>{account_prompt}{activation}<p class="fineprint">Activation writes only a local order and subscription. The source service is never contacted.</p></section>"""
return layout("Review subscription", body, account=account, compact=True)
def login(account: dict[str, Any] | None, email: str = "", next_url: str = "/account") -> str:
if account:
return layout("Already signed in", '<section class="empty-state"><h1>You’re signed in</h1><a class="button" href="/account">Open your account</a></section>', account=account, compact=True)
if not email:
form = f"""<form action="/auth/login" method="get"><label>Email<input name="email" type="email" placeholder="Email address" required></label><input type="hidden" name="next" value="{_e(next_url)}"><button class="button full" type="submit">Log in with email</button></form>"""
else:
form = f"""<form data-api="/api/auth/login" data-redirect="{_e(next_url)}"><label>Email<input name="email" type="email" value="{_e(email)}" readonly></label><label>Password<input name="password" type="password" autocomplete="current-password" required></label><p class="demo-hint"><b>Local demo:</b> demo@curology.local / WebsiteBench!785</p><p class="form-error" data-error></p><button class="button full" type="submit">Log in</button></form><a class="text-link" href="/auth/login">Use a different email</a>"""
body = f"""<section class="auth-shell"><h1>Log in</h1>{form}<div class="or"><span>Or sign in with</span></div><button class="identity" type="button" disabled>Continue with Google · unavailable offline</button><button class="identity" type="button" disabled>Continue with Apple · unavailable offline</button><button class="identity" type="button" disabled>Continue with Facebook · unavailable offline</button><p><a href="/auth/recover">Forgot your password?</a></p><p>Don’t have an account?</p><a class="button secondary full" href="/auth/register">Get Started</a></section>"""
return layout("Log in", body, compact=True)
def register(account: dict[str, Any] | None, next_url: str = "/account") -> str:
body = f"""<section class="auth-shell wide"><p class="eyebrow">Local account</p><h1>Let’s get started</h1><p>Create a local-only profile. A verification code is placed in this browser’s local outbox; no email is sent.</p><form data-api="/api/auth/register/start" data-reveal="registration-verify"><label>Full name<input name="display_name" autocomplete="name" required></label><label>Email address<input name="email" type="email" autocomplete="email" required></label><label>Password<input name="password" type="password" minlength="8" maxlength="128" autocomplete="new-password" required></label><label class="check"><input name="terms" type="checkbox" value="accepted" required><span>I agree to the <a href="/terms">Terms of Service</a> and acknowledge the <a href="/privacy">Privacy Notice</a>.</span></label><p class="form-error" data-error></p><button class="button full" type="submit">Create local account</button></form><section id="registration-verify" class="verify-panel" hidden><h2>Enter the local verification code</h2><p id="local-code" class="local-code"></p><form data-api="/api/auth/register/verify" data-redirect="{_e(next_url)}"><label>Six-digit code<input name="code" inputmode="numeric" pattern="[0-9]{{6}}" maxlength="6" autocomplete="one-time-code" required></label><p class="form-error" data-error></p><button class="button full" type="submit">Verify and continue</button></form></section><p>Already have an account? <a href="/auth/login?next={_e(next_url)}">Log in</a></p></section>"""
return layout("Create account", body, account=account, compact=True)
def recovery(account: dict[str, Any] | None) -> str:
body = """<section class="auth-shell wide"><h1>Reset your password</h1><p>Enter the email for your local Curology account. The public response is the same whether or not it exists.</p><form data-api="/api/auth/recovery/start" data-reveal="recovery-verify"><label>Email address<input name="email" type="email" placeholder="Email address" required></label><p class="form-error" data-error></p><button class="button full" type="submit">Save reset request locally</button></form><section id="recovery-verify" class="verify-panel" hidden><p id="local-code" class="local-code"></p><form data-api="/api/auth/recovery/complete" data-redirect="/account"><label>Six-digit code<input name="code" inputmode="numeric" pattern="[0-9]{6}" required></label><label>New password<input name="new_password" type="password" minlength="8" required></label><p class="form-error" data-error></p><button class="button full" type="submit">Set new password</button></form></section><a class="text-link" href="/auth/login">← Return to sign in</a></section>"""
return layout("Password recovery", body, account=account, compact=True)
def account_dashboard(
account: dict[str, Any], data: dict[str, Any], state: dict[str, Any]
) -> str:
subscription = data["subscription"]
if subscription:
card = f"""<article class="subscription-card"><div><p class="eyebrow">Current subscription</p><h2>{_e(subscription['plan_tier']).title()} routine</h2><p class="status {_e(subscription['status'])}">{_e(subscription['status']).title()}</p></div><dl><dt>Quantity</dt><dd>{_e(subscription['quantity'])}</dd><dt>Delivery</dt><dd>{_e(subscription['frequency'])}</dd><dt>Next delivery</dt><dd>{_e(subscription['next_delivery'])}</dd></dl><a class="button" href="/account/subscription">Manage subscription</a></article>"""
else:
card = '<article class="subscription-card"><h2>No subscription yet</h2><p>Complete the skin questionnaire to build a routine.</p><a class="button" href="/sign-up/start/face">Find your formula</a></article>'
latest = data["orders"][0] if data["orders"] else None
latest_html = f"""<article class="history-card"><p class="eyebrow">Newest item</p><h2>{_e(latest['order_id'])}</h2><p class="status {_e(latest['status'])}">{_e(latest['status']).title()}</p><p>{_e(latest['delivery_date'])} · ${int(latest['amount_minor'])/100:.2f}</p><a href="/account/orders/{quote(str(latest['order_id']), safe='')}">View order details</a></article>""" if latest else '<article class="history-card"><h2>No order history</h2><a href="/shop">Browse skincare</a></article>'
address_summary = (
f"<p>{_e(state.get('shipping_address'))}<br>"
f"{_e(state.get('shipping_city'))}, {_e(state.get('shipping_region'))} "
f"{_e(state.get('shipping_postal'))}</p>"
if state.get("shipping_complete")
else "<p>Add a synthetic address for local delivery management.</p>"
)
address_card = (
'<article class="subscription-card"><div><p class="eyebrow">Shipping</p>'
f"<h2>Shipping &amp; contact address</h2>{address_summary}</div>"
'<a class="button secondary" href="/account/address">Manage address</a></article>'
)
body = f"""<section class="account-shell"><div class="account-heading"><div><p>Welcome back</p><h1>{_e(account['display_name'])}</h1></div><form data-api="/api/auth/logout" data-redirect="/"><button class="link-button" type="submit">Log out</button></form></div><div class="account-grid">{card}{latest_html}{address_card}</div><nav class="account-nav"><a href="/account/subscription">Subscription &amp; delivery</a><a href="/account/address">Shipping &amp; contact address</a><a href="/account/orders">Past &amp; upcoming orders</a><a href="/help">Help center</a></nav></section>"""
return layout("My Curology", body, account=account)
def account_address(account: dict[str, Any], state: dict[str, Any]) -> str:
body = f"""<section class="account-shell narrow"><a href="/account">← Account</a><p class="eyebrow">Subscription settings</p><h1>Shipping &amp; contact address</h1><p>Use synthetic details only. This address stays in the site-isolated local database.</p><form data-api="/api/shipping" data-redirect="/account/address"><label>Full name<input name="name" autocomplete="name" value="{_e(state.get('shipping_name'))}" required></label><label>Street address<input name="address" autocomplete="street-address" value="{_e(state.get('shipping_address'))}" required></label><div class="split-fields"><label>City<input name="city" value="{_e(state.get('shipping_city'))}" required></label><label>State / region<input name="region" value="{_e(state.get('shipping_region'))}" required></label></div><div class="split-fields"><label>Postal code<input name="postal" value="{_e(state.get('shipping_postal'))}" required></label><label>Contact email<input name="email" type="email" value="{_e(state.get('shipping_email'))}" required></label></div><input type="hidden" name="idempotency_key" data-idempotency><p class="form-error" data-error></p><button class="button" type="submit">Save address</button></form></section>"""
return layout("Shipping & contact address", body, account=account)
def subscription(account: dict[str, Any], data: dict[str, Any]) -> str:
item = data["subscription"]
if not item:
return layout("Subscription", '<section class="empty-state"><h1>No subscription yet</h1><a class="button" href="/sign-up/start/face">Start consultation</a></section>', account=account)
action_button = (
'<form data-api="/api/subscription/reactivate" data-reload><input type="hidden" name="idempotency_key" data-idempotency><button class="button" type="submit">Reactivate subscription</button><p class="form-error" data-error></p></form>'
if item["status"] == "canceled"
else '<form data-api="/api/subscription/pause" data-reload><input type="hidden" name="idempotency_key" data-idempotency><button class="button secondary" type="submit">Pause subscription</button><p class="form-error" data-error></p></form>'
if item["status"] == "active"
else ""
)
body = f"""<section class="account-shell"><a href="/account">← Account</a><p class="eyebrow">Subscription settings</p><h1>Manage your routine</h1><p class="status {_e(item['status'])}">{_e(item['status']).title()}</p><div class="management-grid"><form data-api="/api/subscription/modify" data-reload><h2>Change routine</h2><label>Plan<select name="plan_tier"><option value="custom" {_selected(item['plan_tier'],'custom')}>Custom Formula</option><option value="essentials" {_selected(item['plan_tier'],'essentials')}>Essentials</option><option value="complete" {_selected(item['plan_tier'],'complete')}>Complete routine</option></select></label><label>Quantity<select name="quantity"><option value="1" {_selected(item['quantity'],1)}>1</option><option value="2" {_selected(item['quantity'],2)}>2</option><option value="3" {_selected(item['quantity'],3)}>3</option><option value="4" {_selected(item['quantity'],4)}>4</option></select></label><label>Cadence<select name="frequency"><option value="30-days" {_selected(item['frequency'],'30-days')}>Every 30 days</option><option value="60-days" {_selected(item['frequency'],'60-days')}>Every 60 days</option><option value="90-days" {_selected(item['frequency'],'90-days')}>Every 90 days</option></select></label><label>Products<select name="product_option"><option value="custom-formula" {_selected(item['product_option'],'custom-formula')}>Custom formula</option><option value="formula-cleanser" {_selected(item['product_option'],'formula-cleanser')}>Formula + cleanser</option><option value="complete-routine" {_selected(item['product_option'],'complete-routine')}>Complete routine</option></select></label><input type="hidden" name="idempotency_key" data-idempotency><button class="button" type="submit">Save changes</button><p class="form-error" data-error></p></form><article><h2>Next delivery</h2><p><b>{_e(item['next_delivery'])}</b></p><form data-api="/api/subscription/reschedule" data-reload><label>New date<input type="date" name="delivery_date" value="{_e(item['next_delivery'])}" required></label><input type="hidden" name="idempotency_key" data-idempotency><button class="button secondary" type="submit">Reschedule</button><p class="form-error" data-error></p></form><form data-api="/api/subscription/skip" data-reload><input type="hidden" name="idempotency_key" data-idempotency><button class="button secondary" type="submit">Skip this delivery</button><p class="form-error" data-error></p></form></article></div><div class="danger-zone">{action_button}<form data-api="/api/subscription/cancel" data-reload><input type="hidden" name="idempotency_key" data-idempotency><button class="danger" type="submit" {'disabled' if item['status']=='canceled' else ''}>Cancel subscription</button><p class="form-error" data-error></p></form></div></section>"""
return layout("Manage subscription", body, account=account)
def orders(account: dict[str, Any], data: dict[str, Any]) -> str:
def order_action(item: dict[str, Any]) -> str:
order_id = quote(str(item["order_id"]), safe="")
if item["kind"] == "upcoming" and item["status"] in {"scheduled", "paused"}:
return (
f'<a href="/account/subscription?order_id={order_id}">Manage delivery</a>'
)
return f'<a href="/account/orders/{order_id}">View order details</a>'
items = "".join(
f"""<article class="order-row"><div><p class="eyebrow">{_e(item['kind'])} order</p><h2>{_e(item['order_id'])}</h2></div><p class="status {_e(item['status'])}">{_e(item['status']).title()}</p><p>{_e(item['delivery_date'])}</p><p>${int(item['amount_minor'])/100:.2f}</p><p>{_e(item.get('tracking_label'))}</p>{order_action(item)}</article>"""
for item in data["orders"]
) or '<div class="empty-state"><h2>No orders yet</h2><a href="/shop">Browse skincare</a></div>'
body = f"""<section class="account-shell"><a href="/account">← Account</a><p class="eyebrow">Billing and delivery history</p><h1>Past &amp; upcoming orders</h1><div class="orders">{items}</div><a class="text-link" href="/shop">Back to skincare products</a></section>"""
return layout("Order history", body, account=account)
def order_detail(account: dict[str, Any], item: dict[str, Any]) -> str:
can_manage = item["kind"] == "upcoming" and item["status"] in {
"scheduled",
"paused",
}
action = (
'<a class="button" href="/account/subscription">Manage this delivery</a>'
if can_manage
else '<p>This historical order is read-only.</p>'
)
body = f"""<section class="account-shell narrow"><a href="/account/orders">← Past &amp; upcoming orders</a><p class="eyebrow">{_e(item['kind'])} order</p><h1>Order details</h1><article class="subscription-card"><div><h2>{_e(item['order_id'])}</h2><p class="status {_e(item['status'])}">{_e(item['status']).title()}</p></div><dl><dt>Delivery date</dt><dd>{_e(item['delivery_date'])}</dd><dt>Amount</dt><dd>${int(item['amount_minor'])/100:.2f}</dd><dt>Shipment update</dt><dd>{_e(item.get('tracking_label'))}</dd></dl>{action}</article></section>"""
return layout("Order details", body, account=account)
def help_page(account: dict[str, Any] | None) -> str:
body = """<section class="help-hero"><a href="/">Back to Home Page</a><h1>How can we help?</h1><p>Everything you need to know about Curology</p><form class="search" action="/help" method="get"><label for="help-search">Search help articles</label><div><input id="help-search" name="q" placeholder="Search help articles"><button>Search</button></div></form></section><section class="section help-categories"><h2>Browse by Category</h2><p>Explore the local knowledge base.</p><div class="category-grid"><article><h3>The Basics</h3><p>Questionnaire, plans, and local simulations.</p></article><article><h3>Curology products</h3><p>Custom Formula and routine essentials.</p></article><article><h3>Account access</h3><p>Sign in, registration, and password recovery.</p></article><article><h3>Billing &amp; shipping</h3><p>Payment outcomes and delivery management.</p></article><article><h3>Failed actions</h3><p>Required fields, retry, and safe recovery.</p></article><article><h3>Terms &amp; privacy</h3><p>How this offline clone handles local data.</p></article></div><div class="contact-cta"><h2>Still have questions?</h2><a class="button" href="/contact">Contact Us</a></div><div class="contact-cta" id="access"><h2>Curology Access Program</h2><p>Find local support information for eligible visitors. This offline clone does not submit an enrollment request.</p><a class="text-link" href="/contact">Ask about access →</a></div></section>"""
return layout("Help center", body, account=account)
ARTICLES = [
("skin-concerns", "What is acne anyway?", "Think you’re breaking out? Start with this one-stop acne guide.", "11 min read", "acne"),
("skin-concerns", "What are blackheads?", "Understand why pores clog and how skin experts approach prevention.", "8 min read", "blackheads"),
("skin-treatments", "How to build a consistent evening routine", "Put cleansing, treatment, and hydration in a practical order.", "6 min read", "routine"),
("skincare-products", "Choosing a moisturizer for your skin type", "Compare gel and cream textures without the guesswork.", "7 min read", "moisturizer"),
("ingredients", "Prescription ingredients explained", "A plain-language guide to tretinoin, azelaic acid, and niacinamide.", "5 min read", "ingredients"),
("ingredients", "Hyaluronic acid and your skin barrier", "Learn how humectants support comfortable daily hydration.", "6 min read", "hydration"),
("curology", "The science behind a personalized skin quiz", "See why the questions connect skin goals to routine choices.", "5 min read", "quiz"),
("mind-body", "Skin confidence without perfection", "Practical ways to track progress while remembering that results vary.", "4 min read", "confidence"),
("video", "Three steps for a calmer morning routine", "A short visual guide to cleanse, treat, and protect.", "3 min watch", "video"),
]
def skincare_101(
account: dict[str, Any] | None, topic: str = "", query: str = ""
) -> str:
topics = {item[0] for item in ARTICLES}
topic = topic if topic in topics else ""
normalized = query.strip().casefold()
articles = [
item for item in ARTICLES
if (not topic or item[0] == topic)
and (not normalized or normalized in " ".join(item).casefold())
]
chips = "".join(
f'<a class="topic-chip {"active" if value == topic else ""}" href="/skincare-101{f"?topic={value}" if value else ""}">{_e(label)}</a>'
for value, label in (
("", "All"), ("skin-concerns", "Skin concerns"),
("skin-treatments", "Skin treatments"), ("skincare-products", "Skincare products"),
("ingredients", "Ingredients"), ("curology", "Curology"),
("mind-body", "Mind & body"), ("video", "Video"),
)
)
cards = "".join(
f'<article class="article-card"><div class="article-art {_e(art)}" aria-hidden="true"><span>{_e(category.replace("-", " "))}</span></div><div><p class="eyebrow">{_e(category.replace("-", " "))}</p><h2>{_e(title)}</h2><p>{_e(summary)}</p><small>{_e(duration)}</small><a href="/skincare-101/articles/{_e(art)}">Read article →</a></div></article>'
for category, title, summary, duration, art in articles
) or '<section class="empty-state article-empty"><h2>No stories match those filters</h2><a class="button" href="/skincare-101">View all stories</a></section>'
body = f"""<section class="editorial-hero"><div><p class="eyebrow">Expert-backed guides</p><h1>Skincare 101</h1><p>Clear, practical information about skin concerns, ingredients, treatments, and daily products.</p></div><div class="editorial-orbit" aria-hidden="true"><span>skin</span><span>science</span><span>routine</span></div></section><section class="article-hub"><form class="article-search" action="/skincare-101" method="get"><label>Search stories<input name="q" value="{_e(query)}" placeholder="Search skincare topics"></label><button type="submit">Search</button></form><nav class="topic-chips" aria-label="Article topics">{chips}</nav><div class="article-heading"><h2>Latest from Curology</h2><span>{len(articles)} stories</span></div><div class="article-grid">{cards}</div><p class="medical-note">Educational content only. Talk to a medical provider about individual health concerns.</p></section>"""
return layout("Skincare 101", body, account=account)
def skincare_article(account: dict[str, Any] | None, slug: str) -> str:
match = next((item for item in ARTICLES if item[4] == slug), None)
if match is None:
return not_found(account, f"/skincare-101/articles/{slug}")
category, title, summary, duration, art = match
body = f"""<article class="story-page"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span>•</span><a href="/skincare-101">Skincare 101</a><span>•</span><span>{_e(title)}</span></nav><div class="story-heading"><p class="eyebrow">{_e(category.replace('-', ' '))}</p><h1>{_e(title)}</h1><p>{_e(summary)}</p><small>By Curology Team · {_e(duration)}</small></div><div class="article-art story-art {_e(art)}" aria-hidden="true"></div><div class="story-copy"><p class="medical-note">We’re here to share general skincare information, but this is not medical advice.</p><h2>Start with the basics</h2><p>Skin routines work best when each step has a clear job. Begin with gentle cleansing, introduce one treatment at a time, and support the skin barrier with consistent hydration.</p><h2>Track what your skin tells you</h2><p>Give a routine time, note irritation or comfort, and adjust one variable at a time. Personalized prescription care requires review by a licensed provider on the source service; this offline page provides education only.</p><a class="button" href="/sign-up/start/face">Explore the local skin quiz</a></div></article>"""
return layout(title, body, account=account)
def why_curology(account: dict[str, Any] | None) -> str:
comparison_rows = "".join(
f'<div><b>{_e(topic)}</b><span>✓ {_e(curology)}</span><span>— {_e(other)}</span></div>'
for topic, curology, other in (
("Formula", "Ingredients chosen for you", "One-size-fits-all formulas"),
("Ingredients", "Prescription-strength options", "Non-prescription ingredients only"),
("Guidance", "1:1 licensed provider care", "Research products on your own"),
("Plan", "Designed for more effective results", "Results based on trial and error"),
)
)
concern_panels = "".join(
f'<article class="concern-panel {"active" if index == 1 else ""}" data-concern-panel="{_e(key)}"><div class="concern-art {_e(key)}" aria-hidden="true"><b>{index}</b></div><div><p class="eyebrow">Goal {index}</p><h3>{_e(title)}</h3><p>{_e(copy)}</p><div class="tags">{"".join(f"<span>{_e(tag)}</span>" for tag in tags)}</div><a class="button" href="/sign-up/start/face">Get your formula</a></div></article>'
for index, (key, title, copy, tags) in enumerate((
("acne", "Clear acne", "Target breakouts, clogged pores, and visible inflammation with a provider-guided routine.", ("Oiliness", "Hormonal acne", "Clogged pores")),
("spots", "Fade dark spots", "Support a more even-looking tone while addressing the source of post-acne marks.", ("Post-acne marks", "Uneven tone", "Sun support")),
("texture", "Smooth texture", "Combine proven actives and barrier support to improve rough or uneven-looking skin.", ("Texture", "Fine lines", "Dryness")),
("redness", "Calm redness", "Build a gentler routine around visible redness and rosacea-prone skin goals.", ("Redness", "Sensitivity", "Rosacea")),
), start=1)
)
faq = "".join(
f'<details><summary>{_e(question)}</summary><p>{_e(answer)}</p></details>'
for question, answer in (
("What is Curology and how does it work?", "Curology combines an online consultation, licensed-provider review, personalized prescription formulas when appropriate, scheduled shipments, and ongoing support."),
("How is prescription skincare different from over-the-counter products?", "A licensed provider can select prescription-strength ingredients and adjust concentrations to an individual plan instead of relying on one-size-fits-all formulas."),
("Is Curology actual dermatology care, or just an automated quiz?", "On the source service, patient information is assessed by a licensed dermatology provider. This offline clone models the flow but provides no care."),
("Who is Curology best for?", "It may suit people seeking provider-guided options for acne, dark spots, rosacea, texture, or early aging concerns."),
("Can a personalized formula change over time?", "The source service can adjust a formula as skin needs evolve. The local clone models plan changes without medical claims."),
)
)
body = f"""<section class="why-hero"><div><p class="eyebrow">Why Curology</p><h1>Award-winning skincare for real results.</h1><p>Personalized prescriptions. Clinically-proven ingredients. Access to real, licensed dermatology providers. The evidence is in the effect.</p><a class="button" href="/sign-up/start/face">Start your skin consultation</a></div><div class="why-hero-art" aria-hidden="true"><span>made<br>for<br>you</span></div></section><section class="trust-strip"><span><b>✚</b>Dermatologist-developed</span><span><b>3</b>Rx ingredients</span><span><b>5.5M+</b>treated</span><span><b>↗</b>Provider support</span></section><section class="section comparison" id="our-story"><p class="eyebrow">A different kind of routine</p><h2>Made-for-you makes all the difference</h2><div class="comparison-head"><b></b><b>Curology</b><b>Other skincare</b></div><div class="comparison-grid">{comparison_rows}</div><a class="button" href="/sign-up/start/face">Get your formula</a></section><section class="section concern-section"><p class="eyebrow">Multitasking care</p><h2>Treat multiple skin concerns with 1 product</h2><p>Fight breakouts, fade dark spots, and smooth fine lines with one personalized formula.</p><div class="concern-tabs" role="tablist" aria-label="Skin goals">{''.join(f'<button type="button" role="tab" data-concern-tab="{key}" aria-selected="{"true" if index == 1 else "false"}">{index}</button>' for index, key in enumerate(("acne", "spots", "texture", "redness"), start=1))}</div><div class="concern-panels">{concern_panels}</div></section><section class="duo-band"><div><p class="eyebrow">AM to PM</p><h2>Your prescription power duo</h2><p>Two custom Rx formulas work together across morning and evening to target your selected goals.</p><a class="button" href="/shop?category=sets">Compare routines</a></div><div class="duo-products"><span class="tube violet"></span><span class="tube blue"></span></div></section><section class="section expert-guidance"><p class="eyebrow">Care that evolves</p><h2>Expert guidance for your skin</h2><div><article><span>01</span><h3>Personalization</h3><p>We learn about your goals to build a routine around your needs.</p></article><article><span>02</span><h3>Custom prescription formulas</h3><p>A licensed provider reviews information and selects ingredients when appropriate.</p></article><article><span>03</span><h3>Expert care just a message away</h3><p>The source service offers ongoing provider support as skin needs change.</p></article></div><a class="button" href="/sign-up/start/face">Start your skin consultation</a></section><section class="section why-faq"><p class="eyebrow">Learn more</p><h2>Frequently asked questions</h2><div class="faq-list">{faq}</div></section><section class="routine-marquee"><h2>Start a routine as unique as you</h2><div>{''.join(f'<a href="{_product_path(slug)}"><b>{_e(PRODUCT_BY_SLUG[slug][1])}</b><span>{_e(PRODUCT_BY_SLUG[slug][2])}</span></a>' for slug in ("custom-formula-acne", "dayprime-rx", "hydrotret-rx", "body-cleanse-rx"))}</div><a class="button" href="/sign-up/start/face">Get your formula</a></section>"""
return layout("Why Curology", body, account=account)
def reviews_page(account: dict[str, Any] | None) -> str:
stories = (
("acne", "LR", "12 months", "My routine gave me a simpler way to stay consistent, and I felt more confident tracking gradual changes."),
("dark-spots", "VM", "9 months", "The biggest difference was having one clear plan instead of changing products every week."),
("texture", "AK", "6 months", "Hydration and consistency helped my skin feel smoother and made my evening routine easier."),
("acne", "JS", "3 months", "Progress was not instant, but the structured routine made it easier to keep going."),
("redness", "MT", "8 months", "A gentler routine helped me pay attention to comfort instead of chasing quick fixes."),
("dark-spots", "RB", "1 year", "Seeing my progress side by side helped me notice changes that were easy to miss day to day."),
("texture", "CY", "5 months", "The routine felt straightforward and fit into mornings without adding lots of products."),
("acne", "EP", "10 months", "I liked having a plan I could adjust rather than starting over whenever my skin changed."),
)
cards = "".join(
f'<article class="story-card {"review-extra" if index > 5 else ""}" data-review-card="{_e(category)}" {"hidden" if index > 5 else ""}><div class="story-portrait {_e(category)}"><span>Before</span><b>{_e(initials)}</b><span>After</span></div><div><div class="review-stars">{_five_stars()}</div><h3>{_e(duration)} of consistency</h3><p>{_e(copy)}</p><small>Local composite story · results may vary</small></div></article>'
for index, (category, initials, duration, copy) in enumerate(stories)
)
body = f"""<section class="review-policy"><div><p class="eyebrow">Transparency first</p><h1>Our Review Policy</h1><p>Positive feedback is not incentivized. Public review figures are presented with their source labels, and individual results may vary.</p></div><div class="rating-sources"><article><b>4.42</b><span>out of 5 on Reviews.io</span><small>1,142 reviews</small></article><article><b>4.2</b><span>out of 5 on Facebook</span><small>3,441 reviews</small></article><article><b>4.2</b><span>out of 5 on Influenster</span><small>9,103 reviews</small></article></div></section><section class="section community-reviews"><p class="eyebrow">Real routines, individual results</p><h2>Confident skin starts here. Just ask the internet.</h2><p>Results may vary.</p><div class="review-filters" role="group" aria-label="Filter stories"><button class="active" type="button" data-review-filter="all">All stories</button><button type="button" data-review-filter="acne">Acne</button><button type="button" data-review-filter="dark-spots">Dark spots</button><button type="button" data-review-filter="texture">Texture</button><button type="button" data-review-filter="redness">Redness</button></div><div class="story-grid">{cards}</div><button class="button review-more" type="button" data-review-more>View more</button></section><section class="featured-band"><p>Featured in</p><div><span>VOGUE</span><span>refinery29</span><span>Allure</span><span>goop</span><span>Forbes</span></div></section><section class="trial-section"><div><p class="eyebrow">Your routine, your choices</p><h2>Get more with your trial</h2><p>Your trial includes a Custom Formula and daily essentials. Edit the local box to fit your routine and budget.</p><a class="button" href="/sign-up/start/face">Unlock your offer</a><small>30-day trial simulation. Subject to consultation. Cancel anytime.</small></div><div class="trial-products"><a href="/products/custom-formula-acne/"><span class="tube white"></span><b>Custom Formula</b><small>Treatment cream for your skin goals</small></a><a href="/shop/gentle-cleanser"><span class="tube navy"></span><b>Cleanser and moisturizer</b><small>Daily go-tos for clean, soft skin</small></a><a href="/products/body-cleanse-rx/"><span class="tube violet"></span><b>Body CleanseRx</b><small>Lightly foaming wash for breakouts</small></a></div></section>"""
return layout("Curology reviews", body, account=account)
def contact_page(account: dict[str, Any] | None) -> str:
body = """<section class="flow-shell narrow"><p class="eyebrow">Support</p><h1>Contact us</h1><p>This form saves a local request for demonstration. It never sends a text or email.</p><form data-api="/api/contact" data-clear><label>Topic<select name="topic"><option value="Questionnaire help">Questionnaire help</option><option value="Account access">Account access</option><option value="Payment simulation">Failed payment simulation</option><option value="Delivery management">Delivery management</option></select></label><label>How can we help?<textarea name="message" rows="6" minlength="10" required></textarea></label><input type="hidden" name="idempotency_key" data-idempotency><p class="form-error" data-error></p><button class="button" type="submit">Save local request</button></form><a class="text-link" href="/help">← Back to help</a></section>"""
return layout("Contact us", body, account=account)
def simple_page(account: dict[str, Any] | None, title: str, copy: str) -> str:
return layout(title, f'<section class="legal"><h1>{_e(title)}</h1><p>{_e(copy)}</p><p>This WebsiteBench clone runs entirely offline and is not the Curology source service.</p><a href="/">Back to home</a></section>', account=account)
def privacy_page(account: dict[str, Any] | None) -> str:
body = """<section class="legal"><h1>Privacy Notice</h1><p>Questionnaire, account, shipping, payment-scenario, and subscription state stay in the site-isolated local SQLite database.</p><section id="do-not-sell"><h2>Do Not Sell or Share My Personal Information</h2><p>This offline clone does not sell or share personal information, call advertising services, or submit a request to the source website.</p></section><p>This WebsiteBench clone runs entirely offline and is not the Curology source service.</p><a href="/">Back to home</a></section>"""
return layout("Privacy Notice", body, account=account)
def not_found(account: dict[str, Any] | None, path: str) -> str:
body = f"""<section class="not-found"><span class="sad-face" aria-hidden="true">·︵·</span><h1>Sorry! We mixed things up</h1><p>This page doesn’t exist</p><code>{_e(path)}</code><div><a class="button" href="/sign-up/start/face">Find your Rx formula</a><a class="text-link" href="/shop">Return to skincare</a></div></section>"""
return layout("Page not found", body, account=account, status_code=404)