:root {
    --bg: #f5f6f4;
    --surface: #ffffff;
    --surface-soft: #f9faf8;

    --text: #303231;
    --muted: #606060;
    --line: #dfe3de;

    /*
     * Farben des TB-ITF-Logos
     */
    --green: #8aae40;
    --green-dark: #729134;

    --orange: #e9ba4b;
    --orange-dark: #de9721;

    --radius: 14px;
    --shadow: 0 12px 34px rgba(25, 34, 29, 0.07);
    --shell: 1120px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

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

img {
    max-width: 100%;
    height: auto;
}

a {
    color: var(--green);
    text-underline-offset: 0.18em;
}

a:hover {
    color: var(--green-dark);
}


/* Skip-Link
-------------------------------------------------------------- */

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 100;
    background: #111;
    color: #fff;
    padding: .7rem 1rem;
}

.skip-link:focus {
    left: .75rem;
    top: .75rem;
}


/* Grundlayout
-------------------------------------------------------------- */

.site-shell {
    width: min(calc(100% - 2rem), var(--shell));
    margin-inline: auto;
}

.site-header {
    background: rgba(255, 255, 255, .96);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 20;
    backdrop-filter: blur(10px);
}

.header-inner {
    min-height: 92px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}


/* Logo
-------------------------------------------------------------- */

.brand {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.brand img {
    width: 118px;
    height: auto;
    display: block;
}


/* Navigation
-------------------------------------------------------------- */

.main-nav {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: .35rem;
    flex-wrap: wrap;
}

.main-nav a {
    color: var(--text);
    text-decoration: none;
    font-weight: 650;
    padding: .65rem .85rem;
    border-radius: 9px;
}

.main-nav a:hover,
.main-nav a[aria-current="page"] {
    background: #f3f6ed;
    color: var(--green);
}


/* Hauptinhalt
-------------------------------------------------------------- */

.site-main {
    min-height: calc(100vh - 180px);
}

.page-section {
    padding: clamp(2.5rem, 6vw, 5rem) 0;
}

.page-section.compact {
    padding-top: 2.4rem;
}

.page-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: clamp(1.35rem, 3vw, 2.5rem);
}


/* Typografie
-------------------------------------------------------------- */

.eyebrow {
    margin: 0 0 .55rem;
    color: var(--orange-dark);
    font-size: .82rem;
    font-weight: 800;
    letter-spacing: .09em;
    text-transform: uppercase;
}

h1,
h2,
h3,
h4 {
    line-height: 1.2;
    color: #303231;
}

h1 {
    margin: 0 0 1rem;
    font-size: clamp(2rem, 4.5vw, 3.35rem);
    letter-spacing: -.035em;
}

h2 {
    margin: 2.2rem 0 .85rem;
    font-size: clamp(1.35rem, 3vw, 1.8rem);
}

h3 {
    margin: 1.8rem 0 .6rem;
    font-size: 1.18rem;
}

p {
    margin: 0 0 1rem;
}

.lead {
    max-width: 760px;
    font-size: clamp(1.05rem, 2vw, 1.22rem);
    color: var(--muted);
}

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


/* Startseite / Hero
-------------------------------------------------------------- */

.hero {
    padding:
        clamp(3.2rem, 8vw, 6.2rem)
        0
        clamp(2.7rem, 6vw, 4.5rem);

    background:
        radial-gradient(
            circle at 86% 18%,
            rgba(138, 174, 64, .16),
            transparent 24rem
        ),
        radial-gradient(
            circle at 8% 75%,
            rgba(233, 186, 75, .14),
            transparent 22rem
        ),
        var(--surface);

    border-bottom: 1px solid var(--line);
}

.hero-grid {
    display: grid;
    grid-template-columns:
        minmax(0, 1.35fr)
        minmax(260px, .65fr);

    gap: clamp(2rem, 6vw, 5rem);
    align-items: center;
}

.hero-copy h1 span {
    display: block;
    color: var(--green);
}

