/* nv-tokens.css — NormaViva design tokens + canonical components
   2026-05-26 baseline. Founder may re-skin "theme" later by swapping
   the hex values in :root; consumers should always reference var(--nv-*). */

:root {
  /* Palette */
  --nv-primary: #0f2147;
  --nv-primary-hover: #0a1733;
  --nv-primary-soft: #e0e7ff;
  --nv-accent: #3b82f6;
  --nv-accent-hover: #2563eb;
  --nv-accent-soft: #dbeafe;
  --nv-success: #059669;
  --nv-success-soft: #d1fae5;
  --nv-warning: #d97706;
  --nv-warning-soft: #fef3c7;
  --nv-danger: #dc2626;
  --nv-danger-soft: #fee2e2;

  /* Text */
  --nv-text: #0f172a;
  --nv-text-muted: #475569;
  --nv-text-soft: #64748b;
  --nv-text-faint: #94a3b8;

  /* Surfaces */
  --nv-bg: #fafbfc;
  --nv-bg-elevated: #ffffff;
  --nv-bg-subtle: #f1f5f9;
  --nv-border: #e2e8f0;
  --nv-border-strong: #cbd5e1;

  /* Typography */
  --nv-font-display: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --nv-font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --nv-font-mono: "SF Mono", "Consolas", "Monaco", monospace;

  /* Sizes (rem-based, root = 16px) */
  --nv-h1: 2rem;        /* 32px */
  --nv-h2: 1.375rem;    /* 22px */
  --nv-h3: 1.0625rem;   /* 17px */
  --nv-body: 0.9375rem; /* 15px */
  --nv-small: 0.8125rem; /* 13px */
  --nv-xs: 0.6875rem;   /* 11px */

  /* Spacing */
  --nv-s1: 4px;
  --nv-s2: 8px;
  --nv-s3: 12px;
  --nv-s4: 16px;
  --nv-s5: 24px;
  --nv-s6: 32px;
  --nv-s7: 48px;
  --nv-s8: 64px;

  /* Radius */
  --nv-r-sm: 6px;
  --nv-r-md: 8px;
  --nv-r-lg: 12px;
  --nv-r-xl: 16px;
  --nv-r-pill: 9999px;

  /* Shadows */
  --nv-shadow-xs: 0 1px 2px rgba(15, 33, 71, 0.04);
  --nv-shadow-sm: 0 2px 4px rgba(15, 33, 71, 0.06);
  --nv-shadow-md: 0 4px 12px rgba(15, 33, 71, 0.08);
  --nv-shadow-lg: 0 12px 32px rgba(15, 33, 71, 0.12);
  --nv-shadow-focus: 0 0 0 3px rgba(59, 130, 246, 0.2);

  /* Transitions */
  --nv-t-fast: 0.15s ease;
  --nv-t-smooth: 0.25s ease;
}

@media (max-width: 700px) {
  :root {
    --nv-h1: 1.625rem;  /* 26px on mobile */
    --nv-h2: 1.25rem;   /* 20px */
  }
}

/* ============================================================
   CANONICAL COMPONENTS (.nv-*)
   Use these for any new surface. Existing surfaces piggy-back on
   the tokens via their own class names — see surface CSS files.
   ============================================================ */

