/*
 * ═══════════════════════════════════════════════════════════════
 * justReporting Design System v3.0
 * Brand Color: #27c13f
 * 3-Saeulen: Gruen (Nachhaltigkeit) | Blau (Finanzen) | Violett (Technologie)
 * v2.1: 3-Saeulen-Farben, neue Button-Typen, Website-Fonts, Hero-Gradients
 * v3.0: Plus Jakarta Sans + Inter Fonts, Stone-Neutral-Palette, Typography Scale
 * ═══════════════════════════════════════════════════════════════
 */

:root {
  /* ═══════════════════════════════════════
     BRAND COLORS
     ═══════════════════════════════════════ */
  --jr-primary: #27c13f;         /* 3.1:1 auf #FAFAF9 — NUR Decorations, Icons, große Headlines ≥24px */
  --jr-primary-dark: #1fa033;    /* 3.1:1 auf #FAFAF9 — immer noch unter WCAG AA Text-Schwelle */
  --jr-primary-text: #187A28;    /* 4.7:1 auf #FAFAF9 ✅ WCAG AA — für grüne Textelemente und Links */
  --jr-primary-light: #2dd348;
  --jr-primary-gradient: linear-gradient(145deg, #2dd348 0%, #27c13f 50%, #1fa033 100%);
  --jr-primary-shadow: 0 4px 14px rgba(39, 193, 63, 0.35);
  --jr-primary-shadow-hover: 0 6px 20px rgba(39, 193, 63, 0.45);


  /* ═══════════════════════════════════════
     3-SAEULEN-FARBSYSTEM (Website)
     ═══════════════════════════════════════ */

  /* Nachhaltigkeit (Gruen) – alias fuer Primary */
  --jr-sustainability: #27C13F;
  --jr-sustainability-dark: #1FA033;
  --jr-sustainability-light: #2DD348;
  --jr-sustainability-gradient: linear-gradient(145deg, #2DD348 0%, #27C13F 50%, #1FA033 100%);
  --jr-sustainability-shadow: 0 4px 14px rgba(39, 193, 63, 0.35);
  --jr-sustainability-shadow-hover: 0 6px 20px rgba(39, 193, 63, 0.45);

  /* Finanzen (Blau) */
  --jr-finance: #2563EB;
  --jr-finance-dark: #1D4ED8;
  --jr-finance-light: #3B82F6;
  --jr-finance-gradient: linear-gradient(145deg, #3B82F6 0%, #2563EB 50%, #1D4ED8 100%);
  --jr-finance-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
  --jr-finance-shadow-hover: 0 6px 20px rgba(37, 99, 235, 0.45);
  --jr-finance-bg: rgba(37, 99, 235, 0.08);
  --jr-finance-bg-hover: rgba(37, 99, 235, 0.12);

  /* Technologie (Violett) */
  --jr-tech: #7C3AED;
  --jr-tech-dark: #6D28D9;
  --jr-tech-light: #8B5CF6;
  --jr-tech-gradient: linear-gradient(145deg, #8B5CF6 0%, #7C3AED 50%, #6D28D9 100%);
  --jr-tech-shadow: 0 4px 14px rgba(124, 58, 237, 0.35);
  --jr-tech-shadow-hover: 0 6px 20px rgba(124, 58, 237, 0.45);
  --jr-tech-bg: rgba(124, 58, 237, 0.08);
  --jr-tech-bg-hover: rgba(124, 58, 237, 0.12);

  /* Tool/Amber */
  --jr-tool: #FF9500;
  --jr-tool-gradient: linear-gradient(145deg, #FFB020 0%, #FF9500 100%);
  --jr-tool-shadow: 0 4px 14px rgba(255, 149, 0, 0.35);


  /* ═══════════════════════════════════════
     HIGHLIGHT COLORS – LIGHT MODE
     ═══════════════════════════════════════ */
  --highlight-evidence: #FFF8E1;
  --highlight-clarification: #FFEDE8;
  --highlight-proofreading: #E3F4FD;
  --highlight-active: #E8F9ED;
  --highlight-selection: #F5F5F7;


  /* ═══════════════════════════════════════
     HIGHLIGHT COLORS – DARK MODE
     ═══════════════════════════════════════ */
  --highlight-evidence-dark: rgba(255, 214, 10, 0.18);
  --highlight-clarification-dark: rgba(255, 159, 10, 0.18);
  --highlight-proofreading-dark: rgba(0, 122, 255, 0.18);
  --highlight-active-dark: rgba(39, 193, 63, 0.18);
  --highlight-selection-dark: rgba(142, 142, 147, 0.14);


  /* ═══════════════════════════════════════
     TAG COLORS – LIGHT MODE
     ═══════════════════════════════════════ */
  --tag-evidence: #E6A000;
  --tag-evidence-bg: rgba(230, 160, 0, 0.15);
  
  --tag-clarification: #D2691E;
  --tag-clarification-bg: rgba(210, 105, 30, 0.15);
  
  --tag-proofreading: #0077CC;
  --tag-proofreading-bg: rgba(0, 119, 204, 0.12);
  
  --tag-active: #27c13f;
  --tag-active-bg: rgba(39, 193, 63, 0.15);


  /* ═══════════════════════════════════════
     TAG COLORS – DARK MODE
     ═══════════════════════════════════════ */
  --tag-evidence-dark: #FFD60A;
  --tag-clarification-dark: #FF9F0A;
  --tag-proofreading-dark: #0A84FF;
  --tag-active-dark: #30D158;


  /* ═══════════════════════════════════════
     VERSION COMPARE COLORS
     ═══════════════════════════════════════ */
  --compare-replacement: #7C3AED;
  --compare-replacement-bg: rgba(124, 58, 237, 0.15);
  --compare-insertion: #27c13f;
  --compare-insertion-bg: rgba(39, 193, 63, 0.15);


  /* ═══════════════════════════════════════
     SEMANTIC COLORS
     ═══════════════════════════════════════ */
  --color-success: #27c13f;
  --color-success-bg: #E8F9ED;
  --color-warning: #FF9500;
  --color-warning-bg: #FFF8E1;
  --color-error: #EF4444;
  --color-error-bg: #FFEBE9;
  --color-info: #0077CC;
  --color-info-bg: #E3F4FD;


  /* ═══════════════════════════════════════
     BACKGROUNDS – LIGHT MODE (Tailwind Stone / warm)
     ═══════════════════════════════════════ */
  --bg-primary: #FAFAF9;       /* stone-50 */
  --bg-elevated: #FFFFFF;
  --bg-secondary: #F5F5F4;     /* stone-100 */
  --bg-tertiary: #E7E5E4;      /* stone-200 */


  /* ═══════════════════════════════════════
     BACKGROUNDS – DARK MODE
     ═══════════════════════════════════════ */
  --bg-primary-dark: #000000;
  --bg-elevated-dark: #1C1C1E;
  --bg-secondary-dark: #2C2C2E;
  --bg-tertiary-dark: #3A3A3C;


  /* ═══════════════════════════════════════
     TEXT COLORS – LIGHT MODE (Tailwind Stone / warm)
     ═══════════════════════════════════════ */
  --text-primary: #1C1917;     /* stone-900 */
  --text-secondary: #57534E;   /* stone-600 */
  --text-muted: #78716C;       /* stone-500 */
  --text-tertiary: #A8A29E;    /* stone-400 */


  /* ═══════════════════════════════════════
     TEXT COLORS – DARK MODE
     ═══════════════════════════════════════ */
  --text-primary-dark: #F5F5F7;
  --text-secondary-dark: #98989D;
  --text-tertiary-dark: #636366;


  /* ═══════════════════════════════════════
     BORDERS (Tailwind Stone / warm)
     ═══════════════════════════════════════ */
  --border-light: #E7E5E4;            /* stone-200 */
  --border-dark: rgba(255, 255, 255, 0.1);


  /* ═══════════════════════════════════════
     SPACING SCALE (8px base)
     ═══════════════════════════════════════ */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 12px;
  --space-lg: 16px;
  --space-xl: 20px;
  --space-2xl: 24px;
  --space-3xl: 32px;
  --space-4xl: 40px;
  --space-5xl: 48px;


  /* ═══════════════════════════════════════
     BORDER RADIUS
     ═══════════════════════════════════════ */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-pill: 100px;


  /* ═══════════════════════════════════════
     SHADOWS
     ═══════════════════════════════════════ */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
  --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.16);


  /* ═══════════════════════════════════════
     TYPOGRAPHY
     ═══════════════════════════════════════ */

  /* Headings – Plus Jakarta Sans (geometrisch-humanistisch, warm) */
  --font-heading: 'Plus Jakarta Sans', -apple-system, sans-serif;

  /* Body / UI – Inter (screen-optimiert, hohe Lesbarkeit) */
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Code / Monospace */
  --font-mono: 'JetBrains Mono', 'Fira Code', 'SF Mono', monospace;
  --font-code: 'JetBrains Mono', 'Fira Code', 'SF Mono', monospace;

  /* Font Weights */
  --font-weight-heading: 700;
  --font-weight-subheading: 600;
  --font-weight-body: 400;
  --font-weight-label: 500;
  --font-weight-button: 600;

  --text-xs: 11px;
  --text-sm: 12px;
  --text-caption: 13px;
  --text-body: 15px;
  --text-headline: 17px;
  --text-title: 22px;
  --text-large: 28px;

  --tracking-tight: -0.02em;
  --tracking-normal: -0.01em;


  /* ═══════════════════════════════════════
     TRANSITIONS (legacy — prefer duration + easing tokens)
     ═══════════════════════════════════════ */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
  --transition-smooth: 0.35s cubic-bezier(0.4, 0, 0.2, 1);


  /* ═══════════════════════════════════════
     MOTION DESIGN — DURATION TOKENS
     ═══════════════════════════════════════ */
  --jr-duration-instant:  100ms;
  --jr-duration-fast:     150ms;
  --jr-duration-normal:   200ms;
  --jr-duration-moderate: 300ms;
  --jr-duration-slow:     550ms;
  --jr-duration-slower:   650ms;
  --jr-duration-slowest:  850ms;

  /* Alias (backward-compat) */
  --jr-motion-fast: var(--jr-duration-fast);

  /* ─── Stagger-Skala (3-Token-System) ─── */
  --jr-stagger-sm:      60ms;    /* Kinder einer Komponente */
  --jr-stagger-md:     100ms;    /* Karten-Reihen, Listen */
  --jr-stagger-lg:     160ms;    /* Seiten-Sektionen */
  /* Backward-compat: */
  --jr-stagger-fast:    var(--jr-stagger-sm);
  --jr-stagger-child:   var(--jr-stagger-sm);
  --jr-stagger-slow:    var(--jr-stagger-md);
  --jr-stagger-section: var(--jr-stagger-lg);

  /* ─── Easing ─── */
  --jr-ease-out:        cubic-bezier(0.16, 1, 0.3, 1);
  --jr-ease-in:         cubic-bezier(0.55, 0, 1, 0.45);
  --jr-ease-in-out:     cubic-bezier(0.4, 0, 0.2, 1);
  --jr-ease-spring:     cubic-bezier(0.22, 1.2, 0.36, 1);
  --jr-ease-bounce:     cubic-bezier(0.34, 1.56, 0.64, 1);
  --jr-ease-decelerate: cubic-bezier(0, 0, 0.2, 1);


  /* ═══════════════════════════════════════
     FARBHIERARCHIE (KI-Regel)
     ═══════════════════════════════════════ */
  /*
   * REGEL: Grün führt. Blau und Violett sind Kontext-Farben, keine Primärfarben.
   *
   * Prioritätsrang für KI-Tools und Entwickler:
   *   1. Nachhaltigkeit (#27C13F) — Lead-Farbe, Buttons, CTAs, Primary Actions
   *   2. Finanzen (#2563EB)       — nur für Finance-Kontext, nie als globale Akzentfarbe
   *   3. Technologie (#7C3AED)    — nur für Tech/Plattform-Kontext
   *   4. Tool (#FF9500)           — nur für interaktive Werkzeuge, nie dominant
   *
   * Grün DARF NICHT als Text-Farbe auf hellem Hintergrund verwendet werden:
   *   #27C13F auf #FAFAF9 → Kontrast 3.1:1 (WCAG AA nicht erfüllt für Fließtext)
   *   Für grüne Textelemente immer --jr-primary-dark (#1FA033) → 4.6:1 ✅
   */


  /* ═══════════════════════════════════════
     STATUS-WORKFLOW (CSRD-Prüfungsprozess)
     ═══════════════════════════════════════ */
  /*
   * Workflow: Vorabanalyse → In Prüfung → Freigegeben | Nacharbeit → Abgeschlossen
   * Rückfrage offen kann jederzeit auftreten (IDW PS 345n Tz. 89)
   */
  --status-preliminary:       #6B7280;
  --status-preliminary-bg:    rgba(107, 114, 128, 0.10);
  --status-preliminary-label: "Vorabanalyse";

  --status-in-progress:       #F59E0B;
  --status-in-progress-bg:    rgba(245, 158, 11, 0.10);
  --status-in-progress-label: "In Prüfung";

  --status-approved:          #27C13F;
  --status-approved-bg:       rgba(39, 193, 63, 0.10);
  --status-approved-label:    "Freigegeben";

  --status-rework:            #EF4444;
  --status-rework-bg:         rgba(239, 68, 68, 0.10);
  --status-rework-label:      "Nacharbeit erforderlich";

  --status-done:              #1FA033;
  --status-done-bg:           rgba(31, 160, 51, 0.10);
  --status-done-label:        "Abgeschlossen";

  --status-query-open:        #7C3AED;
  --status-query-open-bg:     rgba(124, 58, 237, 0.10);
  --status-query-open-label:  "Rückfrage offen";


  /* ═══════════════════════════════════════
     SEVERITY-SYSTEM (ESRS-Prüfungslogik)
     ═══════════════════════════════════════ */
  /*
   * ROT-HART: Formeller Verstoß / Versagungsrisiko
   *           → § 331 HGB, Art. 8 EU-Taxonomie-VO → Einschränkung/Versagung möglich
   * ROT-WEICH: ESRS-Vollständigkeitslücke / wesentlicher Mangel (heilbar)
   *           → Nacharbeit, aber kein unmittelbares Versagungsrisiko
   * GELB:     Hinweis / Verbesserungspotential — nicht wesentlich (ESRS 1.57)
   * BLAU:     Information / neutral — keine Prüfungsrelevanz
   *
   * WICHTIG: Freie Strings "Error/Warning/Info" sind VERBOTEN.
   *          Im UI immer "ROT/GELB/BLAU" oder die deutschen Label verwenden.
   */
  --severity-critical-hard:         #C00000;
  --severity-critical-hard-bg:      rgba(192, 0, 0, 0.08);
  --severity-critical-hard-border:  rgba(192, 0, 0, 0.25);
  --severity-critical-hard-label:   "ROT — Versagungsrisiko";

  --severity-critical-soft:         #EF4444;
  --severity-critical-soft-bg:      rgba(239, 68, 68, 0.08);
  --severity-critical-soft-border:  rgba(239, 68, 68, 0.20);
  --severity-critical-soft-label:   "ROT — Wesentliche Lücke";

  --severity-warning:                #F59E0B;
  --severity-warning-bg:             rgba(245, 158, 11, 0.08);
  --severity-warning-label:          "GELB — Hinweis";

  --severity-info:                   #2563EB;
  --severity-info-bg:                rgba(37, 99, 235, 0.08);
  --severity-info-label:             "BLAU — Information";


  /* ═══════════════════════════════════════
     KI-DISCLAIMER (ReportingGPT — §323 HGB)
     ═══════════════════════════════════════ */
  /*
   * KI-Disclaimer muss im Produkt persistent sichtbar sein:
   * "KI-generierte Einschätzungen sind keine Prüfungsurteile im Sinne
   *  des § 323 HGB. Die Verantwortung für das Prüfungsurteil liegt
   *  ausschließlich beim bestellten Abschlussprüfer."
   *
   * Design-Token für den Disclaimer-Hinweis-Bereich:
   */
  --disclaimer-bg:     rgba(245, 158, 11, 0.06);
  --disclaimer-border: rgba(245, 158, 11, 0.30);
  --disclaimer-text:   #92400E;   /* Amber-800 — lesbar auf hellem Hintergrund */
}


/* ═══════════════════════════════════════════════════════════════
   DARK MODE
   ═══════════════════════════════════════════════════════════════ */

[data-theme="dark"],
.dark {
  --bg-primary: var(--bg-primary-dark);
  --bg-elevated: var(--bg-elevated-dark);
  --bg-secondary: var(--bg-secondary-dark);
  --bg-tertiary: var(--bg-tertiary-dark);
  
  --text-primary: var(--text-primary-dark);
  --text-secondary: var(--text-secondary-dark);
  --text-tertiary: var(--text-tertiary-dark);
  
  --border-light: var(--border-dark);
  
  --highlight-evidence: var(--highlight-evidence-dark);
  --highlight-clarification: var(--highlight-clarification-dark);
  --highlight-proofreading: var(--highlight-proofreading-dark);
  --highlight-active: var(--highlight-active-dark);
  --highlight-selection: var(--highlight-selection-dark);
  
  --tag-evidence: var(--tag-evidence-dark);
  --tag-clarification: var(--tag-clarification-dark);
  --tag-proofreading: var(--tag-proofreading-dark);
  --tag-active: var(--tag-active-dark);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg-primary: var(--bg-primary-dark);
    --bg-elevated: var(--bg-elevated-dark);
    --bg-secondary: var(--bg-secondary-dark);
    --bg-tertiary: var(--bg-tertiary-dark);
    
    --text-primary: var(--text-primary-dark);
    --text-secondary: var(--text-secondary-dark);
    --text-tertiary: var(--text-tertiary-dark);
    
    --border-light: var(--border-dark);
    
    --highlight-evidence: var(--highlight-evidence-dark);
    --highlight-clarification: var(--highlight-clarification-dark);
    --highlight-proofreading: var(--highlight-proofreading-dark);
    --highlight-active: var(--highlight-active-dark);
    --highlight-selection: var(--highlight-selection-dark);
    
    --tag-evidence: var(--tag-evidence-dark);
    --tag-clarification: var(--tag-clarification-dark);
    --tag-proofreading: var(--tag-proofreading-dark);
    --tag-active: var(--tag-active-dark);
  }
}


/* ═══════════════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════════════ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  font-family: var(--font-family);
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all var(--transition-normal);
  letter-spacing: var(--tracking-normal);
}

/* Sizes */
.btn-sm {
  padding: var(--space-sm) var(--space-lg);
  font-size: var(--text-caption);
  border-radius: var(--radius-sm);
  min-height: 32px;
}

.btn-md {
  padding: var(--space-md) var(--space-2xl);
  font-size: var(--text-body);
  border-radius: var(--radius-md);
  min-height: 44px;
}

.btn-lg {
  padding: var(--space-lg) var(--space-3xl);
  font-size: var(--text-headline);
  border-radius: var(--radius-lg);
  min-height: 52px;
}

/* Primary */
.btn-primary {
  background: var(--jr-primary-gradient);
  color: white;
  box-shadow: var(--jr-primary-shadow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--jr-primary-shadow-hover);
}

.btn-primary:active {
  transform: translateY(0);
}

/* Secondary */
.btn-secondary {
  background: rgba(39, 193, 63, 0.12);
  color: var(--jr-primary);
}

.btn-secondary:hover {
  background: rgba(39, 193, 63, 0.18);
}

/* Outline */
.btn-outline {
  background: transparent;
  color: var(--jr-primary);
  border: 1.5px solid var(--jr-primary);
}

.btn-outline:hover {
  background: rgba(39, 193, 63, 0.08);
}

/* Ghost */
.btn-ghost {
  background: transparent;
  color: var(--jr-primary);
}

.btn-ghost:hover {
  background: rgba(39, 193, 63, 0.08);
}

/* Danger */
.btn-danger {
  background: linear-gradient(145deg, #FF4D4D, #EF4444);
  color: white;
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.35);
}

.btn-danger:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.45);
}

/* Finance (Blau – Finanzen-Saeule) */
.btn-finance {
  background: var(--jr-finance-gradient);
  color: white;
  box-shadow: var(--jr-finance-shadow);
}

.btn-finance:hover {
  transform: translateY(-2px);
  box-shadow: var(--jr-finance-shadow-hover);
}

.btn-finance:active {
  transform: translateY(0);
}

/* Tech (Violett – Technologie-Saeule) */
.btn-tech {
  background: var(--jr-tech-gradient);
  color: white;
  box-shadow: var(--jr-tech-shadow);
}

.btn-tech:hover {
  transform: translateY(-2px);
  box-shadow: var(--jr-tech-shadow-hover);
}

.btn-tech:active {
  transform: translateY(0);
}

/* Tool (Amber – Interaktive Tools) */
.btn-tool {
  background: var(--jr-tool-gradient);
  color: white;
  box-shadow: var(--jr-tool-shadow);
}

.btn-tool:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 149, 0, 0.45);
}

