/* Fortas Talent Assessments. Builds on styles.css tokens and buttons. */

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
[hidden] { display: none !important; }
body { background: var(--paper); }
main { min-height: calc(100vh - 80px); }
.narrow { max-width: 860px; }
.screen { padding: 48px 0 96px; }

/* ---------- Header with progress stepper ---------- */
.a-header { background: #fff; border-bottom: 1px solid #E2E3DD; position: sticky; top: 0; z-index: 5; }
.a-header-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 76px; }
.stepper { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 26px; }
.stepper li { position: relative; display: flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: 999px; color: var(--muted); font-size: 14px; font-weight: 600; white-space: nowrap; }
.stepper li + li::before { content: ""; position: absolute; left: -21px; top: 50%; width: 16px; height: 2px; background: #D5D6CF; }
.step-dot { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: #EFF0EB; color: var(--muted); font-size: 13px; font-weight: 700; flex: none; }
.stepper li.done .step-dot { background: var(--green); color: #fff; }
.stepper li.done { color: var(--ink-2); }
.stepper li.current { background: var(--highlight); color: var(--ink); }
.stepper li.current .step-dot { background: var(--ink); color: #fff; }
.timer {
  font-family: 'JetBrains Mono', ui-monospace, monospace; font-weight: 500; font-size: 17px;
  min-width: 86px; text-align: center; padding: 9px 14px; border-radius: 999px;
  background: var(--ink); color: #fff; font-variant-numeric: tabular-nums;
}
.timer.low { background: var(--highlight); color: var(--ink); }
.timer.critical { background: #A12C1F; color: #fff; }

/* ---------- Intro ---------- */
.screen-intro { padding: 0 0 96px; }
.intro-band { background: var(--green); color: #fff; padding: 64px 0 72px; }
.intro { display: flex; flex-wrap: wrap; gap: 48px 64px; align-items: flex-start; }
.intro-copy { flex: 999 1 460px; min-width: 0; display: flex; flex-direction: column; gap: 20px; padding-top: 8px; }
.kicker { font-size: 16px; color: var(--green-tint); font-weight: 600; }
.intro-title { font-family: var(--display); font-weight: 700; font-size: clamp(42px, 5.4vw, 74px); line-height: 0.98; letter-spacing: -0.035em; color: #fff; }
.intro-lead { font-size: 19px; line-height: 1.55; color: #DCE8E0; max-width: 520px; }
.facts { margin: 12px 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; }
.facts div { background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.16); border-radius: 14px; padding: 14px 16px; }
.facts dt { font-size: 13px; color: var(--green-tint); }
.facts dd { margin: 4px 0 0; font-family: var(--display); font-weight: 700; font-size: 28px; letter-spacing: -0.02em; color: #fff; }

.panel { background: #fff; border-radius: 22px; padding: 32px; box-shadow: 0 30px 60px -32px rgba(10, 30, 20, 0.55); color: var(--ink); }
.panel-title { font-family: var(--display); font-weight: 700; font-size: 24px; letter-spacing: -0.02em; }
.start-form { flex: 1 1 360px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.start-form label { display: flex; flex-direction: column; gap: 7px; font-size: 14px; font-weight: 600; }
.start-form input[type=text], .start-form input[type=email], .start-form input[type=tel], .start-form select {
  min-height: 48px; padding: 0 14px; border: 1px solid #BFC2BA; border-radius: 10px;
  font-size: 16px; font-weight: 400; background: #fff; color: var(--ink);
}
.start-form input:focus, .start-form select:focus { border-color: var(--green); }
.start-form select:disabled { background: #EAF2ED; border-color: #B9D2C3; color: var(--ink); font-weight: 600; opacity: 1; cursor: default; }
.start-form label.check { flex-direction: row; align-items: flex-start; gap: 10px; font-weight: 400; line-height: 1.5; color: var(--body); }
.start-form label.check input { width: 20px; height: 20px; margin: 0; flex: none; accent-color: var(--green); }
.optional { font-weight: 400; color: var(--muted); }
.form-error { color: #A12C1F; font-size: 15px; min-height: 1em; }

.rules-wrap { padding-top: 56px; }
.rules-title { font-family: var(--display); font-weight: 700; font-size: 26px; letter-spacing: -0.02em; margin-bottom: 20px; }
.rules { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.rules li { background: #fff; border: 1px solid #DCDDD6; border-radius: 16px; padding: 20px; font-size: 15px; line-height: 1.55; color: var(--body); }
.rules strong { display: block; color: var(--ink); font-size: 16px; margin-bottom: 4px; }

/* ---------- Shared ---------- */
.screen-title { font-family: var(--display); font-weight: 700; font-size: clamp(32px, 4vw, 48px); line-height: 1.04; letter-spacing: -0.03em; margin-bottom: 12px; }
.screen-lead { font-size: 18px; line-height: 1.6; color: var(--body); max-width: 680px; }
.hint { font-size: 15px; color: var(--muted); }
.actions-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin-top: 24px; }
.stat { background: #fff; border: 1px solid #DCDDD6; border-radius: 16px; padding: 16px 18px; display: flex; flex-direction: column; gap: 2px; }
.stat-value { font-family: var(--display); font-weight: 700; font-size: 34px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat-label { font-size: 14px; color: var(--muted); }

/* ---------- Typing ---------- */
.typing-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 28px 0 16px; }
.typing-card { background: #fff; border: 1px solid #DCDDD6; border-radius: 20px; padding: 10px; }
.passage {
  font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 17px; line-height: 1.95;
  padding: 18px 20px; color: #8A8F96; max-height: 290px; overflow-y: auto;
  user-select: none; -webkit-user-select: none;
}
.passage .ok { color: var(--ink); }
.passage .bad { color: #A12C1F; background: #F8D9D3; border-radius: 2px; }
.passage .cur { background: var(--highlight); color: var(--ink); border-radius: 2px; }
.typing-input {
  width: 100%; padding: 14px 16px; border: 0; border-top: 1px solid #E6E7E1; border-radius: 0 0 12px 12px;
  font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 16px; line-height: 1.6;
  resize: none; background: #F7F8F4; color: var(--ink);
}
.typing-input:focus { outline: 3px solid var(--green); outline-offset: -3px; background: #fff; }
.typing-input:disabled { color: var(--muted); }

/* ---------- Questions ---------- */
.test-layout { display: flex; flex-wrap: wrap; gap: 32px; align-items: flex-start; }
.question-col { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.progress { height: 8px; background: #E3E5DE; border-radius: 999px; overflow: hidden; }
.progress-fill { display: block; height: 100%; width: 0; background: var(--green); border-radius: 999px; transition: width 0.3s ease; }
@media (prefers-reduced-motion: reduce) { .progress-fill { transition: none; } }
.question-card { background: #fff; border: 1px solid #DCDDD6; border-radius: 22px; padding: 36px 36px 32px; }
.q-meta { display: inline-block; font-size: 13px; font-weight: 700; color: var(--green); background: #EAF2ED; padding: 5px 10px; border-radius: 999px; margin-bottom: 16px; }
.q-text {
  font-family: var(--display); font-weight: 600; font-size: clamp(21px, 2.2vw, 26px);
  line-height: 1.32; letter-spacing: -0.015em; color: var(--ink);
  user-select: none; -webkit-user-select: none; white-space: pre-line; display: block;
}
.q-options { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.q-options legend { padding: 0; margin-bottom: 22px; }
.option {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px; min-height: 60px;
  border: 1.5px solid #DCDDD6; border-radius: 14px; cursor: pointer; font-size: 17px; line-height: 1.45;
  user-select: none; -webkit-user-select: none; background: #fff;
}
.option:hover { border-color: #9EA29A; background: #FAFBF8; }
.option input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.option-letter {
  width: 34px; height: 34px; border-radius: 10px; flex: none; display: grid; place-items: center;
  border: 1.5px solid #CFD1C9; font-weight: 700; font-size: 15px; color: var(--ink-2); background: #fff;
}
.option:has(input:checked) { border-color: var(--green); background: #EAF2ED; }
.option:has(input:checked) .option-letter { background: var(--green); border-color: var(--green); color: #fff; }
.option:has(input:focus-visible) { outline: 3px solid var(--green); outline-offset: 2px; }
.written-area {
  width: 100%; margin-top: 22px; min-height: 260px; padding: 16px; border: 1px solid #BFC2BA; border-radius: 14px;
  font-size: 16px; line-height: 1.65; resize: vertical; color: var(--ink); background: #FCFCFA;
}
.written-area:focus { border-color: var(--green); background: #fff; }
.word-count { margin-top: 8px; font-size: 14px; color: var(--muted); }
.nav-row { display: flex; justify-content: space-between; gap: 12px; }

.navigator { flex: 1 1 250px; min-width: 0; position: sticky; top: 96px; background: #fff; border: 1px solid #DCDDD6; border-radius: 22px; padding: 22px; display: flex; flex-direction: column; gap: 16px; }
.navigator-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.navigator-title { font-weight: 700; font-size: 16px; }
.navigator-count { font-size: 14px; color: var(--muted); }
.nav-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.nav-item {
  display: grid; place-items: center; padding: 0; min-height: 44px; border: 1.5px solid #DCDDD6; border-radius: 10px;
  background: #fff; font-weight: 700; font-size: 15px; color: var(--ink); cursor: pointer;
}
.nav-item:hover { border-color: #9EA29A; }
.nav-item.done { background: var(--green); border-color: var(--green); color: #fff; }
.nav-item.current { box-shadow: 0 0 0 3px var(--highlight); }
.navigator-legend { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.dot { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.dot-done { background: var(--green); }
.dot-todo { background: #fff; border: 1.5px solid #CFD1C9; margin-left: 8px; }
.review-btn { width: 100%; }

/* ---------- Review & done ---------- */
.review-card, .done-card { background: #fff; border: 1px solid #DCDDD6; border-radius: 24px; padding: 40px; }
.review-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 20px 0; }
.review-missing { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }
.review-missing button { min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1.5px solid var(--ink); background: #fff; font-weight: 600; cursor: pointer; }
.review-missing button:hover { background: var(--highlight); }
.done-card { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 16px; }
.done-card .screen-lead { margin: 0 auto; }
.done-mark { width: 76px; height: 76px; border-radius: 50%; background: var(--highlight); color: var(--ink); display: grid; place-items: center; }

/* ---------- Small screens ---------- */
@media (max-width: 860px) {
  .step-label { display: none; }
  .stepper li { padding: 4px; }
  .stepper li.current { padding: 4px 10px 4px 4px; }
  .stepper li.current .step-label { display: inline; }
  .brand-sub { display: none; }
}
@media (max-width: 760px) {
  .navigator { position: static; }
  .nav-grid { grid-template-columns: repeat(7, minmax(0, 1fr)); }
  .question-card, .panel, .review-card, .done-card { padding: 24px 20px; }
  .screen { padding: 28px 0 72px; }
  .intro-band { padding: 40px 0 48px; }
  .stat-value { font-size: 26px; }
  .passage { font-size: 15px; padding: 14px; }
  .a-header-row { gap: 10px; }
  .stepper { gap: 14px; }
  .stepper li + li::before { left: -12px; width: 10px; }
  .a-header .brand-name { font-size: 19px; white-space: nowrap; }
}
@media (max-width: 460px) {
  .stepper li.current .step-label { display: none; }
  .nav-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .typing-stats { gap: 8px; }
  .stat { padding: 12px; }
}
