/* ══════════════════════════════════════════
   DESIGN-SYSTEM: "Solid Ground"
   ══════════════════════════════════════════ */

/* Import Fonts */
@import url('https://fonts.googleapis.com/css2?family=Lora:wght@400;500;600;700&family=Nunito+Sans:wght@400;500;600;700&display=swap');

/* CSS Variables */
:root {
    --primary: #92400e; /* Terrakotta-Braun */
    --secondary: #1e3a5f; /* Architekt-Blau */
    --accent: #d97706; /* Warmes Amber */
    --background: #fefbf6; /* Warmes Creme-Weiß */
    --surface: #ffffff;
    --card: #faf5ee; /* Helles Sandbeige */
    --text: #1c1917; /* Warmes fast-Schwarz */
    --muted: #78716c; /* Warmes Grau */
    --success: #16a34a;
    --danger: #dc2626;
    --gradient-hero: linear-gradient(135deg, #fef3c7 0%, #fed7aa 50%, #fecaca 100%);
    
    --font-headings: 'Lora', serif;
    --font-body: 'Nunito Sans', sans-serif;

    --box-shadow: 0 2px 12px rgba(146, 64, 14, 0.08);
    --box-shadow-hover: 0 4px 16px rgba(146, 64, 14, 0.12);
    --border-radius: 8px;
}

/* ══════════════════════════════════════════
   Global Styles & Resets
   ══════════════════════════════════════════ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px; /* Header height */
}

body {
    font-family: var(--font-body);
    font-size: 1.0625rem; /* 17px */
    line-height: 1.75;
    color: var(--text);
    background-color: var(--background);
    -webkit-font-smoothing: antialiased;
}

/* ══════════════════════════════════════════
   Typography
   ══════════════════════════════════════════ */
h1, h2, h3, h4 {
    font-family: var(--font-headings);
    color: var(--secondary);
    line-height: 1.25;
    margin-bottom: 1rem;
}

h1 { font-size: 2.75rem; line-height: 1.2; }
h2 { font-size: 2rem; line-height: 1.25; text-align: center; margin-bottom: 2.5rem; }
h3 { font-size: 1.375rem; line-height: 1.3; }
h4 { font-size: 1.1rem; }

p { margin-bottom: 1rem; }
a { color: var(--accent); text-decoration: none; transition: color 0.2s ease; }
a:hover { color: var(--primary); }

/* ══════════════════════════════════════════
   Layout & Utilities
   ══════════════════════════════════════════ */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

section {
    padding: 5rem 0;
}
section:nth-of-type(even) { background-color: var(--surface); }

.section-intro {
    max-width: 700px;
    margin: -1.5rem auto 2.5rem;
    text-align: center;
    color: var(--muted);
}

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    font-weight: 600;
    font-family: var(--font-body);
    transition: all 0.2s ease;
    border: 2px solid transparent;
    cursor: pointer;
}
.btn-primary {
    background-color: var(--accent);
    color: white;
}
.btn-primary:hover {
    background-color: #b45309;
    transform: translateY(-2px);
    box-shadow: var(--box-shadow-hover);
}
.btn-secondary {
    background-color: transparent;
    color: var(--primary);
    border-color: var(--primary);
}
.btn-secondary:hover {
    background-color: var(--primary);
    color: white;
}

.card {
    background-color: var(--card);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--box-shadow-hover);
}
.card-grid {
    display: grid;
    gap: 1.5rem;
}
.card-grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.card-grid.cols-4 { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.card-grid.cols-5 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

/* ══════════════════════════════════════════
   Header & Navigation
   ══════════════════════════════════════════ */
#header {
    position: sticky;
    top: 0;
    width: 100%;
    background-color: var(--surface);
    z-index: 1000;
    transition: box-shadow 0.3s ease;
}
#header.scrolled {
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}
.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
}
.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-headings);
    font-weight: 600;
    font-size: 1.25rem;
    color: var(--text);
}
#nav-menu ul {
    display: flex;
    list-style: none;
    gap: 2rem;
}
#nav-menu a {
    color: var(--text);
    font-weight: 500;
    position: relative;
    padding: 0.5rem 0;
}
#nav-menu a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary);
    transition: width 0.3s ease;
}
#nav-menu a:hover::after { width: 100%; }
#nav-toggle { display: none; background: none; border: none; cursor: pointer; }

/* ══════════════════════════════════════════
   Section Styles
   ══════════════════════════════════════════ */