.btn-tool:active {
  transform: translateY(0);
}

/* Animated Border (Premium CTA – Conic-Gradient Rotation) */
.btn-animated-border {
  position: relative;
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: none;
  z-index: 1;
}

.btn-animated-border::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  background: conic-gradient(from var(--border-angle, 0deg), #27C13F, #2563EB, #7C3AED, #27C13F);
  z-index: -1;
  animation: rotateBorder 4s linear infinite;
}

@property --border-angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}

@keyframes rotateBorder {
  to { --border-angle: 360deg; }
}

/* Gradient Glow (Floating CTA / Special) */
.btn-gradient-glow {
  background: linear-gradient(135deg, #27C13F, #2563EB);
  color: white;
  box-shadow: 0 4px 20px rgba(39, 193, 63, 0.4);
  transition: all var(--transition-smooth);
}

.btn-gradient-glow:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(37, 99, 235, 0.5);
}

/* Semantic */
.btn-evidence {
  background: var(--tag-evidence-bg);
  color: var(--tag-evidence);
}

.btn-clarification {
  background: var(--tag-clarification-bg);
  color: var(--tag-clarification);
}

.btn-proofreading {
  background: var(--tag-proofreading-bg);
  color: var(--tag-proofreading);
}

/* Disabled */
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}


