/* ==========================================================================
   nexo. — sistema base
   Lima + negro del logotipo. Archivo en dos anchos: expandido para títulos
   (el mismo gesto ancho del logotipo) y normal para todo lo demás.
   ========================================================================== */

@font-face {
  font-family: "Archivo";
  src: url("/fonts/archivo-latin-standard-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Archivo";
  src: url("/fonts/archivo-latin-ext-standard-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+20A0-20AB, U+20AD-20C0,
    U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --lima: #c5ff00;
  --negro: #0a0a0a;
  /* Lima de marca con un degradado suave: más claro arriba a la izquierda,
     un tono más profundo abajo a la derecha. Para los bloques lima grandes. */
  --lima-degradado:
    radial-gradient(90% 70% at 0% 0%, #dcff5c 0%, rgba(220, 255, 92, 0) 70%),
    linear-gradient(160deg, #c5ff00 35%, #a9e400 100%);

  --fuente: "Archivo", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  /* Escala tipográfica (razón ≈ 1.25) */
  --t-xs: 0.8125rem;
  --t-sm: 0.9375rem;
  --t-md: 1.0625rem;
  --t-lg: 1.3125rem;
  --t-xl: 1.75rem;
  --t-2xl: clamp(2rem, 1.3rem + 2.6vw, 3rem);
  --t-3xl: clamp(2.375rem, 1.1rem + 5.4vw, 4.75rem);

  /* Radios: cada nivel de contenedor tiene el suyo */
  --r-ventana: 32px;
  --r-tarjeta: 24px;
  --r-interior: 14px;
  --r-pildora: 999px;

  --gutter: clamp(16px, 4vw, 40px);
  --ancho: 1200px;
  color-scheme: dark;
}

/* ----- Tema oscuro (por defecto) ----- */
:root,
:root[data-theme="dark"] {
  --pagina: #09090a;
  --ventana: #121213;
  --superficie: #19191b;
  --elevada: #222225;
  --linea: rgba(255, 255, 255, 0.08);
  --linea-fuerte: rgba(255, 255, 255, 0.18);
  --tinta: #f4f4f1;
  --tinta-2: #a9a9a5;
  --tinta-3: #73736f;
  --acento: var(--lima);
  --sobre-acento: var(--negro);
  --acento-texto: var(--lima);
  --foco: var(--lima);
  --resalte: rgba(197, 255, 0, 0.12);
  --brillo: rgba(197, 255, 0, 0.55);
  --sombra: 0 30px 80px -30px rgba(0, 0, 0, 0.9);
  --inverso: #f4f4f1;
  --sobre-inverso: #0a0a0a;
  color-scheme: dark;
}

/* ----- Tema claro ----- */
:root[data-theme="light"] {
  --pagina: #d8d9de;
  --ventana: #e8e9ed;
  --superficie: #f1f1f4;
  --elevada: #ffffff;
  --linea: rgba(12, 12, 16, 0.09);
  --linea-fuerte: rgba(12, 12, 16, 0.24);
  --tinta: #0f0f11;
  --tinta-2: #50515a;
  --tinta-3: #7d7e87;
  --acento: var(--lima);
  --sobre-acento: var(--negro);
  --acento-texto: #0f0f11; /* el lima no se lee como texto sobre claro */
  --foco: #0f0f11;
  --resalte: rgba(197, 255, 0, 0.5);
  --brillo: rgba(197, 255, 0, 0);
  --sombra: 0 30px 60px -34px rgba(40, 42, 60, 0.45);
  --inverso: #0f0f11;
  --sobre-inverso: #ffffff;
  color-scheme: light;
}

/* ----- Reinicio mínimo ----- */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
}
body {
  margin: 0;
  background: var(--pagina);
  color: var(--tinta);
  font-family: var(--fuente);
  font-size: var(--t-md);
  font-stretch: 100%;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
h1,
h2,
h3,
h4,
p,
ul,
ol,
dl,
dd,
figure {
  margin: 0;
}
ul,
ol {
  padding: 0;
  list-style: none;
}
a {
  color: inherit;
  text-decoration: none;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
}
svg {
  display: block;
  flex: none;
}
[hidden] {
  display: none !important;
}
code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.92em;
}
:focus-visible {
  outline: 2px solid var(--foco);
  outline-offset: 3px;
}
::selection {
  background: var(--lima);
  color: var(--negro);
}

.solo-lectores {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ----- Tipografía ----- */
.titulo {
  font-stretch: 125%;
  font-weight: 600;
  letter-spacing: -0.022em;
  line-height: 1.04;
  text-wrap: balance;
}
.titulo--3xl {
  font-size: var(--t-3xl);
  letter-spacing: -0.03em;
  line-height: 0.98;
}
.titulo--2xl {
  font-size: var(--t-2xl);
}
.titulo--xl {
  font-size: var(--t-xl);
  line-height: 1.12;
}
.titulo--lg {
  font-size: var(--t-lg);
  line-height: 1.2;
  letter-spacing: -0.012em;
}
.bajada {
  font-size: var(--t-lg);
  line-height: 1.45;
  color: var(--tinta-2);
  max-width: 34em;
  text-wrap: pretty;
}
.suave {
  color: var(--tinta-2);
}
.tenue {
  color: var(--tinta-3);
}
.chico {
  font-size: var(--t-sm);
}
.mini {
  font-size: var(--t-xs);
}
.cifras {
  font-variant-numeric: tabular-nums;
}

/* ----- Logotipo ----- */
.logo {
  display: inline-flex;
  align-items: center;
  color: var(--tinta);
}
.logo svg {
  height: 15px;
  width: auto;
}

/* ----- Iconos ----- */
.icono {
  width: 20px;
  height: 20px;
}
.icono--sm {
  width: 16px;
  height: 16px;
}
.icono--flecha {
  width: 22px;
  height: 11px;
}

/* ----- Botones ----- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 22px;
  border-radius: var(--r-pildora);
  font-size: var(--t-sm);
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  border: 1px solid transparent;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s, transform 0.15s;
}
.btn:active {
  transform: translateY(1px);
}
.btn--primario {
  background: var(--acento);
  color: var(--sobre-acento);
  box-shadow: 0 0 0 1px rgba(10, 10, 10, 0.12) inset, 0 10px 34px -14px var(--brillo);
}
.btn--primario:hover {
  background: #d4ff3d;
}
.btn--linea {
  border-color: var(--linea-fuerte);
  color: var(--tinta);
}
.btn--linea:hover {
  background: var(--elevada);
}
.btn--inverso {
  background: var(--negro);
  color: #fff;
}
.btn--inverso:hover {
  background: #262626;
}
.btn--sm {
  min-height: 38px;
  padding: 0 16px;
  font-size: var(--t-xs);
}
.btn--lg {
  min-height: 54px;
  padding: 0 28px;
  font-size: var(--t-md);
}
.btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}
.btn-icono {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--linea);
  background: var(--superficie);
  color: var(--tinta-2);
  transition: color 0.15s, background-color 0.15s;
}
.btn-icono:hover {
  color: var(--tinta);
  background: var(--elevada);
}

/* Interruptor de tema: muestra el icono del tema al que cambia */
.tema .icono--sol,
:root[data-theme="light"] .tema .icono--luna {
  display: block;
}
.tema .icono--luna,
:root[data-theme="light"] .tema .icono--sol {
  display: none;
}

/* ----- Etiquetas y fichas pequeñas ----- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 6px 14px;
  border-radius: var(--r-pildora);
  background: var(--elevada);
  border: 1px solid var(--linea);
  font-size: var(--t-xs);
  line-height: 1.25;
}
.chip b {
  font-weight: 500;
  color: var(--tinta-3);
}

/* Prioridad: se distingue por relleno y por texto, no solo por color */
.prioridad {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 28px;
  padding: 0 12px;
  border-radius: var(--r-pildora);
  font-size: var(--t-xs);
  font-weight: 600;
  white-space: nowrap;
  border: 1px solid transparent;
}
.prioridad::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}
.prioridad[data-nivel="alta"] {
  background: var(--acento);
  color: var(--sobre-acento);
}
.prioridad[data-nivel="media"] {
  border-color: var(--linea-fuerte);
  color: var(--tinta);
}
.prioridad[data-nivel="media"]::before {
  background: transparent;
  box-shadow: 0 0 0 1.5px currentColor inset;
}
.prioridad[data-nivel="baja"] {
  background: var(--elevada);
  border-color: var(--linea);
  color: var(--tinta-2);
}
.prioridad[data-nivel="baja"]::before {
  width: 8px;
  height: 1.5px;
  border-radius: 0;
}

/* Estado de cada dato: verificado · inferencia · no encontrado.
   Es la regla de Nexo: nunca se mezclan hechos con suposiciones. */
.estado {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex: none;
  vertical-align: baseline;
}
.estado[data-estado="verificado"] {
  background: var(--acento);
  box-shadow: 0 0 0 1px rgba(10, 10, 10, 0.35);
}
.estado[data-estado="inferencia"] {
  background: transparent;
  box-shadow: 0 0 0 1.5px var(--tinta-2) inset;
}
.estado[data-estado="no-encontrado"] {
  width: 10px;
  height: 1.5px;
  border-radius: 0;
  background: var(--tinta-3);
  vertical-align: middle;
}
.leyenda {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  font-size: var(--t-xs);
  color: var(--tinta-2);
}
.leyenda li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* ----- Campos de formulario ----- */
.campo {
  display: grid;
  gap: 8px;
  align-content: start;
}
.campo > label,
.campo > .campo__titulo {
  font-size: var(--t-sm);
  font-weight: 500;
}
.campo__ayuda {
  font-size: var(--t-xs);
  color: var(--tinta-2);
  line-height: 1.45;
}
.campo__opcional {
  font-weight: 400;
  color: var(--tinta-3);
}
.entrada {
  width: 100%;
  min-height: 50px;
  padding: 13px 16px;
  border-radius: var(--r-interior);
  border: 1px solid var(--linea-fuerte);
  background: var(--superficie);
  font-size: var(--t-md);
  line-height: 1.4;
  transition: border-color 0.15s, background-color 0.15s;
}
:root[data-theme="light"] .entrada {
  background: var(--elevada);
}
textarea.entrada {
  min-height: 132px;
  resize: vertical;
}
textarea.entrada[data-corto] {
  min-height: 96px;
}
.grupo {
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
}
.grupo > legend {
  padding: 0;
  margin-bottom: 10px;
}
.entrada::placeholder {
  color: var(--tinta-3);
}
.entrada:hover {
  border-color: var(--tinta-3);
}
.entrada:focus-visible {
  outline: 2px solid var(--foco);
  outline-offset: 1px;
  border-color: transparent;
}
.entrada[aria-invalid="true"] {
  border-color: #ff6b57;
}
.campo__error {
  font-size: var(--t-xs);
  color: #ff8a78;
  font-weight: 500;
}
:root[data-theme="light"] .campo__error {
  color: #b3261e;
}
:root[data-theme="light"] .entrada[aria-invalid="true"] {
  border-color: #b3261e;
}

/* Opciones tipo píldora (selección múltiple o única) */
.opciones {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.opcion {
  position: relative;
}
.opcion input {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
  cursor: pointer;
}
.opcion span {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 16px;
  border-radius: var(--r-pildora);
  border: 1px solid var(--linea-fuerte);
  font-size: var(--t-sm);
  color: var(--tinta-2);
  transition: background-color 0.12s, color 0.12s, border-color 0.12s;
}
.opcion input:hover + span {
  color: var(--tinta);
  border-color: var(--tinta-3);
}
.opcion input:checked + span {
  background: var(--acento);
  border-color: transparent;
  color: var(--sobre-acento);
  font-weight: 600;
  box-shadow: 0 0 0 1px rgba(10, 10, 10, 0.12) inset;
}
.opcion input:focus-visible + span {
  outline: 2px solid var(--foco);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
