/*
 * Teilnehmendenseiten (Projektplan 7.2).
 *
 * Vorgaben, die hier zaehlen: eine Frage je Bildschirm, Aussage in grosser
 * gut lesbarer Schrift, fuenf Antwortflaechen gross genug fuer Daumenbedienung.
 * Deshalb ist die Grundschrift groesser als im Adminbereich und die
 * Antwortflaechen sind mindestens 48 Pixel hoch.
 */

:root {
    --ink: #1c1c1f;
    --ink-soft: #5f5f68;
    --line: #dcdce0;
    --bg: #ffffff;
    --bg-soft: #f6f6f7;
    --accent: #2c4f7c;
    --accent-soft: #eaf0f7;
    --warn: #8a5a00;
    --warn-bg: #fdf6e6;
    --bad: #9b2226;
    --bad-bg: #fdecec;
    --ok: #1f6b3f;
    --ok-bg: #edf6f0;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
    font-size: 17px;
    line-height: 1.6;
    color: var(--ink);
    background: var(--bg);
}

main { max-width: 40rem; margin: 0 auto; padding: 1.5rem 1.15rem 4rem; }

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

h1 { font-size: 1.65rem; line-height: 1.25; margin: .5rem 0 1rem; }
h2 { font-size: 1.2rem; margin: 2rem 0 .6rem; }

.lead { font-size: 1.1rem; }
.muted { color: var(--ink-soft); }
.small { font-size: .9rem; }
.hint { font-size: .87rem; color: var(--ink-soft); }
ul.spaced > li { margin-bottom: .6rem; }

.site-head {
    display: flex; align-items: center; justify-content: space-between;
    max-width: 40rem; margin: 0 auto; padding: .9rem 1.15rem;
}
.site-head .brand { font-weight: 600; text-decoration: none; color: var(--ink); }
.site-foot { max-width: 40rem; margin: 0 auto; padding: 1rem 1.15rem 2rem; font-size: .87rem; }

hr { border: none; border-top: 1px solid var(--line); margin: 2rem 0; }

/* -- Meldungen ------------------------------------------------------------- */

.flash { padding: .8rem 1rem; border-radius: 6px; margin: 0 0 1.25rem; }
.flash-info  { background: var(--accent-soft); }
.flash-ok    { background: var(--ok-bg); }
.flash-error { background: var(--bad-bg); color: var(--bad); }

.notice { background: var(--bg-soft); border-left: 4px solid var(--line); border-radius: 4px; padding: .9rem 1.1rem; margin: 1.25rem 0; }
.notice-warn { background: var(--warn-bg); border-left-color: var(--warn); }

/* -- Formulare ------------------------------------------------------------- */

.stack { display: flex; flex-direction: column; gap: .3rem; margin: 1.5rem 0; }
.stack label { margin-top: .9rem; font-weight: 600; font-size: .95rem; }

input[type="email"], input[type="text"] {
    font: inherit; padding: .7rem .8rem;
    border: 1px solid var(--line); border-radius: 6px; background: var(--bg);
    width: 100%;
}
input:focus-visible, button:focus-visible, a:focus-visible {
    outline: 3px solid var(--accent); outline-offset: 2px;
}

.code-input { font-family: ui-monospace, Consolas, monospace; letter-spacing: .12em; text-transform: uppercase; font-size: 1.15rem; }

button { font: inherit; cursor: pointer; border-radius: 6px; border: 1px solid var(--line); background: var(--bg-soft); padding: .6rem 1rem; }
button.primary { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 600; }
button.big { padding: .85rem 1.4rem; font-size: 1.05rem; margin-top: 1.25rem; }
.linklike { background: none; border: none; padding: 0; color: var(--accent); text-decoration: underline; }
.inline { display: inline; }

.consent { margin-top: 1.25rem; }
.checkbox { display: flex; gap: .7rem; align-items: flex-start; font-weight: 400; }
.checkbox input { margin-top: .35rem; width: 1.15rem; height: 1.15rem; flex: none; }

/* -- Einstieg -------------------------------------------------------------- */

