/* IBM Plex — self-hosted so the flow renders identically on Windows and Android.
   The previous "Avenir Next" stack only resolved on macOS. SIL OFL 1.1. */
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/ui/fonts/ibm-plex-sans-400.woff2") format("woff2");
}

@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/ui/fonts/ibm-plex-sans-600.woff2") format("woff2");
}

@font-face {
  font-family: "IBM Plex Sans Condensed";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/ui/fonts/ibm-plex-sans-condensed-600.woff2") format("woff2");
}

@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/ui/fonts/ibm-plex-mono-400.woff2") format("woff2");
}

:root {
  color-scheme: light;

  /* Type roles. Every surface reads these three, never a raw family name. */
  --font-ui: "IBM Plex Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-label: "IBM Plex Sans Condensed", "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --ink: #003041;
  --accent-text: #506f90;
  --link: #2b759e;
  --muted: #5a7079;
  --line: #dce4e8;
  --table-line: #e5e9ef;
  --surface: #f5f7fa;
  --surface-soft: #f1f3f7;
  --element: #f1f3f7;
  --element-tint: #d5efeb;
  --primary: #003041;
  --primary-hover: #001f2b;
  --pink: #f10357;
  --pink-hover: #c40246;
  --blue: #2eb4ff;
  --green: #00a886;
  --amber: #b26b00;
  --alert-bg: #fef2f6;
  --alert-stroke: #fccdde;
  --white: #ffffff;
  --shadow: 0 24px 70px rgba(0, 48, 65, 0.11);

  /* Quiet Ledger surfaces — the canonical set the hosted pages share. */
  --ground: #f7f9fa;
  --field: #fbfcfe;
  --rail: #002733;
  --rail-muted: #7fa0ab;
  --rail-line: #0c3f4e;
  --mint: #e8f4f1;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-ui);
  background:
    radial-gradient(circle at top left, rgba(213, 239, 235, 0.75), transparent 360px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.8), rgba(245, 247, 250, 0.95)),
    var(--surface);
  color: var(--ink);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.app-shell {
  display: flex;
  justify-content: center;
  min-height: 100vh;
}

.workspace {
  align-self: start;
  margin: 0 auto;
  max-width: 820px;
  padding: 56px 34px;
  width: 100%;
}

.hosted-flow {
  margin: 0 auto;
  max-width: 640px;
  padding: 56px 24px;
}

.hosted-flow-panel {
  margin: 0;
}

.toolbar {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: space-between;
  margin-bottom: 16px;
}

.session-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.status-pill {
  border: 1px solid var(--table-line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--muted);
  display: inline-flex;
  font-size: 13px;
  gap: 6px;
  min-height: 34px;
  padding: 8px 12px;
}

.status-pill strong {
  color: var(--ink);
  font-weight: 700;
}

.progress-track {
  background: var(--table-line);
  border-radius: 999px;
  height: 4px;
  margin: 0 0 18px;
  overflow: hidden;
}

#progressBar {
  background: var(--pink);
  border-radius: inherit;
  display: block;
  height: 100%;
  transition: width 180ms ease;
  width: 16.666%;
}

section {
  display: none;
}

