/* Modern Responsive Stylesheet for Therapielotse */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

:root {
    --primary: #0d9488;
    --primary-dark: #0f766e;
    --primary-light: #ccfbf1;
    --accent: #6366f1;
    --accent-glow: rgba(99, 102, 241, 0.25);
    
    --success: #10b981;
    --success-bg: #ecfdf5;
    --success-text: #047857;
    
    --danger: #ef4444;
    --danger-bg: #fef2f2;
    --danger-text: #b91c1c;

    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --border-color: #e2e8f0;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 8px;
    
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 14px -2px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 10px 30px -4px rgba(15, 23, 42, 0.12);
    --shadow-glow: 0 0 20px rgba(16, 185, 129, 0.3);
}

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

html, body {
    overflow-x: hidden;
    width: 100%;
}

body {
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, .brand-title {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
}

/* Container */
.container {
    width: 100%;
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 1.25rem;
}

/* Header & Navbar */
.navbar {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 0.85rem 0;
}

.navbar-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    text-decoration: none;
    color: var(--text-main);
}

.brand-icon {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.3);
}

.brand-text h1 {
    font-size: 1.25rem;
    line-height: 1.1;
    background: linear-gradient(135deg, var(--primary-dark), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-text span {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

.nav-toggle {
    display: none;
    background: transparent;
    border: 1.5px solid var(--border-color);
    color: var(--text-main);
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-md);
    font-size: 1.25rem;
    cursor: pointer;
    min-width: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
}

.nav-toggle:hover {
    background: var(--primary-light);
    color: var(--primary-dark);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

@media (max-width: 768px) {
    .nav-toggle {
        display: inline-flex;
    }

    .navbar-inner {
        flex-wrap: wrap;
    }

    .nav-actions {
        display: none;
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
        padding-top: 0.85rem;
        margin-top: 0.5rem;
        border-top: 1px solid var(--border-color);
    }

    .nav-actions.active {
        display: flex;
    }

    .nav-actions .btn {
        width: 100%;
        justify-content: center;
        padding: 0.75rem 1rem;
    }
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.65rem 1.25rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.925rem;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    outline: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.25);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(13, 148, 136, 0.35);
}

.btn-outline {
    background: transparent;
    border: 1.5px solid var(--border-color);
    color: var(--text-main);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}

.btn-call-large {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    font-size: 1.1rem;
    font-weight: 700;
    padding: 0.9rem 1.5rem;
    border-radius: var(--radius-md);
    width: 100%;
    box-shadow: var(--shadow-glow);
    animation: pulse-border 2.5s infinite;
}

.btn-call-large:hover {
    background: linear-gradient(135deg, #059669, #047857);
    transform: scale(1.02);
}

@keyframes pulse-border {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* Hero & Filter Section */
.hero-section {
    background: linear-gradient(180deg, #f0fdfa 0%, var(--bg-main) 100%);
    padding: 2.5rem 0 1.5rem 0;
    border-bottom: 1px solid var(--border-color);
}

.hero-header {
    text-align: center;
    margin-bottom: 2rem;
}

.hero-header h2 {
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.hero-header p {
    color: var(--text-muted);
    font-size: 1.05rem;
    max-width: 680px;
    margin: 0 auto;
}

.filter-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(226, 232, 240, 0.8);
}

.filter-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr auto;
    gap: 1rem;
    align-items: end;
}

@media (max-width: 900px) {
    .filter-grid {
        grid-template-columns: 1fr;
    }
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.input-with-btn {
    display: flex;
    gap: 0.5rem;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-family: inherit;
    transition: all 0.2s ease;
    background: #ffffff;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15);
}

.toggle-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: var(--success-bg);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: var(--radius-md);
    cursor: pointer;
    user-select: none;
}

.toggle-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--success);
    cursor: pointer;
}

.toggle-group label {
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--success-text);
}

/* View Switcher & Results Bar */
.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 2rem 0 1.25rem 0;
    flex-wrap: wrap;
    gap: 1rem;
}

.results-count {
    font-size: 1.1rem;
    font-weight: 700;
}

.view-tabs {
    display: flex;
    background: var(--border-color);
    padding: 3px;
    border-radius: var(--radius-md);
}

.view-tab {
    padding: 0.45rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    cursor: pointer;
    border: none;
    background: transparent;
    color: var(--text-muted);
    transition: all 0.2s ease;
}

.view-tab.active {
    background: white;
    color: var(--primary-dark);
    box-shadow: var(--shadow-sm);
}

/* Card Grid Layout */
.therapist-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

@media (max-width: 480px) {
    .therapist-grid {
        grid-template-columns: 1fr;
    }
}

.therapist-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    transition: all 0.25s ease;
}

.therapist-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(13, 148, 136, 0.3);
}

.therapist-card.has-capacity {
    border-left: 5px solid var(--success);
}

.therapist-card.no-capacity {
    border-left: 5px solid #cbd5e1;
    opacity: 0.85;
}

.card-header-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
    gap: 0.5rem;
}

.capacity-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.capacity-badge.available {
    background: var(--success-bg);
    color: var(--success-text);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.capacity-badge.unavailable {
    background: #f1f5f9;
    color: #64748b;
    border: 1px solid #e2e8f0;
}

.distance-badge {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent);
    background: #eef2ff;
    padding: 0.25rem 0.6rem;
    border-radius: var(--radius-sm);
}

.therapist-name {
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
    color: var(--text-main);
}

.therapist-address {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.category-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 1.25rem;
}

.category-tag {
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--primary-light);
    color: var(--primary-dark);
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
}

.therapist-notes {
    font-size: 0.85rem;
    color: var(--text-muted);
    background: #f8fafc;
    padding: 0.75rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.25rem;
    border-left: 3px solid var(--border-color);
}

