/* Components specific to the role finder. Everything else is inherited from
   style.css and scorecard.css so the two assessments stay visually identical. */

/* ---------- role results ---------- */
.role-matches {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  margin-top: var(--space-6);
}

.role-empty {
  background: var(--color-surface);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-lg, 12px);
  padding: var(--space-5);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  line-height: 1.6;
}

.role-podium {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
}
@media (min-width: 900px) {
  .role-podium { grid-template-columns: 1.4fr 1fr 1fr; align-items: start; }
}

.role-podium__card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg, 12px);
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.role-podium__card--top {
  border-color: var(--color-amber);
  border-width: 2px;
  box-shadow: var(--shadow-lg);
}
.role-podium__place {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-faint);
}
.role-podium__card--top .role-podium__place { color: var(--color-amber); }
.role-podium__name {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-primary);
  line-height: 1.2;
}
.role-podium__card--top .role-podium__name { font-size: var(--text-2xl); }
.role-podium__tagline {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}
.role-podium__match {
  font-size: var(--text-sm);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--color-amber);
}
.role-podium__blurb {
  font-size: var(--text-sm);
  line-height: 1.6;
  color: var(--color-text);
  margin-top: var(--space-2);
}
.role-podium__market {
  font-size: var(--text-xs);
  line-height: 1.55;
  color: var(--color-text-faint);
  border-left: 2px solid var(--color-border);
  padding-left: var(--space-3);
}

.role-note {
  background: var(--color-primary-soft);
  border-radius: var(--radius-lg, 12px);
  padding: var(--space-4) var(--space-5);
  font-size: var(--text-sm);
  line-height: 1.6;
  color: var(--color-text);
}

.role-rank {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg, 12px);
  padding: var(--space-5);
}
.role-rank__title {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--color-text-faint);
  margin-bottom: var(--space-4);
}
.role-rank__row {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-1);
  padding-block: var(--space-2);
  border-bottom: 1px solid var(--color-divider);
}
.role-rank__row:last-child { border-bottom: 0; }
@media (min-width: 720px) {
  .role-rank__row {
    grid-template-columns: minmax(160px, 1.2fr) 3fr auto;
    gap: var(--space-4);
    align-items: center;
  }
}
.role-rank__name { font-size: var(--text-sm); color: var(--color-text-muted); }
.role-rank__row--top .role-rank__name { color: var(--color-primary); font-weight: 700; }
.role-rank__track {
  display: block;
  height: 8px;
  border-radius: 999px;
  background: var(--color-surface-2, var(--color-border));
  overflow: hidden;
}
.role-rank__fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--color-primary);
}
.role-rank__row--top .role-rank__fill { background: var(--color-amber); }
.role-rank__value {
  font-size: var(--text-sm);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--color-text);
  text-align: right;
}


/* ---------- forced-choice framing ---------- */
.response-legend__note {
  font-size: var(--text-sm);
  line-height: 1.65;
  color: var(--color-text-muted);
}
.response-legend__note em { color: var(--color-text); font-style: italic; }


.results-card__note {
  font-size: var(--text-xs);
  line-height: 1.6;
  color: var(--color-text-faint);
  text-align: center;
  max-width: 48ch;
  margin: 0 auto var(--space-4);
}

/* ---------- ranked choice ---------- */
.question__hint {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  margin-bottom: var(--space-2);
}
/* The badge holds a rank now, not a letter, so it is empty until chosen. */
.option-list--ranked .option-card__letter { min-width: 1.6em; }
.option-list--ranked .option-card:not(.active):not(.option-card--second) .option-card__letter {
  border: 1px dashed var(--color-border);
  background: transparent;
  color: transparent;
}
.option-card--second {
  border-color: var(--color-primary);
  background: var(--color-primary-soft);
}
.option-card--second .option-card__letter {
  background: var(--color-primary);
  color: var(--color-text-inverse, #fff);
}

/* ---------- confidence ---------- */
.confidence {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-2) var(--space-3);
  border-left: 3px solid var(--color-primary);
  background: var(--color-surface-2, var(--color-surface));
  border-radius: 0 var(--radius-lg, 12px) var(--radius-lg, 12px) 0;
  padding: var(--space-4) var(--space-5);
}
.confidence--clear { border-left-color: var(--color-teal); }
.confidence--moderate { border-left-color: var(--color-amber); }
.confidence--blend { border-left-color: var(--color-rose); }
.confidence__label {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}
.confidence--clear .confidence__label { color: var(--color-teal); }
.confidence--moderate .confidence__label { color: var(--color-amber); }
.confidence--blend .confidence__label { color: var(--color-rose); }
.confidence__text { font-size: var(--text-sm); color: var(--color-text); line-height: 1.55; }
.confidence--broad { border-left-color: var(--color-violet); }
.confidence--broad .confidence__label { color: var(--color-violet); }

