/* ============================================================================
   ICOPAD — Design Tokens v1
   Brand: red / green / brown / white
   Typography: Inter (variable), 1rem body baseline, SaaS-grade rhythm.
   ============================================================================ */

:root {
  /* ── Brand: Red (primary default) ──────────────────────────────────── */
  --red-50:  #fef2f4;
  --red-100: #fdd8de;
  --red-200: #fbb1bd;
  --red-300: #f57a8f;
  --red-400: #e84c66;
  --red-500: #c8102e;
  --red-600: #a30d26;
  --red-700: #7d0a1d;
  --red-800: #570714;
  --red-900: #3a040d;

    /* ── Hero height — subtracts the sticky header so the hero fills
     the remaining viewport on every device. Update the values if the
     header tokens change. */
  --hero-vh-min: 520px;
  --hero-vh-max: 820px;
  --hero-vh-cap: 92svh;   /* fallback for browsers without svh */

  --hero-offset-mobile: calc(var(--header-height-mobile) + 56px);
  --hero-offset-desktop: calc(var(--header-height) + 76px);

  /* ── Brand: Green ──────────────────────────────────────────────────── */
  --green-50:  #eff9f3;
  --green-100: #d4f0e0;
  --green-200: #a8e0c0;
  --green-300: #6fca97;
  --green-400: #3aab70;
  --green-500: #0f7b3f;
  --green-600: #0c6534;
  --green-700: #095028;
  --green-800: #063a1c;
  --green-900: #042611;

  /* ── Brand: Brown ──────────────────────────────────────────────────── */
  --brown-50:  #f8f4ef;
  --brown-100: #eaded0;
  --brown-200: #d4bda0;
  --brown-300: #b89372;
  --brown-400: #8e6a48;
  --brown-500: #6b4423;
  --brown-600: #56361c;
  --brown-700: #412816;
  --brown-800: #2b1b0f;
  --brown-900: #1a1009;

  /* ── Active accent ─────────────────────────────────────────────────── */
  --accent-50:  var(--red-50);
  --accent-100: var(--red-100);
  --accent-200: var(--red-200);
  --accent-300: var(--red-300);
  --accent-400: var(--red-400);
  --accent-500: var(--red-500);
  --accent-600: var(--red-600);
  --accent-700: var(--red-700);
  --accent-800: var(--red-800);
  --accent-900: var(--red-900);

  --brand:       var(--accent-500);
  --brand-hover: var(--accent-600);
  --brand-ink:   #ffffff;

  --secondary:       var(--green-500);
  --secondary-hover: var(--green-600);

  /* ── Semantic ──────────────────────────────────────────────────────── */
  --success-50:  var(--green-50);
  --success-100: var(--green-100);
  --success-500: var(--green-500);
  --success-600: var(--green-600);
  --success-700: var(--green-700);
  --success:     var(--green-500);

  --warning-50:  #fff7ed;
  --warning-100: #ffedd5;
  --warning-500: #ea8f08;
  --warning-600: #c67a08;
  --warning-700: #945c08;
  --warning:     var(--warning-500);

  --error-50:  #fef2f4;
  --error-100: #fdd8de;
  --error-500: var(--red-500);
  --error-600: var(--red-600);
  --error-700: var(--red-700);
  --error:     var(--red-500);

  --info-50:  #eff6ff;
  --info-100: #dbeafe;
  --info-500: #2e90fa;
  --info-600: #1570ef;
  --info-700: #175cd3;
  --info:     var(--info-500);

  /* ── Neutrals ──────────────────────────────────────────────────────── */
  --gray-0:   #ffffff;
  --gray-25:  #fcfcfc;
  --gray-50:  #f9f8f7;
  --gray-100: #f2f0ee;
  --gray-200: #e5e2df;
  --gray-300: #d1ccc7;
  --gray-400: #a29a92;
  --gray-500: #76706a;
  --gray-600: #565250;
  --gray-700: #3d3a38;
  --gray-800: #272524;
  --gray-900: #161413;
  --gray-950: #0b0a0a;

  /* ── Surfaces ──────────────────────────────────────────────────────── */
  --bg:             var(--gray-50);
  --bg-subtle:      var(--gray-25);
  --bg-muted:       var(--gray-100);
  --surface:        var(--gray-0);
  --surface-hover:  var(--gray-50);
  --surface-active: var(--gray-100);

  --border:        var(--gray-200);
  --border-strong: var(--gray-300);
  --border-subtle: var(--gray-100);

  --text:          var(--gray-900);
  --text-muted:    var(--gray-600);
  --text-subtle:   var(--gray-500);
  --text-disabled: var(--gray-400);
  --text-invert:   var(--gray-0);

  /* ── Typography ────────────────────────────────────────────────────── */
  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system,
               "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-mono:  "JetBrains Mono", ui-monospace, "Cascadia Code",
               Menlo, Consolas, monospace;

  --fs-xs:   0.75rem;      /* 12px */
  --fs-sm:   0.875rem;     /* 14px */
  --fs-base: 1rem;         /* 16px */
  --fs-md:   1.0625rem;    /* 17px */
  --fs-lg:   1.125rem;     /* 18px */
  --fs-xl:   1.25rem;      /* 20px */
  --fs-2xl:  1.5rem;       /* 24px */
  --fs-3xl:  1.875rem;     /* 30px */
  --fs-4xl:  2.25rem;      /* 36px */
  --fs-5xl:  3rem;         /* 48px */
  --fs-6xl:  3.75rem;      /* 60px */

  --fw-regular:  400;
  --fw-medium:   500;
  --fw-semibold: 600;
  --fw-bold:     700;

  --lh-tight:  1.1;
  --lh-snug:   1.35;
  --lh-normal: 1.5;
  --lh-base:   1.6;
  --lh-loose:  1.75;

  --tracking-tight:  -0.015em;
  --tracking-snug:   -0.005em;
  --tracking-normal: 0;
  --tracking-wide:   0.015em;
  --tracking-wider:  0.04em;
  --tracking-widest: 0.08em;

  /* ── Spacing (4px base) ───────────────────────────────────────────── */
  --space-1:  0.25rem;   --space-2:  0.5rem;    --space-3:  0.75rem;
  --space-4:  1rem;      --space-5:  1.25rem;   --space-6:  1.5rem;
  --space-7:  1.75rem;   --space-8:  2rem;      --space-10: 2.5rem;
  --space-12: 3rem;      --space-14: 3.5rem;    --space-16: 4rem;
  --space-20: 5rem;      --space-24: 6rem;      --space-32: 8rem;

  /* ── Radii ────────────────────────────────────────────────────────── */
  --radius-xs:   4px;
  --radius-sm:   6px;
  --radius-md:   8px;
  --radius-lg:   12px;
  --radius-xl:   16px;
  --radius-2xl:  24px;
  --radius-full: 9999px;

  /* ── Shadows ──────────────────────────────────────────────────────── */
  --shadow-2xs: 0 1px 2px 0 rgb(15 23 42 / 0.05);
  --shadow-xs:  0 1px 2px 0 rgb(15 23 42 / 0.06), 0 1px 3px 0 rgb(15 23 42 / 0.10);
  --shadow-sm:  0 1px 3px 0 rgb(15 23 42 / 0.10), 0 1px 2px -1px rgb(15 23 42 / 0.06);
  --shadow-md:  0 4px 6px -1px rgb(15 23 42 / 0.08), 0 2px 4px -2px rgb(15 23 42 / 0.06);
  --shadow-lg:  0 10px 15px -3px rgb(15 23 42 / 0.08), 0 4px 6px -4px rgb(15 23 42 / 0.04);
  --shadow-xl:  0 20px 25px -5px rgb(15 23 42 / 0.10), 0 8px 10px -6px rgb(15 23 42 / 0.05);
  --shadow-2xl: 0 25px 50px -12px rgb(15 23 42 / 0.20);

  --ring-brand:   0 0 0 4px rgb(200 16 46 / 0.18);
  --ring-error:   0 0 0 4px rgb(200 16 46 / 0.20);
  --ring-success: 0 0 0 4px rgb(15 123 63 / 0.20);

  /* ── Motion ──────────────────────────────────────────────────────── */
  --ease-out:    cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in:     cubic-bezier(0.7, 0, 0.84, 0);
  --ease-inout:  cubic-bezier(0.65, 0, 0.35, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

  --dur-instant: 80ms;
  --dur-fast:    120ms;
  --dur-base:    180ms;
  --dur-slow:    260ms;
  --dur-slower:  400ms;
  --dur-drawer:  320ms;
  --dur-mega:    200ms;

  /* ── Layout ──────────────────────────────────────────────────────── */
  --container-max: 1280px;
  --content-max:   1200px;
  --content-narrow: 720px;
  --gutter: clamp(1rem, 4vw, 2rem);

  --header-height-mobile: 60px;
  --header-height:        72px;
  --sidebar-width:        260px;

  /* ── Z-index ─────────────────────────────────────────────────────── */
  --z-base:     0;
  --z-dropdown: 1000;
  --z-sticky:   1100;
  --z-overlay:  1300;
  --z-modal:    1400;
  --z-toast:    1700;
  --z-tooltip:  1800;

  /* ── Bootstrap overrides ──────────────────────────────────────────── */
  --bs-primary:          var(--brand);
  --bs-primary-rgb:      200, 16, 46;
  --bs-body-font-family: var(--font-sans);
  --bs-body-font-size:   var(--fs-base);
  --bs-body-line-height: var(--lh-normal);
  --bs-body-color:       var(--text);
  --bs-body-bg:          var(--bg);
  --bs-border-color:     var(--border);
  --bs-border-radius:    var(--radius-md);
  --bs-link-color:       var(--brand);
  --bs-link-hover-color: var(--brand-hover);
  --bs-focus-ring-color: rgb(200 16 46 / 0.25);
}

/* ── Accent overrides ─────────────────────────────────────────────── */
[data-accent="red"] {
  --accent-50:  var(--red-50);
  --accent-100: var(--red-100);
  --accent-200: var(--red-200);
  --accent-300: var(--red-300);
  --accent-400: var(--red-400);
  --accent-500: var(--red-500);
  --accent-600: var(--red-600);
  --accent-700: var(--red-700);
  --accent-800: var(--red-800);
  --accent-900: var(--red-900);
  --brand:       var(--accent-500);
  --brand-hover: var(--accent-600);
  --ring-brand:  0 0 0 4px rgb(200 16 46 / 0.18);
  --bs-primary-rgb: 200, 16, 46;
}

[data-accent="green"] {
  --accent-50:  var(--green-50);
  --accent-100: var(--green-100);
  --accent-200: var(--green-200);
  --accent-300: var(--green-300);
  --accent-400: var(--green-400);
  --accent-500: var(--green-500);
  --accent-600: var(--green-600);
  --accent-700: var(--green-700);
  --accent-800: var(--green-800);
  --accent-900: var(--green-900);
  --brand:       var(--accent-500);
  --brand-hover: var(--accent-600);
  --ring-brand:  0 0 0 4px rgb(15 123 63 / 0.20);
  --bs-primary-rgb: 15, 123, 63;
}

[data-accent="brown"] {
  --accent-50:  var(--brown-50);
  --accent-100: var(--brown-100);
  --accent-200: var(--brown-200);
  --accent-300: var(--brown-300);
  --accent-400: var(--brown-400);
  --accent-500: var(--brown-500);
  --accent-600: var(--brown-600);
  --accent-700: var(--brown-700);
  --accent-800: var(--brown-800);
  --accent-900: var(--brown-900);
  --brand:       var(--accent-500);
  --brand-hover: var(--accent-600);
  --ring-brand:  0 0 0 4px rgb(107 68 35 / 0.20);
  --bs-primary-rgb: 107, 68, 35;
}

[data-accent="slate"] {
  --accent-50:  var(--slate-50);
  --accent-100: var(--slate-100);
  --accent-200: var(--slate-200);
  --accent-300: var(--slate-300);
  --accent-400: var(--slate-400);
  --accent-500: var(--slate-500);
  --accent-600: var(--slate-600);
  --accent-700: var(--slate-700);
  --accent-800: var(--slate-800);
  --accent-900: var(--slate-900);
  --brand:       var(--accent-600);      /* slightly darker for
                                            enterprise contrast */
  --brand-hover: var(--accent-700);
  --ring-brand:  0 0 0 4px rgb(51 65 85 / 0.18);
  --bs-primary-rgb: 51, 65, 85;
}

/* ── Dark mode ─────────────────────────────────────────────────────── */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:             #0e0d0c;
    --bg-subtle:      #131211;
    --bg-muted:       #1c1a18;
    --surface:        #181614;
    --surface-hover:  #201d1b;
    --surface-active: #2a2624;

    --border:        #2c2826;
    --border-strong: #423c38;
    --border-subtle: #1f1c1a;

    --text:          #ece8e4;
    --text-muted:    #a8a19a;
    --text-subtle:   #7d766f;
    --text-disabled: #59534d;
    --text-invert:   #0e0d0c;

    --shadow-2xs: 0 1px 2px 0 rgb(0 0 0 / 0.4);
    --shadow-xs:  0 1px 2px 0 rgb(0 0 0 / 0.4);
    --shadow-sm:  0 1px 3px 0 rgb(0 0 0 / 0.5);
    --shadow-md:  0 4px 6px -1px rgb(0 0 0 / 0.5);
    --shadow-lg:  0 10px 15px -3px rgb(0 0 0 / 0.5);
    --shadow-xl:  0 20px 25px -5px rgb(0 0 0 / 0.6);

    --bs-body-color: var(--text);
    --bs-body-bg:    var(--bg);
    --bs-border-color: var(--border);
  }
}

