/* Nüchtern & freundlich: viel Weiß, ruhige Typografie, ein Akzentton. */

:root {
  --bg: #ffffff;
  --bg-soft: #f6f8fa;
  --ink: #20242c;
  --ink-soft: #5c6672;
  --border: #e2e6ec;
  --accent: #14487d;
  --accent-dark: #0a2647;
  --accent-soft: #e7edf6;
  /* Enzianblau mit leichtem Verlauf in Schwarz, für Flächen (Buttons,
     Fortschrittsanzeige) — überwiegend blau, nur ein Hauch Schwarz am Rand.
     Für reinen Text/Rahmen/Fokus weiterhin die flachen --accent-* Farben oben. */
  --accent-gradient: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 65%, #05070a 130%);
  --accent-gradient-hover: linear-gradient(135deg, var(--accent-dark) 0%, #05070a 100%);
  --danger: #b3452f;
  --danger-soft: #fbeee9;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(10, 15, 20, 0.05), 0 4px 14px rgba(10, 15, 20, 0.06);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
}

.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px 80px;
}

.page--narrow {
  max-width: 560px;
}

h1, h2, h3 {
  font-weight: 600;
  color: var(--ink);
  line-height: 1.3;
}

h1 { font-size: 1.6rem; margin: 0 0 6px; }
h2 { font-size: 1.2rem; margin: 32px 0 12px; }
h3 { font-size: 1.02rem; margin: 20px 0 6px; }

p { color: var(--ink); }
p.lead { color: var(--ink-soft); margin-top: 0; }

a { color: var(--accent); }

.top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.top nav a {
  color: var(--ink-soft);
  text-decoration: none;
  margin-left: 16px;
  font-size: 0.92rem;
}
.top nav a:hover { color: var(--accent); }

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.72rem;
  color: var(--ink-soft);
  font-weight: 600;
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.lang-switch { font-size: 0.82rem; white-space: nowrap; }
.lang-switch a { color: var(--ink-soft); text-decoration: none; padding: 2px 3px; }
.lang-switch a:hover { color: var(--accent); }
.lang-switch a.is-active { color: var(--accent); font-weight: 700; text-decoration: underline; }
.lang-switch span { color: var(--border); margin: 0 2px; }

.card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}

.card--soft { background: var(--bg-soft); }

.section-block {
  border-top: 1px solid var(--border);
  padding-top: 20px;
  margin-top: 20px;
}
.section-block:first-child { border-top: none; padding-top: 0; margin-top: 0; }

.field { margin-bottom: 18px; }

.field label.field-label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  font-size: 0.97rem;
}

.label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.label-row .field-label { margin-bottom: 6px; }
.field-label.small { font-size: 0.84rem; color: var(--ink-soft); font-weight: 600; }

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 640px) {
  .two-col { grid-template-columns: 1fr; }
}

.questionrow {
  border-top: 1px solid var(--border);
  padding-top: 16px;
  margin-top: 16px;
}
.questionrow:first-of-type { border-top: none; padding-top: 0; margin-top: 0; }

.questionrow details { margin-top: 10px; }
.questionrow summary { cursor: pointer; }
.questionrow summary:hover { color: var(--accent); }

.answer-text {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  margin-top: 8px;
  cursor: text;
}
.answer-text::selection { background: var(--accent-soft); }

.coding-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.coding-chip:last-child { border-bottom: none; }
.coding-chip form { margin-left: auto; }

.field .hint {
  display: block;
  color: var(--ink-soft);
  font-size: 0.86rem;
  margin-bottom: 6px;
}

.field .optional-tag {
  color: var(--ink-soft);
  font-weight: 400;
  font-size: 0.82rem;
}

input[type=text], input[type=email], input[type=password], input[type=date],
input[type=number], select, textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.98rem;
  font-family: inherit;
  color: var(--ink);
  background: #fff;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

textarea { min-height: 96px; resize: vertical; }

