/* ─────────────────────────────────────────────────────────────
   WeDo+ Design Tokens — v0.1
   Foundation for the wedo-next redesign. Light mode only (v1).
   Tokens are semantic where it matters; dark mode lives behind a
   future [data-theme="dark"] swap of the same variable names.
   ───────────────────────────────────────────────────────────── */

:root {
  /* ───── Brand: navy primary ───── */
  --navy-50:  #f1f4fb;
  --navy-100: #dde4f3;
  --navy-200: #b6c4e3;
  --navy-300: #899ecc;
  --navy-400: #5a78b3;
  --navy-500: #345599;
  --navy-600: #1d3d7d;
  --navy-700: #102d62;
  --navy-800: #001e4c;   /* ★ brand navy */
  --navy-900: #00153a;
  --navy-950: #000a22;

  /* ───── Brand: orange (official CE naranja = #ff7802) ─────
     Manual de identidad Crédito Express: naranja primario #FF7802.
     The bright brand orange (-500) pairs with NAVY text (AA 6.4:1) for
     fills/graphics; for white-text CTAs/links use --accent (-700, AA 5:1). */
  --orange-50:  #fff3e8;
  --orange-100: #ffe1c5;
  --orange-200: #ffc18a;
  --orange-300: #ff9f4d;
  --orange-400: #ff8a26;
  --orange-500: #ff7802;   /* ★ CE brand orange — logo/graphics; fails AA w/ white text */
  --orange-600: #d96400;   /* large-text / icon accent (~3:1 on white) */
  --orange-700: #b45309;   /* CTA bg / links — AA-safe (5:1) w/ white text */
  --orange-800: #8a3f06;   /* hover/pressed */
  --orange-900: #5c2a05;

  /* ───── Brand: yellow (official CE secundario = #f9bb21) ─────
     Use as a graphic/highlight accent. Bright fills take NAVY text. */
  --yellow-50:  #fff8e7;
  --yellow-100: #fdecc2;
  --yellow-200: #fcdd8c;
  --yellow-300: #fac84e;
  --yellow-400: #f9bb21;   /* ★ CE brand yellow — highlights/graphics */
  --yellow-500: #e9a50c;
  --yellow-600: #c0850a;   /* large text on white (~3:1) */
  --yellow-700: #8f6207;

  /* ───── Neutrals: cool gray (slightly blue-tinted) ───── */
  --gray-0:   #ffffff;
  --gray-25:  #fafbfd;
  --gray-50:  #f4f6fa;
  --gray-100: #e9ecf3;
  --gray-200: #d6dce7;
  --gray-300: #b3bccd;
  --gray-400: #8893aa;
  --gray-500: #5f6b82;
  --gray-600: #424d63;
  --gray-700: #2f384a;
  --gray-800: #1d2434;
  --gray-900: #0e1320;

  /* CE secondary gray (official #e0e0e0) — neutral, for brand fills/dividers.
     Distinct from the cool product-UI ramp above. */
  --gray-secondary: #e0e0e0;

  /* ───── Semantic: status colors (each w/ bg + border + fg) ───── */
  --success-50:  #ecfdf3;
  --success-200: #abefc6;
  --success-600: #079455;
  --success-700: #067647;

  --warning-50:  #fffaeb;
  --warning-200: #fedf89;
  --warning-600: #dc6803;
  --warning-700: #b54708;

  --error-50:    #fef3f2;
  --error-200:   #fecdca;
  --error-600:   #d92d20;
  --error-700:   #b42318;

  --info-50:     #eff8ff;
  --info-200:    #b2ddff;
  --info-600:    #1570ef;
  --info-700:    #175cd3;

  /* ───── Semantic aliases ───── */
  --bg-canvas:    var(--gray-50);    /* app background */
  --bg-surface:   var(--gray-0);     /* cards, panels */
  --bg-subtle:    var(--gray-25);    /* nested surfaces, table headers */
  --bg-hover:     var(--gray-100);
  --bg-active:    var(--gray-200);

  --fg-default:   var(--gray-900);
  --fg-muted:     var(--gray-500);
  --fg-subtle:    var(--gray-400);
  --fg-on-brand:  var(--gray-0);

  --border-default: var(--gray-200);
  --border-strong:  var(--gray-300);
  --border-focus:   var(--orange-600);

  --primary:        var(--navy-800);
  --primary-hover:  var(--navy-700);
  --primary-fg:     var(--gray-0);

  --accent:         var(--orange-700);   /* AA-safe orange for white-text CTAs/links */
  --accent-hover:   var(--orange-800);
  --accent-fg:      var(--gray-0);

  /* ───── Brand colors (Crédito Express identity) ───── */
  --brand-orange:   var(--orange-500);    /* #ff7802 — logo, graphics, large fills (use w/ navy text) */
  --brand-navy:     var(--navy-800);      /* #001e4c — logo, headlines */
  --brand-yellow:   var(--yellow-400);    /* #f9bb21 — highlights, patterns */
  --brand-gray:     var(--gray-secondary);/* #e0e0e0 — neutral fills, dividers */

  /* ───── Typography ───── */
  /* Official CE typeface: DM Sans (ExtraBold titles / Medium subtitles / Regular body). */
  --font-sans: "DM Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-display: "DM Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --text-xs:   12px;   /* table micro labels, captions */
  --text-sm:   13px;   /* dense table cells, metadata */
  --text-base: 14px;   /* body, form labels, default */
  --text-md:   16px;   /* input values, primary body */
  --text-lg:   18px;   /* section subtitles */
  --text-xl:   20px;   /* card titles */
  --text-2xl:  24px;   /* page titles */
  --text-3xl:  30px;   /* dashboard hero numbers */
  --text-4xl:  36px;
  --text-5xl:  48px;

  --leading-tight:  1.2;
  --leading-snug:   1.35;
  --leading-normal: 1.5;

  --weight-regular:   400;
  --weight-medium:    500;   /* DM Sans Medium — subtitles */
  --weight-semibold:  600;
  --weight-bold:      700;
  --weight-extrabold: 800;   /* DM Sans ExtraBold — titles/headlines */

  /* ───── Spacing (4px base) ───── */
  --space-0:  0;
  --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;
  --space-20: 80px;

  /* ───── Radius ───── */
  --radius-sm:   4px;   /* badges, tags */
  --radius-md:   6px;   /* inputs, buttons */
  --radius-lg:   8px;   /* cards */
  --radius-xl:   12px;  /* modals, hero panels */
  --radius-2xl:  16px;
  --radius-full: 9999px;

  /* ───── Shadows ───── */
  --shadow-xs: 0 1px 2px rgba(14, 19, 32, 0.05);
  --shadow-sm: 0 1px 3px rgba(14, 19, 32, 0.08), 0 1px 2px rgba(14, 19, 32, 0.04);
  --shadow-md: 0 4px 8px -2px rgba(14, 19, 32, 0.08), 0 2px 4px -2px rgba(14, 19, 32, 0.04);
  --shadow-lg: 0 12px 16px -4px rgba(14, 19, 32, 0.08), 0 4px 6px -2px rgba(14, 19, 32, 0.03);
  --shadow-xl: 0 20px 24px -4px rgba(14, 19, 32, 0.10), 0 8px 8px -4px rgba(14, 19, 32, 0.04);

  /* ───── Motion ───── */
  --ease-out:    cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --duration-fast:   120ms;
  --duration-normal: 200ms;
  --duration-slow:   320ms;

  /* ───── Opacity (CE manual: opacidades permitidas) ───── */
  --opacity-strong: 0.9;   /* 90% */
  --opacity-soft:   0.7;   /* 70% */

  /* ───── Layout ───── */
  --sidebar-w-full:    240px;
  --sidebar-w-collapsed: 64px;
  --topbar-h:          56px;
  --row-h-comfortable: 56px;
  --row-h-default:     48px;
  --row-h-dense:       40px;
}

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