/* Your Flow kit v1, kit.css (lane A): the tokens, the frame and the shared page
   utilities. Every selector starts with .yf (or :where(.yf), which adds no
   specificity), and every colour a rule paints is a token. The kit sets the 26
   values under "defaults" inline when it mounts (frame.js), so those defaults
   only cover a page that shows the kit before it runs. kit-controls.css styles
   the controls. Ported from the approved prototype's themes.css and flow.css. */

/* ---- resets: the same baseline on a tenant's own site as on EventWell's page ---- */
.yf, .yf *, .yf *::before, .yf *::after { box-sizing: border-box; }
.yf [hidden] { display: none !important; }
:where(.yf) :where(p, h1, h2, h3, ul, ol) { margin: 0; }
:where(.yf) :where(ul, ol) { padding: 0; list-style: none; }
:where(.yf) :where(img, svg) { display: block; max-width: 100%; }
:where(.yf) :where(button, input, select, textarea) { font: inherit; color: inherit; }
.yf-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* ---- defaults: the cream surface with the default accent (config.js and theme.js) ---- */
:where(.yf) {
  --wp-accent: #3f6a2e; --wp-accent-contrast: #fcfaf4; --wp-accent-soft: #e4eae2;
  --wp-border: #e5dfce; --wp-danger: #a33d2f; --wp-danger-soft: #f9e2df;
  --wp-focus: #3f6a2e; --wp-page: #ece7d8; --wp-success: #2c6e44; --wp-success-soft: #e4f2e7;
  --wp-surface: #fcfaf4; --wp-surface-muted: #f4efe2; --wp-text: #28251f; --wp-text-muted: #6f6858;
  --wp-warning: #8a5a0b; --wp-warning-soft: #f6e8c8;
  --yf-action: #3f6a2e; --yf-action-ink: #fcfaf4; --yf-action-hover: #365b28;
  --yf-stage: #15120f; --yf-stage-2: #241f1a; --yf-on-stage: #f2ebdd; --yf-on-stage-muted: #b8ad9b;
  --yf-stage-line: rgba(242, 235, 221, 0.14); --yf-progress: #497138; --yf-field: #fefdfa;
}

