/* ==========================================================================
   FLOW primitives - V6 "Warm Glass Atelier" for every transactional and account screen
   cart page, checkout, order, auth, account, contact, newsletter, try-on.
   Cream page with a soft warm light wash, paper cards (24-32px) with warm shadows, sand panels, frosted glass for bars and captions, cocoa pills,
   olive used only as a small accent (dots, ticks, the delivery bar). Serif headings (Instrument Serif, one weight, italic = the accent word).
   Rules kept everywhere: works without JS and motion, controls >= 44px, text >= 4.5:1 (ink / muted on cream, paper, sand, white), every animation
   has a reduced-motion path. Class names (fx-*) are a stable contract used by the cart, checkout, order, account, auth, contact, newsletter and try-on views.
   ========================================================================== */

/* ---------- the page: cream + a soft light wash (static, CSS only) so the glass has something to frost ---------- */
.fx-scene { position: relative; isolation: isolate; overflow-x: clip; background: var(--cream); font-variant-numeric: lining-nums; }
.fx-scene::before {
  content: ""; position: absolute; inset: 0 0 auto 0; block-size: min(48rem, 100%); z-index: -1; pointer-events: none;
  background:
    radial-gradient(54rem 30rem at 8% -8%, rgba(234, 223, 209, .95), transparent 70%),
    radial-gradient(46rem 26rem at 96% 2%, rgba(205, 187, 166, .34), transparent 72%),
    radial-gradient(34rem 20rem at 58% 26%, rgba(255, 250, 244, .85), transparent 70%);
}
.fx-page { padding-block: clamp(1.25rem, .6rem + 2.4vw, 3rem) clamp(3.5rem, 2rem + 5vw, 7rem); }
.fx-page--tall { min-block-size: calc(100svh - var(--header-h, 4rem) - 3rem); }
.fx-wrap { inline-size: 100%; max-inline-size: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.fx-wrap--narrow { max-inline-size: calc(var(--container-narrow) + var(--gutter) * 2); }
.fx-wrap--mid { max-inline-size: calc(1240px + var(--gutter) * 2); }

/* ---------- page heading: eyebrow + serif title (+ a glass pill link on the right) ---------- */
.fx-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--space-3) var(--space-6); margin-block-end: clamp(1.5rem, 1rem + 2vw, 2.75rem); }
.fx-head__main { min-inline-size: 0; }
.fx-head .eyebrow { margin-block-end: var(--space-3); }
.fx-title {
  margin: 0; font-family: var(--font-display); font-weight: var(--fw-display); color: var(--ink);
  font-size: clamp(2.5rem, 1.2rem + 4.6vw, 5rem); line-height: .98; letter-spacing: var(--tracking-display); text-wrap: balance; overflow-wrap: anywhere;
}
.fx-title em { font-style: italic; font-weight: inherit; color: inherit; }
.fx-title--md { font-size: clamp(2.25rem, 1.1rem + 3.6vw, 4rem); }
.fx-lead { margin: var(--space-4) 0 0; max-inline-size: 56ch; font-size: var(--fs-md); line-height: 1.55; color: var(--text-muted); }
.fx-backlink {
  display: inline-flex; align-items: center; gap: .6rem; min-block-size: var(--tap); padding: 0 1.15rem; border: 1px solid var(--glass-border); border-radius: var(--radius-pill);
  background: var(--glass-bg); -webkit-backdrop-filter: blur(14px) saturate(1.2); backdrop-filter: blur(14px) saturate(1.2); box-shadow: var(--shadow-1);
  color: var(--text); font: 600 var(--fs-sm)/1.2 var(--font-body); text-decoration: none;
  transition: background-color var(--dur-2) var(--ease-soft), translate var(--dur-3) var(--ease-soft), box-shadow var(--dur-3) var(--ease-soft);
}
.fx-backlink:hover { background: var(--white); translate: 0 -2px; box-shadow: var(--shadow-2); }
.fx-backlink .icon { inline-size: 1rem; block-size: 1rem; transition: transform var(--dur-3) var(--ease-soft); }
.fx-backlink:hover .icon { transform: translateX(-.25rem); }
.fx-h2 { margin: 0 0 var(--space-4); font-family: var(--font-display); font-weight: var(--fw-display); font-size: clamp(1.6rem, 1.15rem + 1.4vw, 2.3rem); line-height: 1; letter-spacing: var(--tracking-display); }

