/* Barrierefreiheit – BITV 2.0 / WCAG 2.1 AA Ergänzungen */

/* Fokus sichtbar auf allen interaktiven Elementen */
:focus-visible {
    outline: 3px solid #005a9c;
    outline-offset: 2px;
}

.skip-link:focus-visible {
    outline: 3px solid #ffbf00;
    outline-offset: 0;
}

/* Reduzierte Bewegung (Systemeinstellung + manuell) */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

html.reduce-motion *,
html.reduce-motion *::before,
html.reduce-motion *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
}

/* Hoher Kontrast (optional per Klasse am body) */
body.high-contrast {
    --color-text: #000000;
    --color-text-light: #0d1117;
    --color-bg: #ffffff;
    --color-border: #000000;
    --color-border-light: #333333;
    --color-primary: #001022;
    --color-primary-dark: #000d1a;
    --color-primary-light: #002244;
    --color-bg-cool: #e8eef4;
    --color-bg-warm: #f5f3f0;
}

body.high-contrast a {
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* Rechtstext-Seiten */
.legal-content {
    max-width: 760px;
}

.legal-content h2 {
    font-size: 1.35rem;
    font-weight: 700;
    margin: 2rem 0 0.75rem;
    color: var(--color-text);
}

.legal-content h3 {
    font-size: 1.1rem;
    font-weight: 650;
    margin: 1.5rem 0 0.5rem;
}

.legal-content p,
.legal-content li {
    font-size: 1rem;
    line-height: 1.75;
    color: var(--color-text-light);
    margin-bottom: 0.75rem;
}

.legal-content ul,
.legal-content ol {
    list-style: disc;
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}

.legal-content a {
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* Leichte Sprache */
.leichte-sprache {
    font-size: 1.125rem;
    line-height: 1.9;
}

.leichte-sprache p {
    max-width: 65ch;
}

.leichte-sprache .info-box {
    background: var(--color-bg-cool);
    border-left: 4px solid var(--color-primary);
    padding: 1.25rem 1.5rem;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    margin: 1.5rem 0;
}

/* DGS-Bereich */
.dgs-section {
    background: var(--color-bg-warm);
    border-radius: var(--radius-lg);
    padding: 2rem;
    border: 1px solid var(--color-border);
}

.dgs-video-wrapper {
    aspect-ratio: 16 / 9;
    background: var(--color-bg-cool);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--color-border);
    margin-top: 1rem;
}

.dgs-placeholder {
    text-align: center;
    padding: 2rem;
    color: var(--color-text-light);
}

/* Barrierefreiheits-Toolbar */
.a11y-toolbar {
    background: var(--color-bg-cool);
    border-bottom: 1px solid var(--color-border-light);
    padding: 0.5rem 0;
    font-size: 0.875rem;
}

.a11y-toolbar .container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1.5rem;
}

.a11y-toolbar__label {
    font-weight: 600;
    color: var(--color-text);
}

.a11y-toolbar button {
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: 0.4rem 0.85rem;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    min-height: 44px;
    min-width: 44px;
    color: var(--color-text);
    font-family: inherit;
}

.a11y-toolbar button:hover,
.a11y-toolbar button:focus-visible {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.a11y-toolbar button[aria-pressed="true"] {
    background: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
}

/* KI-Chat Platzhalter (Phase 4) */
.ki-chat-fab {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 900;
    background: var(--color-primary-dark);
    color: #fff;
    border: none;
    border-radius: 999px;
    padding: 0.85rem 1.25rem;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    min-height: 48px;
    font-family: inherit;
}

.ki-chat-fab:hover,
.ki-chat-fab:focus-visible {
    background: var(--color-primary-dark);
    color: #fff;
}

.ki-chat-panel {
    position: fixed;
    bottom: 5.5rem;
    right: 1.5rem;
    width: min(380px, calc(100vw - 2rem));
    max-height: 480px;
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    z-index: 901;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.ki-chat-panel[hidden] {
    display: none;
}

.ki-chat-panel__header {
    background: var(--color-primary-dark);
    color: #fff;
    padding: 1rem 1.25rem;
}

.ki-chat-panel__header h2 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.ki-chat-panel__hint {
    font-size: 0.75rem;
    opacity: 0.9;
    line-height: 1.4;
}

.ki-chat-panel__close {
    margin-top: 0.5rem;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: #fff;
    border-radius: var(--radius-sm);
    padding: 0.25rem 0.75rem;
    cursor: pointer;
    font-family: inherit;
    min-height: 44px;
}

.ki-chat-panel__close:hover,
.ki-chat-panel__close:focus-visible {
    background: rgba(255, 255, 255, 0.12);
}

.ki-chat-panel__messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    min-height: 120px;
}

.ki-chat-panel__form {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--color-border-light);
}

.ki-chat-panel__form input {
    flex: 1;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: 0.65rem 0.85rem;
    font-size: 0.9rem;
    font-family: inherit;
    min-height: 44px;
}

.ki-chat-panel__form button {
    background: var(--color-primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    padding: 0 1rem;
    font-weight: 600;
    cursor: pointer;
    min-height: 44px;
    min-width: 44px;
    font-family: inherit;
}

.ki-chat-msg {
    padding: 0.65rem 0.85rem;
    border-radius: var(--radius-sm);
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    line-height: 1.5;
}

.ki-chat-msg--system {
    background: var(--color-bg-cool);
    color: var(--color-text-light);
}
