/*
 * Werkstatt-Bewertungen — Basis-Stylesheet (self-hosted, CSP-kompatibel).
 *
 * Kein externes CDN, keine Web-Fonts von Drittanbietern (CSP: style-src 'self').
 * Design-Prinzipien: klare Hierarchie, hoher Textkontrast (WCAG 2.1 AA,
 * mindestens 4.5:1 für Fließtext), sichtbare Fokus-Zustände, responsive
 * Mobile-First-Layout ohne JavaScript-Abhängigkeit.
 *
 * Design-System-Hinweis (frontend-htmx, Design-Relaunch): dieses Stylesheet
 * ist additiv gewachsen (Phase 1–5 + Relaunch) — bestehende Klassennamen
 * bleiben stabil (kein Breaking Change für bestehende Templates), Tokens
 * wurden erweitert (größere Spacing-/Type-Skala, Elevation, Motion,
 * Dark-Mode). Siehe docs/handoffs/frontend-htmx.md, Abschnitt "Design-
 * System-Relaunch" für die Begründung.
 */

:root {
  /* --- Farben (Basis, hell) ------------------------------------------- */
  --color-bg: #ffffff;
  --color-text: #1a1a1a;
  --color-muted: #4b5563;
  --color-primary: #1e4d8c;
  --color-primary-hover: #163a68;
  --color-primary-active: #122f56;
  --color-primary-tint: #eaf1fb;
  --color-primary-contrast: #ffffff;
  /* Text-/Link-Variante der Markenfarbe — im Dark-Mode aufgehellt, damit
     Fließtext-Links auf dunklem Grund AA-Kontrast (>=4.5:1) behalten.
     Buttons/Badges nutzen weiterhin --color-primary (Flächenfarbe, eigenes
     Kontrast-Inselchen unabhängig vom Seitenhintergrund). */
  --color-accent-text: var(--color-primary);
  --color-border: #d1d5db;
  --color-surface: #f7f8fa;
  --color-surface-warm: #f8f5f0;
  --color-success-bg: #e6f4ea;
  --color-success-text: #14532d;
  --color-error-bg: #fdecea;
  --color-error-text: #7f1d1d;
  --color-badge-unclaimed: #6b7280;
  --color-badge-pending: #92400e;
  --color-badge-claimed: #14532d;
  --focus-ring: 3px solid var(--color-accent-text);

  /* --- Spacing-Skala (Apple-Maßstab: großzügiger Weißraum) ------------- */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 1rem;
  --space-4: 1.5rem;
  --space-5: 2rem;
  --space-6: 3rem;
  --space-7: 5rem;
  --space-8: 8rem;

  /* --- Typografische Skala --------------------------------------------- */
  --fs-hero: clamp(2.75rem, 6vw, 4.5rem);
  --fs-h1: 2.5rem;
  --fs-h2: 1.75rem;
  --fs-h3: 1.375rem;
  --fs-lg: 1.125rem;
  --fs-base: 1rem;
  --fs-sm: 0.875rem;
  --fs-xs: 0.75rem;
  --content-measure: 65ch;
  --container-wide: 72rem;

  /* --- Radius-Skala ------------------------------------------------------ */
  --radius: 0.375rem; /* historischer Alias, von vielen bestehenden Regeln genutzt */
  --radius-sm: 0.5rem;
  --radius-md: 0.875rem;
  --radius-lg: 1.25rem;
  --radius-full: 999px;

  /* --- Elevation (weiche, geschichtete Schatten statt harter Kanten) --- */
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06), 0 1px 1px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08), 0 2px 6px rgba(15, 23, 42, 0.05);
  --shadow-lg: 0 20px 48px rgba(15, 23, 42, 0.14), 0 6px 16px rgba(15, 23, 42, 0.08);

  /* --- Bewegung (kurz, gedämpft — respektiert prefers-reduced-motion) -- */
  --duration-fast: 120ms;
  --duration-base: 200ms;
  --duration-slow: 420ms;
  --ease-standard: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-emphasized: cubic-bezier(0.2, 0, 0, 1);
}