/* === BUTTONS === */
.nv-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--nv-s2);
  padding: 10px 18px;
  font: 500 var(--nv-body)/1.2 var(--nv-font-body);
  border-radius: var(--nv-r-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background var(--nv-t-fast), transform var(--nv-t-fast), box-shadow var(--nv-t-fast);
  text-decoration: none;
  white-space: nowrap;
}
.nv-btn:focus-visible { outline: none; box-shadow: var(--nv-shadow-focus); }
.nv-btn--primary {
  background: var(--nv-primary);
  color: #fff;
  box-shadow: var(--nv-shadow-sm);
}
.nv-btn--primary:hover { background: var(--nv-primary-hover); transform: translateY(-1px); box-shadow: var(--nv-shadow-md); }
.nv-btn--primary:active { transform: translateY(0); }
.nv-btn--secondary {
  background: var(--nv-bg-elevated);
  color: var(--nv-text);
  border-color: var(--nv-border-strong);
}
.nv-btn--secondary:hover { background: var(--nv-bg-subtle); border-color: var(--nv-text-muted); }
.nv-btn--accent {
  background: var(--nv-accent);
  color: #fff;
}
.nv-btn--accent:hover { background: var(--nv-accent-hover); }
.nv-btn--ghost {
  background: transparent;
  color: var(--nv-text-muted);
  padding: 8px 12px;
}
.nv-btn--ghost:hover { background: var(--nv-bg-subtle); color: var(--nv-text); }
.nv-btn--lg { padding: 14px 24px; font-size: 1rem; }
.nv-btn .price-inline {
  font-weight: 400;
  font-size: var(--nv-small);
  opacity: 0.85;
  margin-left: var(--nv-s2);
  padding-left: var(--nv-s2);
  border-left: 1px solid rgba(255,255,255,0.25);
}

/* === CARDS === */
.nv-card {
  background: var(--nv-bg-elevated);
  border: 1px solid var(--nv-border);
  border-radius: var(--nv-r-lg);
  padding: var(--nv-s5);
  transition: border-color var(--nv-t-smooth), box-shadow var(--nv-t-smooth), transform var(--nv-t-smooth);
}
.nv-card--clickable {
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: block;
}
.nv-card--clickable:hover {
  border-color: var(--nv-primary);
  box-shadow: var(--nv-shadow-md);
  transform: translateY(-2px);
}
.nv-card .card-icon { font-size: 1.75rem; margin-bottom: var(--nv-s3); display: block; }
.nv-card .card-title { font: 600 var(--nv-h3)/1.3 var(--nv-font-display); color: var(--nv-text); margin: 0 0 var(--nv-s2); }
.nv-card .card-desc { font: 400 var(--nv-body)/1.5 var(--nv-font-body); color: var(--nv-text-soft); margin: 0 0 var(--nv-s3); }
.nv-card .card-meta { font: 500 var(--nv-small)/1.4 var(--nv-font-body); color: var(--nv-text-muted); }
.nv-card .card-cta { display: inline-flex; align-items: center; gap: var(--nv-s1); margin-top: var(--nv-s3); font: 600 var(--nv-small)/1 var(--nv-font-body); color: var(--nv-accent); }

/* === BADGES === */
.nv-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  font: 600 var(--nv-xs)/1.5 var(--nv-font-display);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: var(--nv-r-pill);
}
.nv-badge--beta { background: var(--nv-warning-soft); color: var(--nv-warning); }
.nv-badge--new { background: var(--nv-success-soft); color: var(--nv-success); }
.nv-badge--premium { background: var(--nv-primary-soft); color: var(--nv-primary); }
.nv-badge--neutral { background: var(--nv-bg-subtle); color: var(--nv-text-muted); }

/* === INPUTS === */
.nv-input {
  width: 100%;
  padding: 12px 14px;
  font: 400 var(--nv-body)/1.4 var(--nv-font-body);
  color: var(--nv-text);
  background: var(--nv-bg-elevated);
  border: 1px solid var(--nv-border-strong);
  border-radius: var(--nv-r-md);
  transition: border-color var(--nv-t-fast), box-shadow var(--nv-t-fast);
}
.nv-input:focus { outline: none; border-color: var(--nv-accent); box-shadow: var(--nv-shadow-focus); }
.nv-input::placeholder { color: var(--nv-text-faint); }

/* === SECTION TITLES === */
.nv-section-label {
  font: 600 var(--nv-xs)/1.4 var(--nv-font-display);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--nv-text-muted);
  margin: 0 0 var(--nv-s3);
}