.hero-address {
    background: rgba(255, 255, 255, .82);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.3rem 1.4rem;
}

.hero-address strong {
    display: block;
    font-size: 1.08rem;
}

.hero-actions {
    display: flex;
    gap: .7rem;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}


/* Buttons
-------------------------------------------------------------- */

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: .68rem 1rem;
    border-radius: 9px;
    border: 1px solid transparent;
    text-decoration: none;
    font-weight: 750;
}

.button-primary {
    background: var(--green);
    color: #fff;
}

.button-primary:hover {
    background: var(--green-dark);
    color: #fff;
}

.button-secondary {
    background: var(--surface);
    color: var(--text);
    border-color: var(--line);
}

.button-secondary:hover {
    border-color: #bfc6be;
    color: var(--text);
}


/* Kacheln auf der Startseite
-------------------------------------------------------------- */

.service-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.service-card {
    display: flex;
    min-height: 180px;
    flex-direction: column;
    justify-content: space-between;

    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);

    padding: 1.45rem;

    text-decoration: none;
    color: var(--text);

    box-shadow: 0 5px 20px rgba(25, 34, 29, .04);

    transition:
        transform .16s ease,
        border-color .16s ease,
        box-shadow .16s ease;
}

.service-card:hover {
    transform: translateY(-2px);
    border-color: rgba(138, 174, 64, .55);
    box-shadow: var(--shadow);
    color: var(--text);
}

.service-card .card-kicker {
    color: var(--orange-dark);
    font-size: .78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.service-card strong {
    font-size: 1.28rem;
}

.service-card p {
    margin: .55rem 0 1.5rem;
    color: var(--muted);
}

.card-arrow {
    font-weight: 800;
    color: var(--green);
}


/* Dokumentenlisten
-------------------------------------------------------------- */

.document-groups {
    display: grid;
    gap: 1.7rem;
}

.document-list {
    list-style: none;
    padding: 0;
    margin: .4rem 0 0;
    border-top: 1px solid var(--line);
}

.document-list li {
    border-bottom: 1px solid var(--line);
}

.document-list a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;

    padding: .86rem .15rem;

    color: var(--text);
    text-decoration: none;
}

.document-list a:hover {
    color: var(--green);
}

.file-type {
    flex: 0 0 auto;
    color: var(--muted);
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: .06em;
}


/* Hinweise
-------------------------------------------------------------- */

.notice {
    padding: .9rem 1rem;
    border-radius: 9px;
    background: #f3f6ed;
    border-left: 4px solid var(--green);
}

.notice-error {
    border-left-color: #a33;
    background: #fff5f5;
}

.note-box {
    margin-top: 2rem;
    padding: 1.2rem 1.3rem;

    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-radius: 10px;
}


/* Filter
-------------------------------------------------------------- */

.filter-bar {
    display: flex;
    align-items: end;
    gap: .8rem;

    margin: 1.4rem 0 1rem;

    flex-wrap: wrap;
}

.filter-field {
    flex: 1 1 320px;
}

.filter-field label {
    display: block;
    margin-bottom: .35rem;
    font-weight: 700;
}

.filter-field input {
    width: 100%;
    min-height: 44px;

    padding: .66rem .8rem;

    font: inherit;
    color: var(--text);

    background: #fff;

    border: 1px solid #bdc5bc;
    border-radius: 9px;
}

.filter-field input:focus {
    outline: 3px solid rgba(138, 174, 64, .20);
    border-color: var(--green);
}

.filter-result {
    color: var(--muted);
    font-size: .92rem;
    padding-bottom: .65rem;
}


/* Tabellen
-------------------------------------------------------------- */

.table-wrap {
    overflow-x: auto;

    border: 1px solid var(--line);
    border-radius: 10px;

    background: #fff;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 780px;
    font-size: .94rem;
}

th,
td {
    padding: .72rem .8rem;

    text-align: left;
    vertical-align: top;

    border-bottom: 1px solid #e7eae6;
}

