/* ═══════════════════════════════════════════════════════
   AAAW Survey — style.css
   Paleta: #0A0A0F · #F8F7F4 · #4F46E5 · #E8E6FF · #6B7280
   Tipografia: DM Sans + DM Serif Display
   ═══════════════════════════════════════════════════════ */

/* ── Reset ────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ── Tokens ───────────────────────────────────────────── */
:root {
  --c-ink:          #0A0A0F;
  --c-bg:           #F8F7F4;
  --c-surface:      #FFFFFF;
  --c-brand:        #4F46E5;
  --c-brand-light:  #E8E6FF;
  --c-brand-mid:    #C7C4FF;
  --c-muted:        #6B7280;
  --c-border:       rgba(10, 10, 15, 0.08);
  --c-border-hover: rgba(79, 70, 229, 0.3);
  --c-error:        #DC2626;
  --c-error-bg:     #FEF2F2;
  --c-success:      #059669;
  --c-success-bg:   #ECFDF5;

  --r-card:   16px;
  --r-btn:    10px;
  --r-input:  10px;

  --shadow-card: 0 1px 3px rgba(0,0,0,0.06), 0 4px 16px rgba(0,0,0,0.04);
  --shadow-hover: 0 4px 12px rgba(79,70,229,0.12);

  --transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Base ─────────────────────────────────────────────── */
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'DM Sans', system-ui, sans-serif;
  background-color: var(--c-bg);
  color: var(--c-ink);
  line-height: 1.6;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}

/* Screen-reader only utility */
.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 utility */
.hidden {
  display: none !important;
}

/* ── Progress Rail (signature element) ───────────────── */
.progress-rail {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 3px;
  background: var(--c-border);
  z-index: 100;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--c-brand) 0%, #818CF8 100%);
  width: 0%;
  transition: width 600ms cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 0 2px 2px 0;
}

/* ── Survey Shell ─────────────────────────────────────── */
.survey-shell {
  padding-top: 3px; /* clearance for fixed progress rail */
  min-height: 100dvh;
}

/* ── Steps ────────────────────────────────────────────── */
.step {
  opacity: 1;
  transform: translateY(0);
  animation: stepIn 400ms cubic-bezier(0.4, 0, 0.2, 1) both;
}

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

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

.step-inner {
  max-width: 680px;
  margin: 0 auto;
  padding: 80px 24px 80px;
}

.step-inner.wide {
  max-width: 760px;
}

/* ── Badges / Labels ──────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--c-brand-light);
  color: var(--c-brand);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: 100px;
  margin-bottom: 28px;
}

.step-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--c-brand);
  margin-bottom: 12px;
}

.step-label-accent {
  display: inline-flex;
  align-items: center;
  font-size: 14px;
  color: var(--c-brand);
  background: linear-gradient(135deg, #FFFFFF 0%, var(--c-brand-light) 100%);
  border: none;
  border-radius: 999px;
  box-shadow: 0 8px 18px rgba(79, 70, 229, 0.08);
  padding: 7px 14px;
}

/* ── Typography ───────────────────────────────────────── */
.display-title {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--c-ink);
  margin-bottom: 20px;
}

.display-title em {
  font-style: italic;
  color: var(--c-brand);
}

.display-title.small {
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  text-align: center;
}

.section-title {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 8px;
}

.section-subtitle {
  color: var(--c-muted);
  font-size: 15px;
  margin-bottom: 36px;
}

.lead {
  font-size: 17px;
  color: var(--c-muted);
  max-width: 520px;
  margin-bottom: 36px;
  line-height: 1.7;
}

.lead.centered {
  text-align: center;
  margin-left: auto;
  margin-right: auto;
}

/* ── Welcome — meta grid ──────────────────────────────── */
.meta-grid {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 36px;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-card);
  padding: 14px 18px;
  flex: 1 1 160px;
}

.meta-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.meta-item strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--c-ink);
}

.meta-item span {
  font-size: 12px;
  color: var(--c-muted);
}

/* ── Institution block ────────────────────────────────── */
.institution-block {
  display: flex;
  align-items: center;
  gap: 20px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-card);
  padding: 20px 24px;
  margin-bottom: 40px;
}

