.survey-page {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    background:
        radial-gradient(60rem 30rem at 85% -10%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 70%),
        radial-gradient(50rem 28rem at -10% 110%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 70%),
        var(--bg);
    background-attachment: fixed;
}

.preview-banner {
    padding: 6px 16px;
    background: var(--warn-bg);
    color: var(--warn);
    font-size: .875rem;
    text-align: center;
}

/* Fortschritt bleibt immer sichtbar */

.progress {
    position: sticky;
    top: 0;
    z-index: 5;
    padding: 12px 16px 10px;
    background: color-mix(in srgb, var(--surface) 86%, transparent);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
}

.progress-row, .progress-track, .progress-step {
    max-width: 720px;
    margin-inline: auto;
}

.progress-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    font-size: .875rem;
}

.progress-title {
    overflow: hidden;
    color: var(--ink-2);
    font-weight: 600;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.progress-percent {
    color: var(--ink);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.progress-track {
    height: 8px;
    margin-top: 7px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--surface-2);
}

.progress-fill {
    width: 0;
    height: 100%;
    border-radius: 999px;
    background: var(--accent);
    transition: width .35s cubic-bezier(.2, .7, .2, 1);
}

.progress-step {
    margin-top: 5px;
    color: var(--ink-3);
    font-size: .8125rem;
}

/* Inhalt */

.stage {
    flex: 1;
    width: 100%;
    max-width: 752px;
    margin-inline: auto;
    padding: 28px 16px 24px;
}

.stage-center {
    display: flex;
    align-items: center;
}

.card {
    width: 100%;
    padding: 36px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: var(--surface);
    box-shadow: var(--shadow);
    animation: rise .35s cubic-bezier(.2, .7, .2, 1);
}

.card-center { text-align: center; }

.card h1 {
    font-size: clamp(1.5rem, 1.25rem + 1.2vw, 2rem);
    letter-spacing: -.015em;
}

.card h1:focus { outline: none; }

.lead {
    margin: 10px 0 0;
    color: var(--ink-2);
    font-size: 1.0625rem;
    white-space: pre-line;
}

.card-intro .lead { font-size: 1.125rem; }

@keyframes rise {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: none; }
}

/* Fragen */

.question {
    min-width: 0;
    margin: 28px 0 0;
    padding: 0;
    border: 0;
}

.q-title {
    padding: 0;
    font-size: 1.0625rem;
    font-weight: 650;
}

.q-required { color: var(--danger); }

.q-help {
    margin: 2px 0 0;
    color: var(--ink-3);
    font-size: .9375rem;
}

.question > .choices,
.question > .field,
.question > .number-row,
.question > .slider-wrap {
    margin-top: 12px;
}

.q-error {
    margin: 0;
    color: var(--danger);
    font-size: .9375rem;
}

.q-error:not(:empty) { margin-top: 8px; }

.question.has-error > .q-title { color: var(--danger); }

.q-children:empty { display: none; }

.is-followup {
    margin-top: 18px;
    padding: 14px 16px 16px;
    border-left: 3px solid var(--accent);
    border-radius: 0 12px 12px 0;
    background: color-mix(in srgb, var(--accent) 6%, var(--surface));
    animation: rise .28s cubic-bezier(.2, .7, .2, 1);
}

.is-followup > legend { float: left; width: 100%; }
.is-followup > legend + * { clear: both; }

/* Auswahlkarten */

.choices {
    display: grid;
    gap: 8px;
}

.choice {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 50px;
    padding: 11px 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
    cursor: pointer;
    transition: border-color .12s ease, background-color .12s ease;
}

.choice:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); }

.choice input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.choice-mark {
    position: relative;
    flex: none;
    width: 22px;
    height: 22px;
    border: 2px solid var(--ink-3);
    border-radius: 50%;
    transition: border-color .12s ease, background-color .12s ease;
}

.is-multi .choice-mark { border-radius: 6px; }

.choice input:checked + .choice-mark {
    border-color: var(--accent);
    background: var(--accent);
}

.choice input:checked + .choice-mark::after {
    content: "";
    position: absolute;
    inset: 4px;
    border-radius: 50%;
    background: var(--on-accent);
}

.is-multi input:checked + .choice-mark::after {
    inset: 1px 5px 4px;
    border: solid var(--on-accent);
    border-width: 0 2px 2px 0;
    border-radius: 0;
    background: none;
    transform: rotate(42deg);
}

.choice:has(input:checked) {
    border-color: var(--accent);
    background: color-mix(in srgb, var(--accent) 9%, var(--surface));
}

