/* =========================================================
   Agentes de IA Perú — estilos
   ========================================================= */

:root {
  --blue: #0e7a55;
  --blue-dark: #0a5f42;
  --blue-soft: #e3f3ec;
  --ink: #0b1220;
  --ink-2: #3a4458;
  --ink-3: #6b7489;
  --line: #e3e8f0;
  --bg: #ffffff;
  --bg-alt: #f6f8fb;
  --card: #ffffff;
  --green: #12a150;
  --red: #e5484d;
  --chat-bg: #eef2f6;
  --bubble-in: #ffffff;
  --bubble-out: #d7ebff;

  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(11, 18, 32, .04), 0 8px 24px rgba(11, 18, 32, .06);
  --shadow-lg: 0 24px 60px rgba(10, 77, 54, .18);
  --header-h: 60px;
  --font: "Instrument Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --blue: #2fbf86;
    --blue-dark: #23a573;
    --blue-soft: #12301f;
    --ink: #eef2f8;
    --ink-2: #c3cbd9;
    --ink-3: #8d97aa;
    --line: #232c3b;
    --bg: #0b1018;
    --bg-alt: #111823;
    --card: #141c28;
    --chat-bg: #0f1621;
    --bubble-in: #1b2433;
    --bubble-out: #12345a;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .3);
    --shadow-lg: 0 24px 60px rgba(0, 0, 0, .5);
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 40px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 18px;
  line-height: 1.65;
  color: var(--ink-2);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--blue); text-decoration-thickness: 1px; text-underline-offset: 3px; }
h1, h2, h3, h4, h5, h6 { color: var(--ink); line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 .5em; font-weight: 600; }
h1 { font-size: clamp(2.1rem, 4.6vw, 3.6rem); letter-spacing: -0.035em; }
h2 { font-size: clamp(1.7rem, 3vw, 2.35rem); }
h3 { font-size: 1.15rem; letter-spacing: -0.01em; }
p { margin: 0 0 1.1em; }
strong { color: var(--ink); font-weight: 600; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

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

:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 6px; }

