/* ============================================================
   AgriCalcul — Design System Tokens (Terroir moderne)
   Importé depuis le handoff Claude Design. Source de vérité
   des couleurs / typo / espacements / élévations.
   ============================================================ */

/* ============================================================
   AgriCalcul — COLOR TOKENS
   Warm, agricultural palette. Forest ink, leaf-green primary,
   terracotta-orange accent, vegetable category colors.
   ============================================================ */
:root {
  /* --- Brand: leaf green (primary) --- */
  --green-900: #2c4717;
  --green-700: #45701f;
  --green-600: #517f26;
  --green-500: #5f8f2e;   /* PRIMARY */
  --green-400: #79a64a;
  --green-300: #a9c97f;
  --green-200: #cfe0b3;
  --green-100: #e4eed3;
  --green-50:  #eef3e4;

  /* --- Brand: terracotta orange (accent) --- */
  --orange-700: #a8611c;
  --orange-600: #c2762a;
  --orange-500: #e2912f;  /* ACCENT */
  --orange-300: #eebb7e;
  --orange-100: #f8e6cd;
  --orange-50:  #fbeede;

  /* --- Warm neutral (ink + greys) --- */
  --ink-900: #14241b;     /* primary text / forest */
  --ink-800: #20302a;
  --ink-700: #2f3d33;
  --ink-600: #45534a;
  --ink-500: #5c6b60;     /* secondary text */
  --ink-400: #7c8a80;     /* muted / placeholder */
  --ink-300: #a7b1a8;
  --ink-200: #cdd3cb;
  --line-200: #e7e3da;    /* hairline borders */
  --line-100: #efece4;

  /* --- Surfaces (warm off-white) --- */
  --bg:            #f4f1ea;  /* app background */
  --surface:       #ffffff;  /* cards */
  --surface-2:     #faf8f3;  /* subtle raised / inputs */
  --surface-sunken:#efece4;  /* wells, tracks */
  --scrim:         rgba(20,36,27,.46);

  /* --- Semantic --- */
  --success-500: #5f8f2e;  --success-50: #eef3e4;
  --warning-500: #e2912f;  --warning-50: #fbeede;
  --danger-500:  #d2553f;  --danger-600: #b94530;  --danger-50: #fbe9e4;
  --info-500:    #3f9fc4;  --info-50: #e6f4f9;

  /* --- Category / vegetable accents (rotating chips & card spines) --- */
  --cat-leaf:    #6fa23a;  /* choux, verts */
  --cat-carrot:  #e2912f;  /* racines */
  --cat-sky:     #5bb6d6;  /* courges, eau */
  --cat-beet:    #d96aa0;  /* betteraves */
  --cat-squash:  #d6a73a;  /* potirons */
  --cat-plum:    #8a7bd8;  /* aubergines */
  --cat-tomato:  #d2553f;  /* fruits rouges */
  --cat-lime:    #9bbf3b;  /* salades */

  /* --- Aliases (semantic surface roles) --- */
  --text-primary:   var(--ink-900);
  --text-secondary: var(--ink-500);
  --text-muted:     var(--ink-400);
  --text-on-green:  #ffffff;
  --surface-card:   var(--surface);
  --border-card:    var(--line-200);
  --primary:        var(--green-500);
  --primary-press:  var(--green-700);
  --accent:         var(--orange-500);
}

/* ============================================================
   AgriCalcul — TYPOGRAPHY TOKENS
   Display & numerals: Bricolage Grotesque
   Body & UI:          Hanken Grotesque
   ============================================================ */
:root {
  --font-display: 'Bricolage Grotesque', system-ui, sans-serif;
  --font-text:    'Hanken Grotesque', system-ui, sans-serif;
  --font-num:     'Bricolage Grotesque', system-ui, sans-serif; /* KPIs, prices */

  /* Weights */
  --fw-regular: 400;
  --fw-medium:  500;
  --fw-semibold:600;
  --fw-bold:    700;
  --fw-extra:   800;

  /* Type scale (mobile-first app) */
  --t-display-size: 34px; --t-display-lh: 1.02; --t-display-ls: -0.02em;  /* screen titles */
  --t-title-size:   22px; --t-title-lh: 1.1;  --t-title-ls: -0.015em;     /* section headers */
  --t-head-size:    18px; --t-head-lh: 1.2;   --t-head-ls: -0.01em;       /* card titles */
  --t-body-size:    16px; --t-body-lh: 1.5;   --t-body-ls: 0;             /* default body */
  --t-bodysm-size:  14px; --t-bodysm-lh: 1.45;--t-bodysm-ls: 0;           /* secondary */
  --t-label-size:   13px; --t-label-lh: 1.2;  --t-label-ls: 0.02em;       /* labels / buttons */
  --t-over-size:    11px; --t-over-lh: 1.1;   --t-over-ls: 0.12em;        /* OVERLINE (uppercase) */
  --t-caption-size: 12px; --t-caption-lh: 1.3;--t-caption-ls: 0;          /* meta, MAJ dates */

  /* KPI / numeric display */
  --t-kpi-size:     38px; --t-kpi-lh: 1.0;    --t-kpi-ls: -0.02em;
  --t-kpi-sm-size:  24px; --t-kpi-sm-lh: 1.0; --t-kpi-sm-ls: -0.015em;
}

/* ============================================================
   AgriCalcul — SPACING TOKENS  (4px base grid)
   ============================================================ */
:root {
  --sp-0: 0;
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-7: 32px;
  --sp-8: 40px;
  --sp-9: 48px;
  --sp-10: 64px;

  /* Layout */
  --screen-pad: 20px;       /* horizontal padding of an app screen */
  --card-pad: 16px;         /* default card inner padding */
  --card-gap: 12px;         /* gap between stacked cards */
  --bottomnav-h: 68px;      /* tab bar height */
  --max-app-w: 412px;       /* phone canvas width */
}

/* ============================================================
   AgriCalcul — RADIUS & ELEVATION TOKENS
   Soft, low-opacity layered shadows. Generous radii.
   ============================================================ */
:root {
  /* Corner radii */
  --r-xs:  8px;
  --r-sm:  10px;
  --r-md:  14px;   /* inputs, chips */
  --r-lg:  20px;   /* cards */
  --r-xl:  26px;   /* sheets, hero cards */
  --r-2xl: 32px;
  --r-pill: 999px;

  /* Elevation — warm forest-tinted shadows, very soft */
  --sh-0: none;
  --sh-1: 0 1px 2px rgba(20,36,27,.05), 0 1px 1px rgba(20,36,27,.03);
  --sh-2: 0 4px 14px -6px rgba(20,36,27,.12), 0 1px 3px rgba(20,36,27,.05);
  --sh-3: 0 14px 34px -16px rgba(20,36,27,.22), 0 3px 8px rgba(20,36,27,.06);
  --sh-4: 0 26px 56px -22px rgba(20,36,27,.30);
  --sh-nav: 0 -4px 24px -10px rgba(20,36,27,.16);
  --sh-green: 0 10px 22px -10px rgba(95,143,46,.55);   /* primary button glow */

  /* Focus ring */
  --ring: 0 0 0 3px rgba(95,143,46,.28);
}
