/* mamacool creators — registration form widget (theme-embedded,
   self-contained: the store never loads brand.css). Every value is the
   Fable scale (DESIGN.md, 2026-10-14), read from the theme's own variables
   first with the brand values as fallbacks, so the widget follows the
   theme editor. The due-date picker (due-date-picker.js) writes brand
   class names (.mc-months, .mc-choice, .mc-days, .mc-day, .mc-readout);
   they are styled here, scoped under .mccf, with the same values as
   brand.css. README-creators.md. */

.mccf {
  /* colours */
  --mcf-ink: var(--COLOR-HEADING, #0b0b0b);
  --mcf-border: var(--COLOR-BORDER, #0b0b0b);
  --mcf-ink-soft: rgba(11, 11, 11, .55);
  --mcf-card: var(--COLOR-INPUT-BG, #fff5ea);   /* section fill follows the scheme */
  --mcf-field: #fff5ea;                          /* cream field fill: the one divergence */
  --mcf-peach: #ffbe98;
  --mcf-muted: #dcc7b1;
  --mcf-maroon: #752329;
  --mcf-error: var(--COLOR-ERROR, #d02e2e);
  --mcf-tint: rgba(253, 200, 149, .3);           /* hover: the theme wipe colour at 30% */
  /* radii */
  --mcf-radius: var(--RADIUS, 30px);
  --mcf-r-panel: var(--RADIUS-SMALL, 22px);
  --mcf-r-dense: var(--RADIUS-TINY, 14px);
  --mcf-r-tick: var(--RADIUS-CHECKBOX, 4px);
  /* type */
  --mcf-font: var(--FONT-STACK-BODY, "DM Sans", system-ui, sans-serif);
  --mcf-heading: var(--FONT-STACK-HEADING, "Petrona", Georgia, serif);
  --mcf-heading-weight: var(--FONT-WEIGHT-HEADING, 500);
  --mcf-heading-bold: var(--FONT-WEIGHT-HEADING-BOLD, 600);
  --mcf-heading-track: var(--LETTER-SPACING-HEADING, -.025em);
  --mcf-label-size: calc(1.2rem * var(--FONT-ADJUST-LABEL, .65));
  --mcf-label-weight: var(--FONT-WEIGHT-LABEL, 500);
  --mcf-label-caps: var(--LABEL-TEXT-CAPS, uppercase);
  --mcf-label-track: var(--LETTER-SPACING-LABEL, .05em);
  --mcf-btn-font: var(--FONT-STACK-BUTTON, var(--mcf-font));
  --mcf-btn-weight: var(--FONT-WEIGHT-BUTTON, 500);
  --mcf-btn-size: calc(1rem * var(--FONT-ADJUST-MEDIUM-BUTTON, .8));
  --mcf-btn-caps: var(--BUTTON-TEXT-CAPS, none);
  --mcf-btn-track: var(--LETTER-SPACING-BUTTON, .075em);
  --mcf-btn-lh: var(--button-line-height, 1.53);
  --mcf-input-size: var(--FONT-SIZE-INPUT, 1rem);
  --mcf-tap: 44px;
  --mcf-quick: .12s ease;

  font-family: var(--mcf-font);
  font-size: 1rem; line-height: 1.5625;
  color: var(--mcf-ink);
  display: grid; gap: 16px;
  -webkit-tap-highlight-color: transparent;
}
.mccf > * { min-width: 0; max-width: 100%; }
.mccf *, .mccf *::before, .mccf *::after { box-sizing: border-box; }

/* the panel card */
.mccf__card {
  margin: 0;
  padding: 22px 24px;
  background: var(--mcf-card);
  border: 1px solid var(--mcf-border);
  border-radius: var(--mcf-radius);
  display: grid; gap: 18px;
}
.mccf__card > * { min-width: 0; }

/* a question: Petrona 600 1.05rem label, hint under it, the control, its error */
.mccf__field { display: grid; gap: 8px; }
.mccf__field + .mccf__field { margin-top: 10px; } /* 28px between questions (card gap 18 + 10), as .mc-field */
.mccf__field[hidden] { display: none; }
.mccf__label {
  font-family: var(--mcf-heading); font-weight: var(--mcf-heading-bold);
  font-size: 1.05rem; line-height: 1.35; letter-spacing: var(--mcf-heading-track);
  margin: 0;
}
.mccf__optional { font-family: var(--mcf-font); font-weight: 400; font-size: .85rem; letter-spacing: 0; color: var(--mcf-ink-soft); }
.mccf__hint { margin: -4px 0 0; font-size: .85rem; line-height: 1.5; color: var(--mcf-ink-soft); }
.mccf__sub {
  margin: 4px 0 0;
  font-size: var(--mcf-label-size); font-weight: var(--mcf-label-weight);
  text-transform: var(--mcf-label-caps); letter-spacing: var(--mcf-label-track); color: var(--mcf-ink-soft);
}

/* text inputs: the theme field (1rem, 13/20, 26px line, pill) */
.mccf__input {
  font-family: var(--mcf-font); font-weight: 400; font-size: var(--mcf-input-size); /* 16px: iOS zooms on anything smaller */
  line-height: 26px; color: var(--mcf-ink);
  padding: 13px 20px; width: 100%; margin: 0;
  background: var(--mcf-field);
  border: 1px solid var(--mcf-border); border-radius: var(--mcf-radius);
  appearance: none; -webkit-appearance: none;
}
.mccf__input::placeholder { color: var(--mcf-ink-soft); opacity: 1; }
.mccf__input[aria-invalid="true"] { border-color: var(--mcf-error); }
.mccf__input[readonly] { opacity: .7; }

/* choice pills (the escape pill): DM Sans 500 .875rem, 44px, ink when on */
.mccf__pills { display: flex; flex-wrap: wrap; gap: 8px; }
.mccf__pill, .mccf .mc-choice {
  appearance: none; -webkit-appearance: none;
  display: inline-flex; align-items: center; justify-content: center;
  max-width: 100%; min-height: var(--mcf-tap);
  font-family: var(--mcf-font); font-size: .875rem; font-weight: 500; line-height: 1.3;
  text-transform: none; letter-spacing: 0;
  padding: 8px 15px; margin: 0;
  color: var(--mcf-ink); background: transparent;
  border: 1px solid var(--mcf-border); border-radius: 999px;
  cursor: pointer; transition: background-color var(--mcf-quick), color var(--mcf-quick);
}
.mccf .mc-choice--sm { min-height: 40px; padding: 6px 14px; }
@media (hover: hover) {
  .mccf__pill:hover:not([aria-pressed="true"]),
  .mccf .mc-choice:hover:not(.is-on):not([aria-checked="true"]) { background: var(--mcf-tint); }
}
.mccf__pill[aria-pressed="true"], .mccf .mc-choice.is-on, .mccf .mc-choice[aria-checked="true"] { background: var(--mcf-ink); color: #fff5ea; }

/* the due-date picker: month strip, day grid, readout */
.mccf__picker { display: grid; gap: 14px; }
.mccf__picker[hidden] { display: none; }
.mccf__step { display: grid; gap: 8px; }
.mccf__step[hidden] { display: none; }
.mccf .mc-months {
  display: flex; gap: 8px;
  overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x proximity; scrollbar-width: none;
  padding: 2px 0 6px;
}
.mccf .mc-months::-webkit-scrollbar { display: none; }
.mccf .mc-months > .mc-choice { flex: none; scroll-snap-align: center; }
.mccf .mc-months > .mc-choice:not(.is-on):not([aria-checked="true"]) { background: var(--mcf-field); }
/* capped at 390px so a day cell is about 51px, the same as hq and the PDP sheet */
.mccf .mc-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; max-width: 390px; }
.mccf .mc-day {
  appearance: none; -webkit-appearance: none;
  font-family: var(--mcf-font); font-size: 1rem; font-weight: 400;
  width: 100%; min-width: 0; aspect-ratio: 1; min-height: var(--mcf-tap); padding: 0; margin: 0;
  border: 1px solid var(--mcf-border); border-radius: 999px;
  background: var(--mcf-field); color: var(--mcf-ink);
  cursor: pointer; transition: background-color var(--mcf-quick), color var(--mcf-quick);
}
.mccf .mc-day[disabled] { opacity: .3; cursor: default; }
.mccf .mc-day.is-on, .mccf .mc-day[aria-checked="true"] { background: var(--mcf-ink); color: #fff5ea; font-weight: 500; }
@media (hover: hover) { .mccf .mc-day:hover:not(.is-on):not([disabled]) { background: var(--mcf-tint); } }
.mccf .mc-readout {
  font-family: var(--mcf-heading); font-weight: var(--mcf-heading-weight);
  font-size: 1.15rem; line-height: 1.25; letter-spacing: var(--mcf-heading-track); margin: 0;
}
.mccf .mc-readout:empty { display: none; }
.mccf .mc-readout.is-set { font-weight: var(--mcf-heading-bold); }

/* the tick: a native checkbox with its line of text; a link inside opens without toggling */
.mccf__check {
  display: flex; align-items: flex-start; gap: 12px;
  min-height: var(--mcf-tap); padding: 4px 0;
  font-family: var(--mcf-font); font-size: 1rem; line-height: 1.5; color: var(--mcf-ink);
  cursor: pointer;
}
.mccf__check input {
  appearance: none; -webkit-appearance: none;
  flex: none; width: 22px; height: 22px; margin: 1px 0 0; position: relative;
  border: 1px solid var(--mcf-border); border-radius: var(--mcf-r-tick);
  background: var(--mcf-field); cursor: pointer;
  transition: background-color var(--mcf-quick);
}
.mccf__check input:checked { background: var(--mcf-ink); border-color: var(--mcf-ink); }
.mccf__check input:checked::after {
  content: ""; position: absolute; left: 7px; top: 3px; width: 5px; height: 10px;
  border: solid #fff5ea; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.mccf__check input[aria-invalid="true"] { border-color: var(--mcf-error); }
.mccf__check a, .mccf__panel a, .mccf__error a {
  color: var(--mcf-ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px;
}
.mccf__check a:hover, .mccf__panel a:hover { text-decoration-thickness: 2px; }

/* visually hidden: in the DOM for keyboards, readers and bots, invisible to eyes */
.mccf__sr {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* the Fable button: theme button variables, brand fallbacks */
.mccf__footer { display: grid; gap: 12px; }
.mccf__submit {
  justify-self: start;
  display: inline-block; min-width: 120px; margin: 0;
  font-family: var(--mcf-btn-font); font-weight: var(--mcf-btn-weight); font-size: var(--mcf-btn-size);
  line-height: var(--mcf-btn-lh); text-transform: var(--mcf-btn-caps); letter-spacing: var(--mcf-btn-track);
  padding: calc(15px * var(--FONT-ADJUST-MEDIUM-BUTTON, .8)) calc(22px * var(--FONT-ADJUST-MEDIUM-BUTTON, .8));
  background: var(--mcf-ink); color: #fff5ea;
  border: 1px solid var(--mcf-ink); border-radius: var(--mcf-radius);
  text-align: center; cursor: pointer; position: relative; z-index: 1;
}
@media (min-width: 1440px) { .mccf__submit { min-width: 180px; } }
@media (max-width: 479px) { .mccf__submit { width: 100%; } }
/* the theme's hover: 30% lighten-darken overlay wipes in (top, CSS-only) */
.mccf__submit::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  border-radius: inherit;
  background: var(--COLOR-BG-LIGHTEN-DARKEN, #fdc895); opacity: .3;
  transform: scale(1, 0); transform-origin: top center;
}
@media (prefers-reduced-motion: no-preference) { .mccf__submit::before { transition: transform .3s ease; } }
@media (hover: hover) { .mccf__submit:hover::before { transform: none; } }
.mccf__submit[disabled] { opacity: .45; cursor: not-allowed; }
.mccf__submit[disabled]::before { content: none; }

/* errors: one line per field, one line by the button for everything else */
.mccf__error { font-size: .85rem; font-weight: 500; line-height: 1.4; color: var(--mcf-error); margin: 0; }
.mccf__error[hidden] { display: none; }
.mccf__error:empty { display: none; }

/* one focus ring: peach, 2px, 2px out (the store's mouse mode hides it: body.no-outline) */
.mccf__pill:focus-visible, .mccf .mc-choice:focus-visible, .mccf .mc-day:focus-visible,
.mccf__submit:focus-visible, .mccf__check input:focus-visible, .mccf__check a:focus-visible,
.mccf__input:focus, .mccf__panel a:focus-visible {
  outline: 2px solid var(--mcf-peach); outline-offset: 2px;
}
body.no-outline .mccf__input:focus { outline: none; }

/* full-panel states (registered, already registered) */
.mccf__panel {
  padding: 40px 28px; text-align: center;
  background: var(--mcf-card);
  border: 1px solid var(--mcf-border);
  border-radius: var(--mcf-radius);
  display: grid; gap: 10px; justify-items: center;
}
.mccf__panel:focus { outline: none; } /* focus lands here after submit; the ring is for keyboards only */
.mccf__panel-title { font-family: var(--mcf-heading); font-size: 1.35rem; font-weight: var(--mcf-heading-weight); line-height: 1.25; letter-spacing: var(--mcf-heading-track); margin: 0; }
.mccf__panel-text { font-size: .92rem; line-height: 1.5; opacity: .8; max-width: 46ch; margin: 0; }

@media (prefers-reduced-motion: no-preference) {
  .mccf.is-in > * { animation: mccf-in .3s ease; }
  @keyframes mccf-in { from { opacity: 0; } }
}

@media (max-width: 540px) {
  .mccf__card { padding: 18px; }
  .mccf__panel { padding: 32px 18px; }
}
