/* ============================================================
   FleteQ — Design System v2 · Tokens canónicos
   Sprint B.2 — Landing + Login + Onboarding
   Fecha: 13 may 2026 · Owner: Claude Design (Anthropic)
   ============================================================
   PRESERVA paleta canónica `#1A3C5E / #27AE60 / #E67E22 / #E74C3C`
   y wordmark v3 Inter 800 + Q verde (IMPI Clase 42+39, intocable).
   Tokens HSL = derivaciones formales del hex canónico.
============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400..700;1,400..700&family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  /* ── Paleta canónica (hex inmutable) ─────────────────────── */
  --fq-azul:       #1A3C5E;   /* primary brand */
  --fq-verde:      #27AE60;   /* success / accent (Q wordmark) */
  --fq-naranja:    #E67E22;   /* warning */
  --fq-rojo:       #E74C3C;   /* danger */
  --fq-carbon:     #0F1E2E;   /* texto */
  --fq-gris-fondo: #F5F7FA;   /* fondo */

  /* ── Light theme (default editorial) ─────────────────────── */
  --bg:           #FAFAF7;    /* fondo cálido editorial Stripe-tono */
  --bg-elev:      #FFFFFF;
  --bg-muted:     #F5F4EF;
  --bg-inset:     #ECEAE2;
  --ink:          #0F1E2E;    /* carbón */
  --ink-2:        #2D3E54;    /* secundario */
  --ink-3:        #5C6C82;    /* terciario */
  --ink-4:        #8A98AD;    /* muted */
  --line:         #E5E2D6;    /* borde sutil */
  --line-2:       #D8D4C4;    /* borde fuerte */

  --brand:        #1A3C5E;    /* azul canónico */
  --brand-ink:    #FFFFFF;
  --brand-hover:  #122B45;
  --brand-soft:   #EEF2F6;

  --accent:       #27AE60;    /* verde canónico */
  --accent-ink:   #FFFFFF;
  --accent-hover: #1F8F4E;
  --accent-soft:  #E8F5EE;
  --accent-700:   #1F8F4E;
  --accent-800:   #186F3D;

  --warn:         #E67E22;
  --warn-soft:    #FBE9D7;
  --danger:       #E74C3C;
  --danger-soft:  #FBE0DD;

  /* Traffic-light 5 niveles (slider margen cotizador) */
  --signal-loss:        #C0392B;   /* pérdida */
  --signal-low:         #E67E22;   /* bajo */
  --signal-fair:        #F1C40F;   /* justo */
  --signal-profitable:  #27AE60;   /* rentable */
  --signal-optimal:     #16A085;   /* óptimo */

  /* ── Tipografía ──────────────────────────────────────────── */
  --font-sans:    'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  /* MAY28_X — --font-serif refactor world-class B2B SaaS canon (Stripe/Linear/Ramp).
     Token preservado para back-compat con reglas CSS que aún lo referencian; ahora
     resuelve a Inter. Cero Playfair en producción visible. Original: 'Playfair
     Display', 'Source Serif Pro', Georgia, serif */
  --font-serif:   var(--font-sans);
  --font-mono:    'JetBrains Mono', 'SF Mono', Menlo, monospace;

  /* Escala tipográfica fluida (clamp para responsive sin breakpoints) */
  --text-xs:    0.75rem;    /* 12 */
  --text-sm:    0.875rem;   /* 14 */
  --text-base:  1rem;       /* 16 */
  --text-md:    1.0625rem;  /* 17 */
  --text-lg:    1.25rem;    /* 20 */
  --text-xl:    clamp(1.375rem, 1.2rem + 0.6vw, 1.75rem);   /* 22-28 */
  --text-2xl:   clamp(1.75rem, 1.4rem + 1.4vw, 2.5rem);     /* 28-40 */
  --text-3xl:   clamp(2.25rem, 1.6rem + 2.6vw, 3.5rem);     /* 36-56 */
  --text-4xl:   clamp(3rem, 2rem + 4vw, 5rem);              /* 48-80 hero H1 */
  --text-display: clamp(3.5rem, 2rem + 6vw, 6rem);          /* 56-96 cifra cotizador */

  /* Letter-spacing */
  --tracking-tight:  -0.02em;
  --tracking-snug:   -0.01em;
  --tracking-normal: 0;
  --tracking-wide:   0.05em;
  --tracking-widest: 0.18em;     /* eyebrow uppercase */

  /* Line-height */
  --leading-tight:   1.05;       /* H1 hero */
  --leading-snug:    1.18;       /* H2/H3 */
  --leading-normal:  1.5;        /* body */
  --leading-loose:   1.7;        /* párrafos largos */

  /* ── Spacing (4pt grid) ───────────────────────────────────── */
  --s-1:   4px;
  --s-2:   8px;
  --s-3:   12px;
  --s-4:   16px;
  --s-5:   24px;
  --s-6:   32px;
  --s-7:   48px;
  --s-8:   64px;
  --s-9:   96px;
  --s-10:  144px;
  --s-11:  192px;

  /* ── Border radius ───────────────────────────────────────── */
  --radius-xs:   4px;
  --radius-sm:   8px;
  --radius-md:   12px;
  --radius-lg:   16px;
  --radius-xl:   24px;
  --radius-2xl:  32px;
  --radius-full: 9999px;

  /* ── Shadows (3 niveles + tinte verde-grisáceo, no negro) ── */
  --shadow-xs:  0 1px 2px rgba(15, 30, 46, 0.04);
  --shadow-sm:  0 1px 2px rgba(15, 30, 46, 0.05), 0 1px 1px rgba(15, 30, 46, 0.03);
  --shadow-md:  0 4px 6px rgba(15, 30, 46, 0.07), 0 2px 4px rgba(15, 30, 46, 0.05);
  --shadow-lg:  0 12px 24px rgba(15, 30, 46, 0.08), 0 4px 8px rgba(15, 30, 46, 0.04);
  --shadow-xl:  0 24px 48px rgba(15, 30, 46, 0.10), 0 8px 16px rgba(15, 30, 46, 0.05);
  --shadow-glow-accent: 0 0 0 4px rgba(39, 174, 96, 0.12);
  --shadow-glow-brand:  0 0 0 4px rgba(26, 60, 94, 0.12);

  /* ── Motion ──────────────────────────────────────────────── */
  --motion-instant: 100ms;
  --motion-micro:   200ms;       /* hover */
  --motion-enter:   400ms;       /* entrada componentes */
  --motion-exit:    300ms;
  --motion-count:   800ms;       /* count-up cifras */
  --easing:         cubic-bezier(0.33, 1, 0.68, 1);   /* easeOutCubic */
  --easing-out:     cubic-bezier(0.16, 1, 0.3, 1);    /* easeOutExpo */
  --easing-bounce:  cubic-bezier(0.68, -0.55, 0.265, 1.55);
  --stagger:        70ms;

  /* ── Container marketing ─────────────────────────────────── */
  --container:      1280px;
  --container-pad:  24px;

  /* ── Focus ring ──────────────────────────────────────────── */
  --ring:           0 0 0 3px rgba(39, 174, 96, 0.35);
  --ring-brand:     0 0 0 3px rgba(26, 60, 94, 0.30);
}