/* Sektion 1: Hero */
#hero {
    background: var(--gradient-hero);
    padding: 6rem 0;
    min-height: 90vh;
    display: flex;
    align-items: center;
}
.hero-container {
    display: grid;
    grid-template-columns: 55fr 45fr;
    align-items: center;
    gap: 3rem;
}
.hero-image img {
    width: 100%;
    height: auto;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow-hover);
}
.hero-actions { display: flex; gap: 1rem; margin-top: 2rem; }
.trust-badges {
    margin-top: 2rem;
    display: flex;
    gap: 1.5rem;
    color: var(--muted);
    font-weight: 500;
}
.trust-badges span { display: flex; align-items: center; gap: 0.5rem; }
.trust-badges .feather { color: var(--success); }

/* Sektion 2: Zinsen */
.zinsen-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: center;
}
table {
    width: 100%;
    border-collapse: collapse;
}
th, td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #eee;
}
thead {
    background-color: var(--card);
    font-family: var(--font-headings);
    color: var(--secondary);
}
tbody tr:nth-child(even) { background-color: var(--card); }
.zinsen-chart img {
    width: 100%;
    border-radius: var(--border-radius);
}
.trend-stable { color: var(--muted); }
.trend-down { color: var(--success); }
.trend-up { color: var(--danger); }

/* Unique UI Elements */
.info-box {
    margin-top: 2rem;
    padding: 1.5rem;
    background-color: var(--card);
    border-radius: var(--border-radius);
}
.info-box-accent {
    border-left: 5px solid var(--primary);
}
.blueprint-card {
    border: 1px solid var(--secondary);
    background-color: var(--surface);
}
.section-divider-wrapper {
    background-color: var(--surface);
    line-height: 0;
}
.section-divider-roof .shape-fill {
    fill: var(--background);
}

/* Sektion 4: Rechner */
.rechner-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    background-color: var(--card);
    padding: 2rem;
    border-radius: var(--border-radius);
}
.rechner-form { display: flex; flex-direction: column; gap: 1rem; }
.form-group { display: flex; flex-direction: column; }
.form-group label { margin-bottom: 0.25rem; font-weight: 500; color: var(--muted); }
.form-group input, .form-group select, .form-group textarea {
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    font-family: var(--font-body);
    font-size: 1rem;
}
.form-group input:focus { outline: 2px solid var(--accent); border-color: transparent; }
.rechner-ergebnis {
    background-color: var(--surface);
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.ergebnis-item {
    display: flex;
    justify-content: space-between;
    padding: 1rem 0;
    border-bottom: 1px solid #eee;
}
.ergebnis-item:last-of-type { border: none; }
.ergebnis-item strong {
    font-family: var(--font-headings);
    font-size: 1.25rem;
    color: var(--primary);
}
.rechner-form .btn { margin-top: 1rem; }

/* Sektion 7: Fehler */
.danger-card {
    border-left: 5px solid var(--danger);
}
.danger-card h4 { color: var(--danger); }

/* Sektion 9: Vergleich */
.vergleich-wrapper { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
.vergleich-kolumne { background-color: var(--card); padding: 2rem; border-radius: var(--border-radius); }
.vergleich-kolumne ul { list-style: none; }
.vergleich-kolumne li { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.5rem; }
.success-icon { color: var(--success); }
.danger-icon { color: var(--danger); }

/* Sektion 10: Checkliste */
.checklist {
    list-style: none;
    columns: 2;
    -webkit-columns: 2;
    -moz-columns: 2;
}
.checklist li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    cursor: pointer;
    transition: color 0.2s ease;
}
.checklist li.checked {
    color: var(--muted);
    text-decoration: line-through;
}
.checklist .feather-check-square { color: var(--success); }

/* Sektion 11: Anschlussfinanzierung (Timeline) */
.timeline {
    position: relative;
    max-width: 800px;
    margin: 2rem auto;
}
.timeline::after {
    content: '';
    position: absolute;
    width: 3px;
    background-color: var(--primary);
    top: 0;
    bottom: 0;
    left: 50%;
    margin-left: -1.5px;
    opacity: 0.2;
}
.timeline-item {
    padding: 1rem 3rem;
    position: relative;
    width: 50%;
}
.timeline-item:nth-child(odd) { left: 0; text-align: right; }
.timeline-item:nth-child(even) { left: 50%; }
.timeline-dot {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    background-color: var(--accent);
    border: 3px solid var(--background);
    top: 25px;
    border-radius: 50%;
    z-index: 1;
}
.timeline-item:nth-child(odd) .timeline-dot { right: -8px; }
.timeline-item:nth-child(even) .timeline-dot { left: -8px; }

/* Sektion 13: FAQ (Accordion) */
.accordion { max-width: 800px; margin: 0 auto; }
.accordion-item { border-bottom: 1px solid #eee; }
.accordion-header {
    width: 100%;
    background: none;
    border: none;
    text-align: left;
    padding: 1.5rem 1rem;
    font-size: 1.1rem;
    font-family: var(--font-headings);
    color: var(--secondary);
    cursor: pointer;
    position: relative;
    transition: background-color 0.2s;
}
.accordion-header::after {
    content: '+';
    position: absolute;
    right: 1rem;
    font-size: 1.5rem;
    font-weight: 400;
    color: var(--accent);
    transition: transform 0.3s ease;
}
.accordion-header.active::after { transform: rotate(45deg); }
.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out, padding 0.3s ease-out;
}
.accordion-content p {
    padding: 0 1rem 1.5rem;
    margin: 0;
}
.accordion-item:hover .accordion-header { background-color: var(--card); }

/* Sektion 14: Kontakt */
.kontakt-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
}
.kontakt-info address a { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.5rem; color: var(--text); }
.oeffnungszeiten { margin-top: 1.5rem; }
.google-maps {
    margin-top: 1.5rem;
    border-radius: var(--border-radius);
    overflow: hidden;
    line-height: 0;
}
.google-maps iframe {
    width: 100%;
    height: 250px;
    border: 0;
}
.kontakt-form form { display: flex; flex-direction: column; gap: 1rem; }
.form-group-checkbox { display: flex; align-items: center; gap: 0.5rem; }
.form-group-checkbox label { font-size: 0.9rem; }