/* --- Dark Mode: reiner Token-Flip, keine Duplikation von Komponenten-CSS - */
@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: #0b0d0f;
    --color-text: #f5f5f7;
    --color-muted: #a1a1a6;
    --color-primary-tint: #142033;
    --color-accent-text: #7fb2f5;
    --color-border: #38383c;
    --color-surface: #1c1c1e;
    --color-surface-warm: #201c17;
    --color-success-bg: #123a20;
    --color-success-text: #8fe3a6;
    --color-error-bg: #3a1414;
    --color-error-text: #ffb4a8;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5), 0 1px 1px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.5), 0 2px 6px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 20px 48px rgba(0, 0, 0, 0.6), 0 6px 16px rgba(0, 0, 0, 0.35);
  }
}

* {
  box-sizing: border-box;
}

html {
  font-size: 100%;
  color-scheme: light dark;
}

/*
 * Selbst-gehostete Variable-Font: Inter (SIL OFL 1.1 — Lizenztext in
 * static/fonts/Inter-LICENSE.txt). Quelle: @fontsource-variable/inter@5.2.8,
 * latin-Subset, EINE Datei für alle Gewichte 100–900 (~47 KB woff2).
 * Self-hosted → CSP font-src 'self', kein Third-Party-Request (DSGVO), 0 CLS.
 * font-display: swap zeigt bis zum Laden den System-Fallback (kein FOIT).
 */
@font-face {
  font-family: "Inter Variable";
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  src: url("../fonts/inter-latin-wght-normal.260c81a4759b.woff2") format("woff2-variations");
}

body {
  margin: 0;
  /* Inter Variable (self-hosted, s. @font-face oben) mit verfeinertem
     System-Fallback für die Ladephase / ältere Browser. */
  font-family:
    "Inter Variable",
    "Inter",
    -apple-system,
    BlinkMacSystemFont,
    "SF Pro Text",
    "Segoe UI",
    Roboto,
    system-ui,
    sans-serif;
  font-size: var(--fs-base);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Sichtbarer Fokus-Zustand für Tastaturnavigation (WCAG 2.4.7) */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: var(--focus-ring);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

a {
  color: var(--color-accent-text);
  text-decoration-thickness: from-font;
  transition: color var(--duration-fast) var(--ease-standard);
}

a:hover {
  text-decoration-color: currentColor;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--color-primary);
  color: var(--color-primary-contrast);
  padding: var(--space-2) var(--space-3);
  z-index: 100;
  border-radius: 0 0 var(--radius) 0;
}

.skip-link:focus {
  left: 0;
}

/* --- Kopfzeile / Marke ------------------------------------------------- */

.site-header {
  border-bottom: 1px solid var(--color-border);
  padding: var(--space-3) var(--space-4);
  background: var(--color-bg);
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  max-width: var(--container-wide);
  margin: 0 auto;
}

.site-nav__brand,
.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: 700;
  font-size: var(--fs-lg);
  color: var(--color-text);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.site-nav__brand:hover,
.brand:hover {
  color: var(--color-accent-text);
}

.brand__mark {
  flex: none;
  color: var(--color-primary);
}

.site-nav__links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav__user {
  color: var(--color-muted);
  font-size: var(--fs-sm);
}

.link-button {
  background: none;
  border: none;
  padding: 0;
  color: var(--color-accent-text);
  text-decoration: underline;
  font: inherit;
  cursor: pointer;
}

/* Überschreibt die generische button:hover-Flächenfarbe (--color-primary-hover):
   Als reiner Text-Link (wie die Nachbar-Links "Anmelden"/"Registrieren" in
   derselben Navigationsliste, siehe a/a:hover oben) bleibt .link-button auch
   im Hover-Zustand flächenlos – sonst kollidiert --color-accent-text
   (für Fließtext-Kontrast gewählt) mit --color-primary-hover (Flächenfarbe,
   Kontrast-Inselchen für Buttons) und fällt unter WCAG-AA (~1.36:1). */
.link-button:hover {
  background: transparent;
  color: var(--color-accent-text);
  text-decoration-color: currentColor;
}

