/*
 * Hinweisgeberschutz-Frontend -- Standalone-Stylesheet
 *
 * Anonymitaets-Regel: KEINE externen Fonts, KEIN CDN, KEIN Analytics.
 * System-Font-Stack, damit der Browser keine externen Ressourcen laedt.
 *
 * ca. 500 Zeilen  |  Sektions-Kommentare  |  CSS Custom Properties
 */

/* === Custom Properties === */
:root {
    --primary:       #8b2635;
    --primary-hover:  #6e1e2a;
    --primary-light:  rgba(139, 38, 53, 0.08);
    --primary-glow:   rgba(139, 38, 53, 0.18);

    --gray-50:   #f9fafb;
    --gray-100:  #f3f4f6;
    --gray-200:  #e5e7eb;
    --gray-300:  #d1d5db;
    --gray-400:  #9ca3af;
    --gray-500:  #6b7280;
    --gray-600:  #4b5563;
    --gray-700:  #374151;
    --gray-800:  #1f2937;
    --gray-900:  #111827;

    --info-bg:      #eff6ff;
    --info-border:  #bfdbfe;
    --info-text:    #1e40af;
    --warn-bg:      #fffbeb;
    --warn-border:  #fde68a;
    --warn-text:    #92400e;
    --danger-bg:    #fef2f2;
    --danger-border:#fecaca;
    --danger-text:  #991b1b;
    --success-bg:   #f0fdf4;
    --success-border:#bbf7d0;
    --success-text: #166534;

    --radius-sm:  6px;
    --radius:     10px;
    --radius-lg:  14px;

    --shadow-sm:  0 1px 2px rgba(0,0,0,0.05);
    --shadow:     0 2px 8px rgba(0,0,0,0.08);
    --shadow-lg:  0 4px 16px rgba(0,0,0,0.10);
    --shadow-lift:0 8px 24px rgba(0,0,0,0.12);

    --font-sans:  -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
                  Ubuntu, Cantarell, 'Helvetica Neue', Helvetica, Arial, sans-serif;
    --font-mono:  'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace;
}

/* === Reset === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
    font-family: var(--font-sans);
    line-height: 1.65;
    color: var(--gray-800);
    background: var(--gray-50);
    min-height: 100vh;
    padding: 1rem;
}

/* === Layout === */
.container {
    max-width: 740px;
    margin: 2rem auto;
    padding: 0 1rem;
}

/* === Card === */
.card {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 2.5rem 3rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-200);
}

/* === Hero === */
.hero {
    text-align: center;
    padding: 3rem 1.5rem 2rem;
    margin-bottom: 1.5rem;
}

.hero-icon {
    font-size: 3rem;
    line-height: 1;
    margin-bottom: 1rem;
    color: var(--primary);
}

.hero-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--gray-900);
    letter-spacing: -0.01em;
    margin-bottom: 0.75rem;
}

.hero-lead {
    font-size: 1.125rem;
    color: var(--gray-600);
    max-width: 560px;
    margin: 0 auto;
    line-height: 1.7;
}

/* === Typography === */
h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--gray-900);
    letter-spacing: -0.01em;
    margin-bottom: 1rem;
}

h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-900);
    letter-spacing: -0.005em;
    margin: 2rem 0 0.75rem;
}

h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gray-900);
    margin: 1.5rem 0 0.5rem;
}

p {
    margin-bottom: 1rem;
    color: var(--gray-700);
}

p.lead {
    font-size: 1.0625rem;
    line-height: 1.7;
    color: var(--gray-600);
}

p.footer {
    text-align: center;
    color: var(--gray-500);
    margin-top: 2rem;
    font-size: 0.85rem;
}

small, .text-muted { color: var(--gray-500); }
.text-center { text-align: center; }

/* === Links === */
a {
    color: var(--primary);
    text-decoration: none;
    transition: color 150ms;
}
a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* === Code === */
code {
    display: inline-block;
    background: var(--gray-100);
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 0.875rem;
    color: var(--gray-900);
}