/* === HERO === */
.nv-hero {
  padding: var(--nv-s7) 0 var(--nv-s5);
  text-align: left;
}
.nv-hero h1 {
  font: 700 var(--nv-h1)/1.15 var(--nv-font-display);
  color: var(--nv-text);
  margin: 0 0 var(--nv-s3);
  letter-spacing: -0.02em;
}
.nv-hero .hero-lead {
  font: 400 1.0625rem/1.55 var(--nv-font-body);
  color: var(--nv-text-soft);
  max-width: 620px;
  margin: 0 0 var(--nv-s5);
}
.nv-hero .hero-actions { display: flex; gap: var(--nv-s3); flex-wrap: wrap; }

/* === RESPONSIVE WRAPPERS === */
.nv-container { max-width: 1080px; margin: 0 auto; padding: 0 var(--nv-s4); }
.nv-container--narrow { max-width: 760px; }

/* ═══ V2 PATCH (Propuesta Visual designer 2026-05-26) ═══ */
/* ════════════════════════════════════════════════════════════════════
   nv-tokens.css · v2 patch
   Propuesta visual · Asistentes Expertos + Encarga Estudios
   --------------------------------------------------------------------
   Drop-in reemplazo de las variables en /assets/nv-tokens.css.
   Mantiene aliases backward-compat con --nv-* para no romper CSS legacy
   del resto del sitio (Oficio & Circular, /calculadoras, /fallos).

   Cambios críticos (breaking visual, no breaking código):
     1. --nv-accent: #3b82f6 → #8a6c2a (oro cálido)
     2. --nv-bg:     #fafbfc → #fbfaf7 (paper warm)
     3. Body font:   system-ui → Inter (unifica)
   El resto es ADD (ramps completas + nuevos tokens) sin destruir.
   ════════════════════════════════════════════════════════════════════ */

