:root {
    --bg: #f7f1e8;
    --panel: #fffaf4;
    --text: #3c332c;
    --accent: #b7864f;
    --accent-dark: #8f6437;
    --border: #eadbc8;
    --soft: #efe3d2;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    color: var(--text);
    background: linear-gradient(180deg, #fbf7f1, var(--bg));
}

.container, .page-wrap {
    width: min(1100px, calc(100% - 32px));
    margin: 0 auto;
}

.page-wrap {
    padding: 24px 0 48px;
}

.site-header, .site-footer {
    background: rgba(255,255,255,0.6);
    backdrop-filter: blur(6px);
    border-bottom: 1px solid var(--border);
}

.site-footer {
    border-top: 1px solid var(--border);
    border-bottom: 0;
    padding: 20px 0;
    margin-top: 32px;
}

.nav-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 0;
}

.brand {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--accent-dark);
    text-decoration: none;
}

.main-nav {
    display: flex;
    gap: 16px;
    align-items: center;
}

.main-nav a {
    color: var(--text);
    text-decoration: none;
}

.user-menu {
    position: relative;
    display: inline-block;
    padding: 10px 14px;
    background: var(--panel);
    border-radius: 999px;
    border: 1px solid var(--border);
}

.user-menu span,
.user-menu > a {
    color: var(--text);
    text-decoration: none;
}

.user-menu:hover .dropdown,
.user-menu:focus-within .dropdown {
    display: block;
}

.dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0;
    min-width: 220px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 20px;
    overflow: hidden;
    z-index: 1000;
}

.dropdown a {
    display: block;
    padding: 14px 16px;
    color: var(--text);
    text-decoration: none;
    white-space: nowrap;
}

.dropdown a:hover {
    background: var(--soft);
}

.card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 26px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 15px 40px rgba(80, 58, 34, 0.08);
}

.hero-card {
    padding: 40px 32px;
}

.form-card {
    max-width: 560px;
}

input[type="text"],
input[type="email"],
input[type="password"],
textarea {
    width: 100%;
    margin: 8px 0 18px;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: #fff;
}

.btn {
    display: inline-block;
    padding: 10px 18px;
    border: 1px solid #cdb693;
    border-radius: 999px;
    background: #efe3d1;
    color: #3f342c;
    text-decoration: none;
    cursor: pointer;
}

.btn-secondary {
    background: #f7f3ee;
}

.btn-danger {
    background: #d86a5f;
    border-color: #d86a5f;
    color: #fff;
}

.btn-small {
    padding: 8px 14px;
    font-size: 14px;
}

.button-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.topic-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 18px;
}

.topic-box,
.question-box,
.contact-box {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 18px;
}

.topic-box {
    text-decoration: none;
    color: var(--text);
}

.question-box {
    margin-bottom: 16px;
}

.radio-row {
    display: flex;
    gap: 18px;
}

.result-chart {
    width: 100%;
    max-width: 1000px;
    border-radius: 18px;
    border: 1px solid var(--border);
}

.result-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 18px;
}

.result-table th,
.result-table td {
    padding: 10px;
    border-bottom: 1px solid var(--border);
    text-align: left;
}

.flash-wrapper {
    margin-bottom: 16px;
}

.flash {
    padding: 14px 16px;
    border-radius: 16px;
    margin-bottom: 10px;
    border: 1px solid var(--border);
    background: #fff;
}

.flash.success { border-color: #9fc89f; }
.flash.warning { border-color: #e0b86d; }
.flash.danger,
.flash.error { border-color: #d89f9f; }

.muted {
    color: #786a5d;
}

.content-card {
    background: #fff;
    border: 1px solid #dccdb7;
    border-radius: 28px;
    padding: 24px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.05);
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th,
.admin-table td {
    padding: 12px 10px;
    border-bottom: 1px solid #e7dccd;
    text-align: left;
    vertical-align: top;
}

.actions {
    white-space: nowrap;
}

.admin-form .form-group {
    margin-bottom: 18px;
}

.admin-form textarea {
    min-height: 120px;
    resize: vertical;
}

.checkbox-list {
    display: grid;
    gap: 10px;
    padding: 14px;
    border: 1px solid #d8c7ae;
    border-radius: 16px;
    background: #fffdf9;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

@media (max-width: 700px) {
    .nav-bar {
        flex-direction: column;
        gap: 12px;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* contacts verbergen bei self assessment */
select {
    width: 100%;
    margin: 8px 0 18px;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text);
}

/* Progress bar */
.progress-bar-wrap {
    width: 100%;
    height: 18px;
    background: #f1e8dc;
    border: 1px solid var(--border);
    border-radius: 999px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 999px;
    transition: width 0.25s ease;
}

.filter-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.filter-item {
    margin-bottom: 0;
}

.question-group {
    background: #fcf8f2;
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 20px;
    margin-bottom: 22px;
}

.question-group:nth-child(odd) {
    background: #fffaf4;
}

.question-group:nth-child(even) {
    background: #f8f1e7;
}

.question-group-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.question-group-header h2 {
    margin: 0 0 6px 0;
    font-size: 1.15rem;
}

.question-list {
    display: grid;
    gap: 12px;
}

.question-item {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    background: #fff;
    border: 1px solid #eadfce;
    border-radius: 18px;
    padding: 16px;
}

.question-item-main {
    flex: 1;
    min-width: 0;
}

.question-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 8px;
    font-size: 0.92rem;
}

.question-id {
    font-weight: 700;
    color: var(--accent-dark);
}

.question-branch {
    color: #6f5d4f;
}

.question-text {
    line-height: 1.45;
}

.question-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

@media (max-width: 700px) {
    .question-group-header,
    .question-item {
        flex-direction: column;
    }

    .question-actions {
        justify-content: flex-start;
    }
}