.inst-logo {
  font-family: 'DM Serif Display', serif;
  font-size: 14px;
  font-weight: 400;
  color: var(--c-brand);
  background: var(--c-brand-light);
  border-radius: 8px;
  padding: 8px 12px;
  white-space: nowrap;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.inst-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--c-ink);
  margin-bottom: 2px;
}

.inst-program {
  font-size: 12px;
  color: var(--c-muted);
  line-height: 1.5;
  margin-bottom: 2px;
}

.inst-researcher {
  font-size: 12px;
  color: var(--c-muted);
}

/* ── Buttons ──────────────────────────────────────────── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--c-brand);
  color: #fff;
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  font-weight: 500;
  padding: 14px 28px;
  border: none;
  border-radius: var(--r-btn);
  cursor: pointer;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
  text-decoration: none;
}

.btn-primary:hover {
  background: #4338CA;
  transform: translateY(-1px);
  box-shadow: var(--shadow-hover);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary:focus-visible {
  outline: 3px solid var(--c-brand-mid);
  outline-offset: 3px;
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-spinner {
  width: 15px;
  height: 15px;
  border: 2px solid rgba(255, 255, 255, 0.38);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  color: var(--c-muted);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 500;
  padding: 14px 20px;
  border: 1px solid var(--c-border);
  border-radius: var(--r-btn);
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition), background var(--transition);
}

.btn-ghost:hover {
  color: var(--c-ink);
  border-color: rgba(10,10,15,0.2);
  background: var(--c-surface);
}

.btn-ghost:focus-visible {
  outline: 3px solid var(--c-brand-mid);
  outline-offset: 3px;
}

.nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 40px;
  gap: 12px;
}

.link-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  color: var(--c-muted);
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 0;
  transition: color var(--transition);
}

.link-btn:hover {
  color: var(--c-ink);
}

/* ── TCLE ─────────────────────────────────────────────── */
.tcle-scroll {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-card);
  padding: 28px 32px;
  max-height: 380px;
  overflow-y: auto;
  scroll-behavior: smooth;
  margin-bottom: 28px;

  /* Custom scrollbar */
  scrollbar-width: thin;
  scrollbar-color: var(--c-brand-mid) transparent;
}

.tcle-scroll::-webkit-scrollbar {
  width: 4px;
}

.tcle-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.tcle-scroll::-webkit-scrollbar-thumb {
  background: var(--c-brand-mid);
  border-radius: 2px;
}

.tcle-scroll:focus-visible {
  outline: 2px solid var(--c-brand);
  outline-offset: 2px;
}

.tcle-scroll h3 {
  font-family: 'DM Serif Display', serif;
  font-size: 16px;
  margin-bottom: 16px;
  color: var(--c-ink);
}

.tcle-scroll h4 {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--c-brand);
  margin-top: 20px;
  margin-bottom: 8px;
}

.tcle-scroll p {
  font-size: 14px;
  color: #374151;
  line-height: 1.8;
  margin-bottom: 4px;
}

.tcle-footer {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--c-border);
  font-weight: 500 !important;
  color: var(--c-ink) !important;
}

/* ── Consent checkbox ─────────────────────────────────── */
.consent-check {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  cursor: pointer;
  padding: 16px 20px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-input);
  transition: border-color var(--transition), background var(--transition);
  margin-bottom: 16px;
}

.consent-check:has(input:checked) {
  border-color: var(--c-brand);
  background: var(--c-brand-light);
}

.consent-check input {
  position: absolute;
  opacity: 0;
  width: 0; height: 0;
}

.check-box {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border: 2px solid var(--c-border);
  border-radius: 5px;
  background: var(--c-surface);
  flex-shrink: 0;
  margin-top: 1px;
  transition: all var(--transition);
}

.consent-check input:checked ~ .check-box {
  background: var(--c-brand);
  border-color: var(--c-brand);
}

.consent-check input:checked ~ .check-box::after {
  content: '';
  display: block;
  width: 5px;
  height: 9px;
  border: 2px solid white;
  border-top: none;
  border-left: none;
  transform: rotate(45deg) translate(-1px, -1px);
}

