:root {
    --bg: #f3ede2;
    --card: #fffdf8;
    --text: #2a1e17;
    --muted: #7a6a5b;
    --border: #e4d8c5;
    --brand: #7c2d12;
    --brand-dark: #5c2210;
    --gold: #a67c1f;
    --ink: #1b140f;
    --green-bg: #ecfdf3;
    --green-text: #166534;
    --red-bg: #fef2f2;
    --red-text: #991b1b;
    --radius: 10px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
}

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

h1, h2, h3 {
    font-family: Georgia, "Times New Roman", serif;
    color: var(--ink);
}

.site-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 20px;
    background: var(--ink);
    border-bottom: 3px solid var(--brand);
}

.site-header .brand {
    font-family: Georgia, "Times New Roman", serif;
    font-weight: bold;
    font-size: 1.25rem;
    letter-spacing: 0.02em;
    text-decoration: none;
    color: #f3ede2;
}

.site-header nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 16px;
}

.site-header nav a {
    text-decoration: none;
    color: #d8cdbd;
    font-size: 0.95rem;
    padding: 6px 0;
}

.site-header nav a:hover {
    color: var(--gold);
}

.site-main {
    max-width: 960px;
    margin: 0 auto;
    padding: 24px 16px 60px;
}

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

/* Das Bild hat einen eigenen gestalteten Rand (Runen-Zierleisten,
   Ecksymbole) - deshalb bewusst vollstaendig gezeigt statt zugeschnitten. */
.hero {
    max-width: 380px;
    margin: 0 auto 22px;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--gold);
    box-shadow: 0 16px 44px rgba(27, 20, 15, 0.45);
}

.hero-image {
    display: block;
    width: 100%;
    height: auto;
}

.hero-heading {
    max-width: 640px;
    margin: 0 auto 22px;
    text-align: center;
}

.hero-heading h1 {
    margin: 0 0 8px;
}

.hero-heading p {
    margin: 0;
    color: var(--muted);
}

.steps {
    margin: 10px 0 0;
    padding-left: 22px;
}

.steps li {
    margin-bottom: 12px;
}

.site-footer {
    text-align: center;
    color: #d8cdbd;
    font-size: 0.85rem;
    padding: 20px;
    margin-top: 30px;
    background: var(--ink);
    border-top: 3px solid var(--brand);
}

.site-footer a {
    color: #e8dcc8;
}

h1 {
    font-size: 1.6rem;
    margin-top: 0;
}

.muted {
    color: var(--muted);
}

.alert {
    padding: 12px 14px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    font-weight: bold;
}

.alert-error {
    background: var(--red-bg);
    color: var(--red-text);
}

.alert-success {
    background: var(--green-bg);
    color: var(--green-text);
}

.form-card,
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
}

form {
    display: flex;
    flex-direction: column;
}

label {
    margin-top: 14px;
    font-weight: bold;
    font-size: 0.9rem;
}

label.checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: normal;
    margin-top: 8px;
}

input[type="text"],
input[type="tel"],
input[type="email"],
input[type="password"],
textarea,
select {
    padding: 10px;
    margin-top: 5px;
    font-size: 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    color: var(--text);
}

fieldset {
    margin-top: 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 14px;
}

legend {
    font-weight: bold;
    padding: 0 6px;
}

button,
.button {
    margin-top: 20px;
    padding: 12px 16px;
    background: var(--brand);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
}

button:hover,
.button:hover {
    background: var(--brand-dark);
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px;
}

.card-grid .card-link {
    display: block;
    text-decoration: none;
    color: var(--text);
}

.card-grid .card:hover {
    border-color: var(--gold);
}

.card-grid .card form {
    margin-top: 10px;
}

.card-grid .card .link-button {
    font-size: 0.85rem;
}

/* Verhindert, dass breite Tabellen auf Smartphones das ganze Layout aufbrechen. */
.table-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

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

/* Nur echte Datentabellen (in .table-wrap) sollen lieber scrollen statt
   ihre Spalten kaputtzuquetschen; reine Textinhalt-Tabellen (z.B. in der
   Datenschutzerklärung) sollen stattdessen ganz normal umbrechen. */
.table-wrap table {
    min-width: 480px;
}

th,
td {
    padding: 10px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: top;
    font-size: 0.92rem;
}

th {
    color: var(--muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

td.actions {
    white-space: nowrap;
}

td.actions a,
td.actions form {
    margin-right: 10px;
    display: inline-block;
}

.badge {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: bold;
}

.badge-success {
    background: var(--green-bg);
    color: var(--green-text);
}

.badge-muted {
    background: #f3f4f6;
    color: #4b5563;
}

.link-button {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    color: var(--brand);
    font-weight: normal;
    font-size: 0.92rem;
    text-decoration: underline;
    cursor: pointer;
}

.link-button:hover {
    background: none;
    color: var(--brand-dark);
}

td form {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

td form select {
    margin-top: 0;
    padding: 4px 6px;
    font-size: 0.85rem;
}

.button-secondary {
    margin-top: 20px;
    padding: 12px 16px;
    background: #374151;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
}

.button-secondary:hover {
    background: #1f2937;
}

/*
 * Solange der Cookie-Consent noch aussteht, wird die Seite dahinter
 * "milchig" (Milchglas-Effekt) und darf nicht mehr gescrollt werden -
 * der Banner selbst ist ein deutlich hervorgehobenes zentriertes Modal.
 */
body.consent-pending {
    overflow: hidden;
}

.cookie-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(243, 237, 226, 0.7);
    backdrop-filter: blur(8px) saturate(120%);
    -webkit-backdrop-filter: blur(8px) saturate(120%);
    animation: cookie-overlay-fade-in 0.2s ease-out;
}

@keyframes cookie-overlay-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.cookie-banner {
    width: 100%;
    max-width: 460px;
    background: var(--card);
    color: var(--text);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: 0 24px 64px rgba(15, 23, 42, 0.35);
    padding: 26px 24px;
    text-align: center;
}

.cookie-banner h2 {
    margin: 0 0 10px;
    font-size: 1.2rem;
}

.cookie-banner p {
    margin: 0;
    font-size: 0.92rem;
    color: var(--muted);
}

.cookie-banner-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 18px;
}

.cookie-banner-actions .button,
.cookie-banner-actions .button-secondary {
    margin-top: 0;
    padding: 12px 14px;
    flex: 1;
}

/*
|--------------------------------------------------------------------------
| Mobile / Tablet
|--------------------------------------------------------------------------
| Tabellen laufen bewusst nicht mit um (siehe .table-wrap), stattdessen
| werden sie horizontal scrollbar. Alles andere (Formulare, Karten,
| Navigation) ist bereits fluid/flex-basiert und passt sich automatisch an.
*/
@media (max-width: 720px) {
    .site-header {
        padding: 12px 16px;
    }

    .site-main {
        padding: 18px 14px 48px;
    }

    h1 {
        font-size: 1.35rem;
    }

    .hero {
        max-width: 280px;
    }

    .hero-heading h1 {
        font-size: 1.2rem;
    }

    .stats,
    .card-grid {
        grid-template-columns: 1fr;
    }

    th,
    td {
        padding: 8px;
        font-size: 0.85rem;
    }
}

@media (max-width: 420px) {
    .cookie-banner {
        padding: 20px 18px;
    }

    .cookie-banner-actions {
        flex-direction: column;
    }

    td.actions a,
    td.actions form {
        display: block;
        margin: 0 0 8px;
    }
}