/* ---------- Progreso de lectura ---------- */
.progress { position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 60; }
.progress span { display: block; height: 100%; width: 0; background: var(--blue); transition: width .1s linear; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  background: var(--blue); color: #fff; font-weight: 600; text-decoration: none;
  padding: 14px 22px; border-radius: 999px; border: 0; cursor: pointer;
  font-size: 1rem; line-height: 1.2; text-align: center;
  transition: transform .15s ease, background .15s ease, box-shadow .15s ease;
  box-shadow: 0 6px 18px rgba(14, 122, 85, .28);
}
.btn:hover { background: var(--blue-dark); transform: translateY(-2px); box-shadow: 0 10px 26px rgba(14, 122, 85, .35); }
.btn:active { transform: translateY(0); }
.btn-lg { padding: 18px 28px; font-size: 1.06rem; }
.btn-white { background: #fff; color: #0a5f42; box-shadow: 0 10px 30px rgba(0, 0, 0, .18); }
.btn-white:hover { background: #effaf4; }
.btn svg { transition: transform .2s ease; flex-shrink: 0; }
.btn:hover svg { transform: translateX(4px); }

/* ---------- Cabecera ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  padding: 10px 0;
  transition: padding .25s ease;
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  height: var(--header-h); padding: 0 10px 0 16px;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border: 1px solid var(--line); border-radius: 18px;
  box-shadow: 0 1px 2px rgba(11, 18, 32, .03);
  transition: box-shadow .25s ease, border-color .25s ease, background .25s ease;
}
.site-header.scrolled { padding: 6px 0; }
.site-header.scrolled .header-inner { box-shadow: var(--shadow); background: color-mix(in srgb, var(--bg) 90%, transparent); }
@media (min-width: 768px) { .site-header .header-inner { padding: 0 10px 0 18px; } }

.logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; color: var(--ink); text-decoration: none; font-size: 1rem; letter-spacing: -0.01em; flex-shrink: 0; }
.logo-mark {
  width: 34px; height: 34px; border-radius: 10px; color: #fff; display: grid; place-items: center;
  background: linear-gradient(135deg, #1aa874 0%, #0a5f42 100%);
  box-shadow: 0 4px 12px rgba(14, 122, 85, .35);
}
.logo-text small { display: block; font-size: .7rem; font-weight: 500; color: var(--ink-3); letter-spacing: 0; line-height: 1.1; }
.logo-text { line-height: 1.15; }

.main-nav { display: flex; align-items: center; gap: 4px; }
.main-nav > a:not(.btn), .nav-drop-btn {
  white-space: nowrap; color: var(--ink-2); text-decoration: none; font-size: .94rem; font-weight: 500;
  padding: 9px 14px; border-radius: 10px; transition: color .15s, background .15s;
}
.main-nav > a:not(.btn):hover, .nav-drop-btn:hover, .nav-drop.open .nav-drop-btn { color: var(--ink); background: var(--bg-alt); }
.main-nav > a[aria-current="page"] { color: var(--blue); }
.nav-cta { white-space: nowrap; margin-left: 10px; padding: 11px 18px; font-size: .92rem; box-shadow: 0 4px 14px rgba(14, 122, 85, .28); }

/* Desplegable de guías */
.nav-drop { position: relative; }
.nav-drop-btn { display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; cursor: pointer; font-family: inherit; }
.nav-drop-btn svg { transition: transform .2s ease; }
.nav-drop.open .nav-drop-btn svg { transform: rotate(180deg); }
.nav-drop-btn.is-current { color: var(--blue); }
.nav-drop-menu {
  position: absolute; top: calc(100% + 12px); left: 50%; width: 560px; transform: translate(-50%, 6px);
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 10px;
  background: var(--card); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-lg);
  opacity: 0; visibility: hidden; transition: opacity .18s ease, transform .18s ease, visibility .18s;
}
.nav-drop.open .nav-drop-menu { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
.nav-drop-menu a {
  display: flex; gap: 12px; align-items: flex-start; padding: 12px; border-radius: 12px; text-decoration: none; color: var(--ink-2);
  transition: background .15s;
}
.nav-drop-menu a:hover, .nav-drop-menu a[aria-current="page"] { background: var(--blue-soft); }
.nav-drop-menu .di { width: 36px; height: 36px; flex-shrink: 0; border-radius: 10px; background: var(--blue-soft); display: grid; place-items: center; font-size: 1.05rem; }
.nav-drop-menu a:hover .di { background: var(--card); }
.nav-drop-menu strong { display: block; font-size: .93rem; line-height: 1.3; }
.nav-drop-menu small { display: block; font-size: .8rem; color: var(--ink-3); line-height: 1.35; margin-top: 2px; }
.nav-drop-menu .all { grid-column: 1 / -1; justify-content: center; font-size: .86rem; font-weight: 600; color: var(--blue); padding: 10px; border-top: 1px solid var(--line); border-radius: 0 0 10px 10px; margin-top: 4px; }

.nav-toggle { display: none; width: 44px; height: 44px; border: 0; background: var(--bg-alt); border-radius: 12px; cursor: pointer; padding: 12px 11px; }
.nav-toggle span { display: block; height: 2px; background: var(--ink); margin: 4px 0; border-radius: 2px; transition: transform .2s, opacity .2s; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 1100px) {
  .nav-toggle { display: block; }
  .main-nav {
    position: fixed; left: 16px; right: 16px; top: calc(var(--header-h) + 24px);
    max-height: calc(100vh - var(--header-h) - 40px); overflow-y: auto;
    flex-direction: column; align-items: stretch; gap: 2px; padding: 10px;
    background: var(--card); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-lg);
    opacity: 0; visibility: hidden; transform: translateY(-8px); transition: opacity .2s ease, transform .2s ease, visibility .2s;
  }
  .main-nav.open { opacity: 1; visibility: visible; transform: none; }
  .main-nav > a:not(.btn), .nav-drop-btn { padding: 13px 12px; font-size: 1rem; width: 100%; justify-content: space-between; text-align: left; }
  .nav-drop-menu {
    position: static; width: auto; transform: none; grid-template-columns: 1fr; box-shadow: none; border: 0; padding: 0 0 6px;
    display: none; opacity: 1; visibility: visible; background: transparent;
  }
  .nav-drop.open .nav-drop-menu { display: grid; transform: none; }
  .nav-cta { margin: 8px 0 0; width: 100%; padding: 14px 18px; }
}
@media (max-width: 420px) { .logo-text small { display: none; } }

/* ---------- Hero ---------- */
.hero {
  padding: 64px 0 80px;
  background:
    radial-gradient(900px 500px at 85% 10%, color-mix(in srgb, var(--blue) 16%, transparent), transparent 70%),
    radial-gradient(600px 400px at 0% 100%, color-mix(in srgb, var(--blue) 8%, transparent), transparent 70%),
    var(--bg);
  border-bottom: 1px solid var(--line);
}
.hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 56px; align-items: center; }
.eyebrow {
  display: inline-block; font-size: .8rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--blue); background: var(--blue-soft); padding: 6px 12px; border-radius: 999px; margin-bottom: 20px;
}
.lead { font-size: 1.2rem; color: var(--ink-2); max-width: 600px; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 18px 24px; margin: 30px 0 26px; }
.link-quiet { color: var(--ink-2); font-weight: 500; text-decoration: none; }
.link-quiet:hover { color: var(--blue); }
.hero-points { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: .92rem; color: var(--ink-3); }
.hero-points li::before { content: "✓"; color: var(--green); font-weight: 700; margin-right: 6px; }