/* ═══════════════════════════════════════════════════════════════
   HIGHLIGHTS
   ═══════════════════════════════════════════════════════════════ */

.highlight-evidence {
  background: var(--highlight-evidence);
  padding: 3px 2px;
  border-radius: 3px;
}

.highlight-clarification {
  background: var(--highlight-clarification);
  padding: 3px 2px;
  border-radius: 3px;
}

.highlight-proofreading {
  background: var(--highlight-proofreading);
  padding: 3px 2px;
  border-radius: 3px;
}

.highlight-active {
  background: var(--highlight-active);
  padding: 3px 2px;
  border-radius: 3px;
}

.highlight-selection {
  background: var(--highlight-selection);
  padding: 3px 2px;
  border-radius: 3px;
}


/* ═══════════════════════════════════════════════════════════════
   TAGS
   ═══════════════════════════════════════════════════════════════ */

.tag {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  font-weight: 600;
}

.tag-evidence {
  background: var(--tag-evidence-bg);
  color: var(--tag-evidence);
}

.tag-clarification {
  background: var(--tag-clarification-bg);
  color: var(--tag-clarification);
}

.tag-proofreading {
  background: var(--tag-proofreading-bg);
  color: var(--tag-proofreading);
}

.tag-active {
  background: var(--tag-active-bg);
  color: var(--tag-active);
}


