/*
 * Crew17 — Design Tokens
 * CSS Custom Properties (Variables) als Single Source of Truth.
 *
 * Tailwind-CDN-Klassen bleiben primäres Styling-Werkzeug.
 * Diese Tokens definieren Werte, nicht Klassen — für:
 *   - Custom Components die kein Tailwind-Äquivalent haben
 *   - Doku / Referenz für das Design-System
 *   - Dark-Mode-Vorbereitung (light: → dark: Overrides)
 *
 * Mapping zu Tailwind:
 *   --color-primary       → indigo-500   (bg-indigo-500, text-indigo-500, …)
 *   --color-primary-dark  → indigo-600
 *   --color-cta           → zinc-900     (Linear-Signatur-Button)
 *   --color-bg            → white
 *   --color-bg-subtle     → zinc-50
 *   --color-border        → zinc-200
 *   --color-text          → zinc-900
 *   --color-text-muted    → zinc-500
 *
 * Verwendung: var(--color-primary) in Custom-CSS.
 * In Templates: direkt Tailwind-Klassen nutzen (bg-indigo-500 etc.).
 *
 * Migration der Komponenten auf Tokens: Sprint 11.5/11.6.
 */

/* ==========================================================================
   @font-face — Inter Variable (self-hosted, latin + latin-ext für DE/FR)
   ========================================================================== */

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/inter/inter-variable-latin-ext.084b211fc382.woff2") format('woff2');
  unicode-range:
    U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF,
    U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/inter/inter-variable-latin.4b73e2ff3024.woff2") format('woff2');
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,
    U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ==========================================================================
   :root — Design Tokens (Light Mode)
   ========================================================================== */