[data-theme="dark"],
[data-bs-theme="dark"] {
  --bg:             #0e0d0c;
  --bg-subtle:      #131211;
  --bg-muted:       #1c1a18;
  --surface:        #181614;
  --surface-hover:  #201d1b;
  --surface-active: #2a2624;

  --border:        #2c2826;
  --border-strong: #423c38;
  --border-subtle: #1f1c1a;

  --text:          #ece8e4;
  --text-muted:    #a8a19a;
  --text-subtle:   #7d766f;
  --text-disabled: #59534d;
  --text-invert:   #0e0d0c;

  --shadow-2xs: 0 1px 2px 0 rgb(0 0 0 / 0.4);
  --shadow-xs:  0 1px 2px 0 rgb(0 0 0 / 0.4);
  --shadow-sm:  0 1px 3px 0 rgb(0 0 0 / 0.5);
  --shadow-md:  0 4px 6px -1px rgb(0 0 0 / 0.5);
  --shadow-lg:  0 10px 15px -3px rgb(0 0 0 / 0.5);
  --shadow-xl:  0 20px 25px -5px rgb(0 0 0 / 0.6);

  --bs-body-color: var(--text);
  --bs-body-bg:    var(--bg);
  --bs-border-color: var(--border);
}

  /* ── Brand: Slate (Corporate) ──────────────────────────────────────── */
  --slate-50:  #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1e293b;
  --slate-900: #0f172a;

/* ── Inter font feature settings ─────────────────────────────────── */
html {
  font-feature-settings: "cv11", "ss01", "kern", "liga", "calt";
}