.radio-group { display: flex; gap: 18px; flex-wrap: wrap; }
.radio-group label { font-weight: 400; display: flex; align-items: center; gap: 6px; cursor: pointer; }

/* "Kann ich nicht beurteilen" / "Can't assess this" fallback option — kept
   visually set apart from the substantive options: pushed to the far right
   of its row (flex auto-margin — still works if it wraps onto its own
   line), muted color, italic. */
.radio-group label.option-na {
  margin-left: auto;
  color: var(--ink-soft);
  font-style: italic;
}

.note-field { margin-top: 10px; min-height: 56px; }

/* Admin-only per-question note — visually distinct from the respondent's
   own optional note-field above it, so it's unmistakable during a live call
   which textarea is private. */
.note-field.admin-note {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.note-field.admin-note::placeholder { color: var(--accent-dark); opacity: 0.7; }

.admin-mode-banner {
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  color: var(--accent-dark);
  padding: 12px 16px;
}

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
}
.checkbox-row input { margin-top: 3px; }

.btn {
  display: inline-block;
  border: none;
  border-radius: 8px;
  padding: 11px 18px;
  font-size: 0.96rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  background: var(--bg-soft);
  color: var(--ink);
  border: 1px solid var(--border);
}
.btn:hover { background: var(--border); }