/* ---- fixed tokens: the same on every surface and accent ---- */
:where(.yf) {
  --yf-plate: #ffffff; --yf-plate-rim: #e6e1d6; --yf-plate-shadow: rgba(20, 16, 12, 0.32);
  --yf-food-green: #7a9c4e; --yf-food-green-2: #5c7a3a; --yf-food-brown: #a9744f; --yf-food-brown-2: #7c5638;
  --yf-food-cream: #f3e6c8; --yf-food-gold: #d9a441; --yf-food-red: #c1543c;
  --yf-food-purple: #7d4f7a; --yf-food-orange: #e08a2b; --yf-food-pink: #e2938a;
  --yf-food-char: #3b2a22; --yf-food-sauce: #eddcb5;
  --yf-shadow-card: 0 1px 2px rgba(0, 0, 0, 0.16), 0 20px 32px -18px rgba(0, 0, 0, 0.5);
  --yf-shadow-keepsake: 0 1px 2px rgba(0, 0, 0, 0.16), 0 24px 40px -20px rgba(0, 0, 0, 0.5);
  --yf-shadow-float: 0 12px 30px rgba(0, 0, 0, 0.28);
  --yf-backdrop: rgba(0, 0, 0, 0.4);
  --yf-radius: 12px; --yf-radius-control: 10px; --yf-radius-pill: 999px;
  --yf-ease: cubic-bezier(0.16, 1, 0.3, 1); --yf-dur-1: 160ms; --yf-dur-2: 260ms; --yf-dur-3: 420ms; --yf-motion-distance: 12px;
  --yf-stage-texture: none;
}
.yf[data-surface="linen"] {
  --yf-stage-texture: url("data:image/svg+xml,%3Csvg xmlns='http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
:where(.yf[data-corners="square"]) { --yf-radius: 4px; --yf-radius-control: 4px; --yf-radius-pill: 6px; }
:where(.yf[data-corners="round"]) { --yf-radius: 20px; --yf-radius-control: 12px; --yf-radius-pill: 999px; }

/* ---- aliases: the prototype's token names, ported line for line ---- */
.yf {
  --yf-ground: var(--wp-surface); --yf-ground-2: var(--wp-surface-muted); --yf-surface: var(--yf-field);
  --yf-line: var(--wp-border); --yf-line-strong: var(--wp-text-muted);
  --yf-ink: var(--wp-text); --yf-ink-soft: var(--wp-text); --yf-muted: var(--wp-text-muted);
  --yf-progress-ink: var(--yf-progress);
  --yf-signature: var(--wp-accent); --yf-signature-deep: var(--wp-accent);
  --yf-ok: var(--wp-success); --yf-warn: var(--wp-warning); --yf-danger: var(--wp-danger);
  --yf-focus: var(--wp-focus);
}
.yf-head, .yf-stage, .yf-toast { --yf-focus: var(--yf-on-stage); }

/* ---- host override hooks: declared with :where so any host rule wins ---- */
:where(.yf) {
  --yf-font-body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --yf-font-display: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --yf-font-signature: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --yf-signature-style: italic; --yf-weight-display: 800;
}
:where(.yf[data-font="inherit"]) { --yf-font-body: inherit; --yf-font-display: inherit; }
:where(.yf[data-font="serif"]) {
  --yf-font-display: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --yf-weight-display: 600;
}

/* ---- motion: three levels of the same movement ---- */
.yf[data-motion="gentle"] { --yf-dur-1: 100ms; --yf-dur-2: 160ms; --yf-dur-3: 220ms; --yf-motion-distance: 4px; }
.yf[data-motion="off"] { --yf-dur-1: 0.01ms; --yf-dur-2: 0.01ms; --yf-dur-3: 0.01ms; --yf-motion-distance: 0px; }
@media (prefers-reduced-motion: reduce) {
  .yf, .yf[data-motion] { --yf-dur-1: 0.01ms; --yf-dur-2: 0.01ms; --yf-dur-3: 0.01ms; --yf-motion-distance: 0px; }
}

/* ---- layout: document flow with a sticky action bar, so it sits inside a host page ---- */
.yf {
  position: relative; display: flex; flex-direction: column; container-type: inline-size; container-name: yf;
  background: var(--yf-ground); color: var(--yf-ink);
  font-family: var(--yf-font-body); font-size: 16px; line-height: 1.5;
  caret-color: var(--yf-action); scrollbar-color: var(--yf-line-strong) var(--yf-ground-2);
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
.yf ::selection { background: var(--yf-action); color: var(--yf-action-ink); }
.yf :focus-visible { outline: 2.5px solid var(--yf-focus); outline-offset: 2px; scroll-margin-bottom: 140px; }
.yf [tabindex="-1"]:focus { outline: none; }

.yf-mode { margin: 0; padding: 8px 20px; background: var(--yf-ground-2); color: var(--yf-ink-soft); font-size: 12.5px; text-align: center; }

/* ---- head, brand and progress: the moments happen on the dark linen band ---- */
.yf-head { position: relative; isolation: isolate; background: var(--yf-stage); color: var(--yf-on-stage); padding: 14px 20px 16px; }
.yf-brand { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; font-family: var(--yf-font-display); font-weight: var(--yf-weight-display); font-size: 14.5px; }
.yf-brand__logo { height: 34px; width: auto; }
.yf-brand__name { min-width: 0; overflow-wrap: anywhere; }

.yf-progress { position: relative; }
.yf-progress__list { display: flex; justify-content: space-between; position: relative; }
.yf-progress__list::before {
  content: ""; position: absolute; left: calc(50% / var(--yf-progress-count, 3)); right: calc(50% / var(--yf-progress-count, 3));
  top: 5px; height: 2px; background: var(--yf-stage-line);
}
.yf-progress__fill {
  position: absolute; left: calc(50% / var(--yf-progress-count, 3)); top: 5px; height: 2px;
  width: calc(100% - 100% / var(--yf-progress-count, 3)); background: var(--yf-progress);
  transform: scaleX(var(--yf-progress-at, 0)); transform-origin: 0 50%; transition: transform var(--yf-dur-3) var(--yf-ease);
}
.yf-progress__stop { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.yf-progress__dot { width: 10px; height: 10px; border-radius: 50%; background: var(--yf-stage-2); border: 2px solid var(--yf-stage-line); }
.yf-progress__label { font-size: 11px; font-weight: 600; color: var(--yf-on-stage-muted); }
.yf-progress__stop.is-done .yf-progress__dot { background: var(--yf-progress); border-color: var(--yf-progress); }
.yf-progress__stop.is-current .yf-progress__dot { background: var(--yf-progress); border-color: var(--yf-on-stage); }
.yf-progress__stop.is-current .yf-progress__label { color: var(--yf-on-stage); }

/* ---- body, steps and their transitions: transform and opacity only ---- */
.yf-body { flex: 1 0 auto; padding: 20px 20px 8px; }
.yf-step { outline: none; }
.yf-step-enter { opacity: 0; transform: translateX(var(--yf-motion-distance)); }
.yf-step-enter-active { opacity: 1; transform: translateX(0); transition: opacity var(--yf-dur-3) var(--yf-ease), transform var(--yf-dur-3) var(--yf-ease); }
.yf-step-exit { opacity: 1; transform: translateX(0); pointer-events: none; }
.yf-step-exit-active { opacity: 0; transform: translateX(calc(var(--yf-motion-distance) * -1)); transition: opacity var(--yf-dur-2) var(--yf-ease), transform var(--yf-dur-2) var(--yf-ease); }

.yf-h1 { margin: 0 0 6px; font-family: var(--yf-font-display); font-weight: var(--yf-weight-display); font-size: 26px; font-size: clamp(22px, 7cqi, 28px); line-height: 1.15; color: var(--yf-ink); text-wrap: balance; overflow-wrap: anywhere; scroll-margin-bottom: 140px; }
.yf-sub { margin: 0 0 20px; font-size: 15px; line-height: 1.5; color: var(--yf-ink-soft); max-width: 52ch; text-wrap: pretty; }
.yf-note { margin: 10px 0 0; font-size: 12.5px; line-height: 1.5; color: var(--yf-muted); }
.yf-welcome { margin: 0 0 16px; }

/* ---- actions: sticky, so the primary action stays reachable while a couple types ---- */
.yf-actions {
  position: sticky; bottom: 0; z-index: 10; display: flex; flex-direction: column; gap: 8px;
  padding: 14px 20px calc(14px + env(safe-area-inset-bottom)); background: var(--yf-ground); border-top: 1px solid var(--yf-line);
}
.yf-actions:empty { display: none; }
@media (max-height: 480px) { .yf-actions { position: static; } }

.yf-help { margin: 0; padding: 10px 20px calc(10px + env(safe-area-inset-bottom)); background: var(--yf-ground-2); color: var(--yf-muted); font-size: 12px; text-align: center; }
/* A phone number is one unit: it never breaks at its hyphen. The contact fallback uses the same class. */
.yf-help__phone { font-weight: 700; color: var(--yf-ink-soft); white-space: nowrap; }
.yf-powered { margin: 0; padding: 6px 20px calc(6px + env(safe-area-inset-bottom)); background: var(--yf-ground-2); color: var(--yf-muted); font-size: 11px; text-align: center; }

@container yf (min-width: 720px) {
  .yf-mode, .yf-head, .yf-body, .yf-actions, .yf-help, .yf-powered { padding-inline: max(20px, calc((100cqi - 640px) / 2)); }
}

/* ---- the toast: fixed to the viewport, on the dark band. It takes its natural width (a fixed box
   with only left: 50% would be squeezed into the half of the screen right of the middle) and sits
   above the action bar: frame.js sets --yf-toast-lift to the bar's height when the toast shows. ---- */
.yf-toast {
  position: fixed; left: 50%; bottom: calc(max(var(--yf-toast-lift, 0px), env(safe-area-inset-bottom)) + 16px); z-index: 50;
  display: flex; align-items: center; gap: 10px; width: max-content; max-width: calc(100% - 32px);
  padding: 12px 16px; border-radius: var(--yf-radius-control);
  background: var(--yf-stage); color: var(--yf-on-stage); font-size: 13.5px; font-weight: 600;
  box-shadow: var(--yf-shadow-float); opacity: 0; pointer-events: none; transform: translate(-50%, 8px);
  transition: opacity var(--yf-dur-2) var(--yf-ease), transform var(--yf-dur-2) var(--yf-ease);
}
.yf-toast.is-visible { opacity: 1; pointer-events: auto; transform: translate(-50%, 0); }
.yf-toast__text { flex: 1; min-width: 0; }
.yf-toast__undo {
  flex: none; display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; margin: -12px -4px;
  padding: 0 8px; background: none; border: none; color: var(--yf-on-stage); font-weight: 700; text-decoration: underline; cursor: pointer;
}

/* ---- shared utilities: the dark stage, the signature face, the fallback panel ---- */
.yf-stage { position: relative; isolation: isolate; background: var(--yf-stage); color: var(--yf-on-stage); border-radius: var(--yf-radius); }
.yf-signature { font-family: var(--yf-font-signature); font-style: var(--yf-signature-style, normal); color: var(--yf-signature-deep); line-height: 1; }
.yf-stage .yf-signature { color: var(--yf-on-stage); }
.yf-head::before, .yf-stage::before {
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0.06; pointer-events: none;
  background-repeat: repeat; background-size: 180px 180px; border-radius: inherit; background-image: var(--yf-stage-texture);
}
.yf-fallback { padding: 4px 0; }
.yf-fallback p { margin: 0 0 8px; font-size: 14px; line-height: 1.5; color: var(--yf-ink-soft); }

@media (forced-colors: active) {
  .yf-progress__dot { forced-color-adjust: none; }
}
