/* ============================================================
   QUADRALIGN -- Colors & Type
   Single source of CSS truth for the Animal Health Platform.
   Import this in any HTML before component styles.

   Source of truth: reference/design.md (codebase) -- values lifted
   verbatim. Newer typographic decisions (Jost + Plus Jakarta Sans
   on the web, system sans in app) live in CONTENT FUNDAMENTALS.
   ============================================================ */

/* ---- Fonts ----
   Display: Jost -- headings, numbers, the bridgeless A
   Body / UI: Plus Jakarta Sans -- paragraph, buttons, labels
   Accent / mono: JetBrains Mono -- stats, code, technical labels
   Mobile app: system sans (per design.md) -- not Jost
*/
/* Self-hosted variable fonts (no external CDN — DSGVO: no IP to third parties) */
@font-face{font-family:'Jost';font-style:normal;font-weight:100 900;font-display:swap;src:url('theme/fonts/Jost.woff2') format('woff2')}
@font-face{font-family:'Jost';font-style:italic;font-weight:100 900;font-display:swap;src:url('theme/fonts/Jost-Italic.woff2') format('woff2')}
@font-face{font-family:'Plus Jakarta Sans';font-style:normal;font-weight:200 800;font-display:swap;src:url('theme/fonts/PlusJakartaSans.woff2') format('woff2')}
@font-face{font-family:'Plus Jakarta Sans';font-style:italic;font-weight:200 800;font-display:swap;src:url('theme/fonts/PlusJakartaSans-Italic.woff2') format('woff2')}
@font-face{font-family:'JetBrains Mono';font-style:normal;font-weight:100 800;font-display:swap;src:url('theme/fonts/JetBrainsMono.woff2') format('woff2')}

