/* ============================================================
   FirmaDigitalMéxico · styles.css
   Mobile-first · sin frameworks · system fonts
   ============================================================ */

:root {
  --texto: #1a1a2e;
  --texto-suave: #4b4b63;
  --fondo: #ffffff;
  --fondo-suave: #f6f7f9;
  --borde: #e3e5ea;
  --acento: #0e9f6e;
  --acento-oscuro: #0a7f58;
  --ambar: #b45309; /* AA sobre blanco */
  --ambar-icono: #d97706;
  --rojo: #b91c1c;
  --radio: 10px;
  --sombra: 0 1px 3px rgba(26, 26, 46, 0.08);
  --fuente: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 4.5rem; /* compensar header fijo en anclas */
}

body {
  margin: 0;
  font-family: var(--fuente);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--texto);
  background: var(--fondo);
  -webkit-font-smoothing: antialiased;
}

img,
svg {
  max-width: 100%;
}

.contenedor {
  width: min(100% - 2.5rem, 72rem);
  margin-inline: auto;
}

h1,
h2,
h3,
h4 {
  line-height: 1.25;
  margin: 0 0 0.6em;
}

h1 {
  font-size: clamp(1.75rem, 4.5vw, 2.75rem);
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(1.4rem, 3vw, 2rem);
  letter-spacing: -0.01em;
}

h3 {
  font-size: 1.15rem;
}

p {
  margin: 0 0 1em;
}

a {
  color: var(--acento-oscuro);
}

a:hover {
  color: var(--acento);
}

:focus-visible {
  outline: 3px solid var(--acento);
  outline-offset: 2px;
  border-radius: 3px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--acento-oscuro);
  color: #fff;
  padding: 0.6rem 1rem;
  z-index: 100;
}

.skip-link:focus {
  left: 0.5rem;
  top: 0.5rem;
  color: #fff;
}

.seccion-intro {
  color: var(--texto-suave);
  max-width: 46rem;
  margin-bottom: 1.5rem;
}

/* ---------- Marcador [VERIFICAR] ---------- */
.verificar {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ambar);
  background: #fef3e2;
  border: 1px dashed #e8b26b;
  border-radius: 5px;
  padding: 0.1rem 0.4rem;
  white-space: nowrap;
}

/* ---------- Iconos ---------- */
.ico {
  width: 1em;
  height: 1em;
  vertical-align: -0.12em;
  flex-shrink: 0;
}

.si .ico-check {
  color: var(--acento);
  width: 1.15em;
  height: 1.15em;
}

.no .ico-cruz {
  color: var(--rojo);
  width: 1.05em;
  height: 1.05em;
}

.score {
  display: inline-flex;
  align-items: baseline;
  gap: 0.25rem;
  font-variant-numeric: tabular-nums;
}

.score .ico-estrella {
  color: var(--ambar-icono);
  align-self: center;
}

.score-num {
  font-weight: 700;
}

.score-de {
  color: var(--texto-suave);
  font-size: 0.8em;
}

/* Texto con matiz en columnas sí/no ("Vía integración", "Consultar") */
.bool-texto {
  font-size: 0.85em;
  color: var(--texto-suave);
  font-weight: 600;
}

/* ============================================================
   Header
   ============================================================ */
.header {
  position: fixed;
  inset: 0 0 auto 0;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--borde);
  z-index: 50;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 3.75rem;
  flex-wrap: wrap;
}

.logo {
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  color: var(--texto);
  text-decoration: none;
}

.logo span {
  color: var(--acento);
}

.menu-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid var(--borde);
  border-radius: 8px;
  padding: 0.45rem;
  color: var(--texto);
  cursor: pointer;
}

.nav {
  display: none;
  width: 100%;
  flex-direction: column;
  gap: 0.25rem;
  padding-bottom: 0.75rem;
}

.nav.abierto {
  display: flex;
}

.nav a {
  text-decoration: none;
  color: var(--texto);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.5rem 0.25rem;
  border-radius: 6px;
}

.nav a:hover {
  color: var(--acento-oscuro);
}

@media (min-width: 768px) {
  .menu-btn {
    display: none;
  }

  .nav {
    display: flex;
    flex-direction: row;
    width: auto;
    gap: 1.5rem;
    padding-bottom: 0;
  }
}

/* ============================================================
   Hero
   ============================================================ */