.btn-primary { background: var(--accent-gradient); color: #fff; border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-gradient-hover); border-color: var(--accent-dark); }

.btn-danger { background: var(--danger-soft); color: var(--danger); border-color: #eeceC2; }
.btn-danger:hover { background: #f6ddd4; }

.btn-small { padding: 6px 12px; font-size: 0.85rem; }

.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 24px; }

.flash {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: 0.93rem;
}
.flash--success { background: var(--accent-soft); color: var(--accent-dark); }
.flash--error { background: var(--danger-soft); color: var(--danger); }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
th, td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
th { color: var(--ink-soft); font-weight: 600; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.03em; }
tr:last-child td { border-bottom: none; }

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  background: var(--bg-soft);
  color: var(--ink-soft);
  border: 1px solid var(--border);
  white-space: nowrap;
}
.badge--pending { background: #f4f0e6; color: #8a6d1f; border-color: #e9dfc4; }
.badge--sent { background: #e9f0fb; color: #2b5b9e; border-color: #d3e2f7; }
.badge--opened { background: #f0e9fb; color: #6a3fa0; border-color: #e1d3f5; }
.badge--completed { background: var(--accent-soft); color: var(--accent-dark); border-color: #cfe6dd; }

.muted { color: var(--ink-soft); }
.small { font-size: 0.85rem; }
.right { text-align: right; }
.mt0 { margin-top: 0; }

.table-wrap { overflow-x: auto; }

.inline-select select { width: auto; padding: 4px 8px; font-size: 0.85rem; }

.footer-note {
  margin-top: 40px;
  color: var(--ink-soft);
  font-size: 0.82rem;
  text-align: center;
}

.researcher-card {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.researcher-photo {
  width: 95px;
  height: 95px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.researcher-card a { font-size: 0.92rem; }

.researcher-bio {
  display: block;
  color: var(--ink-soft);
  font-size: 0.86rem;
  margin-top: 2px;
}

.salutation-line {
  font-weight: 600;
  margin-bottom: 4px;
}

.consent-text {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px 18px;
  font-size: 0.93rem;
  color: var(--ink);
  margin-bottom: 16px;
}

.progress-hint {
  font-size: 0.82rem;
  color: var(--ink-soft);
}

/* Chapter stepper: fill bar + meta line always visible; the arrow row is a
   progressive enhancement that only appears once assets/interview.js has
   confirmed it can paginate (body.js-ready) — without it, every .chapter
   stays in normal flow and the whole questionnaire is one scrollable page,
   so the arrows would otherwise sit there doing nothing. */
.stepper {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  padding: 14px 0 10px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.stepper-track {
  height: 6px;
  background: var(--bg-soft);
  border-radius: 999px;
  overflow: hidden;
}

.stepper-fill {
  height: 100%;
  background: var(--accent-gradient);
  border-radius: 999px;
  transition: width 0.25s ease;
  width: 0%;
}

.stepper-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 8px;
  font-size: 0.82rem;
  color: var(--ink-soft);
}
.stepper-meta strong { color: var(--ink); }
.stepper-percent { font-weight: 600; color: var(--accent-dark); }
.save-status { margin-left: auto; font-style: italic; }

.stepper-arrows {
  display: none;
  margin-top: 12px;
  overflow-x: auto;
}
.js-ready .stepper-arrows { display: flex; }

.stepper-arrow {
  flex: 1 0 auto;
  min-width: 84px;
  position: relative;
  border: none;
  background: var(--bg-soft);
  color: var(--ink-soft);
  padding: 9px 16px 9px 24px;
  margin-right: -12px;
  font-size: 0.76rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 0 100%, 12px 50%);
}
.stepper-arrow:first-child {
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 0 100%);
  padding-left: 14px;
}
.stepper-arrow:last-child { margin-right: 0; }
.stepper-arrow.is-current { background: var(--accent-gradient); color: #fff; z-index: 2; }
.stepper-arrow.is-done { background: var(--accent-soft); color: var(--accent-dark); }

/* Chapter pagination itself: hidden state is toggled via the native `hidden`
   attribute from JS, so no CSS rule is needed to show/hide chapters — this
   keeps the no-JS fallback trivially correct (nothing here overrides it). */
.chapter-nav {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: -8px 0 20px;
}
.chapter-nav [data-next], .chapter-nav [data-prev] { display: none; }
.js-ready .chapter-nav [data-next], .js-ready .chapter-nav [data-prev] { display: inline-block; }

/* Per-question info tooltip ("?" button), replacing the always-visible hint
   line for interview questions — the probe/context text is often long, so a
   tooltip keeps the question list scannable while still being one click (or
   hover) away. */
.qtip {
  position: relative;
  display: inline-block;
  margin-left: 6px;
  vertical-align: middle;
}
.qtip-btn {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--ink-soft);
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 18px;
  padding: 0;
  cursor: pointer;
}
.qtip-btn:hover, .qtip-btn:focus { background: var(--accent-soft); color: var(--accent-dark); border-color: var(--accent-soft); outline: none; }
.qtip-bubble {
  display: none;
  position: absolute;
  z-index: 30;
  left: 0;
  top: 130%;
  width: 320px;
  max-width: min(80vw, 320px);
  background: var(--ink);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 400;
  line-height: 1.45;
  padding: 12px 14px;
  border-radius: 8px;
  box-shadow: var(--shadow);
  text-align: left;
}
.qtip-btn:hover + .qtip-bubble,
.qtip-btn:focus + .qtip-bubble,
.qtip.is-open .qtip-bubble { display: block; }
@media (max-width: 640px) {
  .qtip-bubble { left: auto; right: 0; width: 260px; }
}

/* Inline glossary term (annotate_glossary()) — same .qtip/.qtip-bubble
   mechanics as the "?" hint button above, just styled as a plain
   dotted-underlined word inline in running text instead of a round badge. */
.qtip.qtip-inline { margin-left: 0; vertical-align: baseline; }
.qtip-btn--word {
  width: auto;
  height: auto;
  border: none;
  border-radius: 0;
  border-bottom: 1px dotted var(--ink-soft);
  background: none;
  color: inherit;
  font: inherit;
  line-height: inherit;
  padding: 0;
  cursor: help;
}
.qtip-btn--word:hover, .qtip-btn--word:focus {
  background: none;
  color: var(--accent-dark);
  border-bottom-color: var(--accent-dark);
  outline: none;
}

.thankyou {
  text-align: center;
  padding: 60px 20px;
}
.thankyou .icon { font-size: 2.6rem; margin-bottom: 12px; }

@media (max-width: 640px) {
  .page { padding: 20px 16px 60px; }
  .card { padding: 18px; }
  .radio-group { flex-direction: column; gap: 8px; }
}