.choices { display: grid; gap: .75rem; margin: 1.75rem 0; }
.choice {
    display: block; padding: 1.1rem 1.2rem; border: 1px solid var(--line);
    border-radius: 8px; text-decoration: none; color: var(--ink);
}
.choice strong { display: block; font-size: 1.1rem; }
.choice span { color: var(--ink-soft); font-size: .95rem; }
.choice:hover { border-color: var(--accent); }
.choice-primary { border-color: var(--accent); background: var(--accent-soft); }

/* -- Zugangscode ----------------------------------------------------------- */

.codebox {
    display: flex; flex-wrap: wrap; gap: .75rem; align-items: center;
    background: var(--bg-soft); border: 2px dashed var(--line);
    border-radius: 10px; padding: 1.4rem 1.2rem; margin: 1.5rem 0;
}
.code {
    font-family: ui-monospace, Consolas, monospace;
    font-size: clamp(1.8rem, 9vw, 2.6rem);
    font-weight: 700; letter-spacing: .1em; user-select: all;
}
.copy { margin-left: auto; }

/* -- Situationsanker ------------------------------------------------------- */

fieldset { border: 1px solid var(--line); border-radius: 8px; padding: 1rem 1.1rem; margin: 1.25rem 0; }
legend { font-weight: 600; padding: 0 .4rem; }

.scale-0-10 { display: grid; grid-template-columns: repeat(11, 1fr); gap: .25rem; margin: .5rem 0; }
.scale-point input { position: absolute; opacity: 0; width: 0; height: 0; }
.scale-point span {
    display: flex; align-items: center; justify-content: center;
    min-height: 2.7rem; border: 1px solid var(--line); border-radius: 5px;
    cursor: pointer; font-size: .95rem;
}
.scale-point input:checked + span { background: var(--accent); color: #fff; border-color: var(--accent); }
.scale-point input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
.scale-ends { display: flex; justify-content: space-between; font-size: .82rem; color: var(--ink-soft); }

.options { display: grid; gap: .5rem; }
.option { display: flex; gap: .7rem; align-items: center; padding: .7rem .9rem; border: 1px solid var(--line); border-radius: 6px; cursor: pointer; }
.option input { width: 1.15rem; height: 1.15rem; }
.option:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }

/* -- Fragebogen ------------------------------------------------------------ */

.progress { margin: .5rem 0 1.5rem; }
.progress-text { margin: .45rem 0 0; font-size: .9rem; color: var(--ink-soft); }

/*
 * Fortschrittsbalken. Das progress-Element bringt eine eigene Darstellung mit,
 * die je nach Browser sehr verschieden aussieht - deshalb appearance: none und
 * die Pseudoelemente. Sie muessen einzeln stehen: Kennt ein Browser eines der
 * beiden nicht, verwirft er sonst die ganze Regelgruppe.
 */
.progress-bar {
    display: block;
    width: 100%;
    height: 6px;
    border: none;
    border-radius: 3px;
    background: var(--bg-soft);
    -webkit-appearance: none;
    appearance: none;
    overflow: hidden;
}
.progress-bar::-webkit-progress-bar { background: var(--bg-soft); border-radius: 3px; }
.progress-bar::-webkit-progress-value { background: var(--accent); border-radius: 3px; transition: width .2s ease; }
.progress-bar::-moz-progress-bar { background: var(--accent); border-radius: 3px; }

.reminder { background: var(--accent-soft); border-radius: 6px; padding: .7rem .9rem; margin-bottom: 1.25rem; font-size: .95rem; }

/* Aussage in grosser, gut lesbarer Schrift (Projektplan 7.2). */
.statement {
    font-size: clamp(1.3rem, 5.5vw, 1.65rem);
    line-height: 1.35;
    margin: 1.5rem 0 2rem;
    min-height: 4.5rem;
}