.hero {
  padding: 7rem 0 3.5rem;
  background: linear-gradient(180deg, #f2faf7 0%, var(--fondo) 100%);
}

.hero-kicker {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--acento-oscuro);
  margin-bottom: 0.75rem;
}

.hero-sub {
  font-size: 1.1rem;
  color: var(--texto-suave);
  max-width: 44rem;
  margin-bottom: 1.75rem;
}

.btn-primario {
  display: inline-block;
  background: var(--acento);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  padding: 0.8rem 1.6rem;
  border-radius: 8px;
  box-shadow: var(--sombra);
  transition: background 0.15s ease;
}

.btn-primario:hover,
.btn-primario:focus-visible {
  background: var(--acento-oscuro);
  color: #fff;
}

/* ============================================================
   Resumen rápido
   ============================================================ */
.resumen {
  padding: 3rem 0;
}

.resumen-grid {
  display: grid;
  gap: 1rem;
}

.card-resumen {
  background: var(--fondo-suave);
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  padding: 1.25rem 1.4rem;
}

.card-resumen-etiqueta {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--acento-oscuro);
  margin-bottom: 0.35rem;
}

.card-resumen-ganador {
  font-size: 1.3rem;
  font-weight: 800;
  margin-bottom: 0.35rem;
}

.card-resumen-ganador a {
  color: var(--texto);
  text-decoration: none;
  border-bottom: 2px solid var(--acento);
}

.card-resumen-ganador a:hover {
  color: var(--acento-oscuro);
}

.card-resumen-nota {
  font-size: 0.9rem;
  color: var(--texto-suave);
  margin: 0;
}

@media (min-width: 768px) {
  .resumen-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ============================================================
   Tabla comparativa
   ============================================================ */
.comparativa {
  padding: 3rem 0;
}

.tabla-scroll {
  display: none;
  overflow-x: auto;
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  box-shadow: var(--sombra);
  max-height: 80vh;
  overflow-y: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  min-width: 56rem;
}

thead th {
  position: sticky;
  top: 0;
  background: var(--fondo-suave);
  border-bottom: 2px solid var(--borde);
  text-align: left;
  padding: 0;
  z-index: 2;
}

.btn-orden {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  width: 100%;
  background: none;
  border: 0;
  font: inherit;
  font-weight: 700;
  color: var(--texto);
  padding: 0.75rem 0.9rem;
  cursor: pointer;
  text-align: left;
}

.btn-orden:hover {
  color: var(--acento-oscuro);
}

.ico-orden {
  width: 0.6rem;
  height: 0.8rem;
  color: #b9bcc7;
}

th.orden-asc .flecha-up,
th.orden-desc .flecha-down {
  color: var(--acento);
  fill: var(--acento);
}

th.orden-asc .ico-orden .flecha-down,
th.orden-desc .ico-orden .flecha-up {
  opacity: 0.35;
}

tbody th,
tbody td {
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid var(--borde);
  text-align: left;
  vertical-align: middle;
}

tbody tr:last-child th,
tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover {
  background: #fafbfc;
}

tbody th {
  font-weight: 700;
  white-space: nowrap;
}

.link-fila {
  color: var(--texto);
  text-decoration: none;
  border-bottom: 1px dotted var(--acento);
}

.link-fila:hover {
  color: var(--acento-oscuro);
}

/* Tarjetas apiladas (móvil) */
.tarjetas-movil {
  display: grid;
  gap: 1rem;
}

.tarjeta-movil {
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  padding: 1.1rem 1.25rem;
  box-shadow: var(--sombra);
}

.tarjeta-movil-titulo {
  margin-bottom: 0.75rem;
}

.tarjeta-movil-titulo a {
  color: var(--texto);
  text-decoration: none;
  border-bottom: 1px dotted var(--acento);
}

.tarjeta-movil-datos {
  margin: 0;
  display: grid;
  gap: 0.45rem;
}

.tarjeta-movil-datos > div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  border-bottom: 1px dashed var(--borde);
  padding-bottom: 0.4rem;
}

.tarjeta-movil-datos > div:last-child {
  border-bottom: 0;
}

.tarjeta-movil-datos dt {
  font-size: 0.85rem;
  color: var(--texto-suave);
  font-weight: 600;
}

.tarjeta-movil-datos dd {
  margin: 0;
  text-align: right;
}

