/* Beta pre-registration forms (SPEC-AMENDMENTS G3, H4, H30). Phone first; uses the tokens and the
   .field / .choice / .check styles from base.css. Own class names start with bf-. Owned by the
   build session (G9). Each form links this file itself, so no page needs it in the head. */

.bf-form {
  display: grid;
  gap: 1.1rem;
  max-width: 34rem;
  padding: 1.25rem;
  border: 1.5px solid var(--rule);
  border-radius: var(--radius);
  background: var(--card);
  text-align: left;
}
@media (min-width: 640px) {
  .bf-form {
    padding: 1.6rem 1.75rem;
  }
}
.bf-form .bf-title {
  font-size: 1.35rem;
  margin: 0;
}
.bf-lede {
  margin: -0.6rem 0 0;
  color: var(--ink-3);
  font-size: 0.92rem;
}
.bf-form .field,
.bf-form fieldset.field {
  margin: 0;
}
.bf-form input[type='email'],
.bf-form input[type='text'],
.bf-form input[type='url'],
.bf-form select,
.bf-form textarea {
  width: 100%;
  min-height: 44px;
  font-size: 1rem; /* 16px keeps phones from zooming in on focus */
}
.bf-form .choice {
  min-height: 44px;
  align-items: center;
}
.bf-form .choice:has(.choice-hint) {
  align-items: flex-start;
}
.bf-group .choices {
  grid-template-columns: 1fr;
}
.bf-two-cols .choices {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (min-width: 640px) {
  .bf-two-cols .choices {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
.bf-two-cols .choice {
  padding: 0.55rem 0.65rem;
  font-size: 0.92rem;
}
.bf-check.bf-has-error .check input {
  outline: 2px solid var(--bad);
  outline-offset: 2px;
}
.bf-consent {
  display: grid;
  gap: 0.7rem;
}
.bf-notice {
  font-size: 0.84rem;
  color: var(--ink-2);
  line-height: 1.5;
  padding: 0.8rem 0.95rem;
  background: var(--paper-2);
  border-radius: var(--radius-sm);
}
.bf-notice p {
  margin: 0;
}
.bf-notice p + p {
  margin-top: 0.45rem;
}
.bf-notice mark.bf-placeholder,
.bf-closed mark.bf-placeholder {
  background: var(--mark);
  color: var(--mark-ink);
  padding: 0 0.2em;
  border-radius: 3px;
}
.bf-alert {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  padding: 0.75rem 0.9rem;
  border-radius: var(--radius-sm);
  background: var(--warn-soft);
  color: var(--ink);
}
.bf-form .error-summary h3 {
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 0.4rem;
  color: var(--bad);
}
/* Honeypot: off screen for people, still in the markup for bots. */
.bf-hp {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.bf-closed p {
  margin: 0;
}

/* Thank-you and "not open yet" pages. */
.bf-page {
  max-width: 38rem;
  margin: 0 auto;
  display: grid;
  gap: 1rem;
}
.bf-page h1 {
  margin: 0;
}
.bf-page .bf-steps {
  display: grid;
  gap: 0.5rem;
  padding-left: 1.2rem;
  margin: 0;
}
.bf-page h2 {
  font-size: 1.2rem;
  margin: 0.4rem 0 0;
}
.bf-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.bf-programmes {
  display: grid;
  gap: 0.35rem 1rem;
  margin: 0;
  padding: 0.9rem 1rem;
  border-left: 3px solid var(--accent);
  background: var(--paper-2);
  border-radius: var(--radius-sm);
}
.bf-programmes dt {
  font-weight: 700;
}
.bf-programmes dd {
  margin: 0 0 0.4rem;
  color: var(--ink-2);
}

.bf-promise {
  margin: -0.4rem 0 0;
  padding: 0.7rem 0.9rem;
  border-left: 3px solid var(--ok);
  background: var(--ok-soft);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  color: var(--ink);
}
fieldset.bf-optional {
  display: grid;
  gap: 1.1rem;
  padding-top: 0.9rem;
  border-top: 1.5px solid var(--rule);
}
.bf-optional-heading {
  font-weight: 700;
  font-size: 1.02rem;
  padding: 0;
  margin-bottom: 0.2rem;
}
.bf-notice div[lang='ko'] {
  margin-top: 0.45rem;
}
.bf-under {
  margin: -0.5rem 0 0;
  font-size: 0.86rem;
  color: var(--ink-3);
  text-align: center;
}

/* The optional news line reads like the text around it, not like a heading. */
.bf-news .check,
.bf-news .check span {
  font-weight: 400;
}
/* A wrapped "(optional)" starts in line with the label text; the plain space before it keeps the gap. */
.check .opt {
  margin-left: 0;
}

/* Thank-you page share link (beta v2 C5): a read-only field and the Copy button from app.js. */
.bf-share {
  display: grid;
  gap: 0.5rem;
  padding: 0.9rem 1rem;
  border-left: 3px solid var(--accent);
  background: var(--paper-2);
  border-radius: var(--radius-sm);
}
.bf-share label {
  font-weight: 600;
}
.bf-share-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.bf-share-row input[type='text'] {
  flex: 1 1 14rem;
  min-width: 0;
  min-height: 44px;
  font-size: 1rem; /* 16px keeps phones from zooming in on focus */
}
.bf-share-row .btn {
  min-height: 44px;
}

/* ---------------------------------------------------------------- brand v5 (24 Nov 2026) */
/* The form card: a 2 px ink frame with 18 px corners; its title in the heading face. */
.bf-form {
  border: 2px solid var(--rule-strong);
  border-radius: var(--radius-lg);
  padding: clamp(20px, 2.6vw, 32px);
}
.bf-form .bf-title {
  font-size: 24px;
  font-stretch: 112%;
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.bf-lede {
  font-size: 0.9375rem;
}
/* Notices: the privacy note and the tester promise share the plain ink-edged note (1 Dec 2026: the promise no longer
   uses the blush and red of errors and chosen answers, so it never reads as an error); "please wait" is amber. */
.bf-notice {
  font-size: 0.9375rem;
  padding: 14px 16px;
  background: var(--paper);
  border: 1.5px solid var(--rule);
  border-left: 5px solid var(--ink);
  border-radius: 4px var(--radius) var(--radius) 4px;
}
.bf-notice mark.bf-placeholder,
.bf-closed mark.bf-placeholder {
  background: transparent;
  color: var(--ink);
  border: 1.5px dashed var(--field);
  border-radius: var(--radius-sm);
  padding: 0 5px;
  font-weight: 600;
}
.bf-promise {
  margin: 0;
  padding: 14px 16px;
  border: 1.5px solid var(--rule);
  border-left: 5px solid var(--ink);
  border-radius: 4px var(--radius) var(--radius) 4px;
  background: var(--paper);
  color: var(--ink-2);
  font-size: 0.9375rem;
}
.bf-alert {
  padding: 14px 16px;
  border: 1.5px solid var(--warn);
  border-left-width: 5px;
  border-radius: 4px var(--radius) var(--radius) 4px;
}
/* Choices draw their own row in base.css, so the two-column groups need no padding of their own. */
.bf-two-cols .choice {
  padding: 0;
  font-size: 0.9375rem;
}
.bf-two-cols .choice > input + span {
  padding: 9px 10px 9px 40px;
}
.bf-two-cols .choice > input + span::before {
  left: 11px;
}
.bf-check.bf-has-error .check input {
  outline: 0;
  border: 2.5px solid var(--bad);
}
.bf-check.bf-has-error .check input:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
.bf-under {
  font-size: 0.875rem;
}
/* The two programmes above the form: a red edge, as on the /brands hero. */
.bf-programmes {
  padding: 15px 18px 16px;
  border-left: 5px solid var(--red);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--card);
}
.bf-programmes dt {
  font-family: var(--font-display);
  font-weight: 800;
  font-stretch: 108%;
  font-size: 1.0625rem;
}
/* Thank-you: the one page where the bubble gets big (CSS only: the h1 becomes a red bubble, tail bottom left).
   Cream on red is large type only: this is 28 px and up at weight 900, four words. */
#bf-thanks > h1 {
  position: relative;
  justify-self: start;
  margin: 0 0 14px;
  padding: 0.5em 0.85em 0.52em;
  border-radius: 18px;
  background: var(--red);
  color: #fff3e2;
  font-size: clamp(28px, 3.4vw, 36px);
  font-weight: 900;
  font-stretch: 125%;
  line-height: 0.96;
  letter-spacing: -0.03em;
  text-transform: uppercase;
}
#bf-thanks > h1::after {
  content: '';
  position: absolute;
  left: 16px;
  top: calc(100% - 1px);
  width: 16px;
  height: 14px;
  background: inherit;
  clip-path: polygon(0 0, 100% 0, 6% 100%);
}
#bf-thanks > .lede {
  color: var(--ink);
}
/* The share-link box under it. */
.bf-share {
  padding: 20px;
  border: 2px solid var(--rule-strong);
  border-radius: var(--radius-lg);
  background: var(--card);
}
.bf-share label {
  font-weight: 700;
}
@media (max-width: 520px) {
  .bf-share-row {
    flex-direction: column;
  }
  .bf-share-row input[type='text'] {
    flex: 0 0 auto;
  }
}
/* Very small phones: the niche tiles take one column, so no word runs over a border. */
@media (max-width: 379px) {
  .bf-two-cols .choices {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ---------------------------------------------------------------- portals on apply (25 Nov 2026) */
/* The password step (pages A and B), its other pages (C, D, E), the closed page and the wrong-portal page.
   Same look as the form: one column, the 16 px gutter of the page, one red main button. */
.bf-form input[type='password'] {
  width: 100%;
  min-height: 44px;
  font-size: 1rem; /* 16px keeps phones from zooming in on focus */
}
.bf-step .eyebrow {
  margin-bottom: -0.4rem;
}
.bf-step h1 {
  overflow-wrap: anywhere;
}
/* "You log in with this email": the address stands out and long ones wrap instead of running off a phone. */
.bf-email-box {
  display: grid;
  gap: 0.35rem;
  padding: 14px 16px;
  background: var(--card);
  border: 1.5px solid var(--rule);
  border-left: 5px solid var(--ink);
  border-radius: 4px var(--radius) var(--radius) 4px;
  overflow-wrap: anywhere;
}
.bf-email-box p {
  margin: 0;
}
/* "The terms in short": tinted, bold heading, directly above the tick. */
.bf-terms {
  display: grid;
  gap: 0.55rem;
  padding: 14px 16px 16px;
  background: var(--paper-2);
  border-radius: var(--radius);
  font-size: 0.9375rem;
  line-height: 1.5;
}
.bf-terms h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
}
.bf-terms ul {
  margin: 0;
  padding-left: 1.15rem;
  display: grid;
  gap: 0.35rem;
}
.bf-terms p {
  margin: 0;
}
.bf-terms-links a {
  white-space: nowrap;
}
/* Review E5: list-item keeps the ▶ open/close marker (flex hid it). */
.bf-ko-terms summary {
  cursor: pointer;
  font-weight: 700;
  min-height: 44px;
  display: list-item;
  padding: 0.6rem 0;
}
.bf-ko-terms ul {
  margin-top: 0.2rem;
}
.bf-agree .check,
.bf-agree .check span {
  font-weight: 500;
}
.bf-agree .check span a {
  font-weight: 700;
}
/* Korean help lines: small, under the English, never instead of it. */
.ko-help {
  margin: -0.35rem 0 0;
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--ink-2);
}
.bf-form .ko-help {
  margin-top: -0.6rem;
}
/* The line on top of a form page when someone is logged in. */
.bf-logged-in {
  margin: 0;
  padding: 10px 14px;
  border-radius: var(--radius);
  background: var(--card);
  border: 1.5px solid var(--rule);
}
.bf-logged-in a {
  font-weight: 700;
}
/* A plain link beside a button in an action row (page D "Forgot your password?"). */
.bf-actions {
  align-items: center;
}
.bf-text-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-weight: 600;
}
.bf-actions .inline-form {
  margin: 0;
}
@media (max-width: 420px) {
  .bf-actions > .btn,
  .bf-actions > .inline-form,
  .bf-actions > .inline-form .btn {
    width: 100%;
  }
}

