:root {
    --primary: #1b2a4a;
    --primary-hover: #0f1d36;
    --accent: #e87722;
    --accent-hover: #d4691e;
    --bg: #f5f7fa;
    --card-bg: #ffffff;
    --text: #1e293b;
    --text-muted: #2d4a7a;
    --border: #e2e8f0;
    --error: #dc2626;
    --success: #16a34a;
    --focus: #e87722;
    --warning: #f59e0b;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

/* Auth pages */
body:has(.auth-container) {
    display: flex;
    align-items: center;
    justify-content: center;
}
.auth-container {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2.5rem;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
}
.auth-container h1 {
    font-size: 1.75rem;
    text-align: center;
    margin-bottom: 0.5rem;
}
.subtitle {
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 2rem;
    font-size: 0.95rem;
}
.brand { color: var(--accent); }

/* Forms */
.form-group { margin-bottom: 1.25rem; }
label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.4rem;
    font-size: 0.95rem;
}
input[type="text"], input[type="email"], input[type="password"], input[type="url"] {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s;
}
input:focus {
    outline: none;
    border-color: var(--focus);
    box-shadow: 0 0 0 3px rgba(232, 119, 34, 0.25);
}
/* Buttons: Navy statt Orange für WCAG AA Kontrast (weiß auf navy = 14.22:1) */
.btn-full {
    width: 100%;
    padding: 0.85rem;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 0.5rem;
}
.btn-full:hover { background: var(--accent-hover); }
.btn-full:focus { outline: none; box-shadow: 0 0 0 3px rgba(232, 119, 34, 0.4); }
.error-message {
    color: var(--error);
    font-weight: 600;
    text-align: center;
    margin-top: 1rem;
    min-height: 1.5rem;
}
.error-message:empty { display: none; }
.success-message {
    color: var(--success);
    font-weight: 600;
    text-align: center;
    margin-top: 1rem;
}
.auth-links {
    display: flex;
    justify-content: space-between;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}
.auth-links a {
    color: var(--accent);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
}
.auth-links a:hover { text-decoration: underline; }
.auth-links a:focus { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 2px; }
.auth-links.center { justify-content: center; }

/* Legal pages */
body:has(.legal-container) {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 2rem 1rem;
}
.legal-container {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2.5rem;
    width: 100%;
    max-width: 700px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
}
.legal-container h1 {
    font-size: 1.75rem;
    text-align: center;
    margin-bottom: 0.5rem;
}
.legal-container h2 {
    font-size: 1.2rem;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    color: var(--primary);
}
.legal-container h3 {
    font-size: 1.05rem;
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
}
.legal-container p {
    line-height: 1.6;
    margin-bottom: 0.5rem;
}
.legal-container ul {
    margin: 0.5rem 0 1rem 1.5rem;
    line-height: 1.6;
}
.legal-container li {
    margin-bottom: 0.4rem;
}
.legal-container a {
    color: var(--accent);
    text-decoration: underline;
}
.legal-container a:hover {
    color: var(--accent-hover);
}
.legal-container a:focus {
    outline: 2px solid var(--focus);
    outline-offset: 2px;
    border-radius: 2px;
}
.legal-container code {
    background: var(--bg);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.9em;
}
.legal-date {
    margin-top: 2rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-style: italic;
}

/* Legal footer on auth and app pages */
.legal-footer {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    font-size: 0.85rem;
    color: var(--text-muted);
}
.legal-footer a {
    color: var(--text-muted);
    text-decoration: none;
    margin: 0 0.5rem;
}
.legal-footer a:hover {
    color: var(--accent);
    text-decoration: underline;
}
.legal-footer a:focus {
    outline: 2px solid var(--focus);
    outline-offset: 2px;
    border-radius: 2px;
}

/* Checkbox group for registration */
.checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}
.checkbox-group input[type="checkbox"] {
    width: auto;
    margin-top: 0.25rem;
    flex-shrink: 0;
    accent-color: var(--accent);
}
.checkbox-group label {
    font-weight: 400;
    font-size: 0.9rem;
    line-height: 1.4;
    margin-bottom: 0;
}
.checkbox-group a {
    color: var(--accent);
    text-decoration: underline;
}
.checkbox-group a:hover {
    color: var(--accent-hover);
}
.checkbox-group a:focus {
    outline: 2px solid var(--focus);
    outline-offset: 2px;
    border-radius: 2px;
}

/* App layout */
header {
    background: var(--primary);
    color: white;
    padding: 0.75rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
header h1 { font-size: 1.3rem; color: white; }
.header-logo {
    height: 36px;
    width: auto;
    margin-right: 0.75rem;
    vertical-align: middle;
}
.header-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.header-actions { display: flex; gap: 0.5rem; align-items: center; }
.header-btn {
    background: none;
    border: 2px solid rgba(255,255,255,0.3);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
}
.header-btn:hover { border-color: rgba(255,255,255,0.6); background: rgba(255,255,255,0.1); }
.header-btn:focus { outline: none; box-shadow: 0 0 0 3px rgba(232, 119, 34, 0.5); }
.header-btn.active { background: var(--accent); color: white; border-color: var(--accent); }

/* Main content */
.main-content {
    max-width: 900px;
    margin: 2rem auto;
    padding: 0 1.5rem;
}

/* Upload area */
.upload-area {
    background: var(--card-bg);
    border: 2px dashed var(--accent);
    border-radius: 12px;
    padding: 2.5rem;
    text-align: center;
    margin-bottom: 2rem;
    transition: border-color 0.2s;
}
.upload-area:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(232, 119, 34, 0.15); }
.upload-area h2 { margin-bottom: 0.75rem; font-size: 1.2rem; }
.upload-area p { color: var(--text-muted); margin-bottom: 1rem; }
.upload-btn {
    display: inline-block;
    background: var(--primary);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
}
.upload-btn:hover { background: var(--primary-hover); }
.upload-btn:focus { outline: none; box-shadow: 0 0 0 3px rgba(27, 42, 74, 0.4); }
input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
}

