/* ==========================================================================
   Wohngeld Berlin — Design System
   Color scheme: Deep blue professional, warm orange CTAs, clean typography
   ========================================================================== */

:root {
    /* Primary palette */
    --primary: #1a3a5c;
    --primary-light: #2a5580;
    --primary-dark: #0f2640;
    --accent: #0d7377;
    --accent-light: #10989e;

    /* CTA */
    --cta: #e8751a;
    --cta-hover: #c46210;
    --cta-active: #a3520e;
    --cta-shadow: rgba(232, 117, 26, 0.35);

    /* Backgrounds */
    --bg: #ffffff;
    --bg-light: #f5f4f0;
    --bg-card: #fafaf8;

    /* Text */
    --text: #2d2d2d;
    --text-light: #5a5a5a;
    --text-muted: #888888;
    --heading: #1a3a5c;

    /* Borders & Dividers */
    --border: #e0ded8;
    --border-light: #ecebe7;

    /* Feedback */
    --success: #2d8a56;
    --success-bg: #edf7f1;

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.10);
    --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.12);

    /* Focus */
    --focus-ring: 3px solid #ffbf47;
    --focus-ring-offset: 2px;

    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-heading: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --line-height: 1.65;
    --line-height-heading: 1.3;

    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;

    /* Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;

    /* Transitions */
    --transition: 0.2s ease;
    --transition-slow: 0.35s ease;
}

/* ==========================================================================
   Reset & Base
   ========================================================================== */

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-family);
    font-size: 1rem;
    line-height: var(--line-height);
    color: var(--text);
    background-color: var(--bg);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

/* ==========================================================================
   Typography
   ========================================================================== */

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--heading);
    line-height: var(--line-height-heading);
    font-weight: 700;
}

h1 {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    margin-bottom: var(--space-md);
}

h2 {
    font-size: clamp(1.35rem, 3vw, 1.85rem);
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-sm);
    border-bottom: 2px solid var(--border-light);
}

h3 {
    font-size: clamp(1.15rem, 2vw, 1.35rem);
    margin-bottom: var(--space-sm);
}

h3:not(.no-accent) {
    color: var(--accent);
}

p {
    margin-bottom: var(--space-md);
}

a {
    color: var(--primary);
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color var(--transition);
}

a:hover {
    color: var(--primary-light);
}

ul, ol {
    margin-bottom: var(--space-md);
    padding-left: 1.5rem;
}

li {
    margin-bottom: var(--space-sm);
}

strong {
    font-weight: 600;
    color: var(--heading);
}

/* ==========================================================================
   Layout
   ========================================================================== */

.container {
    width: 92%;
    max-width: 1100px;
    margin: 0 auto;
    padding: var(--space-lg) 0;
}

main {
    flex: 1;
}

/* ==========================================================================
   Skip Link
   ========================================================================== */

.skip-link {
    position: absolute;
    top: -50px;
    left: var(--space-md);
    background: var(--primary);
    color: #fff;
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-sm);
    z-index: 2000;
    font-weight: 600;
    transition: top var(--transition);
    text-decoration: none;
}

.skip-link:focus {
    top: var(--space-sm);
    outline: var(--focus-ring);
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */

header {
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-xl);
    padding: var(--space-sm) 0;
}

/* Logo */
.logo a {
    text-decoration: none;
    color: var(--primary);
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    white-space: nowrap;
    transition: color var(--transition);
}

.logo a:hover {
    color: var(--primary-light);
}

.logo a::before {
    content: '🏢 ';
    font-size: 1.15rem;
}

/* Navigation */
.nav-links {
    list-style: none;
    display: flex;
    gap: var(--space-lg);
    margin: 0;
    padding: 0;
}

.nav-links li {
    position: relative;
    margin-bottom: 0;
}

.nav-links a,
.submenu-toggle {
    text-decoration: none;
    color: var(--text);
    font-weight: 500;
    padding: var(--space-sm) 0;
    display: block;
    background: none;
    border: none;
    font-size: 0.95rem;
    cursor: pointer;
    font-family: inherit;
    transition: color var(--transition);
    position: relative;
}