/* === Forms === */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--gray-700);
    font-size: 0.95rem;
}

.form-control {
    width: 100%;
    padding: 0.875rem 1rem;
    font-size: 1rem;
    border: 1.5px solid var(--gray-300);
    border-radius: var(--radius);
    background: #fff;
    color: var(--gray-900);
    font-family: inherit;
    line-height: 1.5;
    transition: border-color 200ms, box-shadow 200ms;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-glow);
}

.form-control::placeholder {
    color: var(--gray-400);
}

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

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='7' fill='none'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7280' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

.form-text {
    display: block;
    margin-top: 0.375rem;
    font-size: 0.85rem;
    color: var(--gray-500);
}

/* === Buttons === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border: 2px solid transparent;
    border-radius: var(--radius);
    cursor: pointer;
    text-decoration: none;
    font-family: inherit;
    transition: background 200ms, border-color 200ms, box-shadow 200ms, transform 100ms;
    gap: 0.5rem;
}

.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }

.btn-primary {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
.btn-primary:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    color: #fff;
    box-shadow: var(--shadow-sm);
}

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

.btn-block { display: flex; width: 100%; }
.btn-lg { padding: 1rem 2rem; font-size: 1.0625rem; }
.btn-sm { min-height: 36px; padding: 0.375rem 0.875rem; font-size: 0.875rem; }

.cta-row {
    display: flex;
    gap: 0.875rem;
    flex-wrap: wrap;
    margin: 1.5rem 0 2rem;
}

/* === Alerts === */
.alert {
    padding: 1.125rem 1.5rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    border: none;
    border-left: 4px solid transparent;
    line-height: 1.6;
}

.alert strong { display: inline; }

.alert-info {
    background: var(--info-bg);
    border-left-color: var(--info-border);
    color: var(--info-text);
}
.alert-warning {
    background: var(--warn-bg);
    border-left-color: var(--warn-border);
    color: var(--warn-text);
}
.alert-danger {
    background: var(--danger-bg);
    border-left-color: var(--danger-border);
    color: var(--danger-text);
}
.alert-success {
    background: var(--success-bg);
    border-left-color: var(--success-border);
    color: var(--success-text);
}

/* === Dividers === */
hr {
    border: none;
    border-top: 1px solid var(--gray-200);
    margin: 2rem 0;
}

/* === Spacing helpers === */
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mt-2 { margin-top: 1rem; }

/* === Kanal-Grid (Landing) === */
.kanal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0 2rem;
}

.kanal-card {
    padding: 1.75rem 1.5rem;
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    transition: box-shadow 250ms, transform 250ms;
    text-align: center;
}
.kanal-card:hover {
    box-shadow: var(--shadow-lift);
    transform: translateY(-2px);
}

.kanal-icon {
    font-size: 2rem;
    margin-bottom: 0.75rem;
    line-height: 1;
}

.kanal-card h3 {
    font-size: 1rem;
    margin: 0 0 0.5rem;
    color: var(--gray-900);
}

.kanal-card p {
    font-size: 0.9rem;
    color: var(--gray-600);
    margin: 0;
}

/* === Beschreibungs-Box (Meldungsinhalt) === */
.beschreibung-box {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 1.25rem;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.65;
    color: var(--gray-800);
}

/* === Meldungs-Meta-Grid === */
.meldung-meta-grid {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.5rem 1.25rem;
    margin: 1rem 0 1.5rem;
    font-size: 0.95rem;
}
.meldung-meta-grid dt { font-weight: 600; color: var(--gray-700); }
.meldung-meta-grid dd { color: var(--gray-800); margin: 0; }