.consent-check:focus-within .check-box {
  outline: 3px solid var(--c-brand-mid);
  outline-offset: 2px;
}

.check-text {
  font-size: 14px;
  font-weight: 500;
  color: var(--c-ink);
  line-height: 1.5;
}

/* ── Error messages ───────────────────────────────────── */
.consent-error,
.questionnaire-error {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--c-error-bg);
  color: var(--c-error);
  border: 1px solid rgba(220, 38, 38, 0.15);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 20px;
}

.questionnaire-error {
  margin-top: 24px;
}

/* ── Profile form ─────────────────────────────────────── */
.profile-form {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.form-field {
  /* no explicit styles — children handle it */
}

.field-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--c-ink);
  margin-bottom: 10px;
}

/* Select */
.select-wrapper {
  position: relative;
}

.field-select {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-input);
  padding: 12px 40px 12px 16px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  color: var(--c-ink);
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.field-select:focus {
  outline: none;
  border-color: var(--c-brand);
  box-shadow: 0 0 0 3px var(--c-brand-light);
}

.field-select:hover {
  border-color: var(--c-border-hover);
}

.select-arrow {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--c-muted);
}

/* Radio grid (cards) */
.radio-fieldset {
  border: none;
  padding: 0;
}

.radio-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.radio-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  color: var(--c-ink);
  transition: all var(--transition);
  user-select: none;
}

.radio-card input {
  position: absolute;
  opacity: 0;
  width: 0; height: 0;
}

.radio-card:has(input:checked) {
  background: var(--c-brand-light);
  border-color: var(--c-brand);
  color: var(--c-brand);
  font-weight: 500;
}

.radio-card:hover {
  border-color: var(--c-brand-mid);
}

.radio-card:focus-within {
  outline: 3px solid var(--c-brand-mid);
  outline-offset: 2px;
}

/* Radio stack (list style) */
.radio-stack {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.radio-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-input);
  cursor: pointer;
  font-size: 14px;
  color: var(--c-ink);
  transition: all var(--transition);
  user-select: none;
}

.radio-row input {
  position: absolute;
  opacity: 0;
  width: 0; height: 0;
}

.radio-dot {
  width: 18px;
  height: 18px;
  border: 2px solid var(--c-border);
  border-radius: 50%;
  flex-shrink: 0;
  position: relative;
  transition: all var(--transition);
}

.radio-row:has(input:checked) {
  border-color: var(--c-brand);
  background: var(--c-brand-light);
}

.radio-row:has(input:checked) .radio-dot {
  border-color: var(--c-brand);
  background: var(--c-brand);
}

.radio-row:has(input:checked) .radio-dot::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: white;
}

.radio-row:hover {
  border-color: var(--c-brand-mid);
}

.radio-row:focus-within {
  outline: 3px solid var(--c-brand-mid);
  outline-offset: 2px;
}

/* ── Questionnaire / AAAW ─────────────────────────────── */
.likert-legend {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--c-muted);
  margin-bottom: 24px;
  padding: 0 2px;
}

#step-questionnaire {
  min-height: 100dvh;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.72), rgba(248,247,244,0.92)),
    linear-gradient(135deg, #F8F7F4 0%, #EEF7F3 48%, #F4F0FF 100%);
}

#step-questionnaire .step-inner.wide {
  max-width: 1120px;
}

#step-questionnaire .section-title,
#step-questionnaire .section-subtitle {
  text-align: center;
}

#step-questionnaire .section-subtitle {
  margin-bottom: 22px;
}

#step-questionnaire .likert-legend {
  display: none;
}

.questionnaire-panel {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(10, 10, 15, 0.08);
  border-radius: 8px;
  box-shadow: 0 18px 48px rgba(20, 20, 30, 0.08);
  padding: 24px;
}

.questionnaire-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.question-kicker {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--c-brand);
  background: linear-gradient(135deg, #FFFFFF 0%, var(--c-brand-light) 100%);
  border-radius: 999px;
  box-shadow: 0 8px 18px rgba(79, 70, 229, 0.07);
  padding: 6px 12px;
  margin-bottom: 8px;
}

