"""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 """ Curology""" def _shop_menu() -> str: return """""" def _skincare_menu() -> str: return """""" def _footer() -> str: return f"""""" def _cart_drawer() -> str: return """""" 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 = ( 'My account' if account else 'Log in' ) if compact: navigation = f"""
{_logo()}
{account_link}···
""" else: navigation = f""" """ offer = ( f'
{_e(offer_copy)}
' if offer_copy else '
Try Curology FREE* for 30 days when you subscribe—just pay $5.45 shipping & handling
' if show_offer else "" ) cookie = """ """ return f""" {_e(title)} · Curology {navigation}{offer}
{content}
{_footer()}{_cart_drawer()} {cookie}
""" def home(account: dict[str, Any] | None) -> str: return layout( "Personalized prescription skincare", """

Skincare that
understands the
assignment

Personalized prescription care that is designed to evolve with your skin and deliver real results.

93% report effective*5M+ patients treated9K+ 5-star reviews
Start in minutes

Personalized prescription formulas

One routine, made around your skin

Explore Custom FormulaRx →

Custom FormulaRx

Target acne, dark spots & more.

DayPrimeRx

Target acne and prime your skin.

HydroTretRx

Target texture and hydrate.

How Curology works

A guided routine in four clear steps

1

Tell us about you

Answer quick questions about your skin and goals.

2

See your plan

Review the local personalized-plan simulation.

3

Start your routine

Choose delivery options and review local payment.

4

Manage anytime

Modify, pause, skip, cancel, or reactivate locally.

Get your formula
""", 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 '" def _stars(meta: dict[str, Any]) -> str: return f'{_five_stars()}{_e(meta["rating"])}/5' 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"""
""" if not products: label = query or CATEGORY_LABELS.get(category) or CONCERN_LABELS.get(concern) or "these filters" body = f"""

Shop skincare

Products for every routine

{search}
⌁

No matches for “{_e(label)}”

Try a broader search or return to all routine essentials.

View all skincareFind your Rx formula
""" else: cards = "".join( f"""
{'Rx' if _is_prescription(slug) else ''}

{_e(name)}

{_stars(PRODUCT_META[slug])}({_e(PRODUCT_META[slug]['reviews'])})

{_e(description)}

{_e(price)}{'Get formula' if _is_prescription(slug) else f''}
""" for slug, name, description, price, color in products ) body = f'

Shop skincare

Shop skincare routine essentials

Prescription-powered personalization and dermatologist-designed daily essentials.

{search}

{len(products)} products

Clear filters
{cards}
' 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 'Rx · HSA/FSA ELIGIBLE' if prescription else 'DERMATOLOGIST DEVELOPED' ) targets = ( 'AcneClogged poresSkin textureDark spots' if prescription else 'CleanseHydrateSupport your routine' ) main_art = ( 'Cream Moisturizer tube on a clean white background' if slug == "cream-moisturizer" else f'
Curology
' ) gallery = ( '' if slug == "cream-moisturizer" else ''.join(f'' for index in range(3)) ) purchase = ( 'Get your formula' if prescription else f'
1
' ) review_cards = "".join( f'
{_five_stars()}

{_e(title)}

{_e(copy)}

Local demonstration review · results vary
' 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'
{_e(question)}

{_e(answer)}

' 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'

{_e(PRODUCT_BY_SLUG[item][1])}

{_e(PRODUCT_BY_SLUG[item][2])}

{_e(PRODUCT_BY_SLUG[item][3])}
' for item in recommendation_slugs ) return layout( name, f"""

{_e('Prescription skincare' if prescription else 'Routine essential')}

{_e(name)}

{_e(description)}

{_stars(meta)} ({_e(meta['reviews'])} reviews)

