/*
 * Web pública de Mantyra (mantyra.com). Solo tokens del design system
 * (mantyra-tokens.css): sin el tema Good del panel, para que cargue ligera.
 * Reglas de la marca: fondos lisos, tarjetas planas con borde, formas cuadradas,
 * sin imágenes decorativas. El único «dibujo» es el propio producto.
 */

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: var(--text-body);
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }
a { color: var(--brand); text-underline-offset: 3px; }
a:hover { color: var(--brand-hover); }
:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; border-radius: var(--radius-sm); }

h1, h2, h3 { margin: 0; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
ul { margin: 0; padding: 0; list-style: none; }

.wrap { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 768px) { .wrap { padding: 0 32px; } }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; z-index: 100; background: var(--surface); padding: 8px 12px; }

/* ---- Tipografía ---- */
.display {
  font-family: var(--font-display); font-weight: 700; letter-spacing: -0.025em;
  font-size: clamp(36px, 6vw, 60px); line-height: 1.04;
}
.h1 { font: var(--text-h1); letter-spacing: var(--ls-h1); }
.h2 { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.015em; font-size: clamp(26px, 3.4vw, 36px); line-height: 1.15; }
.h3 { font: var(--text-h3); }
.lead { font-size: clamp(17px, 1.6vw, 20px); line-height: 1.5; color: var(--text-muted); font-weight: 500; }
.caption { font: var(--text-caption); letter-spacing: var(--ls-caption); text-transform: uppercase; color: var(--text-muted); }
.muted { color: var(--text-muted); }
.small { font: var(--text-small); }
.mono { font-family: var(--font-mono); font-weight: 600; }