/* ---------- card: warm paper, white edge, soft warm shadow ---------- */
.fx-card {
  position: relative; min-inline-size: 0; margin: 0 0 var(--space-6); padding: clamp(1.25rem, .8rem + 1.8vw, 2.1rem);
  background: var(--paper); border: 1px solid rgba(255, 255, 255, .9); border-radius: var(--r-card); color: var(--text);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .9) inset, 0 0 0 1px rgba(var(--cocoa-rgb), .05), 0 26px 54px -36px rgba(var(--cocoa-rgb), .34), 0 8px 20px -14px rgba(var(--cocoa-rgb), .14);
}
.fx-card > :last-child { margin-block-end: 0; }
.fx-card--lg { border-radius: var(--r-card-lg); padding: clamp(1.5rem, 1rem + 2.2vw, 2.75rem); }
.fx-card--soft, .fx-card--flat { background: var(--sand); border-color: rgba(255, 255, 255, .55); box-shadow: none; }
.fx-card--glass { background: var(--glass-bg-strong); border-color: var(--glass-border); -webkit-backdrop-filter: blur(24px) saturate(1.2); backdrop-filter: blur(24px) saturate(1.2); box-shadow: var(--glass-shadow); }
.fx-card--center { text-align: center; display: grid; justify-items: center; gap: var(--space-3); }
.fx-card--center > * { margin-block: 0; }
.fx-grid-2 { display: grid; gap: 0 var(--space-4); grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) { .fx-card--glass { background: var(--paper); } .fx-backlink { background: var(--paper); } }

/* ---------- split layout: AI lifestyle photograph + warm glass form card (auth, contact, newsletter, tracking) ---------- */
.fx-split { display: grid; gap: var(--space-6); align-items: stretch; }
@media (min-width: 62rem) {
  .fx-split { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(2rem, 4vw, 4.5rem); }
  .fx-split--reverse > .fx-photo { order: 2; }
}
.fx-photo { position: relative; margin: 0; min-block-size: 16rem; overflow: hidden; isolation: isolate; border-radius: var(--r-card-lg); background: var(--ph-cool); box-shadow: var(--shadow-2); }
@media (min-width: 62rem) { .fx-photo { min-block-size: 34rem; } }
.fx-photo__img, .fx-photo picture { position: absolute; inset: 0; inline-size: 100%; block-size: 100%; object-fit: cover; object-position: var(--fx, 50% 30%); }
.fx-photo picture { display: block; }
.fx-photo picture > img { inline-size: 100%; block-size: 100%; object-fit: cover; object-position: var(--fx, 50% 30%); }
.fx-photo__ph { position: absolute; inset: 0; background: var(--ph-cool); }
.fx-photo.has-photo::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(var(--cream-rgb), 0) 55%, rgba(42, 27, 21, .26)); pointer-events: none; }
.fx-photo__cap { position: absolute; z-index: 2; inset-inline: 1rem; inset-block-end: 1rem; max-inline-size: 26rem; padding: 1.1rem 1.35rem; border: 1px solid var(--glass-border); border-radius: var(--r-card); background: var(--glass-bg-strong); -webkit-backdrop-filter: blur(24px) saturate(1.2); backdrop-filter: blur(24px) saturate(1.2); box-shadow: var(--glass-shadow); font-family: var(--font-display); font-weight: var(--fw-display); font-size: clamp(1.5rem, 1.1rem + 1.2vw, 2rem); letter-spacing: var(--tracking-display); line-height: 1.02; color: var(--ink); }
/* honest label on every AI image (same pill the home page uses) */
.fx-photo__ai { position: absolute; z-index: 2; inset-block-start: .85rem; inset-inline-start: .85rem; display: inline-flex; align-items: center; min-block-size: 1.6rem; padding: 0 .75rem; border: 1px solid var(--glass-border); border-radius: var(--radius-pill); background: var(--glass-bg-strong); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); color: var(--ink); font: 600 .65rem/1 var(--font-body); letter-spacing: var(--tracking-label); text-transform: uppercase; }
/* caption card over a photograph: frosted glass with INK text (5:1 even over pure black) */
.fx-photo__glass {
  position: absolute; z-index: 2; inset-inline: 1rem; inset-block-end: 1rem; max-inline-size: 26rem; padding: 1.15rem 1.35rem; border: 1px solid var(--glass-border); border-radius: var(--r-card);
  background: var(--glass-bg-strong); -webkit-backdrop-filter: blur(24px) saturate(1.2); backdrop-filter: blur(24px) saturate(1.2); box-shadow: var(--glass-shadow);
  color: var(--text); font-size: var(--fs-sm); line-height: 1.5;
}
.fx-photo__glass strong { display: block; margin-block-end: .25rem; font-family: var(--font-display); font-weight: var(--fw-display); font-size: 1.65rem; letter-spacing: var(--tracking-display); line-height: 1; }
.fx-photo.is-placeholder::after { display: none; }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) { .fx-photo__glass, .fx-photo__ai, .fx-photo__cap { background: var(--paper); } }