/* ---------------------------------------------------------------- the 4-step forms (1 Dec 2026) */
/* One step per page: a 4-part bar, the step heading, its questions, Continue. Phone first; the card keeps the
   narrow column on wide screens. Colours come from the tokens, so light and dark both follow the theme. */
.bf-stepform {
  gap: 1.15rem;
}
.bf-kicker {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--ink-3);
}
.bf-progress {
  list-style: none;
  margin: -0.35rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(var(--bf-steps, 4), minmax(0, 1fr));
  gap: 6px;
}
.bf-progress li {
  display: grid;
  align-content: start;
  gap: 6px;
  min-width: 0;
  font-size: 0.8125rem;
  line-height: 1.25;
  color: var(--ink-3);
}
.bf-progress li::before {
  content: '';
  display: block;
  height: 6px;
  border-radius: 999px;
  background: var(--rule);
}
.bf-progress li.is-done::before {
  background: var(--ink);
}
.bf-progress li[aria-current='step']::before {
  background: var(--accent);
}
.bf-progress li[aria-current='step'] {
  color: var(--ink);
  font-weight: 700;
}
/* Phones: the bar alone (the heading below says the step in words); the labels stay for screen readers. */
@media (max-width: 519px) {
  .bf-progress-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
}
.bf-form .bf-step-title {
  font-size: clamp(20px, 5.2vw, 24px);
  overflow-wrap: anywhere;
}
.bf-step-title:focus {
  outline: none;
}
.bf-step-title:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 4px;
  border-radius: 4px;
}
.bf-stepform .bf-lede {
  margin-top: -0.5rem;
  color: var(--ink-2);
}
/* Choices are full-width tap cards (48 px and up, from base.css); a radio group is one card per row. */
.bf-stepform .bf-group .choices {
  grid-template-columns: minmax(0, 1fr);
}
/* Topics: one column on the smallest phones, two from 360 px, and still two in the narrow column on desktop. */
.bf-stepform .bf-two-cols .choices {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (max-width: 359px) {
  .bf-stepform .bf-two-cols .choices {
    grid-template-columns: minmax(0, 1fr);
  }
}
.bf-stepform .bf-two-cols .choice > input + span {
  min-height: 48px;
}
/* The required tick (18 or older) is a card too, so the whole row is the target. */
.bf-stepform .bf-check:not(.bf-news) .check {
  min-height: 48px;
  align-items: center;
  padding: 10px 14px;
  border: 1.5px solid var(--field);
  border-radius: var(--radius);
  background: var(--card);
}
.bf-stepform .bf-check:not(.bf-news) .check:hover {
  border-color: var(--ink);
}
.bf-stepform .bf-check:not(.bf-news) .check:has(input:checked) {
  border-color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--ink);
  background: var(--accent-soft);
}
.bf-stepform .bf-check.bf-has-error .check {
  border-color: var(--bad);
}
.bf-stepform input[type='email'],
.bf-stepform input[type='text'],
.bf-stepform select {
  min-height: 48px;
}
/* Continue and Back. Continue comes first in the page (Enter moves on); phones: both full width, Continue on top,
   not sticky, so nothing covers a field. Wider screens: side by side, Back on the left. */
