/* مُرتقى — تطبيق الاختبار */
.assessment-page { min-height: 100vh; }
.assessment-main { padding-block: var(--sp-5) var(--sp-7); }
.assessment-container { max-width: 880px; }
.assessment-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: var(--sp-4);
  margin-bottom: var(--sp-4);
}
.assessment-heading h1 { font-size: var(--fs-xl); margin-top: var(--sp-1); }
.quiet-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--text-muted);
  font-size: var(--fs-sm);
  font-weight: 700;
}
.storage-warning,
.assessment-alert {
  margin-bottom: var(--sp-4);
  padding: var(--sp-3) var(--sp-4);
  border: 1px solid color-mix(in srgb, var(--orange) 48%, var(--border));
  border-radius: var(--r-md);
  background: var(--orange-soft);
  color: var(--text);
  font-size: var(--fs-sm);
}
.assessment-app {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  background: var(--surface);
  box-shadow: var(--sh-3);
  overflow: hidden;
}
.assessment-mode-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 30px;
  padding: .28rem .7rem;
  border: 1px solid color-mix(in srgb, var(--brand) 34%, var(--border));
  border-radius: var(--r-full);
  background: var(--brand-soft);
  color: var(--brand);
  font-size: var(--fs-xs);
  font-weight: 800;
}
.assessment-mode-badge--quick {
  border-color: color-mix(in srgb, var(--green) 42%, var(--border));
  background: var(--green-soft);
  color: var(--green-strong);
}
.screen-card { padding: var(--sp-5); }
.screen-card__head {
  display: grid;
  gap: var(--sp-2);
  margin-bottom: var(--sp-5);
}
.screen-card__head p { color: var(--text-muted); }
.screen-card__actions {
  display: flex;
  gap: var(--sp-3);
  flex-wrap: wrap;
  margin-top: var(--sp-5);
}
.screen-card__actions .btn { min-width: 150px; }
.resume-card {
  display: grid;
  gap: var(--sp-4);
}
.resume-card__mark {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: var(--r-lg);
  color: var(--brand);
  background: var(--brand-soft);
  font-size: var(--fs-xl);
  font-weight: 800;
}

.personalization-progress,
.question-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--sp-3);
  color: var(--text-muted);
  font-size: var(--fs-sm);
  font-weight: 700;
}
.progress-track {
  width: 100%;
  height: 7px;
  margin-top: var(--sp-3);
  border-radius: var(--r-full);
  background: var(--brand-soft-2);
  overflow: hidden;
}
.progress-track__fill {
  display: block;
  width: var(--progress, 0%);
  height: 100%;
  border-radius: inherit;
  background: var(--brand);
  transition: width .2s ease;
}
.personalization-form,
.question-form { margin-top: var(--sp-5); }
.choice-group {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
.choice-group legend {
  width: 100%;
  margin-bottom: var(--sp-4);
  color: var(--text);
  font-size: var(--fs-xl);
  line-height: 1.45;
  font-weight: 800;
}
.choice-grid { display: grid; gap: var(--sp-3); }
.choice {
  position: relative;
  min-width: 0;
}
.choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.choice label {
  min-height: 56px;
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface-soft);
  cursor: pointer;
  transition: border-color .16s ease, background-color .16s ease, box-shadow .16s ease;
}
.choice label::before {
  content: "";
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  border: 2px solid var(--text-muted);
  border-radius: 50%;
  box-shadow: inset 0 0 0 4px var(--surface-soft);
}
.choice label:hover { border-color: var(--brand); }
.choice input:checked + label {
  border-color: var(--brand);
  background: var(--brand-soft);
  box-shadow: 0 0 0 1px var(--brand);
}
.choice input:checked + label::before {
  border-color: var(--brand);
  background: var(--brand);
  box-shadow: inset 0 0 0 4px var(--brand-soft);
}
.choice input:focus-visible + label {
  outline: 3px solid var(--ring);
  outline-offset: 3px;
}
.choice input:disabled + label { cursor: wait; opacity: .72; }

.question-shell { display: grid; }
.question-top {
  display: grid;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--border);
  background: var(--surface-soft);
}
.question-stage {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 30px;
  padding-inline: var(--sp-3);
  border-radius: var(--r-full);
  background: var(--brand-soft);
  color: var(--brand);
  font-size: var(--fs-xs);
  font-weight: 800;
}
.question-body { padding: var(--sp-5); }
.question-instruction {
  margin-bottom: var(--sp-3);
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-md);
  background: var(--surface-soft);
  color: var(--text-muted);
  font-size: var(--fs-sm);
  font-weight: 700;
}
.question-context-block {
  display: grid;
  gap: var(--sp-2);
  margin-bottom: var(--sp-5);
}
.question-part-label {
  width: fit-content;
  padding: .28rem .7rem;
  border-radius: var(--r-full);
  color: var(--brand);
  background: var(--brand-soft);
  font-size: var(--fs-xs);
  font-weight: 800;
}
.question-part-label--question { margin-bottom: var(--sp-2); }
.question-context {
  width: 100%;
  padding: var(--sp-5);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: color-mix(in srgb, var(--brand-soft) 45%, var(--surface));
  color: var(--text);
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 1.05rem;
  line-height: 1.85;
  text-align: start;
  overflow-wrap: anywhere;
}
.question-title {
  display: grid;
  justify-items: start;
  margin-bottom: var(--sp-4);
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: var(--fs-xl);
  line-height: 1.55;
  text-align: start;
  overflow-wrap: anywhere;
}
.question-title__text { display: block; }
.question-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  justify-content: flex-start;
  margin-top: var(--sp-5);
}
.question-actions .btn { min-width: 180px; }
.error-state,
.ready-state,
.completed-state {
  display: grid;
  gap: var(--sp-4);
  text-align: center;
  justify-items: center;
  padding-block: var(--sp-3);
}
.error-state p,
.ready-state p,
.completed-state p {
  max-width: 54ch;
  color: var(--text-muted);
}

@media (min-width: 680px) {
  .screen-card { padding: var(--sp-6); }
  .personalization-form .choice-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .question-body { padding: var(--sp-6); }
}

@media (max-width: 560px) {
  .route-header--compact { --header-h: 62px; }
  .assessment-main { padding-top: var(--sp-4); }
  .assessment-heading { align-items: start; }
  .assessment-heading h1 { font-size: var(--fs-lg); }
  .assessment-heading .eyebrow { display: none; }
  .screen-card,
  .question-body { padding: var(--sp-4); }
  .question-top { padding: var(--sp-3) var(--sp-4); }
  .screen-card__actions .btn,
  .question-actions .btn { width: 100%; }
  .choice-group legend,
  .question-title { font-size: var(--fs-lg); }
  .question-context { padding: var(--sp-4); font-size: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  .progress-track__fill { transition: none; }
}
