/* =========================================================
   common.css – Gemeinsame Stile fuer alle Seiten
   Wahlwerbung Impressum-Generator System
   ========================================================= */

:root {
    /* WCAG 2.2 AA konforme Farbpalette */
    --primary: #1a365d;
    --primary-dark: #102544;
    --primary-hover: #15294a;
    --accent: #735128;
    --accent-light: #d4a96a;
    --text-primary: #1a202c;
    --text-secondary: #2d3748;
    --text-muted: #4a5568;
    --bg-page: #ffffff;
    --bg-section: #f1f3f7;
    --bg-card: #ffffff;
    --border: #cbd5e0;
    --border-strong: #718096;
    --success: #1e5631;
    --success-bg: #d1fae5;
    --warning: #8b5a00;
    --warning-bg: #fef3c7;
    --warning-border: #ca8a04;
    --danger: #8b1c1c;
    --danger-bg: #fee2e2;
    --info: #1e4e8c;
    --info-bg: #e0f2fe;
    --focus-ring: #2563eb;
}

* { box-sizing: border-box; }

html { font-size: 16px; }

body, h1, h2, h3, h4, h5, h6, p, a, button, input, select, textarea,
label, div, span, li, td, th, pre, code, blockquote {
    font-family: Verdana, Geneva, Tahoma, sans-serif;
}

body {
    background: var(--bg-page);
    color: var(--text-primary);
    font-size: 1rem;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    margin: 0;
}

/* ============= FOKUS (WCAG 2.4.7, 2.4.11) ============= */
*:focus {
    outline: 3px solid var(--focus-ring);
    outline-offset: 2px;
}
*:focus:not(:focus-visible) { outline: none; }
*:focus-visible {
    outline: 3px solid var(--focus-ring);
    outline-offset: 2px;
}

/* ============= SKIP LINK ============= */
.skip-link {
    position: absolute;
    top: -100px;
    left: 0;
    background: var(--primary);
    color: white;
    padding: 1rem 1.5rem;
    text-decoration: none;
    font-weight: 700;
    z-index: 1000;
}
.skip-link:focus { top: 0; color: white; }

/* ============= HEADER ============= */
.site-header {
    background: var(--primary);
    color: white;
    padding: 1.5rem 0;
    border-bottom: 4px solid var(--accent);
}
.site-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    color: white;
}
.site-header .header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}
.site-header a {
    color: white;
    text-decoration: none;
}
.site-header a:hover { text-decoration: underline; }
.user-info {
    font-size: 0.9rem;
    color: rgba(255,255,255,0.9);
}

/* ============= CONTAINER ============= */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
}
.container-sm {
    max-width: 500px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ============= CARD ============= */
.card {
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: 6px;
    margin-bottom: 1.5rem;
}
.card-header {
    background: var(--bg-section);
    border-bottom: 2px solid var(--border);
    padding: 1rem 1.5rem;
    font-weight: 700;
    color: var(--primary);
    font-size: 1.05rem;
}
.card-body { padding: 1.5rem; }

/* ============= FORM ============= */
.form-label {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.4rem;
    display: block;
}
.form-label .required { color: var(--danger); font-weight: 700; margin-left: 2px; }
.form-label .required-text {
    font-size: 0.85rem;
    font-weight: 400;
    color: var(--danger);
    margin-left: 4px;
}
.form-control, .form-select, textarea.form-control {
    border: 2px solid var(--border-strong);
    border-radius: 4px;
    padding: 0.65rem 0.85rem;
    font-size: 1rem;
    color: var(--text-primary);
    background: white;
    width: 100%;
    line-height: 1.5;
    font-family: inherit;
}
.form-control:focus, .form-select:focus, textarea.form-control:focus {
    border-color: var(--focus-ring);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
    outline: none;
}
.form-text {
    color: var(--text-secondary);
    font-size: 0.88rem;
    margin-top: 0.3rem;
}
.form-group { margin-bottom: 1rem; }

textarea.form-control { min-height: 100px; resize: vertical; }

/* ============= BUTTONS (WCAG 2.5.5, 2.5.8) ============= */
.btn {
    font-weight: 600;
    border-radius: 4px;
    padding: 0.65rem 1.25rem;
    font-size: 1rem;
    border: 2px solid transparent;
    min-height: 44px;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    font-family: inherit;
}
.btn-primary {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}
.btn-primary:hover, .btn-primary:focus {
    background: var(--primary-hover);
    color: white;
}
.btn-outline {
    background: white;
    color: var(--primary);
    border-color: var(--primary);
}
.btn-outline:hover, .btn-outline:focus {
    background: var(--bg-section);
}
.btn-accent {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}
.btn-accent:hover, .btn-accent:focus {
    background: #5e4220;
    color: white;
}
.btn-danger {
    background: var(--danger);
    color: white;
    border-color: var(--danger);
}
.btn-danger:hover, .btn-danger:focus {
    background: #6f1414;
    color: white;
}
.btn-block { display: flex; width: 100%; }
.btn-sm { padding: 0.4rem 0.8rem; font-size: 0.88rem; min-height: 36px; }

/* ============= ALERTS ============= */
.alert {
    padding: 1rem 1.25rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    border: 2px solid;
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
}
.alert-success {
    background: var(--success-bg);
    color: #065f46;
    border-color: var(--success);
}
.alert-warning {
    background: var(--warning-bg);
    color: #713f12;
    border-color: var(--warning-border);
}
.alert-danger {
    background: var(--danger-bg);
    color: #7f1d1d;
    border-color: var(--danger);
}
.alert-info {
    background: var(--info-bg);
    color: var(--info);
    border-color: var(--info);
}

/* ============= TABLE ============= */
.table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}
.table th, .table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
.table th {
    background: var(--bg-section);
    font-weight: 700;
    color: var(--primary);
    border-bottom: 2px solid var(--border-strong);
}
.table tbody tr:hover { background: var(--bg-section); }

/* ============= UTILITIES ============= */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.fw-bold { font-weight: 700; }
.mt-1 { margin-top: 0.5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; } .mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; } .mb-2 { margin-bottom: 1rem; } .mb-3 { margin-bottom: 1.5rem; } .mb-4 { margin-bottom: 2rem; }
.d-flex { display: flex; }
.gap-2 { gap: 1rem; }
.flex-wrap { flex-wrap: wrap; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }

.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;
}

/* ============= FOOTER ============= */
.site-footer {
    background: var(--primary-dark);
    color: rgba(255,255,255,0.9);
    padding: 2rem 0;
    margin-top: 4rem;
    text-align: center;
    font-size: 0.88rem;
}
.site-footer a { color: var(--accent-light); }

/* ============= RESPONSIVE ============= */
@media (max-width: 768px) {
    .site-header h1 { font-size: 1.2rem; }
    .card-body { padding: 1rem; }
    .container { padding: 0 1rem; }
}

@media print {
    .btn, .skip-link, .site-header, .site-footer { display: none; }
}