/* Cards */
.section-title {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border);
}
.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.25rem;
    margin-bottom: 1rem;
    transition: box-shadow 0.2s;
}
.card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.card-name { font-weight: 700; font-size: 1.05rem; }
.card-info { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 0.75rem; }
.card-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

/* Status badges */
.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}
.badge-ready { background: #fff7ed; color: #9a3412; }
.badge-processing { background: #fef3c7; color: #92400e; }
.badge-done { background: #dcfce7; color: #166534; }
.badge-error { background: #fee2e2; color: #991b1b; }
.badge-inactive { background: #f1f5f9; color: #64748b; }
.badge-admin { background: #fff7ed; color: #9a3412; }

/* Buttons */
.btn {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: background 0.2s;
}
.btn:focus { outline: none; box-shadow: 0 0 0 3px rgba(232, 119, 34, 0.3); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); }
.btn-secondary { background: var(--bg); border: 2px solid var(--border); color: var(--text); }
.btn-secondary:hover:not(:disabled) { border-color: var(--text-muted); }
.btn-danger { background: var(--error); color: white; }
.btn-danger:hover:not(:disabled) { background: #b91c1c; }
.btn-small { padding: 0.35rem 0.75rem; font-size: 0.8rem; }

/* Progress */
.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
    margin: 0.75rem 0;
}
.progress-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 4px;
    transition: width 0.5s;
}

/* Image review */
.image-review {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.25rem;
    margin-bottom: 1rem;
}
.image-review-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.image-meta { font-size: 0.85rem; color: var(--text-muted); }
.image-preview {
    max-width: 100%;
    max-height: 300px;
    border: 1px solid var(--border);
    border-radius: 6px;
    margin-bottom: 0.75rem;
}
.alt-text-field {
    width: 100%;
    min-height: 80px;
    padding: 0.75rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    resize: vertical;
}
.alt-text-field:focus {
    outline: none;
    border-color: var(--focus);
    box-shadow: 0 0 0 3px rgba(232, 119, 34, 0.25);
}
.image-type-badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    background: #fff7ed;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #9a3412;
}
.save-indicator {
    font-size: 0.85rem;
    color: var(--success);
    margin-left: 0.5rem;
    opacity: 0;
    transition: opacity 0.3s;
}
.save-indicator.visible { opacity: 1; }

/* Navigation */
.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    background: none;
    border: none;
    color: var(--accent);
    font-size: 1rem;
    cursor: pointer;
    font-weight: 600;
}
.back-btn:focus { outline: none; box-shadow: 0 0 0 3px rgba(232, 119, 34, 0.3); border-radius: 4px; }

/* Empty state */
.empty-state { text-align: center; color: var(--text-muted); padding: 2rem; }

/* Admin table */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}
.admin-table th, .admin-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
.admin-table th {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
}
.admin-table tr:hover { background: var(--bg); }

/* Accessible utilities */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}
.modal {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 2rem;
    width: 100%;
    max-width: 450px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.modal h2 { margin-bottom: 1rem; font-size: 1.2rem; }
.modal .form-group { margin-bottom: 1rem; }
.modal-actions { display: flex; gap: 0.5rem; justify-content: flex-end; margin-top: 1.5rem; }

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        transition: none !important;
        animation: none !important;
    }
}


/* Drag & Drop */
.upload-area.drag-over {
    border-color: var(--primary);
    background: #f0f4ff;
    box-shadow: 0 0 0 3px rgba(27, 42, 74, 0.2);
}

/* Neuigkeiten Button */
.news-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.5rem 1.25rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.news-btn:hover { background: var(--primary-hover); }
.news-btn:focus { outline: none; box-shadow: 0 0 0 3px rgba(27, 42, 74, 0.4); }

/* Neuigkeiten Panel */
.news-panel {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
}
.news-panel[hidden] { display: none; }
.news-panel-content {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 2rem;
    width: 100%;
    max-width: 550px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.news-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border);
}
.news-panel-header h2 { font-size: 1.2rem; margin: 0; }
.news-panel-header button {
    background: var(--bg);
    border: 2px solid var(--border);
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    font-weight: 600;
    color: var(--text);
}
.news-panel-header button:hover { border-color: var(--text-muted); }
.news-panel-header button:focus { outline: none; box-shadow: 0 0 0 3px rgba(27, 42, 74, 0.3); }
.news-item {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.95rem;
    line-height: 1.5;
}
.news-item:last-child { border-bottom: none; }
.news-date {
    font-weight: 700;
    color: var(--primary);
    margin-right: 0.25rem;
}

/* Neuigkeiten: gelesene Eintraege */
.news-item-read {
    color: var(--text-muted);
    opacity: 0.65;
}
.news-divider {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.75rem 0 0.25rem;
    margin-top: 0.5rem;
    border-top: 1px solid var(--border);
}