:root {
  /* ── navy ramp (11 pasos · primary) ───────────────────────── */
  --navy-50:  #f4f7fc;
  --navy-100: #e8eef8;
  --navy-200: #d0ddf0;
  --navy-300: #a3bbe6;
  --navy-400: #6b8fd9;
  --navy-500: #3d6ac9;
  --navy-600: #2a4f9e;
  --navy-700: #1d3878;
  --navy-800: #15295a;
  --navy-900: #0f2147;  /* primary brand · sin cambio */
  --navy-950: #0a1834;
  --nv-primary: var(--navy-900); /* alias backward-compat */

  /* ── accent · CAMBIO: oro cálido (era #3b82f6 azul) ──────── */
  --accent:        #8a6c2a;
  --accent-700:    #6f5520;  /* hover, inline link */
  --accent-soft:   #f1ebde;  /* pill bg */
  --accent-border: #d8c89a;  /* pill border */
  --nv-accent:      var(--accent);       /* backward-compat */
  --nv-accent-soft: var(--accent-soft);  /* backward-compat */

  /* ── ink ramp (11 pasos · neutros cool) ──────────────────── */
  --ink-50:   #f6f7fa;
  --ink-100:  #ecedf2;
  --ink-200:  #dee1e8;
  --ink-300:  #c0c5cf;
  --ink-400:  #9aa1ae;
  --ink-500:  #6b7280;
  --ink-600:  #565c6a;
  --ink-700:  #3a3f4b;
  --ink-800:  #232730;
  --ink-900:  #16181d;
  --ink-950:  #0c0d10;

  /* aliases backward-compat de text */
  --nv-text:        var(--ink-900);
  --nv-text-muted:  var(--ink-600);
  --nv-text-soft:   var(--ink-500);
  --nv-text-faint:  var(--ink-400);

  /* ── surfaces · paper warm ─────────────────────────────── */
  --paper:           #fbfaf7;
  --white:           #ffffff;
  --nv-bg:           var(--paper);       /* CAMBIO: era #fafbfc */
  --nv-bg-elevated:  var(--white);
  --nv-bg-subtle:    var(--ink-50);
  --nv-border:       var(--ink-200);
  --nv-border-strong:var(--ink-300);

  /* alias semánticos */
  --bg:            var(--paper);
  --surface:       var(--white);
  --surface-alt:   var(--ink-50);
  --border:        var(--ink-200);
  --border-strong: var(--ink-300);

  /* ── status colors (refinados · institucional) ──────────── */
  --verde-700: #256449;
  --verde:     #2f7a55;
  --verde-soft:#e6f0eb;
  --ambar-700: #a36d10;
  --ambar:     #c98a17;
  --ambar-soft:#faf1de;
  --rojo-700:  #9a2f2f;
  --rojo:      #b53a3a;
  --rojo-soft: #f6e7e7;
  --gris-700:  #4a5160;
  --gris:      #6b7280;
  --gris-soft: #ecedf2;
  /* aliases backward-compat */
  --nv-success: var(--verde);
  --nv-warning: var(--ambar);
  --nv-danger:  var(--rojo);

  /* ── focus & shadows ─────────────────────────────────────── */
  --focus-ring:    var(--navy-600);
  --focus-shadow:  0 0 0 3px var(--navy-100);
  --shadow-xs: 0 1px 1px rgba(15,33,71,.04);
  --shadow-sm: 0 1px 2px rgba(15,33,71,.04), 0 1px 1px rgba(15,33,71,.03);
  --shadow-md: 0 2px 4px rgba(15,33,71,.06), 0 4px 12px rgba(15,33,71,.05);
  --shadow-lg: 0 8px 24px rgba(15,33,71,.08), 0 2px 6px rgba(15,33,71,.04);

  /* ── typography ──────────────────────────────────────────── */
  --font-sans:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;
  --font-serif: "Source Serif 4", "Source Serif Pro", Georgia, "Times New Roman", serif;
  --font-mono:  "JetBrains Mono", "SF Mono", Consolas, "Liberation Mono", monospace;

  /* size scale · sin cambio · documentado para referencia */
  --fs-display: 44px;
  --fs-h1:      32px;
  --fs-h2:      22px;
  --fs-h3:      17px;
  --fs-body:    15px;
  --fs-small:   13px;
  --fs-xs:      11px;
  /* mobile (≤700px) */
  --fs-h1-m: 26px;
  --fs-h2-m: 20px;
  --fs-h3-m: 16px;

  /* ── spacing 4·8·12·16·24·32·48·64 (sin cambio) ─────────── */
  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px;
  --sp-5: 24px; --sp-6: 32px; --sp-7: 48px; --sp-8: 64px;

  /* ── radii ────────────────────────────────────────────────── */
  --r-sm: 4px; --r-md: 6px; --r-lg: 8px; --r-xl: 12px; --r-pill: 9999px;

  /* ── motion ──────────────────────────────────────────────── */
  --dur-fast:  120ms;
  --dur-base:  180ms;
  --ease-out:  cubic-bezier(.2,.8,.2,1);
}

/* ════════════════════════════════════════════════════════════════════
   Cambios de comportamiento (5 reglas que se sobreescriben)
   ──────────────────────────────────────────────────────────────────── */

/* 1. body unifica a Inter (era system-ui) */
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--ink-900);
}

/* 2. .nv-card hover · sin translate · sólo border + shadow */
.nv-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-sm);
  transition: border-color var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-fast) var(--ease-out);
}
.nv-card:hover,
.nv-card.--clickable:hover {
  border-color: var(--navy-300);
  box-shadow: var(--shadow-md);
  transform: none; /* explicit override */
}

/* 3. .nv-btn--primary hover · sin translate · darken bg */
.nv-btn--primary {
  background: var(--navy-900);
  color: var(--white);
  border: 1px solid var(--navy-900);
  transition: background var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-fast) var(--ease-out);
}
.nv-btn--primary:hover {
  background: var(--navy-800);
  border-color: var(--navy-800);
  transform: none;
}
.nv-btn--primary:focus-visible {
  outline: none;
  box-shadow: var(--focus-shadow);
}
.nv-btn--primary:active {
  background: var(--navy-950);
}