/* ═══════════════════════════════════════════════════════════════
   VERSION COMPARE
   ═══════════════════════════════════════════════════════════════ */

.compare-replacement {
  background: linear-gradient(180deg, var(--compare-replacement-bg) 0%, rgba(124, 58, 237, 0.08) 100%);
  border-bottom: 2px solid var(--compare-replacement);
  padding: 2px 4px;
  border-radius: 4px;
}

.compare-insertion {
  background: linear-gradient(180deg, var(--compare-insertion-bg) 0%, rgba(39, 193, 63, 0.08) 100%);
  border-bottom: 2px dashed var(--compare-insertion);
  padding: 2px 4px;
  border-radius: 4px;
}


/* ═══════════════════════════════════════════════════════════════
   TOAST NOTIFICATIONS
   ═══════════════════════════════════════════════════════════════ */

.toast {
  position: fixed;
  top: var(--space-2xl);
  right: var(--space-2xl);
  background: var(--bg-elevated);
  border-radius: var(--radius-lg);
  padding: var(--space-lg) var(--space-xl);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  gap: var(--space-md);
  min-width: 320px;
  animation: slideIn 0.3s ease;
  overflow: hidden;
}

.toast-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.toast-icon-success {
  background: var(--jr-primary-gradient);
  color: white;
}

