/* EMPREAR Design System — tokens (bp-*)
   FEAT-094 Brand System: EMPREAR platform brand vs tenant theme layers.
   Default tenant branding still inherits via Theme Engine (--tenant-primary / --tenant-secondary).
   Do NOT use EMPREAR brand tokens to paint Wall Security / Gráfica Magro tenant chrome.
*/

:root {
  /* ── EMPREAR Brand System (marketing + platform product chrome) ──
     FEAT-093 §10 APPROVED 2026-11-18: warm ivory paper, ink marketing CTA.
     Highlight/brass is accent only — never the primary marketing button fill. */
  --bp-brand-primary: #0b1f44;
  --bp-brand-secondary: #0d6efd;
  --bp-brand-accent: #4cc3ff;
  --bp-brand-highlight: #ffc633;
  --bp-brand-brass: var(--bp-brand-highlight);
  --bp-brand-paper: #f7f4ec;
  --bp-brand-bg: var(--bp-brand-paper);
  --bp-brand-surface: #ffffff;
  --bp-brand-text: #10172a;
  --bp-brand-text-muted: #3d4660;
  --bp-brand-border: rgba(16, 23, 42, 0.12);
  --bp-brand-border-strong: rgba(16, 23, 42, 0.22);
  --bp-brand-on-primary: #ffffff;
  --bp-brand-on-secondary: #ffffff;
  --bp-brand-on-highlight: #10172a;

  /* ── Legacy Magro CMYK DNA (Magro tenant / legacy landing accents only) ──
     Kept for Gráfica Magro isolation. Prefer --bp-brand-* for EMPREAR surfaces. */
  --bp-legacy-magro-cyan: #00bcd4;
  --bp-legacy-magro-magenta: #e65297;
  --bp-legacy-magro-yellow: #f6d76b;
  --bp-legacy-magro-black: #0a0a0a;
  /* Compat aliases — Magro landing CSS still references --bp-cmyk-* */
  --bp-cmyk-cyan: var(--bp-legacy-magro-cyan);
  --bp-cmyk-magenta: var(--bp-legacy-magro-magenta);
  --bp-cmyk-yellow: var(--bp-legacy-magro-yellow);
  --bp-cmyk-black: var(--bp-legacy-magro-black);

  /* Surfaces (platform dark ink scale — EMPREAR technical SaaS) */
  --bp-black: #0a0f1c;
  --bp-graphite: #121826;
  --bp-anthracite: #1a2233;
  --bp-raised: #162033;
  --bp-white: #ffffff;
  --bp-gray: #6b7280;
  --bp-gray-light: #9ca3af;

  /* Typography — system stack in product chrome; no Google Fonts in base shell */
  --bp-font-family: "Segoe UI", "Helvetica Neue", ui-sans-serif, system-ui, sans-serif;
  --bp-font-brand-display: "Palatino Linotype", Palatino, "Iowan Old Style", Georgia, serif;
  --bp-font-mono: "Cascadia Mono", "Segoe UI Mono", ui-monospace, monospace;
  --bp-font-display: clamp(1.875rem, 4vw, 3rem);
  --bp-font-display-xl: clamp(2.25rem, 5.5vw, 4.25rem);
  --bp-landing-bg: var(--bp-brand-paper);
  --bp-landing-warm-white: var(--bp-brand-paper);
  --bp-font-h1: clamp(1.5rem, 3vw, 2rem);
  --bp-font-h2: 1.35rem;
  --bp-font-h3: 1.125rem;
  --bp-font-body: 0.9375rem;
  --bp-font-label: 0.8125rem;
  --bp-font-caption: 0.75rem;
  --bp-weight-normal: 400;
  --bp-weight-medium: 500;
  --bp-weight-semibold: 600;
  --bp-weight-bold: 700;
  --bp-line-tight: 1.2;
  --bp-line-normal: 1.5;
  --bp-line-relaxed: 1.65;
  --bp-letter-display: -0.02em;
  --bp-letter-eyebrow: 0.12em;

  /* Spacing */
  --bp-space-xs: 0.25rem;
  --bp-space-sm: 0.5rem;
  --bp-space-md: 1rem;
  --bp-space-lg: 1.5rem;
  --bp-space-xl: 2rem;
  --bp-space-2xl: 3rem;
  --bp-space-3xl: 4rem;
  --bp-container: 1200px;

  /* Radius */
  --bp-radius-sm: 6px;
  --bp-radius-md: 10px;
  --bp-radius-lg: 16px;
  --bp-radius-btn: 6px;
  --bp-radius-pill: 999px;

  /* Borders (platform dark chrome) */
  --bp-border: rgba(255, 255, 255, 0.08);
  --bp-border-strong: rgba(255, 255, 255, 0.15);
  --bp-border-brand: rgba(13, 110, 253, 0.35);
  /* Compat: Magro border name still referenced by legacy CSS */
  --bp-border-magenta: color-mix(in srgb, var(--bp-brand-secondary) 35%, transparent); /* was Magro; brand alias FEAT-096 */

  /* Shadows — EMPREAR depth (blue-tinted), not Magro magenta glow */
  --bp-shadow-none: none;
  --bp-shadow-subtle: 0 1px 2px rgba(11, 31, 68, 0.2);
  --bp-shadow-card: 0 12px 40px rgba(11, 31, 68, 0.28);
  --bp-shadow-card-hover: 0 20px 50px rgba(11, 31, 68, 0.22), 0 0 48px rgba(13, 110, 253, 0.1);
  --bp-shadow-floating: 0 4px 24px rgba(11, 31, 68, 0.28);
  --bp-shadow-modal: 0 16px 40px rgba(11, 31, 68, 0.4);
  --bp-shadow-cta: 0 4px 16px rgba(13, 110, 253, 0.35);

  /* Platform identity (product chrome — never inherits tenant theme) */
  --bp-platform-bg: var(--bp-black);
  --bp-platform-surface: var(--bp-graphite);
  --bp-platform-surface-raised: var(--bp-anthracite);
  --bp-platform-text: #f5f7fb;
  --bp-platform-text-muted: #a8b0c0;
  --bp-platform-accent: var(--bp-brand-secondary);
  --bp-platform-accent-strong: #0a58ca;
  --bp-platform-accent-cyan: var(--bp-brand-accent);
  --bp-platform-accent-yellow: var(--bp-brand-highlight);
  --bp-platform-border: var(--bp-border);
  --bp-platform-primary: var(--bp-brand-primary);

  /* Gradients — EMPREAR navy → secondary/accent (Highlight never primary CTA fill) */
  --bp-gradient-page: linear-gradient(160deg, #0a0f1c 0%, #121826 50%, #0b1f44 100%);
  --bp-gradient-card: linear-gradient(145deg, #162033 0%, #1a2233 100%);
  --bp-gradient-cta: linear-gradient(135deg, var(--bp-brand-primary) 0%, var(--bp-brand-secondary) 100%);
  --bp-gradient-cta-hover: linear-gradient(135deg, #081832 0%, var(--bp-platform-accent-strong) 100%);
  --bp-gradient-brand-bar: linear-gradient(
    90deg,
    var(--bp-brand-primary) 0%,
    var(--bp-brand-secondary) 45%,
    var(--bp-brand-accent) 100%
  );
  /* Compat alias for Magro bar consumers; EMPREAR uses brand-bar */
  --bp-gradient-cmyk-bar: var(--bp-gradient-brand-bar);
  --bp-gradient-hero-glow:
    radial-gradient(ellipse at 18% 0%, rgba(13, 110, 253, 0.16) 0%, transparent 46%),
    radial-gradient(ellipse at 92% 12%, rgba(76, 195, 255, 0.1) 0%, transparent 42%),
    radial-gradient(ellipse at 70% 100%, rgba(255, 198, 51, 0.06) 0%, transparent 38%),
    var(--bp-gradient-page);

  /* Engineering identity — EMPREAR accent cyan */
  --bp-engineering-accent: var(--bp-brand-accent);
  --bp-engineering-border: rgba(76, 195, 255, 0.45);

  /* Tenant defaults (overridden per tenant by Theme Engine — NOT EMPREAR brand) */
  --tenant-primary: #1a1a1a;
  --tenant-secondary: #3b82f6;
  --bp-tenant-bg: #f1f5f9;
  --bp-tenant-surface: #ffffff;
  --bp-tenant-text: #0f172a;
  --bp-tenant-text-muted: #64748b;
  --bp-tenant-border: #e2e8f0;

  /* Semantic — dark platform surfaces */
  --bp-color-success: #4ade80;
  --bp-color-success-bg: rgba(74, 222, 128, 0.14);
  --bp-color-warning: var(--bp-brand-highlight);
  --bp-color-warning-bg: rgba(255, 198, 51, 0.14);
  --bp-color-error: #dc3545;
  --bp-color-error-bg: rgba(220, 53, 69, 0.14);
  --bp-color-info: var(--bp-brand-accent);
  --bp-color-info-bg: rgba(76, 195, 255, 0.12);
  --bp-color-neutral: #9ca3af;
  --bp-color-neutral-bg: rgba(255, 255, 255, 0.08);

  /* Light-surface semantic (Portal / Theme Engine light contexts only) */
  --bp-color-success-bg-light: #dcfce7;
  --bp-color-warning-bg-light: #fef3c7;
  --bp-color-error-bg-light: #fee2e2;
  --bp-color-info-bg-light: #ecfeff;
  --bp-color-neutral-bg-light: #e2e8f0;

  /* Breakpoints (reference) */
  --bp-bp-tablet: 768px;
  --bp-bp-desktop: 1280px;

  /* Motion — design system v3 (120/200/320 ms) */
  --bp-motion-instant: 0ms;
  --bp-motion-fast: 120ms;
  --bp-motion-normal: 200ms;
  --bp-motion-slow: 320ms;
  --bp-motion-enter: 400ms;
  --bp-ease: cubic-bezier(0.4, 0, 0.2, 1);
  --bp-ease-standard: var(--bp-ease);
  --bp-ease-emphasized: cubic-bezier(0.2, 0.8, 0.2, 1);

  /* Semantic aliases (Premium Technical SaaS — light tenant default) */
  --background: var(--bp-tenant-bg);
  --foreground: var(--bp-tenant-text);
  --muted: var(--bp-tenant-text-muted);
  --surface-1: var(--bp-tenant-surface);
  --border-subtle: var(--bp-tenant-border);
  --action-primary: var(--tenant-secondary);
  --ring: var(--tenant-secondary);

  /* EMPREAR brand semantic aliases (platform marketing / platform chrome helpers) */
  --bp-brand-action-primary: var(--bp-brand-secondary);
  --bp-brand-action-highlight: var(--bp-brand-highlight);
  /* Surface A marketing enter CTA = ink (C-05); product chrome still uses action blue */
  --bp-brand-marketing-cta: var(--bp-brand-primary);
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --bp-motion-instant: 0ms;
    --bp-motion-fast: 0ms;
    --bp-motion-normal: 0ms;
    --bp-motion-slow: 0ms;
    --bp-motion-enter: 0ms;
  }
}