@media (min-width: 768px) {
  .tabla-scroll {
    display: block;
  }

  .tarjetas-movil {
    display: none;
  }
}

.nota-tabla {
  font-size: 0.82rem;
  color: var(--texto-suave);
  margin-top: 1rem;
  max-width: 60rem;
}

.nota-noscript {
  background: var(--fondo-suave);
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  padding: 1rem 1.25rem;
}

/* ============================================================
   Análisis individual
   ============================================================ */
.analisis {
  padding: 3rem 0;
  background: var(--fondo-suave);
}

.card-analisis {
  background: var(--fondo);
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  margin-bottom: 0.75rem;
  box-shadow: var(--sombra);
  overflow: hidden;
}

.card-analisis-titulo {
  margin: 0;
  font-size: 1.05rem;
}

.acordeon-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  background: none;
  border: 0;
  font: inherit;
  font-weight: 700;
  color: var(--texto);
  padding: 1rem 1.25rem;
  cursor: pointer;
  text-align: left;
}

.acordeon-btn:hover {
  color: var(--acento-oscuro);
}

.ico-chevron {
  width: 1.1rem;
  height: 1.1rem;
  color: var(--texto-suave);
  transition: transform 0.2s ease;
}

.acordeon-btn[aria-expanded="true"] .ico-chevron {
  transform: rotate(180deg);
}

.acordeon-panel {
  padding: 0 1.25rem 1.25rem;
}

.analisis-cols {
  display: grid;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.analisis-cols h4 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--texto-suave);
  margin-bottom: 0.4rem;
}

.lista-check,
.lista-cruz {
  list-style: none;
  margin: 0;
  padding: 0;
}

.lista-check li,
.lista-cruz li {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  margin-bottom: 0.4rem;
  font-size: 0.95rem;
}

.lista-check .ico-check {
  color: var(--acento);
  margin-top: 0.25rem;
}

.lista-cruz .ico-cruz {
  color: var(--rojo);
  margin-top: 0.3rem;
}

.ideal-para {
  background: #f2faf7;
  border-left: 3px solid var(--acento);
  border-radius: 0 6px 6px 0;
  padding: 0.6rem 0.9rem;
  font-size: 0.95rem;
}

.enlace-oficial {
  font-weight: 700;
}

@media (min-width: 768px) {
  .analisis-cols {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }
}

/* ============================================================
   Metodología y sección educativa
   ============================================================ */
.metodologia,
.educativa {
  padding: 3rem 0;
}

.metodologia-grid,
.educativa-grid {
  display: grid;
  gap: 1.25rem;
}

.metodologia-grid article,
.educativa-grid article {
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  padding: 1.25rem 1.4rem;
  box-shadow: var(--sombra);
}

.metodologia-grid h3,
.educativa-grid h3 {
  color: var(--acento-oscuro);
}

.metodologia-grid p,
.educativa-grid p {
  margin: 0;
  color: var(--texto-suave);
  font-size: 0.97rem;
}

@media (min-width: 768px) {
  .metodologia-grid,
  .educativa-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.metodologia-nota {
  margin-top: 1.5rem;
  border: 1px solid var(--borde);
  border-left: 3px solid var(--acento);
  border-radius: var(--radio);
  padding: 1.25rem 1.4rem;
  background: var(--fondo-suave);
}

.metodologia-nota p {
  color: var(--texto-suave);
  font-size: 0.97rem;
}

.metodologia-fuentes {
  margin-bottom: 0;
  font-size: 0.85rem;
}

/* ============================================================
   FAQ
   ============================================================ */
.faq {
  padding: 3rem 0 4rem;
  background: var(--fondo-suave);
}

.faq-item {
  background: var(--fondo);
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  margin-bottom: 0.75rem;
  box-shadow: var(--sombra);
}

.faq-item h3 {
  margin: 0;
  font-size: 1rem;
}

.faq-item .acordeon-panel p {
  margin: 0;
  color: var(--texto-suave);
}

/* ============================================================
   Footer
   ============================================================ */
.footer {
  border-top: 1px solid var(--borde);
  padding: 2.5rem 0;
  font-size: 0.9rem;
  color: var(--texto-suave);
}

.footer a {
  color: var(--acento-oscuro);
}

.footer-copy {
  margin-top: 1.5rem;
  margin-bottom: 0;
}

/* ============================================================
   Preferencias del usuario
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .ico-chevron {
    transition: none;
  }
}