.toast-icon-warning {
  background: linear-gradient(145deg, #FFB020, #FF9500);
  color: white;
}

.toast-icon-error {
  background: linear-gradient(145deg, #FF4D4D, #EF4444);
  color: white;
}

.toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: var(--jr-primary);
  animation: progress 4s linear;
}

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes progress {
  from { width: 100%; }
  to { width: 0%; }
}


/* ═══════════════════════════════════════════════════════════════
   CARDS
   ═══════════════════════════════════════════════════════════════ */

.card {
  background: var(--bg-elevated);
  border-radius: var(--radius-xl);
  padding: var(--space-2xl);
  border: 1px solid var(--border-light);
}


/* ═══════════════════════════════════════════════════════════════
   FORMS
   ═══════════════════════════════════════════════════════════════ */

.input {
  width: 100%;
  padding: var(--space-md) var(--space-lg);
  font-size: var(--text-body);
  font-family: var(--font-family);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  color: var(--text-primary);
  transition: border-color var(--transition-fast);
}

.input:focus {
  outline: none;
  border-color: var(--jr-primary);
}

.input::placeholder {
  color: var(--text-tertiary);
}

.toggle {
  position: relative;
  width: 51px;
  height: 31px;
  border-radius: 16px;
  background: rgba(120, 120, 128, 0.16);
  border: none;
  cursor: pointer;
  transition: background var(--transition-normal);
}

.toggle.active {
  background: var(--jr-primary);
}

.toggle-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 27px;
  height: 27px;
  border-radius: 14px;
  background: white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  transition: left var(--transition-normal);
}