.question-remaining {
  color: var(--c-muted);
  font-size: 13px;
}

.question-percent {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 54px;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  text-align: center;
  font-weight: 700;
  color: var(--c-brand);
  background: linear-gradient(135deg, #FFFFFF 0%, var(--c-brand-light) 100%);
  box-shadow: 0 10px 22px rgba(79, 70, 229, 0.09);
}

.question-progress {
  width: 100%;
  height: 8px;
  background: rgba(10, 10, 15, 0.08);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 24px;
}

.question-progress-fill {
  height: 100%;
  width: 4%;
  background: linear-gradient(90deg, var(--c-brand), #059669);
  border-radius: inherit;
  transition: width 300ms ease;
}

.single-question-card {
  border-radius: 8px;
  padding: 30px;
  min-height: 390px;
}

.single-question-title {
  font-size: 1.35rem;
  line-height: 1.35;
  font-weight: 650;
  color: var(--c-ink);
  margin-bottom: 24px;
}

.single-answer-options {
  display: grid;
  gap: 10px;
}

.answer-option {
  display: grid;
  grid-template-columns: 38px 1fr;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 58px;
  padding: 12px 16px;
  background: #fff;
  border: 1px solid var(--c-border);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition), box-shadow var(--transition), transform var(--transition);
}

.answer-option:hover {
  border-color: var(--c-border-hover);
  box-shadow: 0 8px 20px rgba(20, 20, 30, 0.06);
  transform: translateY(-1px);
}

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

.answer-value {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  color: var(--c-muted);
  font-size: 13px;
  font-weight: 700;
  transition: all var(--transition);
}

.answer-label {
  color: var(--c-ink);
  font-size: 15px;
  font-weight: 500;
}

.answer-option:has(input:checked) {
  background: var(--c-brand-light);
  border-color: var(--c-brand);
  box-shadow: 0 10px 26px rgba(79, 70, 229, 0.13);
}

.answer-option:has(input:checked) .answer-value {
  background: var(--c-brand);
  border-color: var(--c-brand);
  color: #fff;
}

.answer-option:focus-within {
  outline: 3px solid var(--c-brand-mid);
  outline-offset: 2px;
}

.question-nav {
  max-width: 1120px;
  margin: 18px auto 0;
}

.questionnaire-matrix-panel {
  padding: 18px;
}

.matrix-progress-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.matrix-scroll {
  width: 100%;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
  scrollbar-color: var(--c-brand-mid) transparent;
}

.matrix-scroll::-webkit-scrollbar {
  height: 6px;
}

.matrix-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.matrix-scroll::-webkit-scrollbar-thumb {
  background: var(--c-brand-mid);
  border-radius: 999px;
}

.likert-matrix {
  min-width: 860px;
  border: 1px solid var(--c-border);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 10px 28px rgba(20, 20, 30, 0.05);
}

.matrix-row {
  display: grid;
  grid-template-columns: minmax(300px, 1fr) repeat(5, minmax(82px, 0.32fr));
  align-items: stretch;
}

.likert-matrix .matrix-row.question-card {
  padding: 0;
  border: none;
  border-radius: 0;
  box-shadow: none;
}

.matrix-row + .matrix-row:not(.matrix-header) {
  border-top: 1px solid var(--c-border);
}

.matrix-row:nth-child(even):not(.matrix-header):not(.matrix-number-row) {
  background: rgba(248, 247, 244, 0.42);
}

.matrix-number-row {
  background: linear-gradient(180deg, #FFFFFF 0%, #FAFAFD 100%);
}

.matrix-number-spacer,
.matrix-number-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  border: none;
}

.matrix-header {
  position: sticky;
  top: 0;
  z-index: 2;
  background: linear-gradient(180deg, #FFFFFF 0%, #F6F7FB 100%);
  box-shadow: 0 1px 0 var(--c-border), 0 8px 18px rgba(20, 20, 30, 0.04);
}

.matrix-question-head,
.matrix-option-head,
.matrix-question-cell,
.matrix-choice {
  min-height: 58px;
}

.matrix-question-head,
.matrix-option-head {
  display: flex;
  align-items: center;
  padding: 12px 14px;
  font-size: 12px;
  font-weight: 700;
  color: #4B5563;
  border-right: 1px solid var(--c-border);
}

.matrix-question-head {
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.matrix-option-head {
  justify-content: center;
  text-align: center;
  min-height: 58px;
  line-height: 1.2;
  font-size: 13px;
}

.matrix-head-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  color: var(--c-brand);
  background: linear-gradient(135deg, #FFFFFF 0%, var(--c-brand-light) 100%);
  border: none;
  box-shadow: 0 10px 22px rgba(79, 70, 229, 0.09);
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 19px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0;
}

.matrix-option-head:last-child,
.matrix-choice:last-child {
  border-right: none;
}

.matrix-question-cell {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  font-size: 15px;
  line-height: 1.45;
  color: var(--c-ink);
  border-right: 1px solid var(--c-border);
  font-weight: 570;
}

.matrix-question-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  flex: 0 0 34px;
  color: var(--c-brand);
  background: linear-gradient(180deg, #FFFFFF 0%, var(--c-brand-light) 100%);
  border: 1px solid rgba(79, 70, 229, 0.24);
  box-shadow: 0 6px 14px rgba(79, 70, 229, 0.10);
  font-size: 13px;
  font-weight: 800;
}

.matrix-question-text {
  display: block;
  max-width: 540px;
}

.matrix-choice {
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-right: 1px solid var(--c-border);
  transition: background var(--transition), box-shadow var(--transition);
}

.matrix-choice:hover {
  background: var(--c-brand-light);
}

.matrix-choice input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.matrix-marker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(10, 10, 15, 0.10);
  background: linear-gradient(180deg, #FFFFFF 0%, #F7F7FA 100%);
  color: #4B5563;
  font-size: 13px;
  font-weight: 800;
  transition: all var(--transition);
}

.matrix-choice:has(input:checked) {
  background: var(--c-brand-light);
  box-shadow: inset 0 0 0 1px rgba(79, 70, 229, 0.2);
}

.matrix-choice:has(input:checked) .matrix-marker {
  background:
    radial-gradient(circle at 32% 28%, rgba(255,255,255,0.35), transparent 34%),
    linear-gradient(135deg, var(--c-brand), #059669);
  border-color: var(--c-brand);
  color: #fff;
  box-shadow: 0 8px 18px rgba(79, 70, 229, 0.24);
}

.matrix-choice:focus-within {
  outline: 3px solid var(--c-brand-mid);
  outline-offset: -3px;
  position: relative;
  z-index: 1;
}

.likert-matrix .question-card.unanswered-highlight {
  box-shadow: inset 3px 0 0 var(--c-error);
}

.likert-matrix .question-card.unanswered-highlight .matrix-question-cell {
  background: var(--c-error-bg);
}

/* Dimension block */
.dimension-block {
  margin-bottom: 40px;
}

.dimension-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--c-border);
}

.dimension-number {
  font-family: 'DM Serif Display', serif;
  font-size: 26px;
  color: var(--c-brand-mid);
  line-height: 1;
  flex-shrink: 0;
  padding-top: 2px;
}

.dimension-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--c-ink);
  margin-bottom: 3px;
}

