:root {
    --color-primary: #005ca9;
    --color-primary-dark: #003459;
    --color-primary-mid: #196cb4;
    --color-primary-soft: #88b3d8;
    --color-bg: #f4f7fa;
    --color-surface: #ffffff;
    --color-surface-soft: #f7fbff;
    --color-border: #cfe0ef;
    --color-text: #16324a;
    --color-text-soft: #4e6780;
    --color-type1: #bcd7ee;
    --color-type2: #d4e4f4;
    --color-type3: #e9f1f9;
    --color-error: #c62828;
    --shadow-soft: 0 8px 24px rgba(0, 40, 80, 0.08);
    --transition: 0.2s ease;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    width: 100%;
    height: 100%;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.5;
}

h1, h2, h3, h4, h5, h6 {
    margin: 0;
    color: var(--color-primary-dark);
    font-weight: 700;
}

p {
    margin: 0;
}

a {
    color: var(--color-primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.page-shell {
    padding: 24px 14px;
}

.content {
    max-width: 1240px;
    margin: 0 auto;
    background: var(--color-surface);
    box-shadow: 0 0 18px rgba(0, 0, 0, 0.12);
    overflow: visible;
}

/* Sticky header block */

.sticky-shell {
    position: sticky;
    top: 0;
    z-index: 50;
    background-image: url("../imgs/header-bg.png");
    background-size: cover;
    background-position: center right;
    background-repeat: no-repeat;
    box-shadow: 0 2px 8px rgba(0, 40, 80, 0.08);
}

/* Header */

.site-header {
    background: #ffffff;
}

.topbar {
    background: transparent;
    padding: 14px 30px 18px;
    min-height: 130px;
    display: flex;
    align-items: flex-start;
}

.brand {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 10px;
    text-decoration: none;
}

.brand:hover {
    text-decoration: none;
}

.brand-logo {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-shrink: 0;
    max-width: 320px;
}

.brand-logo img {
    display: block;
    max-width: 100%;
    max-height: 70px;
    width: auto;
    height: auto;
}

.brand-title {
    color: var(--color-primary-dark);
    font-size: 30px;
    line-height: 1.1;
    font-weight: 700;
}

/* TEMP navigation */

.temp-nav {
    background: rgba(255, 255, 255, 0.96);
    border-top: 1px solid rgba(207, 224, 239, 0.75);
    border-bottom: 1px solid var(--color-border);
    padding: 10px 30px 12px;
}

.temp-nav-row {
    display: flex;
    align-items: center;
    gap: 14px;
}

.temp-nav-row + .temp-nav-row {
    margin-top: 8px;
}

.temp-nav-label {
    flex: 0 0 120px;
    color: var(--color-primary-dark);
    font-size: 13px;
    font-weight: 700;
}

.temp-nav-items {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.temp-nav-button {
    min-width: 38px;
    min-height: 34px;
    padding: 6px 12px;
    border: 1px solid var(--color-border);
    background: #ffffff;
    color: var(--color-primary-dark);
    font-family: inherit;
    font-size: 14px;
    line-height: 1;
    font-weight: 700;
    cursor: pointer;
    transition: background var(--transition), border-color var(--transition), color var(--transition);
}

.temp-nav-button:hover {
    background: var(--color-surface-soft);
    border-color: var(--color-primary-soft);
}

.temp-nav-button.active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #ffffff;
}

.tableau-nav-button {
    font-size: 18px;
    min-width: 46px;
}

.field-nav-button {
    min-width: 36px;
}

/* Hero */

.hero {
    padding: 22px 30px 16px;
    background: #ffffff;
    border-bottom: 1px solid var(--color-border);
}

.hero-copy {
    width: 100%;
    max-width: none;
}

.hero h1 {
    font-size: 29px;
    line-height: 1.15;
    margin-bottom: 10px;
}

.hero-text {
    font-size: 16px;
    line-height: 1.5;
    color: var(--color-text-soft);
}

.hero-text p {
    margin: 0 0 10px 0;
}

.hero-text p:last-child {
    margin-bottom: 0;
}

.hero-text strong {
    color: var(--color-primary-dark);
}

/* Main form area */

form {
    padding: 18px 30px 30px;
}

.info-card {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 18px 20px;
    margin-bottom: 22px;
    background: #ffffff;
    border-left: 4px solid var(--color-primary);
    border-top: 1px solid var(--color-border);
    border-right: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
}

.intro-card {
    margin-bottom: 18px;
}

.info-icon {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    background: var(--color-primary);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
}

.info-content h2 {
    font-size: 22px;
    margin-bottom: 8px;
}

.info-content p {
    color: var(--color-text-soft);
}

.info-content p + p {
    margin-top: 10px;
}

/* Accordion */

.accordion {
    margin-bottom: 24px;
}

.accordion .title {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--color-primary);
    padding: 8px 16px;
    min-height: 46px;
    cursor: pointer;
    transition: background var(--transition);
}

.accordion .title:hover {
    background: var(--color-primary-mid);
}

.accordion .title .short {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    color: var(--color-primary-dark);
    font-size: 22px;
    line-height: 1;
    font-weight: 700;
}

.accordion .title span.text {
    display: block;
    color: #ffffff;
    font-size: 20px;
    line-height: 1.3;
    font-weight: 500;
}

.accordion .items {
    display: none;
    padding: 14px 0 0;
    border: none;
    background: #ffffff;
}

.accordion.open .items {
    display: block;
}

.element-rows {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.row {
    border: none;
    background: #ffffff;
    padding: 12px 0;
    scroll-margin-top: 230px;
}

.row-head {
    display: block;
    margin-bottom: 12px;
}

.headline {
    background: #bdd7ee;
    padding: 6px 10px;
    font-size: 13px;
    line-height: 1.5;
    color: #3e586f;
}

.headline strong {
    color: #083658;
}

/* Missing answer state */

.row.row-missing {
    background: #fffdfd;
    box-shadow: inset 0 0 0 1px rgba(198, 40, 40, 0.06);
}

.row.row-missing .headline {
    position: relative;
    background: #f9eeee;
    padding-right: 170px;
}

.row.row-missing .headline strong {
    color: #7a2f2f;
}

.row.row-missing .headline::after {
    content: "Bitte Auswahl treffen";
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    font-size: 12px;
    font-weight: 700;
    color: var(--color-error);
    white-space: nowrap;
}

/* Answers */

.rating-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 8px;
    align-items: stretch;
}

.block {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 205px;
    padding: 10px 8px;
    background: #ffffff;
    border: none;
    border-radius: 0;
    cursor: pointer;
    transition: var(--transition);
}

.block input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.block:hover {
    box-shadow: none;
}

.block.type1:hover {
    background: var(--color-type1);
}

.block.type2:hover {
    background: var(--color-type2);
}

.block.type3:hover {
    background: var(--color-type3);
}

.block-header {
    display: block;
}

.grade-badge {
    display: inline-block;
    margin: 0;
    padding: 0;
    background: transparent;
    color: var(--color-primary-dark);
    font-weight: 700;
    font-size: 13px;
    line-height: 1.2;
}

.block p {
    font-size: 12px;
    line-height: 1.38;
    color: #274862;
}

.block.selected,
.block:has(input:checked) {
    box-shadow: none;
}

.block.type1.selected,
.block.type1:has(input:checked) {
    background: var(--color-type1);
}

.block.type2.selected,
.block.type2:has(input:checked) {
    background: var(--color-type2);
}

.block.type3.selected,
.block.type3:has(input:checked) {
    background: var(--color-type3);
}

.block.selected .grade-badge,
.block:has(input:checked) .grade-badge {
    display: inline-block;
    padding: 4px 10px;
    background: var(--color-primary);
    color: #ffffff;
}

/* Form */

.form-intro {
    margin-top: 6px;
}

.form-card {
    padding: 18px 20px;
    background: #ffffff;
    border: 1px solid var(--color-border);
}

.fields {
    width: 100%;
}

.fields .field {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 12px 14px;
    align-items: start;
    padding: 10px 0;
    border-bottom: 1px solid #d9e6f2;
}

.fields .field:last-of-type {
    border-bottom: none;
}

.fields .field > div {
    width: auto;
}

.fields .field label {
    display: inline-block;
    font-weight: 700;
    line-height: 1.4;
    color: var(--color-primary-dark);
    padding-top: 10px;
}

.fields .field label.small {
    font-size: 12px;
    font-weight: 400;
    color: var(--color-text-soft);
    padding-top: 0;
}

.fields input[type=text],
.fields input[type=email],
.fields select {
    width: 100%;
    min-height: 44px;
    border: 1px solid transparent;
    background: #e9f1f9;
    padding: 0 12px;
    font-size: 15px;
    color: var(--color-text);
    outline: none;
    transition: background var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.fields input[type=text]:hover,
.fields input[type=email]:hover,
.fields select:hover {
    background: #edf4fb;
}

.fields input[type=text]:focus,
.fields input[type=email]:focus,
.fields select:focus {
    border-color: rgba(0, 92, 169, 0.35);
    box-shadow: inset 0 0 0 2px rgba(0, 92, 169, 0.18);
    background: #f4f9fe;
}

.field-checkbox {
    align-items: start;
}

.checkbox-line {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
    column-gap: 12px;
    row-gap: 10px;
    align-items: start;
    padding-top: 6px;
}

.checkbox-line input[type=checkbox] {
    grid-column: 1;
    grid-row: 1;
    margin: 4px 0 0 0;
    width: 18px;
    height: 18px;
    accent-color: var(--color-primary);
}

.checkbox-line label.small {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
}

.checkbox-line label.small.checkbox-text {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.checkbox-line label.small.checkbox-text span {
    display: block;
    line-height: 1.5;
}

.checkbox-line a {
    font-weight: 600;
}

.form-submit-hint {
    display: none;
    margin: 0 0 16px 0;
    padding: 12px 14px;
    background: #fdf1f1;
    border-left: 4px solid var(--color-error);
    color: var(--color-error);
    font-size: 14px;
    line-height: 1.5;
}

.form-submit-hint.visible {
    display: block;
}

.submit-row {
    padding-top: 16px;
}

form input[type=submit] {
    display: inline-block;
    width: 100%;
    min-height: 50px;
    border: none;
    background: var(--color-primary-mid);
    color: #ffffff;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: background var(--transition), opacity var(--transition);
}

form input[type=submit]:hover {
    background: var(--color-primary);
}

.error {
    display: block;
    margin-top: 8px;
    padding: 10px 12px;
    background: #fdf1f1;
    border-left: 4px solid var(--color-error);
    color: var(--color-error);
    font-style: normal;
    font-size: 13px;
    line-height: 1.45;
}

.field-checkbox .error {
    grid-column: 2;
    margin: 0;
    width: 100%;
}

/* Footer */

.site-footer {
    margin-top: 0;
}

.footer-top {
    background: var(--color-primary-soft);
    color: #ffffff;
    padding: 10px 30px;
    font-size: 13px;
    font-weight: 700;
    text-align: right;
}

.footer-bottom {
    background: #ffffff;
    color: #000000;
    padding: 14px 30px 20px;
    font-size: 12px;
    line-height: 1.7;
    text-align: center;
    border-top: 1px solid var(--color-border);
}

/* Success page compatibility */

.success-page .sticky-shell {
    position: relative;
}

.success-main {
    padding: 18px 30px 30px;
}

.success-card {
    margin-bottom: 0;
}

.success-card .info-icon {
    font-size: 20px;
}

.success-page .hero {
    border-bottom: 1px solid var(--color-border);
}

.success-page .hero-text p:last-child {
    margin-bottom: 0;
}

/* Legacy compatibility */

.success.content {
    padding-top: 20px;
}

.success .header {
    height: auto;
    position: relative;
    top: auto;
}

.current,
.scroller-heading,
.header,
.image.fixed,
.checkbox_wrapper,
.info:before,
.block .num,
.row > .col,
.headline + .col {
    display: none;
}

.resp {
    padding: 20px 30px;
}

.resp p {
    margin: 0 0 12px 0;
    font-size: 18px;
    line-height: 1.6;
}

.resp p.heading {
    font-weight: bold;
}

/* Responsive */

@media (max-width: 980px) {
    .topbar {
        min-height: 115px;
    }

    .brand-title {
        font-size: 28px;
    }

    .brand-logo img {
        max-height: 64px;
    }

    .hero h1 {
        font-size: 28px;
    }

    .rating-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .fields .field {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .fields .field label {
        padding-top: 0;
    }

    .temp-nav-row {
        align-items: flex-start;
    }

    .temp-nav-label {
        flex: 0 0 115px;
    }
}

@media (max-width: 680px) {
    .page-shell {
        padding: 10px;
    }

    .topbar,
    .hero,
    form,
    .footer-top,
    .footer-bottom,
    .success-main {
        padding-left: 16px;
        padding-right: 16px;
    }

    .topbar {
        min-height: 96px;
        padding-top: 12px;
        padding-bottom: 14px;
    }

    .brand-title {
        font-size: 24px;
    }

    .brand-logo img {
        max-height: 58px;
    }

    .temp-nav {
        padding-left: 16px;
        padding-right: 16px;
    }

    .temp-nav-row {
        display: block;
    }

    .temp-nav-row + .temp-nav-row {
        margin-top: 10px;
    }

    .temp-nav-label {
        display: block;
        margin-bottom: 6px;
        font-size: 12px;
    }

    .temp-nav-items {
        gap: 6px;
    }

    .temp-nav-button {
        min-height: 32px;
        padding: 6px 10px;
        font-size: 13px;
    }

    .tableau-nav-button {
        min-width: 42px;
        font-size: 17px;
    }

    .field-nav-button {
        min-width: 34px;
    }

    .hero-text {
        font-size: 16px;
    }

    .accordion .title span.text {
        font-size: 17px;
        line-height: 1.35;
    }

    .accordion .title .short {
        width: 32px;
        height: 32px;
        flex-basis: 32px;
        font-size: 20px;
    }

    .sticky-shell {
        position: static;
        box-shadow: none;
        background-position: center center;
    }

    .row {
        scroll-margin-top: 20px;
    }

    .rating-grid {
        grid-template-columns: 1fr;
    }

    .row.row-missing .headline {
        padding-right: 10px;
        padding-bottom: 28px;
    }

    .row.row-missing .headline::after {
        top: auto;
        bottom: 6px;
        right: 10px;
        transform: none;
    }

    .checkbox-line {
        grid-template-columns: 18px minmax(0, 1fr);
    }

    .field-checkbox .error {
        grid-column: 1 / -1;
    }
}