/* ── layout ──────────────────────────────────────────────────────────────── */
html, body { height: 100%; }

#wrap {
  position: relative;
  min-height: 100%;
  height: auto !important;
  margin: 0 auto -60px;
  padding: 0 0 60px;
}

#main-container { padding-top: 70px; }

#footer {
  position: relative;
  height: 60px;
  padding-top: 20px;
  border-top: 1px solid #dee2e6;
  font-size: 0.9rem;
}

.footer-button { padding-right: 1em; }
.locale-flag   { height: 0.8em; }

/* ── flash messages ──────────────────────────────────────────────────────── */
.flash-messages {
  z-index: 800;
  position: fixed;
  top: calc(1.5rem + 1.7rem);
  left: 0;
  right: 0;
  margin: 0;
  padding: 0;
}

.flash-messages .alert {
  border-radius: 0;
  margin: 0;
  text-align: center;
  padding: 0.4rem 0;
  border-left: none;
  border-right: none;
  border-top: none;
}

.flash-messages .alert + .alert { margin-top: 1px; }

.flash-messages .alert .container {
  line-height: 1.5;
}

/* ── centered page layout (login, signup, auth forms) ────────────────────── */
main.page-centered {
  min-height: calc(100vh - 56px - 60px); /* viewport minus navbar and footer */
  display: flex;
  align-items: center;
  box-sizing: border-box;
}

main.page-centered #main-container {
  padding-top: 2rem;
  padding-bottom: 2rem;
  width: 100%;
}

/* ── flex gap utilities (Bootstrap 4 lacks these natively) ───────────────── */
.gap-2 { gap: .5rem; }
.gap-3 { gap: .75rem; }

/* ── tasks ───────────────────────────────────────────────────────────────── */
.transcript {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  padding: 0.3em;
  border: 1px solid #dee2e6;
  margin: 1em;
}

.word {
  display: flex;
  flex-direction: column;
  padding: 0 0.3em 0 0;
  border-bottom: 1px solid #dee2e6;
  margin-bottom: 0.2em;
}

.clicked-word { position: relative; }

.marker {
  color: #dc3545;
  font-weight: bold;
  position: absolute;
  top: 1.1em;
}

/* ── sortable ────────────────────────────────────────────────────────────── */
.grabbable { cursor: grab; }

/* ── responses (participant flow) ────────────────────────────────────────── */
.g-recaptcha    { display: inline-block; margin-top: 1em; }
.has-tip        { color: grey; text-decoration: underline dotted; }

label.required::after {
  content: " *";
  color: #dc3545;
  font-weight: bold;
}

.validation-error { font-size: 0.875rem; margin-top: 0.25rem; }

.question-container { position: relative; }

.question-container .is-invalid,
.form-text-input.is-invalid {
  border-color: #dc3545;
  box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

.question-container .is-invalid:focus,
.form-text-input.is-invalid:focus {
  border-color: #dc3545;
  box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

/* ── question cards (participant survey) ─────────────────────────────────── */
.question-card { box-shadow: 0 1px 3px rgba(0,0,0,0.08); }

.question-card .card-body { padding: 1.5rem; }

@media screen and (min-width: 480px) {
  .question-card { width: 90%; margin: 0 auto; }
}

@media screen and (min-width: 640px) {
  .question-card { width: 75%; }
}

.question-prompt p { margin-bottom: 0.4rem; }
.question-prompt p:last-of-type { margin-bottom: 0; }
.question-prompt { font-size: 1rem; font-weight: 500; line-height: 1.5; }

/* inject the required asterisk inside the last <p> from markdown */
.prompt-required p:last-of-type::after {
  content: " *";
  color: #dc3545;
  font-weight: 700;
  font-size: 1.05em;
}

/* ── rating scale ────────────────────────────────────────────────────────── */
.rating-scale { padding: 0.25rem 0; }

.rating-scale .custom-range { display: block; width: 100%; }

.rating-ticks { padding: 0 0.5rem; }
.rating-ticks span { text-align: center; min-width: 1ch; }

.rating-value-display {
  font-size: 1.2rem;
  font-weight: 600;
  color: #495057;
  line-height: 1;
}

/* ── audio player (listening task) ──────────────────────────────────────── */
.audio-progress     { height: 6px; border-radius: 3px; }
.audio-progress-bar { width: 0%; transition: width 0.25s linear; }
.audio-player       { max-width: 520px; }

/* ── click task ──────────────────────────────────────────────────────────── */
#progress { display: block; width: 100%; height: 48px; cursor: pointer; }
.click-review-item { background: #fff; }
.click-player      { max-width: 720px; }

/* ── documentation editor ────────────────────────────────────────────────── */
.code-editor {
  font-family: monospace;
  font-size: 0.875rem;
  white-space: pre;
}

.doc-image-thumb {
  height: 40px;
  width: 60px;
  object-fit: cover;
  border: 1px solid #dee2e6;
  border-radius: 3px;
  margin-right: .75rem;
  flex-shrink: 0;
}

/* ── warning page ────────────────────────────────────────────────────────── */
.warning-page-cover {
  background: rgba(0,0,0,0.75);
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  z-index: 1040;
}

.warning-page-cover .alert {
  position: absolute;
  z-index: 1000;
  top: 60px; right: 20px; left: 20px;
}

.warning-page-cover .alert h2 { margin-top: 0; }

.warning-page-cover .alert p {
  font-size: 18px;
  line-height: 1.5;
}

/* ── pages / docs ────────────────────────────────────────────────────────── */
.docs img {
  border: 1px solid #dee2e6;
  border-radius: 3px;
  margin: 0.5em 0;
}