/* ── Dark theme ─────────────────────────────────────────────── */
:root[data-theme="dark"] {
  --bg:           #0B1622;
  --bg-elev:      #122236;
  --bg-muted:     #16273E;
  --bg-inset:     #0A1320;
  --ink:          #F2EFE5;
  --ink-2:        #C8CEDA;
  --ink-3:        #8A98AD;
  --ink-4:        #5C6C82;
  --line:         rgba(255, 255, 255, 0.08);
  --line-2:       rgba(255, 255, 255, 0.14);

  --brand:        #5891C7;          /* azul más brillante en dark */
  --brand-ink:    #0B1622;
  --brand-hover:  #6BA1D8;
  --brand-soft:   rgba(88, 145, 199, 0.12);

  --accent:       #34CE73;          /* verde más brillante */
  --accent-ink:   #0B1622;
  --accent-hover: #45D982;
  --accent-soft:  rgba(52, 206, 115, 0.14);
  --accent-700:   #45D982;

  --warn-soft:    rgba(230, 126, 34, 0.14);
  --danger-soft:  rgba(231, 76, 60, 0.14);

  --shadow-sm:  0 1px 2px rgba(0, 0, 0, 0.30);
  --shadow-md:  0 6px 12px rgba(0, 0, 0, 0.40), 0 2px 4px rgba(0, 0, 0, 0.30);
  --shadow-lg:  0 16px 32px rgba(0, 0, 0, 0.50), 0 4px 8px rgba(0, 0, 0, 0.35);
  --shadow-xl:  0 32px 64px rgba(0, 0, 0, 0.55), 0 8px 16px rgba(0, 0, 0, 0.40);
}

/* ── Reset mínimo ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  /* MAY29_B B4 — guard anti scroll-horizontal (overflow-x: clip NO crea scroll-container,
     preserva position:sticky del topnav, a diferencia de overflow-x: hidden). */
  overflow-x: clip;
  font-family: var(--font-sans);
  font-size: var(--text-md);
  line-height: var(--leading-normal);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: 'ss01', 'cv11';
  transition: background var(--motion-enter) var(--easing), color var(--motion-enter) var(--easing);
}
img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: none; padding: 0; }
input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4, h5, h6 { margin: 0; font-weight: 700; letter-spacing: var(--tracking-tight); text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }

::selection { background: var(--accent); color: var(--accent-ink); }

/* ── Type primitives ───────────────────────────────────────── */
.eyebrow {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: var(--ink-3);
  font-feature-settings: 'tnum';
}

.h-display {
  font-family: var(--font-sans);
  font-weight: 800;
  font-size: var(--text-4xl);
  line-height: var(--leading-tight);
  letter-spacing: -0.035em;
  color: var(--ink);
}

.serif-italic {
  font-family: var(--font-sans);
  font-style: normal;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.mono-num {
  font-family: var(--font-mono);
  font-feature-settings: 'tnum', 'zero';
  font-variant-numeric: tabular-nums;
}

/* ── Wordmark v3 canónico (IMPI — intocable) ───────────────── */
.fq-wordmark {
  font-family: var(--font-sans);
  font-weight: 800;
  letter-spacing: -0.04em;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--fq-azul);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
}
.fq-wordmark .fq-symbol { flex: 0 0 auto; }
.fq-wordmark .word { display: inline-flex; }
.fq-wordmark .word b { color: var(--fq-verde); font-weight: 800; }
:root[data-theme="dark"] .fq-wordmark { color: #FFFFFF; }

/* ── Focus universal ──────────────────────────────────────── */
:focus-visible {
  outline: none;
  box-shadow: var(--ring);
  border-radius: var(--radius-sm);
}