.messages {
  list-style: none;
  margin: var(--space-3) auto;
  padding: 0 var(--space-4);
  max-width: var(--container-wide);
}

.messages__item {
  padding: var(--space-3);
  border-radius: var(--radius);
  margin-bottom: var(--space-2);
}

.messages__item--success {
  background: var(--color-success-bg);
  color: var(--color-success-text);
}

.messages__item--error {
  background: var(--color-error-bg);
  color: var(--color-error-text);
}

.site-main {
  max-width: var(--container-wide);
  margin: 0 auto;
  padding: var(--space-4);
  min-height: 60vh;
}

/* --- Fußzeile ------------------------------------------------------------ */

.site-footer {
  border-top: 1px solid var(--color-border);
  margin-top: var(--space-7);
  color: var(--color-muted);
}

.site-footer__inner {
  max-width: var(--container-wide);
  margin: 0 auto;
  padding: var(--space-5) var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.site-footer__legal {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3) var(--space-4);
  margin: 0;
  padding: 0;
}

.site-footer__legal a {
  color: var(--color-muted);
}

.site-footer__legal a:hover {
  color: var(--color-accent-text);
}

.site-footer__copy {
  font-size: var(--fs-sm);
  margin: 0;
}

/* --- ODbL-Attribution (OpenStreetMap-Katalogdaten, Herkunftsnachweis) --- */
/* Wiederverwendet in Fußzeile, Verzeichnis-Listing und Profildetail (nur bei
   bestätigter OSM-Herkunft) — siehe templates/workshops/_osm_attribution.html. */
.osm-attribution {
  font-size: var(--fs-sm);
  color: var(--color-muted);
  margin: 0;
}

.osm-attribution__link {
  color: inherit;
  text-decoration: underline;
}

.osm-attribution__link:hover,
.osm-attribution__link:focus-visible {
  color: var(--color-accent-text);
}

/* Abstand nach oben, wenn die Attribution im Fließtext (nicht in der
   Fußzeile mit eigenem Flex-Gap) eingebunden wird. */
.osm-attribution--section {
  margin-top: var(--space-4);
}

/* --- Typografie ----------------------------------------------------------- */

h1,
h2,
h3 {
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

h1 {
  font-size: var(--fs-h1);
  margin: 0 0 var(--space-3);
}

h2 {
  font-size: var(--fs-h2);
  margin: 0 0 var(--space-3);
}

h3 {
  font-size: var(--fs-h3);
  margin: 0 0 var(--space-2);
}

p {
  text-wrap: pretty;
}

strong,
b {
  font-weight: 600;
}

/* Inhalts-Maßeinheit für Fließtext (Lesbarkeit) — Grids/Layouts bleiben
   davon unberührt (nur auf Prosa-Blöcke wie Rechtstexte anwenden). */
.prose {
  max-width: var(--content-measure);
}

.prose h2 {
  margin-top: var(--space-6);
}

.prose h2:first-child {
  margin-top: 0;
}

.prose p,
.prose ul,
.prose ol {
  margin: 0 0 var(--space-3);
  color: var(--color-text);
}

.prose ul,
.prose ol {
  padding-left: var(--space-4);
}

/* --- Filterformular --------------------------------------------------- */

.filter-form {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: end;
  background: var(--color-surface);
  padding: var(--space-4);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-4);
}

.filter-form__field {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.filter-form label {
  font-weight: 600;
  font-size: var(--fs-sm);
}

.filter-form input,
.filter-form select {
  padding: var(--space-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font: inherit;
  min-width: 10rem;
  background: var(--color-bg);
  color: var(--color-text);
}

/* --- Buttons ------------------------------------------------------------ */

button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-full);
  border: 1px solid transparent;
  background: var(--color-primary);
  color: var(--color-primary-contrast);
  font: inherit;
  font-size: var(--fs-sm);
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition:
    background-color var(--duration-base) var(--ease-standard),
    border-color var(--duration-base) var(--ease-standard),
    transform var(--duration-fast) var(--ease-standard);
}

