/* Master onboarding orchestration (#10414 quiz + #10414 gallery + #10415 matrix).
   Shared CSS — body[data-onboarding-page] selectors scope per-page tweaks. */

/* Base typography — historically (commit 71ad80fa5, 2026-05-11) this file scoped
   a body[data-onboarding-page] { font-family: ... } block to keep onboarding pages
   from rendering in Times New Roman. That block was removed once the proper fix
   landed in /css/platform-brand.css (base `body { font-family: var(--pm-font-ui) }`),
   which every onboarding HTML loads first. Onboarding now inherits brand typography
   automatically. Comment kept to short-circuit any future "why isn't onboarding
   scoped?" investigation. */

body[data-onboarding-page] {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(10, 31, 26, 0.06) 0 25%, transparent 25% 50%, rgba(245, 158, 11, 0.07) 50% 75%, transparent 75%) 0 0 / 42px 42px,
    radial-gradient(circle at 12% 0%, rgba(124, 245, 210, 0.18), transparent 30%),
    radial-gradient(circle at 88% 8%, rgba(245, 158, 11, 0.13), transparent 24%),
    linear-gradient(180deg, #fbfbf4 0%, #f3f8ef 42%, #e8efe4 100%);
  color: var(--pm-ink);
}

body[data-onboarding-page] main {
  padding-bottom: 3rem;
}

