/* ArgentoBot: sitio público. Tokens de docs/guia-visual.md (HSL sin envoltorio).
   Sin recursos externos ni estilos en línea (CSP estricta). JavaScript propio y externo: ayuda.js, landing.js y contacto.js. */

@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("fonts/plus-jakarta-sans-latin-wght-normal.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light dark;
  /* Marca: el celeste de la bandera (#74ACDF). Misma escala que la consola (web/src/app/globals.css). */
  --brand: 206 63% 66%;
  --background: 210 30% 97.5%;
  --foreground: 215 20% 9%;
  --card: 0 0% 100%;
  --primary: 206 80% 37%;
  --primary-foreground: 0 0% 100%;
  --primary-text: 206 85% 34%;
  --muted: 210 16% 93%;
  --muted-foreground: 210 10% 38%;
  --accent: 210 18% 94%;
  --border: 210 16% 89%;
  --input: 210 10% 50%;
  --ring: 206 80% 37%;
  --status-warning: 32 95% 26%;
  --warning-bg: 40 100% 94%;
  --radius: 0.625rem;
  --elev-card: 0 1px 2px hsl(215 20% 20% / 0.06), 0 6px 20px -6px hsl(215 20% 20% / 0.1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --background: 213 31% 7%;
    --foreground: 210 15% 95%;
    --card: 210 14% 11%;
    --primary: 206 63% 66%;
    --primary-foreground: 213 31% 7%;
    --primary-text: 206 85% 72%;
    --muted: 210 12% 15%;
    --muted-foreground: 210 8% 66%;
    --accent: 210 12% 18%;
    --border: 210 12% 20%;
    --input: 210 8% 44%;
    --ring: 206 70% 68%;
    --status-warning: 40 95% 62%;
    --warning-bg: 40 40% 14%;
    --elev-card: 0 0 0 1px hsl(0 0% 100% / 0.04), 0 8px 24px -8px hsl(0 0% 0% / 0.6);
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overflow-x: clip;
  scroll-padding-top: 5rem; /* la cabecera es fija */
}

body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  font-family: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 1rem;
  line-height: 1.65;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}

:focus-visible {
  outline: 2px solid hsl(var(--ring));
  outline-offset: 2px;
}

a, button { touch-action: manipulation; }

a { color: hsl(var(--primary-text)); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }

h1, h2, h3 { line-height: 1.25; text-wrap: balance; margin: 0 0 0.75rem; font-weight: 700; }
h1 { font-size: clamp(1.75rem, 1.2rem + 2.4vw, 2.75rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.25rem, 1.05rem + 0.9vw, 1.625rem); margin-top: 2.5rem; }
h3 { font-size: 1.0625rem; margin-top: 1.5rem; }
p, ul, ol, dl { margin: 0 0 1rem; }
ul, ol { padding-left: 1.4rem; }
li { margin-bottom: 0.4rem; }

.skip {
  position: absolute;
  left: 0.75rem;
  top: -4rem;
  background: hsl(var(--card));
  color: hsl(var(--primary-text));
  padding: 0.6rem 1rem;
  border-radius: var(--radius);
  box-shadow: var(--elev-card);
  z-index: 10;
}
.skip:focus { top: 0.75rem; }

.wrap { width: 100%; max-width: 72rem; margin-inline: auto; padding-inline: 1rem; }
@media (min-width: 768px) { .wrap { padding-inline: 1.5rem; } }
.prose { max-width: 46rem; }

/* Encabezado */
.site-header { position: sticky; top: 0; z-index: 20; border-bottom: 1px solid hsl(var(--border)); background: hsl(var(--card)); }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1.5rem; padding-block: 0.75rem; }
.brand { display: inline-flex; align-items: center; gap: 0.6rem; font-weight: 800; font-size: 1.125rem; color: hsl(var(--foreground)); text-decoration: none; min-height: 2.75rem; }
.brand img { display: block; width: auto; height: 1.75rem; } /* logo horizontal de la marca: 120 px de ancho como mínimo */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.nav ul { display: flex; flex-wrap: wrap; gap: 0.25rem 0.25rem; list-style: none; margin: 0; padding: 0; }
.nav li { margin: 0; }
.nav a { display: inline-flex; align-items: center; min-height: 2.75rem; padding: 0 0.75rem; border-radius: var(--radius); color: hsl(var(--foreground)); text-decoration: none; font-size: 0.9375rem; font-weight: 500; }
.nav a:hover { background: hsl(var(--accent)); }
.nav a[aria-current="page"] { color: hsl(var(--primary-text)); font-weight: 700; }
@media (min-width: 768px) { .nav a { min-height: 2rem; } }
/* Celular: marca y menú en una sola fila, para que la cabecera fija no tape media pantalla */
@media (max-width: 479px) {
  .site-header .wrap { flex-wrap: nowrap; gap: 0.5rem; padding-block: 0.35rem; }
  .nav ul { flex-wrap: nowrap; gap: 0; }
  .nav a { padding: 0 0.5rem; font-size: 0.875rem; }
}
@media (max-width: 359px) {
  .brand img { height: 1.5rem; }
  .nav a { padding: 0 0.35rem; font-size: 0.8125rem; }
}

