/* ============================================================
   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
*/
@import url('https://fonts.googleapis.com/css2?family=Jost:ital,wght@0,300;0,400;0,500;0,600;0,700;1,300;1,400;1,500;1,600;1,700&family=Plus+Jakarta+Sans:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;700&display=swap');

: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);

  /* ---------- 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-4: 0 8px 32px rgba(42,127,127,.10);
  --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); }
.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; }
.kstudio-link { font-family: var(--font-mono); font-size: 11px; color: rgba(255,255,255,.4); text-decoration: none; }
.kstudio-link:hover { color: var(--sage); }
.kstudio-link b { font-family: var(--font-display); font-weight: 600; color: rgba(255,255,255,.65); }
.kstudio-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; }

@media (max-width: 880px) {
  nav, nav.legal-nav { padding: 14px 20px; }
  .site-footer { flex-direction: column; gap: 14px; text-align: center; padding: 24px; }
}
