/* ═══════════════════════════════════════════════════════════════
   CSS específico de Auditoría en Marketing (auditoria-marketing.html)
   Se carga después de css/style.css.
   ═══════════════════════════════════════════════════════════════ */

/* ── Hero: copy + simulación de performance (Three.js) ── */
/* En style.css las reglas base de .hero-corp-sub/-actions van después de sus modificadores --left y los pisan;
   aquí se acota al hero de esta página para no mover los heros de otras páginas. */
.aud-hero .hero-corp-sub--left { margin: 0 0 1rem; max-width: 34em; }
.aud-hero .hero-corp-actions--left { justify-content: flex-start; margin-bottom: 0; }
.aud-qualify {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  margin: .4rem 0 2rem;
  padding: .55rem 1.1rem .55rem .6rem;
  border-radius: 999px;
  background: var(--paper);
  border: 1px solid var(--line);
  font-size: .88rem;
  color: var(--ink-3);
  line-height: 1.35;
}
.aud-qualify .bi {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--brand);
  color: var(--ink);
  font-size: .85rem;
  flex-shrink: 0;
}
.aud-qualify b { color: var(--ink); }

/* Panel oscuro: canvas Three.js de fondo (js/auditoria-hero.js) + capa HTML con la tasa y los ajustes.
   La capa HTML funciona sola: si WebGL o Three.js no cargan, el panel queda con su degradado. */
.perf-demo-wrap { margin: 0; }
.perf-demo {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  aspect-ratio: 1 / .94;
  min-height: 460px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, .08);
  background:
    radial-gradient(120% 80% at 92% 0%, rgba(242, 180, 0, .13), transparent 58%),
    linear-gradient(180deg, #0F1829 0%, #0B1220 100%);
  box-shadow: 0 30px 70px rgba(11, 18, 32, .30);
  color: #fff;
}
.perf-canvas { position: absolute; inset: 0; z-index: 0; display: block; width: 100%; height: 100%; opacity: 0; transition: opacity 1.2s ease; }
.perf-demo.is-3d .perf-canvas { opacity: 1; }
/* Velo inferior: la lista de ajustes se lee sobre las partículas */
.perf-demo::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(to top, rgba(11, 18, 32, .96) 0%, rgba(11, 18, 32, .78) 30%, rgba(11, 18, 32, 0) 56%);
}
.perf-ui { position: absolute; inset: 0; z-index: 2; display: flex; flex-direction: column; justify-content: space-between; padding: 1.9rem 1.9rem 1.6rem; pointer-events: none; }