/* ---- Botones ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: var(--control-h); padding: 0 18px; border-radius: var(--radius-md);
  font: 700 15px/1 var(--font-ui); text-decoration: none; white-space: nowrap;
  border: 2px solid transparent; cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
.btn:active { transform: scale(.985); }
.btn-lg { height: var(--control-h-lg); padding: 0 24px; font-size: 16px; }
.btn-primary { background: var(--brand); color: var(--on-brand); }
.btn-primary:hover { background: var(--brand-hover); color: var(--on-brand); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover { background: var(--surface-sunken); color: var(--text); }
.btn-ghost { background: transparent; color: var(--text); }
.btn-ghost:hover { background: var(--surface-sunken); color: var(--text); }
.btn-block { width: 100%; }

/* ---- Cabecera ---- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: saturate(1.2);
  border-bottom: 1px solid var(--border);
}
.site-header .wrap { display: flex; align-items: center; gap: 24px; height: 68px; }
.brand { display: inline-flex; align-items: center; flex-shrink: 0; }
.brand img { height: 30px; width: auto; }
.nav { display: none; gap: 4px; margin-left: 12px; }
.nav a { padding: 8px 12px; border-radius: var(--radius-md); color: var(--text); text-decoration: none; font-weight: 600; font-size: 15px; }
.nav a:hover, .nav a[aria-current="page"] { background: var(--surface-sunken); }
.header-cta { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.header-cta .btn-ghost { display: none; }
@media (min-width: 900px) {
  .nav { display: flex; }
  .header-cta .btn-ghost { display: inline-flex; }
}
.menu-btn { display: inline-flex; width: 44px; height: 44px; align-items: center; justify-content: center; border: 0; background: transparent; color: var(--text); border-radius: var(--radius-md); cursor: pointer; }
.menu-btn:hover { background: var(--surface-sunken); }
@media (min-width: 900px) { .menu-btn { display: none; } }
.mobile-nav { display: none; border-top: 1px solid var(--border); background: var(--bg); }
.mobile-nav.open { display: block; }
.mobile-nav a { display: block; padding: 14px 16px; border-bottom: 1px solid var(--border); color: var(--text); text-decoration: none; font-weight: 600; }
@media (min-width: 900px) { .mobile-nav, .mobile-nav.open { display: none; } }

/* ---- Secciones ---- */
.section { padding: 72px 0; }
.section-tight { padding: 48px 0; }
.section + .section { border-top: 1px solid var(--border); }
.section-surface { background: var(--surface); }
.section-head { max-width: 720px; margin-bottom: 40px; display: grid; gap: 12px; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
@media (min-width: 768px) { .section { padding: 104px 0; } }

.grid { display: grid; gap: 16px; }
@media (min-width: 640px) { .grid-2 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) {
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
}
@media (min-width: 640px) and (max-width: 899px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 24px;
}
.card-link { display: block; text-decoration: none; color: inherit; transition: border-color var(--dur-fast) var(--ease-out); }
.card-link:hover { border-color: var(--brand); color: inherit; }
.card .h3 { margin: 16px 0 6px; }
.icon-box {
  width: 44px; height: 44px; border-radius: var(--radius-md);
  background: var(--brand-soft); color: var(--brand);
  display: inline-flex; align-items: center; justify-content: center;
}

/* ---- Hero ---- */
.hero { padding: 56px 0 72px; }
.hero .wrap { display: grid; gap: 48px; align-items: center; }
@media (min-width: 1000px) {
  .hero { padding: 88px 0 104px; }
  .hero .wrap { grid-template-columns: 1.05fr .95fr; gap: 64px; }
}
.hero-copy { display: grid; gap: 24px; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-note { display: flex; align-items: center; gap: 8px; color: var(--text-muted); font: var(--text-small); }
.hero-note svg { color: var(--success); flex-shrink: 0; }

/* Maqueta de informe: el producto como imagen */
.report {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-xl);
  box-shadow: var(--shadow-2); overflow: hidden; font-size: 14px;
}
.report-top { height: 4px; background: var(--brand); }
.report-head { display: flex; justify-content: space-between; gap: 16px; padding: 20px 22px 16px; border-bottom: 1px solid var(--border); }
.report-when { justify-items: end; align-content: start; text-align: right; }
.report-head strong { font-family: var(--font-display); font-size: 17px; letter-spacing: -0.01em; }
.report-body { padding: 16px 22px; display: grid; gap: 16px; }
.check-list { display: grid; gap: 8px; }
.check-row { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.check-box {
  width: 20px; height: 20px; border-radius: var(--radius-sm); flex-shrink: 0;
  background: var(--brand); color: var(--on-brand);
  display: inline-flex; align-items: center; justify-content: center;
}
.measure-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.measure { border: 1px solid var(--border); border-radius: var(--radius-md); padding: 10px; display: grid; gap: 4px; }
.measure .value { font: var(--text-mono); font-size: 18px; }
.measure.bad { border-color: var(--st-medicion-out_of_range-bg); background: color-mix(in srgb, var(--st-medicion-out_of_range-bg) 45%, transparent); }
.measure.bad .value { color: var(--st-medicion-out_of_range-fg); }
.badge {
  display: inline-flex; align-items: center; gap: 4px; width: fit-content;
  padding: 3px 7px; border-radius: var(--radius-sm);
  font: var(--text-caption); letter-spacing: var(--ls-caption); text-transform: uppercase;
}
.badge-ok { background: var(--st-medicion-in_range-bg); color: var(--st-medicion-in_range-fg); }
.badge-bad { background: var(--st-medicion-out_of_range-bg); color: var(--st-medicion-out_of_range-fg); }
.badge-done { background: var(--st-visita-completed-bg); color: var(--st-visita-completed-fg); }
.badge-brand { background: var(--brand-soft); color: var(--brand); }
.report-foot { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; padding: 14px 22px 18px; border-top: 1px solid var(--border); background: var(--surface-sunken); }
.signature { font-family: "Geologica", cursive; font-weight: 300; font-size: 22px; font-style: italic; line-height: 1; color: var(--text); }
.seal { display: flex; align-items: center; gap: 8px; color: var(--text-muted); font-size: 12px; text-align: right; }
.seal img { width: 28px; height: 28px; }

/* ---- Antes / con Mantyra ---- */
.compare { display: grid; gap: 16px; }
@media (min-width: 900px) { .compare { grid-template-columns: 1fr 1fr; } }
.compare .card { display: grid; gap: 14px; align-content: start; }
.compare li { display: flex; gap: 10px; align-items: flex-start; }
.compare li svg { margin-top: 3px; flex-shrink: 0; }
.compare .before svg { color: var(--text-muted); }
.compare .after { border-color: var(--brand); }
.compare .after svg { color: var(--success); }

/* ---- Pasos ---- */
.steps { counter-reset: step; }
.step { position: relative; display: grid; gap: 8px; align-content: start; }
.step-num { font: var(--text-mono); color: var(--text-muted); font-size: 14px; }

/* ---- Precios ---- */
.plans { display: grid; gap: 16px; }
@media (min-width: 640px) { .plans { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .plans { grid-template-columns: repeat(4, 1fr); } }
.plan { display: flex; flex-direction: column; gap: 20px; }
.plan.featured { border: 2px solid var(--brand); }
.plan-head { display: grid; gap: 4px; }
.plan-name { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.plan-name .h3 { margin: 0; }
.price { display: flex; align-items: baseline; gap: 4px; }
.price .amount { font-family: var(--font-display); font-weight: 700; font-size: 40px; line-height: 1; letter-spacing: -0.02em; }
.plan ul { display: grid; gap: 10px; font: var(--text-small); }
.plan li { display: flex; gap: 10px; align-items: flex-start; }
.plan li svg { color: var(--brand); flex-shrink: 0; margin-top: 2px; }
.plan li.off { color: var(--text-muted); }
.plan li.off svg { color: var(--text-disabled); }
.plan .btn { margin-top: auto; }

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); }
.compare-table { width: 100%; border-collapse: collapse; min-width: 640px; font: var(--text-small); }
.compare-table th, .compare-table td { padding: 14px 16px; text-align: left; border-bottom: 1px solid var(--border); }
.compare-table thead th { font: var(--text-caption); letter-spacing: var(--ls-caption); text-transform: uppercase; color: var(--text-muted); background: var(--surface-sunken); }
.compare-table tbody tr:last-child td, .compare-table tbody tr:last-child th { border-bottom: 0; }
.compare-table tbody th { font-weight: 700; }
.compare-table td.num { font-family: var(--font-mono); font-weight: 600; }

/* ---- FAQ ---- */
.faq { display: grid; gap: 8px; max-width: 820px; }
.faq details { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.faq summary { list-style: none; cursor: pointer; padding: 18px 20px; font-weight: 700; display: flex; justify-content: space-between; gap: 16px; align-items: center; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary svg { transition: transform var(--dur-base) var(--ease-out); flex-shrink: 0; color: var(--text-muted); }
.faq details[open] summary svg { transform: rotate(180deg); }
.faq details p { padding: 0 20px 18px; color: var(--text-muted); }

/* ---- Llamada final ---- */
.cta-band { background: var(--green-900); color: var(--neutral-50); border-radius: var(--radius-xl); padding: 40px 24px; display: grid; gap: 20px; }
.cta-band .lead { color: var(--green-200); }
.cta-band .btn-primary { background: var(--accent); color: var(--on-accent); }
.cta-band .btn-primary:hover { background: var(--accent-hover); color: var(--on-accent); }
.cta-band .btn-secondary { background: transparent; color: var(--neutral-50); border-color: var(--green-600); }
.cta-band .btn-secondary:hover { background: var(--green-800); color: var(--neutral-50); }
@media (min-width: 900px) { .cta-band { padding: 56px; grid-template-columns: 1fr auto; align-items: center; } }

/* ---- Sector ---- */
.crumbs { display: flex; gap: 8px; align-items: center; font: var(--text-small); color: var(--text-muted); margin-bottom: 16px; }
.crumbs a { color: var(--text-muted); }
.template-card { display: grid; gap: 16px; }
.template-card ol { margin: 0; padding: 0; list-style: none; display: grid; gap: 0; }
.template-card ol li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.template-card ol li:last-child { border-bottom: 0; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; gap: 6px; align-items: center; padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius-full); background: var(--surface); color: var(--text); text-decoration: none; font-weight: 600; font-size: 14px; }
.chip:hover, .chip[aria-current="page"] { border-color: var(--brand); color: var(--brand); }

/* ---- Legal ---- */
.legal { display: grid; gap: 32px; }
@media (min-width: 900px) { .legal { grid-template-columns: 240px 1fr; gap: 56px; } }
.legal-nav { display: grid; gap: 4px; align-content: start; }
.legal-nav a { padding: 8px 12px; border-radius: var(--radius-md); color: var(--text); text-decoration: none; font-weight: 600; font-size: 14px; }
.legal-nav a[aria-current="page"], .legal-nav a:hover { background: var(--surface-sunken); }
@media (min-width: 900px) { .legal-nav { position: sticky; top: 92px; } }
.prose { max-width: 720px; display: grid; gap: 16px; }
.prose h2 { font: var(--text-h2); letter-spacing: var(--ls-h2); margin-top: 16px; }
.prose ul { list-style: disc; padding-left: 22px; display: grid; gap: 6px; }
.prose table { border-collapse: collapse; width: 100%; font: var(--text-small); }
.prose th, .prose td { border: 1px solid var(--border); padding: 10px 12px; text-align: left; vertical-align: top; }
.prose th { background: var(--surface-sunken); }
.notice { border: 1px solid var(--warning-soft); background: var(--warning-soft); color: var(--warning-text); border-radius: var(--radius-md); padding: 14px 16px; font: var(--text-small); }
.fill { background: var(--warning-soft); color: var(--warning-text); padding: 0 4px; border-radius: var(--radius-sm); }

/* ---- Pie ---- */
.site-footer { border-top: 1px solid var(--border); padding: 56px 0 40px; margin-top: 0; }
.footer-grid { display: grid; gap: 32px; }
@media (min-width: 900px) { .footer-grid { grid-template-columns: 1.4fr repeat(3, 1fr); } }
.footer-grid h2 { font: var(--text-caption); letter-spacing: var(--ls-caption); text-transform: uppercase; color: var(--text-muted); margin-bottom: 12px; }
.footer-grid ul { display: grid; gap: 8px; }
.footer-grid a { color: var(--text); text-decoration: none; font-size: 15px; }
.footer-grid a:hover { color: var(--brand); text-decoration: underline; }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--border); color: var(--text-muted); font: var(--text-small); }

.stack-8 { display: grid; gap: 8px; }
.stack-16 { display: grid; gap: 16px; }
.mt-40 { margin-top: 40px; }
.center { text-align: center; }

/* ---- Iconos Lucide en línea ({% icon %}) ---- */
.lucide { display: inline-block; width: 1.25em; height: 1.25em; vertical-align: -0.25em; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; fill: none; flex-shrink: 0; }
.lucide-14 { width: 14px; height: 14px; }
.lucide-16 { width: 16px; height: 16px; }
.lucide-20 { width: 20px; height: 20px; }
.lucide-24 { width: 24px; height: 24px; }
.lucide-28 { width: 28px; height: 28px; }

@media (max-width: 480px) {
  .report-head, .report-body, .report-foot { padding-left: 16px; padding-right: 16px; }
  .report-head { flex-direction: column; gap: 12px; }
  .report-when { display: flex; flex-direction: row-reverse; justify-content: flex-end; align-items: center; gap: 12px; }
  .measure-grid { gap: 6px; }
  .measure { padding: 8px; }
  .measure .value { font-size: 16px; white-space: nowrap; }
  .measure .badge { font-size: 10px; letter-spacing: .02em; padding: 2px 5px; }
}