.card-action {
    margin-top: auto;
}

/* Map Container */
#map-container {
    width: 100%;
    height: 520px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    margin-bottom: 3rem;
    border: 1px solid var(--border-color);
    overflow: hidden;
}

/* Auth Cards (Login/Register/Dashboard) */
.auth-wrapper {
    max-width: 520px;
    margin: 3rem auto;
}

.auth-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 2.25rem;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
}

.auth-header {
    text-align: center;
    margin-bottom: 1.75rem;
}

.auth-header h2 {
    font-size: 1.75rem;
    margin-bottom: 0.35rem;
}

.auth-header p {
    color: var(--text-muted);
    font-size: 0.925rem;
}

.qr-box {
    text-align: center;
    background: #f8fafc;
    padding: 1.25rem;
    border-radius: var(--radius-md);
    border: 1px dashed var(--border-color);
    margin: 1.25rem 0;
}

.qr-box img {
    max-width: 200px;
    height: auto;
    border-radius: var(--radius-sm);
}

.secret-code {
    font-family: monospace;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    background: #e2e8f0;
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-sm);
    display: inline-block;
    margin-top: 0.5rem;
}

/* Dashboard Specifics */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    margin: 2rem 0;
}

@media (max-width: 850px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

.capacity-toggle-box {
    background: linear-gradient(135deg, #0d9488, #0f766e);
    color: white;
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    box-shadow: var(--shadow-lg);
    margin-bottom: 1.5rem;
}

.toggle-switch-large {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    margin-top: 1rem;
}

.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #cbd5e1;
    transition: .3s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #10b981;
}

input:checked + .slider:before {
    transform: translateX(26px);
}

.alert {
    padding: 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.25rem;
    font-size: 0.9rem;
    font-weight: 500;
}

.alert-success {
    background: var(--success-bg);
    color: var(--success-text);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.alert-danger {
    background: var(--danger-bg);
    color: var(--danger-text);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.footer {
    border-top: 1px solid var(--border-color);
    padding: 2rem 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-top: auto;
}

/* =========================================================================
   BARRIEREFREIHEIT (WCAG 2.1 AA / BITV 2.0 / BFSG) & FOCUS STYLES
   ========================================================================= */

/* Skip Link for Screen Readers & Keyboard Navigation */
.skip-link {
    position: absolute;
    top: -100px;
    left: 1rem;
    background: var(--primary-dark);
    color: #ffffff;
    padding: 0.75rem 1.25rem;
    z-index: 9999;
    border-radius: var(--radius-sm);
    font-weight: 700;
    text-decoration: none;
    transition: top 0.2s ease;
}

.skip-link:focus {
    top: 1rem;
    outline: 3px solid #facc15;
}

/* High Contrast Focus Rings for Keyboard Navigation */
:focus-visible {
    outline: 3px solid var(--accent) !important;
    outline-offset: 3px !important;
}

/* Screen Reader Only Utility Class */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* =========================================================================
   DSGVO / TTDSG COOKIE CONSENT BANNER STYLES
   ========================================================================= */
.cookie-banner {
    position: fixed;
    bottom: 1.25rem;
    left: 1.25rem;
    right: 1.25rem;
    max-width: 800px;
    margin: 0 auto;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    color: #ffffff;
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 10000;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.cookie-banner-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

@media (max-width: 768px) {
    .cookie-banner-content {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* =========================================================================
   BARRIEREFREIHEITS-LEISTE (A11Y TOOLBAR: SCHRIFTVERGRÖSSERUNG & HOHER KONTRAST)
   ========================================================================= */

.a11y-toolbar {
    background: #0f172a;
    color: #ffffff;
    font-size: 0.8rem;
    padding: 0.35rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.a11y-toolbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.a11y-title {
    font-weight: 600;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.a11y-controls {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.a11y-btn {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-sm);
    padding: 0.25rem 0.6rem;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    min-height: 32px;
}

.a11y-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #ffffff;
}

/* =========================================================================
   HIGH CONTRAST MODE (SCHWARZ / GELB - WCAG AAA STANDARD)
   ========================================================================= */

body.high-contrast-mode {
    background-color: #000000 !important;
    color: #ffff00 !important;
}

body.high-contrast-mode *,
body.high-contrast-mode h1,
body.high-contrast-mode h2,
body.high-contrast-mode h3,
body.high-contrast-mode h4,
body.high-contrast-mode p,
body.high-contrast-mode label,
body.high-contrast-mode span,
body.high-contrast-mode strong {
    color: #ffff00 !important;
    background-color: #000000 !important;
    border-color: #ffff00 !important;
    text-shadow: none !important;
    box-shadow: none !important;
}

body.high-contrast-mode a,
body.high-contrast-mode button,
body.high-contrast-mode .btn {
    background-color: #000000 !important;
    color: #00ffff !important;
    border: 2px solid #00ffff !important;
    text-decoration: underline !important;
    font-weight: 700 !important;
}

body.high-contrast-mode a:hover,
body.high-contrast-mode button:hover,
body.high-contrast-mode .btn:hover {
    background-color: #00ffff !important;
    color: #000000 !important;
}

body.high-contrast-mode .navbar,
body.high-contrast-mode .card,
body.high-contrast-mode .therapist-card,
body.high-contrast-mode .filter-card,
body.high-contrast-mode .auth-card,
body.high-contrast-mode .a11y-toolbar {
    background-color: #000000 !important;
    border: 2px solid #ffff00 !important;
}

body.high-contrast-mode :focus-visible {
    outline: 4px solid #00ffff !important;
    outline-offset: 4px !important;
}