button:hover,
.button:hover {
  background: var(--color-primary-hover);
}

button:active,
.button:active {
  background: var(--color-primary-active);
}

@media (prefers-reduced-motion: no-preference) {
  button:active,
  .button:active {
    transform: scale(0.98);
  }
}

button:disabled,
.button:disabled,
.button[aria-disabled="true"] {
  background: var(--color-border);
  color: var(--color-muted);
  cursor: not-allowed;
}

/* Sekundär-Variante: umrandet, transparente Fläche (bewusst wenig Gewicht,
   für den zweiten CTA neben einer primären Handlung). */
.button--secondary {
  background: transparent;
  color: var(--color-accent-text);
  border-color: var(--color-border);
}

.button--secondary:hover {
  background: var(--color-primary-tint);
  border-color: var(--color-accent-text);
}

.button--secondary:active {
  background: var(--color-primary-tint);
}

/* Ghost-Variante: keine Fläche, nur Text — für tertiäre Handlungen. */
.button--ghost {
  background: transparent;
  color: var(--color-accent-text);
  padding-left: var(--space-2);
  padding-right: var(--space-2);
}

.button--ghost:hover {
  background: var(--color-primary-tint);
}

.button--large {
  padding: var(--space-3) var(--space-5);
  font-size: var(--fs-base);
}

.button--reject {
  background: #7f1d1d;
}

.button--reject:hover {
  background: #641717;
}

.button--approve {
  background: #14532d;
}

.button--approve:hover {
  background: #0f3f22;
}

/* htmx-Ladeindikator: standardmäßig unsichtbar, sichtbar während eines
   aktiven htmx-Requests (Konvention der htmx-Bibliothek). Ohne htmx.js
   bleibt das Element dauerhaft ausgeblendet (kein Layout-Bruch). */
.htmx-indicator {
  opacity: 0;
  transition: opacity var(--duration-base) var(--ease-standard);
}

.htmx-request.htmx-indicator,
.htmx-request .htmx-indicator {
  opacity: 1;
}

/* --- Ergebnisliste ------------------------------------------------------- */

.results-count {
  color: var(--color-muted);
}

.workshop-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  /* min(18rem, 100%) statt eines festen 18rem-Minimums: verhindert einen
     Grid-Blowout (horizontales Overflow) auf sehr schmalen Viewports
     (320px), auf denen 18rem (288px) breiter ist als die verfügbare
     .site-main-Content-Box (~272px) — die Spalte darf nie breiter werden
     als ihr Container, unabhängig vom Padding. */
  grid-template-columns: repeat(auto-fill, minmax(min(18rem, 100%), 1fr));
  gap: var(--space-3);
}

.workshop-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  background: var(--color-bg);
  box-shadow: var(--shadow-sm);
  transition:
    box-shadow var(--duration-base) var(--ease-standard),
    transform var(--duration-base) var(--ease-standard);
}

@media (prefers-reduced-motion: no-preference) {
  .workshop-card:hover,
  .case-summary-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
  }
}

.workshop-card h2 {
  font-size: var(--fs-lg);
  margin: 0 0 var(--space-2);
}

.workshop-card h2 a {
  color: var(--color-accent-text);
  text-decoration: none;
}

.workshop-card h2 a:hover {
  text-decoration: underline;
}

.tag-list,
.workshop-card__tags {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  padding: 0;
  margin: var(--space-2) 0;
}

.tag {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  padding: 0.125rem var(--space-2);
  font-size: var(--fs-sm);
  color: var(--color-text);
}

.badge {
  display: inline-block;
  border-radius: var(--radius-full);
  padding: 0.125rem var(--space-2);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: #ffffff;
}

.badge--unclaimed {
  background: var(--color-badge-unclaimed);
}

.badge--pending {
  background: var(--color-badge-pending);
}

.badge--claimed {
  background: var(--color-badge-claimed);
}

.empty-state {
  color: var(--color-muted);
  padding: var(--space-4) 0;
}

.pagination ul {
  list-style: none;
  display: flex;
  gap: var(--space-3);
  align-items: center;
  padding: 0;
  margin: var(--space-4) 0 0;
}