.onb-hero {
  max-width: 78rem;
  margin: 0 auto 1.75rem;
  padding: clamp(4rem, 8vw, 7rem) 1.25rem 0;
  text-align: center;
}
.onb-hero-kicker {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  margin: 0 0 0.85rem;
  padding: 0.35rem 0.7rem;
  border: 1px solid rgba(10, 31, 26, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: #0a3f34;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.onb-hero h1 {
  font-family: var(--pm-font-display);
  font-size: clamp(2.45rem, 5.4vw, 5.1rem);
  line-height: 1.03;
  margin: 0 0 1rem;
  color: #10231d;
  letter-spacing: 0;
}
.onb-hero .lede {
  font-size: clamp(1.02rem, 2vw, 1.2rem);
  line-height: 1.65;
  color: #475569;
  margin: 0 auto;
  max-width: 48rem;
}
.onb-hero-stats {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin: 1.35rem auto 0;
}
.onb-hero-stats span {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
  min-height: 44px;
  padding: 0.65rem 0.9rem;
  border: 1px solid rgba(15, 35, 29, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.8);
  color: #365148;
  box-shadow: 0 14px 34px rgba(6, 18, 14, 0.08);
}
.onb-hero-stats strong { color: #10231d; font-size: 1.05rem; }
.onb-hero-actions {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1.35rem;
}
.onb-progress { margin-top: 1rem; color: #475569; font-size: 0.9rem; }

/* ── Quiz ────────────────────────────────────────────────────────────────── */
.onb-quiz-wrap { max-width: 44rem; margin: 1.5rem auto; padding: 0 1.25rem; }
.onb-quiz-questions { display: flex; flex-direction: column; gap: 1.5rem; }
.onb-quiz-q { border: 1px solid rgba(15, 23, 42, 0.12); border-radius: 14px; padding: 1.1rem 1.25rem; margin: 0; background: rgba(255, 255, 255, 0.92); box-shadow: 0 18px 44px rgba(6, 18, 14, 0.08); }
.onb-quiz-q legend { font-weight: 700; padding: 0 0.5rem; color: #10231d; }
/* Tap target ≥44×44 CSS px (WCAG 2.5.5 / Apple HIG / Material) — issue #10674.
   Each <label class="onb-quiz-opt"> is the full-width hit area; min-height + padding
   guarantee the row meets the threshold even with a default browser radio glyph
   (~18-20px) plus the 1rem label text. Matches the 44px discipline used by .chip,
   .btn, .cat-chip, .menu-toggle elsewhere in the codebase. */
.onb-quiz-opt {
  display: flex; align-items: center; gap: 0.75rem;
  min-height: 44px; padding: 0.5rem 0.5rem;
  cursor: pointer; border-radius: 6px;
}
.onb-quiz-opt:hover, .onb-quiz-opt:focus-within { background: rgba(124, 245, 210, 0.14); }
/* Grow the radio's own hit surface so a tap on the glyph (not just the label
   text) registers reliably; width/height keep the visual size unchanged but
   browsers honour the larger touch box. */
.onb-quiz-opt input { margin: 0; width: 1.15rem; height: 1.15rem; flex-shrink: 0; }
.onb-quiz-opt span { color: #1e293b; line-height: 1.4; }
#onb-quiz-submit { display: block; margin: 0; }
#onb-quiz-submit:disabled { opacity: 0.5; cursor: not-allowed; }

/* #11188 — multi-step quiz progress bar + action row.
   `.onb-progress-bar` is the visual fill underneath the "Question N of 5"
   counter; updated by JS as the user advances/back-steps. `.onb-quiz-actions`
   centers Back/Next/Submit; only the relevant buttons are visible per step
   (Back hidden on step 1; Next on all but last; Submit only on last). */
.onb-progress-bar {
  max-width: 24rem;
  height: 6px;
  margin: 0.75rem auto 0;
  background: rgba(15, 23, 42, 0.12);
  border-radius: 999px;
  overflow: hidden;
}
.onb-progress-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--pm-accent-ink) 0%, var(--pm-accent) 100%);
  transition: width 0.2s ease;
}
.onb-quiz-actions {
  display: flex; gap: 0.75rem; justify-content: center; align-items: center; flex-wrap: wrap;
  margin: 1.5rem auto 0;
}
.onb-quiz-actions .btn-secondary,
.onb-quiz-actions .btn-cta { min-height: 44px; }
.onb-quiz-actions [hidden] { display: none !important; }
.onb-quiz-actions button:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Quiz results ────────────────────────────────────────────────────────── */
.onb-results { max-width: 64rem; margin: 2rem auto; padding: 0 1.25rem; }
.onb-results.hidden { display: none; }
.onb-results-lede { color: #475569; }
.onb-results-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; margin: 1.5rem 0; }
.onb-result-card {
  display: flex; flex-direction: column; gap: 0.5rem;
  padding: 1rem; border: 1px solid rgba(15, 23, 42, 0.12); border-radius: 14px;
  text-decoration: none; color: #10231d; background: rgba(255, 255, 255, 0.92);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.onb-result-card:hover, .onb-result-card:focus { border-color: var(--pm-accent-ink); box-shadow: 0 14px 32px rgba(124,245,210,0.22); }
.onb-result-slug { font-weight: 600; text-transform: capitalize; }
.onb-result-industry { font-size: 0.85rem; color: #475569; text-transform: uppercase; letter-spacing: 0.05em; }
.onb-results-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* ── Gallery + matrix shared filter row ──────────────────────────────────── */
.onb-gallery-filters {
  display: flex; flex-wrap: wrap; gap: 0.75rem; justify-content: center; align-items: center;
  max-width: 52rem;
  margin: 1.5rem auto 0;
  padding: 0.75rem;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 18px 44px rgba(6, 18, 14, 0.08);
}
.onb-filter-label { font-size: 0.8rem; color: #365148; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; }
.onb-filter {
  padding: 0.65rem 0.85rem; border: 1px solid rgba(15, 23, 42, 0.16); border-radius: 10px;
  font-size: 0.95rem; min-width: 12rem; max-width: 100%; min-height: 44px; background: #ffffff; color: #10231d;
}

/* ── Gallery ─────────────────────────────────────────────────────────────── */
.onb-gallery-wrap { max-width: 88rem; margin: 1.75rem auto; padding: 0 1.25rem; }
.onb-gallery-groups { display: flex; flex-direction: column; gap: 2.6rem; }
.onb-gallery-group { padding: 0; }
.onb-gallery-industry {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-transform: capitalize;
  margin: 0 0 0.95rem;
  color: #0f2a24;
  font-size: clamp(1.2rem, 2vw, 1.75rem);
}
.onb-gallery-industry::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  background: linear-gradient(90deg, rgba(10,31,26,0.18), transparent);
}
.onb-gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(248px, 1fr)); gap: 1rem; }
.onb-gallery-card {
  position: relative; display: flex; flex-direction: column; padding: 0; border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 8px; text-decoration: none; color: #10231d; background: #ffffff; overflow: hidden;
  transition: border-color 0.2s, transform 0.15s ease, box-shadow 0.15s ease;
  min-height: 260px;
  box-shadow: 0 18px 42px rgba(6, 18, 14, 0.08);
  isolation: isolate;
}
.onb-gallery-card:hover, .onb-gallery-card:focus { border-color: var(--pm-accent-ink); transform: translateY(-2px); box-shadow: 0 24px 48px rgba(6, 18, 14, 0.16); }
.onb-gallery-card::before {
  content: attr(data-industry);
  display: grid;
  place-items: center;
  position: absolute;
  inset: 0 0 auto;
  height: 164px;
  padding: 1rem;
  background:
    linear-gradient(135deg, rgba(9, 28, 24, 0.88), rgba(25, 81, 68, 0.74)),
    repeating-linear-gradient(135deg, rgba(124,245,210,0.18) 0 1px, transparent 1px 16px);
  color: rgba(255, 255, 255, 0.86);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-align: center;
  z-index: 0;
}
.onb-gallery-card-hero {
  position: relative;
  z-index: 1;
  display: block; width: 100%; height: 164px; object-fit: cover;
  background: transparent;
  border-bottom: 1px solid rgba(15, 23, 42, 0.1);
  opacity: 0;
  transition: opacity 0.2s ease;
}
.onb-gallery-card.is-image-loaded .onb-gallery-card-hero { opacity: 1; }
.onb-gallery-card.is-image-error .onb-gallery-card-hero { opacity: 0; }
.onb-gallery-card-body {
  position: relative;
  z-index: 2;
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 0.45rem;
  padding: 0.9rem 1rem 1rem;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdf9 100%);
}
.onb-gallery-card-kicker {
  color: #0a6b57;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.onb-gallery-card-title { font-weight: 800; color: #10231d; line-height: 1.25; font-size: 1rem; }
.onb-gallery-card-action {
  margin-top: auto;
  color: #5b3b07;
  font-size: 0.86rem;
  font-weight: 800;
}
/* Iframe is JS-inserted on hover (debounced 350ms) and removed on mouseleave.
   pointer-events:none keeps the card's <a> click target above the iframe so a
   click on the preview still opens the full demo in a new tab. */
.onb-gallery-iframe {
  position: absolute; inset: 0; width: 100%; height: 100%; border: 0; pointer-events: none;
  background: #ffffff;
  z-index: 4;
}

/* ── Feature matrix ──────────────────────────────────────────────────────── */
.onb-matrix-wrap { max-width: 84rem; margin: 1.5rem auto 3rem; padding: 0 1.25rem; }
.onb-matrix-groups { display: flex; flex-direction: column; gap: 1.5rem; }
.onb-matrix-group { background: rgba(255, 255, 255, 0.92); padding: 1rem 1.25rem; border-radius: 14px; border: 1px solid rgba(15, 23, 42, 0.12); box-shadow: 0 18px 44px rgba(6, 18, 14, 0.08); }
.onb-matrix-industry { text-transform: capitalize; color: var(--pm-accent-ink); margin: 0 0 0.75rem; font-size: 1.05rem; }
.onb-matrix-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.onb-matrix-table th, .onb-matrix-table td { text-align: left; padding: 0.6rem 0.75rem; border-bottom: 1px solid rgba(15, 23, 42, 0.08); vertical-align: top; }
.onb-matrix-table th { font-weight: 700; color: #10231d; background: rgba(124, 245, 210, 0.12); border-bottom: 2px solid rgba(124, 245, 210, 0.28); }
.onb-matrix-mod-label { font-weight: 700; color: #10231d; }
.onb-matrix-mod-desc { color: #475569; font-size: 0.85rem; margin-top: 0.25rem; }
.onb-matrix-tier { text-transform: uppercase; letter-spacing: 0.05em; font-size: 0.8rem; color: #475569; }
.onb-matrix-cats { color: #475569; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.82rem; word-break: break-word; }

@media (max-width: 720px) {
  body[data-onboarding-page] .site-header .header-inner {
    min-height: 64px;
    gap: 0.65rem;
    padding-block: 0.55rem;
  }
  body[data-onboarding-page] .site-nav {
    justify-content: flex-end;
    gap: 0.5rem;
  }
  body[data-onboarding-page] .site-nav a:not(.btn-cta) { display: none; }
  .onb-hero { padding-inline: 1rem; }
  .onb-hero {
    padding-top: 0.9rem;
    margin-bottom: 1rem;
  }
  .onb-hero-kicker { min-height: 24px; margin-bottom: 0.35rem; }
  .onb-hero h1 { font-size: clamp(1.85rem, 8.4vw, 2.45rem); }
  .onb-hero .lede { font-size: 0.94rem; line-height: 1.4; margin-top: 0.55rem; }
  .onb-hero-stats {
    display: none;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.5rem;
    margin-top: 0.9rem;
  }
  .onb-hero-stats span {
    flex: 0 1 auto;
    justify-content: center;
    min-height: 58px;
    padding: 0.55rem 0.45rem;
    border-radius: 8px;
    text-align: center;
    font-size: 0.8rem;
    line-height: 1.25;
    flex-direction: column;
  }
  .onb-hero-stats strong { font-size: 1rem; }
  .onb-hero-actions .btn-cta,
  .onb-hero-actions .btn-secondary { width: 100%; justify-content: center; }
  .onb-hero-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: stretch;
    margin-top: 0.75rem;
  }
  .onb-hero-actions .btn-cta,
  .onb-hero-actions .btn-secondary {
    min-height: 42px;
    padding: 0.65rem 0.85rem;
    font-size: 0.9rem;
  }
  .onb-hero-actions .btn-secondary {
    width: auto;
    min-width: 108px;
  }
  .onb-gallery-filters { margin-top: 0.9rem; }
  .onb-gallery-filters {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    justify-items: stretch;
    border-radius: 8px;
    gap: 0.35rem;
    padding: 0.7rem;
  }
  .onb-filter-label { text-align: left; font-size: 0.72rem; }
  .onb-filter { width: 100%; min-width: 0; min-height: 38px; padding: 0.55rem 0.65rem; }
  .onb-gallery-wrap { padding: 0 1rem; }
  .onb-gallery-groups { gap: 1.35rem; }
  .onb-gallery-group { gap: 0.75rem; }
  .onb-gallery-grid { grid-template-columns: minmax(0, 1fr); }
  .onb-gallery-card { min-height: 216px; }
  .onb-gallery-card::before,
  .onb-gallery-card-hero { height: 126px; }
  .onb-gallery-card-body { padding: 0.75rem; gap: 0.35rem; }
  .onb-matrix-wrap { padding: 0 1rem; }
  .onb-matrix-group { padding: 0.85rem; }
  .onb-matrix-table,
  .onb-matrix-table thead,
  .onb-matrix-table tbody,
  .onb-matrix-table tr,
  .onb-matrix-table th,
  .onb-matrix-table td {
    display: block;
    width: 100%;
  }
  .onb-matrix-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
  .onb-matrix-table tr {
    border: 1px solid rgba(15, 23, 42, 0.1);
    border-radius: 10px;
    background: #ffffff;
    overflow: hidden;
  }
  .onb-matrix-table tr + tr { margin-top: 0.75rem; }
  .onb-matrix-table td {
    min-width: 0;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    padding: 0.65rem 0.75rem;
  }
  .onb-matrix-table td:last-child { border-bottom: 0; }
  .onb-matrix-table td::before {
    display: block;
    margin-bottom: 0.25rem;
    color: #64748b;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }
  .onb-matrix-table td:nth-child(1)::before { content: "Module"; }
  .onb-matrix-table td:nth-child(2)::before { content: "Tier"; }
  .onb-matrix-table td:nth-child(3)::before { content: "Default categories"; }
  .onb-matrix-table td:nth-child(4)::before { content: "Flag"; }
}

.onb-flag { display: inline-block; padding: 0.15rem 0.5rem; border-radius: 999px; font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
.onb-flag-compliance { background: #fef3c7; color: #92400e; }
.onb-flag-empty { color: #9ca3af; font-size: 0.85rem; }

.onb-empty { padding: 2rem; text-align: center; color: #6b7280; }
.form-status-error { color: #b91c1c; }
.hidden { display: none; }