th {
    position: sticky;

    /*
     * Sticky innerhalb des .table-wrap.
     * Nicht auf Headerhöhe verschieben.
     */
    top: 0;

    z-index: 5;

    background: #f3f6ed;

    font-size: .82rem;
    letter-spacing: .025em;
}

tbody tr:nth-child(even) {
    background: #fafbf9;
}

tbody tr:hover {
    background: #f4f7ef;
}

.numeric {
    text-align: right;
    white-space: nowrap;
}

.price-secondary {
    display: block;
    color: var(--muted);
    font-size: .82rem;
}

.doc-icons {
    white-space: nowrap;
}

.doc-icons a {
    display: inline-flex;
    padding: .15rem;
}

.doc-icons img {
    display: block;
}

.row-hidden {
    display: none;
}


/* Rechtstexte
-------------------------------------------------------------- */

.legal-content {
    max-width: 880px;
    overflow-wrap: anywhere;
}

.legal-content > :first-child {
    margin-top: 0;
}

.legal-content br + br {
    line-height: .7;
}

.legal-content div {
    margin: 0;
}

.legal-content ul {
    padding-left: 1.35rem;
}

.legal-content a {
    overflow-wrap: anywhere;
}


/*
 * Händlerbund-HTML direkt verwenden,
 * aber feste Pixelgrößen an das Seitenlayout anpassen.
 */

.legal-content span[style*="font-size:12px"],
.legal-content span[style*="font-size: 12px"] {
    font-size: .92rem !important;
}

.legal-content span[style*="font-size:14px"],
.legal-content span[style*="font-size: 14px"],
.legal-content strong[style*="font-size: 14px"],
.legal-content br[style*="font-size: 14px"] {
    font-size: 1rem !important;
}

.legal-content span[style*="font-size:16px"],
.legal-content span[style*="font-size: 16px"] {
    font-size: 1.08rem !important;
}

.legal-content span[style*="font-size:18px"],
.legal-content span[style*="font-size: 18px"] {
    font-size: 1.28rem !important;
}

.legal-content span[style*="font-size:20px"],
.legal-content span[style*="font-size: 20px"] {
    font-size: 1.42rem !important;
}

.legal-content span[style*="font-size:22px"],
.legal-content span[style*="font-size: 22px"] {
    font-size: 1.8rem !important;
}


/* Footer
-------------------------------------------------------------- */

.site-footer {
    border-top: 1px solid var(--line);
    background: #ecefea;
    color: var(--muted);
}

.footer-inner {
    min-height: 88px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 1rem 2rem;
    flex-wrap: wrap;
}

.footer-inner p {
    margin: 0;
}

.footer-inner nav {
    display: flex;
    gap: .9rem 1.2rem;
    flex-wrap: wrap;
}

.footer-inner a {
    color: #48504b;
}

.footer-inner a:hover {
    color: var(--green);
}


/* Responsive
-------------------------------------------------------------- */

@media (max-width: 760px) {

    .site-header {
        position: static;
    }

    .header-inner {
        min-height: 0;
        padding: .8rem 0;
        align-items: flex-start;
    }

    .brand img {
        width: 96px;
    }

    .main-nav {
        gap: .15rem;
    }

    .main-nav a {
        padding: .48rem .55rem;
        font-size: .91rem;
    }

    .hero-grid {
        grid-template-columns: 1fr;
    }

    .hero-address {
        max-width: 420px;
    }

    .service-grid {
        grid-template-columns: 1fr;
    }

    .page-card {
        border-radius: 10px;
    }

    th {
        top: 0;
    }
}


@media (max-width: 470px) {

    .header-inner {
        display: block;
    }

    .brand {
        margin-bottom: .55rem;
    }

    .main-nav {
        justify-content: flex-start;
    }

    .site-shell {
        width: min(calc(100% - 1.2rem), var(--shell));
    }
}