/* --- Profildetail --------------------------------------------------------- */

.workshop-detail__facts {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: var(--space-1) var(--space-3);
}

.workshop-detail__facts dt {
  font-weight: 600;
  color: var(--color-muted);
}

.claim-cta {
  margin-top: var(--space-5);
  padding: var(--space-4);
  background: var(--color-surface);
  border-radius: var(--radius-md);
}

.claim-hint {
  margin-top: var(--space-4);
  color: var(--color-muted);
}

/* --- Staff-Queue ---------------------------------------------------------- */

.staff-queue__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.staff-queue__item {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: var(--space-3);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
}

.staff-queue__actions {
  display: flex;
  gap: var(--space-2);
}

/* --- Formulare (cases-Wizard, moderation-Formulare, allauth-Elemente) --- */

fieldset {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: var(--space-3) var(--space-4);
  margin: 0 0 var(--space-4);
}

legend {
  font-weight: 700;
  padding: 0 var(--space-2);
}

.form-hint {
  color: var(--color-muted);
  font-size: var(--fs-sm);
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  margin-bottom: var(--space-3);
  max-width: 32rem;
}

.form-field label,
.form-field legend {
  font-weight: 600;
  font-size: var(--fs-sm);
  padding: 0;
}

.form-field input,
.form-field select,
.form-field textarea {
  padding: var(--space-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font: inherit;
  background: var(--color-bg);
  color: var(--color-text);
}

.form-field__help {
  color: var(--color-muted);
  font-size: var(--fs-xs);
  margin: 0;
}

.form-field__error {
  color: var(--color-error-text);
  font-size: var(--fs-xs);
  margin: 0;
}

/* Checkbox-/Radio-Listen (Symptome/Beschwerdekategorien, NullBooleanSelect) */
.form-field ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

/* Django-Standard-Fehlerliste (``form.errors``, u. a. allauth-Elements) */
.errorlist {
  list-style: none;
  margin: 0 0 var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: var(--color-error-bg);
  color: var(--color-error-text);
  border-radius: var(--radius);
  font-size: var(--fs-sm);
}

/* --- Stop-Muster-Warnungen (nicht blockierend, TZ §6.1) ------------------ */

.stop-pattern-warnings {
  list-style: none;
  margin: var(--space-2) 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.stop-pattern-warnings__item {
  background: var(--color-error-bg);
  color: var(--color-error-text);
  border-radius: var(--radius);
  padding: var(--space-2) var(--space-3);
  font-size: var(--fs-sm);
}

.stop-pattern-warnings__matched {
  font-style: italic;
}

/* --- Fallstatus-/Verifikations-Badges ------------------------------------ */

.badge--status-draft,
.badge--status-pending_moderation {
  background: var(--color-badge-pending);
}

.badge--status-published {
  background: var(--color-badge-claimed);
}

.badge--status-rejected,
.badge--status-removed {
  background: #7f1d1d;
}

.badge--status-in_dispute,
.badge--status-unresolved {
  background: var(--color-badge-pending);
}

.badge--status-resolved {
  background: var(--color-badge-claimed);
}

.badge--verification-unverified {
  background: var(--color-badge-unclaimed);
}

.badge--verification-document_verified,
.badge--verification-booking_verified {
  background: var(--color-badge-claimed);
}

.verification-badge {
  margin: var(--space-2) 0 var(--space-4);
}

.verification-disclosure {
  color: var(--color-muted);
  font-size: var(--fs-sm);
  margin-top: var(--space-1);
}

/* --- Fakten-Ansicht (öffentliche Fallkarte + eigene Fallseite) ----------- */

.case-facts-readonly__list {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: var(--space-1) var(--space-3);
  margin-bottom: var(--space-4);
}

.case-facts-readonly__list dt {
  font-weight: 600;
  color: var(--color-muted);
}

.case-opinion-readonly {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-4);
}

/* --- Nachweise ------------------------------------------------------------ */

.evidence-list {
  list-style: none;
  margin: 0 0 var(--space-3);
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.evidence-list__item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.evidence-list__pending {
  color: var(--color-muted);
  font-size: var(--fs-sm);
}

/* --- Fall-Zusammenfassungsliste (öffentliche Werkstatt-Fallliste) -------- */

.case-summary-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  /* Siehe .workshop-list weiter oben: min(18rem, 100%) verhindert denselben
     Grid-Blowout bei 320px-Viewports. */
  grid-template-columns: repeat(auto-fill, minmax(min(18rem, 100%), 1fr));
  gap: var(--space-3);
}

.case-summary-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  background: var(--color-bg);
  box-shadow: var(--shadow-sm);
  transition:
    box-shadow var(--duration-base) var(--ease-standard),
    transform var(--duration-base) var(--ease-standard);
}