section.active {
  display: block;
  background: var(--white);
  border: 1px solid var(--table-line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 42px;
}

.section-heading {
  border-bottom: 1px solid var(--table-line);
  margin: -2px 0 28px;
  padding-bottom: 24px;
}

.step-eyebrow {
  color: var(--pink);
  display: block;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  margin-bottom: 10px;
  text-transform: uppercase;
}

h2 {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.15;
  margin: 0;
}

.section-heading p {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
  margin: 12px 0 0;
  max-width: 560px;
}

form {
  display: grid;
  gap: 20px;
}

form.compact {
  border-top: 1px solid var(--table-line);
  margin-top: 26px;
  max-width: 520px;
  padding-top: 26px;
}

.grid {
  align-items: start;
  display: grid;
  gap: 20px 18px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.span-2 {
  grid-column: 1 / -1;
}

/* Company number onwards sit in a second grid, revealed once a company has
   been chosen. Two grids stacked carry no gap between them, so the company
   number label landed flush against the legal name field above it. */
[data-business-after-company-selection] {
  margin-top: 20px;
}

label {
  display: grid;
  gap: 7px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}

.field-guidance {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.4;
}

.completion-message p {
  margin: 0;
}

.completion-message p + p {
  margin-top: 12px;
}

input,
textarea,
select {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  min-height: 48px;
  outline: none;
  padding: 12px 13px;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
  width: 100%;
}

/* iOS gives date controls an intrinsic width and centres their localised value.
   Constrain them to the same grid track as every other person field. */
input[type="date"] {
  -webkit-appearance: none;
  appearance: none;
  min-width: 0;
  text-align: left;
}

input[type="date"]::-webkit-date-and-time-value {
  text-align: left;
}

input::placeholder,
textarea::placeholder {
  color: var(--muted);
}

input:focus,
textarea:focus,
select:focus {
  background: var(--white);
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(46, 180, 255, 0.18);
}

/* A field the journey has taken out of the merchant's hands has to read that
   way. Left looking live, a disabled field's placeholder is mistaken for a
   value that has been filled in for them. */
input:disabled:not([type="checkbox"]):not([type="radio"]):not(.code-input__field),
textarea:disabled,
select:disabled {
  background: var(--element);
  color: var(--muted);
  cursor: not-allowed;
}

textarea {
  min-height: 96px;
  resize: vertical;
}

.checkbox-row {
  align-items: center;
  display: flex;
  gap: 8px;
  min-height: 42px;
}

.checkbox-row input {
  accent-color: var(--link);
  min-height: auto;
  width: auto;
}

/* A checkbox sharing a grid row with a labelled field starts level with that
   field's label, which leaves it floating above the control it qualifies.
   Sink it onto the control instead. */
.checkbox-row.field-aligned {
  align-self: end;
  min-height: 48px;
}

/* ------------------------------------------------------------------
   Verification code entry. The input underneath keeps the value; these
   boxes show it. See code-input.js.
   ------------------------------------------------------------------ */
.code-input {
  max-width: 328px;
  position: relative;
}

.code-input .code-input__field {
  background: none;
  border: 0;
  border-radius: 0;
  caret-color: transparent;
  color: transparent;
  height: 100%;
  inset: 0;
  min-height: 0;
  padding: 0;
  position: absolute;
  width: 100%;
  z-index: 1;
}

.code-input .code-input__field:focus {
  background: none;
  border: 0;
  box-shadow: none;
}

.code-input .code-input__field::selection {
  background: none;
}

.code-input__cells {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(var(--code-input-length, 6), minmax(0, 1fr));
}

.code-input__cell {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  display: flex;
  font-family: var(--font-mono);
  font-size: 19px;
  justify-content: center;
  min-height: 48px;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

.code-input:focus-within .code-input__cell[data-active] {
  background: var(--white);
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(46, 180, 255, 0.18);
}

.code-input .code-input__field:disabled ~ .code-input__cells .code-input__cell {
  opacity: 0.55;
}

.hint {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.45;
}

.inline-status {
  align-items: center;
  color: var(--muted);
  display: flex;
  font-size: 14px;
  font-weight: 600;
  gap: 10px;
  line-height: 1.45;
  margin-top: 16px;
}

.spinner {
  animation: spin 850ms linear infinite;
  border: 3px solid var(--table-line);
  border-radius: 999px;
  border-top-color: var(--pink);
  display: inline-block;
  flex: 0 0 auto;
  height: 22px;
  width: 22px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.subsection {
  border-top: 1px solid var(--table-line);
  display: grid;
  gap: 16px;
  padding-top: 20px;
}

fieldset.subsection {
  border-bottom: 0;
  border-left: 0;
  border-right: 0;
  margin: 0;
  min-width: 0;
  padding-left: 0;
  padding-right: 0;
}

.subsection h3 {
  font-size: 17px;
  margin: 0;
}

.option-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.option-grid .checkbox-row {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
}

.people-sections,
.people-list {
  display: grid;
  gap: 12px;
}

.people-section,
.person-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  padding: 14px;
}

.people-section.complete {
  background: var(--element-tint);
  border-color: rgba(0, 168, 134, 0.3);
}

.people-section strong {
  font-size: 14px;
}

.people-section span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.person-card {
  background: var(--white);
  margin-top: 4px;
}

.person-card-header {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.compact-button {
  min-height: 36px;
  padding: 8px 12px;
}

.company-search-results {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 16px 44px rgba(0, 48, 65, 0.12);
  display: grid;
  margin-top: -2px;
  overflow: hidden;
}

.company-search-result {
  background: var(--white);
  border: 0;
  border-bottom: 1px solid var(--table-line);
  border-radius: 0;
  color: var(--ink);
  display: grid;
  gap: 3px;
  justify-items: start;
  min-height: 0;
  padding: 12px 14px;
  text-align: left;
}

.company-search-result:last-child {
  border-bottom: 0;
}

.company-search-result span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.company-search-result:hover {
  background: var(--surface-soft);
  transform: none;
}

button,
.button-link {
  align-items: center;
  background: var(--primary);
  border: 0;
  border-radius: 6px;
  color: var(--white);
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-weight: 700;
  justify-content: center;
  min-height: 46px;
  padding: 12px 18px;
  text-decoration: none;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

button:focus-visible,
.button-link:focus-visible {
  box-shadow: 0 0 0 3px rgba(46, 180, 255, 0.25);
  outline: none;
}

button.secondary {
  background: var(--white);
  border: 1px solid var(--line);
  color: var(--ink);
}

.button-link.secondary-link {
  background: var(--white);
  border: 1px solid var(--line);
  color: var(--ink);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
  transform: none;
}

button:hover,
.button-link:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

button.secondary:hover {
  background: var(--surface-soft);
  border-color: var(--accent-text);
}

.button-link.secondary-link:hover {
  background: var(--surface-soft);
  border-color: var(--accent-text);
}

button:disabled:hover {
  transform: none;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
}

.message {
  background: var(--element-tint);
  border: 1px solid rgba(0, 168, 134, 0.24);
  border-radius: 8px;
  color: var(--ink);
  margin-bottom: 16px;
  padding: 12px 14px;
}

.message.error {
  background: var(--alert-bg);
  border-color: var(--alert-stroke);
  color: var(--pink-hover);
}

.message.success {
  background: var(--element-tint);
  border-color: rgba(0, 168, 134, 0.34);
  color: var(--green);
  font-weight: 700;
}

.requirements-panel {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--table-line);
  border-radius: 10px;
  box-shadow: 0 12px 36px rgba(0, 48, 65, 0.07);
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
  padding: 14px;
}

.requirements-panel.ready {
  border-color: rgba(0, 168, 134, 0.28);
}

.requirements-header {
  align-items: start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.requirements-header strong {
  display: block;
  font-size: 14px;
}

.requirements-header span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  line-height: 1.45;
  margin-top: 2px;
}

.requirements-count {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 9px;
}

.requirements-list {
  display: grid;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.requirements-list li {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  display: grid;
  gap: 3px;
  padding: 10px 11px;
}

.requirements-list strong {
  font-size: 13px;
}

.requirements-list span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.processor-requirements-panel {
  border-top: 1px solid var(--table-line);
  display: grid;
  gap: 14px;
  margin-top: 22px;
  padding-top: 20px;
}

.processor-requirements-list {
  display: grid;
  gap: 12px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.processor-requirements-list li {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  padding: 14px;
}

.processor-requirements-list li > span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.processor-requirement-heading {
  align-items: start;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.processor-requirement-heading strong {
  font-size: 14px;
}

.provider-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.provider-tags span {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  padding: 4px 8px;
}

.processor-requirement-action,
.terms-acceptance {
  display: grid;
  gap: 10px;
}

.terms-acceptance {
  background: var(--white);
  border: 1px solid var(--table-line);
  border-radius: 8px;
  padding: 12px;
}

.terms-acceptance a {
  color: var(--link);
  font-size: 13px;
  font-weight: 700;
}

/* ============================================================
   SWP-HOSTED FOLLOW-UP FORM
   .follow-up-fields had no styling at all, so every field was a bare block
   label: `label { display: grid }` plus `input { width: 100% }` gave a
   confirmation checkbox a full-width box on a row of its own, under its text,
   and put day, month and year on three separate lines.
   ============================================================ */
.follow-up-fields {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

/* A confirmation and a grouped date are about the whole answer, not one column
   of it. */
.follow-up-fields > .follow-up-confirm,
.follow-up-fields > .follow-up-group {
  grid-column: 1 / -1;
}

.follow-up-field {
  align-content: start;
  display: grid;
  gap: 6px;
}

.follow-up-field-label {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
}

.follow-up-group {
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  margin: 0;
  min-width: 0;
  padding: 14px 16px 16px;
}

.follow-up-group legend {
  font-size: 13px;
  font-weight: 700;
  padding: 0 6px;
}

/* Three parts of one answer stay on one line at every width: they are short
   enough that stacking them only makes the form longer. */
.follow-up-date {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.follow-up-date .follow-up-field-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.follow-up-confirm {
  margin-top: 2px;
}

.hidden {
  display: none;
}

.field-hint {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

/* Single breakpoint across every hosted surface. This was 760 here, 980 and 620
   in hosted-onboarding.css, and 560 in account-update.css, so the two pages
   reflowed at different widths. */
@media (max-width: 900px) {
  .grid {
    grid-template-columns: 1fr;
  }

  .option-grid {
    grid-template-columns: 1fr;
  }

  .workspace {
    max-width: 100%;
    padding: 24px 18px;
  }

  .progress-track,
  .step-eyebrow {
    display: none;
  }

  section.active {
    padding: 28px 22px;
  }

  .span-2 {
    grid-column: auto;
  }

  h2 {
    font-size: 25px;
  }
}
body.onboarding-booting .app-shell {
  visibility: hidden;
}

.onboarding-boot {
  align-items: center;
  background: #f5f7fa;
  color: #003041;
  display: none;
  font: 600 16px/1.5 "IBM Plex Sans", Arial, sans-serif;
  inset: 0;
  justify-content: center;
  position: fixed;
  z-index: 1000;
}

body.onboarding-booting .onboarding-boot {
  display: flex;
}