.toggle.active .toggle-knob {
  left: 22px;
}


/* ═══════════════════════════════════════════════════════════════
   UPLOAD AREA
   ═══════════════════════════════════════════════════════════════ */

.upload-area {
  border: 2px dashed var(--jr-primary);
  border-radius: var(--radius-xl);
  padding: var(--space-4xl);
  text-align: center;
  background: rgba(39, 193, 63, 0.05);
  transition: all var(--transition-normal);
}

.upload-area:hover {
  background: rgba(39, 193, 63, 0.08);
}

[data-theme="dark"] .upload-area,
.dark .upload-area {
  background: rgba(39, 193, 63, 0.08);
}


/* ═══════════════════════════════════════════════════════════════
   TABS
   ═══════════════════════════════════════════════════════════════ */

.tabs {
  display: flex;
  gap: var(--space-sm);
}

.tab {
  padding: var(--space-md) var(--space-2xl);
  font-size: var(--text-body);
  font-weight: 500;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-normal);
  background: var(--bg-secondary);
  color: var(--text-secondary);
}

.tab.active {
  background: var(--jr-primary);
  color: white;
  box-shadow: 0 4px 12px rgba(39, 193, 63, 0.3);
}

.tab:hover:not(.active) {
  background: var(--bg-tertiary);
}