.nav-links a:hover,
.submenu-toggle:hover {
    color: var(--primary);
}

.nav-links a.active {
    color: var(--primary);
    font-weight: 600;
}

.nav-links a.active::after,
.submenu-toggle[aria-current="page"]::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--cta);
    border-radius: 1px;
}

.has-submenu {
    position: relative;
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

/* Bridge gap between button and submenu to prevent hover loss */
.has-submenu::after {
    content: '';
    position: absolute;
    bottom: calc(-1 * var(--space-sm) - 4px);
    left: 0;
    width: 100%;
    height: calc(var(--space-sm) + 6px);
}

/* Arrow indicator */
.arrow {
    display: inline-block;
    width: 0;
    height: 0;
    margin-left: 4px;
    vertical-align: middle;
    border-top: 4px solid var(--text);
    border-right: 4px solid transparent;
    border-left: 4px solid transparent;
    transition: transform var(--transition);
}

.submenu-toggle:hover .arrow {
    border-top-color: var(--primary);
}

.submenu-toggle[aria-expanded="true"] .arrow {
    transform: rotate(180deg);
}

/* Desktop Submenu */
@media (min-width: 1025px) {
    .submenu {
        position: absolute;
        top: calc(100% + var(--space-sm));
        left: -0.75rem;
        background: var(--bg);
        border: 1px solid var(--border);
        border-radius: var(--radius-md);
        box-shadow: var(--shadow-lg);
        list-style: none;
        padding: var(--space-sm) 0;
        margin: 0;
        min-width: 230px;
        opacity: 0;
        visibility: hidden;
        transform: translateY(6px);
        transition: all var(--transition);
        z-index: 1000;
    }

    /* Invisible bridge to prevent hover gap */
    .submenu::before {
        content: '';
        position: absolute;
        top: calc(-1 * var(--space-sm) - 2px);
        left: 0;
        width: 100%;
        height: calc(var(--space-sm) + 2px);
    }

    .nav-links li:hover > .submenu,
    .nav-links li:focus-within > .submenu {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    .submenu li a {
        padding: 0.6rem 1.25rem;
        font-size: 0.9rem;
        white-space: nowrap;
    }

    .submenu li a:hover {
        background: var(--bg-light);
        color: var(--primary);
    }
}

/* Hamburger menu toggle */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    z-index: 1100;
    border-radius: var(--radius-sm);
}

.menu-toggle:hover {
    background: var(--bg-light);
}

.hamburger {
    display: block;
    width: 24px;
    height: 2.5px;
    background: var(--text);
    position: relative;
    transition: background var(--transition);
    border-radius: 2px;
}

.hamburger::before,
.hamburger::after {
    content: '';
    position: absolute;
    width: 24px;
    height: 2.5px;
    background: var(--text);
    left: 0;
    border-radius: 2px;
    transition: transform var(--transition);
}

.hamburger::before { top: -7px; }
.hamburger::after { bottom: -7px; }

.menu-toggle[aria-expanded="true"] .hamburger {
    background: transparent;
}

.menu-toggle[aria-expanded="true"] .hamburger::before {
    transform: rotate(45deg) translate(5px, 5px);
}

.menu-toggle[aria-expanded="true"] .hamburger::after {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Language Switcher */
.language-switcher {
    display: flex;
    align-items: center;
}

.language-switcher select {
    padding: 0.5rem 2rem 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg);
    font-size: 0.9rem;
    cursor: pointer;
    font-family: inherit;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M6 8L1 3h10z' fill='%235a5a5a'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.6rem center;
    transition: border-color var(--transition);
}

.language-switcher select:hover,
.language-switcher select:focus {
    border-color: var(--primary);
}

/* ==========================================================================
   Buttons & CTAs
   ========================================================================== */

.btn {
    display: inline-block;
    padding: 0.8rem 1.75rem;
    font-size: 1rem;
    font-weight: 600;
    font-family: var(--font-family);
    text-decoration: none;
    border-radius: var(--radius-md);
    border: 2px solid transparent;
    cursor: pointer;
    transition: all var(--transition);
    text-align: center;
    line-height: 1.4;
}

.btn:focus-visible {
    outline: var(--focus-ring);
    outline-offset: var(--focus-ring-offset);
}

/* Primary CTA */
.btn-cta {
    background: var(--cta);
    color: #ffffff;
    border-color: var(--cta);
    box-shadow: 0 2px 8px var(--cta-shadow);
}

.btn-cta:hover {
    background: var(--cta-hover);
    border-color: var(--cta-hover);
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px var(--cta-shadow);
}

.btn-cta:active {
    background: var(--cta-active);
    border-color: var(--cta-active);
    transform: translateY(0);
    box-shadow: 0 1px 4px var(--cta-shadow);
}

/* Large hero CTA */
.btn-hero {
    padding: 1rem 2.5rem;
    font-size: 1.15rem;
    border-radius: var(--radius-lg);
    letter-spacing: 0.01em;
}

/* Secondary button */
.btn-secondary {
    background: var(--bg);
    color: var(--primary);
    border-color: var(--primary);
    box-shadow: none;
}

.btn-secondary:hover {
    background: var(--primary);
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

/* CTA Boxes (in-content) */
.cta-box {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #ffffff;
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    margin: var(--space-2xl) 0;
    text-align: center;
    box-shadow: var(--shadow-md);
}

.cta-box h2,
.cta-box h3 {
    color: #ffffff;
    border-bottom: none;
    margin-bottom: var(--space-sm);
}

.cta-box p {
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: var(--space-lg);
}

.cta-box .btn-cta {
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
}

.cta-box.cta-top {
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    margin-top: 0;
}

.cta-box.cta-bottom {
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* ==========================================================================
   Hero Section (Homepage)
   ========================================================================== */

.hero {
    background: linear-gradient(170deg, #f0f4f8 0%, #e8edf2 100%);
    border-radius: var(--radius-lg);
    padding: var(--space-3xl) var(--space-2xl);
    margin-bottom: var(--space-2xl);
    text-align: center;
    border: 1px solid var(--border-light);
}

.hero h1 {
    font-size: clamp(1.75rem, 5vw, 2.75rem);
    margin-bottom: var(--space-md);
    color: var(--primary-dark);
}

.hero-subtitle {
    font-size: clamp(1.05rem, 2vw, 1.25rem);
    color: var(--text-light);
    max-width: 650px;
    margin: 0 auto var(--space-xl);
    line-height: 1.6;
}

.hero .btn-hero {
    margin-top: var(--space-sm);
}

/* Intro text for content pages */
.intro-text {
    font-size: 1.1rem;
    color: var(--text-light);
    max-width: 750px;
    margin-bottom: var(--space-xl);
    line-height: 1.7;
}

/* ==========================================================================
   Steps Grid (Homepage)
   ========================================================================== */

.steps {
    margin: var(--space-3xl) 0;
}

.steps h2 {
    text-align: center;
    margin-bottom: var(--space-2xl);
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-xl);
}

.step-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    text-align: center;
    transition: transform var(--transition), box-shadow var(--transition);
    position: relative;
}

.step-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: var(--primary);
    color: #ffffff;
    font-size: 1.25rem;
    font-weight: 700;
    border-radius: 50%;
    margin-bottom: var(--space-md);
}

.step-card h3 {
    margin-bottom: var(--space-sm);
    color: var(--heading);
}

.step-card p {
    color: var(--text-light);
    font-size: 0.95rem;
    margin-bottom: 0;
}

/* ==========================================================================
   Trust Section (Homepage)
   ========================================================================== */

.trust {
    background: var(--bg-light);
    border-radius: var(--radius-lg);
    padding: var(--space-2xl);
    margin: var(--space-3xl) 0;
    text-align: center;
    border: 1px solid var(--border-light);
}

.trust h2 {
    border-bottom: none;
}

.trust ul {
    list-style: none;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--space-md);
    margin-top: var(--space-lg);
}