.dimension-desc {
  font-size: 13px;
  color: var(--c-muted);
  line-height: 1.5;
}

/* Question card */
.questions-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.question-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-card);
  padding: 22px 24px;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.question-card:has(input:checked) {
  border-color: var(--c-brand-mid);
}

.question-card.unanswered-highlight {
  border-color: var(--c-error);
  box-shadow: 0 0 0 3px rgba(220,38,38,0.08);
}

.question-text {
  font-size: 14px;
  line-height: 1.7;
  color: var(--c-ink);
  margin-bottom: 18px;
}

.q-number {
  font-weight: 600;
  color: var(--c-brand);
  margin-right: 4px;
}

/* Likert scale */
.likert-scale {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.likert-option {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
}

.likert-option input {
  position: absolute;
  opacity: 0;
  width: 0; height: 0;
}

.likert-dot {
  width: 42px;
  height: 42px;
  border: 1.5px solid var(--c-border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--c-bg);
  transition: all var(--transition);
}

.likert-num {
  font-size: 13px;
  font-weight: 500;
  color: var(--c-muted);
  transition: color var(--transition);
  user-select: none;
}

.likert-option:hover .likert-dot {
  border-color: var(--c-brand);
  background: var(--c-brand-light);
}

.likert-option:hover .likert-num {
  color: var(--c-brand);
}

.likert-option input:checked ~ .likert-dot {
  background: var(--c-brand);
  border-color: var(--c-brand);
  box-shadow: 0 2px 8px rgba(79,70,229,0.25);
}

.likert-option input:checked ~ .likert-dot .likert-num {
  color: #fff;
}

.likert-option:focus-within .likert-dot {
  outline: 3px solid var(--c-brand-mid);
  outline-offset: 3px;
}

/* ── Finish screen ────────────────────────────────────── */
.finish-icon {
  display: flex;
  justify-content: center;
  margin-bottom: 24px;
}

.finish-body {
  font-size: 15px;
  color: var(--c-muted);
  text-align: center;
  line-height: 1.8;
  margin-top: 16px;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

.finish-meta {
  margin: 28px auto;
  padding: 16px 24px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-card);
  text-align: center;
  max-width: 360px;
}

.finish-meta p {
  font-size: 13px;
  color: var(--c-muted);
  line-height: 1.7;
}

.finish-meta strong {
  color: var(--c-ink);
}

#step-finish .step-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.restart-link {
  margin-top: 16px;
}