.bf-nav {
  display: grid;
  gap: 10px;
  margin-top: 0.2rem;
}
.bf-nav .btn {
  width: 100%;
  min-height: 52px;
  justify-content: center;
}
@media (min-width: 520px) {
  .bf-nav {
    display: flex;
    flex-direction: row-reverse;
    align-items: stretch;
    gap: 12px;
  }
  .bf-nav .bf-next {
    flex: 1 1 auto;
    width: auto;
  }
  .bf-nav .bf-back {
    flex: 0 0 auto;
    width: auto;
    min-width: 8.5rem;
  }
}
.bf-nav .btn[aria-busy='true'] {
  cursor: progress;
}
.bf-stepform .bf-under {
  margin-top: -0.4rem;
}
/* The password step (step 4) is the same card as steps 1 to 3: kicker, bar and step heading at its top. The line on
   translated pages that the account pages are in English sits under the lede. */
.bf-in-english {
  margin-top: -0.4rem;
}
.bf-step .bf-email-box {
  max-width: 34rem;
}
/* A fresh step 1 after a reload or after browser Back from step 4 (shown by public/js/beta-steps.js). */
.bf-draft-note {
  margin: 0;
  padding: 10px 14px;
  border: 1.5px solid var(--rule);
  border-left: 5px solid var(--ink);
  border-radius: 4px var(--radius) var(--radius) 4px;
  background: var(--paper);
  font-size: 0.9375rem;
}
.bf-draft-note[hidden] {
  display: none;
}
/* Japanese has no spaces: headings and question labels break between phrases where the browser can tell them
   apart (auto-phrase), and otherwise keep their lines even, so a line never ends with one stray character. */
:lang(ja) :is(.bf-page h1, .bf-form h2, .bf-form h3, .bf-step-title) {
  text-wrap: balance;
}
:lang(ja) :is(.bf-form legend, .bf-form .field > label) {
  text-wrap: pretty;
}
@supports (word-break: auto-phrase) {
  :lang(ja) :is(.bf-page h1, .bf-form h2, .bf-form h3, .bf-step-title, .bf-form legend, .bf-form .field > label) {
    word-break: auto-phrase;
    /* A long katakana run counts as one phrase; without this it widens the page past a phone screen. */
    overflow-wrap: anywhere;
  }
}
@media (prefers-reduced-motion: no-preference) {
  .bf-progress li::before {
    transition: background-color 0.2s ease;
  }
}