.trust li {
    background: var(--bg);
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-weight: 500;
    font-size: 0.95rem;
    border: 1px solid var(--border-light);
}

.trust li::before {
    content: '✓';
    color: var(--success);
    font-weight: 700;
    font-size: 1.1rem;
}

/* ==========================================================================
   CTA Section (Homepage bottom)
   ========================================================================== */

.cta-section {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: var(--radius-lg);
    padding: var(--space-3xl) var(--space-2xl);
    text-align: center;
    margin: var(--space-3xl) 0 var(--space-2xl);
    box-shadow: var(--shadow-lg);
}

.cta-section h2 {
    color: #ffffff;
    border-bottom: none;
    font-size: clamp(1.35rem, 3vw, 1.75rem);
}

.cta-section p {
    color: rgba(255, 255, 255, 0.85);
    max-width: 550px;
    margin: 0 auto var(--space-xl);
}

/* ==========================================================================
   Content Pages (Generic)
   ========================================================================== */

.content-page {
    max-width: 850px;
}

.content-page h1 {
    margin-bottom: var(--space-sm);
}

.content-page h2 {
    margin-top: var(--space-2xl);
    margin-bottom: var(--space-md);
}

.content-page h3 {
    margin-top: var(--space-lg);
}

.content-page p + h3 {
    margin-top: var(--space-xl);
}

