/* The Neural Academy — Precision UI, gemeinsame Tokens & Basiskomponenten. */

:root {
  --font-headline: 'Outfit', 'Poppins', Arial, sans-serif;
  --font-system:   'Inter', -apple-system, system-ui, Arial, sans-serif;

  --text-caption1:    12px;
  --text-footnote:    13px;
  --text-subhead:     15px;
  --text-body:        17px;
  --text-title3:      20px;
  --text-title2:      22px;
  --text-large-title: 34px;
  --text-display:     48px;

  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  20px;
  --space-6:  24px;
  --space-8:  32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;

  --institut-green:       #1E9E5C;
  --institut-green-hover: #17824B;
  --institut-green-tint:  rgba(30,158,92,0.08);

  --ink:      #16231C;
  --ink-80:   #46524C;
  --grey-44:  #66716B;
  --grey-86:  #DCE8E0;
  --grey-96:  #EEF5F0;
  --bg-page:      #F5FAF7;
  --bg-surface:   #FFFFFF;
  --bg-elevated:  #FFFFFF;
  --bg-inset:     var(--grey-96);

  --text-primary:   var(--ink);
  --text-secondary: rgba(22,35,28,0.65);
  --text-muted:     rgba(22,35,28,0.50);
  --text-tertiary:  rgba(22,35,28,0.40);
  --text-inverse:   #FFFFFF;
  --on-ink:         #FFFFFF;  /* Text/Icons auf einer --ink-gefüllten Fläche (Buttons, Avatare) */

  --border:          var(--grey-86);
  --border-hairline: rgba(22,35,28,0.07);
  --border-divider:  rgba(22,35,28,0.05);

  --color-success: var(--institut-green);
  --color-error:   #D7263D;
  --color-warning: #F2A93B;

  --radius-xs:   6px;
  --radius-sm:   10px;
  --radius-md:   14px;
  --radius-lg:   18px;
  --radius-xl:   22px;
  --radius-none: 0;
  --radius-full: 9999px;

  --hover-state:   rgba(22,35,28,0.04);
  --pressed-state: rgba(22,35,28,0.08);

  --shadow-xs: 0 1px 2px rgba(22,35,28,0.05);
  --shadow-sm: 0 2px 8px rgba(22,35,28,0.07), 0 1px 3px rgba(22,35,28,0.04);
  --shadow-md: 0 4px 16px rgba(22,35,28,0.09), 0 2px 6px rgba(22,35,28,0.04);
  --shadow-lg: 0 8px 32px rgba(22,35,28,0.11), 0 4px 12px rgba(22,35,28,0.05);

  --ease-spring: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-out:    cubic-bezier(0, 0, 0.2, 1);
  --dur-instant: 100ms;
  --dur-fast:    200ms;
  --dur-normal:  300ms;
}

.dark, [data-theme="dark"] {
  --bg-page:     #0E1712;
  --bg-surface:  #17221C;
  --bg-elevated: #1F2C24;
  --bg-inset:    #26332B;

  --text-primary:   #FFFFFF;
  --text-secondary: rgba(235,245,240,0.6);
  --text-muted:     rgba(235,245,240,0.3);

  --border:          rgba(255,255,255,0.12);
  --border-hairline: rgba(255,255,255,0.12);
  --border-divider:  rgba(255,255,255,0.1);

  --hover-state:   rgba(255,255,255,0.06);
  --pressed-state: rgba(255,255,255,0.10);

  --ink: #FFFFFF;
  --institut-green: #34C67F;
  --on-ink: #16231C;  /* --ink ist im Dark Mode weiß, Text darauf muss dunkel sein */
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-system);
  font-size: var(--text-body);
  color: var(--text-primary);
  background: var(--bg-page);
}

a { color: inherit; }

/* ── Typografie ── */
.large-title {
  font-family: var(--font-headline);
  font-weight: 800;
  font-size: var(--text-large-title);
  letter-spacing: -0.01em;
  line-height: 1.15;
  color: var(--text-primary);
  margin: 0;
}
.large-title .accent { color: var(--institut-green); }

.title2 {
  font-family: var(--font-headline);
  font-weight: 700;
  font-size: var(--text-title2);
  color: var(--text-primary);
  margin: 0;
}

.quiet {
  font-family: var(--font-system);
  font-weight: 300;
  color: var(--text-muted);
}

