/* =====================================================
   PT3 – FRAGEBÖGEN & FORMULARE (neu 2026)
   Wird zusätzlich zu style.css auf Formularseiten geladen
   ===================================================== */
.fb-wrap { max-width: 820px; margin: 0 auto; padding: 2.5rem 1.25rem 4rem; }
.fb-intro {
  background: var(--green-light);
  border: 1px solid var(--green-muted);
  border-radius: var(--r-lg);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.75rem;
  font-size: .95rem;
  color: var(--gray-800);
}
.fb-intro strong { color: var(--green-deep); }
.fb-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-sm);
}
.fb-card legend, .fb-card-title { font-weight: 700; font-size: 1.02rem; color: var(--gray-900); padding: 0 .4rem; margin-bottom: .5rem; }
fieldset.fb-card { border: 1px solid var(--border); }
.fb-row { display: flex; gap: 1rem; flex-wrap: wrap; }
.fb-row > label { flex: 1 1 220px; display: flex; flex-direction: column; gap: .35rem; font-weight: 600; font-size: .9rem; color: var(--gray-800); }
.fb-card input[type="text"],
.fb-card input[type="date"],
.fb-card input[type="email"],
.fb-card input[type="tel"],
.fb-card input[type="number"],
.fb-card select,
.fb-card textarea {
  width: 100%;
  padding: .65rem .8rem;
  border: 1px solid var(--gray-200);
  border-radius: var(--r-sm);
  font-family: var(--font);
  font-size: .95rem;
  color: var(--text);
  background: var(--white);
  box-sizing: border-box;
}
.fb-card textarea { min-height: 90px; resize: vertical; }
.fb-card input:focus, .fb-card textarea:focus, .fb-card select:focus { outline: 2px solid var(--green-muted); border-color: var(--green); }
.fb-q { font-weight: 600; font-size: .95rem; color: var(--gray-800); margin: .85rem 0 .4rem; }
.fb-hint { font-size: .83rem; color: var(--text-muted); margin-bottom: .5rem; }
.fb-range-line { display: flex; align-items: center; gap: .85rem; margin: .5rem 0 1rem; }
.fb-range-line input[type="range"] { flex: 1; }
.fb-range-value {
  min-width: 38px; text-align: center; font-weight: 700;
  color: var(--green-deep); background: var(--green-light);
  border: 1px solid var(--green-muted); border-radius: var(--r-sm);
  padding: .15rem .4rem; font-size: .95rem;
}
input[type="range"].fb-range {
  -webkit-appearance: none; appearance: none;
  height: 8px; background: var(--gray-200);
  border-radius: var(--r-full); outline: none;
}
input[type="range"].fb-range::-webkit-slider-thumb {
  -webkit-appearance: none; width: 22px; height: 22px;
  background: var(--green); border: 3px solid var(--white);
  box-shadow: 0 1px 5px rgba(0,0,0,.25); border-radius: 50%; cursor: pointer;
}
input[type="range"].fb-range::-moz-range-thumb {
  width: 18px; height: 18px; background: var(--green);
  border: 3px solid var(--white); box-shadow: 0 1px 5px rgba(0,0,0,.25);
  border-radius: 50%; cursor: pointer;
}
.fb-options { display: flex; flex-direction: column; gap: .45rem; margin: .5rem 0 .75rem; }
.fb-options label {
  display: flex; align-items: flex-start; gap: .55rem;
  font-size: .92rem; color: var(--gray-800);
  padding: .5rem .75rem; border: 1px solid var(--border);
  border-radius: var(--r-sm); cursor: pointer;
  transition: background var(--t), border-color var(--t);
}
.fb-options label:hover { background: var(--off); }
.fb-options input { margin-top: .2rem; accent-color: var(--green-dark); }
.fb-options label:has(input:checked) { background: var(--green-light); border-color: var(--green); }
.fb-options-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: .45rem .8rem; }
.fb-yesno { display: flex; gap: .6rem; }
.fb-yesno label { flex: 1; justify-content: center; text-align: center; }
.pt3-captcha {
  background: var(--off); border: 1.5px dashed var(--green);
  border-radius: var(--r-md); padding: 1rem 1.25rem; margin: 1.5rem 0 1rem;
}
.pt3-captcha-label { font-weight: 700; font-size: .9rem; color: var(--gray-900); margin-bottom: .5rem; }
.pt3-captcha-required { color: var(--green-dark); }
.pt3-captcha-row { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.pt3-captcha-question { font-size: 1.05rem; font-weight: 700; color: var(--green-deep); }
.pt3-captcha-input {
  width: 110px; padding: .55rem .7rem;
  border: 1px solid var(--gray-200); border-radius: var(--r-sm);
  font-size: 1rem; font-weight: 600;
}
.pt3-status { font-weight: 600; margin-top: 1rem; text-align: center; min-height: 1.4em; }
.pt3-status-ok { color: #1b7f1b; }
.pt3-status-err { color: #b00020; }
.fb-submit {
  display: block; width: 100%; padding: .9rem;
  background: var(--green); color: var(--white);
  font-size: 1.05rem; font-weight: 700; font-family: var(--font);
  border: none; border-radius: var(--r-md); cursor: pointer;
  transition: background var(--t), transform var(--t); margin-top: 1rem;
}
.fb-submit:hover:not(:disabled) { background: var(--green-dark); transform: translateY(-1px); }
.fb-submit:disabled { opacity: .6; cursor: wait; }
.fb-canvas-wrap {
  position: relative; width: 100%; max-width: 520px; aspect-ratio: 1 / 1;
  margin: .5rem 0; background: #fff; border: 1px solid var(--gray-200);
  border-radius: var(--r-sm); overflow: hidden;
}
.fb-canvas-wrap canvas { position: absolute; left: 0; top: 0; width: 100%; height: 100%; touch-action: none; display: block; }
.fb-tools { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin: .5rem 0 1rem; }
.fb-tools button {
  padding: .4rem .8rem; border-radius: var(--r-sm);
  border: 1px solid var(--gray-200); background: var(--white);
  cursor: pointer; font-family: var(--font); font-size: .85rem;
  font-weight: 600; color: var(--gray-800);
}
.fb-tools button:hover, .fb-tools button.active { background: var(--green-light); border-color: var(--green); }
.fb-sign-wrap { width: 100%; max-width: 520px; border: 1px solid var(--gray-200); border-radius: var(--r-sm); background: #fff; }
.fb-sign-wrap canvas { width: 100%; height: 160px; display: block; touch-action: none; }
.fb-dyn-row { display: flex; gap: .6rem; margin-bottom: .6rem; flex-wrap: wrap; }
.fb-dyn-row input { flex: 1 1 140px; }
.fb-dyn-add {
  background: var(--green-light); border: 1px solid var(--green-muted);
  color: var(--green-deep); font-weight: 600; padding: .45rem .9rem;
  border-radius: var(--r-sm); cursor: pointer; font-family: var(--font); font-size: .85rem;
}
.fb-dyn-add:hover { background: var(--green-muted); }
.ov-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 640px) { .ov-grid { grid-template-columns: 1fr; } }
.ov-btn {
  position: relative; display: flex; align-items: center; justify-content: space-between;
  gap: 14px; text-decoration: none; background: var(--white);
  border: 1px solid var(--border); border-radius: 18px; padding: 18px;
  color: var(--gray-900); font-weight: 700; font-size: 16px; line-height: 1.2;
  box-shadow: 0 10px 25px rgba(15, 23, 42, .08);
  transition: transform var(--t), box-shadow var(--t), border-color var(--t);
}
.ov-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 45px rgba(15, 23, 42, .12);
  border-color: var(--green); color: var(--gray-900);
}
.ov-btn::after { content: '→'; font-size: 1.2rem; color: var(--green-dark); flex-shrink: 0; }
.ov-btn small { display: block; font-weight: 500; font-size: .8rem; color: var(--text-muted); margin-top: 2px; }
.dl-list { display: flex; flex-direction: column; gap: .8rem; }
.dl-item {
  display: flex; align-items: center; gap: 1rem;
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 1rem 1.25rem;
  transition: border-color var(--t), box-shadow var(--t);
}
.dl-item:hover { border-color: var(--green); box-shadow: var(--shadow-sm); }
.ms-progress { display: flex; align-items: center; gap: .4rem; margin-bottom: 1.5rem; }
.ms-progress-bar { flex: 1; height: 8px; background: var(--gray-200); border-radius: var(--r-full); overflow: hidden; }
.ms-progress-fill { height: 100%; background: linear-gradient(90deg, var(--green), var(--green-dark)); border-radius: var(--r-full); transition: width .3s ease; }
.ms-progress-text { font-size: .82rem; font-weight: 600; color: var(--text-muted); white-space: nowrap; }
.ms-step { display: none; }
.ms-step.active { display: block; animation: msFade .25s ease; }
@keyframes msFade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.ms-nav { display: flex; gap: .75rem; margin-top: 1.25rem; }
.ms-nav .fb-submit { margin-top: 0; }
.ms-btn-back {
  padding: .9rem 1.5rem; background: var(--white);
  border: 1.5px solid var(--gray-200); color: var(--gray-800);
  border-radius: var(--r-md); font-family: var(--font);
  font-size: 1rem; font-weight: 600; cursor: pointer;
}
.ms-btn-back:hover { background: var(--gray-100); }
.fb-note { font-size: .8rem; color: var(--text-muted); }
.fb-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.fb-table th, .fb-table td { border: 1px solid var(--border); padding: .55rem .7rem; text-align: left; }
.fb-table th { background: var(--green-light); color: var(--gray-900); }
@media (max-width: 640px) { .fb-card { padding: 1.1rem; } }

/* ── Überspringen-Button (Schulterscreen) ─────────────── */
.fb-skip-btn {
border: 1px solid var(--line, #dfe9c9);
background: #f4f6ee;
color: #64716b;
border-radius: 999px;
padding: 6px 14px;
font-size: 13px;
font-weight: 700;
cursor: pointer;
transition: all .2s ease;
}
.fb-skip-btn.is-active {
background: #ffe9c9;
border-color: #e8bd7d;
color: #8a5a1d;
}

/* ── Ranking-Zeilen (PSB) ─────────────────────────────── */
.fb-rank-row {
display: flex;
align-items: center;
gap: 12px;
border: 1px solid var(--line, #dfe9c9);
background: #fff;
border-radius: 14px;
padding: 10px 14px;
margin-bottom: 8px;
}
.fb-rank-badge {
display: grid;
place-items: center;
width: 34px;
height: 34px;
border-radius: 10px;
background: #f2f9e3;
color: #86b93b;
font-weight: 800;
flex-shrink: 0;
}
.fb-rank-name { flex: 1; font-weight: 600; }
.fb-rank-actions { display: flex; gap: 6px; }
.fb-rank-btn {
border: 1px solid var(--line, #dfe9c9);
background: #f2f9e3;
color: #86b93b;
width: 32px;
height: 32px;
border-radius: 10px;
cursor: pointer;
font-weight: 800;
}
.fb-rank-btn:disabled { opacity: .35; cursor: not-allowed; }

/* ── Checkbox-Grid (PSB Aktivitäten) ──────────────────── */
.fb-check-grid {
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
gap: 10px;
}
.fb-check {
position: relative;
display: flex;
cursor: pointer;
}
.fb-check input {
position: absolute;
inset: 0;
opacity: 0;
cursor: pointer;
}
.fb-check span {
width: 100%;
min-height: 50px;
display: flex;
align-items: center;
padding: 12px 14px;
border-radius: 14px;
border: 1px solid var(--line, #dfe9c9);
background: #fbfef7;
font-weight: 600;
transition: all .2s ease;
}
.fb-check input:checked + span {
background: rgba(171, 212, 99, .2);
border-color: #9fcb4d;
box-shadow: inset 0 0 0 1px #9fcb4d;
}
@media (max-width: 640px) {
.fb-check-grid { grid-template-columns: 1fr; }
}

/* ── 3-Spalten-Reihe (SEBT Versuche) ──────────────────── */
.fb-row-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 640px) { .fb-row-3 { grid-template-columns: 1fr; } }

/* ── Pill-Button Antwortzeilen (KOOS/HOOS/NDI/CSI Redesign) ───────────────── */
.fb-q-block { margin-bottom: 1.4rem; }
.fb-q-block:last-child { margin-bottom: 0; }
.fb-q-label {
  font-size: .97rem; font-weight: 600; color: var(--gray-900);
  margin-bottom: .55rem; line-height: 1.45;
}
.fb-q-id {
  display: inline-block; background: var(--green); color: #fff;
  font-size: .78rem; font-weight: 700; padding: .15rem .45rem;
  border-radius: 999px; margin-right: .45rem; vertical-align: middle;
}
.fb-pills {
  display: flex; flex-wrap: wrap; gap: .4rem;
}
.fb-pills label {
  display: inline-flex; align-items: center; justify-content: center;
  padding: .45rem .9rem; border: 1.5px solid var(--border);
  border-radius: 999px; font-size: .88rem; font-weight: 500;
  color: var(--gray-800); cursor: pointer; background: #fff;
  transition: background var(--t), border-color var(--t), color var(--t);
  user-select: none; -webkit-user-select: none;
}
.fb-pills label:hover { background: var(--off); border-color: var(--green); }
.fb-pills input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; }
.fb-pills label:has(input:checked) {
  background: var(--green); border-color: var(--green); color: #fff; font-weight: 700;
}
/* NDI: lange Texte brauchen volle Breite */
.fb-pills-stack { flex-direction: column; }
.fb-pills-stack label {
  border-radius: var(--r-sm); justify-content: flex-start;
  padding: .55rem 1rem; text-align: left;
}
/* Subscale-Trenner */
.fb-subscale-header {
  display: flex; align-items: center; gap: .75rem;
  margin: 1.6rem 0 .8rem; padding-bottom: .5rem;
  border-bottom: 2px solid var(--green-light);
}
.fb-subscale-header h3 {
  font-size: 1rem; font-weight: 700; color: var(--green-deep); margin: 0;
}
.fb-subscale-hint {
  font-size: .85rem; color: var(--gray-600); margin: -.3rem 0 .9rem; font-style: italic;
}
/* Fortschrittsanzeige */
.fb-progress-bar {
  height: 6px; background: var(--border); border-radius: 999px;
  margin: .5rem 0 1.5rem; overflow: hidden;
}
.fb-progress-fill {
  height: 100%; background: var(--green); border-radius: 999px;
  transition: width .3s ease; width: 0%;
}

/* ── Anmeldeformular Spezifisch ────────────────────────────────────────── */
.fb-check-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: .5rem; margin: .75rem 0;
}
.fb-check {
  display: flex; align-items: center; gap: .6rem;
  padding: .55rem .85rem; border: 1.5px solid var(--border);
  border-radius: var(--r-sm); cursor: pointer; background: #fff;
  transition: background var(--t), border-color var(--t);
  font-size: .88rem; font-weight: 500;
}
.fb-check:hover { background: var(--off); border-color: var(--green); }
.fb-check input[type="checkbox"] { width: 1.1rem; height: 1.1rem; accent-color: var(--green-dark); }
.fb-check:has(input:checked) { background: var(--green-light); border-color: var(--green); }

.fb-conditional {
  margin-top: 1.25rem; padding: 1.25rem;
  background: var(--off); border-left: 4px solid var(--green);
  border-radius: 0 var(--r-md) var(--r-md) 0;
}
.fb-table-wrap { overflow-x: auto; margin-top: .75rem; }
.fb-table { width: 100%; border-collapse: collapse; min-width: 400px; }
.fb-table th, .fb-table td {
  border: 1px solid var(--border); padding: .65rem;
  text-align: left; font-size: .88rem;
}
.fb-table th { background: var(--green-light); font-weight: 700; color: var(--green-deep); }
.fb-table input {
  width: 100%; border: 1px solid var(--border); border-radius: var(--r-sm);
  padding: .5rem .7rem; font-family: inherit; font-size: .88rem;
}
.fb-add-row {
  margin-top: .75rem; padding: .55rem 1.1rem; border-radius: 999px;
  border: 1px solid var(--green); background: #fff; color: var(--green-dark);
  cursor: pointer; font-weight: 600; font-size: .85rem; transition: all var(--t);
}
.fb-add-row:hover { background: var(--green); color: #fff; }

.hp-sign-wrap {
  position: relative; width: 100%; max-width: 520px; margin: 1rem 0;
  border: 1.5px solid var(--border); border-radius: var(--r-md); background: #fff;
}
.hp-sign-wrap canvas { width: 100%; height: 160px; display: block; touch-action: none; cursor: crosshair; }
.hp-tools { display: flex; gap: .6rem; margin: .5rem 0 1.5rem; }
.hp-tools button {
  padding: .5rem 1rem; border-radius: 999px; border: 1px solid var(--border);
  background: #fff; color: var(--gray-700); cursor: pointer; font-size: .82rem; font-weight: 600;
}
.hp-tools button:hover { background: var(--off); color: var(--green-dark); border-color: var(--green); }