/* ==========================================================================
   FAQ
   ========================================================================== */

/* FAQ teaser on homepage */
.faq-teaser {
    padding: var(--space-2xl) 0;
    background: var(--bg-card);
}

.faq-teaser h2 {
    margin-bottom: var(--space-lg);
}

.faq-teaser .faq-item {
    background: var(--bg);
}

.faq-teaser .btn {
    margin-top: var(--space-lg);
}

.faq-category {
    margin-bottom: var(--space-2xl);
}

.faq-category h2 {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.faq-item {
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-sm);
    overflow: hidden;
    transition: box-shadow var(--transition);
}

.faq-item:hover {
    box-shadow: var(--shadow-sm);
}

.faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: var(--space-md) var(--space-lg);
    margin: 0;
    background: var(--bg);
    border: none;
    cursor: pointer;
    font-size: 1.05rem;
    font-weight: 600;
    font-family: var(--font-family);
    text-align: left;
    color: var(--heading) !important;
    transition: background var(--transition), color var(--transition);
}

.faq-question:focus-visible {
    outline: var(--focus-ring);
    outline-offset: -2px;
}

.faq-question:hover {
    background: var(--bg-light);
    color: var(--primary);
}

.faq-question::after {
    content: '+';
    font-size: 1.4rem;
    font-weight: 400;
    color: var(--primary);
    margin-left: var(--space-md);
    flex-shrink: 0;
    transition: transform var(--transition);
    width: 24px;
    text-align: center;
}

.faq-question[aria-expanded="true"] {
    background: var(--primary);
    color: #ffffff !important;
}

.faq-question[aria-expanded="true"]::after {
    content: '−';
    color: #ffffff;
    transform: rotate(180deg);
}

.faq-answer {
    padding: 0 var(--space-lg);
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-slow), padding var(--transition-slow);
    background: var(--bg-card);
    font-size: 0.95rem;
    line-height: 1.7;
}

.faq-answer.open {
    max-height: 2000px;
    padding: var(--space-md) var(--space-lg) var(--space-lg);
}

.faq-answer p:last-child {
    margin-bottom: 0;
}

.faq-link {
    color: var(--accent);
    font-weight: 500;
}

.faq-link:hover {
    color: var(--accent-light);
}

/* Related Links */
.related-links {
    background: var(--bg-light);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    margin-top: var(--space-3xl);
    border: 1px solid var(--border-light);
}

