/* Research survey pages (/research/). Builds on /css/style.css tokens. */

.survey .lede-s { font-size: 1.15rem; color: var(--muted); }
.survey progress {
  display: block; width: 100%; height: 0.5rem; margin: 0 0 2rem;
  appearance: none; -webkit-appearance: none; border: 0; border-radius: 999px;
  background: var(--line); overflow: hidden;
}
.survey progress::-webkit-progress-bar { background: var(--line); border-radius: 999px; }
.survey progress::-webkit-progress-value { background: var(--accent); border-radius: 999px; }
.survey progress::-moz-progress-bar { background: var(--accent); border-radius: 999px; }
.survey .progress-text { color: var(--muted); font-size: 0.93rem; margin: -0.5rem 0 0.5rem !important; }

.survey-form { margin-top: 1.5rem; }
.survey-form .q { border: 0; padding: 0; margin: 0 0 2.25rem; min-width: 0; }
.survey-form legend, .survey-form .qlabel {
  display: block; padding: 0; margin: 0 0 0.6rem;
  font-weight: 600; font-size: 1.05rem; line-height: 1.45;
}
.survey-form .help { margin: -0.25rem 0 0.7rem !important; color: var(--muted); font-size: 0.95rem; }
.survey-form .req { color: var(--accent); }
.survey-form .opt { font-weight: 400; color: var(--muted); }

.choices { display: grid; gap: 0.4rem; }
.choice {
  display: flex; align-items: flex-start; gap: 0.7rem;
  padding: 0.6rem 0.8rem; border: 1px solid var(--line); border-radius: 8px;
  background: var(--card); cursor: pointer; line-height: 1.4;
  transition: border-color 0.15s;
}
.choice:hover { border-color: var(--accent); }
.choice:has(input:checked) { border-color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
.choice input { flex: none; width: 1.1rem; height: 1.1rem; margin: 0.12rem 0 0; accent-color: var(--accent); }

.scale .choices { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.scale .choice { flex-direction: column; align-items: center; text-align: center; font-size: 0.92rem; padding: 0.7rem 0.4rem; }
.scale .choice input { margin: 0 0 0.25rem; }
@media (max-width: 640px) {
  .scale .choices { grid-template-columns: 1fr; }
  .scale .choice { flex-direction: row; align-items: flex-start; text-align: left; font-size: 1rem; padding: 0.6rem 0.8rem; }
  .scale .choice input { margin: 0.12rem 0 0; }
}

.survey-form .rank { display: grid; grid-template-columns: 5rem minmax(0, 1fr); align-items: center; gap: 0.75rem; margin: 0 0 0.5rem; }
.survey-form .rank label { font-weight: 600; color: var(--muted); }
.survey-form select, .survey-form textarea, .survey-form input[type=number] {
  width: 100%; padding: 0.65rem 0.75rem; font: inherit; color: var(--ink);
  background: var(--card); border: 1px solid var(--line); border-radius: 6px;
}
.survey-form select:focus, .survey-form textarea:focus, .survey-form input[type=number]:focus { border-color: var(--accent); }
.survey-form .num { display: flex; align-items: center; gap: 0.5rem; }
.survey-form .num input { max-width: 7rem; }
@media (max-width: 480px) {
  .survey-form .rank { grid-template-columns: 1fr; gap: 0.3rem; }
}

.survey-form .has-err .choice, .survey-form .has-err select, .survey-form .has-err input, .survey-form .has-err textarea { border-color: #c0392b; }
.err { color: #b3261e; font-weight: 600; margin: 0 0 0.6rem !important; }
@media (prefers-color-scheme: dark) { .err { color: #ff8a80; } }
.err-summary { border: 2px solid #b3261e; border-radius: 8px; padding: 0.8rem 1rem; margin: 0 0 1.5rem; }
.err-summary p { margin: 0 !important; }

.req-note { color: var(--muted); font-size: 0.9rem; }
.req-note span { color: var(--accent); }
.survey-nav { display: flex; flex-wrap: wrap; gap: 0.75rem; justify-content: space-between; margin-top: 1rem; }
.survey-nav .btn:only-child { margin-left: auto; }

.check label { display: flex; gap: 0.6rem; align-items: flex-start; font-weight: 400; }
.form .check input[type=checkbox] { width: 1.1rem; height: 1.1rem; flex: none; margin-top: 0.25rem; accent-color: var(--accent); }
.start-form { margin-top: 2.5rem; padding: 1.5rem; background: var(--card); border: 1px solid var(--line); border-radius: 12px; max-width: none; }
.start-form .cf-turnstile { margin: 0 0 1.1rem; }
.ref { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: 0.08em; background: var(--card); border: 1px solid var(--line); border-radius: 4px; padding: 0.1em 0.4em; }

/* results area */
.research-admin { max-width: var(--wide); }
.research-admin h1 { margin-bottom: 1.25rem; }
.research-admin h2 { margin: 2.25rem 0 0.8rem; font-size: 1.35rem; }
.research-admin table { border-collapse: collapse; width: 100%; max-width: 40rem; font-size: 0.95rem; }
.research-admin th, .research-admin td { text-align: left; padding: 0.45rem 0.6rem; border-bottom: 1px solid var(--line); }
.research-admin td:last-child, .research-admin th:last-child { text-align: right; }
.research-admin .notice { background: var(--card); border-left: 3px solid var(--accent); padding: 0.6rem 0.9rem; }
.research-admin .form { margin-top: 0.5rem; }

.share-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.survey .form input[readonly] { color: var(--muted); }