/* 4. .nv-btn--lg + .price-inline (CTA "Encargar estudio · $17.850") */
.nv-btn--lg {
  padding: 12px 22px;
  font-size: 14.5px;
  border-radius: var(--r-md);
}
.nv-btn--lg .price-inline {
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  padding-left: 10px;
  margin-left: 10px;
  border-left: 1px solid rgba(255, 255, 255, 0.25);
  opacity: 0.92;
}
.nv-btn--secondary .price-inline,
.nv-btn--ghost .price-inline {
  border-left-color: rgba(15, 33, 71, 0.18);
}

/* 5. .nv-wizard-stepper · variante bar (nueva · reemplaza círculos) */
.nv-wizard-stepper {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: var(--sp-5);
}
.nv-wizard-stepper__bar {
  display: flex;
  gap: 6px;
}
.nv-wizard-stepper__seg {
  height: 3px;
  flex: 1;
  border-radius: 2px;
  background: var(--ink-200);
  transition: background var(--dur-fast);
}
.nv-wizard-stepper__seg.is-done,
.nv-wizard-stepper__seg.is-current {
  background: var(--navy-900);
}
.nv-wizard-stepper__labels {
  display: flex;
  justify-content: space-between;
  font-size: var(--fs-xs);
  color: var(--ink-500);
}
.nv-wizard-stepper__labels span.is-current {
  color: var(--ink-900);
  font-weight: 600;
}
.nv-wizard-stepper__meta {
  font-size: var(--fs-xs);
  color: var(--ink-600);
}
.nv-wizard-stepper__meta strong {
  color: var(--ink-900);
  font-weight: 600;
}
@media (max-width: 700px) {
  .nv-wizard-stepper__labels { display: none; }
}

/* ════════════════════════════════════════════════════════════════════
   Lifecycle badges para Encarga Estudios (5 estados)
   Útiles en /mis-estudios y en email status updates.
   ──────────────────────────────────────────────────────────────────── */
.nv-badge--lifecycle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: var(--r-pill);
  font-family: var(--font-sans);
}
.nv-badge--lifecycle::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  display: inline-block;
}
.nv-badge--queued   { background: var(--gris-soft);  color: var(--ink-700);    }
.nv-badge--queued::before   { background: var(--ink-500); }
.nv-badge--running  { background: var(--navy-100);   color: var(--navy-700);   }
.nv-badge--running::before  { background: var(--navy-600); }
.nv-badge--review   { background: var(--ambar-soft); color: var(--ambar-700);  }
.nv-badge--review::before   { background: var(--ambar); }
.nv-badge--ready    { background: var(--verde-soft); color: var(--verde-700);  }
.nv-badge--ready::before    { background: var(--verde); }
.nv-badge--delivered{ background: var(--white); border: 1px solid var(--navy-900); color: var(--navy-900); padding: 1px 7px; }
.nv-badge--delivered::before{ background: var(--navy-900); }

/* ════════════════════════════════════════════════════════════════════
   Dark mode · Phase 2 · descomenta cuando decidas shipear
   ──────────────────────────────────────────────────────────────────── */
/*
@media (prefers-color-scheme: dark) {
  :root {
    --bg:            #0a1228;
    --surface:       #0f1a36;
    --surface-alt:   #15234a;
    --border:        #1d2f5f;
    --border-strong: #2a4179;
    --ink-900: #eef0f7;
    --ink-800: #d8dde8;
    --ink-700: #c4cad8;
    --ink-600: #9ba8c2;
    --ink-500: #6b7d9e;
    --accent:     #c89a52;
    --accent-700: #d8af65;
    --accent-soft: rgba(200,154,82,.12);
    --focus-shadow: 0 0 0 3px rgba(61,106,201,.35);
  }
  body { color: var(--ink-800); }
}
*/
