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

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: #f1f5f9;
  color: #1e293b;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Page layout ── */
.page-layout {
  display: flex;
  flex: 1;
  min-height: 0;
}

/* ── Sidebar stepper ── */
.sidebar {
  width: 210px;
  min-width: 210px;
  background: #fff;
  border-right: 1px solid #e2e8f0;
  padding: 2rem 1rem;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.stepper { display: flex; flex-direction: column; gap: 0; }
.step-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem 0.5rem;
  position: relative;
}
.step-item:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 1.15rem;
  top: 2.4rem;
  width: 2px;
  height: calc(100% - 1rem);
  background: #e2e8f0;
}
.step-item.done::after { background: #16a34a; }
.step-item.active::after { background: #bfdbfe; }

.step-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  flex-shrink: 0;
  background: #f1f5f9;
  color: #94a3b8;
  border: 2px solid #e2e8f0;
  z-index: 1;
}
.step-item.done .step-icon {
  background: #dcfce7;
  border-color: #16a34a;
  color: #16a34a;
}
.step-item.active .step-icon {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
}
.step-text { display: flex; flex-direction: column; padding-top: 0.3rem; }
.step-label {
  font-size: 0.88rem;
  font-weight: 600;
  color: #94a3b8;
}
.step-item.done .step-label { color: #16a34a; }
.step-item.active .step-label { color: #1e293b; }
.step-sub {
  font-size: 0.75rem;
  color: #64748b;
  margin-top: 0.1rem;
}

/* ── Main ── */
main {
  flex: 1;
  padding: 2.5rem 2rem;
  min-width: 0;
}

/* ── Card ── */
.card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 2.5rem;
  max-width: 820px;
  margin: 0 auto;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.card.centered { text-align: center; }

h1 {
  font-size: 1.6rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 0.4rem;
}
.subtitle {
  color: #64748b;
  font-size: 1rem;
  margin-bottom: 1.8rem;
}

/* ── Info box ── */
.info-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 1.2rem 1.5rem;
  margin-bottom: 1.5rem;
  text-align: left;
}
.incentive-box { background: #fefce8; border-color: #fde68a; }
.incentive-box h2 { color: #92400e; }
.incentive-box p { color: #78350f; }

.info-box h2 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: #334155;
}
.info-box p { color: #475569; line-height: 1.6; margin-bottom: 0.5rem; }
.info-box p:last-child { margin-bottom: 0; }

/* ── Numbered consent points ── */
.consent-list {
  color: #475569;
  line-height: 1.6;
  padding-left: 1.4rem;
}
.consent-list li { margin-bottom: 1rem; }
.consent-list li:last-child { margin-bottom: 0; }

/* ── Alert ── */
.alert { padding: 0.8rem 1rem; border-radius: 8px; margin-bottom: 1.2rem; font-size: 0.9rem; }
.alert-error { background: #fef2f2; border: 1px solid #fca5a5; color: #b91c1c; }

/* ── Form ── */
.form-group {
  margin-bottom: 1.6rem;
}
.form-group > label {
  display: block;
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
  color: #334155;
}
input[type="number"], input[type="text"], select {
  width: 100%;
  max-width: 220px;
  padding: 0.5rem 0.75rem;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 0.95rem;
  color: #1e293b;
  outline: none;
  transition: border-color .15s;
}
input[type="number"]:focus, input[type="text"]:focus, select:focus { border-color: #2563eb; }

/* ── Landing page (participant ID) ── */
.landing-card { max-width: 560px; padding: 3rem 2.5rem; }
.landing-logo { display: block; margin: 0 auto 1.5rem; max-width: 320px; height: auto; }
.landing-card .subtitle { text-align: center; }
.landing-form { margin-top: 1.5rem; text-align: left; }
.landing-form input[type="text"] { max-width: 100%; text-align: center; }
.landing-btn { width: 100%; margin-top: 0.5rem; }

.radio-group { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 0.3rem; }
.radio-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  font-size: 0.93rem;
  color: #475569;
}

.hint { font-size: 0.87rem; color: #64748b; margin-bottom: 1rem; line-height: 1.5; }

/* ── 100-point allocation ── */
.allocation-grid { display: flex; flex-direction: column; gap: 0.75rem; margin-bottom: 1rem; }
.allocation-row {
  display: grid;
  grid-template-columns: 190px 80px 1fr;
  align-items: center;
  gap: 0.75rem;
}
.model-name {
  font-weight: 600;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ── Model icon ── */
.model-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.model-icon svg { width: 22px; height: 22px; display: block; }
.allocation-input {
  width: 70px;
  max-width: 70px;
  text-align: center;
}
.allocation-bar-wrap {
  height: 10px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
}
.allocation-bar {
  height: 100%;
  background: #2563eb;
  border-radius: 999px;
  width: 0%;
  transition: width .2s;
}
.points-counter {
  font-size: 0.93rem;
  font-weight: 600;
  color: #2563eb;
  margin-top: 0.5rem;
}

/* ── Question box ── */
.question-box {
  background: #f0f7ff;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  padding: 1.2rem 1.5rem;
  margin-bottom: 1.8rem;
}
.question-label {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #2563eb;
  margin-bottom: 0.4rem;
}
.question-text { font-size: 1.05rem; color: #1e293b; line-height: 1.6; }

/* ── Answer cards ── */
.answers-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem;
  margin-bottom: 1.2rem;
}
.answer-card {
  border: 2px solid color-mix(in srgb, var(--model-color, #cbd5e1) 40%, white);
  border-radius: 10px;
  padding: 1.2rem 1.3rem;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s, background .15s;
  background: color-mix(in srgb, var(--model-color, #94a3b8) 8%, white);
}
.answer-card:hover {
  border-color: var(--model-color, #93c5fd);
  background: color-mix(in srgb, var(--model-color, #94a3b8) 14%, white);
}
.answer-card.selected {
  border-color: var(--model-color, #2563eb);
  background: color-mix(in srgb, var(--model-color, #94a3b8) 20%, white);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--model-color, #2563eb) 25%, transparent);
}
.answer-label {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-bottom: 0.7rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.answer-text { font-size: 0.95rem; color: #334155; line-height: 1.65; }

/* ── Clickable-answers hint ── */
.click-hint {
  font-size: 1rem;
  color: #2563eb;
  font-weight: 600;
  margin-bottom: 1.2rem;
}

/* ── Practice badge ── */
.practice-badge {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #b45309;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 999px;
  padding: 0.3rem 0.9rem;
  margin-bottom: 1rem;
}

.neither-card { margin-bottom: 1.2rem; }
.neither-card .answer-label { color: #94a3b8; }
.neither-card.selected { border-color: #2563eb; background: #eff6ff; box-shadow: 0 0 0 3px #bfdbfe; }
.neither-card.selected .answer-label { color: #2563eb; }

.selection-hint {
  font-size: 1.05rem;
  font-weight: 700;
  color: #2563eb;
  margin-bottom: 1.2rem;
  text-align: center;
}

/* ── Form actions (submit button alignment) ── */
.form-actions {
  display: flex;
  justify-content: flex-end;
}

/* ── Buttons ── */
.btn {
  display: inline-block;
  padding: 0.65rem 1.8rem;
  border-radius: 8px;
  font-size: 0.97rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: background .15s, opacity .15s;
}
.btn-primary { background: #2563eb; color: #fff; }
.btn-primary:hover:not(:disabled) { background: #1d4ed8; }
.btn-primary:disabled { opacity: 0.45; cursor: not-allowed; }

/* ── Thank you ── */
.checkmark {
  font-size: 3.5rem;
  color: #16a34a;
  margin-bottom: 0.5rem;
}
.small-text { font-size: 0.85rem; color: #94a3b8; margin-top: 1rem; }

/* ── Footer ── */
footer {
  text-align: center;
  padding: 1.2rem;
  font-size: 0.82rem;
  color: #94a3b8;
  border-top: 1px solid #e2e8f0;
  background: #fff;
}

/* ── Trial progress ── */
.trial-progress {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.4rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e2e8f0;
}
.trial-counter { font-size: 0.88rem; font-weight: 600; color: #64748b; }
.timer-strip {
  font-size: 0.88rem;
  font-weight: 700;
  color: #2563eb;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  padding: 0.3rem 0.9rem;
}
.timer-strip.timer-low {
  color: #b91c1c;
  background: #fef2f2;
  border-color: #fca5a5;
}
.trial-dots { display: flex; gap: 0.4rem; }
.trial-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: #e2e8f0;
}
.trial-dot.done { background: #16a34a; }
.trial-dot.active { background: #2563eb; }

/* ── Likert scale ── */
.likert-group { display: flex; flex-direction: column; gap: 1.6rem; }
.likert-item { display: flex; flex-direction: column; gap: 0.3rem; }
.likert-question { font-size: 0.93rem; color: #334155; font-weight: 500; margin-bottom: 0.2rem; }
.likert-anchors {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: #94a3b8;
  margin-bottom: 0.2rem;
}
.likert-options { display: flex; gap: 0.5rem; }
.likert-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  cursor: pointer;
  flex: 1;
}
.likert-label input[type="radio"] { accent-color: #2563eb; }
.likert-label span { font-size: 0.8rem; color: #64748b; }

/* ── Consent checkbox ── */
.consent-check {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin: 1.5rem 0;
  padding: 1rem 1.2rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}
.consent-check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 2px;
  accent-color: #2563eb;
}
.consent-check label { font-size: 0.93rem; color: #334155; cursor: pointer; }

/* ── Section divider ── */
.section-divider {
  font-size: 1rem;
  font-weight: 700;
  color: #334155;
  border-bottom: 2px solid #e2e8f0;
  padding-bottom: 0.4rem;
  margin: 1.8rem 0 1rem;
}

/* ── Responsive ── */
@media (max-width: 700px) {
  .sidebar { display: none; }
  .answers-grid { grid-template-columns: 1fr; }
  .card { padding: 1.5rem; }
}