/* === Status-Badge === */
.status-badge {
    display: inline-block;
    padding: 0.25rem 0.875rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
}
.status-eingegangen    { background: var(--info-bg);    color: var(--info-text);    border: 1px solid var(--info-border); }
.status-bestaetigt     { background: var(--success-bg); color: var(--success-text); border: 1px solid var(--success-border); }
.status-bearbeitung    { background: var(--warn-bg);    color: var(--warn-text);    border: 1px solid var(--warn-border); }
.status-massnahmen     { background: #fdf4ff; color: #6b21a8; border: 1px solid #e9d5ff; }
.status-abgeschlossen  { background: var(--gray-100); color: var(--gray-700); border: 1px solid var(--gray-300); }
.status-geloescht      { background: var(--danger-bg); color: var(--danger-text); border: 1px solid var(--danger-border); }

/* === Postbox Nachrichten (Chat-Bubbles) === */
.nachricht-liste {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 1rem 0 1.5rem;
}

.nachricht-bubble {
    max-width: 82%;
    padding: 1rem 1.25rem;
    border-radius: var(--radius-lg);
    line-height: 1.6;
    word-break: break-word;
    box-shadow: var(--shadow-sm);
}

.nachricht-bubble .meta {
    font-size: 0.75rem;
    margin-bottom: 0.4rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.nachricht-bubble .text { white-space: pre-wrap; }

/* Bearbeiter / Meldestelle: links */
.nachricht-bearbeiter {
    align-self: flex-start;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-bottom-left-radius: 4px;
}
.nachricht-bearbeiter .meta { color: var(--gray-600); }

/* Hinweisgeber: rechts */
.nachricht-hinweisgeber {
    align-self: flex-end;
    background: var(--info-bg);
    border: 1px solid var(--info-border);
    border-bottom-right-radius: 4px;
}
.nachricht-hinweisgeber .meta { color: var(--info-text); }

/* System: zentriert */
.nachricht-system {
    align-self: center;
    max-width: 92%;
    background: var(--warn-bg);
    border: 1px solid var(--warn-border);
    font-size: 0.875rem;
    text-align: center;
    border-radius: var(--radius);
}
.nachricht-system .meta { color: var(--warn-text); }

/* === Anhang-Liste === */
.anhang-liste {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    margin: 0.75rem 0 1.25rem;
}
.anhang-liste a,
.anhang-form button {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.875rem;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    background: #fff;
    text-decoration: none;
    color: var(--gray-800);
    font-size: 0.9rem;
    transition: background 150ms, box-shadow 150ms;
    cursor: pointer;
    font-family: inherit;
}
.anhang-liste a:hover,
.anhang-form button:hover {
    background: var(--gray-100);
    box-shadow: var(--shadow-sm);
}
.anhang-liste .groesse { color: var(--gray-500); font-size: 0.8rem; }

/* === Tracking-Code-Box === */
.tracking-code-box {
    background: var(--success-bg);
    border: 2px solid var(--success-border);
    border-radius: var(--radius);
    padding: 2rem;
    text-align: center;
    margin: 1.5rem 0;
}
.tracking-code-box .label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--success-text);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.75rem;
}
.tracking-code-box code {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: var(--gray-900);
    background: transparent;
    padding: 0;
}

/* === Print === */
@media print {
    .no-print { display: none !important; }
    body { background: #fff; padding: 0; }
    .card { box-shadow: none; border: 1px solid #ccc; }
}

/* === Mobile (<=640px) === */
@media (max-width: 640px) {
    body { padding: 0; }
    .container { padding: 0 0.5rem; margin: 0.75rem auto; }
    .card { padding: 1.75rem 1.5rem; border-radius: var(--radius); }
    h1 { font-size: 1.5rem; }
    .hero { padding: 2rem 1rem 1.5rem; }
    .hero-title { font-size: 1.5rem; }
    .hero-icon { font-size: 2.5rem; }
    .btn { min-height: 48px; }
    .btn-lg { padding: 0.875rem 1.5rem; font-size: 1rem; }
    .kanal-grid { grid-template-columns: 1fr; }
    .nachricht-bubble { max-width: 92%; }
    .cta-row { flex-direction: column; }
    .cta-row .btn { width: 100%; }
}

/* === Prefers-Reduced-Motion === */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