/* ── Submit status ────────────────────────────────────── */
.submit-status {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 16px;
  display: none;
}

.submit-status.success {
  display: block;
  background: var(--c-success-bg);
  color: var(--c-success);
  border: 1px solid rgba(5, 150, 105, 0.2);
}

.submit-status.error {
  display: block;
  background: var(--c-error-bg);
  color: var(--c-error);
  border: 1px solid rgba(220, 38, 38, 0.2);
}

/* ── Reduced motion ───────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .step { animation: none; }
}

/* ── Responsive ───────────────────────────────────────── */

/* Tablet */
@media (max-width: 768px) {
  .step-inner {
    padding: 60px 20px 60px;
  }

  .meta-grid {
    flex-direction: column;
  }

  .meta-item {
    flex: none;
  }

  .institution-block {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .tcle-scroll {
    padding: 20px 20px;
  }

  .dimension-header {
    gap: 12px;
  }

  .questionnaire-panel {
    padding: 20px;
  }

  .single-question-card {
    padding: 24px 20px;
    min-height: 360px;
  }

  .single-question-title {
    font-size: 1.18rem;
  }
}

/* Mobile */
@media (max-width: 480px) {
  .step-inner {
    padding: 48px 16px 64px;
  }

  .display-title {
    font-size: 1.8rem;
  }

  /* Likert scale mobile: show labels below dots */
  .likert-scale {
    gap: 4px;
  }

  .likert-dot {
    width: 36px;
    height: 36px;
  }

  .likert-num {
    font-size: 12px;
  }

  .question-card {
    padding: 18px 16px;
  }

  .radio-grid {
    flex-direction: column;
  }

  .radio-card {
    width: 100%;
  }

  .nav-row {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .nav-row .btn-primary,
  .nav-row .btn-ghost {
    justify-content: center;
    width: 100%;
  }

  .btn-primary,
  .btn-ghost {
    width: 100%;
    justify-content: center;
  }

  .tcle-scroll {
    max-height: 300px;
  }

  .dimension-block {
    margin-bottom: 32px;
  }

  .questionnaire-panel {
    padding: 16px;
  }

  .questionnaire-top {
    align-items: flex-start;
  }

  .single-question-card {
    padding: 20px 16px;
    min-height: auto;
  }

  .single-question-title {
    font-size: 1.05rem;
  }

  .answer-option {
    grid-template-columns: 34px 1fr;
    min-height: 54px;
    padding: 10px 12px;
  }

  .answer-value {
    width: 30px;
    height: 30px;
  }

  .answer-label {
    font-size: 14px;
  }
}