.case-summary-card h2 {
  font-size: var(--fs-lg);
  margin: 0 0 var(--space-2);
}

/* --- Moderations-/Beschwerde-Warteschlange -------------------------------- */

.queue-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.queue-list__item {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: var(--space-3);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-3);
}

.queue-list__item--overdue {
  border-color: var(--color-error-text);
}

.queue-list__subtitle {
  color: var(--color-muted);
  font-size: var(--fs-sm);
}

.queue-list__sla--overdue {
  color: var(--color-error-text);
  font-weight: 600;
}

.queue-list__decision-form {
  min-width: 16rem;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

/* --- Werkstattantworten (Antwortrecht, TZ §5.6) --------------------------- */

.reply-list {
  list-style: none;
  margin: 0 0 var(--space-3);
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.reply-list__item {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: var(--space-3);
  background: var(--color-surface);
}

.reply-list__meta {
  color: var(--color-muted);
  font-size: var(--fs-xs);
  margin: 0 0 var(--space-1);
}

.reply-list__text {
  margin: 0;
  white-space: pre-line;
}

/* --- Streitfall (TZ §5.4) -------------------------------------------------- */

.dispute-status {
  margin-bottom: var(--space-3);
}

.dispute-status__meta {
  color: var(--color-muted);
  font-size: var(--fs-sm);
}

.dispute-outcome {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  margin-top: var(--space-2);
}

.badge--dispute-open,
.badge--dispute-workshop_responded {
  background: var(--color-badge-pending);
}

.badge--dispute-escalated {
  background: #7f1d1d;
}

.badge--dispute-resolved {
  background: var(--color-badge-claimed);
}

.badge--dispute-unresolved {
  background: var(--color-badge-pending);
}

.dispute-timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  border-left: 3px solid var(--color-border);
}

.dispute-timeline__item {
  padding: 0 0 var(--space-2) var(--space-3);
}

.dispute-timeline__meta {
  color: var(--color-muted);
  font-size: var(--fs-xs);
  margin: 0 0 var(--space-1);
}

.dispute-timeline__outcome,
.dispute-timeline__note {
  background: var(--color-surface);
  border-radius: var(--radius);
  padding: var(--space-2) var(--space-3);
  white-space: pre-line;
}

/* --- Transparenz-Rating-Badge (TZ §5.5) ------------------------------------ */

.score-badge__value {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: 600;
}

.badge--score {
  background: var(--color-primary);
}

.score-badge__details {
  margin-top: var(--space-2);
}

.score-badge__details summary {
  cursor: pointer;
  font-weight: 600;
  padding: var(--space-1) 0;
}

.score-factors {
  border-collapse: collapse;
  width: 100%;
  margin: var(--space-2) 0;
}

.score-factors th,
.score-factors td {
  border-bottom: 1px solid var(--color-border);
  padding: var(--space-1) var(--space-2);
  text-align: left;
  font-size: var(--fs-sm);
}

.score-badge__anomaly {
  background: var(--color-error-bg);
  color: var(--color-error-text);
  border-radius: var(--radius);
  padding: var(--space-2) var(--space-3);
}

/* Nur für Screenreader sichtbar (WCAG 2.1 — versteckte, aber zugängliche
   Tabellenbeschriftung). */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* --- B2B-Kabinett (Dashboard/Abo, TZ §5.9/§5.10, Phase 4 Wave 2) --------- */

.b2b-dashboard section {
  margin-bottom: var(--space-5);
}

.b2b-response-speed {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  margin-top: var(--space-3);
}

.b2b-subscription-card form {
  display: inline-block;
  margin: 0 var(--space-2) var(--space-2) 0;
}

/* =========================================================================
   Homepage — Hero / Ablauf / Vertrauens-Band / Abschluss-CTA
   (Design-Relaunch, siehe docs/handoffs/frontend-htmx.md)
   ========================================================================= */

.hero {
  padding: var(--space-7) 0 var(--space-6);
}

.hero__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
  align-items: center;
}