main { flex: 1; padding-block: 2rem 4rem; }

/* Botones: un solo primario por pantalla */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 2.75rem; padding: 0 1.25rem; border-radius: calc(var(--radius) - 2px); border: 1px solid transparent; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.btn-primary { background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); }
.btn-primary:hover { filter: brightness(0.93); }
.btn-outline { background: transparent; color: hsl(var(--foreground)); border-color: hsl(var(--input)); }
.btn-outline:hover { background: hsl(var(--accent)); }
@media (min-width: 768px) { .btn { min-height: 2.25rem; } }

/* Portada */
.hero { padding-block: 1.5rem 1rem; }
.hero .lead { font-size: clamp(1.0625rem, 1rem + 0.4vw, 1.25rem); color: hsl(var(--muted-foreground)); max-width: 40rem; }
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.5rem; }

.grid { display: grid; gap: 0.75rem; grid-template-columns: 1fr; margin-bottom: 1rem; }
@media (min-width: 768px) { .grid { gap: 1rem; } .grid.cols-3 { grid-template-columns: repeat(3, 1fr); } .grid.cols-2 { grid-template-columns: repeat(2, 1fr); } }
.card { background: hsl(var(--card)); border-radius: calc(var(--radius) + 4px); box-shadow: var(--elev-card); padding: 1rem; }
@media (min-width: 768px) { .card { padding: 1.5rem; } }
.card h3 { margin-top: 0; }
.card p:last-child, .card ul:last-child { margin-bottom: 0; }

.steps { list-style: none; counter-reset: paso; padding: 0; }
.steps li { counter-increment: paso; position: relative; padding-left: 2.75rem; margin-bottom: 1rem; }
.steps li::before { content: counter(paso); position: absolute; left: 0; top: 0; width: 2rem; height: 2rem; border-radius: 999px; background: hsl(var(--muted)); color: hsl(var(--foreground)); font-weight: 700; display: grid; place-items: center; }

/* Marcadores a completar: visibles a propósito */
mark.pendiente { background: hsl(var(--warning-bg)); color: hsl(var(--status-warning)); padding: 0.05rem 0.35rem; border-radius: 0.3rem; border: 1px dashed hsl(var(--status-warning)); font-weight: 600; }

.aviso { border-left: 4px solid hsl(var(--status-warning)); background: hsl(var(--warning-bg)); padding: 0.75rem 1rem; border-radius: 0 var(--radius) var(--radius) 0; margin-bottom: 1.5rem; }
.aviso p:last-child { margin-bottom: 0; }

.meta { color: hsl(var(--muted-foreground)); font-size: 0.875rem; }

.toc { background: hsl(var(--card)); border-radius: var(--radius); box-shadow: var(--elev-card); padding: 1rem 1.25rem; margin-bottom: 2rem; }
.toc h2 { font-size: 1rem; margin: 0 0 0.5rem; }
.toc ol { margin: 0; columns: 1; }
@media (min-width: 768px) { .toc ol { columns: 2; } }

.table-wrap { margin-bottom: 1rem; }
table { border-collapse: collapse; width: 100%; overflow-wrap: anywhere; background: hsl(var(--card)); font-size: 0.875rem; }
th, td { text-align: left; vertical-align: top; padding: 0.6rem 0.5rem; border-bottom: 1px solid hsl(var(--border)); }
th { font-weight: 700; background: hsl(var(--muted)); }
caption { text-align: left; font-weight: 600; padding: 0 0 0.5rem; }

/* Ayuda */
[hidden] { display: none !important; }
.volver { margin-bottom: 1rem; font-size: 0.9375rem; }
.volver a { display: inline-flex; align-items: center; min-height: 2.75rem; }
@media (min-width: 768px) { .volver a { min-height: 2rem; } }

