/* Portada de JAMC (jamc-erp.com) y páginas legales. Mismos colores que el portal y el panel; claro y oscuro según el sistema. */
:root {
  --fondo: #f4f6f9;
  --superficie: #ffffff;
  --superficie-2: #f0f3f7;
  --borde: #dde3ea;
  --texto: #18202b;
  --tenue: #5d6876;
  --primario: #1f5fbf;
  --primario-texto: #ffffff;
  --primario-suave: #e5eefb;
  --verde: #12703c;
  --verde-suave: #e3f4ea;
  --gris: #5d6876;
  --gris-suave: #eceff3;
  --sombra: 0 1px 2px rgba(16, 24, 40, 0.06), 0 1px 3px rgba(16, 24, 40, 0.08);
  --radio: 12px;
  --ancho: 1080px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --fondo: #0f141a;
    --superficie: #171e26;
    --superficie-2: #1e2731;
    --borde: #2c3845;
    --texto: #e6ebf1;
    --tenue: #9aa6b4;
    --primario: #5b9bff;
    --primario-texto: #0b1220;
    --primario-suave: #1a2c47;
    --verde: #5fd394;
    --verde-suave: #16301f;
    --gris: #9aa6b4;
    --gris-suave: #232c36;
    --sombra: 0 1px 2px rgba(0, 0, 0, 0.4);
    color-scheme: dark;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 4.5rem;
}
@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}
body {
  margin: 0;
  background: var(--fondo);
  color: var(--texto);
  font: 16px/1.55 system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
main {
  flex: 1;
}
h1,
h2,
h3 {
  line-height: 1.25;
  margin: 0 0 0.6rem;
  text-wrap: balance;
}
p {
  margin: 0 0 0.75rem;
}
a {
  color: var(--primario);
  text-underline-offset: 2px;
}
a:focus-visible,
.btn:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--primario);
  outline-offset: 2px;
}
.tenue {
  color: var(--tenue);
}
.saltar {
  position: absolute;
  left: -9999px;
  top: 0.5rem;
  z-index: 10;
  padding: 0.5rem 0.9rem;
  border-radius: 8px;
  background: var(--superficie);
  box-shadow: var(--sombra);
}
.saltar:focus {
  left: 0.5rem;
}