/* ---------- interleaved questions ---------- */
/* Situations and self-ratings alternate, so each needs to announce which kind
   it is - otherwise the change of answering mode reads as an inconsistency. */
.question__step {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--color-text-faint);
  margin-bottom: var(--space-2);
}
.question--depth {
  background: var(--color-surface-2, var(--color-surface));
  border-radius: var(--radius-lg, 12px);
  padding: var(--space-5);
  border-left: 3px solid var(--color-amber);
}
.question__step--depth { color: var(--color-amber); }

/* ---------- lead gate ---------- */
.gate { margin-top: var(--space-8); }
.gate__card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl, 16px);
  padding: var(--space-8) var(--space-6);
  max-width: 520px;
  margin-inline: auto;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.gate__icon { font-size: 26px; }
.gate__title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-primary);
  margin: 0;
}
.gate__desc { font-size: var(--text-sm); color: var(--color-text-muted); margin: 0; line-height: 1.6; }

.gate-form__field { display: flex; flex-direction: column; gap: var(--space-1); }
.gate-form__field span { font-size: var(--text-sm); font-weight: 600; }
.gate-form__field input {
  font: inherit;
  font-size: var(--text-base, 16px);
  padding: var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md, 8px);
  background: var(--color-bg);
  color: var(--color-text);
}
.gate-form__field input:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 1px;
  border-color: var(--color-primary);
}
.gate-form__trap {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
.gate-form__consent {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  line-height: 1.55;
}
.gate-form__consent input { margin-top: 3px; flex-shrink: 0; width: 16px; height: 16px; }
.gate-form__error { font-size: var(--text-sm); color: var(--color-rose); margin: 0; font-weight: 600; }
.gate-form__submit { width: 100%; margin-top: var(--space-2); }

/* ---------- share card ---------- */
.share-block {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
  align-items: center;
  margin-top: var(--space-2);
}
@media (min-width: 900px) { .share-block { grid-template-columns: 360px 1fr; } }

.share-card {
  background: var(--color-surface);
  border: 2px solid var(--color-amber);
  border-radius: var(--radius-xl, 16px);
  overflow: hidden;
  text-align: center;
}
.share-card__top { background: var(--color-primary); padding: var(--space-3); }
.share-card__brand {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--color-text-inverse, #fff);
}
.share-card__body {
  padding: var(--space-6) var(--space-5) var(--space-6);
  background: linear-gradient(160deg, var(--color-primary-soft) 0%, var(--color-surface) 60%);
}
.share-card__eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-faint);
  margin-bottom: var(--space-2);
}
.share-card__role {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--color-primary);
  line-height: 1.15;
  margin-bottom: var(--space-1);
}
.share-card__tagline { font-size: var(--text-sm); color: var(--color-text-muted); margin-bottom: var(--space-3); }
.share-card__chart { height: 210px; max-width: 260px; margin: 0 auto var(--space-3); }
.share-card__line { font-size: var(--text-sm); color: var(--color-text); margin-bottom: var(--space-1); }
.share-card__line--band { color: var(--color-text-muted); }
.share-card__footer {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  margin-top: var(--space-4);
}

.share-actions { display: flex; flex-direction: column; gap: var(--space-3); align-items: flex-start; }
.share-actions .btn-primary { width: 100%; }
.share-actions__note { font-size: var(--text-xs); color: var(--color-text-faint); line-height: 1.55; margin: 0; }
.share-actions .btn-primary:disabled { opacity: 0.6; cursor: progress; }