.related-links h2 {
    margin-top: 0;
    border-bottom: none;
    font-size: 1.25rem;
}

.related-links ul {
    list-style: none;
    padding: 0;
    margin: var(--space-md) 0 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: var(--space-sm);
}

.related-links li {
    margin-bottom: 0;
}

.related-links a {
    display: block;
    padding: 0.6rem 0.75rem;
    background: var(--bg);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all var(--transition);
}

.related-links a:hover {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
}

/* ==========================================================================
   Tables
   ========================================================================== */

.table-wrapper {
    overflow-x: auto;
    margin: var(--space-xl) 0;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.wohngeld-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.wohngeld-table thead {
    background: var(--primary);
    color: #ffffff;
}

.wohngeld-table th {
    padding: 0.85rem 1rem;
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
}

.wohngeld-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-light);
    text-align: left;
}

.wohngeld-table tbody tr:nth-child(even) {
    background: var(--bg-light);
}

.wohngeld-table tbody tr:hover {
    background: #edf2f7;
}

.table-note {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: var(--space-sm);
    font-style: italic;
}

/* ==========================================================================
   Footer
   ========================================================================== */

footer {
    background: var(--primary-dark);
    color: rgba(255, 255, 255, 0.8);
    padding: var(--space-2xl) 0;
    margin-top: var(--space-3xl);
}

.footer-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-lg);
}

.footer-info {
    font-size: 0.9rem;
}

.footer-links {
    list-style: none;
    display: flex;
    gap: var(--space-lg);
    margin: 0;
    padding: 0;
}

.footer-links li {
    margin-bottom: 0;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color var(--transition);
}

.footer-links a:hover {
    color: #ffffff;
}

/* ==========================================================================
   Utility Classes
   ========================================================================== */

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.text-center {
    text-align: center;
}

.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }

/* ==========================================================================
   Focus & Accessibility
   ========================================================================== */

a:focus-visible,
button:focus-visible,
select:focus-visible,
input:focus-visible {
    outline: var(--focus-ring);
    outline-offset: var(--focus-ring-offset);
}

/* Reduce motion preference */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    html {
        scroll-behavior: auto;
    }
}

/* ==========================================================================
   Responsive — Tablet & Mobile
   ========================================================================== */

@media (max-width: 1024px) {
    .header-container {
        gap: var(--space-md);
    }

    .language-switcher {
        margin-left: auto;
    }

    /* Mobile hamburger */
    .menu-toggle {
        display: block;
    }

    .nav-wrapper {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 340px;
        height: 100vh;
        height: 100dvh;
        background: var(--bg);
        box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
        padding: 5rem var(--space-xl) var(--space-xl);
        transition: right var(--transition-slow);
        z-index: 1050;
        overflow-y: auto;
    }

    .nav-wrapper.is-active {
        right: 0;
    }

    .nav-links {
        flex-direction: column;
        gap: var(--space-sm);
    }

    .has-submenu {
        flex-direction: column;
        align-items: flex-start;
    }

    .submenu {
        list-style: none;
        padding-left: var(--space-lg);
        display: none;
        width: 100%;
    }

    .submenu.is-open {
        display: block;
    }

    .submenu li a {
        padding: 0.6rem 0;
        font-size: 0.9rem;
    }

    /* Hero */
    .hero {
        padding: var(--space-2xl) var(--space-lg);
    }

    .hero .btn-hero {
        padding: 0.9rem 2rem;
        font-size: 1.05rem;
    }

    /* Steps */
    .steps-grid {
        grid-template-columns: 1fr;
    }

    /* Trust */
    .trust ul {
        grid-template-columns: 1fr;
    }

    /* Footer */
    .footer-container {
        flex-direction: column;
        text-align: center;
    }

    .footer-links {
        flex-wrap: wrap;
        justify-content: center;
    }
}