/* ══════════════════════════════════════════
   Footer
   ══════════════════════════════════════════ */
#footer {
    background-color: var(--text);
    color: #eee;
    padding-top: 4rem;
    border-top: 5px solid var(--primary);
}
.footer-container {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 2rem;
    padding-bottom: 3rem;
}
.footer-col h4 {
    color: var(--accent);
    margin-bottom: 1.5rem;
}
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 0.75rem; }
.footer-col a { color: #ccc; }
.footer-col a:hover { color: white; }
.footer-col p { color: #ccc; }
.footer-col .slogan { font-style: italic; font-size: 0.9rem; }
.footer-bottom {
    background-color: #111;
    padding: 1.5rem 0;
    text-align: center;
    font-size: 0.9rem;
    color: var(--muted);
}
.footer-bottom p { margin: 0.25rem 0; }
.disclaimer { font-style: italic; font-size: 0.8rem; }

/* ══════════════════════════════════════════
   Cookie Banner
   ══════════════════════════════════════════ */
#cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: var(--text);
    color: white;
    padding: 1rem;
    z-index: 2000;
    display: none; /* JS will show it */
}
.cookie-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.cookie-buttons { display: flex; gap: 1rem; }
#cookie-accept { background-color: var(--primary); }

/* ══════════════════════════════════════════
   Responsiveness
   ══════════════════════════════════════════ */
@media (max-width: 992px) {
    h1 { font-size: 2.25rem; }
    h2 { font-size: 1.75rem; }

    #nav-menu {
        display: none;
        position: absolute;
        top: 80px;
        left: 0;
        right: 0;
        background-color: var(--surface);
        box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    }
    #nav-menu.active { display: block; }
    #nav-menu ul { flex-direction: column; padding: 1rem; gap: 0; }
    #nav-menu li { width: 100%; }
    #nav-menu a { display: block; padding: 1rem; }
    #nav-toggle { display: block; }
    .header-cta { display: none; }

    .hero-container { grid-template-columns: 1fr; text-align: center; }
    .hero-image { grid-row: 1; margin-bottom: 2rem; }
    .hero-actions, .trust-badges { justify-content: center; }
    .zinsen-content, .rechner-wrapper, .kontakt-container { grid-template-columns: 1fr; }
    .checklist { columns: 1; }
    .timeline::after { left: 8px; }
    .timeline-item, .timeline-item:nth-child(even) { left: 0; width: 100%; padding-left: 3rem; text-align: left !important; }
    .timeline-dot, .timeline-item:nth-child(odd) .timeline-dot, .timeline-item:nth-child(even) .timeline-dot { left: 0; }

    .footer-container { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 576px) {
    body { font-size: 1rem; }
    section { padding: 3rem 0; }
    h1 { font-size: 1.8rem; }
    .card-grid { grid-template-columns: 1fr; }
    .footer-container { grid-template-columns: 1fr; }
    .cookie-container { flex-direction: column; gap: 1rem; text-align: center; }
}