/* iOS fallback: Safari ignores the download attribute on blob URLs */
.card-lightbox {
  position: fixed; inset: 0; z-index: 999;
  background: rgba(6, 21, 34, 0.9);
  display: flex; align-items: center; justify-content: center;
  padding: var(--space-6); overflow-y: auto;
}
.card-lightbox__inner {
  display: flex; flex-direction: column; align-items: center; gap: var(--space-4);
  max-width: 420px; width: 100%; margin: auto;
}
.card-lightbox__hint { color: #fff; font-size: var(--text-sm); font-weight: 600; text-align: center; }
.card-lightbox__img {
  width: 100%; height: auto; border-radius: var(--radius-lg, 12px);
  -webkit-touch-callout: default;
}
.card-lightbox__close {
  background: #fff; color: var(--color-primary); border: none;
  border-radius: var(--radius-full, 999px); font-weight: 700;
  padding: var(--space-3) var(--space-8); cursor: pointer; font-size: var(--text-sm);
}

/* ---------- topbar tools ---------- */
.topbar__tools { display: flex; align-items: center; gap: var(--space-3); }
.lang-switch {
  display: inline-flex;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full, 999px);
  overflow: hidden;
  background: var(--color-surface);
}
.lang-switch__btn {
  font: inherit;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 6px 11px;
  border: 0;
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
}
.lang-switch__btn.active { background: var(--color-primary); color: var(--color-text-inverse, #fff); }
.lang-switch__btn:focus-visible { outline: 2px solid var(--color-primary); outline-offset: -2px; }

/* ---------- topbar tools ---------- */
.topbar__tools { display: flex; align-items: center; gap: var(--space-3); }
.lang-switch {
  display: inline-flex;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full, 999px);
  overflow: hidden;
  background: var(--color-surface);
}
.lang-switch__btn {
  font: inherit;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 6px 11px;
  border: 0;
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
}
.lang-switch__btn.active { background: var(--color-primary); color: var(--color-text-inverse, #fff); }
.lang-switch__btn:focus-visible { outline: 2px solid var(--color-primary); outline-offset: -2px; }

/* ---------- locked results ----------
   The result is rendered for real and then blurred, with the form floating
   over it. Showing the shape of what is waiting is a better invitation than an
   empty box, and the card is sticky so it stays with the reader instead of
   scrolling away up the page. */



/* .gate__card sets an explicit display, which beats the hidden attribute's
   default display:none - without this the waiting card and the form show side
   by side once every question is answered. */
.gate__card[hidden] { display: none; }

/* ---------- hero role list ---------- */
/* Set apart from the lede and separated by dots so five job titles scan as a
   list instead of disappearing into a paragraph. */
.hero__roles {
  font-size: var(--text-sm);
  line-height: 1.65;
  color: var(--color-text-faint);
  max-width: 60ch;
  margin-top: calc(var(--space-2) * -1);
}
.hero__roles-label { display: block; margin-bottom: var(--space-1); }
.hero__roles-list { color: var(--color-text-muted); font-weight: 600; }

/* ---------- single column ----------
   scorecard.css splits .assessment__inner into two columns above 1024px,
   which is right for the Sensemaker page (form left, result right) and wrong
   here: it cut this page in half and squeezed the questions into a narrow
   band. The role finder reads top to bottom, so it stays one column and is
   centred at a comfortable measure. */
.assessment__inner {
  grid-template-columns: 1fr;
  max-width: 720px;
}
@media (min-width: 1024px) {
  .assessment__inner { grid-template-columns: 1fr; }
}

.gate { display: flex; justify-content: center; }
.gate__card[hidden] { display: none; }

/* ---------- unanswered questions ---------- */
.gate__card--incomplete { border-style: dashed; align-items: flex-start; }
.gate__desc--warn { color: var(--color-amber); font-weight: 600; }
.gate__card--incomplete .btn-secondary { width: auto; margin-top: var(--space-2); }

/* Only applied after the reader asks to be taken to what is missing, so the
   page is not covered in warnings before they have had a chance to answer. */
.question--missing {
  outline: 2px solid var(--color-amber);
  outline-offset: 6px;
  border-radius: var(--radius-md, 8px);
}