/* ═══════════════════════════════════════════════════════════════
   ACCESSIBILITY
   ═══════════════════════════════════════════════════════════════ */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

:focus-visible {
  outline: 2px solid var(--jr-primary);
  outline-offset: 2px;
}


/* ═══════════════════════════════════════════════════════════════
   GLASS EFFECT (Headers, Overlays)
   ═══════════════════════════════════════════════════════════════ */

.glass {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
}

[data-theme="dark"] .glass,
.dark .glass {
  background: rgba(28, 28, 30, 0.88);
}


/* ═══════════════════════════════════════════════════════════════
   HERO GRADIENTS (Website – 3-Saeulen-System)
   ═══════════════════════════════════════════════════════════════ */

/* Nachhaltigkeit (Gruen) */
.hero-sustainability {
  background: linear-gradient(135deg, #065F46 0%, #27C13F 50%, #F0FDF4 100%);
  color: white;
}

.hero-sustainability-soft {
  background: linear-gradient(150deg, #F0FDF4 0%, #ECFDF5 40%, #D1FAE5 100%);
  color: var(--text-primary);
}

/* Finanzen (Blau/Slate) */
.hero-finance {
  background: linear-gradient(135deg, #0F172A 0%, #1E3A5F 50%, #E2E8F0 100%);
  color: white;
}

.hero-finance-soft {
  background: linear-gradient(150deg, #F8FAFC 0%, #E2E8F0 40%, #CBD5E1 100%);
  color: var(--text-primary);
}

/* Technologie (Violett) */
.hero-tech {
  background: linear-gradient(135deg, #5B21B6 0%, #7C3AED 50%, #A78BFA 100%);
  color: white;
}

.hero-tech-soft {
  background: linear-gradient(150deg, #F5F3FF 0%, #EDE9FE 40%, #DDD6FE 100%);
  color: var(--text-primary);
}

/* Homepage / Kombiniert (alle 3 Saeulen) */
.hero-combined {
  background: linear-gradient(135deg, #065F46 0%, #27C13F 25%, #2563EB 60%, #7C3AED 100%);
  color: white;
}


/* ═══════════════════════════════════════════════════════════════
   REDUCED MOTION – Animated Border
   ═══════════════════════════════════════════════════════════════ */

@media (prefers-reduced-motion: reduce) {
  .btn-animated-border::before {
    animation: none;
  }
  .btn-gradient-glow {
    transition-duration: 0.01ms !important;
  }
}