:root {

  /* --------------------------------------------------------------------------
     Typography
     -------------------------------------------------------------------------- */

  --font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI',
    Roboto, sans-serif;

  /* Scale (entspricht Tailwind text-* defaults) */
  --text-xs:   0.75rem;    /* 12px — Captions, Badges, Tabellen-Header */
  --text-sm:   0.875rem;   /* 14px — Body-Default (Linear-Stil: compact) */
  --text-base: 1rem;       /* 16px — Larger Body */
  --text-lg:   1.125rem;   /* 18px — Section-Headers */
  --text-xl:   1.25rem;    /* 20px — Page-Titles (H2) */
  --text-2xl:  1.5rem;     /* 24px — Hero-Titles (H1) */

  --leading-tight:  1.25;
  --leading-snug:   1.375;
  --leading-normal: 1.5;

  --font-weight-normal:   400;
  --font-weight-medium:   500;
  --font-weight-semibold: 600;
  --font-weight-bold:     700;


  /* --------------------------------------------------------------------------
     Colors — Primäres Interface (Tailwind zinc/indigo)
     -------------------------------------------------------------------------- */

  /* Primary (Indigo) */
  --color-primary:       #6366f1;  /* indigo-500 — Links, Active-States */
  --color-primary-dark:  #4f46e5;  /* indigo-600 — Hover */
  --color-primary-light: #eef2ff;  /* indigo-50  — Subtle BG */

  /* CTA — Linear-Signatur: schwarz */
  --color-cta:           #18181b;  /* zinc-900 */
  --color-cta-hover:     #27272a;  /* zinc-800 */

  /* Backgrounds */
  --color-bg:            #ffffff;  /* white — Page-Background */
  --color-bg-subtle:     #fafafa;  /* zinc-50 — Sektionen, Hover, Empty-States */
  --color-bg-elevated:   #ffffff;  /* white — Cards, Modals */

  /* Borders */
  --color-border:        #e4e4e7;  /* zinc-200 — Standard */
  --color-border-strong: #d4d4d8;  /* zinc-300 — Fokus-Ring-Basis */

  /* Text */
  --color-text:          #18181b;  /* zinc-900 — Body-Text */
  --color-text-muted:    #71717a;  /* zinc-500 — Labels, Captions, Subtext */
  --color-text-subtle:   #a1a1aa;  /* zinc-400 — Placeholders, Deemphasized */


  /* --------------------------------------------------------------------------
     Colors — Semantisch (Status)
     -------------------------------------------------------------------------- */

  /* Success (Genehmigt, Anwesend, Aktiv) */
  --color-success:        #10b981;  /* emerald-500 */
  --color-success-dark:   #059669;  /* emerald-600 */
  --color-success-light:  #ecfdf5;  /* emerald-50 */
  --color-success-border: #a7f3d0;  /* emerald-200 */
  --color-success-text:   #065f46;  /* emerald-800 */

  /* Warning (Bald fällig, Compliance-Bedarf) */
  --color-warning:        #f59e0b;  /* amber-500 */
  --color-warning-dark:   #d97706;  /* amber-600 */
  --color-warning-light:  #fffbeb;  /* amber-50 */
  --color-warning-border: #fde68a;  /* amber-200 */
  --color-warning-text:   #92400e;  /* amber-800 */

  /* Danger (Abgelehnt, Überfällig, Fehler) */
  --color-danger:         #f43f5e;  /* rose-500 */
  --color-danger-dark:    #e11d48;  /* rose-600 */
  --color-danger-light:   #fff1f2;  /* rose-50 */
  --color-danger-border:  #fecdd3;  /* rose-200 */
  --color-danger-text:    #9f1239;  /* rose-800 */

  /* Info (Hinweise, Neutral-Status) */
  --color-info:           #0ea5e9;  /* sky-500 */
  --color-info-dark:      #0284c7;  /* sky-600 */
  --color-info-light:     #f0f9ff;  /* sky-50 */
  --color-info-border:    #bae6fd;  /* sky-200 */
  --color-info-text:      #075985;  /* sky-800 */

  /* Neutral */
  --color-neutral:        #71717a;  /* zinc-500 */
  --color-neutral-light:  #fafafa;  /* zinc-50 */
  --color-neutral-border: #e4e4e7;  /* zinc-200 */
  --color-neutral-text:   #3f3f46;  /* zinc-700 */


  /* --------------------------------------------------------------------------
     Spacing (entspricht Tailwind spacing scale × 4px)
     -------------------------------------------------------------------------- */

  --space-1:  0.25rem;   /*  4px */
  --space-2:  0.5rem;    /*  8px */
  --space-3:  0.75rem;   /* 12px */
  --space-4:  1rem;      /* 16px */
  --space-5:  1.25rem;   /* 20px */
  --space-6:  1.5rem;    /* 24px */
  --space-8:  2rem;      /* 32px */
  --space-10: 2.5rem;    /* 40px */
  --space-12: 3rem;      /* 48px */
  --space-16: 4rem;      /* 64px */


  /* --------------------------------------------------------------------------
     Border-Radius (Linear-Stil: md als Standard)
     -------------------------------------------------------------------------- */

  --radius-sm:   0.25rem;   /*  4px — Badges, kleine Tags */
  --radius-md:   0.375rem;  /*  6px — Buttons, Inputs, Cards (Linear-Standard) */
  --radius-lg:   0.5rem;    /*  8px — Modals, große Cards */
  --radius-xl:   0.75rem;   /* 12px — große Panels (aktuell rounded-xl in Components) */
  --radius-full: 9999px;    /* Vollkreis — Avatare, Pill-Badges */


  /* --------------------------------------------------------------------------
     Shadows
     -------------------------------------------------------------------------- */

  --shadow-xs: 0 1px 1px 0 rgb(0 0 0 / 0.03);
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.07), 0 2px 4px -2px rgb(0 0 0 / 0.05);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.08), 0 4px 6px -4px rgb(0 0 0 / 0.05);


  /* --------------------------------------------------------------------------
     Z-Index-Skala
     -------------------------------------------------------------------------- */

  --z-base:    0;
  --z-raised:  10;
  --z-sticky:  20;
  --z-overlay: 30;
  --z-modal:   40;
  --z-toast:   50;


  /* --------------------------------------------------------------------------
     Transitions
     -------------------------------------------------------------------------- */

  --transition-fast:   150ms ease;
  --transition-normal: 200ms ease;
  --transition-slow:   300ms ease;

}


/* ==========================================================================
   Body-Default — Inter als globale Schriftart
   ========================================================================== */

body {
  font-family: var(--font-sans);
}


/* ==========================================================================
   HTMX-Indicator — display:none statt opacity:0 (verhindert Layout-Lücke)
   HTMX 2.x blendet .htmx-indicator per opacity aus, belegt aber Platz.
   Dieser Override schaltet auf display:none um.
   ========================================================================== */

.htmx-indicator {
  display: none;
}

.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator {
  display: block;
}


/* ==========================================================================
   Dark Mode — Vorbereitet (Tokens werden in 11.x überschrieben)
   @media (prefers-color-scheme: dark) { :root { ... } }
   Manueller Toggle via .dark-Klasse: .dark :root { ... }
   Noch nicht aktiv — Dark Mode ist Backlog-Item 11.x.
   ========================================================================== */
