/* =====================================================================
   3K AdoptaDog 2026 — Páginas legales (Constructor B)
   Requiere tokens.css antes. La sección BASE se copia de inscripcion.css
   (scratchpad/build_css.py) para que las subpágina no dependan de styles.css.
   ===================================================================== */

/* ---------- Íconos locales (máscaras) ---------- */
body {
  --ico-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E");
  --ico-alert: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7.5v5.5M12 16.5v.01'/%3E%3C/svg%3E");
  --ico-check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7.5'/%3E%3C/svg%3E");
  --ico-info: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 11v5.5M12 7.5v.01'/%3E%3C/svg%3E");
  --ico-wifi: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 8.8a15 15 0 0 1 20 0M5 12.4a10 10 0 0 1 14 0M8.5 15.9a5 5 0 0 1 7 0M12 19.5v.01'/%3E%3C/svg%3E");
}

/* =====================================================================
   BASE COMPARTIDA DE SUBPÁGINAS (misma en pago.css y legal.css)
   ===================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 16px; }
body {
  margin: 0; min-height: 100vh;
  font-family: var(--font-body); font-size: var(--step-0); line-height: var(--lh-body);
  color: var(--color-text); background: var(--color-bg);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
[hidden] { display: none !important; }
a { color: var(--color-link); text-underline-offset: .18em; text-decoration-thickness: 2px; }
a:hover { color: var(--color-link-hover); }
:focus-visible { outline: 3px solid var(--color-focus-light); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3 { font-family: var(--font-display); font-weight: var(--fw-display); line-height: var(--lh-heading); letter-spacing: var(--ls-heading); text-wrap: balance; margin: 0; }
p { text-wrap: pretty; }
.ico { width: 1.25em; height: 1.25em; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ico--inline { display: inline-block; vertical-align: -.2em; color: var(--c-red-500); }

.skip-link { position: absolute; left: 12px; top: -60px; z-index: var(--z-skip); background: var(--c-gold-500); color: var(--c-red-900); font-weight: 800; padding: 10px 16px; border-radius: var(--radius-pill); text-decoration: none; transition: top var(--dur-fast); }
.skip-link:focus { top: 12px; }

/* ---- Cabezal rojo con grano y ola ---- */
.sub-hero {
  position: relative; isolation: isolate; color: var(--color-text-on-brand);
  background: var(--grad-red-radial);
  padding: 0 var(--gutter) calc(var(--wave-h) + var(--space-3xl));
  overflow: hidden;
}
.sub-hero::before { /* grano */
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: var(--noise); opacity: .09; mix-blend-mode: overlay;
}
.sub-hero::after { /* ola crema */
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: var(--wave-h);
  background: var(--color-bg);
  -webkit-mask: var(--svg-wave) bottom / 100% 100% no-repeat; mask: var(--svg-wave) bottom / 100% 100% no-repeat;
}
.sub-hero__inner { position: relative; max-width: var(--container); margin: 0 auto; }
.sub-hero h1 { font-size: var(--step-5); }
.sub-hero h1 em { font-style: normal; color: var(--c-gold-300); }
.sub-hero__lead { font-size: var(--step-1); color: var(--color-text-on-brand-muted); margin: var(--space-xs) 0 0; max-width: 34ch; }
.sub-hero__snow { position: absolute; width: 28px; height: 28px; background: #fff; opacity: .2; -webkit-mask: var(--svg-snow) center/contain no-repeat; mask: var(--svg-snow) center/contain no-repeat; pointer-events: none; }

.sub-nav { display: flex; align-items: center; justify-content: space-between; gap: var(--space-s); max-width: var(--container); margin: 0 auto; min-height: var(--header-h); padding: var(--space-2xs) 0; }
.sub-nav__brand img { height: 52px; width: auto; filter: brightness(0) invert(1) drop-shadow(0 2px 6px rgba(74, 7, 17, .35)); transition: transform var(--dur-base) var(--ease-back); }
.sub-nav__brand:hover img { transform: rotate(-4deg) scale(1.04); }
.sub-nav__back {
  display: inline-flex; align-items: center; gap: .5em; min-height: 44px; padding: 0 1.1em;
  border-radius: var(--radius-pill); border: 2px solid rgba(255, 255, 255, .55);
  color: #fff; text-decoration: none; font-family: var(--font-display); font-weight: 600; font-size: var(--step--1);
  background: rgba(255, 255, 255, .08); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  transition: background var(--dur-fast), border-color var(--dur-fast), transform var(--dur-base) var(--ease-out-soft);
}
.sub-nav__back:hover { color: var(--c-red-700); background: #fff; border-color: #fff; }
.sub-nav__back:hover .ico { transform: translateX(-3px); }
.sub-nav__back .ico { transition: transform var(--dur-base) var(--ease-back); }
.sub-nav__back:focus-visible { outline-color: var(--color-focus); }

.chip {
  display: inline-flex; align-items: center; gap: .45em; margin: 0 0 var(--space-s);
  font-family: var(--font-body); font-weight: 800; font-size: var(--step--1);
  padding: 6px 14px; border-radius: var(--radius-pill); line-height: 1.3;
}
.chip--glass { background: rgba(255, 246, 238, .14); border: 1.5px solid rgba(255, 246, 238, .35); color: #fff; }
.chip--glass .ico { color: var(--c-gold-300); }

/* ---- Botones (3 variantes × 2 tamaños) ---- */
.btn {
  --btn-h: 48px;
  position: relative; isolation: isolate; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: .55em;
  min-height: var(--btn-h); padding: 0 1.5em;
  border: 2px solid transparent; border-radius: var(--radius-pill);
  font-family: var(--font-display); font-weight: 600; font-size: var(--step-0); letter-spacing: var(--ls-button); line-height: 1.1;
  text-decoration: none; cursor: pointer; user-select: none; -webkit-tap-highlight-color: transparent;
  transition: transform var(--dur-base) var(--ease-out-soft), box-shadow var(--dur-base) var(--ease-out-soft), background-color var(--dur-fast), color var(--dur-fast), border-color var(--dur-fast);
}
.btn--lg { --btn-h: 56px; font-size: var(--step-1); padding: 0 1.8em; }
.btn--block { width: 100%; }
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(3px) scale(var(--press-scale)); transition-duration: var(--dur-instant); transition-timing-function: var(--ease-bounce-soft); }
.btn[disabled] { cursor: not-allowed; opacity: .65; transform: none; }

.btn--primary { background: var(--grad-gold); color: var(--c-red-900); box-shadow: var(--shadow-press-gold); }
.btn--primary::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--grad-gold-shine) no-repeat; background-size: 220% 100%; background-position: -160% 0; }
.btn--primary:hover::before { animation: kf-shine 700ms var(--ease-out-soft); }
.btn--primary:active { box-shadow: 0 1px 0 var(--c-gold-900); }