/* Teléfono */
.hero-visual { display: flex; flex-direction: column; align-items: center; }
.phone {
  width: 100%; max-width: 360px; border-radius: 34px; background: var(--card);
  border: 8px solid #111827; box-shadow: var(--shadow-lg); overflow: hidden;
  transform: rotate(1.5deg);
}
.phone-top { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--blue); color: #fff; }
.phone-top strong { color: #fff; display: block; font-size: .95rem; line-height: 1.2; }
.phone-top small { opacity: .85; font-size: .78rem; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: rgba(255, 255, 255, .22); display: grid; place-items: center; font-weight: 700; font-size: .85rem; }
.chat { background: var(--chat-bg); padding: 16px 12px 20px; display: flex; flex-direction: column; gap: 10px; min-height: 380px; }
.js .msg {
  max-width: 85%; padding: 9px 12px 18px; border-radius: 14px; font-size: .9rem; line-height: 1.45;
  color: var(--ink); position: relative; box-shadow: 0 1px 1px rgba(0, 0, 0, .06);
  opacity: 0; transform: translateY(8px); transition: opacity .4s ease, transform .4s ease;
}
.msg.show { opacity: 1; transform: none; }
.msg .time { position: absolute; right: 10px; bottom: 4px; font-size: .68rem; color: var(--ink-3); }
.msg.in { background: var(--bubble-in); align-self: flex-start; border-top-left-radius: 4px; }
.msg.out { background: var(--bubble-out); align-self: flex-end; border-top-right-radius: 4px; }
.msg.audio { display: flex; align-items: center; gap: 8px; min-width: 170px; padding-right: 54px; }
.wave {
  width: 90px; height: 18px; flex-shrink: 0;
  background: repeating-linear-gradient(90deg, var(--ink-3) 0 2px, transparent 2px 5px);
  -webkit-mask: radial-gradient(ellipse at center, #000 40%, transparent 72%);
  mask: radial-gradient(ellipse at center, #000 40%, transparent 72%);
}
.msg.note {
  align-self: center; max-width: 100%; background: color-mix(in srgb, var(--green) 14%, var(--card));
  color: var(--green); font-weight: 600; font-size: .8rem; padding: 8px 12px; text-align: center;
}
.visual-caption { font-size: .88rem; color: var(--ink-3); text-align: center; max-width: 320px; margin-top: 22px; }

@media (max-width: 960px) {
  .hero { padding: 40px 0 56px; }
  .hero-grid { grid-template-columns: 1fr; gap: 44px; }
  .phone { transform: none; }
}

/* ---------- Layout de contenido ---------- */
.content-grid { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 64px; padding-top: 64px; padding-bottom: 40px; }
.article { max-width: 780px; min-width: 0; }

.toc { position: sticky; top: calc(var(--header-h) + 44px); align-self: start; max-height: calc(100vh - var(--header-h) - 64px); overflow: auto; }
.toc-title { font-size: .78rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 12px; }
.toc ol { list-style: none; padding: 0; margin: 0; counter-reset: toc; border-left: 2px solid var(--line); }
.toc li { counter-increment: toc; }
.toc a {
  display: block; padding: 7px 0 7px 16px; margin-left: -2px; border-left: 2px solid transparent;
  color: var(--ink-3); text-decoration: none; font-size: .9rem; line-height: 1.35; transition: color .15s, border-color .15s;
}
.toc a::before { content: counter(toc, decimal-leading-zero) "  "; font-variant-numeric: tabular-nums; opacity: .6; white-space: pre; }
.toc a:hover { color: var(--ink); }
.toc a.active { color: var(--blue); border-left-color: var(--blue); font-weight: 600; }

@media (max-width: 1020px) {
  .content-grid { grid-template-columns: 1fr; gap: 0; padding-top: 40px; }
  .toc { position: static; max-height: none; background: var(--bg-alt); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 48px; }
  .toc ol { columns: 2; column-gap: 24px; border-left: 0; }
  .toc a { padding-left: 0; border-left: 0; margin-left: 0; }
  .article { max-width: none; }
}
@media (max-width: 560px) { .toc ol { columns: 1; } }

/* ---------- Bloques ---------- */
.block { padding: 8px 0 64px; position: relative; }
.block + .block { border-top: 1px solid var(--line); padding-top: 64px; }
.section-num { display: block; font-size: .85rem; font-weight: 700; color: var(--blue); letter-spacing: .08em; margin-bottom: 10px; font-variant-numeric: tabular-nums; }

.definition {
  background: var(--blue-soft); border-left: 4px solid var(--blue); border-radius: 0 var(--radius) var(--radius) 0;
  padding: 22px 26px; margin: 28px 0;
}
.definition p { margin: 0; font-size: 1.1rem; color: var(--ink); }
.definition-label { font-size: .78rem !important; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--blue) !important; margin-bottom: 6px !important; }

.check-list, .x-list { list-style: none; padding: 0; margin: 0 0 1.2em; }
.check-list li, .x-list li { position: relative; padding-left: 34px; margin-bottom: 12px; }
.check-list li::before, .x-list li::before {
  position: absolute; left: 0; top: 3px; width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center; font-size: .75rem; font-weight: 700;
}
.check-list li::before { content: "✓"; background: color-mix(in srgb, var(--green) 15%, transparent); color: var(--green); }
.x-list li::before { content: "✕"; background: color-mix(in srgb, var(--red) 14%, transparent); color: var(--red); }

/* Tabla comparativa */
.table-wrap { overflow-x: auto; margin: 24px 0; border: 1px solid var(--line); border-radius: var(--radius); }
.compare { width: 100%; border-collapse: collapse; font-size: .95rem; min-width: 540px; }
.compare th, .compare td { padding: 14px 18px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.compare tbody tr:last-child th, .compare tbody tr:last-child td { border-bottom: 0; }
.compare thead th { background: var(--bg-alt); color: var(--ink); font-weight: 600; font-size: .85rem; text-transform: uppercase; letter-spacing: .05em; }
.compare thead th:last-child { background: var(--blue); color: #fff; }
.compare tbody th { color: var(--ink); font-weight: 600; white-space: nowrap; }
.compare td:nth-child(2) { color: var(--ink-3); }
.compare td:last-child { color: var(--ink); background: color-mix(in srgb, var(--blue) 5%, transparent); font-weight: 500; }
.note-text { font-size: 1.15rem; color: var(--ink); }

/* Pasos */
.steps { list-style: none; padding: 0; margin: 28px 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.steps li { display: flex; gap: 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.steps h3 { margin-bottom: 6px; }
.steps p { margin: 0; font-size: .95rem; }
.step-icon { font-size: 1.5rem; width: 48px; height: 48px; flex-shrink: 0; border-radius: 12px; background: var(--blue-soft); display: grid; place-items: center; }
@media (max-width: 640px) { .steps { grid-template-columns: 1fr; } }

/* Beneficios */
.benefits { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin: 28px 0 40px; }
.benefit {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.benefit:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--blue) 40%, var(--line)); }
.benefit-icon { font-size: 1.6rem; display: block; margin-bottom: 12px; }
.benefit h3 { margin-bottom: 6px; }
.benefit p { margin: 0; font-size: .95rem; }
@media (max-width: 640px) { .benefits { grid-template-columns: 1fr; } }

/* CTA intermedio */
.inline-cta {
  display: flex; align-items: center; justify-content: space-between; gap: 24px 32px; flex-wrap: wrap;
  background: linear-gradient(135deg, var(--blue) 0%, #0a5f42 100%); color: #e6f2ff;
  border-radius: 22px; padding: 32px; box-shadow: var(--shadow-lg);
}
.inline-cta > div { flex: 1 1 280px; }
.inline-cta p { margin: 0; }
.inline-cta-title { color: #fff; font-size: 1.35rem; font-weight: 600; letter-spacing: -0.01em; margin-bottom: 6px !important; line-height: 1.25; }
.inline-cta .btn { background: #fff; color: #0a5f42; box-shadow: 0 8px 20px rgba(0, 0, 0, .15); }
.inline-cta .btn:hover { background: #effaf4; }
@media (max-width: 560px) { .inline-cta { padding: 24px; } .inline-cta .btn { width: 100%; } }

/* Calculadora */
.calc {
  display: grid; grid-template-columns: 1.1fr .9fr; gap: 0; margin-top: 28px;
  border: 1px solid var(--line); border-radius: 22px; overflow: hidden; box-shadow: var(--shadow); background: var(--card);
}
.calc-inputs { padding: 28px; display: flex; flex-direction: column; gap: 24px; }
.field { display: block; }
.field > span { display: block; font-size: .92rem; font-weight: 600; color: var(--ink); margin-bottom: 10px; line-height: 1.35; }
.range-row { display: flex; align-items: center; gap: 14px; }
.range-row output { min-width: 52px; text-align: right; font-weight: 700; color: var(--blue); font-variant-numeric: tabular-nums; }
input[type="range"] {
  -webkit-appearance: none; appearance: none; flex: 1; height: 6px; border-radius: 999px; cursor: pointer;
  background: linear-gradient(to right, var(--blue) var(--fill, 50%), var(--line) var(--fill, 50%));
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 22px; height: 22px; border-radius: 50%; background: #fff;
  border: 3px solid var(--blue); box-shadow: 0 2px 6px rgba(0, 0, 0, .2);
}
input[type="range"]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 3px solid var(--blue); }
.money-input { display: flex; align-items: center; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg); overflow: hidden; max-width: 220px; }
.money-input span { padding: 0 12px; color: var(--ink-3); font-weight: 600; }
.money-input input { border: 0; background: transparent; padding: 12px 12px 12px 0; font: inherit; font-weight: 600; color: var(--ink); width: 100%; }
.money-input input:focus { outline: none; }
.money-input:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 25%, transparent); }

.calc-results { background: var(--ink); color: #c9d3e3; padding: 28px; display: flex; flex-direction: column; gap: 18px; justify-content: center; }
@media (prefers-color-scheme: dark) { .calc-results { background: #060a10; } }
.result { display: flex; flex-direction: column; border-bottom: 1px solid rgba(255, 255, 255, .1); padding-bottom: 14px; }
.result-label { font-size: .85rem; }
.result-value { font-size: 1.9rem; font-weight: 700; color: #fff; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; line-height: 1.2; }
.result-main { border-bottom: 0; padding-bottom: 0; }
.result-main .result-value { font-size: 2.6rem; color: #6cb8ff; }
.result-sub { font-size: .9rem; color: #9fb0c8; }
.calc-disclaimer { font-size: .78rem; color: #8090a8; margin: 0; }
@media (max-width: 760px) { .calc { grid-template-columns: 1fr; } .calc-inputs, .calc-results { padding: 22px; } }

/* Tabs */
.tabs { margin-top: 24px; }
.tab-list { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.tab-list button {
  font: inherit; font-size: .9rem; font-weight: 600; padding: 10px 16px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); background: var(--card); color: var(--ink-2); transition: all .15s;
}
.tab-list button:hover { border-color: var(--blue); color: var(--blue); }
.tab-list button[aria-selected="true"] { background: var(--blue); border-color: var(--blue); color: #fff; }
.tab-panel { background: var(--bg-alt); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; animation: fadeIn .3s ease; }
.tab-panel .check-list { margin: 0; }
.tab-panel .check-list li:last-child { margin-bottom: 0; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (max-width: 560px) {
  .tab-list { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px 20px; padding: 0 16px 6px; scrollbar-width: none; }
  .tab-list::-webkit-scrollbar { display: none; }
  .tab-list button { flex-shrink: 0; }
  .tab-panel { padding: 22px; }
}

/* Mitos */
.myths { display: flex; flex-direction: column; gap: 14px; margin-top: 24px; }
.myth { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--card); }
.myth p { margin: 0; padding: 16px 22px; }
.myth span {
  display: inline-block; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em;
  padding: 3px 9px; border-radius: 6px; margin-right: 10px; vertical-align: 2px;
}
.myth-false { color: var(--ink-3); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--red) 50%, transparent); background: var(--bg-alt); }
.myth-false span { background: color-mix(in srgb, var(--red) 14%, transparent); color: var(--red); text-decoration: none; }
.myth-true { color: var(--ink); }
.myth-true span { background: color-mix(in srgb, var(--green) 15%, transparent); color: var(--green); }

/* Timeline */
.timeline { list-style: none; padding: 0; margin: 28px 0 0; counter-reset: tl; }
.timeline li { position: relative; padding: 0 0 30px 64px; counter-increment: tl; }
.timeline li::before {
  content: counter(tl); position: absolute; left: 0; top: -4px; width: 42px; height: 42px; border-radius: 50%;
  background: var(--blue); color: #fff; font-weight: 700; display: grid; place-items: center;
  box-shadow: 0 0 0 6px var(--blue-soft);
}
.timeline li::after { content: ""; position: absolute; left: 20px; top: 46px; bottom: 4px; width: 2px; background: var(--line); }
.timeline li:last-child { padding-bottom: 0; }
.timeline li:last-child::after { display: none; }
.timeline h3 { margin-bottom: 6px; padding-top: 4px; }
.timeline p { margin: 0; }

/* Checklist */
.checklist { list-style: none; padding: 0; margin: 24px 0 16px; display: grid; gap: 10px; }
.checklist label {
  display: flex; gap: 14px; align-items: flex-start; cursor: pointer; padding: 14px 18px;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--card); transition: border-color .15s, background .15s;
}
.checklist label:hover { border-color: var(--blue); }
.checklist input { width: 20px; height: 20px; accent-color: var(--blue); margin-top: 4px; flex-shrink: 0; cursor: pointer; }
.checklist label:has(input:checked) { background: var(--blue-soft); border-color: var(--blue); color: var(--ink); }
.checklist-score { font-weight: 600; color: var(--blue); }

/* Métricas */
.metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 24px; }
.metric { border-top: 3px solid var(--blue); background: var(--bg-alt); border-radius: 0 0 var(--radius-sm) var(--radius-sm); padding: 20px; }
.metric h3 { font-size: 1.02rem; margin-bottom: 6px; }
.metric p { margin: 0; font-size: .92rem; }
@media (max-width: 860px) { .metrics { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .metrics { grid-template-columns: 1fr; } }

/* FAQ */
.faq { margin-top: 24px; border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  list-style: none; cursor: pointer; padding: 20px 44px 20px 0; position: relative;
  font-weight: 600; color: var(--ink); font-size: 1.05rem; line-height: 1.4;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  width: 30px; height: 30px; border-radius: 50%; background: var(--blue-soft); color: var(--blue);
  display: grid; place-items: center; font-size: 1.2rem; font-weight: 500; transition: transform .2s;
}
.faq details[open] summary::after { content: "−"; }
.faq summary:hover { color: var(--blue); }
.faq details p { padding: 0 44px 20px 0; margin: 0; }

/* ---------- CTA final ---------- */
.final-cta {
  background:
    radial-gradient(700px 400px at 90% 0%, rgba(255, 255, 255, .18), transparent 70%),
    linear-gradient(135deg, #0e7a55 0%, #0a4d36 100%);
  color: #dcebff; padding: 96px 0; text-align: center; margin-top: 40px;
}
.final-inner { max-width: 820px; }
.final-cta h2 { color: #fff; font-size: clamp(2rem, 4.2vw, 3.1rem); letter-spacing: -0.03em; }
.final-cta p { font-size: 1.15rem; max-width: 620px; margin-left: auto; margin-right: auto; }
.eyebrow-light { background: rgba(255, 255, 255, .16); color: #fff; }
.final-cta .btn { margin-top: 14px; }
.final-small { font-size: .9rem !important; margin-top: 18px; opacity: .85; }
@media (max-width: 560px) { .final-cta { padding: 64px 0; } .final-cta .btn { width: 100%; } }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); font-size: .88rem; color: var(--ink-3); }

/* ---------- Animaciones de entrada ---------- */
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s ease; }
.js .reveal.visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal, .js .msg { opacity: 1 !important; transform: none !important; }
}

@media (max-width: 560px) {
  body { font-size: 17px; }
  .hero-actions .btn { width: 100%; }
  .block { padding-bottom: 48px; }
  .block + .block { padding-top: 48px; }
}

/* ---------- Secciones de wiki ---------- */
.sub-h { margin-top: 36px; }
.metrics-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 520px) { .metrics-2 { grid-template-columns: 1fr; } }

.compare-neutral thead th:last-child { background: var(--bg-alt); color: var(--ink); }
.compare-neutral td:nth-child(2), .compare-neutral td:last-child { color: var(--ink-2); background: none; font-weight: 400; }

.glossary { margin: 24px 0 0; display: grid; gap: 0; border-top: 1px solid var(--line); }
.glossary > div { display: grid; grid-template-columns: 240px 1fr; gap: 4px 24px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.glossary dt { color: var(--ink); font-weight: 600; line-height: 1.4; scroll-margin-top: calc(var(--header-h) + 16px); }
.glossary dd { margin: 0; font-size: .95rem; }
@media (max-width: 640px) { .glossary > div { grid-template-columns: 1fr; } }

.sources { padding-left: 1.2em; margin: 16px 0 0; }
.sources li { margin-bottom: 10px; font-size: .95rem; }

/* =========================================================
   Páginas de guía (subpáginas)
   ========================================================= */
h4, h5, h6 { color: var(--ink); line-height: 1.3; margin: 0 0 .4em; font-weight: 600; }
h4 { font-size: 1.02rem; }
h5 { font-size: .95rem; }
h6 { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); }
.article h3 { margin-top: 1.6em; }
.article h4 { margin-top: 1.3em; }
.article h2 + h3, .article h3:first-child { margin-top: .4em; }

/* Cabecera de página */
.page-hero {
  padding: 36px 0 52px;
  background:
    radial-gradient(800px 380px at 90% 0%, color-mix(in srgb, var(--blue) 14%, transparent), transparent 70%),
    var(--bg);
  border-bottom: 1px solid var(--line);
}
.page-hero-inner { max-width: 860px; }
.page-hero h1 { font-size: clamp(2rem, 4.2vw, 3.1rem); margin-bottom: .45em; }
.page-hero .lead { max-width: 720px; }
.page-meta { display: flex; flex-wrap: wrap; gap: 8px 20px; list-style: none; padding: 0; margin: 22px 0 0; font-size: .9rem; color: var(--ink-3); }
.page-meta li { display: inline-flex; align-items: center; gap: 6px; }

/* Migas de pan */
.breadcrumbs ol { list-style: none; padding: 0; margin: 0 0 22px; display: flex; flex-wrap: wrap; gap: 6px; font-size: .86rem; color: var(--ink-3); }
.breadcrumbs li + li::before { content: "/"; margin-right: 6px; opacity: .6; }
.breadcrumbs a { color: var(--ink-3); text-decoration: none; }
.breadcrumbs a:hover { color: var(--blue); }
.breadcrumbs [aria-current="page"] { color: var(--ink-2); }

/* Resumen clave */
.key-points { background: var(--bg-alt); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 26px; margin: 0 0 40px; }
.key-points h2 { font-size: 1rem; text-transform: uppercase; letter-spacing: .08em; color: var(--blue); margin-bottom: 12px; }
.key-points ul { margin: 0; padding-left: 1.1em; }
.key-points li { margin-bottom: 6px; }
.key-points li:last-child { margin-bottom: 0; }

/* Tarjetas de detalle (tipo, ejemplo, paso) */
.item-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px 26px; margin: 18px 0; }
.item-card > h3:first-child, .item-card > h4:first-child { margin-top: 0; }
.item-card p:last-child, .item-card ul:last-child { margin-bottom: 0; }
.item-card .item-tag {
  display: inline-block; font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em;
  color: var(--blue); background: var(--blue-soft); padding: 3px 10px; border-radius: 999px; margin-bottom: 10px;
}
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 14px; }
.facts > div { background: var(--bg-alt); border-radius: var(--radius-sm); padding: 14px 16px; }
.facts h4, .facts h5 { margin: 0 0 4px; font-size: .86rem; color: var(--blue); text-transform: uppercase; letter-spacing: .05em; }
.facts p { margin: 0; font-size: .93rem; }
@media (max-width: 720px) { .facts { grid-template-columns: 1fr; } }

/* Prompt de ejemplo */
.prompt-box { background: #0b1220; color: #d7e3f4; border-radius: var(--radius); padding: 22px 24px; margin: 18px 0; font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: .86rem; line-height: 1.65; overflow-x: auto; white-space: pre-wrap; }
.prompt-box b { color: #7ee2b8; font-weight: 600; }

/* Enlace a guía relacionada dentro del texto */
.guide-link {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 24px 0 0;
  padding: 18px 22px; border-radius: var(--radius); border: 1px solid color-mix(in srgb, var(--blue) 35%, var(--line));
  background: var(--blue-soft); color: var(--ink); text-decoration: none; transition: transform .15s ease, box-shadow .15s ease;
}
.guide-link:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.guide-link span { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--blue); display: block; }
.guide-link strong { font-size: 1.05rem; }
.guide-link svg { flex-shrink: 0; color: var(--blue); }

/* Guías relacionadas */
.related { padding: 64px 0 24px; border-top: 1px solid var(--line); }
.related h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); margin-bottom: 24px; }
.related-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.related-card {
  display: flex; flex-direction: column; gap: 8px; padding: 22px; border-radius: var(--radius); border: 1px solid var(--line);
  background: var(--card); text-decoration: none; color: var(--ink-2); transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.related-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--blue) 40%, var(--line)); }
.related-card .di { font-size: 1.5rem; }
.related-card h3 { margin: 0; font-size: 1.08rem; }
.related-card p { margin: 0; font-size: .92rem; }
.related-card .more { margin-top: auto; padding-top: 6px; font-weight: 600; font-size: .9rem; color: var(--blue); }
@media (max-width: 860px) { .related-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .related-grid { grid-template-columns: 1fr; } }

/* FAQ con encabezados dentro del summary */
.faq summary h3 { display: inline; font-size: inherit; font-weight: inherit; letter-spacing: 0; margin: 0; color: inherit; line-height: inherit; }

/* Título del CTA final (no es un encabezado) */
.final-title { font-size: clamp(2rem, 4.2vw, 3.1rem) !important; font-weight: 600; letter-spacing: -0.03em; line-height: 1.15; color: #fff; max-width: none !important; }

/* ---------- Pie de página ampliado ---------- */
.footer-top { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; padding: 48px 0 32px; }
.footer-brand p { margin: 14px 0 0; max-width: 340px; font-size: .92rem; }
.footer-col p.footer-title { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--ink); margin: 0 0 12px; }
.footer-col ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.footer-col a { color: var(--ink-3); text-decoration: none; font-size: .92rem; }
.footer-col a:hover { color: var(--blue); }
.footer-bottom { border-top: 1px solid var(--line); padding: 20px 0 28px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px 24px; }
.footer-bottom p { margin: 0; }
.footer-bottom a { color: var(--ink-3); text-decoration: none; }
.footer-bottom a:hover { color: var(--blue); }
.site-footer { padding: 0; }
@media (max-width: 760px) { .footer-top { grid-template-columns: 1fr 1fr; } .footer-brand { grid-column: 1 / -1; } }
@media (max-width: 420px) { .footer-top { grid-template-columns: 1fr; } }

/* Recuadro "En tu negocio" */
.biz-note { display: flex; gap: 14px; align-items: flex-start; background: color-mix(in srgb, var(--green) 9%, var(--card)); border: 1px solid color-mix(in srgb, var(--green) 30%, var(--line)); border-radius: var(--radius); padding: 18px 22px; margin: 22px 0; }
.biz-note::before { content: "💼"; font-size: 1.3rem; line-height: 1.5; }
.biz-note p { margin: 0; color: var(--ink); }
.biz-note strong:first-child { color: var(--green); }

/* Portada sin visual: hero de una columna */
.hero-solo .hero-copy { max-width: 860px; }
.hero-solo h1 { font-size: clamp(2.2rem, 5vw, 3.8rem); }
.hero-solo .lead { max-width: 720px; }
.timeline h4 { margin-bottom: 6px; padding-top: 4px; font-size: 1.1rem; }
.hero-guides { margin-top: 36px; padding-top: 26px; border-top: 1px solid var(--line); }
.hero-guides p { font-size: .88rem; font-weight: 600; color: var(--ink-3); margin-bottom: 12px; }
.hero-guides div { display: flex; flex-wrap: wrap; gap: 8px; }
.hero-guides a {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 15px; border-radius: 999px;
  background: var(--card); border: 1px solid var(--line); color: var(--ink); text-decoration: none; font-size: .92rem; font-weight: 500;
  transition: border-color .15s, color .15s, transform .15s;
}
.hero-guides a:hover { border-color: var(--blue); color: var(--blue); transform: translateY(-1px); }


/* =========================================================
   Identidad de web2: crema, verde y coral
   ========================================================= */
:root {
  --ink: #13221d; --ink-2: #34443e; --ink-3: #6a7a74;
  --line: #e4ded3; --bg: #faf7f2; --bg-alt: #f2ece2; --card: #ffffff;
  --coral: #d9472b; --coral-soft: #fbe9e4;
  --font: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Bricolage Grotesque", "Figtree", system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #f1f5f2; --ink-2: #c6d1cc; --ink-3: #8d9b95;
    --line: #26332e; --bg: #0d1412; --bg-alt: #142019; --card: #16231d;
    --coral: #ff7a5c; --coral-soft: #3a1d16;
  }
}
h1, h2, h3, .final-title, .related-card h3 { font-family: var(--display); }
h1, .final-title { font-weight: 800; }
h2 { font-weight: 700; }
.logo { font-family: var(--display); }
.logo-pe { color: var(--coral); }

/* Botones de acción en coral */
.btn { background: var(--coral); box-shadow: 0 8px 22px color-mix(in srgb, var(--coral) 32%, transparent); }
.btn:hover { background: color-mix(in srgb, var(--coral) 86%, #000); box-shadow: 0 12px 28px color-mix(in srgb, var(--coral) 38%, transparent); }
.nav-cta { box-shadow: 0 4px 14px color-mix(in srgb, var(--coral) 30%, transparent); }
.btn-white { background: #fff; color: #0a5f42; }
.btn-white:hover { background: #effaf4; }
.section-num, .item-card .item-tag { color: var(--coral); }
.item-card .item-tag { background: var(--coral-soft); }
.progress span { background: var(--coral); }
.final-cta { position: relative; overflow: hidden; }
.final-cta::before { content: ""; position: absolute; width: 520px; height: 520px; border-radius: 50%; background: rgba(217, 71, 43, .28); filter: blur(90px); right: -160px; top: -220px; pointer-events: none; }
.final-inner { position: relative; }

/* Test de preparación */
.quiz { display: grid; gap: 10px; margin-top: 24px; }
.quiz fieldset { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--card); margin: 0; padding: 14px 18px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.quiz legend { float: left; width: 100%; padding: 0; margin-bottom: 6px; font-weight: 600; color: var(--ink); font-size: .98rem; line-height: 1.45; }
.quiz label { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; padding: 6px 16px; border-radius: 999px; border: 1px solid var(--line); font-size: .92rem; }
.quiz label:has(input:checked) { background: var(--blue-soft); border-color: var(--blue); color: var(--ink); font-weight: 600; }
.quiz input { accent-color: var(--blue); margin: 0; }
.quiz-result { margin-top: 10px; background: #0a5f42; color: #e3f7ee; border-radius: var(--radius); padding: 26px 28px; display: grid; grid-template-columns: auto 1fr; gap: 6px 24px; align-items: center; }
.quiz-result p { margin: 0; }
.quiz-result strong { color: #fff; }
.quiz-score { font-family: var(--display); font-size: 3rem; font-weight: 800; color: #fff; line-height: 1; }
@media (max-width: 560px) { .quiz-result { grid-template-columns: 1fr; } }

/* Tarjetas de pago (Yape, Plin, link, transferencia) */
.pay { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 24px 0; }
.pay-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; display: flex; flex-direction: column; }
.pay-card h3 { margin-top: 0; }
.pay-card p { font-size: .95rem; }
.pay-card p:last-child { margin: auto 0 0; }
.pay-warn, .pay-ok { padding: 12px 14px; border-radius: var(--radius-sm); font-size: .9rem !important; }
.pay-warn { background: var(--coral-soft); }
.pay-ok { background: var(--blue-soft); }
@media (max-width: 760px) { .pay { grid-template-columns: 1fr; } }

/* Un día con un agente */
.day { list-style: none; padding: 0; margin: 26px 0; }
.day li { display: grid; grid-template-columns: 76px 1fr; gap: 18px; padding: 0 0 22px; position: relative; }
.day li::after { content: ""; position: absolute; left: 37px; top: 36px; bottom: 0; width: 2px; background: var(--line); }
.day li:last-child::after { display: none; }
.day time { font-family: var(--display); font-weight: 700; font-size: .95rem; color: #0a5f42; background: var(--blue-soft); border-radius: 10px; height: 36px; display: grid; place-items: center; position: relative; z-index: 1; }
@media (prefers-color-scheme: dark) { .day time { color: var(--blue); } }
.day h3 { margin: 5px 0 4px !important; }
.day p { margin: 0; font-size: .97rem; }