{_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.')}

{_e('Subject to consultation' if prescription else 'Dermatologist-designed daily care')}

Ingredients

{_e(meta['ingredients'])}

How to use

{_e(meta['use'])}

One-time purchase

{_e(meta['size'])}
{_e(price)}
{purchase}
{targets}

Real routine feedback

Customer reviews

{_e(meta['rating'])}/5{_five_stars()}{_e(meta['reviews'])} reviews
{review_cards}
Read more Curology stories →

Good to know

Frequently asked questions

{faq}

Pair it thoughtfully

Complete your routine

Shop all products →
{recommendations}

Prescription-powered personalization

Care designed around your goals

Target acne, dark spots, texture, and early signs of aging with a local plan that reflects your questionnaire answers.

Start skin quiz
5M+ served9K+ 5-star reviews93% report effective*
""", 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", """

Get your personalized
skincare in 3 minutes
or less

Made-for-you,
Rx skincare

Get your complete routine—personalized and simplified.

Get started →

Local questionnaire simulation. Do not enter real medical information. Subject to medical consultation on the source service.

""", 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"""""" for value, label in options ) body = f"""

Question {progress}

{_e(heading)}

{_e(subcopy)}

{choices}

← Back

Answers are saved to this local browser session and survive refresh.

""" 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 = '

Finish your skin questions

Skin type, acne, and aging concerns are required before plan selection.

Continue questionnaire
' 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"""

Your local personalized plan

Choose the routine that fits

Skin: {_e(state['skin_type'])}Acne: {_e(state['acne_concern'])}Aging: {_e(state['aging_concern'])}
Plan tier

← Back
""" return layout("Choose your plan", body, account=account, compact=True) def shipping(account: dict[str, Any] | None, state: dict[str, Any]) -> str: body = f"""

Checkout · 1 of 3

Where should your routine go?

Use synthetic details only. Nothing leaves this local clone.

← Back
""" 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", '

Shipping details are required

Add shipping
', 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"""
  • {_e(name)}{'Rx' if kind == 'rx' else ''}30-day local trial supplyFREE
  • """ 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"""

    Checkout · 2 of 3

    Checkout

    1

    Order Total

    $5.45

    {item_count} item{'s' if item_count != 1 else ''}

      {product_rows}
    Shipping & handling$5.45
    Estimated taxes$0.00
    Order total$5.45

    Payment method

    ▣Local card simulation✓
    No real card fields

    Choose a local outcome below. Only an opaque scenario and sandbox fingerprint are stored; this page cannot charge a card.

    Choose a safe outcome

    PayPalUnavailable offline

    Shipping

    Edit synthetic address →

    After the 30-day local trial, the selected routine is modeled at ${recurring:.2f} every {cadence}. Cancel anytime in the local account. No source subscription or charge is created.

    """ 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 '
    Account required for activation

    Your review is saved. Log in or create a local account.

    ' activation = ( '

    ' if approved and account else 'Choose simulated approval' if not approved else "" ) body = f"""

    Checkout · 3 of 3

    Review your routine

    Your skin profile

    Skin type
    {_e(state.get('skin_type'))}
    Acne concern
    {_e(state.get('acne_concern'))}
    Aging concern
    {_e(state.get('aging_concern'))}
    Edit answers

    Plan

    Tier
    {_e(state.get('plan_tier'))}
    Quantity
    {_e(state.get('quantity'))}
    Delivery
    {_e(state.get('frequency'))}
    Product
    {_e(state.get('product_option'))}
    Edit plan

    Shipping

    {_e(state.get('shipping_name'))}
    {_e(state.get('shipping_address'))}
    {_e(state.get('shipping_city'))}, {_e(state.get('shipping_region'))} {_e(state.get('shipping_postal'))}

    Edit shipping

    Payment

    {_e(state.get('payment_status') or 'Not ready')}

    Local sandbox · no real card

    Change outcome
    {account_prompt}{activation}

    Activation writes only a local order and subscription. The source service is never contacted.

    """ 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", '

    You’re signed in

    Open your account
    ', account=account, compact=True) if not email: form = f"""
    """ else: form = f"""

    Local demo: demo@curology.local / WebsiteBench!785

    Use a different email""" body = f"""

    Log in

    {form}
    Or sign in with

    Forgot your password?

    Don’t have an account?

    Get Started
    """ return layout("Log in", body, compact=True) def register(account: dict[str, Any] | None, next_url: str = "/account") -> str: body = f"""

    Local account

    Let’s get started

    Create a local-only profile. A verification code is placed in this browser’s local outbox; no email is sent.

    Already have an account? Log in

    """ return layout("Create account", body, account=account, compact=True) def recovery(account: dict[str, Any] | None) -> str: body = """

    Reset your password

    Enter the email for your local Curology account. The public response is the same whether or not it exists.

    ← Return to sign in
    """ 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"""

    Current subscription

    {_e(subscription['plan_tier']).title()} routine

    {_e(subscription['status']).title()}

    Quantity
    {_e(subscription['quantity'])}
    Delivery
    {_e(subscription['frequency'])}
    Next delivery
    {_e(subscription['next_delivery'])}
    Manage subscription
    """ else: card = '

    No subscription yet

    Complete the skin questionnaire to build a routine.

    Find your formula
    ' latest = data["orders"][0] if data["orders"] else None latest_html = f"""

    Newest item

    {_e(latest['order_id'])}

    {_e(latest['status']).title()}

    {_e(latest['delivery_date'])} · ${int(latest['amount_minor'])/100:.2f}

    View order details
    """ if latest else '

    No order history

    Browse skincare
    ' address_summary = ( f"

    {_e(state.get('shipping_address'))}
    " f"{_e(state.get('shipping_city'))}, {_e(state.get('shipping_region'))} " f"{_e(state.get('shipping_postal'))}

    " if state.get("shipping_complete") else "

    Add a synthetic address for local delivery management.

    " ) address_card = ( '

    Shipping

    ' f"

    Shipping & contact address

    {address_summary}
    " 'Manage address
    ' ) body = f"""

    Welcome back

    {_e(account['display_name'])}

    {card}{latest_html}{address_card}
    """ return layout("My Curology", body, account=account) def account_address(account: dict[str, Any], state: dict[str, Any]) -> str: body = f"""
    ← Account

    Subscription settings

    Shipping & contact address

    Use synthetic details only. This address stays in the site-isolated local database.

    """ 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", '

    No subscription yet

    Start consultation
    ', account=account) action_button = ( '

    ' if item["status"] == "canceled" else '

    ' if item["status"] == "active" else "" ) body = f"""
    ← Account

    Subscription settings

    Manage your routine

    {_e(item['status']).title()}

    Change routine

    Next delivery

    {_e(item['next_delivery'])}

    {action_button}

    """ 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'Manage delivery' ) return f'View order details' items = "".join( f"""

    {_e(item['kind'])} order

    {_e(item['order_id'])}

    {_e(item['status']).title()}

    {_e(item['delivery_date'])}

    ${int(item['amount_minor'])/100:.2f}

    {_e(item.get('tracking_label'))}

    {order_action(item)}
    """ for item in data["orders"] ) or '

    No orders yet

    Browse skincare
    ' body = f"""
    ← Account

    Billing and delivery history

    Past & upcoming orders

    {items}
    Back to skincare products
    """ 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 = ( 'Manage this delivery' if can_manage else '

    This historical order is read-only.

    ' ) body = f"""
    ← Past & upcoming orders

    {_e(item['kind'])} order

    Order details

    {_e(item['order_id'])}

    {_e(item['status']).title()}

    Delivery date
    {_e(item['delivery_date'])}
    Amount
    ${int(item['amount_minor'])/100:.2f}
    Shipment update
    {_e(item.get('tracking_label'))}
    {action}
    """ return layout("Order details", body, account=account) def help_page(account: dict[str, Any] | None) -> str: body = """
    Back to Home Page

    How can we help?

    Everything you need to know about Curology

    Browse by Category

    Explore the local knowledge base.

    The Basics

    Questionnaire, plans, and local simulations.

    Curology products

    Custom Formula and routine essentials.

    Account access

    Sign in, registration, and password recovery.

    Billing & shipping

    Payment outcomes and delivery management.

    Failed actions

    Required fields, retry, and safe recovery.

    Terms & privacy

    How this offline clone handles local data.

    Still have questions?

    Contact Us

    Curology Access Program

    Find local support information for eligible visitors. This offline clone does not submit an enrollment request.

    Ask about access →
    """ 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'{_e(label)}' 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'

    {_e(category.replace("-", " "))}

    {_e(title)}

    {_e(summary)}

    {_e(duration)}Read article →
    ' for category, title, summary, duration, art in articles ) or '

    No stories match those filters

    View all stories
    ' body = f"""

    Expert-backed guides

    Skincare 101

    Clear, practical information about skin concerns, ingredients, treatments, and daily products.

    Latest from Curology

    {len(articles)} stories
    {cards}

    Educational content only. Talk to a medical provider about individual health concerns.

    """ 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"""

    {_e(category.replace('-', ' '))}

    {_e(title)}

    {_e(summary)}

    By Curology Team · {_e(duration)}

    We’re here to share general skincare information, but this is not medical advice.

    Start with the basics

    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.

    Track what your skin tells you

    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.

    Explore the local skin quiz
    """ return layout(title, body, account=account) def why_curology(account: dict[str, Any] | None) -> str: comparison_rows = "".join( f'
    {_e(topic)}✓ {_e(curology)}— {_e(other)}
    ' 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'

    Goal {index}

    {_e(title)}

    {_e(copy)}

    {"".join(f"{_e(tag)}" for tag in tags)}
    Get your formula
    ' 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'
    {_e(question)}

    {_e(answer)}

    ' 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"""

    Why Curology

    Award-winning skincare for real results.

    Personalized prescriptions. Clinically-proven ingredients. Access to real, licensed dermatology providers. The evidence is in the effect.

    Start your skin consultation
    ✚Dermatologist-developed3Rx ingredients5.5M+treated↗Provider support

    A different kind of routine

    Made-for-you makes all the difference

    CurologyOther skincare
    {comparison_rows}
    Get your formula

    Multitasking care

    Treat multiple skin concerns with 1 product

    Fight breakouts, fade dark spots, and smooth fine lines with one personalized formula.

    {''.join(f'' for index, key in enumerate(("acne", "spots", "texture", "redness"), start=1))}
    {concern_panels}

    AM to PM

    Your prescription power duo

    Two custom Rx formulas work together across morning and evening to target your selected goals.

    Compare routines

    Care that evolves

    Expert guidance for your skin

    01

    Personalization

    We learn about your goals to build a routine around your needs.

    02

    Custom prescription formulas

    A licensed provider reviews information and selects ingredients when appropriate.

    03

    Expert care just a message away

    The source service offers ongoing provider support as skin needs change.

    Start your skin consultation

    Learn more

    Frequently asked questions

    {faq}

    Start a routine as unique as you

    {''.join(f'{_e(PRODUCT_BY_SLUG[slug][1])}{_e(PRODUCT_BY_SLUG[slug][2])}' for slug in ("custom-formula-acne", "dayprime-rx", "hydrotret-rx", "body-cleanse-rx"))}
    Get your formula
    """ 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'
    5 else ""}" data-review-card="{_e(category)}" {"hidden" if index > 5 else ""}>
    Before{_e(initials)}After
    {_five_stars()}

    {_e(duration)} of consistency

    {_e(copy)}

    Local composite story · results may vary
    ' for index, (category, initials, duration, copy) in enumerate(stories) ) body = f"""

    Transparency first

    Our Review Policy

    Positive feedback is not incentivized. Public review figures are presented with their source labels, and individual results may vary.

    4.42out of 5 on Reviews.io1,142 reviews
    4.2out of 5 on Facebook3,441 reviews
    4.2out of 5 on Influenster9,103 reviews

    Real routines, individual results

    Confident skin starts here. Just ask the internet.

    Results may vary.

    {cards}

    Your routine, your choices

    Get more with your trial

    Your trial includes a Custom Formula and daily essentials. Edit the local box to fit your routine and budget.

    Unlock your offer30-day trial simulation. Subject to consultation. Cancel anytime.
    Custom FormulaTreatment cream for your skin goalsCleanser and moisturizerDaily go-tos for clean, soft skinBody CleanseRxLightly foaming wash for breakouts
    """ return layout("Curology reviews", body, account=account) def contact_page(account: dict[str, Any] | None) -> str: body = """

    Support

    Contact us

    This form saves a local request for demonstration. It never sends a text or email.

    ← Back to help
    """ return layout("Contact us", body, account=account) def simple_page(account: dict[str, Any] | None, title: str, copy: str) -> str: return layout(title, f'', account=account) def privacy_page(account: dict[str, Any] | None) -> str: body = """""" return layout("Privacy Notice", body, account=account) def not_found(account: dict[str, Any] | None, path: str) -> str: body = f"""

    Sorry! We mixed things up

    This page doesn’t exist

    {_e(path)}
    Find your Rx formulaReturn to skincare
    """ return layout("Page not found", body, account=account, status_code=404)