:root {
  --bni-red: #cf2030;
  --black: #000000;
  --granite: #64666a;
  --sterling: #c8c8c8;
  --light: #f2f2f2;
  --white: #ffffff;
  --ink: #171717;
  --muted: #5d6269;
  --line: #dedfe1;
  --success: #3c8f4e;
  --warning: #b77618;
  --focus: #007a86;
  --shadow: 0 12px 28px rgba(0, 0, 0, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--white);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.45;
}

a {
  color: inherit;
}

button,
input,
select,
textarea {
  font: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 76px;
  padding: 14px clamp(18px, 4vw, 52px);
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: var(--white);
  background: var(--bni-red);
  border-radius: 8px;
  font-weight: 800;
  letter-spacing: 0;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 1rem;
}

.brand small {
  color: var(--muted);
  font-size: 0.82rem;
}

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
}

.nav a {
  min-height: 40px;
  padding: 10px 12px;
  color: var(--muted);
  border-radius: 6px;
  text-decoration: none;
  white-space: nowrap;
}

.nav a.active,
.nav a:hover {
  color: var(--ink);
  background: var(--light);
}

.app {
  min-height: calc(100vh - 154px);
}

.section {
  padding: clamp(34px, 6vw, 72px) clamp(18px, 5vw, 72px);
}

.section.tight {
  padding-top: clamp(24px, 4vw, 42px);
}

.section.alt {
  background: var(--light);
}

.content {
  width: min(1180px, 100%);
  margin: 0 auto;
}

.intro-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(300px, 0.92fr);
  align-items: center;
  gap: clamp(28px, 5vw, 64px);
}

.kicker {
  margin: 0 0 12px;
  color: var(--bni-red);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
h4,
p {
  margin-top: 0;
}

h1 {
  max-width: 820px;
  margin-bottom: 18px;
  color: var(--black);
  font-size: clamp(2.4rem, 7vw, 5.6rem);
  line-height: 0.96;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 16px;
  font-size: clamp(1.7rem, 3vw, 2.6rem);
  line-height: 1.08;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 10px;
  font-size: 1.12rem;
  line-height: 1.2;
}

.lede {
  max-width: 760px;
  color: var(--muted);
  font-size: clamp(1.04rem, 2vw, 1.25rem);
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 11px 16px;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 6px;
  cursor: pointer;
  font-weight: 750;
  text-decoration: none;
}

.btn:hover {
  border-color: var(--granite);
}

.btn.primary {
  color: var(--white);
  background: var(--bni-red);
  border-color: var(--bni-red);
}

.btn.dark {
  color: var(--white);
  background: var(--black);
  border-color: var(--black);
}

.btn.ghost {
  background: transparent;
}

.btn.small {
  min-height: 36px;
  padding: 8px 11px;
  font-size: 0.9rem;
}

.btn[disabled] {
  cursor: not-allowed;
  opacity: 0.55;
}

.panel {
  padding: clamp(20px, 3vw, 30px);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.panel.flat {
  box-shadow: none;
}

.stat-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  overflow: hidden;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.stat-strip div {
  min-height: 112px;
  padding: 18px;
  background: var(--white);
}

.stat-strip strong {
  display: block;
  color: var(--bni-red);
  font-size: 2rem;
  line-height: 1;
}

.stat-strip span {
  color: var(--muted);
  font-size: 0.9rem;
}

.genius-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 28px;
}

.genius-card,
.result-card,
.event-card,
.member-card {
  position: relative;
  padding: 22px;
  overflow: hidden;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.genius-card::before,
.result-card::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: var(--accent, var(--bni-red));
  content: "";
}

.genius-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
}

.code-badge {
  display: grid;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  place-items: center;
  color: var(--white);
  background: var(--accent, var(--bni-red));
  border-radius: 8px;
  font-weight: 900;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 9px;
  color: var(--granite);
  background: var(--light);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
}

.pill.red {
  color: var(--bni-red);
  background: #fff4f5;
  border-color: #f2ccd0;
}

.pill.dark {
  color: var(--white);
  background: var(--black);
  border-color: var(--black);
}

.flow-line {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 10px;
  margin-top: 28px;
  overflow-x: auto;
}

.flow-step {
  min-height: 120px;
  padding: 16px;
  border: 1px solid var(--line);
  border-top: 5px solid var(--accent, var(--bni-red));
  border-radius: 8px;
  background: var(--white);
}

.flow-step span {
  color: var(--muted);
  font-size: 0.86rem;
}

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

.field {
  display: grid;
  gap: 7px;
}

.field.full {
  grid-column: 1 / -1;
}

.field label {
  color: var(--granite);
  font-size: 0.88rem;
  font-weight: 800;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 46px;
  padding: 11px 12px;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--sterling);
  border-radius: 6px;
}

