/*
 * design-tokens.css — Sapiens.Guru
 * Sistema de diseño centralizado. Todos los .html importan este archivo.
 * Identidad de marca Sapiens (navy, amber, rose, blush) intacta.
 * Escala tipográfica, espaciado, radios y sombras: tomados del sistema DUPLA.
 *
 * USO: <link rel="stylesheet" href="/design-tokens.css">
 * después de /fonts/fonts.css y antes del <style> propio de cada página.
 */

:root {
  /* ── Paleta de marca ─────────────────────────────────────────────────── */
  --navy:    #1C1C19;   /* texto principal, CTA */
  --amber:   #B87333;   /* acento dorado */
  --rose:    #a03c51;   /* acento secundario */
  --blush:   #F5E8DE;   /* fondo cálido, sidebar */

  /* ── Fondos ──────────────────────────────────────────────────────────── */
  --bg:      #fdf9f5;   /* fondo base */
  --bgsf:    #f7f3ef;   /* fondo suave (expertos, etc.) */
  --bgcont:  #f1ede9;   /* contenedores sobre blush */
  --white:   #ffffff;

  /* ── Texto ───────────────────────────────────────────────────────────── */
  --soft:    #7e7570;   /* texto secundario */
  --muted:   #a89e98;   /* texto terciario / placeholders */

  /* ── Bordes y separadores ────────────────────────────────────────────── */
  --rule:    #E8DDD4;   /* borde suave */
  --rule-md: #DADADA;   /* borde medio */

  /* ── Fuentes ─────────────────────────────────────────────────────────── */
  --f-display: 'Cormorant Garamond', 'Libre Caslon Text', Georgia, serif;
  --f-body:    'DM Sans', system-ui, sans-serif;

  /* ── Escala tipográfica (px / line-height / letter-spacing) ──────────── */
  --text-display:   clamp(32px, 5vw, 54px);
  --lh-display:     1.1;

  --text-h1:        clamp(26px, 3.5vw, 40px);
  --lh-h1:          1.15;

  --text-h2:        clamp(20px, 2.5vw, 28px);
  --lh-h2:          1.25;

  --text-h3:        clamp(16px, 1.8vw, 20px);
  --lh-h3:          1.35;

  --text-body-lg:   18px;
  --lh-body-lg:     1.65;

  --text-body:      16px;   /* mínimo absoluto para body */
  --lh-body:        1.6;

  --text-body-sm:   14px;
  --lh-body-sm:     1.55;

  --text-caption:   12px;
  --lh-caption:     1.45;

  --text-label:     11px;
  --ls-label:       0.08em;

  /* ── Espaciado (scale 4px) ────────────────────────────────────────────── */
  --sp-2xs:  4px;
  --sp-xs:   8px;
  --sp-sm:   12px;
  --sp-md:   16px;
  --sp-lg:   24px;
  --sp-xl:   32px;
  --sp-2xl:  48px;
  --sp-3xl:  64px;
  --sp-4xl:  96px;

  /* ── Radio de esquinas ───────────────────────────────────────────────── */
  --r-sm:    6px;
  --r-md:    10px;
  --r-lg:    14px;
  --r-xl:    20px;
  --r-2xl:   28px;
  --r-full:  9999px;

  /* ── Sombras ─────────────────────────────────────────────────────────── */
  --shadow-xs:  0 1px 2px rgba(28, 28, 25, 0.04);
  --shadow-sm:  0 2px 6px rgba(28, 28, 25, 0.06);
  --shadow-md:  0 6px 18px rgba(28, 28, 25, 0.08);
  --shadow-lg:  0 12px 32px rgba(28, 28, 25, 0.10);
  --shadow-amber: 0 0 32px rgba(184, 115, 51, 0.15);

  /* ── Transiciones ────────────────────────────────────────────────────── */
  --ease-out:    cubic-bezier(0.23, 1, 0.32, 1);
  --ease-io:     cubic-bezier(0.77, 0, 0.175, 1);
  --t-fast:      120ms;
  --t-base:      200ms;
  --t-slow:      350ms;

  /* ── Layout ──────────────────────────────────────────────────────────── */
  --container:   1100px;
  --container-lg: 1260px;
  --nav-h:       64px;
  --sidebar-w:   280px;
  --gutter:      28px;
  --gutter-sm:   16px;
}

/* ── Reset mínimo compartido ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--f-body);
  font-size: var(--text-body);
  line-height: var(--lh-body);
  background: var(--bg);
  color: var(--navy);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
img  { display: block; max-width: 100%; }
a    { text-decoration: none; color: inherit; }
button { font-family: var(--f-body); }

/* ── Foco visible ────────────────────────────────────────────────────────── */
*:focus-visible {
  outline: 2px solid var(--rose);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ── Componentes: botones ────────────────────────────────────────────────── */

/* Base — todo botón o enlace-como-botón */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-xs);
  padding: 11px 24px;
  border-radius: var(--r-full);
  border: none;
  font-family: var(--f-body);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: opacity var(--t-fast) ease-out,
              transform var(--t-fast) var(--ease-out);
}
.btn:hover  { opacity: .88; }
.btn:active { transform: scale(.97); }
.btn:disabled,
.btn[disabled] { opacity: .4; cursor: not-allowed; pointer-events: none; }