/* ---------- Botones ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 44px;
  padding: 0.5rem 1.1rem;
  border: 1px solid var(--borde);
  border-radius: 8px;
  background: var(--superficie);
  color: var(--texto);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}
.btn:hover {
  background: var(--superficie-2);
}
.btn-primario {
  background: var(--primario);
  border-color: var(--primario);
  color: var(--primario-texto);
}
.btn-primario:hover {
  background: var(--primario);
  filter: brightness(1.08);
}
.btn-chico {
  min-height: 36px;
  padding: 0.3rem 0.8rem;
  font-size: 0.92rem;
}
.acciones {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
}

/* ---------- Barra superior ---------- */
.barra {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.6rem max(1rem, calc((100% - var(--ancho)) / 2));
  background: var(--superficie);
  border-bottom: 1px solid var(--borde);
}
.marca {
  text-decoration: none;
  color: var(--texto);
}
.marca-logo {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 7px;
  background: var(--primario);
  color: var(--primario-texto);
  font-weight: 800;
  letter-spacing: 0.06em;
}
.nav {
  display: flex;
  align-items: center;
  gap: 0.3rem 1.1rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.nav a:not(.btn) {
  color: var(--tenue);
  text-decoration: none;
  font-weight: 550;
}
.nav a:not(.btn):hover,
.nav a[aria-current='page'] {
  color: var(--texto);
}
.nav a[aria-current='page'] {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
}
@media (max-width: 560px) {
  .nav a[href='/terminos'],
  .nav a[href='/privacidad'] {
    display: none;
  }
}

/* ---------- Secciones de la portada ---------- */
.seccion {
  padding: 3rem max(1rem, calc((100% - var(--ancho)) / 2));
}
.seccion-alterna {
  background: var(--superficie);
  border-block: 1px solid var(--borde);
}
.seccion > h2 {
  font-size: 1.6rem;
}
.seccion > .intro {
  color: var(--tenue);
  max-width: 62ch;
  margin-bottom: 1.6rem;
}
.portada-hero {
  padding-top: 4rem;
  padding-bottom: 3.5rem;
}
.portada-hero h1 {
  font-size: clamp(1.9rem, 5vw, 2.9rem);
  max-width: 20ch;
  letter-spacing: -0.01em;
}
.portada-hero .lema {
  font-size: 1.15rem;
  color: var(--tenue);
  max-width: 54ch;
  margin-bottom: 1.6rem;
}
.rejilla {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.tarjeta {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 1.35rem;
  background: var(--superficie);
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  box-shadow: var(--sombra);
}
.seccion-alterna .tarjeta {
  background: var(--fondo);
  box-shadow: none;
}
.tarjeta h3 {
  font-size: 1.15rem;
  margin: 0;
}
.tarjeta p {
  margin: 0;
  color: var(--tenue);
}
.tarjeta ul {
  margin: 0.3rem 0 0.6rem;
  padding-left: 1.2rem;
  color: var(--tenue);
}
.tarjeta li + li {
  margin-top: 0.2rem;
}
.tarjeta .acciones {
  margin-top: auto;
  padding-top: 0.6rem;
}
.tarjeta-cabeza {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}
.tarjeta-apagada h3 {
  color: var(--tenue);
}
.insignia {
  display: inline-block;
  padding: 0.12rem 0.6rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 650;
  background: var(--gris-suave);
  color: var(--gris);
  white-space: nowrap;
}
.insignia-verde {
  background: var(--verde-suave);
  color: var(--verde);
}
.icono-tarjeta {
  width: 40px;
  height: 40px;
  padding: 8px;
  border-radius: 10px;
  background: var(--primario-suave);
  color: var(--primario);
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  margin-bottom: 0.3rem;
}
.requisitos {
  margin: 0;
  padding-left: 1.2rem;
  max-width: 62ch;
}
.requisitos li + li {
  margin-top: 0.35rem;
}
.contacto {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  align-items: start;
}
.contacto .tarjeta strong {
  color: var(--texto);
}

/* ---------- Pie ---------- */
.pie {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding: 1.4rem max(1rem, calc((100% - var(--ancho)) / 2));
  border-top: 1px solid var(--borde);
  background: var(--superficie);
  color: var(--tenue);
  font-size: 0.9rem;
}
.pie p {
  margin: 0;
}
.pie a {
  color: var(--tenue);
}
.pie a:hover {
  color: var(--texto);
}

/* ---------- Páginas legales ---------- */
.legal {
  padding: 2rem max(1rem, calc((100% - var(--ancho)) / 2)) 3rem;
}
.legal-cabecera {
  margin-bottom: 1.5rem;
}
.legal-cabecera h1 {
  font-size: clamp(1.6rem, 4vw, 2.2rem);
}
.legal-cuerpo {
  display: grid;
  gap: 2rem;
  grid-template-columns: 1fr;
}
@media (min-width: 900px) {
  .legal-cuerpo {
    grid-template-columns: 250px minmax(0, 1fr);
  }
  .indice {
    position: sticky;
    top: 4.5rem;
    align-self: start;
    max-height: calc(100vh - 6rem);
    overflow: auto;
  }
}
.indice details {
  background: var(--superficie);
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  padding: 0.7rem 0.9rem;
}
.indice summary {
  font-weight: 650;
  cursor: pointer;
}
.indice ol {
  list-style: none;
  margin: 0.6rem 0 0;
  padding: 0;
  font-size: 0.9rem;
}
.indice li + li {
  margin-top: 0.35rem;
}
.indice a {
  color: var(--tenue);
  text-decoration: none;
}
.indice a:hover {
  color: var(--primario);
  text-decoration: underline;
}
.texto-legal {
  max-width: 74ch;
  min-width: 0;
}
.texto-legal h2 {
  font-size: 1.3rem;
  margin-top: 2.2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--borde);
}
.texto-legal h2:first-child {
  margin-top: 0;
}
.texto-legal h3 {
  font-size: 1.05rem;
  margin-top: 1.5rem;
}
.texto-legal ul,
.texto-legal ol {
  padding-left: 1.4rem;
  margin: 0 0 0.9rem;
}
.texto-legal li + li {
  margin-top: 0.3rem;
}
.texto-legal .clausula .num {
  font-weight: 700;
}
.texto-legal code {
  font-family: ui-monospace, 'Cascadia Mono', Consolas, 'SF Mono', Menlo, monospace;
  font-size: 0.9em;
  padding: 0.05rem 0.3rem;
  border-radius: 5px;
  background: var(--superficie-2);
  overflow-wrap: anywhere;
}
.texto-legal a {
  overflow-wrap: anywhere;
}
.tabla {
  overflow-x: auto;
  margin: 0 0 1rem;
  border: 1px solid var(--borde);
  border-radius: 10px;
  background: var(--superficie);
}
.tabla table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.93rem;
}
.tabla th,
.tabla td {
  text-align: left;
  vertical-align: top;
  padding: 0.6rem 0.8rem;
  border-bottom: 1px solid var(--borde);
}
.tabla th {
  background: var(--superficie-2);
  font-weight: 650;
}
.tabla tr:last-child td {
  border-bottom: 0;
}
.ficha {
  margin: 0 0 1rem;
  border: 1px solid var(--borde);
  border-radius: 10px;
  background: var(--superficie);
}
.ficha > div {
  display: grid;
  grid-template-columns: minmax(9rem, 34%) 1fr;
  gap: 0.2rem 1rem;
  padding: 0.6rem 0.8rem;
  border-bottom: 1px solid var(--borde);
}
.ficha > div:last-child {
  border-bottom: 0;
}
.ficha dt {
  font-weight: 650;
}
.ficha dd {
  margin: 0;
  overflow-wrap: anywhere;
}
@media (max-width: 520px) {
  .ficha > div {
    grid-template-columns: 1fr;
  }
}

/* ---------- Página no encontrada ---------- */
.no-encontrada {
  text-align: center;
  padding-top: 5rem;
}

/* ---------- Impresión (Imprimir o guardar en PDF) ---------- */
@media print {
  :root {
    --fondo: #fff;
    --superficie: #fff;
    --superficie-2: #f2f2f2;
    --borde: #bbb;
    --texto: #000;
    --tenue: #333;
    --primario: #000;
    color-scheme: light;
  }
  body {
    font-size: 11pt;
    display: block;
  }
  .barra,
  .pie,
  .indice,
  .solo-pantalla,
  .saltar {
    display: none !important;
  }
  .legal {
    padding: 0;
  }
  .legal-cuerpo {
    display: block;
  }
  .texto-legal {
    max-width: none;
  }
  .texto-legal h2 {
    break-after: avoid;
    border-top: 0;
  }
  .texto-legal h3 {
    break-after: avoid;
  }
  .tabla,
  .ficha,
  .ficha > div,
  tr {
    break-inside: avoid;
  }
  .tabla {
    overflow: visible;
  }
  a {
    color: inherit;
  }
}
.acciones.centradas {
  justify-content: center;
}
