/* ── afrAIca Pulse - AI Readiness Assessment Styles (Mobile-First) ──────── */

/* ── Assessment Layout ────────────────────────────────────────────────────── */
.assessment-wrapper {
  max-width: 760px;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
}

@media (min-width: 768px) {
  .assessment-wrapper { padding: 2rem 1.5rem 4rem; }
}

/* ── Progress Bar ─────────────────────────────────────────────────────────── */
.progress-bar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
}

@media (min-width: 768px) {
  .progress-bar { padding: 1.25rem 1.5rem; margin-bottom: 2rem; }
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  font-size: 0.85rem;
}
.progress-meta .step-label { font-weight: 600; color: var(--text); }
.progress-meta .step-count { color: var(--text-muted); }

.progress-track {
  height: 4px;
  background: var(--surface-2);
  border-radius: 2px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: 2px;
  background: var(--primary);
  transition: width 0.4s ease;
}

.dimension-tabs {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}
.dim-tab {
  font-size: 0.7rem;
  padding: 0.3rem 0.7rem;
  min-height: 36px;
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--text-dim);
  font-weight: 500;
  border: 1px solid transparent;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
}
.dim-tab.active   { background: var(--primary);   color: #F2F0EB; border-color: var(--primary); }
.dim-tab.complete { background: var(--surface-2); color: var(--text-muted); border-color: var(--border-strong); }

/* ── Question Card ────────────────────────────────────────────────────────── */
.question-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
  animation: fadeSlide 0.25s ease;
}

@media (min-width: 768px) {
  .question-card { padding: 2rem; margin-bottom: 1.5rem; }
}

@keyframes fadeSlide {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.question-number {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

.question-text {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.5;
  margin-bottom: 1.25rem;
}

@media (min-width: 768px) {
  .question-text { font-size: 1.05rem; margin-bottom: 1.5rem; }
}

.options-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  list-style: none;
}

.option-item {
  display: flex;
  align-items: flex-start;
  gap: 0.875rem;
  padding: 0.875rem 1rem;
  min-height: 48px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
  user-select: none;
}

@media (min-width: 768px) {
  .option-item { padding: 0.9rem 1.1rem; gap: 1rem; }
}

.option-item:hover {
  border-color: var(--primary);
  background: rgba(204, 0, 0, 0.06);
}
.option-item.selected {
  border-color: var(--primary);
  background: rgba(204, 0, 0, 0.1);
}
.option-item:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.option-radio {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--text-dim);
  flex-shrink: 0;
  margin-top: 1px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color var(--transition), background var(--transition);
}

@media (min-width: 768px) {
  .option-radio { width: 18px; height: 18px; margin-top: 2px; }
}

.option-item.selected .option-radio {
  border-color: var(--primary);
  background: var(--primary);
}
.option-item.selected .option-radio::after {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #F2F0EB;
}

.option-text { color: var(--text-muted); font-size: 0.9rem; line-height: 1.4; }
.option-item.selected .option-text { color: var(--text); }

/* ── Question Navigation ──────────────────────────────────────────────────── */
.question-nav {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

@media (min-width: 480px) {
  .question-nav {
    flex-direction: row;
    justify-content: space-between;
    margin-top: 1.5rem;
    gap: 1rem;
  }
}

/* ── Organisation Info Form ───────────────────────────────────────────────── */
.org-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
}

@media (min-width: 768px) {
  .org-form { padding: 2rem; margin-bottom: 1.5rem; }
}

.org-form h2 { margin-bottom: 0.5rem; }
.org-form > p { margin-bottom: 1.5rem; }

/* ── Results ──────────────────────────────────────────────────────────────── */
.results-wrapper { animation: fadeSlide 0.35s ease; }

.results-hero {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem 1.25rem;
  text-align: center;
  margin-bottom: 1.5rem;
}

@media (min-width: 768px) {
  .results-hero { padding: 3rem 2rem; margin-bottom: 2rem; }
}

.results-hero h2 { margin-bottom: 0.25rem; }

/* Score ring */
.score-ring {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  border: 5px solid var(--primary);
  background: var(--surface-2);
  margin: 1.25rem auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

@media (min-width: 768px) {
  .score-ring { width: 160px; height: 160px; margin: 1.5rem auto; }
}

.score-ring .score-value {
  font-size: 2.4rem;
  font-weight: 900;
  color: var(--text);
  line-height: 1;
}

@media (min-width: 768px) {
  .score-ring .score-value { font-size: 2.6rem; }
}

.score-ring .score-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Readiness bands */
.readiness-band {
  display: inline-block;
  padding: 0.5rem 1.5rem;
  border-radius: 4px;
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 1rem;
  border: 1px solid transparent;
}
.band-not-ready  {
  background: rgba(204, 0, 0, 0.14);
  color: #DD4444;
  border-color: rgba(204, 0, 0, 0.3);
}
.band-early {
  background: rgba(180, 80, 0, 0.12);
  color: #CC7722;
  border-color: rgba(180, 80, 0, 0.25);
}
.band-emerging {
  background: rgba(242, 240, 235, 0.07);
  color: #A09C95;
  border-color: rgba(242, 240, 235, 0.12);
}
.band-progressive {
  background: rgba(242, 240, 235, 0.1);
  color: #C8C4BC;
  border-color: rgba(242, 240, 235, 0.2);
}
.band-ready {
  background: var(--primary);
  color: #F2F0EB;
  border-color: var(--primary);
}

/* Dimension score bars */
.dimension-scores {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 1.25rem 0;
  text-align: left;
}

@media (min-width: 768px) {
  .dimension-scores { margin: 1.5rem 0; }
}

.dim-score-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem 1rem;
  align-items: center;
  font-size: 0.85rem;
}