:root {
  /* ---------- Brand colors ---------- */
  --teal:        #2A7F7F;   /* primary CTA, accent on light surfaces */
  --teal-d:      #1E5F5F;   /* hover / pressed */
  --teal-l:      #3A9898;   /* hover background tint */
  --teal-deep:   #1A5555;   /* gradient start (ql-hero) */

  --sage:        #A8D5BA;   /* on-dark accent, progress fills */
  --sand:        #F4EDE4;   /* warm background, tab strip */
  --sand-d:      #EDE3D8;   /* hover state for sand surfaces */

  /* Accents -- use sparingly, alternates to teal */
  --terracotta:  #C97B63;
  --dusty-blue:  #7FA7C4;

  /* ---------- Neutrals ---------- */
  --bg:          #FAFAF7;   /* main page background (warm off-white) */
  --surface:     #FFFFFF;   /* cards, sheets */
  --border:      #E3E6E8;   /* hairlines, dividers */
  --border-soft: #EDEFF0;   /* subtler hairlines */

  --text:        #2F3437;   /* primary text -- also used as charcoal bg */
  --muted:       #6B7378;   /* secondary text, inactive icons */
  --muted-2:     #9AA1A6;   /* tertiary / placeholder */

  /* ---------- Semantic ---------- */
  --success:     #4CAF50;
  --warn:        #F4A261;
  --error:       #E76F51;
  --info:        #3A86FF;

  /* ---------- Status (vet domain) ---------- */
  --status-active:    #4CAF50;   /* aktiv / healthy */
  --status-rehab:     #F4A261;   /* pausiert / in rehab */
  --status-done:      #6B7378;   /* abgeschlossen */
  --status-info:      #3A86FF;

  /* ---------- Tints (icon containers, badge backgrounds) ---------- */
  --teal-tint:    rgba(42,127,127,.10);
  --teal-tint-2:  rgba(42,127,127,.18);
  --sage-tint:    rgba(168,213,186,.25);
  --terra-tint:   rgba(201,123,99,.12);
  --dusty-tint:   rgba(127,167,196,.15);
  --warn-tint:    rgba(244,162,97,.12);
  --error-tint:   rgba(231,111,81,.10);
  --success-tint: rgba(76,175,80,.10);
  --info-tint:    rgba(58,134,255,.10);
  --muted-tint:   rgba(107,115,120,.10);

  /* ---------- Amber (advisory / "Aufmerksamkeit nötig") ---------- */
  --amber:        #C07020;
  --amber-border: #E0A060;
  --amber-tint:   rgba(249,203,147,.30);

  /* ---------- On-dark (text/elements over teal or charcoal surfaces) ---------- */
  --on-dark-text:    rgba(255,255,255,.72);
  --on-dark-title:   #FFFFFF;
  --on-dark-border:  rgba(255,255,255,.10);
  --on-dark-surface: rgba(255,255,255,.06);

  /* ---------- Type families ---------- */
  --font-display: 'Jost', 'Futura', 'Trebuchet MS', sans-serif;
  --font-body:    'Plus Jakarta Sans', -apple-system, 'SF Pro Text', system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', 'SF Mono', ui-monospace, Menlo, monospace;

  /* Mobile-app stack (per design.md -- no Jost on phones) */
  --font-app:     -apple-system, 'SF Pro Text', 'Inter', 'Roboto', system-ui, sans-serif;

  /* ---------- Type scale -- web ---------- */
  --display-1:   clamp(36px, 4.5vw, 60px);
  --display-2:   clamp(36px, 4vw, 56px);
  --h1:          clamp(28px, 3vw, 42px);
  --h2:          22px;
  --h3:          18px;
  --h4:          16px;

  /* Body / micro text */
  --body:        15px;
  --body-sm:     14px;
  --label:       13px;
  --micro:       11px;   /* eyebrow labels, .14em letter-spacing, uppercase */

  /* ---------- Type scale -- mobile app (sans) ---------- */
  --app-h1:      28px;
  --app-h2:      20px;
  --app-body:    15px;
  --app-small:   13px;
  --app-caption: 11px;

  --weight-light: 300;
  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;

  --tracking-eyebrow: .14em;
  --tracking-caps:    .08em;
  --leading-tight:    1.12;
  --leading-snug:     1.4;
  --leading-normal:   1.6;
  --leading-relaxed:  1.75;

  /* ---------- Spacing ---------- */
  --space-xs:   4px;
  --space-sm:   8px;
  --space-md:   16px;
  --space-lg:   24px;
  --space-xl:   32px;
  --space-2xl:  48px;
  --space-3xl:  64px;
  --space-4xl:  80px;

  /* ---------- Radius ---------- */
  --radius-sm:   8px;    /* chips, small tags */
  --radius-md:   12px;   /* inputs, small cards, buttons */
  --radius-lg:   16px;   /* standard cards, modals */
  --radius-xl:   20px;   /* hero cards */
  --radius-2xl:  22px;   /* product hero cards */
  --radius-full: 999px;  /* pills, avatars */

  /* ---------- Shadow / elevation ---------- */
  --shadow-1: 0 1px 4px rgba(0,0,0,.06);
  --shadow-2: 0 4px 12px rgba(0,0,0,.05);
  --shadow-3: 0 8px 28px rgba(42,127,127,.10);   /* teal-tinted hover */
  --shadow-5: 0 20px 60px rgba(42,127,127,.30);  /* big teal glow -- one per page */
  --shadow-soft: 0 6px 24px rgba(0,0,0,.08);

  /* ---------- Motion ---------- */
  --ease-out:    cubic-bezier(.2,.7,.25,1);
  --ease-in-out: cubic-bezier(.45,0,.25,1);
  --dur-fast:    .15s;
  --dur-base:    .22s;
  --dur-slow:    .35s;

  --press-scale: 0.97;
}

/* ============================================================
   Semantic element styles -- opt in via .q-* class
   ============================================================ */

body { font-family: var(--font-body); color: var(--text); background: var(--bg); }

.q-eyebrow {
  font-family: var(--font-body);
  font-size: var(--micro);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--teal);
}

.q-h1 {
  font-family: var(--font-display);
  font-size: var(--h1);
  font-weight: 600;
  color: var(--text);
  line-height: var(--leading-tight);
  margin: 0 0 14px;
  letter-spacing: -0.01em;
}
.q-h1 em { font-style: italic; color: var(--teal); font-weight: 500; }

