/* ==========================================================================
   Public questionnaire (q.php) — mobile-first, paged layout.
   Loaded after styles.css; everything is scoped to body.q-v2.
   ========================================================================== */
.q-v2 {
  --q-green: #3E8745;
  --q-green-dark: #2f6b35;
  --q-green-soft: #eaf3eb;
  --q-teal: #268D9E;
  --q-ink: #22251f;
  --q-muted: #646a5f;
  --q-line: #e2e5dc;
  --q-bg: #f3f5f0;
  --q-card: #ffffff;
  --q-danger: #b3432b;
  --q-radius: 18px;
  --q-radius-sm: 12px;
  --q-shadow: 0 1px 2px rgba(30, 40, 20, .05), 0 8px 28px rgba(30, 40, 20, .07);
  background: var(--q-bg);
  color: var(--q-ink);
  font-size: 17px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}
.q-v2 * { -webkit-tap-highlight-color: transparent; }
.q-v2 h1, .q-v2 h2 { color: var(--q-ink); letter-spacing: -.01em; }
.q-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- top bar + progress ---- */
.q-v2 .q-top { position: sticky; top: 0; z-index: 20; background: rgba(255, 255, 255, .94); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--q-line); }
.q-v2 .q-top-inner { max-width: 860px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.q-v2 .q-logo { height: 30px; width: auto; }
.q-lang-select { position: relative; display: inline-flex; align-items: center; gap: 6px; color: var(--q-muted); border: 1px solid var(--q-line); border-radius: 999px; padding: 4px 10px 4px 10px; background: #fff; }
.q-lang-select select { border: 0; background: transparent; font: inherit; font-size: .9rem; color: var(--q-ink); padding: 2px 0; appearance: auto; max-width: 9.5rem; }
.q-lang-select select:focus { outline: none; }
.q-lang-select:focus-within { outline: 2px solid var(--q-teal); outline-offset: 2px; }
.q-progress { max-width: 860px; margin: 0 auto; padding: 0 16px 10px; }
.q-progress-track { height: 6px; background: var(--q-green-soft); border-radius: 999px; overflow: hidden; }
.q-progress-track span { display: block; height: 100%; width: 4%; background: linear-gradient(90deg, var(--q-green), #5aa95f); border-radius: 999px; transition: width .35s ease; }
.q-progress-text { font-size: .82rem; color: var(--q-muted); margin-top: 5px; }

/* ---- layout ---- */
.q-v2 .q-main { max-width: 860px; margin: 0 auto; padding: 18px 16px 110px; }
.q-v2 .q-card { background: var(--q-card); border-radius: var(--q-radius); box-shadow: var(--q-shadow); padding: 22px 20px; border: 0; margin: 0 0 16px; }
.q-preview-banner { background: #e6f2f4; color: #1d6a77; border-radius: var(--q-radius-sm); padding: 10px 14px; margin-bottom: 14px; font-size: .92rem; }
.q-js .q-step:not(.q-current) { display: none; }
.q-v2 .q-section.q-off, .q-v2 .q-section.q-empty { display: none; }
.q-v2 .q-section { border: 0; margin: 0; padding: 0; }
.q-js .q-step.q-current { animation: q-in .28s ease both; }
@keyframes q-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .q-js .q-step.q-current { animation: none; } .q-progress-track span { transition: none; } }

/* ---- welcome ---- */
.q-hero { position: relative; border-radius: var(--q-radius); overflow: hidden; margin-bottom: 16px; background: #26412a; box-shadow: var(--q-shadow); }
.q-hero picture, .q-hero img { display: block; width: 100%; height: 100%; }
.q-hero img { aspect-ratio: 4 / 4.4; object-fit: cover; }
.q-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10, 20, 8, 0) 30%, rgba(10, 20, 8, .78) 100%); }
.q-hero-text { position: absolute; left: 0; right: 0; bottom: 0; padding: 22px 20px; color: #fff; z-index: 1; }
.q-hero-plain { background: linear-gradient(135deg, var(--q-green-dark), var(--q-teal)); }
.q-hero-plain::after { display: none; }
.q-hero-plain .q-hero-text { position: static; }
.q-kicker { display: inline-block; font-size: .78rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; background: rgba(255, 255, 255, .18); border: 1px solid rgba(255, 255, 255, .3); border-radius: 999px; padding: 3px 10px; backdrop-filter: blur(4px); }
.q-v2 .q-hero h1 { color: #fff; font-size: clamp(1.55rem, 5.6vw, 2.35rem); line-height: 1.15; margin: 12px 0 8px; text-shadow: 0 1px 12px rgba(0, 0, 0, .25); }
.q-meta { margin: 0; font-size: .95rem; opacity: .95; }
.q-meta-time { display: inline-flex; align-items: center; gap: 6px; background: rgba(255, 255, 255, .16); border-radius: 999px; padding: 4px 12px; }
.q-intro { font-size: 1rem; color: #3a3f35; margin-bottom: 18px; }
.q-start-row { margin: 18px 0 8px; }
.q-small { font-size: .82rem; color: var(--q-muted); margin: 10px 0 0; }
.q-resume { background: var(--q-green-soft); border-radius: var(--q-radius-sm); padding: 14px 16px; margin: 16px 0 6px; }
.q-resume p { margin: 0 0 10px; }
.q-resume-actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* Living Lab picker (open link) */
.q-ll-pick legend { font-weight: 700; margin-bottom: 10px; }
.q-ll-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.q-ll-option { position: relative; display: flex; flex-direction: column; gap: 2px; border: 1.5px solid var(--q-line); border-radius: var(--q-radius-sm); padding: 12px 14px; cursor: pointer; background: #fff; transition: border-color .15s, background .15s; min-height: 64px; justify-content: center; }
.q-ll-option input { position: absolute; opacity: 0; pointer-events: none; }
.q-ll-name { font-weight: 700; letter-spacing: .02em; }
.q-ll-country { font-size: .85rem; color: var(--q-muted); }
.q-ll-option:hover { border-color: #b9cdb6; }
.q-ll-option:has(input:checked) { border-color: var(--q-green); background: var(--q-green-soft); box-shadow: inset 0 0 0 1px var(--q-green); }
.q-ll-option:has(input:focus-visible) { outline: 2px solid var(--q-teal); outline-offset: 2px; }

/* ---- section pages ---- */
.q-v2 .q-section-card { padding: 0; overflow: hidden; }
.q-v2 fieldset.q-item { border: 0; margin: 0; padding: 18px 0; min-width: 0; }
.q-v2 .q-welcome fieldset.q-item { padding-top: 4px; }
.q-banner, .q-banner img { display: block; width: 100%; }
.q-banner img { height: auto; aspect-ratio: 3 / 1; object-fit: cover; }
.q-section-body { padding: 20px 20px 8px; }
.q-v2 .q-section-title { font-size: clamp(1.3rem, 4.4vw, 1.65rem); line-height: 1.2; margin: 2px 0 6px; outline: none; }
.q-section-desc { color: var(--q-muted); margin: 0 0 8px; font-size: .95rem; }

/* ---- questions ---- */
.q-v2 .q-item { margin: 0; padding: 18px 0; border-top: 1px solid var(--q-line); }
.q-v2 .q-section-body > .q-item:first-of-type, .q-v2 .q-page-errors + .q-item { border-top: 0; }
.q-v2 .q-item > label, .q-v2 .q-item legend { font-weight: 650; font-size: 1.02rem; line-height: 1.35; margin-bottom: 10px; color: var(--q-ink); }
.q-v2 .q-help { font-size: .88rem; color: var(--q-muted); margin: -4px 0 10px; }
.q-v2 .req { color: var(--q-danger); }
.q-v2 .q-item input[type=text], .q-v2 .q-item input[type=email], .q-v2 .q-item input[type=tel], .q-v2 .q-item input[type=url],
.q-v2 .q-item input[type=number], .q-v2 .q-item input[type=date], .q-v2 .q-item select, .q-v2 .q-item textarea {
  width: 100%; font: inherit; font-size: 1rem; padding: 12px 14px; border: 1.5px solid #d5dacd; border-radius: var(--q-radius-sm); background: #fff; color: var(--q-ink); transition: border-color .15s, box-shadow .15s;
}
.q-v2 .q-item input:focus, .q-v2 .q-item select:focus, .q-v2 .q-item textarea:focus { outline: none; border-color: var(--q-green); box-shadow: 0 0 0 3px rgba(62, 135, 69, .18); }
.q-v2 .q-item textarea { min-height: 110px; resize: vertical; }
.q-v2 .q-item.q-info { background: none; border: 0; border-top: 1px solid var(--q-line); border-radius: 0; padding: 18px 0; }
.q-v2 .q-info .q-info, .q-v2 div.q-info:not(.q-item) { background: #f2f7f1; border-inline-start: 4px solid var(--q-green); border-radius: var(--q-radius-sm); padding: 14px 16px; font-size: .95rem; color: #2f3a2c; }

/* choice tiles */
.q-v2 .q-choices { display: flex; flex-direction: column; gap: 8px; }
.q-v2 .q-choices.inline { flex-direction: row; flex-wrap: wrap; }
.q-v2 .q-choices.inline .q-choice { flex: 1 1 120px; }
.q-v2 .q-choice { position: relative; display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1.5px solid var(--q-line); border-radius: var(--q-radius-sm); background: #fff; cursor: pointer; font-weight: 400; transition: border-color .15s, background .15s; min-height: 50px; }
.q-v2 .q-choice:hover { border-color: #b9cdb6; }
.q-v2 .q-choice input { flex: 0 0 auto; margin: 0; width: 20px; height: 20px; accent-color: var(--q-green); }
.q-v2 .q-choice:has(input:checked) { border-color: var(--q-green); background: var(--q-green-soft); }
.q-v2 .q-choice:has(input:disabled:not(:checked)) { opacity: .45; cursor: not-allowed; }
.q-v2 .q-choice:has(input:focus-visible) { outline: 2px solid var(--q-teal); outline-offset: 2px; }
.q-v2 .q-consent { align-items: flex-start; }
.q-v2 .q-other { margin-top: 8px; }

/* rating 1..N */
.q-v2 .q-rating { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.q-v2 .q-rating-end { order: 2; flex: 1 0 40%; font-size: .82rem; color: var(--q-muted); }
.q-v2 .q-rating-end:last-child { text-align: end; }
.q-v2 .q-rating-step { display: block; flex: 1 1 0; min-width: 34px; }
.q-v2 .q-rating-step span { display: flex; width: 100%; height: 46px; align-items: center; justify-content: center; border: 1.5px solid var(--q-line); border-radius: 10px; background: #fff; font-weight: 600; transition: all .12s; }
.q-v2 .q-rating-step input:checked + span { background: var(--q-green); color: #fff; border-color: var(--q-green); transform: translateY(-1px); box-shadow: 0 4px 10px rgba(62, 135, 69, .25); }

/* grids (rating_matrix / choice_matrix) */
.q-v2 .q-matrix { gap: 6px; }
.q-v2 .q-mx-head { top: 64px; border-radius: 8px; }
.q-v2 .q-mx-row { border-radius: var(--q-radius-sm); padding: 10px 8px; }
.q-v2 .q-mx-row:nth-child(even) { background: #f6f8f3; }
.q-v2 .q-mx-num { min-width: 36px; height: 40px; border-radius: 10px; border-width: 1.5px; font-weight: 600; }
.q-v2 .q-mx-cell input:checked + .q-mx-num { box-shadow: 0 3px 8px rgba(62, 135, 69, .25); }
.q-mx-legend { display: none; }
@media (max-width: 700px) {
  .q-mx-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: .8rem; color: var(--q-muted); margin: 0 0 8px; }
  .q-mx-legend b { color: var(--q-ink); }
  .q-v2 .q-matrix-rating .q-mx-pl { display: none; }
  .q-v2 .q-mx-row { background: #f6f8f3; margin-bottom: 4px; }
  .q-v2 .q-mx-row:nth-child(even) { background: #f6f8f3; }
  .q-v2 .q-matrix-rating .q-mx-num { height: 40px; }
}

/* ranking */
.q-v2 .q-ranking li { border-radius: var(--q-radius-sm); padding: 10px 12px; border-width: 1.5px; }
.q-v2 .q-ranking button { min-width: 38px; min-height: 36px; border-radius: 8px; }

/* organisation lookup */
.q-v2 .q-org-list { border-radius: var(--q-radius-sm); box-shadow: 0 12px 30px rgba(0, 0, 0, .12); }
.q-v2 .q-org-list li { padding: 11px 14px; }

/* stakeholder category */
.q-v2 .q-cat { gap: 14px; }

/* ---- errors ---- */
.q-v2 .q-error-box { background: #fbeeea; color: #8a2f1c; border-radius: var(--q-radius-sm); padding: 12px 14px; margin: 6px 0 12px; font-size: .95rem; }
.q-v2 .q-item.q-invalid > label, .q-v2 .q-item.q-invalid legend { color: var(--q-danger); }
.q-v2 .q-item.q-invalid .q-choice, .q-v2 .q-item.q-invalid input[type=text], .q-v2 .q-item.q-invalid input[type=email], .q-v2 .q-item.q-invalid input[type=number],
.q-v2 .q-item.q-invalid select, .q-v2 .q-item.q-invalid textarea, .q-v2 .q-item.q-invalid .q-ll-option { border-color: #e2a597; }
.q-err { color: var(--q-danger); font-size: .88rem; margin-top: 8px; font-weight: 600; }
.q-err::before { content: "! "; }

/* ---- buttons + navigation ---- */
.q-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-weight: 650; font-size: 1rem; border-radius: 999px; padding: 12px 22px; min-height: 48px; border: 1.5px solid transparent; cursor: pointer; text-decoration: none; transition: background .15s, transform .1s, box-shadow .15s; }
.q-btn:active { transform: translateY(1px); }
.q-btn:focus-visible { outline: 2px solid var(--q-teal); outline-offset: 3px; }
.q-btn-primary { background: var(--q-green); color: #fff; box-shadow: 0 6px 16px rgba(62, 135, 69, .28); }
.q-btn-primary:hover { background: var(--q-green-dark); }
.q-btn-ghost { background: #fff; color: var(--q-ink); border-color: var(--q-line); }
.q-btn-ghost:hover { border-color: #b9cdb6; }
.q-btn-lg { width: 100%; padding: 15px 24px; font-size: 1.08rem; }
.q-arrow { display: inline-block; transition: transform .15s; }
.q-btn:hover .q-arrow { transform: translateX(3px); }
.q-btn:hover .q-arrow-back { transform: translateX(-3px); }
[dir=rtl] .q-arrow { transform: scaleX(-1); }
[dir=rtl] .q-btn:hover .q-arrow { transform: scaleX(-1) translateX(3px); }
.q-nav { display: flex; gap: 10px; justify-content: space-between; }
.q-nav [hidden] { display: none; }
.q-nav .q-btn { flex: 1 1 0; }
.q-nav .q-btn-ghost { flex: 0 0 auto; }
.q-js .q-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 15; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: rgba(255, 255, 255, .96); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-top: 1px solid var(--q-line); justify-content: center; }
.q-js .q-nav > * { max-width: 420px; }
.q-js .q-nav.q-nav-hidden { display: none; }
.q-v2 .q-submit { margin: 0; }
.q-v2 form:not(.q-js) .q-nav { margin-top: 18px; }

/* ---- thank you ---- */
.q-done { text-align: center; }
.q-done-pic img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3.4; object-fit: cover; border-radius: var(--q-radius); box-shadow: var(--q-shadow); }
.q-done-card { margin-top: -48px !important; position: relative; max-width: 620px; margin-left: auto !important; margin-right: auto !important; }
.q-done-icon { width: 64px; height: 64px; border-radius: 50%; background: var(--q-green); color: #fff; display: flex; align-items: center; justify-content: center; margin: -54px auto 10px; box-shadow: 0 8px 20px rgba(62, 135, 69, .35); }
.q-done-card h1 { margin: 6px 0 8px; }

/* ---- footer ---- */
.q-footer { max-width: 860px; margin: 0 auto; padding: 8px 16px 120px; display: flex; gap: 14px; align-items: center; color: var(--q-muted); font-size: .78rem; }
.q-footer .q-eu { height: 34px; width: auto; flex: 0 0 auto; }
.q-footer p { margin: 0; }

/* ---- larger screens ---- */
@media (min-width: 640px) {
  .q-v2 .q-main { padding-top: 28px; }
  .q-hero img { aspect-ratio: 16 / 9; }
  .q-done-pic img { aspect-ratio: 16 / 9; }
  .q-hero-text { padding: 30px 32px; }
  .q-v2 .q-card { padding: 30px 32px; }
  .q-v2 .q-section-card { padding: 0; }
  .q-section-body { padding: 26px 32px 12px; }
  .q-ll-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .q-btn-lg { width: auto; min-width: 240px; }
  .q-v2 .q-rating { flex-wrap: nowrap; }
  .q-v2 .q-rating-end { order: 0; flex: 0 1 auto; max-width: 9rem; }
  .q-v2 .q-rating-step { flex: 0 0 46px; }
}
@media (min-width: 900px) {
  .q-v2 .q-choices.q-choices-cols { display: grid; grid-template-columns: 1fr 1fr; }
}