.perf-label { display: inline-flex; align-items: center; gap: .55rem; font-size: .8rem; font-weight: 600; letter-spacing: .02em; color: rgba(255, 255, 255, .62); }
.perf-live { position: relative; width: 8px; height: 8px; border-radius: 50%; background: #22C55E; }
.perf-live::after { content: ''; position: absolute; inset: -4px; border-radius: 50%; border: 1.5px solid rgba(34, 197, 94, .55); animation: perfLive 2s cubic-bezier(.16, 1, .3, 1) infinite; }
.perf-rate {
  display: flex;
  align-items: baseline;
  margin-top: .35rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(3.6rem, 7.4vw, 6rem);
  line-height: 1;
  letter-spacing: -.03em;
  font-variant-numeric: lining-nums tabular-nums;
}
.perf-num { color: #fff; transition: text-shadow .9s ease; }
.perf-pct { margin-left: .06em; font-size: .52em; color: var(--brand); }
.perf-demo.is-bump .perf-num { text-shadow: 0 0 34px rgba(242, 180, 0, .45); transition-duration: .15s; }
.perf-delta {
  display: inline-flex;
  align-items: center;
  gap: .15rem;
  margin-top: .7rem;
  padding: .25rem .65rem .25rem .4rem;
  border-radius: 999px;
  background: rgba(34, 197, 94, .14);
  color: #4ADE80;
  font-size: .8rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .35s ease, transform .5s cubic-bezier(.16, 1, .3, 1);
}
.perf-delta .bi { font-size: 1.1rem; line-height: 1; }
.perf-delta.is-on { opacity: 1; transform: none; }

.perf-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: .2rem; }
.perf-step { display: flex; align-items: center; gap: .75rem; padding: .42rem .6rem; border-radius: 10px; font-size: .9rem; color: rgba(255, 255, 255, .42); transition: color .4s ease, background-color .4s ease; }
.perf-tick {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, .2);
  transition: background-color .3s ease, border-color .3s ease, transform .45s cubic-bezier(.16, 1, .3, 1);
}
.perf-tick .bi { font-size: .82rem; line-height: 1; color: #0B1220; opacity: 0; transform: scale(.4); transition: opacity .2s ease, transform .4s cubic-bezier(.16, 1, .3, 1); }
.perf-step.is-active { color: #fff; background: rgba(255, 255, 255, .05); }
.perf-step.is-active .perf-tick { border-color: rgba(242, 180, 0, .25); border-top-color: var(--brand); animation: perfSpin .8s linear infinite; }
.perf-step.is-done { color: rgba(255, 255, 255, .86); }
.perf-step.is-done .perf-tick { background: #22C55E; border-color: #22C55E; box-shadow: 0 0 0 4px rgba(34, 197, 94, .16); }
.perf-step.is-done .perf-tick .bi { opacity: 1; transform: none; }
.perf-cap { position: relative; width: fit-content; max-width: 100%; margin: .9rem auto 0; padding: .25rem .8rem; border-radius: 999px; background: rgba(255, 255, 255, .92); font-size: .76rem; color: var(--muted); text-align: center; }

@keyframes perfSpin { to { transform: rotate(360deg); } }
@keyframes perfLive { from { transform: scale(.6); opacity: 1; } to { transform: scale(1.6); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .perf-live::after, .perf-step.is-active .perf-tick { animation: none; }
}

@media (max-width: 575px) {
  .aud-qualify { border-radius: 16px; align-items: flex-start; }
  .perf-demo { aspect-ratio: auto; min-height: 470px; border-radius: 18px; }
  .perf-ui { padding: 1.4rem 1.1rem 1.1rem; }
  .perf-rate { font-size: 3.6rem; }
  .perf-step { font-size: .84rem; padding: .38rem .45rem; gap: .6rem; }
}

/* ── Invertir más vs. optimizar: embudo con fugas ── */
.aud-why { padding: 5rem 0; background: var(--paper); border-top: 1px solid var(--line); }
.aud-why-lead { max-width: 52ch; }
.aud-seg { display: inline-flex; flex-wrap: wrap; gap: .2rem; margin: 1.5rem 0 1.1rem; padding: .3rem; background: #fff; border: 1px solid var(--line); border-radius: 999px; }
.aud-seg-opt { position: relative; margin: 0; }
.aud-seg-opt input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.aud-seg-opt span { display: block; padding: .55rem 1.15rem; border-radius: 999px; font-size: .88rem; font-weight: 600; color: var(--ink-3); transition: background-color .2s ease, color .2s ease; }
.aud-seg-opt:hover span { background: var(--paper); }
.aud-seg-opt input:checked + span { background: var(--ink); color: #fff; }
.aud-seg-opt input:focus-visible + span { box-shadow: 0 0 0 .2rem rgba(242, 180, 0, .5); }
.aud-why-note { margin: 0; max-width: 46ch; min-height: 4.8em; font-size: .97rem; line-height: 1.6; color: var(--ink-3); }

.aud-funnel {
  display: grid;
  grid-template-columns: 9rem minmax(0, 1fr);
  align-items: center;
  column-gap: 1.2rem;
  row-gap: .3rem;
  padding: 1.9rem 1.9rem 1.3rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.aud-row { display: contents; }
.aud-stage { font-size: .84rem; font-weight: 600; color: var(--ink-3); line-height: 1.25; }
.aud-track { display: flex; justify-content: center; height: 38px; background: var(--paper); border-radius: 9px; }
/* El ancho visible se recorta con clip-path (sin animar width): inset lateral = (100% - ancho del escenario) / 2 */
.aud-bar { width: 100%; height: 100%; background: var(--ink); clip-path: inset(0 calc((100% - var(--hoy)) / 2) round 9px); transition: clip-path .85s cubic-bezier(.16, 1, .3, 1); }
.aud-row--result .aud-stage { color: var(--ink); font-weight: 700; }
.aud-row--result .aud-bar { background: var(--brand); }
.aud-funnel[data-state="mas"] .aud-bar { clip-path: inset(0 calc((100% - var(--mas)) / 2) round 9px); }
.aud-funnel[data-state="optimizar"] .aud-bar { clip-path: inset(0 calc((100% - var(--opt)) / 2) round 9px); }
.aud-leak { grid-column: 2; display: flex; align-items: center; justify-content: center; gap: .4rem; padding: .2rem 0; font-size: .76rem; color: var(--muted); transition: color .3s ease; }
.aud-leak .bi { font-size: .8rem; }
.aud-leak-on { color: #9AA3B0; }
.aud-leak-off { display: none; color: #B8860B; }
.aud-funnel[data-state="optimizar"] .aud-leak { color: var(--ink-2); }
.aud-funnel[data-state="optimizar"] .aud-leak-on { display: none; }
.aud-funnel[data-state="optimizar"] .aud-leak-off { display: inline-block; }
.aud-funnel-cap { grid-column: 1 / -1; margin: 1rem 0 0; font-size: .74rem; color: var(--muted); text-align: center; }
@media (prefers-reduced-motion: reduce) { .aud-bar { transition: none; } }
@media (max-width: 575px) {
  .aud-funnel { grid-template-columns: 5.6rem minmax(0, 1fr); column-gap: .8rem; padding: 1.3rem 1.1rem 1rem; }
  .aud-stage { font-size: .76rem; }
  .aud-track { height: 32px; }
  .aud-leak { font-size: .72rem; }
  .aud-seg { display: flex; border-radius: 18px; }
  .aud-seg-opt { flex: 1; }
  .aud-seg-opt span { text-align: center; padding: .55rem .5rem; border-radius: 14px; }
}

/* ── Qué auditamos: filas editoriales ── */
.aud-scope-section { padding: 5rem 0; background: #fff; }
.aud-head { max-width: 640px; margin-bottom: 2.6rem; }
.aud-scope { border-bottom: 1px solid var(--line); }
.aud-scope-row { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 2.5rem; padding: 2.3rem 0; border-top: 1px solid var(--line); }
.aud-scope-title { font-family: var(--font-display); font-weight: 600; font-size: clamp(1.5rem, 2.4vw, 1.9rem); line-height: 1.15; letter-spacing: -.01em; color: var(--ink); margin-bottom: .55rem; }
.aud-scope-intro p { margin: 0; max-width: 36ch; font-size: .95rem; line-height: 1.55; color: var(--muted); }
.aud-scope-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: .8rem 2rem; align-content: start; }
.aud-scope-list li { position: relative; padding-left: 1.15rem; font-size: .94rem; line-height: 1.45; color: var(--ink-3); }
.aud-scope-list li::before { content: ''; position: absolute; left: 0; top: .55em; width: 6px; height: 6px; border-radius: 50%; background: var(--brand); }
.aud-scope-note { margin: 1.5rem 0 0; font-size: .92rem; color: var(--muted); }
.aud-scope-note b { color: var(--ink-2); }
@media (max-width: 991px) { .aud-scope-row { grid-template-columns: 1fr; gap: 1.1rem; padding: 1.9rem 0; } }
@media (max-width: 575px) { .aud-scope-list { grid-template-columns: 1fr; gap: .65rem; } }

/* ── Qué recibes: anatomía del informe + ficha del servicio ── */
.aud-deliver-section { padding: 5rem 0; background: var(--paper); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); scroll-margin-top: 4.5rem; }
.aud-deliver { list-style: none; margin: 2.2rem 0 0; padding: 0; }
.aud-deliver li { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 1rem; padding: 1.15rem 0; border-top: 1px solid var(--line); }
.aud-deliver li:last-child { border-bottom: 1px solid var(--line); }
.aud-deliver .bi { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 50%; background: var(--brand-soft); color: var(--ink); font-size: .95rem; }
.aud-deliver b { display: block; margin-bottom: .15rem; font-size: 1.02rem; color: var(--ink-2); }
.aud-deliver span { font-size: .93rem; line-height: 1.5; color: var(--muted); }

.aud-spec { position: sticky; top: 6.5rem; padding: 1.9rem; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); }
.aud-spec-title { font-family: var(--font-display); font-weight: 600; font-size: 1.4rem; color: var(--ink); margin-bottom: .9rem; }
.aud-spec dl { margin: 0 0 1.5rem; }
.aud-spec-row { display: grid; grid-template-columns: 7.8rem minmax(0, 1fr); gap: 1rem; padding: .8rem 0; border-top: 1px solid var(--line); }
.aud-spec dt { font-size: .8rem; font-weight: 600; color: var(--muted); line-height: 1.45; }
.aud-spec dd { margin: 0; font-size: .92rem; font-weight: 500; line-height: 1.45; color: var(--ink-2); }
.aud-spec-no { display: inline-flex; align-items: center; gap: .35rem; }
.aud-spec-no .bi { color: #9AA3B0; }
.aud-spec .btn-pill { width: 100%; }
.aud-spec-note { margin: 1rem 0 0; font-size: .83rem; line-height: 1.55; color: var(--muted); }
@media (max-width: 991px) { .aud-spec { position: static; } }
@media (max-width: 575px) {
  .aud-spec { padding: 1.4rem 1.2rem; }
  .aud-spec-row { grid-template-columns: 1fr; gap: .15rem; }
}

/* ── Cómo funciona + para quién ── */
.aud-process-section { padding: 5rem 0; background: #fff; }
.aud-steps { list-style: none; margin: 2.6rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); column-gap: 1.6rem; row-gap: 1.1rem; counter-reset: audStep; }
.aud-step { position: relative; padding-top: 3.4rem; counter-increment: audStep; }
.aud-step::before {
  content: counter(audStep);
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #fff;
  border: 1.5px solid var(--ink);
  font-weight: 700;
  font-size: .95rem;
  color: var(--ink);
}
.aud-step:not(:nth-child(4))::after { content: ''; position: absolute; top: 21px; left: 50px; right: -1.2rem; height: 1px; background: var(--line); }
.aud-step:nth-child(4)::before { background: var(--brand); border-color: var(--brand); }
.aud-step-title { font-size: 1.04rem; font-weight: 700; color: var(--ink-2); margin-bottom: .35rem; }
.aud-step p { margin: 0; font-size: .9rem; line-height: 1.55; color: var(--muted); }
.aud-timing { grid-column: 2 / 5; position: relative; margin-top: .4rem; padding-top: .9rem; border-top: 2px solid var(--brand); text-align: center; font-size: .86rem; font-weight: 600; color: var(--ink-2); }
.aud-timing::before, .aud-timing::after { content: ''; position: absolute; top: -8px; width: 2px; height: 14px; background: var(--brand); }
.aud-timing::before { left: 0; }
.aud-timing::after { right: 0; }
.aud-timing .bi { color: #B8860B; margin-right: .3rem; }

.aud-fit { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 1.3rem 1.5rem; align-items: start; margin-top: 3.5rem; padding: 2rem 2.2rem; background: var(--brand-soft); border: 1px solid rgba(242, 180, 0, .35); border-radius: var(--radius-lg); }
.aud-fit-icon { display: flex; align-items: center; justify-content: center; width: 50px; height: 50px; border-radius: 14px; background: var(--brand); color: var(--ink); font-size: 1.35rem; }
.aud-fit-title { font-family: var(--font-display); font-weight: 600; font-size: clamp(1.3rem, 2.2vw, 1.6rem); line-height: 1.25; color: var(--ink); margin-bottom: .45rem; }
.aud-fit p { margin: 0; max-width: 70ch; font-size: .96rem; line-height: 1.6; color: var(--ink-3); }
.aud-fit a { color: var(--ink); font-weight: 600; text-decoration-color: rgba(11, 18, 32, .35); text-underline-offset: 3px; }
.aud-fit a:hover { text-decoration-color: var(--ink); }
@media (max-width: 991px) {
  .aud-steps { grid-template-columns: 1fr 1fr; row-gap: 2rem; }
  .aud-step::after { display: none; }
  .aud-timing { grid-column: 1 / -1; }
}
@media (max-width: 575px) {
  .aud-steps { grid-template-columns: 1fr; row-gap: 1.4rem; }
  .aud-step { padding: .45rem 0 0 3.6rem; min-height: 42px; }
  .aud-fit { grid-template-columns: 1fr; padding: 1.6rem 1.3rem; }
  .aud-timing { margin-top: 0; padding: .9rem 1rem; border: 1px solid rgba(242, 180, 0, .45); border-radius: 14px; background: var(--brand-soft); text-align: left; }
  .aud-timing::before, .aud-timing::after { display: none; }
}

/* ── Opiniones (estáticas, junto al FAQ) ── */
.aud-reviews { display: grid; gap: 1rem; }
.aud-reviews .review-card { min-width: 0; padding: 1.6rem 1.6rem 1.4rem; }
.aud-reviews .review-stars { display: flex; gap: 3px; font-size: 1rem; letter-spacing: 0; }
.aud-reviews .review-text { font-size: .95rem; line-height: 1.65; }

/* Anchos del embudo por escenario (Hoy / Invertir más / Optimizar) */
.aud-row--1 { --hoy: 60%; --mas: 100%; --opt: 60%; }
.aud-row--2 { --hoy: 38%; --mas: 62%;  --opt: 50%; }
.aud-row--3 { --hoy: 22%; --mas: 35%;  --opt: 40%; }
.aud-row--4 { --hoy: 12%; --mas: 19%;  --opt: 31%; }
.aud-row--5 { --hoy: 6%;  --mas: 9%;   --opt: 22%; }

/* Textos que antes iban con style="" en el HTML */
.aud-deliver-lead { max-width: 56ch; }
.aud-cta-lead { max-width: 560px; margin: 0 auto 1.5rem; }