.btn--secondary { background: var(--c-red-500); color: #fff; box-shadow: var(--shadow-press); }
.btn--secondary:hover { background: var(--c-red-600); color: #fff; }
.btn--secondary:active { box-shadow: 0 1px 0 var(--c-red-800); }

.btn--ghost { background: transparent; color: var(--c-red-500); border-color: currentColor; }
.btn--ghost:hover { background: var(--c-red-500); border-color: var(--c-red-500); color: #fff; }

.btn--whatsapp { background: var(--c-whatsapp); color: #fff; box-shadow: 0 4px 0 #126a38; }
.btn--whatsapp:hover { background: #1a7d44; color: #fff; }

/* flecha / huellita que avanza */
.btn--next::after, .btn--paw::after, .btn--back::before {
  content: ""; width: 1.1em; height: 1.1em; flex: none; background: currentColor;
  -webkit-mask: var(--ico-arrow) center/contain no-repeat; mask: var(--ico-arrow) center/contain no-repeat;
  transition: transform var(--dur-base) var(--ease-back);
}
.btn--paw::after { -webkit-mask-image: var(--svg-paw); mask-image: var(--svg-paw); }
.btn--back::before { transform: scaleX(-1); }
.btn--next:hover::after, .btn--paw:hover::after { transform: translateX(4px); }
.btn--paw:hover::after { transform: translateX(4px) rotate(12deg); }
.btn--back:hover::before { transform: scaleX(-1) translateX(4px); }

/* cargando: huesito que gira */
.btn.is-loading { pointer-events: none; }
.btn.is-loading::after {
  -webkit-mask-image: var(--svg-bone); mask-image: var(--svg-bone);
  width: 1.4em; animation: kf-spin .9s linear infinite;
}

/* ---- Footer corto ---- */
.sub-footer {
  position: relative; margin-top: var(--space-3xl); color: var(--color-text-on-brand-muted);
  background: var(--grad-night); padding: calc(var(--space-2xl) + 10px) var(--gutter) var(--space-xl);
  text-align: center; font-size: var(--step--1);
}
.sub-footer::before { /* festón crema */
  content: ""; position: absolute; left: 0; right: 0; top: -1px; height: 20px; background: var(--color-bg);
  -webkit-mask: var(--svg-scallop) top left / var(--scallop-size) repeat-x; mask: var(--svg-scallop) top left / var(--scallop-size) repeat-x;
}
.sub-footer__inner { max-width: var(--container); margin: 0 auto; display: grid; gap: var(--space-s); justify-items: center; }
.sub-footer__brand img { height: 84px; width: auto; filter: brightness(0) invert(1); }
.sub-footer p { margin: 0; }
.sub-footer__event { display: inline-flex; align-items: center; gap: .4em; color: #fff; font-weight: 700; flex-wrap: wrap; justify-content: center; }
.sub-footer__event .ico { color: var(--c-gold-300); }
.sub-footer__links { display: flex; flex-wrap: wrap; gap: 6px 18px; justify-content: center; }
.sub-footer a { color: var(--c-gold-300); font-weight: 700; }
.sub-footer a:hover { color: #fff; }
.sub-footer a:focus-visible { outline-color: var(--color-focus); }
.sub-footer__made { display: inline-flex; align-items: center; gap: .35em; opacity: .85; }
.sub-footer__made .ico { color: var(--c-gold-500); width: 1.1em; height: 1.1em; }

body {
  --ico-chat: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 11.5a8 8 0 0 1-11.8 7L4 20l1.5-4.1A8 8 0 1 1 20 11.5z'/%3E%3C/svg%3E");
  --ico-camera: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='18' height='18' rx='5'/%3E%3Ccircle cx='12' cy='12' r='4'/%3E%3Cpath d='M17.5 6.5v.01'/%3E%3C/svg%3E");
  --ico-up: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 19V5M6 11l6-6 6 6'/%3E%3C/svg%3E");
}
/* =====================================================================
   LEGALES (términos y aviso de privacidad): layout de lectura
   ===================================================================== */
.sub-nav__actions { display: flex; align-items: center; gap: 10px; }
.sub-nav__cta { --btn-h: 44px; font-size: var(--step--1); padding: 0 1.2em; }
.legal-hero { padding-bottom: calc(var(--wave-h) + var(--space-3xl)); }
.legal-hero .sub-hero__inner { padding-top: var(--space-l); }
.legal-hero h1 { font-size: var(--step-5); max-width: 18ch; }
.legal-hero .sub-hero__lead { max-width: 52ch; font-size: var(--step-0); }
.draft-flag {
  display: inline-flex; align-items: center; gap: 8px; margin: 0 0 var(--space-s); padding: 6px 14px 6px 10px;
  background: var(--c-gold-100); color: var(--c-gold-900); border: 3px solid #fff; border-radius: var(--radius-pill);
  font-weight: 800; font-size: var(--step--1); box-shadow: var(--shadow-sticker); transform: rotate(-2deg);
}
.draft-flag::before { content: ""; width: 18px; height: 18px; background: currentColor; -webkit-mask: var(--ico-alert) center/contain no-repeat; mask: var(--ico-alert) center/contain no-repeat; }

.legal { position: relative; z-index: 2; margin-top: calc(var(--space-3xl) * -1); padding: 0 var(--gutter); }
.legal__layout { max-width: 1080px; margin: 0 auto; display: grid; gap: var(--space-l); }
.legal__body {
  min-width: 0; background: var(--color-surface); border-radius: var(--radius-xl); box-shadow: var(--shadow-l);
  padding: var(--space-xl) clamp(20px, 5vw, 56px);
  font-size: var(--step-0); line-height: var(--lh-body);
}
.legal__body > * { max-width: var(--measure); }
.legal__meta { margin: 0 0 var(--space-m); font-size: var(--step--1); color: var(--c-ink-700); font-weight: 700; }
.legal__body h2 {
  display: flex; align-items: center; gap: 10px; margin: var(--space-xl) 0 var(--space-s);
  font-weight: 600; font-size: var(--step-3); color: var(--c-red-500); scroll-margin-top: 24px;
}
.legal__body h2::before { content: ""; flex: none; width: 22px; height: 22px; background: var(--c-gold-500); -webkit-mask: var(--svg-paw) center/contain no-repeat; mask: var(--svg-paw) center/contain no-repeat; transform: rotate(-12deg); }
.legal__body h2:first-of-type { margin-top: var(--space-m); }
.legal__body h3 { margin: var(--space-m) 0 var(--space-2xs); font-weight: 600; font-size: var(--step-1); color: var(--c-red-700); }
.legal__body p { margin: 0 0 var(--space-s); }
.legal__body ul, .legal__body ol { margin: 0 0 var(--space-m); padding-left: 0; }
.legal__body ul { list-style: none; }
.legal__body ul > li { position: relative; padding-left: 28px; margin-bottom: 10px; }
.legal__body ul > li::before { content: ""; position: absolute; left: 2px; top: .35em; width: 15px; height: 15px; background: var(--c-cocoa-600); opacity: .45; -webkit-mask: var(--svg-paw) center/contain no-repeat; mask: var(--svg-paw) center/contain no-repeat; }
.legal__body ol { counter-reset: n; list-style: none; }
.legal__body ol > li { counter-increment: n; position: relative; padding-left: 40px; margin-bottom: 12px; }
.legal__body ol > li::before { content: counter(n); position: absolute; left: 0; top: .1em; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: var(--c-red-50); color: var(--c-red-500); font-family: var(--font-display); font-weight: 700; font-size: .9rem; }
.legal__body strong { color: var(--c-ink-900); font-weight: 800; }
.legal__body a { color: var(--c-red-500); font-weight: 700; }
.todo { background: var(--c-gold-100); color: var(--c-gold-900); border-radius: 6px; padding: 1px 6px; font-weight: 700; font-size: .92em; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.legal__next { margin-top: var(--space-xl) !important; padding-top: var(--space-m); border-top: 2px dashed var(--color-border); }

/* Índice */
.legal__toc { background: var(--color-surface); border-radius: var(--radius-l); box-shadow: var(--shadow-m); padding: var(--space-m); }
.legal__toc p { margin: 0 0 10px; font-weight: 800; font-size: var(--step--2); letter-spacing: var(--ls-eyebrow); text-transform: uppercase; color: var(--c-gold-900); }
.legal__toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; counter-reset: t; }
.legal__toc li { counter-increment: t; }
.legal__toc a {
  display: flex; gap: 10px; align-items: baseline; padding: 8px 12px; border-radius: var(--radius-s);
  color: var(--c-ink-700); text-decoration: none; font-weight: 700; font-size: var(--step--1); line-height: 1.35;
  transition: background var(--dur-fast), color var(--dur-fast), transform var(--dur-base) var(--ease-out-soft);
}
.legal__toc a::before { content: counter(t); flex: none; font-family: var(--font-display); font-weight: 700; color: var(--c-red-200); }
.legal__toc a:hover { background: var(--c-cream-100); color: var(--c-red-500); }
.legal__toc a.is-active { background: var(--c-red-50); color: var(--c-red-500); transform: translateX(4px); }
.legal__toc a.is-active::before { color: var(--c-red-500); }

/* Volver arriba */
.legal-top {
  position: fixed; right: 16px; bottom: 16px; z-index: var(--z-sticky); width: 52px; height: 52px; display: grid; place-items: center;
  border-radius: 50%; background: var(--c-red-500); color: #fff; border: 3px solid #fff; box-shadow: var(--shadow-m);
  opacity: 0; transform: translateY(20px) scale(.8); pointer-events: none;
  transition: opacity var(--dur-base), transform var(--dur-base) var(--ease-back), background var(--dur-fast);
}
.legal-top .ico { width: 24px; height: 24px; }
.legal-top.is-visible { opacity: 1; transform: none; pointer-events: auto; }
.legal-top:hover { background: var(--c-red-600); color: #fff; }

@media (max-width: 639px) {
  .sub-nav__cta { display: none; }
}
@media (min-width: 1024px) {
  .legal__layout { grid-template-columns: 260px 1fr; align-items: start; }
  .legal__aside { position: sticky; top: 24px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
@media print {
  .sub-hero, .legal__aside, .legal-top, .sub-footer { display: none; }
  .legal { margin: 0; } .legal__body { box-shadow: none; padding: 0; }
}