/* ── Top-Navigation ── */
.topbar {
  height: 64px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 var(--space-6);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-hairline);
  position: sticky; top: 0; z-index: 100;
}
.topbar-inner {
  max-width: 880px; margin: 0 auto; width: 100%;
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-6);
}
.wordmark {
  font-family: var(--font-headline); font-weight: 900; font-size: var(--text-title3);
  letter-spacing: -0.01em; color: var(--text-primary); text-decoration: none;
}
.wordmark .accent { color: var(--institut-green); }
.topbar-links { display: flex; gap: var(--space-6); overflow-x: auto; }
.topbar-link {
  font-family: var(--font-system); font-weight: 400; font-size: var(--text-subhead);
  color: var(--text-secondary); text-decoration: none; white-space: nowrap;
  padding: var(--space-2) 0; border-bottom: 2px solid transparent;
}
.topbar-link.active { color: var(--text-primary); border-bottom-color: var(--institut-green); font-weight: 600; }

/* ── Karten ── */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: var(--space-6);
  margin-bottom: var(--space-6);
  scroll-margin-top: 5rem;
}
.card-head { display: flex; align-items: center; gap: var(--space-2); margin-bottom: var(--space-4); }
.card-head h2 { font-family: var(--font-headline); font-weight: 700; font-size: var(--text-title3); margin: 0; color: var(--text-primary); }

/* ── Buttons ── */
.btn-primary {
  background: var(--ink);
  color: var(--on-ink);
  font-family: var(--font-system); font-weight: 600; font-size: var(--text-subhead);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: transform var(--dur-instant) var(--ease-out), opacity var(--dur-fast) var(--ease-out);
}
.btn-primary:hover:not(:disabled) { opacity: 0.85; }
.btn-primary:active { transform: scale(0.97); }
.btn-primary:disabled { opacity: 0.5; cursor: default; }

.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  font-family: var(--font-system); font-weight: 600; font-size: var(--text-subhead);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: var(--space-3) var(--space-5);
  cursor: pointer;
}

.btn-icon {
  width: 40px; height: 40px;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--ink);
  color: var(--on-ink);
  display: flex; align-items: center; justify-content: center;
  font-size: var(--text-subhead);
  cursor: pointer;
}
.btn-icon:hover { opacity: 0.85; }

/* ── Inputs ── */
input[type=text] {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: var(--space-3) var(--space-4);
  font-family: var(--font-system); font-size: var(--text-subhead);
  background: var(--bg-surface); color: var(--text-primary);
}
input[type=text]:focus-visible {
  outline: none; border-color: var(--institut-green);
  box-shadow: 0 0 0 3px var(--institut-green-tint);
}
input[type=file] { font-family: var(--font-system); font-size: var(--text-footnote); color: var(--text-secondary); }

/* ── Chips / Tags (radius-full erlaubt) ── */
.chip {
  display: inline-flex; align-items: center; gap: var(--space-1);
  background: var(--bg-inset);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-full);
  padding: var(--space-2) var(--space-3);
  font-family: var(--font-system); font-size: var(--text-footnote); color: var(--text-secondary);
}
.chip .check { color: var(--institut-green); font-weight: 700; }

/* ── Alert (immer scharfkantig) ── */
.alert {
  border-radius: var(--radius-none);
  border-left: 4px solid var(--color-error);
  background: var(--bg-inset);
  padding: var(--space-3) var(--space-4);
  font-family: var(--font-system); font-size: var(--text-footnote); color: var(--text-secondary);
}

/* ── Status Marker (flacher Balken, keine Pille) ── */
.status-marker {
  display: inline-flex; align-items: center; gap: var(--space-2);
  font-family: var(--font-system); font-size: var(--text-caption1); font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.04em;
  padding-left: var(--space-2); border-left: 3px solid var(--institut-green);
  color: var(--institut-green);
}

/* ── Theme Toggle ── */
.theme-toggle {
  position: fixed; top: 14px; right: 16px; z-index: 200;
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius-full);
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 16px;
  box-shadow: var(--shadow-xs);
}

/* ── Motion ── */
.interactive { transition: transform var(--dur-instant) var(--ease-out), opacity var(--dur-fast) var(--ease-out); cursor: pointer; }
.interactive:active { transform: scale(0.97); opacity: 0.85; }

@keyframes appear {
  from { opacity: 0; transform: scale(0.96) translateY(6px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.appear { animation: appear var(--dur-normal) var(--ease-spring) forwards; }

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

:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--institut-green);
}

.empty { color: var(--text-muted); font-size: var(--text-footnote); }