@media (min-width: 60rem) {
  .hero__grid {
    grid-template-columns: 1.1fr 0.9fr;
  }
}

.hero__eyebrow {
  display: inline-block;
  color: var(--color-accent-text);
  font-weight: 600;
  font-size: var(--fs-sm);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: var(--space-3);
}

.hero__title {
  font-size: var(--fs-hero);
  line-height: 1.05;
  margin: 0 0 var(--space-4);
}

.hero__subtitle {
  font-size: var(--fs-lg);
  color: var(--color-muted);
  max-width: 42ch;
  margin: 0 0 var(--space-5);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.hero__visual {
  color: var(--color-primary);
  width: 100%;
  height: auto;
}

.hero__visual .hero__visual-accent {
  color: var(--color-accent-text);
}

/* So funktioniert's — 3-Schritt-Band */

.steps {
  padding: var(--space-6) 0;
  border-top: 1px solid var(--color-border);
}

.steps__heading {
  text-align: center;
  max-width: 40ch;
  margin: 0 auto var(--space-5);
}

.steps__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: var(--space-5);
}

.step {
  text-align: left;
}

.step__illus {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 4rem;
  height: 4rem;
  border-radius: var(--radius-md);
  background: var(--color-primary-tint);
  color: var(--color-accent-text);
  margin-bottom: var(--space-3);
}

.step__illus svg {
  width: 2.5rem;
  height: 2.5rem;
}

.step__index {
  display: block;
  font-size: var(--fs-sm);
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--color-muted);
  margin-bottom: var(--space-1);
}

.step__title {
  font-size: var(--fs-lg);
  margin: 0 0 var(--space-2);
}

.step__body {
  color: var(--color-muted);
  margin: 0;
}

/* Vertrauens-Band (Belege/DSA/DSGVO) */

.trust-band {
  padding: var(--space-6) 0;
  background: var(--color-surface-warm);
  border-radius: var(--radius-lg);
}

.trust-band__inner {
  padding: 0 var(--space-4);
}

.trust-band__heading {
  max-width: 48ch;
  margin: 0 auto var(--space-5);
  text-align: center;
}

.trust-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: var(--space-4);
}

.trust-item {
  padding: var(--space-4);
}

.trust-item__icon {
  color: var(--color-primary);
  margin-bottom: var(--space-2);
}

.trust-item h3 {
  margin-bottom: var(--space-1);
}

.trust-item p {
  color: var(--color-muted);
  margin: 0;
}

/* Abschluss-CTA */

.cta-band {
  padding: var(--space-7) 0;
  text-align: center;
}

.cta-band__inner {
  max-width: 48ch;
  margin: 0 auto;
}

.cta-band h2 {
  margin-bottom: var(--space-3);
}

.cta-band p {
  color: var(--color-muted);
  margin-bottom: var(--space-4);
}

/* On-Load-Reveal (rein CSS-basiert, kein JS/Intersection-Observer nötig —
   respektiert prefers-reduced-motion vollständig). */