.choice:has(input:focus-visible) {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Zahl */

.number-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.number-row .field { max-width: 180px; }
.unit { color: var(--ink-3); }

/* Slider */

.slider-value {
    display: block;
    color: var(--accent);
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

@media (prefers-color-scheme: dark) {
    .slider-value { color: color-mix(in srgb, var(--accent) 55%, white); }
}

.is-untouched .slider-value {
    color: var(--ink-3);
    font-size: 1rem;
    font-weight: 500;
    line-height: 2.25rem;
}

.slider {
    --fill: 50%;
    display: block;
    width: 100%;
    height: 32px;
    margin: 4px 0 0;
    background: none;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    touch-action: pan-y;
}

.slider::-webkit-slider-runnable-track {
    height: 8px;
    border-radius: 999px;
    background: linear-gradient(to right, var(--accent) var(--fill), var(--surface-2) var(--fill));
}

.slider::-moz-range-track {
    height: 8px;
    border-radius: 999px;
    background: var(--surface-2);
}

.slider::-moz-range-progress {
    height: 8px;
    border-radius: 999px;
    background: var(--accent);
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 26px;
    height: 26px;
    margin-top: -9px;
    border: 3px solid var(--surface);
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 1px 6px rgba(0, 0, 0, .3);
}

.slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border: 3px solid var(--surface);
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 1px 6px rgba(0, 0, 0, .3);
}

.is-untouched .slider::-webkit-slider-runnable-track { background: var(--surface-2); }
.is-untouched .slider::-moz-range-progress { background: transparent; }
.is-untouched .slider::-webkit-slider-thumb { background: var(--ink-3); }
.is-untouched .slider::-moz-range-thumb { background: var(--ink-3); }

.slider-labels {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    color: var(--ink-3);
    font-size: .875rem;
}

.calc {
    margin-top: 12px;
    padding: 10px 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
}

.calc summary {
    color: var(--ink-2);
    font-weight: 600;
    cursor: pointer;
}

.calc-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.calc-fields span {
    display: block;
    margin-bottom: 4px;
    color: var(--ink-2);
    font-size: .875rem;
}

.calc-result {
    margin: 8px 0 0;
    color: var(--ink-2);
    font-size: .9375rem;
}

.calc-result:empty { display: none; }

@media (max-width: 420px) {
    .calc-fields { grid-template-columns: minmax(0, 1fr); }
}

/* Kontaktdaten */

.contact {
    display: grid;
    gap: 14px;
    margin-top: 22px;
}

.contact-field span {
    display: block;
    margin-bottom: 4px;
    color: var(--ink-2);
    font-size: .9375rem;
    font-weight: 600;
}

.consent {
    display: flex;
    gap: 10px;
    color: var(--ink-2);
    font-size: .9375rem;
    cursor: pointer;
}

.consent input {
    flex: none;
    width: 20px;
    height: 20px;
    margin: 2px 0 0;
    accent-color: var(--accent);
}

.hp {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    opacity: 0;
}

/* Navigation */

.nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 10px;
    margin-top: 32px;
}

.nav .button-primary:only-of-type { margin-left: auto; }

.nav-error {
    flex-basis: 100%;
    margin: 0;
    color: var(--danger);
    font-size: .9375rem;
    text-align: right;
}

/* Abschluss */

.done-mark {
    position: relative;
    width: 72px;
    height: 72px;
    margin: 0 auto 18px;
    border-radius: 50%;
    background: var(--accent);
    animation: pop .4s cubic-bezier(.2, 1.4, .4, 1);
}

.done-mark::after {
    content: "";
    position: absolute;
    left: 25px;
    top: 15px;
    width: 22px;
    height: 36px;
    border: solid var(--on-accent);
    border-width: 0 5px 5px 0;
    transform: rotate(42deg);
}

@keyframes pop {
    from { transform: scale(.6); opacity: 0; }
    to { transform: none; opacity: 1; }
}

/* Footer und Datenschutz */

.page-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px 14px;
    padding: 14px 16px 18px;
    color: var(--ink-3);
    font-size: .8125rem;
    text-align: center;
}

.privacy-dialog {
    width: min(680px, calc(100vw - 32px));
    max-height: calc(100dvh - 48px);
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--surface);
    color: var(--ink);
    box-shadow: var(--shadow);
}

.privacy-dialog::backdrop { background: rgba(15, 18, 24, .5); }

.privacy-head {
    position: sticky;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}

.privacy-head h2 { font-size: 1.125rem; }
.privacy-body { padding: 4px 20px 20px; }

@media (max-width: 560px) {
    .stage { padding: 16px 12px; }
    .card { padding: 22px 18px; border-radius: 16px; }
    .nav .button { flex: 1; }
}
