/* Páginas legales, planes y 404 de Workbefy. Colores y tipografía de docs/05_DISENO.md.
   Cinco tamaños: título (h1), sección (h2), subtítulo (h3), cuerpo y pequeño. */
@font-face { font-family: Montserrat; font-weight: 500; font-display: swap; src: url("fonts/montserrat_medium.woff2") format("woff2"), url("fonts/montserrat_medium.ttf") format("truetype"); }
@font-face { font-family: Montserrat; font-weight: 700; font-display: swap; src: url("fonts/montserrat_bold.woff2") format("woff2"), url("fonts/montserrat_bold.ttf") format("truetype"); }
@font-face { font-family: Montserrat; font-weight: 800; font-display: swap; src: url("fonts/montserrat_extrabold.woff2") format("woff2"), url("fonts/montserrat_extrabold.ttf") format("truetype"); }

:root {
  --primary: #99c637;
  --primary-dark: #6f9a24;
  --primary-text: #3f6310;
  --accent: #f5e31f;
  --ink: #2c2b46;
  --muted: #4a505b;
  --border: #d9dce1;
  --divider: #e5e7eb;
  --surface: #ffffff;
  --background: #f7f8f5;
  --tint-green: #eaf4d6;
  --tint-yellow: #fbf6c8;

  --t-h1: clamp(2rem, 1.5rem + 2vw, 2.75rem);
  --t-h2: 1.375rem;
  --t-h3: 1.125rem;
  --t-body: 1rem;
  --t-small: .875rem;

  --radius: 16px;
  --width: 1120px;
  --measure: 720px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html:focus-within { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html:focus-within { scroll-behavior: auto; } }
body {
  margin: 0;
  font-family: Montserrat, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-weight: 500;
  font-size: var(--t-body);
  line-height: 1.65;
  color: var(--ink);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary-text); font-weight: 700; text-underline-offset: 3px; }
a:hover { color: var(--ink); }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; border-radius: 6px; }

.wrap { max-width: var(--width); margin: 0 auto; padding: 0 20px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 16px; background: var(--surface); padding: 8px 12px; z-index: 10; }

/* Encabezado: logo, las tres páginas de consulta y el idioma (visible también en el celular) */
.top { border-bottom: 1px solid var(--divider); background: var(--surface); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 72px; }
.brand { display: flex; align-items: center; min-height: 44px; text-decoration: none; }
.brand img { width: 56px; }
.nav { display: flex; align-items: center; gap: 8px 24px; }
.nav a { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 44px; color: var(--ink); text-decoration: none; font-size: var(--t-small); }
.nav a:hover { color: var(--primary-text); }
.nav a[aria-current="page"] { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; text-decoration-color: var(--primary); }
.nav .lang { border: 1.5px solid var(--border); border-radius: 999px; padding: 0 16px; }
.nav .lang:hover { border-color: var(--ink); color: var(--ink); }

@media (max-width: 640px) { .nav .hide-sm { display: none; } }