.buscador { max-width: 40rem; margin-top: 1.5rem; }
.buscador label { display: block; font-weight: 600; margin-bottom: 0.4rem; }
.buscador input { width: 100%; min-height: 2.75rem; padding: 0 0.9rem; font: inherit; color: hsl(var(--foreground)); background: hsl(var(--card)); border: 1px solid hsl(var(--input)); border-radius: calc(var(--radius) - 2px); }
.buscador input::placeholder { color: hsl(var(--muted-foreground)); opacity: 1; }
.buscador .meta { margin: 0.4rem 0 0; min-height: 1.5rem; }

.sin-resultados { background: hsl(var(--card)); border-radius: var(--radius); box-shadow: var(--elev-card); padding: 1rem 1.25rem; max-width: 40rem; }

.accesos { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: 0.75rem; grid-template-columns: 1fr; }
@media (min-width: 768px) { .accesos { gap: 1rem; grid-template-columns: repeat(3, 1fr); } }
.accesos li { margin: 0; display: flex; }
.acceso { display: flex; flex-direction: column; gap: 0.25rem; width: 100%; color: hsl(var(--foreground)); text-decoration: none; border: 1px solid transparent; }
.acceso strong { color: hsl(var(--primary-text)); font-size: 1.0625rem; }
.acceso span { color: hsl(var(--muted-foreground)); font-size: 0.9375rem; }
.acceso:hover { border-color: hsl(var(--input)); }
.acceso:hover strong { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }

.tema { margin-bottom: 1.5rem; max-width: 46rem; }
.tema h3 { margin-top: 1.5rem; }
details { background: hsl(var(--card)); border-radius: var(--radius); box-shadow: var(--elev-card); margin-bottom: 0.5rem; }
summary { cursor: pointer; padding: 0.75rem 1rem; min-height: 2.75rem; font-weight: 600; overflow-wrap: anywhere; }
summary:hover { background: hsl(var(--accent)); border-radius: var(--radius); }
details[open] > summary { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
details > :not(summary) { padding-inline: 1rem; }
details > p:last-child { margin-bottom: 0; padding-bottom: 1rem; }
details > summary + p { margin-top: 0.5rem; }

/* Formulario de contacto (contacto.js) */
.form-contacto { display: grid; gap: 1rem; }
.campo label { display: block; font-weight: 600; margin-bottom: 0.35rem; }
.campo input, .campo textarea { width: 100%; min-height: 2.75rem; padding: 0.6rem 0.9rem; font: inherit; color: hsl(var(--foreground)); background: hsl(var(--background)); border: 1px solid hsl(var(--input)); border-radius: calc(var(--radius) - 2px); }
.campo textarea { min-height: 8rem; resize: vertical; line-height: 1.5; }
.campo input[aria-invalid="true"], .campo textarea[aria-invalid="true"] { border: 2px solid hsl(var(--status-warning)); }
.error-campo { margin: 0.35rem 0 0; font-size: 0.875rem; font-weight: 600; color: hsl(var(--status-warning)); }
.estado-form { margin: 0; min-height: 1.5rem; font-weight: 600; }
.estado-form[data-tipo="error"] { color: hsl(var(--status-warning)); }
.estado-form[data-tipo="ok"] { color: hsl(var(--primary-text)); }
.form-contacto .btn { justify-self: start; }
.btn[disabled] { opacity: 0.6; cursor: progress; }
.privado { margin: 0; font-size: 0.875rem; color: hsl(var(--muted-foreground)); }
/* Campo trampa: fuera de pantalla (no display:none, que algunos bots detectan) */
.trampa { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Pie */
.site-footer { border-top: 1px solid hsl(var(--border)); background: hsl(var(--card)); padding-block: 1.5rem; font-size: 0.875rem; color: hsl(var(--muted-foreground)); }
.site-footer ul { list-style: none; display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; padding: 0; margin: 0 0 0.75rem; }
.site-footer li { margin: 0; }
.site-footer a { display: inline-flex; align-items: center; min-height: 2.25rem; }
.site-footer p { margin: 0 0 0.5rem; }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

/* Tablas apiladas en celular: cada fila es un bloque con sus etiquetas */
@media (max-width: 767px) {
  thead { position: absolute; left: -9999px; }
  caption { display: block; width: 100%; }
  table, tbody, tr, th, td { display: block; width: 100%; }
  tr { background: hsl(var(--card)); border-radius: var(--radius); box-shadow: var(--elev-card); margin-bottom: 0.75rem; padding: 0.5rem 0.25rem; }
  table { background: transparent; }
  tr th[scope="row"] { background: transparent; border-bottom: 0; padding-bottom: 0.25rem; font-size: 0.9375rem; }
  td { border-bottom: 0; padding-top: 0.15rem; padding-bottom: 0.25rem; }
  td::before { content: attr(data-label) ": "; font-weight: 700; }
}