/* ---------- stepper: a frosted pill bar. Current = white pill with a cocoa number, done = olive tick ---------- */
.fx-stepper {
  display: flex; align-items: stretch; gap: .25rem; margin: 0 0 var(--space-6); padding: .35rem; list-style: none; border: 1px solid var(--glass-border); border-radius: var(--radius-pill);
  background: var(--glass-bg); -webkit-backdrop-filter: blur(18px) saturate(1.2); backdrop-filter: blur(18px) saturate(1.2); box-shadow: var(--glass-shadow);
}
.fx-stepper > li { flex: 1 1 0; min-inline-size: 0; display: flex; }
.fx-stepper__link {
  position: relative; flex: 1; display: flex; align-items: center; justify-content: center; gap: .65rem; min-block-size: 2.9rem; padding: .3rem .85rem; border-radius: var(--radius-pill);
  color: var(--muted-strong); font: 600 var(--fs-sm)/1.15 var(--font-body); text-align: center; text-decoration: none;
  transition: color var(--dur-2) var(--ease-soft), background-color var(--dur-3) var(--ease-soft), box-shadow var(--dur-3) var(--ease-soft);
}
.fx-stepper__link:hover { color: var(--ink); background: rgba(255, 255, 255, .5); }
.fx-stepper__no {
  flex: none; display: grid; place-items: center; inline-size: 1.7rem; block-size: 1.7rem; border-radius: 50%; background: var(--sand); color: var(--muted-strong);
  font-size: var(--fs-xs); font-weight: 700; font-variant-numeric: tabular-nums; transition: background-color var(--dur-3) var(--ease-soft), color var(--dur-3) var(--ease-soft);
}
.fx-stepper__link[aria-current="step"], .fx-stepper__link[aria-current="true"] { color: var(--ink); background: var(--white); box-shadow: 0 1px 0 rgba(255, 255, 255, .9) inset, 0 8px 20px -12px rgba(var(--cocoa-rgb), .45), 0 0 0 1px rgba(var(--cocoa-rgb), .06); }
.fx-stepper__link[aria-current="step"] .fx-stepper__no, .fx-stepper__link[aria-current="true"] .fx-stepper__no { background: var(--cocoa); color: var(--cream); }
.fx-stepper__link.is-done { color: var(--ink); }
.fx-stepper__link.is-done .fx-stepper__no {
  background-color: var(--olive); color: transparent;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23FFFFFF' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: center; background-size: .85rem;
}
@media (max-width: 47.99rem) {
  .fx-stepper__link:not([aria-current="step"]):not([aria-current="true"]) .fx-stepper__label { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .fx-stepper > li:has([aria-current]) { flex: 3 1 0; }
  .fx-stepper__link { padding-inline: .25rem; gap: .45rem; font-size: var(--fs-xs); }
}

/* ---------- radio / checkbox card: native input stays in the DOM; the whole card is the target ---------- */
.fx-choice {
  position: relative; display: flex; align-items: center; gap: var(--space-3); min-block-size: 4.25rem; margin: 0 0 var(--space-3); padding: .95rem 1.2rem; border: 1px solid var(--line-strong); border-radius: var(--r-card);
  background: var(--white); cursor: pointer; transition: border-color var(--dur-2) var(--ease-soft), background-color var(--dur-2) var(--ease-soft), box-shadow var(--dur-3) var(--ease-soft), translate var(--dur-3) var(--ease-soft);
}
.fx-choice::after { content: ""; position: absolute; inset: -1px; border: 2px solid transparent; border-radius: inherit; pointer-events: none; transition: border-color var(--dur-2); }
.fx-choice:hover { border-color: var(--cocoa); translate: 0 -1px; box-shadow: var(--shadow-1); }
.fx-choice > input[type="radio"], .fx-choice > input[type="checkbox"] { position: absolute; inset-block-start: 50%; inset-inline-start: 1.2rem; inline-size: 1.5rem; block-size: 1.5rem; margin: -.75rem 0 0; opacity: 0; cursor: pointer; }
.fx-choice__mark { flex: none; display: grid; place-items: center; inline-size: 1.5rem; block-size: 1.5rem; border: 1px solid var(--ctl-border); border-radius: 50%; background: var(--white); transition: background-color var(--dur-2), border-color var(--dur-2), transform var(--dur-3) var(--ease-spring); }
.fx-choice__mark::after { content: ""; inline-size: .52rem; block-size: .52rem; border-radius: 50%; background: var(--white); transform: scale(0); transition: transform var(--dur-3) var(--ease-spring); }
.fx-choice:has(> input:checked) { background: var(--white); border-color: var(--cocoa); box-shadow: 0 18px 34px -24px rgba(var(--cocoa-rgb), .5); }
.fx-choice:has(> input:checked)::after { border-color: var(--cocoa); }
.fx-choice:has(> input:checked) .fx-choice__mark { background: var(--cocoa); border-color: var(--cocoa); transform: scale(1.05); }
.fx-choice:has(> input:checked) .fx-choice__mark::after { transform: scale(1); }
.fx-choice:has(> input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 3px; }
.fx-choice:has(> input:disabled) { opacity: .55; cursor: not-allowed; }
.fx-choice__body { display: grid; flex: 1; gap: .15rem; min-inline-size: 0; font-size: var(--fs-sm); line-height: 1.45; }
.fx-choice__body > strong { font-size: var(--fs-base); font-weight: 600; }
.fx-choice__aside { flex: none; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.fx-choice--static { cursor: default; }
.fx-choice--static:hover { border-color: var(--line-strong); translate: none; box-shadow: none; }

/* ---------- small status / label pills (flat fills: AA pairs measured in docs/DESIGN_SYSTEM.md 3.3) ---------- */
.fx-tag { display: inline-flex; align-items: center; gap: .4rem; min-block-size: 1.55rem; padding: .2rem .7rem; border: 0; border-radius: 999px; background: var(--mist); color: var(--ink); font: 700 var(--fs-label)/1.1 var(--font-body); letter-spacing: var(--tracking-label); text-transform: uppercase; white-space: nowrap; }
.fx-tag--gold, .fx-tag--warn { background: var(--warn-soft); color: var(--warn-text); }
.fx-tag--ok { background: var(--olive-soft); color: var(--olive-text); }
.fx-tag--bad { background: var(--red-soft); color: var(--red); }
.fx-tag--info { background: var(--mist); color: var(--ink); }
.fx-tag--muted { background: var(--mist); color: var(--muted); }
.fx-tag--dark { background: var(--cocoa); color: var(--cream); }
.fx-dot { inline-size: .45rem; block-size: .45rem; border-radius: 50%; background: currentColor; flex: none; }

/* ---------- medallion + centred result states (success / waiting / error) ---------- */
.fx-medallion { position: relative; display: grid; place-items: center; inline-size: 4.25rem; block-size: 4.25rem; border-radius: 50%; background: var(--cocoa); color: var(--cream); box-shadow: 0 0 0 .55rem rgba(var(--cocoa-rgb), .08), 0 18px 34px -18px rgba(var(--cocoa-rgb), .6); }
.fx-medallion .icon { inline-size: 1.7rem; block-size: 1.7rem; stroke-width: 1.8; }
.fx-medallion--ok { background: var(--cocoa); color: var(--cream); box-shadow: 0 0 0 .55rem rgba(107, 118, 80, .2), 0 18px 34px -18px rgba(var(--cocoa-rgb), .6); }
.fx-medallion--bad { background: var(--red-soft); color: var(--red); box-shadow: 0 0 0 .55rem rgba(168, 40, 28, .1), inset 0 0 0 1px var(--red); }
.fx-result { max-inline-size: 40rem; margin-inline: auto; }

/* ---------- trust / reassurance row ---------- */
.fx-trust { display: flex; flex-wrap: wrap; gap: .55rem 1.2rem; margin: var(--space-4) 0 0; padding: 0; list-style: none; font-size: var(--fs-xs); line-height: 1.4; color: var(--text-muted); }
.fx-trust li { display: inline-flex; align-items: center; gap: .5rem; }
.fx-trust .icon { flex: none; box-sizing: content-box; inline-size: .95rem; block-size: .95rem; padding: .3rem; border-radius: 50%; background: var(--sand); color: var(--cocoa); }
.fx-ainote { margin: var(--space-3) 0 0; font-size: var(--fs-xs); line-height: 1.5; color: var(--text-muted); }

/* ---------- shared alert: sits on the page, soft corners ---------- */
.fx-scene .alert { background: var(--sand); border-color: transparent; }
.fx-scene .alert--success { background: var(--olive-soft); }
.fx-scene .alert--warning { background: var(--warn-soft); }
.fx-scene .alert--danger { background: var(--red-soft); }

/* ---------- entrance: a short soft rise (CSS only, so content is never hidden without JS), skipped under reduced motion ---------- */
@keyframes fx-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
html:not([data-motion="reduced"]) .fx-rise { animation: fx-rise .7s var(--ease-expo) both; animation-delay: calc(var(--i, 0) * 70ms); }
@media (prefers-reduced-motion: reduce) {
  .fx-rise { animation: none !important; }
  .fx-choice, .fx-choice::after, .fx-stepper__link, .fx-stepper__no, .fx-backlink, .fx-backlink .icon, .fx-choice__mark, .fx-choice__mark::after { transition: none; }
  .fx-choice:hover, .fx-backlink:hover { translate: none; }
}
html[data-motion="reduced"] .fx-choice, html[data-motion="reduced"] .fx-stepper__link, html[data-motion="reduced"] .fx-stepper__no, html[data-motion="reduced"] .fx-backlink, html[data-motion="reduced"] .fx-choice__mark, html[data-motion="reduced"] .fx-choice__mark::after { transition: none; }
html[data-motion="reduced"] .fx-choice:hover, html[data-motion="reduced"] .fx-backlink:hover { translate: none; }

@media print { .fx-scene { background: #fff; } .fx-scene::before { display: none; } .fx-card { background: #fff; border-color: #888; box-shadow: none; } }
@media (max-width: 47.99rem) {
  .fx-photo { min-block-size: 19rem; }
  .fx-photo__cap { inset-inline: .65rem; inset-block-end: .65rem; padding: .75rem 1rem; font-size: 1.3rem; }
}

/* browsers without :has(): the native input still drives the mark (the card ring is the progressive extra) */
.fx-choice > input:checked ~ .fx-choice__mark { background: var(--cocoa); border-color: var(--cocoa); }
.fx-choice > input:checked ~ .fx-choice__mark::after { transform: scale(1); }
.fx-choice--check > input:checked ~ .fx-choice__mark::after { transform: rotate(45deg) scale(1); }
.fx-choice > input:focus-visible ~ .fx-choice__mark { outline: 2px solid var(--focus); outline-offset: 3px; }