/* Botones: la misma píldora que en la portada */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 0 24px; border-radius: 999px;
  font-weight: 700; font-size: var(--t-body); text-decoration: none;
  background: var(--primary); color: var(--ink); border: 1.5px solid var(--primary);
}
/* el verde oscuro con texto ink no llega a AA: se aclara poco */
.btn:hover { background: #8bb72c; border-color: #8bb72c; color: var(--ink); }
.btn.secondary { background: var(--surface); border-color: var(--ink); }
.btn.secondary:hover { background: var(--ink); color: var(--surface); }

/* Pie */
footer { border-top: 1px solid var(--divider); padding: 24px 0; font-size: var(--t-small); color: var(--muted); }
footer .wrap { display: flex; justify-content: space-between; gap: 8px 24px; flex-wrap: wrap; align-items: center; }
footer nav { display: flex; gap: 0 24px; flex-wrap: wrap; }
footer a { color: var(--ink); display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 44px; }
footer a[aria-current="page"] { color: var(--primary-text); }

/* Texto legal: una columna de lectura de 60-75 caracteres */
.legal { max-width: calc(var(--measure) + 40px); margin: 0 auto; padding: 56px 20px 96px; }
.legal h1 { font-size: var(--t-h1); line-height: 1.1; font-weight: 800; letter-spacing: -0.02em; margin: 0 0 16px; text-wrap: balance; }
.legal h2 { font-size: var(--t-h2); line-height: 1.25; font-weight: 800; margin: 48px 0 12px; text-wrap: balance; scroll-margin-top: 24px; }
.legal h3 { font-size: var(--t-h3); line-height: 1.3; font-weight: 800; margin: 32px 0 8px; }
.legal p { margin: 0 0 16px; }
.legal ul, .legal ol { margin: 0 0 16px; padding-left: 24px; }
.legal li { margin-bottom: 8px; }
.legal li::marker { color: var(--primary-dark); }
.legal .updated { color: var(--muted); font-size: var(--t-small); margin-bottom: 32px; }
.legal .note { background: var(--tint-yellow); border-radius: var(--radius); padding: 16px 20px; margin: 24px 0; }
.legal .box { background: var(--background); border-radius: var(--radius); padding: 16px 20px; margin: 24px 0; }
.legal .note > :last-child, .legal .box > :last-child { margin-bottom: 0; }
/* Resumen en palabras sencillas al inicio de los términos */
.legal .summary { background: var(--tint-green); border-radius: var(--radius); padding: 8px 24px 16px; margin: 0 0 8px; }
.legal .summary h2 { margin-top: 16px; }
.legal table { width: 100%; border-collapse: collapse; margin: 16px 0 24px; }
.legal th, .legal td { text-align: left; padding: 12px 8px; border-bottom: 1px solid var(--divider); vertical-align: top; }
.legal th { font-weight: 800; }
.legal ol.steps li { margin-bottom: 8px; }
.legal .to-top { margin-top: 48px; font-size: var(--t-small); }
.legal .to-top a { display: inline-flex; align-items: center; min-height: 44px; }

/* Índice de las páginas largas: desplegable en el celular, columna fija al lado en pantallas anchas */
.toc { margin: 0 0 40px; border: 1.5px solid var(--border); border-radius: var(--radius); }
.toc summary { display: flex; align-items: center; justify-content: space-between; min-height: 52px; padding: 0 20px; font-weight: 800; cursor: pointer; list-style: none; }
.toc summary::-webkit-details-marker { display: none; }
.toc summary::after { content: "+"; font-size: var(--t-h2); line-height: 1; color: var(--primary-dark); }
.toc[open] summary::after { content: "\2212"; }
.toc ol { list-style: none; margin: 0; padding: 0 12px 12px; font-size: var(--t-small); line-height: 1.4; }
.toc li { margin: 0; }
.toc a { display: flex; align-items: center; min-height: 44px; padding: 4px 8px; border-radius: 8px; color: var(--ink); font-weight: 700; text-decoration: none; }
.toc a:hover { background: var(--background); color: var(--primary-text); }

@media (min-width: 1200px) {
  .legal.with-toc { max-width: var(--width); display: grid; grid-template-columns: 264px minmax(0, var(--measure)); column-gap: 64px; justify-content: center; }
  .legal.with-toc > * { grid-column: 2; }
  .legal.with-toc > .toc { grid-column: 1; grid-row: 1 / span 3; align-self: start; position: sticky; top: 24px; max-height: calc(100vh - 48px); overflow-y: auto; margin: 8px 0 0; border: 0; border-radius: 0; }
  .legal.with-toc > .toc::details-content { content-visibility: visible; display: block; }
  .legal.with-toc > .toc summary { min-height: 44px; padding: 0 8px; color: var(--muted); font-size: var(--t-small); }
  .legal.with-toc > .toc summary::after { content: none; }
  .legal.with-toc > .toc ol { padding: 0; }
  .legal.with-toc .to-top { display: none; }
}

/* 404 */
.not-found { min-height: calc(100svh - 160px); display: flex; flex-direction: column; justify-content: center; align-items: flex-start; }
.not-found img { width: 88px; margin-bottom: 32px; }
.not-found h1 { margin-bottom: 8px; }
.not-found .actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }

/* Oferta de lanzamiento: franja arriba de la barra. Oculta hasta que site.js la encienda. */
.promo { display: flex; align-items: center; gap: 8px; padding: 8px 16px; background: var(--ink); color: #ffffff; font-size: .875rem; line-height: 1.45; }
.promo[hidden] { display: none; }
.promo p { flex: 1; margin: 0; max-width: 75ch; }
.promo strong { color: var(--accent); }
.promo a { color: #ffffff; font-weight: 700; text-underline-offset: 3px; display: inline-flex; align-items: center; min-height: 44px; vertical-align: middle; }
.promo-x { flex: none; display: grid; place-items: center; width: 44px; height: 44px; margin-left: auto; border: 0; border-radius: 999px; background: transparent; color: #ffffff; cursor: pointer; }
.promo-x:hover { background: rgba(255, 255, 255, .12); }
.promo-x:focus-visible, .promo a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.promo-x svg { width: 20px; height: 20px; }