@media (prefers-reduced-motion: no-preference) {
  .reveal-on-load {
    animation: reveal-up var(--duration-slow) var(--ease-emphasized) both;
  }

  .reveal-on-load--delay-1 {
    animation-delay: 90ms;
  }

  .reveal-on-load--delay-2 {
    animation-delay: 180ms;
  }

  @keyframes reveal-up {
    from {
      opacity: 0;
      transform: translateY(0.75rem);
    }

    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
}

/* =========================================================================
   Rechtstexte (Impressum/Datenschutz/AGB/Cookies/Widerruf)
   ========================================================================= */

.legal-page {
  padding: var(--space-5) 0 var(--space-7);
}

.legal-notice {
  display: flex;
  gap: var(--space-2);
  background: var(--color-error-bg);
  color: var(--color-error-text);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  margin: var(--space-4) 0 var(--space-6);
  max-width: var(--content-measure);
  font-weight: 600;
}

.legal-notice__icon {
  flex: none;
}

/* =========================================================================
   Konto-Seiten (allauth: Anmelden/Registrieren/Passwort/2FA/Sitzungen) —
   ``body.auth-shell``, gesetzt via templates/allauth/layouts/base.html.
   Die allauth-„elements"-Templates rendern rohes <form>/<p>/<label>/
   <input> ohne eigene Klassen (Context7-verifiziert, allauth 65.x
   „elements"-System) — die Regeln unten stylen daher bewusst Element-
   Selektoren, aber NUR innerhalb des ``.auth-shell``-Scopes.
   ========================================================================= */

.auth-shell .site-main {
  max-width: 28rem;
  margin: var(--space-6) auto;
  padding: var(--space-5);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.auth-shell h1 {
  font-size: var(--fs-h2);
}

.auth-shell p {
  color: var(--color-muted);
}

.auth-shell form p {
  margin: 0 0 var(--space-3);
}

.auth-shell label {
  display: block;
  font-weight: 600;
  font-size: var(--fs-sm);
  margin-bottom: var(--space-1);
}

.auth-shell input:not([type="checkbox"]):not([type="radio"]) {
  width: 100%;
  padding: var(--space-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font: inherit;
  background: var(--color-bg);
  color: var(--color-text);
}

.auth-shell input[type="checkbox"],
.auth-shell input[type="radio"] {
  margin-right: var(--space-2);
}

.auth-shell button[type="submit"] {
  width: 100%;
  margin-top: var(--space-2);
}

.auth-shell hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: var(--space-4) 0;
}

@media (max-width: 40rem) {
  .site-nav {
    flex-direction: column;
    align-items: flex-start;
  }

  .filter-form {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-form input,
  .filter-form select {
    min-width: 0;
    width: 100%;
  }

  .auth-shell .site-main {
    margin: var(--space-3);
    padding: var(--space-4);
  }
}

/* --- Rechtstexte: Cookie-/Datentabelle ---------------------------------- */
.legal-table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--space-4) 0;
  font-size: var(--fs-sm);
}
.legal-table th,
.legal-table td {
  text-align: left;
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--color-border);
  vertical-align: top;
}
.legal-table th {
  font-weight: 600;
  color: var(--color-muted);
}

/* --- Werkstatt-Karte: Monogramm-Miniatur (Identität statt Foto) --------- */
.workshop-card__thumb {
  position: relative;
  height: 5rem;
  border-radius: var(--radius-md);
  margin-bottom: var(--space-3);
  background: linear-gradient(135deg, var(--color-primary-tint), var(--color-surface));
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.workshop-card__glyph {
  position: absolute;
  right: -0.4rem;
  bottom: -0.7rem;
  width: 4.5rem;
  height: 4.5rem;
  color: var(--color-accent-text);
  opacity: 0.16;
}
.workshop-card__initial {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
  color: var(--color-accent-text);
}

/* --- Leerer Zustand: Illustration als Einladung zum Handeln ------------- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-3);
  padding: var(--space-6) var(--space-3);
  color: var(--color-muted);
}
.empty-state__illus {
  width: 4rem;
  height: 4rem;
  color: var(--color-border);
}

/* --- Werkstatt-Detail: Kopf mit Garage-Illustration --------------------- */
.workshop-detail__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
}
.workshop-detail__illus {
  width: 7.5rem;
  height: auto;
  flex-shrink: 0;
  color: var(--color-accent-text);
}
@media (max-width: 30rem) {
  .workshop-detail__illus {
    display: none;
  }
}