.answers { display: grid; gap: .55rem; }
.answer {
    display: flex; align-items: center; gap: .9rem;
    width: 100%; min-height: 3.4rem; padding: .7rem 1rem;
    text-align: left; background: var(--bg); border: 1px solid var(--line);
}
.answer:hover { border-color: var(--accent); background: var(--accent-soft); }
.answer.chosen { border-color: var(--accent); background: var(--accent); color: #fff; }
.answer-key {
    flex: none; width: 1.9rem; height: 1.9rem; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: var(--bg-soft); font-size: .9rem; font-weight: 600; color: var(--ink-soft);
}
.answer.chosen .answer-key { background: rgba(255,255,255,.25); color: #fff; }
.answer-label { font-size: 1.02rem; }

/*
 * "Das kann ich nicht beurteilen" (007_rater_skip.sql).
 *
 * Absichtlich anders als die fuenf: kleiner, ohne Rahmen, mit Abstand darueber,
 * rechts statt ueber die ganze Breite. Wer die Reihe der Antworten durchgeht,
 * liest sie nicht als sechste Stufe - und wer sie braucht, findet sie.
 */
.skip-form { display: flex; justify-content: flex-end; margin-top: 1rem; }
/*
 * Noetig, weil das display oben das hidden-Attribut sonst ueberstimmt: Beim
 * Weiterschalten ohne Seitenwechsel blendet survey.js die Auslassung aus, wenn
 * die naechste Aussage keine Skalenaussage ist.
 */
.skip-form[hidden] { display: none; }
.skip-answer {
    background: none; border: none; padding: .35rem .1rem;
    font-size: .92rem; color: var(--ink-soft); text-decoration: underline;
}
.skip-answer:hover { color: var(--accent); }
.skip-answer.chosen { color: var(--accent); font-weight: 600; }

.survey-nav { display: flex; align-items: center; justify-content: space-between; margin: 1.5rem 0 .5rem; gap: 1rem; }
.survey-nav .back { text-decoration: none; }
/*
 * Auf der ersten Frage bleibt die Zurueck-Schaltflaeche unsichtbar, aber
 * vorhanden - sonst findet survey.js sie nie (siehe die Anmerkung in
 * app/View/survey/question.php). 'visibility' haelt den Platz, damit die
 * Abschluss-Schaltflaeche rechts stehen bleibt.
 */
.invisible { visibility: hidden; }

.autosave-hint { font-size: .87rem; color: var(--ink-soft); margin: 1.5rem 0 .5rem; }
.autosave-warn { color: var(--warn); font-weight: 600; }
.keyboard-hint { margin-top: 0; }
kbd {
    font-family: inherit; font-size: .85em; padding: .05rem .35rem;
    border: 1px solid var(--line); border-radius: 3px; background: var(--bg-soft);
}

/* Auf dem Mobiltelefon ist die Tastaturhilfe sinnlos. */
@media (hover: none) and (pointer: coarse) {
    .keyboard-hint { display: none; }
}

/* -- Tabellen (Einwilligung) ----------------------------------------------- */

.table { width: 100%; border-collapse: collapse; margin: 1rem 0; }
.table th, .table td { text-align: left; padding: .5rem .6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { font-size: .85rem; color: var(--ink-soft); }

.button-link {
    display: inline-block; padding: .8rem 1.4rem; border-radius: 6px;
    background: var(--accent); color: #fff; text-decoration: none; font-weight: 600;
}
.button-link:hover { background: #24406a; }

/* -- Freigabe je Projekt (Selbstbedienung, Phase 6) ------------------------- */
/*
 * Je Vorhaben ein eigener Kasten mit einem eigenen Knopf. Bewusst nicht eine
 * Liste mit Schaltern und einem Speichern-Knopf am Ende: Jede dieser Angaben
 * ist eine eigene Entscheidung ueber eine eigene Person am anderen Ende, und
 * sie soll einzeln getroffen und einzeln bestaetigt werden.
 */
.release {
    border: 1px solid var(--line); border-radius: 6px;
    padding: 1rem 1.15rem; margin: 1rem 0;
}
.release h3 { margin: 0 0 .15rem; }
.release p { margin: .35rem 0 .75rem; }

/* Zweite Entscheidung im selben Kasten: Paarbericht (Phase 7). Abgesetzt, weil
   es eine eigene Frage ist und nicht ein Zusatz zur ersten. */
.release-inner { margin-top: 1rem; padding-top: .9rem; border-top: 1px solid var(--line); }
.release-inner h4 { margin: 0 0 .15rem; font-size: 1rem; }