.field textarea {
  min-height: 92px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.choice:focus-within {
  border-color: var(--focus);
  outline: 3px solid rgba(0, 122, 134, 0.16);
}

.help-text {
  color: var(--muted);
  font-size: 0.92rem;
}

.diff-panel {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.diff-row {
  display: grid;
  grid-template-columns: minmax(130px, 0.35fr) minmax(0, 1fr);
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--light);
}

.choice-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.choice {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  padding: 9px 11px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 6px;
  cursor: pointer;
}

.choice input {
  accent-color: var(--bni-red);
}

.consent-choice {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: start;
  gap: 12px;
  width: 100%;
  min-height: 0;
  padding: 16px;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  font-weight: 750;
  overflow-wrap: anywhere;
}

.consent-choice input {
  width: 20px;
  height: 20px;
  min-height: 20px;
  margin: 2px 0 0;
  padding: 0;
  accent-color: var(--bni-red);
}

.consent-choice span {
  min-width: 0;
}

.consent-choice:focus-within {
  border-color: var(--focus);
  outline: 3px solid rgba(0, 122, 134, 0.16);
}

.assessment-shell {
  display: grid;
  grid-template-columns: minmax(0, 0.34fr) minmax(0, 0.66fr);
  gap: 24px;
  align-items: start;
}

.progress-list {
  display: grid;
  gap: 8px;
}

.progress-dot {
  display: grid;
  grid-template-columns: 34px 1fr;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 6px;
  color: var(--muted);
  border-radius: 6px;
}

.progress-dot span:first-child {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  background: var(--light);
  border: 1px solid var(--line);
  border-radius: 50%;
  font-size: 0.82rem;
  font-weight: 800;
}

.progress-dot.current {
  color: var(--ink);
  background: var(--light);
}

.progress-dot.done span:first-child {
  color: var(--white);
  background: var(--success);
  border-color: var(--success);
}

.question-number {
  color: var(--bni-red);
  font-weight: 900;
}

.question-text {
  margin: 12px 0 24px;
  font-size: clamp(1.45rem, 3.2vw, 2.4rem);
  line-height: 1.12;
}

.answer-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.answer-option {
  display: grid;
  min-height: 94px;
  place-items: center;
  padding: 14px;
  text-align: center;
  background: var(--light);
  border: 2px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 850;
}

.answer-option input {
  position: absolute;
  opacity: 0;
}

.answer-option.selected {
  color: var(--white);
  background: var(--bni-red);
  border-color: var(--bni-red);
}

.question-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 24px;
}

.score-list {
  display: grid;
  gap: 12px;
  margin-top: 22px;
}

.score-row {
  display: grid;
  grid-template-columns: 132px 1fr 44px;
  align-items: center;
  gap: 12px;
}

.bar {
  height: 12px;
  overflow: hidden;
  background: var(--light);
  border-radius: 999px;
}

.bar span {
  display: block;
  width: var(--value, 0%);
  height: 100%;
  background: var(--accent, var(--bni-red));
}

.report-hero {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(260px, 0.45fr);
  gap: 24px;
  align-items: stretch;
}

.report-name {
  color: var(--granite);
  font-weight: 800;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 22px;
}

.result-card ul,
.genius-card ul {
  padding-left: 18px;
  margin-bottom: 0;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  background: var(--white);
}

th,
td {
  padding: 12px 11px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--granite);
  background: var(--light);
  font-size: 0.82rem;
  text-transform: uppercase;
}

tr:last-child td {
  border-bottom: 0;
}

.role-token {
  display: inline-flex;
  min-width: 34px;
  min-height: 28px;
  align-items: center;
  justify-content: center;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 900;
}

.role-token.genius {
  color: var(--white);
  background: var(--bni-red);
}

.role-token.competency {
  color: var(--black);
  background: var(--sterling);
}

.role-token.frustration {
  color: var(--granite);
  background: var(--white);
  border: 1px solid var(--sterling);
}

.dashboard-grid,
.event-grid,
.admin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 22px;
}

.event-card {
  display: grid;
  gap: 12px;
}

.event-date {
  color: var(--bni-red);
  font-weight: 900;
}

.admin-table input,
.admin-table select {
  min-width: 160px;
}

.empty-state {
  padding: 32px;
  color: var(--muted);
  background: var(--light);
  border: 1px dashed var(--sterling);
  border-radius: 8px;
}

.notice {
  padding: 14px 16px;
  color: #583d00;
  background: #fff7e6;
  border: 1px solid #f0d49d;
  border-radius: 8px;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  padding: 22px clamp(18px, 5vw, 72px);
  color: var(--muted);
  background: var(--light);
  border-top: 1px solid var(--line);
  font-size: 0.9rem;
}

.site-footer a {
  color: var(--bni-red);
  font-weight: 800;
}

.loading-panel {
  display: grid;
  min-height: 50vh;
  place-items: center;
  color: var(--muted);
}

.loader {
  width: 38px;
  height: 38px;
  border: 4px solid var(--line);
  border-top-color: var(--bni-red);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 40;
  max-width: 360px;
  padding: 13px 15px;
  color: var(--white);
  background: var(--black);
  border-radius: 8px;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(12px);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

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

@media (max-width: 920px) {
  .topbar {
    align-items: start;
    flex-direction: column;
    gap: 10px;
  }

  .intro-grid,
  .assessment-shell,
  .report-hero {
    grid-template-columns: 1fr;
  }

  .genius-grid,
  .result-grid,
  .dashboard-grid,
  .event-grid,
  .admin-grid {
    grid-template-columns: 1fr;
  }

  .progress-list {
    grid-template-columns: repeat(6, minmax(80px, 1fr));
    overflow-x: auto;
  }

  .progress-dot {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }
}

@media (max-width: 640px) {
  .section {
    padding-inline: 16px;
  }

  .nav {
    width: 100%;
  }

  .stat-strip,
  .form-grid,
  .answer-grid {
    grid-template-columns: 1fr;
  }

  .diff-row,
  .score-row {
    grid-template-columns: 1fr;
  }

  .question-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .question-actions .btn {
    width: 100%;
  }
}