@media (max-width: 640px) {
    h1 { font-size: 1.6rem; }
    h2 { font-size: 1.3rem; }

    .container {
        width: 94%;
        padding: var(--space-md) 0;
    }

    .hero {
        padding: var(--space-xl) var(--space-md);
        border-radius: var(--radius-md);
    }

    .hero-subtitle {
        font-size: 1rem;
        margin-bottom: var(--space-lg);
    }

    .step-card {
        padding: var(--space-lg);
    }

    .cta-section,
    .cta-box {
        padding: var(--space-xl) var(--space-md);
    }

    .faq-question {
        padding: var(--space-md);
        font-size: 1rem;
    }

    .faq-answer {
        padding: 0 var(--space-md);
    }

    .faq-answer.open {
        padding: var(--space-md);
    }

    .related-links ul {
        grid-template-columns: 1fr;
    }

    /* Tables on small screens */
    .wohngeld-table {
        font-size: 0.85rem;
    }

    .wohngeld-table th,
    .wohngeld-table td {
        padding: 0.6rem 0.75rem;
    }
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
    header,
    footer,
    .btn,
    .cta-box,
    .cta-section,
    .menu-toggle,
    .language-switcher {
        display: none !important;
    }

    body {
        font-size: 12pt;
        color: #000;
    }

    a {
        color: #000;
        text-decoration: underline;
    }

    .container {
        width: 100%;
        max-width: none;
    }
}

/* ==========================================================================
   Interactive Wohngeld Calculator
   ========================================================================== */

.interactive-calculator {
    background: linear-gradient(135deg, #f7f9fc 0%, #eef2f7 100%);
    border: 2px solid var(--primary);
    border-radius: 12px;
    padding: 2rem;
    margin: 2rem 0;
    box-shadow: 0 4px 20px rgba(26, 58, 92, 0.08);
}

.interactive-calculator h2 {
    color: var(--primary);
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    text-align: center;
}

.interactive-calculator > p {
    text-align: center;
    color: #555;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.calc-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.calc-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.calc-field label {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--primary);
}

.calc-field select,
.calc-field input[type="number"] {
    padding: 0.65rem 0.75rem;
    border: 2px solid #d0d7e0;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
    width: 100%;
    box-sizing: border-box;
}

.calc-field select:focus,
.calc-field input[type="number"]:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26, 58, 92, 0.12);
    outline: none;
}

.calc-input-group {
    display: flex;
    align-items: center;
    position: relative;
}

.calc-input-group input {
    padding-right: 2.5rem !important;
}

.calc-input-suffix {
    position: absolute;
    right: 0.75rem;
    font-weight: 700;
    color: var(--primary);
    font-size: 1.05rem;
    pointer-events: none;
}

.calc-range {
    margin-top: 0.25rem;
}

.calc-range input[type="range"] {
    width: 100%;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: #d0d7e0;
    border-radius: 3px;
    outline: none;
}

.calc-range input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--cta);
    cursor: pointer;
    border: 3px solid #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

.calc-range input[type="range"]::-moz-range-thumb {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--cta);
    cursor: pointer;
    border: 3px solid #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

.calc-hint {
    font-size: 0.8rem;
    color: #888;
    margin-top: 0.2rem;
}

.calc-result {
    background: #fff;
    border: 2px solid var(--accent);
    border-radius: 10px;
    padding: 1.5rem;
    text-align: center;
    margin-bottom: 1.25rem;
    transition: all 0.3s;
}

.calc-result-zero {
    border-color: #ccc;
    opacity: 0.7;
}

.calc-result-inner {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.calc-result-label {
    font-size: 0.9rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.calc-result-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary);
}

.calc-result-note {
    font-size: 0.85rem;
    color: #777;
    margin-top: 0.75rem;
    font-style: italic;
}

.calc-cta {
    text-align: center;
}

.calc-cta .btn-cta {
    font-size: 1.1rem;
    padding: 0.85rem 2.5rem;
}

@media (max-width: 640px) {
    .calc-form {
        grid-template-columns: 1fr;
    }
    
    .calc-result-value {
        font-size: 1.6rem;
    }
}
