/* ============================================================================
   ONBOARDING — STRUCTURE (shared, synced into each concept)
   ----------------------------------------------------------------------------
   Layout and the onboarding components. No brand in here: every colour,
   radius and surface is a token the concept provides.

   The skin contract. A concept's apply page loads, in order:
     1. its foundation.css, which must define the foundation names used here:
        --u --p --gutter --nav-h --space-1…16 --type-* --control-height
        --ease --dur-1 --dur-2, and the primitives .btn .field .t-*
     2. this file
     3. its skin (apply.css), which sets the --ob-* tokens below and styles
        the brand bar and the companion panel
   Defaults below fall back to the foundation's own role names (Topper's and
   Financial Edge's share them); a skin overrides whatever differs.
   ========================================================================== */

:root {
  --ob-font:           var(--sans, system-ui, sans-serif);
  --ob-ink:            var(--ink, #111);
  --ob-ink-2:          var(--ink-2, #555);
  --ob-surface:        var(--surface, #fff);
  --ob-line:           var(--line, rgba(0, 0, 0, .12));
  --ob-field-border:   var(--field-border, rgba(0, 0, 0, .28));
  --ob-accent:         var(--accent, #2459F0);
  --ob-accent-text:    var(--accent-text, var(--ob-accent));
  --ob-accent-wash:    var(--accent-wash, rgba(0, 0, 0, .06));
  --ob-on-accent:      var(--on-accent, #fff);
  --ob-selected-bg:    color-mix(in srgb, var(--ob-accent) 9%, var(--ob-surface));
  --ob-danger:         var(--danger, #B42318);
  --ob-focus:          var(--focus, var(--ob-accent));
  --ob-progress:       var(--ob-accent);
  --ob-radius-card:    var(--radius-panel, 20px);
  --ob-radius-control: var(--radius-control, 10px);
  --ob-card-bg:        var(--ob-surface);
  --ob-card-edge:      0 0 0 1px var(--ob-line);
  --ob-card-shadow:    0 30px 60px -36px rgba(0, 0, 0, .3);
  --ob-card-blur:      0px;
  --ob-card-pad:       max(22px, calc(var(--u) * 2.5));
  --ob-form-width:     max(480px, calc(var(--u) * 35));  /* 560 at the design size */

  /* A form's scale, a level below the landing pages': the questions are
     the point, not the headline. */
  --ob-type-title:     max(26px, calc(var(--u) * 2));      /* 32 */
  --ob-type-heading:   max(18px, calc(var(--u) * 1.25));   /* 20 */
  --ob-type-lead:      var(--type-body);                   /* 17 */
}

/* The landing pages grow up to 1.5x on big screens. A form shouldn't: the
   unit stops just past the design size. Phones keep the foundation's own. */
@media (min-width: 768px) {
  :root { --u: clamp(12px, min(100vw / 90, 100vh / 50), 17px); }
}

/* ================================================================= page == */
.ob {
  min-height: 100vh; min-height: 100svh;
  display: grid; grid-template-rows: auto 1fr;
  font-family: var(--ob-font); color: var(--ob-ink);
}

.ob-top {
  position: relative; z-index: 3;
  width: min(100% - 2 * var(--gutter), var(--container, 1440px)); margin-inline: auto;
  min-height: var(--nav-h);
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: var(--space-6);
}
.ob-top__end { justify-self: end; }
.ob-leave { font-size: var(--type-small); font-weight: 700; color: var(--ob-ink-2); }
.ob-leave:hover { color: var(--ob-ink); }

/* one progress signal: where you are and roughly how long is left */
.ob-progress { justify-self: center; width: min(100%, calc(var(--u) * 30)); }
.ob-progress[hidden] { display: none; }
.ob-progress__text {
  display: flex; justify-content: space-between; gap: var(--space-2);
  font-size: var(--type-small); font-weight: 700; color: var(--ob-ink-2); line-height: 1.3;
}
.ob-progress__text span:first-child { color: var(--ob-ink); }
.ob-progress__bar {
  height: calc(6 * var(--p)); margin-top: calc(8 * var(--p)); border-radius: 999px; overflow: hidden;
  background: color-mix(in srgb, var(--ob-accent) 14%, transparent);
}
.ob-progress__bar i {
  display: block; height: 100%; border-radius: inherit; background: var(--ob-progress);
  transition: width calc(var(--dur-2) * 1.5) var(--ease);
}

.ob-main {
  /* one column: the question, front and centre, with the concept's
     companion as a slim strip above it */
  width: min(100% - 2 * var(--gutter), var(--ob-form-width)); margin-inline: auto;
  display: grid; align-content: start;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "side" "card";
  row-gap: var(--space-2);
  padding-block: var(--space-4) var(--space-16);
}
.ob-side { grid-area: side; position: sticky; top: var(--space-1); z-index: 4; min-width: 0; }

/* ================================================================= card == */
.ob-card {
  grid-area: card; min-width: 0;
  padding: var(--ob-card-pad);
  border-radius: var(--ob-radius-card);
  background: var(--ob-card-bg);
  -webkit-backdrop-filter: blur(var(--ob-card-blur)) saturate(1.3);
  backdrop-filter: blur(var(--ob-card-blur)) saturate(1.3);
  box-shadow: var(--ob-card-edge), var(--ob-card-shadow);
}
.ob-card.is-in { animation: ob-in var(--dur-2) var(--ease) both; }
@keyframes ob-in { from { opacity: 0; transform: translateY(14px); } }

.ob-head { display: grid; gap: var(--space-2); }
/* a brand mark above the title (Zelle) */
.ob-head__logo { display: block; justify-self: start; width: auto; height: calc(34 * var(--p)); border-radius: calc(6 * var(--p)); }
.ob-back {
  justify-self: start; display: inline-flex; align-items: center; gap: calc(6 * var(--p));
  min-height: 44px; margin: calc(-10 * var(--p)) 0 0 calc(-8 * var(--p)); padding: 0 calc(8 * var(--p));
  border: 0; border-radius: 999px; background: none; color: var(--ob-ink-2); cursor: pointer;
  font: 700 var(--type-small)/1 var(--ob-font);
}
.ob-back:hover { color: var(--ob-ink); background: var(--ob-accent-wash); }
.ob-back .ico { width: 1.1em; height: 1.1em; }
.ob-title {
  font-size: var(--ob-type-title); line-height: 1.12; font-weight: 800; letter-spacing: -.025em;
  text-wrap: balance; outline: none;
}
.ob-intro { font-size: var(--ob-type-lead); line-height: 1.5; color: var(--ob-ink-2); text-wrap: pretty; max-width: 34em; }
.ob-intro:empty, .ob-body:empty, .ob-after:empty { display: none; }
.ob-intro p + p { margin-top: .6em; }
.ob-body { margin-top: var(--space-4); }
.ob-after { margin-top: var(--space-4); }

.ob-form > .ob-grid, .ob-form > .ob-group { margin-top: var(--space-4); }
.ob-group { margin: 0; padding: 0; border: 0; min-width: 0; }
.ob-group + .ob-group { margin-top: var(--space-6); padding-top: var(--space-6); border-top: 1px solid var(--ob-line); }
.ob-group__t {
  /* floated, so the group's top rule runs above the title, not through it */
  float: left; width: 100%;
  padding: 0; margin-bottom: var(--space-3);
  font-size: var(--ob-type-heading); font-weight: 800; letter-spacing: -.015em; line-height: 1.2;
}

.ob-group__t + * { clear: both; }
.ob-grid {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--space-4) var(--space-2);
}
.ob-field { grid-column: span var(--span, 12); min-width: 0; margin: 0; padding: 0; border: 0; }
.ob-field[hidden] { display: none; }

.ob-label {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 .5em; padding: 0;
  margin-bottom: calc(8 * var(--p));
  font-size: var(--type-small); font-weight: 700; line-height: 1.35; color: var(--ob-ink);
}
.ob-optional { font-weight: 600; color: var(--ob-ink-2); }
.ob-help { margin-top: calc(8 * var(--p)); font-size: var(--type-small); font-weight: 500; line-height: 1.45; color: var(--ob-ink-2); }
.ob-help--lead { margin: calc(-2 * var(--p)) 0 calc(12 * var(--p)); }
.ob-error { margin-top: calc(8 * var(--p)); font-size: var(--type-small); font-weight: 700; line-height: 1.45; color: var(--ob-danger); }
.ob-error:empty { display: none; }
.ob-field.is-invalid .field { border-color: var(--ob-danger); }
.ob-fine { margin-top: var(--space-4); font-size: var(--type-small); font-weight: 500; line-height: 1.5; color: var(--ob-ink-2); max-width: 40em; }

/* ---- text inputs --------------------------------------------------------- */
.ob-control { position: relative; }
.ob-input { font-variant-numeric: tabular-nums; }
.ob-input--secret { padding-right: calc(76 * var(--p)); }
.ob-input.is-masked { -webkit-text-security: disc; text-security: disc; letter-spacing: .12em; }
.ob-reveal {
  position: absolute; right: calc(6 * var(--p)); top: 50%; translate: 0 -50%;
  min-width: 44px; min-height: 40px; padding: 0 calc(12 * var(--p));
  border: 0; border-radius: 999px; background: transparent; cursor: pointer;
  font: 700 var(--type-small)/1 var(--ob-font); color: var(--ob-accent-text);
}
.ob-reveal:hover { background: var(--ob-accent-wash); }
.ob-input--code {
  font-size: var(--ob-type-heading); font-weight: 800; letter-spacing: .42em; padding-left: calc(18 * var(--p));
}

/* ---- select -------------------------------------------------------------- */
.ob-control--select { position: relative; }
.ob-select { appearance: none; -webkit-appearance: none; padding-right: calc(44 * var(--p)); cursor: pointer; }
.ob-select__chev {
  position: absolute; right: calc(14 * var(--p)); top: 50%; translate: 0 -50%; pointer-events: none;
  width: calc(18 * var(--p)); height: calc(18 * var(--p)); color: var(--ob-ink-2);
}

/* ---- checkbox ------------------------------------------------------------ */
.ob-check { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: calc(14 * var(--p)); align-items: start; cursor: pointer; }
.ob-check input, .ob-toggle input, .ob-choice input, .ob-chip input {
  position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none;
}
.ob-check__box {
  width: calc(26 * var(--p)); height: calc(26 * var(--p)); margin-top: calc(1 * var(--p));
  display: grid; place-items: center; flex: none;
  border: 1.5px solid var(--ob-field-border); border-radius: calc(7 * var(--p));
  background: var(--ob-surface); color: transparent;
  transition: background var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease), color var(--dur-1) var(--ease);
}
.ob-check__box .ico { width: calc(16 * var(--p)); height: calc(16 * var(--p)); }
.ob-check input:checked + .ob-check__box { background: var(--ob-accent); border-color: var(--ob-accent); color: var(--ob-on-accent); }
.ob-check input:focus-visible + .ob-check__box { outline: 3px solid var(--ob-focus); outline-offset: 2px; }
.ob-field.is-invalid .ob-check__box { border-color: var(--ob-danger); }
.ob-check__text { display: grid; gap: calc(4 * var(--p)); }
.ob-check__t { font-size: var(--type-body); font-weight: 700; line-height: 1.4; }
.ob-check__s { font-size: var(--type-small); font-weight: 500; line-height: 1.5; color: var(--ob-ink-2); }
.ob-field--check + .ob-field--check { margin-top: calc(-4 * var(--p)); }
.ob-field--check .ob-error, .ob-field--check .ob-more { margin-left: calc(40 * var(--p)); }

.ob-more { margin-top: calc(8 * var(--p)); font-size: var(--type-small); color: var(--ob-ink-2); }
.ob-more summary {
  display: inline-flex; align-items: center; min-height: 32px; cursor: pointer;
  font-weight: 700; color: var(--ob-accent-text); list-style: none;
}
.ob-more summary::-webkit-details-marker { display: none; }
.ob-more summary::after { content: '+'; margin-left: .4em; font-weight: 800; }
.ob-more[open] summary::after { content: '−'; }
.ob-more p { margin-top: calc(6 * var(--p)); max-width: 40em; line-height: 1.55; }

/* ---- toggle -------------------------------------------------------------- */
.ob-toggle { display: inline-flex; align-items: center; gap: calc(14 * var(--p)); min-height: 44px; cursor: pointer; }
.ob-toggle__track {
  position: relative; width: calc(46 * var(--p)); height: calc(28 * var(--p)); flex: none; border-radius: 999px;
  background: color-mix(in srgb, var(--ob-ink) 22%, transparent);
  transition: background var(--dur-1) var(--ease);
}
.ob-toggle__thumb {
  position: absolute; left: calc(3 * var(--p)); top: calc(3 * var(--p));
  width: calc(22 * var(--p)); height: calc(22 * var(--p)); border-radius: 50%; background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .2);
  transition: transform var(--dur-1) var(--ease);
}
.ob-toggle input:checked + .ob-toggle__track { background: var(--ob-accent); }
.ob-toggle input:checked + .ob-toggle__track .ob-toggle__thumb { transform: translateX(calc(18 * var(--p))); }
.ob-toggle input:focus-visible + .ob-toggle__track { outline: 3px solid var(--ob-focus); outline-offset: 2px; }
.ob-toggle__t { font-size: var(--type-body); font-weight: 700; }

/* ---- choice cards (single or multiple) ----------------------------------- */
.ob-choices { display: grid; gap: calc(10 * var(--p)); }
.ob-choice {
  position: relative;
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: calc(14 * var(--p));
  min-height: var(--control-height); padding: calc(14 * var(--p)) calc(16 * var(--p));
  border: 1.5px solid var(--ob-field-border); border-radius: var(--ob-radius-control);
  background: var(--ob-surface); cursor: pointer;
  transition: border-color var(--dur-1) var(--ease), background var(--dur-1) var(--ease), box-shadow var(--dur-1) var(--ease);
}
.ob-choice:hover { border-color: var(--ob-accent); }
.ob-choice:has(input:checked) { border-color: var(--ob-accent); background: var(--ob-selected-bg); box-shadow: inset 0 0 0 1px var(--ob-accent); }
.ob-choice:has(input:focus-visible) { outline: 3px solid var(--ob-focus); outline-offset: 2px; }
.ob-choice__mark {
  width: calc(22 * var(--p)); height: calc(22 * var(--p)); flex: none;
  display: grid; place-items: center; color: transparent;
  border: 1.5px solid var(--ob-field-border); border-radius: 50%; background: var(--ob-surface);
  transition: background var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease), color var(--dur-1) var(--ease);
}
.ob-field--multi .ob-choice__mark { border-radius: calc(6 * var(--p)); }
.ob-choice__mark .ico { width: calc(14 * var(--p)); height: calc(14 * var(--p)); }
.ob-choice:has(input:checked) .ob-choice__mark { background: var(--ob-accent); border-color: var(--ob-accent); color: var(--ob-on-accent); }
.ob-choice__text { display: grid; gap: calc(2 * var(--p)); min-width: 0; }
/* a payment mark (Apple Pay, Google Pay) between the mark and the words */
.ob-choice:has(.ob-choice__logo) { grid-template-columns: auto auto minmax(0, 1fr) auto; }
.ob-choice__logo { display: block; flex: none; width: auto; height: calc(28 * var(--p)); }
.ob-choice__t { font-size: var(--type-body); font-weight: 700; line-height: 1.35; }
.ob-choice__s { font-size: var(--type-small); font-weight: 500; line-height: 1.45; color: var(--ob-ink-2); }
.ob-note { font-size: var(--type-small); font-weight: 800; color: var(--ob-accent-text); white-space: nowrap; }
.ob-note[hidden] { display: none; }
.ob-field.is-invalid .ob-choice { border-color: color-mix(in srgb, var(--ob-danger) 60%, var(--ob-field-border)); }

/* ---- chips --------------------------------------------------------------- */
.ob-chips, .ob-amounts { display: flex; flex-wrap: wrap; gap: calc(10 * var(--p)); }
.ob-chip {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: 44px; padding: calc(8 * var(--p)) calc(18 * var(--p));
  border: 1.5px solid var(--ob-field-border); border-radius: 999px;
  background: var(--ob-surface); color: var(--ob-ink); cursor: pointer;
  font: 700 var(--type-body)/1.2 var(--ob-font);
  transition: border-color var(--dur-1) var(--ease), background var(--dur-1) var(--ease), color var(--dur-1) var(--ease);
}
.ob-chip:hover { border-color: var(--ob-accent); }
.ob-chip:has(input:checked), .ob-chip[aria-pressed="true"] {
  border-color: var(--ob-accent); background: var(--ob-accent); color: var(--ob-on-accent);
}
.ob-chip:has(input:checked) .ob-note, .ob-chip[aria-pressed="true"] .ob-note { color: inherit; }
.ob-chip:has(input:focus-visible) { outline: 3px solid var(--ob-focus); outline-offset: 2px; }
.ob-chip .ob-note { font-size: var(--type-small); }
.ob-chip-notes:not(:has(.ob-note:not([hidden]))) { display: none; }
.ob-chip-notes { margin-top: calc(8 * var(--p)); }
.ob-chip-notes .ob-note { display: block; white-space: normal; }
.ob-field.is-invalid .ob-chip { border-color: color-mix(in srgb, var(--ob-danger) 60%, var(--ob-field-border)); }

.ob-control--money { position: relative; margin-top: calc(12 * var(--p)); max-width: calc(260 * var(--p)); }
.ob-prefix {
  position: absolute; left: calc(16 * var(--p)); top: 50%; translate: 0 -50%;
  font-weight: 700; color: var(--ob-ink-2); pointer-events: none;
}
.ob-input--money { padding-left: calc(32 * var(--p)); }

.ob-linkbtn {
  display: inline-flex; align-items: center; gap: calc(6 * var(--p));
  min-height: 40px; padding: 0 calc(10 * var(--p)); margin-left: calc(-10 * var(--p));
  border: 0; border-radius: 999px; background: none; cursor: pointer;
  font: 700 var(--type-small)/1 var(--ob-font); color: var(--ob-accent-text);
}
.ob-linkbtn:hover { background: var(--ob-accent-wash); }
.ob-linkbtn .ico { width: 1.05em; height: 1.05em; }

/* ---- actions ------------------------------------------------------------- */
.ob-actions { display: flex; align-items: center; gap: var(--space-3); margin-top: var(--space-4); }
.ob-submit.is-busy { opacity: .75; cursor: progress; }
.ob-submit.is-busy .btn__arrow { display: none; }

/* ================================================================= done == */
.ob-done { display: grid; gap: var(--space-6); }
.ob-notify { display: grid; gap: calc(10 * var(--p)); padding-top: var(--space-6); border-top: 1px solid var(--ob-line); }
.ob-notify__t { font-size: var(--ob-type-heading); font-weight: 800; letter-spacing: -.015em; line-height: 1.25; }
.ob-notify__s { color: var(--ob-ink-2); }
.ob-notify__row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin-top: calc(6 * var(--p)); }
.ob-notify__row .field { flex: 1 1 16em; }
.ob-notify.is-sent { grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: var(--space-2); }
.ob-notify__ico {
  width: calc(36 * var(--p)); height: calc(36 * var(--p)); padding: calc(8 * var(--p)); border-radius: 50%;
  background: var(--ob-accent); color: var(--ob-on-accent);
}

/* ================================================================ phones == */
@media (max-width: 767px) {
  .ob-top { grid-template-columns: auto minmax(0, 1fr); gap: var(--space-3); }
  .ob-top__end { display: none; }
  .ob-progress { justify-self: end; width: min(100%, 220px); }
  .ob-progress__text span:last-child { display: none; }
  .ob-main { padding-block: 0 var(--space-12); row-gap: 8px; }
  /* the card bleeds 6px past the column; the strip follows it, so their
     edges line up */
  .ob-side { top: 0; margin-inline: calc(-1 * var(--gutter)); padding: 8px calc(var(--gutter) - 6px); }
  .ob-card { --ob-card-pad: 22px; margin-inline: calc(-6px); }
  .ob-field { grid-column: span var(--span-m, 12); }
  .ob-grid { gap: 20px 12px; }
  .ob-actions .btn { width: 100%; }
  .ob-notify__row .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .ob-card.is-in { animation: none; }
  .ob-progress__bar i { transition: none; }
}

/* ============================================================ prototype == */
/* The internal menu. System type, neutral colours, the same everywhere. */
.pv { position: fixed; left: 12px; bottom: 12px; z-index: 300; font: 500 13px/1.4 system-ui, -apple-system, 'Segoe UI', sans-serif; color: #1b1b1f; }
.pv__toggle {
  display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 14px;
  border: 0; border-radius: 999px; cursor: pointer;
  font: 700 12px/1 system-ui, -apple-system, sans-serif; letter-spacing: .02em; color: #1b1b1f;
  background: rgba(255, 255, 255, .92); box-shadow: 0 0 0 1px rgba(0, 0, 0, .1), 0 8px 20px -8px rgba(0, 0, 0, .3);
}
.pv__dot { width: 8px; height: 8px; border-radius: 50%; background: #F59E0B; }
.pv__panel {
  position: absolute; left: 0; bottom: 46px; width: min(340px, calc(100vw - 24px));
  max-height: min(78vh, 640px); overflow: auto; padding: 14px;
  border-radius: 14px; background: #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, .08), 0 24px 60px -20px rgba(0, 0, 0, .4);
}
.pv__panel[hidden] { display: none; }
.pv__head { display: grid; gap: 2px; padding-bottom: 10px; border-bottom: 1px solid #eee; }
.pv__head span { color: #6b6b73; }
.pv__sec { padding-top: 12px; }
.pv__label { margin-bottom: 6px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #8a8a93; }
.pv__steps { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.pv__step {
  display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 8px; width: 100%;
  padding: 6px 8px; border: 0; border-radius: 8px; background: none; text-align: left; cursor: pointer;
  font: inherit; color: inherit;
}
.pv__step:hover { background: #f3f3f6; }
.pv__step.is-on { background: #1b1b1f; color: #fff; }
.pv__step code { font: 600 12px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; opacity: .7; }
.pv__step span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pv__row { display: flex; flex-wrap: wrap; gap: 6px; }
.pv__btn {
  display: inline-flex; align-items: center; min-height: 30px; padding: 0 11px;
  border: 1px solid #dcdce2; border-radius: 999px; background: #fff; cursor: pointer;
  font: 600 12px/1 system-ui, -apple-system, sans-serif; color: #1b1b1f; text-decoration: none;
}
.pv__btn:hover { border-color: #1b1b1f; color: #1b1b1f; }
.pv__btn.is-on { background: #1b1b1f; border-color: #1b1b1f; color: #fff; }
.pv__btn.is-off { opacity: .4; cursor: default; }
.pv__hint { color: #6b6b73; }