.q-h2 {
  font-family: var(--font-display);
  font-size: var(--h2);
  font-weight: 600;
  color: var(--text);
  line-height: 1.2;
  margin: 0 0 8px;
}
.q-h2 em { font-style: italic; color: var(--teal); font-weight: 500; }

.q-h3 {
  font-family: var(--font-display);
  font-size: var(--h3);
  font-weight: 600;
  color: var(--text);
  margin: 0 0 6px;
}

.q-h4 {
  font-family: var(--font-display);
  font-size: var(--h4);
  font-weight: 600;
  color: var(--text);
  margin: 0 0 6px;
}

.q-body    { font-family: var(--font-body); font-size: var(--body);    color: var(--muted); line-height: var(--leading-relaxed); }
.q-body-sm { font-family: var(--font-body); font-size: var(--body-sm); color: var(--muted); line-height: var(--leading-normal); }
.q-label   { font-family: var(--font-body); font-size: var(--label);   font-weight: var(--weight-semibold); color: var(--text); }
.q-caption { font-family: var(--font-body); font-size: var(--app-caption); color: var(--muted); }
.q-mono    { font-family: var(--font-mono); font-feature-settings: "tnum"; }

/* On-dark inversions -- swap teal -> sage, text -> white@60-72% */
.q-on-dark { color: rgba(255,255,255,.72); }
.q-on-dark .q-h1 { color: #fff; }
.q-on-dark .q-h1 em { color: var(--sage); }
.q-on-dark .q-h2 { color: #fff; }
.q-on-dark .q-h2 em { color: var(--sage); }
.q-on-dark .q-eyebrow { color: var(--sage); }
.q-on-dark .q-body, .q-on-dark .q-body-sm { color: rgba(255,255,255,.72); }

/* Mobile-app type roles (system sans per design.md) */
.q-app-h1    { font-family: var(--font-app); font-size: var(--app-h1);    font-weight: 700; color: var(--text); letter-spacing: -0.01em; }
.q-app-h2    { font-family: var(--font-app); font-size: var(--app-h2);    font-weight: 600; color: var(--text); }
.q-app-body  { font-family: var(--font-app); font-size: var(--app-body);  font-weight: 400; color: var(--text); }
.q-app-small { font-family: var(--font-app); font-size: var(--app-small); font-weight: 400; color: var(--muted); }
.q-app-cap   { font-family: var(--font-app); font-size: var(--app-caption); font-weight: 500; color: var(--muted); }

/* ============================================================
   Utility primitives -- buttons, cards, eyebrows
   ============================================================ */

.q-btn {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: var(--weight-semibold);
  border-radius: 11px;
  padding: 13px 26px;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: transform var(--dur-fast) var(--ease-out),
              background var(--dur-base) var(--ease-out),
              box-shadow var(--dur-base) var(--ease-out);
  display: inline-flex; align-items: center; gap: 8px;
}
.q-btn:active { transform: scale(var(--press-scale)); }

.q-btn--primary { background: var(--teal); color: #fff; }
.q-btn--primary:hover { background: var(--teal-d); transform: translateY(-1px); }

.q-btn--outline { background: transparent; color: var(--teal); border: 1.5px solid var(--teal); padding: 11.5px 24.5px; }
.q-btn--outline:hover { background: var(--teal-tint); }

.q-btn--on-teal { background: #fff; color: var(--teal); font-weight: 700; }
.q-btn--on-teal:hover { background: var(--sand); }

.q-btn--destructive { background: transparent; color: var(--error); padding: 8px 16px; }

.q-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-2);
  padding: 20px;
  transition: transform var(--dur-base) var(--ease-out),
              border-color var(--dur-base) var(--ease-out),
              box-shadow var(--dur-base) var(--ease-out);
}
.q-card:hover {
  transform: translateY(-3px);
  border-color: rgba(42,127,127,.30);
  box-shadow: var(--shadow-3);
}
.q-card--dashed { border-style: dashed; }

.q-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: var(--weight-semibold);
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 5px 10px;
  border-radius: var(--radius-full);
}
.q-pill--active { background: var(--success-tint); color: var(--success); }
.q-pill--rehab  { background: var(--warn-tint);    color: var(--warn); }
.q-pill--done   { background: rgba(107,115,120,.10); color: var(--muted); }
.q-pill--info   { background: rgba(58,134,255,.10); color: var(--info); }
.q-pill--pro    { background: var(--text); color: #fff; }

/* ============================================================
   Shared chrome — nav, footer, page transitions
   ============================================================ */

*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
img  { max-width: 100%; display: block; }

/* Nav — common to both main (fixed) and legal (sticky) */
nav {
  top: 0; z-index: 200;
  background: rgba(250,250,247,.97);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 32px; height: 68px;
}
/* Main nav (index) overrides via page-specific inline style */
nav.legal-nav { position: sticky; }

.nav-logo  { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.nav-links { display: flex; gap: 24px; align-items: center; }
.nav-links a { font-size: 13px; font-weight: 600; color: var(--muted); text-decoration: none; transition: color .2s; }
.nav-links a:hover { color: var(--text); }

/* Marketing nav — function vs. information split (injected by router.js).
   "Therapeut:in finden" / "Find a Therapist" is a FUNCTION, set apart from the
   info links (Discover/Features/Pricing/FAQ/About/News) with a teal outlined
   button + a vertical divider between News and the function link. */
.nav-links-divider {
  width: 1px; align-self: center; height: 18px;
  background: var(--border); flex-shrink: 0;
}
.nav-links a.nav-links-cta {
  color: var(--teal); border: 1px solid var(--teal);
  padding: 7px 14px; border-radius: 9px; line-height: 1;
  transition: background .2s, color .2s, border-color .2s;
}
.nav-links a.nav-links-cta:hover {
  background: var(--teal); color: #fff; border-color: var(--teal);
}

.nav-cta {
  background: var(--teal); color: #fff; padding: 9px 20px; border-radius: 9px;
  font-size: 13px; font-weight: 600; border: none; cursor: pointer;
  font-family: var(--font-body); transition: all .2s; text-decoration: none;
  display: inline-flex; align-items: center; gap: 6px;
}
.nav-cta:hover { background: var(--teal-d); }
.nav-back { font-size: 13px; font-weight: 600; color: var(--muted); text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.nav-back:hover { color: var(--text); }

/* Footer */
.site-footer {
  background: #212528; padding: 28px 32px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; color: rgba(255,255,255,.5); font-size: 12px;
}
.site-footer-links { display: flex; gap: 18px; }
.site-footer-links a { color: rgba(255,255,255,.5); text-decoration: none; }
.site-footer-links a:hover { color: #fff; }
.ksystems-link { font-family: var(--font-mono); font-size: 11px; color: rgba(255,255,255,.4); text-decoration: none; }
.ksystems-link:hover { color: var(--sage); }
.ksystems-link b { font-family: var(--font-display); font-weight: 600; color: rgba(255,255,255,.65); }
.ksystems-link i { color: var(--sage); font-style: normal; }

/* Page transition — fade driven by router.js */
body { transition: opacity .15s ease; }
body.is-navigating { opacity: 0; }

/* Language switching — shared base rules so bilingual lang-de/lang-en spans render
   correctly (German default) even on pages without their own inline lang CSS.
   The active-language HIDE rules are body-scoped + scoped !important so they ALWAYS
   beat layout rules that set `display` on a .lang-* span (e.g. a flex meta-row like
   `.au-studio-meta span{display:inline-flex}` — specificity 0,1,1 — which otherwise
   re-showed the hidden language and printed both DE+EN). The SHOW side stays normal. */
.lang-en { display: none }            /* pre-JS default (before lang.js adds the body class) */
.lang-block-en { display: none }
.lang-active-de .lang-en { display: none !important }
.lang-active-de .lang-block-en { display: none !important }
.lang-active-en .lang-de { display: none !important }
.lang-active-en .lang-block-de { display: none !important }
.lang-active-en .lang-en { display: inline }
.lang-active-en .lang-block-en { display: block }

/* ── Funktionen nav dropdown (injected by router.js) ── */
/* Uses a UNIQUE `feat-dropdown*` class prefix on purpose: `auth-nav.js` injects
   its own `.nav-dropdown` (the right-aligned profile menu) into <head> AFTER
   this stylesheet, so a shared `.nav-dropdown` name lost the cascade and the
   Funktionen wrap inherited `position:absolute; right:0` — ripping it out of the
   nav and floating it top-right over the hero. The distinct prefix prevents the
   collision so the menu stays inline-anchored under its trigger. */
/* The wrap sits inline in the .nav-links flex row, exactly between the sibling
   <a> links. The trigger is a real .nav-links <a>, so it inherits font/size/
   weight/color/hover from .nav-links a — we only add the caret alignment here. */
.feat-dropdown { position: relative; display: inline-flex; align-items: center; }
.feat-dropdown-trigger {
  display: inline-flex !important; align-items: center; gap: 4px;
  font-family: var(--font-body); font-size: 13px; font-weight: 600;
  color: var(--muted); text-decoration: none; cursor: pointer;
  transition: color .2s; line-height: 1;
}
.feat-dropdown:hover .feat-dropdown-trigger,
.feat-dropdown.open .feat-dropdown-trigger { color: var(--text); }
.feat-dropdown-trigger .nd-chevron { transition: transform .18s; flex-shrink: 0; opacity: .8; }
.feat-dropdown:hover .nd-chevron,
.feat-dropdown.open .nd-chevron { transform: rotate(180deg); }
/* Hover bridge: invisible padded strip below the trigger so the cursor can
   travel to the menu without crossing a dead gap (which made it feel detached). */
.feat-dropdown-menu {
  position: absolute; top: 100%; left: 50%; right: auto;
  transform: translateX(-50%) translateY(-4px);
  margin-top: 10px;
  min-width: 210px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: 0 8px 28px rgba(0,0,0,.10), 0 2px 6px rgba(0,0,0,.06);
  padding: 6px; opacity: 0; pointer-events: none;
  transition: opacity .15s, transform .15s; z-index: 300;
}
/* invisible bridge above the menu card filling the 10px gap to the trigger */
.feat-dropdown-menu::before {
  content: ''; position: absolute; left: 0; right: 0; top: -10px; height: 10px;
}
.feat-dropdown:hover .feat-dropdown-menu,
.feat-dropdown.open .feat-dropdown-menu {
  opacity: 1; pointer-events: auto; transform: translateX(-50%) translateY(0);
}
.feat-dropdown-menu .nd-item {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 12px; border-radius: 8px; font-size: 13px; font-weight: 600;
  color: var(--text); text-decoration: none;
  transition: background .12s, color .12s;
}
.feat-dropdown-menu .nd-item:hover { background: var(--teal-tint); color: var(--teal); }
.feat-dropdown-menu .nd-item-soon { color: var(--muted); }
.feat-dropdown-menu .nd-item-soon:hover { background: var(--sand); color: var(--text); }
.nd-item-lbl { flex: 1; }
.nd-pill {
  font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  padding: 2px 7px; border-radius: 20px; white-space: nowrap;
}
.nd-pill-pro { background: var(--teal); color: #fff; }
.nd-pill-free { background: var(--teal-tint); color: var(--teal); }
.nd-pill-plus { background: #FEF3C7; color: #92400E; }
.nd-pill-soon { background: var(--sand); color: var(--muted); }
.nd-divider { height: 1px; background: var(--border); margin: 4px 6px; }

@media (max-width: 880px) {
  nav, nav.legal-nav { padding: 14px 20px; }
  .site-footer { flex-direction: column; gap: 14px; text-align: center; padding: 24px; }
  .feat-dropdown-menu { left: 0; right: auto; transform: none; margin-top: 6px; }
  .feat-dropdown:hover .feat-dropdown-menu { transform: none; }
  .feat-dropdown.open .feat-dropdown-menu { opacity: 1; pointer-events: auto; transform: none; }
}