@media (min-width: 520px) {
  .dim-score-row { grid-template-columns: 160px 1fr 50px; }
}

@media (min-width: 768px) {
  .dim-score-row { grid-template-columns: 180px 1fr 50px; gap: 1rem; }
}

.dim-score-row .dim-name {
  color: var(--text-muted);
  font-weight: 500;
  grid-column: 1 / -1;
}

@media (min-width: 520px) {
  .dim-score-row .dim-name { grid-column: 1; }
}

.dim-score-bar {
  height: 6px;
  background: var(--surface-2);
  border-radius: 2px;
  overflow: hidden;
  grid-column: 1 / -1;
}

@media (min-width: 520px) {
  .dim-score-bar { grid-column: 2; }
}

.dim-score-fill {
  height: 100%;
  border-radius: 2px;
  background: var(--primary);
  transition: width 0.6s ease;
}
.dim-score-pct {
  color: var(--text);
  font-weight: 700;
  text-align: right;
  justify-self: end;
}

.results-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: stretch;
  margin-top: 1.5rem;
}

@media (min-width: 480px) {
  .results-actions {
    flex-direction: row;
    justify-content: center;
    flex-wrap: wrap;
    align-items: center;
  }
}

/* ── Continental Index ────────────────────────────────────────────────────── */
.index-page-header {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.5rem 1rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

@media (min-width: 768px) {
  .index-page-header { padding: 2rem 1.5rem 1rem; }
}

.sort-select {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.6rem 0.85rem;
  color: var(--text);
  font-family: var(--font);
  font-size: 0.875rem;
  cursor: pointer;
  min-height: 44px;
  -webkit-appearance: none;
}
.sort-select:focus {
  outline: 2px solid var(--primary);
  outline-offset: -1px;
}

.country-grid {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.75rem;
}

@media (min-width: 520px) {
  .country-grid { grid-template-columns: repeat(auto-fill, 200px); justify-content: center; gap: 1rem; }
}

@media (min-width: 768px) {
  .country-grid { padding: 1rem 1.5rem 4rem; }
}

.country-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem;
  transition: border-color var(--transition);
}

@media (min-width: 768px) {
  .country-card { padding: 1.25rem; }
}

.country-card:hover { border-color: var(--border); }

.country-rank  { font-size: 0.7rem; font-weight: 700; color: var(--text-dim); margin-bottom: 0.25rem; }
.country-name  { font-weight: 700; color: var(--text); font-size: 0.9rem; margin-bottom: 0.75rem; }
.country-score { font-size: 1.75rem; font-weight: 900; color: var(--primary); line-height: 1; margin-bottom: 0.5rem; }

@media (min-width: 768px) {
  .country-name  { font-size: 0.95rem; }
  .country-score { font-size: 1.8rem; }
}

.country-bar {
  height: 4px;
  background: var(--surface-2);
  border-radius: 2px;
  overflow: hidden;
}
.country-bar-fill { height: 100%; background: var(--primary); border-radius: 2px; }

/* ── Slider Question ──────────────────────────────────────────────────────── */
.slider-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 1rem 0;
}

.slider-value-display {
  font-size: 3rem;
  font-weight: 900;
  color: var(--primary);
  line-height: 1;
  min-width: 2rem;
  text-align: center;
}

.slider-input {
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  background: var(--surface-2);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}
.slider-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  border: 2px solid var(--primary-dark);
}
.slider-input::-moz-range-thumb {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  border: 2px solid var(--primary-dark);
}

@media (min-width: 768px) {
  .slider-input { height: 4px; }
  .slider-input::-webkit-slider-thumb { width: 22px; height: 22px; }
  .slider-input::-moz-range-thumb { width: 22px; height: 22px; }
}

.slider-track-labels {
  width: 100%;
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-dim);
}

/* ── Multiselect Question ────────────────────────────────────────────────── */
.option-checkbox {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  border: 2px solid var(--text-dim);
  flex-shrink: 0;
  margin-top: 1px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color var(--transition), background var(--transition);
}

@media (min-width: 768px) {
  .option-checkbox { width: 18px; height: 18px; margin-top: 2px; }
}

.option-checkbox.checked {
  border-color: var(--primary);
  background: var(--primary);
}
.option-checkbox.checked::after {
  content: '';
  width: 8px;
  height: 5px;
  border-left: 2px solid #F2F0EB;
  border-bottom: 2px solid #F2F0EB;
  transform: rotate(-45deg) translateY(-1px);
  display: block;
}

.option-item.selected .option-checkbox { border-color: var(--primary); }

.multiselect-counter {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-top: 0.5rem;
  text-align: right;
}

/* ── Question Instruction ────────────────────────────────────────────────── */
.question-instruction {
  font-size: 0.82rem;
  color: var(--text-dim);
  margin-bottom: 1rem;
  font-style: italic;
}