/* Primario — fondo navy, texto blanco */
.btn-primary {
  background: var(--navy);
  color: #fff;
}
.btn-primary:hover { background: rgba(28,28,25,.84); opacity: 1; }

/* Ghost — contorno navy, transparente */
.btn-ghost {
  background: transparent;
  color: var(--navy);
  border: 1.5px solid var(--rule);
}
.btn-ghost:hover { background: var(--blush); opacity: 1; }

/* Pequeño — mismo look, menos padding */
.btn-sm {
  padding: 8px 18px;
  font-size: 11px;
  letter-spacing: 0.1em;
}

/* Ancho completo */
.btn-block {
  display: flex;
  width: 100%;
}

/* ── Alias de botón (nombres históricos del proyecto) ───────────────────── */
/* Permiten eliminar CSS duplicado de cada <style> de página. */

.nav-cta,
.topnav-btn,
.sb-ai-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-xs);
  padding: 10px 22px;
  border-radius: var(--r-full);
  border: none;
  background: var(--navy);
  color: #fff;
  font-family: var(--f-body);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
  transition: opacity var(--t-fast) ease-out,
              transform var(--t-fast) var(--ease-out);
}
.nav-cta:hover,
.topnav-btn:hover,
.sb-ai-btn:hover  { opacity: .88; }
.nav-cta:active,
.topnav-btn:active,
.sb-ai-btn:active { transform: scale(.97); }

/* nav-cta en landing y expertos usa tamaño algo mayor */
.nav-cta { padding: 10px 24px; font-size: 14px; }

/* ── Componentes: tarjetas ───────────────────────────────────────────────── */

/* Plana — solo borde, sin sombra */
.card {
  background: #fff;
  border: 1.5px solid var(--rule);
  border-radius: var(--r-lg);
  overflow: hidden;
}

/* Con sombra leve (contenido secundario) */
.card-raised {
  background: #fff;
  border: 1.5px solid var(--rule);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

/* Con sombra media (modal, panel flotante) */
.card-elevated {
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

/* ── Componentes: inputs ─────────────────────────────────────────────────── */
.input {
  width: 100%;
  padding: 13px 16px;
  border: 1.5px solid var(--rule);
  border-radius: var(--r-md);
  font-family: var(--f-body);
  font-size: var(--text-body-sm);
  color: var(--navy);
  background: var(--bg);
  outline: none;
  transition: border-color var(--t-base) ease-out;
}
.input:focus { border-color: var(--amber); }
.input::placeholder { color: var(--muted); }

/* ── Clases de utilidad compartidas ─────────────────────────────────────── */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.container-lg {
  max-width: var(--container-lg);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* Texto con gradiente amber→rose (usado en headings de impacto) */
.grad-text {
  background: linear-gradient(135deg, var(--amber), var(--rose));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Seguridad Safe Area para iOS */
.pb-safe { padding-bottom: env(safe-area-inset-bottom, 0px); }
.pt-safe { padding-top: env(safe-area-inset-top, 0px); }

/* ——— Bottom Navigation (páginas autenticadas, solo mobile) ——— */
.bottom-nav {
  display: none; /* desktop: oculta */
}
@media (max-width: 768px) {
  /* Ocultar la sidebar horizontal en mobile cuando hay bottom-nav */
  .has-bottom-nav .sidebar {
    display: none !important;
  }
  /* Compensar el espacio que ocupaba la sidebar-top */
  .has-bottom-nav .main {
    padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px));
  }

  .bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: #fff;
    border-top: 1.5px solid var(--rule);
    height: calc(60px + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    /* NO backdrop-filter — Safari iOS flicker */
  }

  .bn-item {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    text-decoration: none;
    color: var(--soft);
    font-family: var(--f-body);
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.03em;
    padding: 8px 4px;
    transition: color var(--t-fast) ease-out;
    -webkit-tap-highlight-color: transparent;
  }

  .bn-item:active {
    opacity: 0.7;
  }

  .bn-item .bn-icon {
    font-size: 22px;
    line-height: 1;
    transition: color var(--t-fast) ease-out;
  }

  .bn-item.active {
    color: var(--navy);
  }

  .bn-item.active .bn-icon {
    /* Filled weight via font-variation-settings */
    font-variation-settings: 'FILL' 1, 'wght' 500, 'GRAD' 0, 'opsz' 24;
  }
}

/* Colores semánticos de estado */
:root {
  --success: #2e7d32;
  --success-bg: #edf7ed;
  --error: #c0392b;
  --error-bg: #fdf0f0;
  --warning: #856404;
  --warning-bg: #fff3cd;
}

/* Ocultar scrollbar (vistas de chat, listas) */
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }
.no-scrollbar::-webkit-scrollbar { display: none; }
