/*
 * Capa visual transversal de Provinet.
 * Se carga al final de cada página: no altera navegación, contenido ni enlaces.
 */
:root {
  --pv-polish-red: #e60012;
  --pv-polish-red-deep: #bd0010;
  --pv-polish-ink: #171b25;
  --pv-polish-muted: #596579;
  --pv-polish-line: #e4e9ef;
  --pv-polish-paper: #fff;
  --pv-polish-ice: #f8fafc;
  --pv-polish-shadow: 0 14px 34px rgba(19, 29, 43, .08);
}

/* La textura queda limitada al contenido, dejando intactas la cabecera y el footer. */
main {
  position: relative;
  isolation: isolate;
}

main::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  opacity: .55;
  background-image:
    linear-gradient(rgba(230, 0, 18, .022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(230, 0, 18, .022) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: linear-gradient(to bottom, transparent 0, #000 9%, #000 91%, transparent 100%);
}

/* Inicio: eleva superficies comerciales sin sustituir sus estilos o fotografías. */
body[data-page="inicio"] .service-strip article,
body[data-page="inicio"] .showcase-grid > article,
body[data-page="inicio"] .support-grid > a,
body[data-page="inicio"] .benefits > article {
  border-color: rgba(218, 224, 232, .92);
  box-shadow: 0 10px 26px rgba(19, 29, 43, .055);
  transition: transform 200ms ease, box-shadow 200ms ease, border-color 200ms ease;
}

body[data-page="inicio"] .service-strip article:hover,
body[data-page="inicio"] .showcase-grid > article:hover,
body[data-page="inicio"] .support-grid > a:hover,
body[data-page="inicio"] .benefits > article:hover {
  transform: translateY(-4px);
  border-color: rgba(230, 0, 18, .32);
  box-shadow: var(--pv-polish-shadow);
}

body[data-page="inicio"] .coverage-quick,
body[data-page="inicio"] .coverage-callout {
  background-image:
    radial-gradient(circle at 95% 90%, rgba(230, 0, 18, .11), transparent 31%),
    linear-gradient(130deg, rgba(255,255,255,.96), rgba(255,248,249,.88));
  box-shadow: var(--pv-polish-shadow);
}

body[data-page="inicio"] .coverage-form,
body[data-page="inicio"] .coverage-callout .coverage-form {
  box-shadow: 0 8px 24px rgba(20, 31, 48, .045);
}

/* Servicios: superficies claras y controles con foco inequívoco. */
body:has(.services-hero) .service-card,
body:has(.services-hero) .plan-option,
body:has(.services-hero) .guide-grid article,
body:has(.services-hero) .faq details {
  border-color: rgba(221, 227, 235, .98);
  box-shadow: 0 9px 24px rgba(20, 31, 48, .045);
}

body:has(.services-hero) .service-card:hover,
body:has(.services-hero) .plan-option:hover,
body:has(.services-hero) .guide-grid article:hover {
  transform: translateY(-3px);
  border-color: rgba(230, 0, 18, .28);
  box-shadow: var(--pv-polish-shadow);
}

body:has(.services-hero) .coverage-callout,
body[data-page="inicio"] .coverage-quick {
  border-color: rgba(230, 0, 18, .22);
}

body:has(.services-hero) .plan-option.is-selected,
body:has(.services-hero) .plan-option[aria-selected="true"] {
  box-shadow: 0 14px 30px rgba(230, 0, 18, .12);
}

/* Centro documental: legibilidad editorial del contenido legal. */
body:has(.norm-hub) .norm-directory a,
body:has(.norm-hub) .norm-paper,
body:has(.norm-hub) .norm-toc {
  box-shadow: 0 10px 27px rgba(19, 29, 43, .055);
}

body:has(.norm-hub) .norm-paper {
  background: linear-gradient(145deg, #fff 0%, #fff 76%, #fff8f8 100%);
}

body:has(.norm-hub) .norm-section {
  border-color: #edf0f3;
}

body:has(.norm-hub) .norm-section h3::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin: 0 9px 2px 0;
  border-radius: 50%;
  background: var(--pv-polish-red);
}

/* Protección infantil: conserva el contraste del bloque de orientación. */
body:has(.tool-grid) .tool-grid article,
body:has(.tool-grid) .report-grid a {
  transition: transform 200ms ease, border-color 200ms ease, box-shadow 200ms ease;
}

body:has(.tool-grid) .tool-grid article:hover,
body:has(.tool-grid) .report-grid a:hover {
  transform: translateY(-4px);
  box-shadow: var(--pv-polish-shadow);
}

body:has(.tool-grid) .commitment {
  border-top: 1px solid rgba(230, 0, 18, .15);
}

/* Controles: todos los enlaces y formularios conservan un foco consistente por teclado. */
:where(main) :is(a, button, input, select, textarea, summary):focus-visible {
  outline: 3px solid rgba(230, 0, 18, .42);
  outline-offset: 3px;
}

:where(main) :is(input, select, textarea) {
  transition: border-color 180ms ease, box-shadow 180ms ease, background-color 180ms ease;
}

:where(main) :is(input, select, textarea):focus {
  border-color: var(--pv-polish-red);
  box-shadow: 0 0 0 4px rgba(230, 0, 18, .10);
}

@media (max-width: 760px) {
  main::before { background-size: 38px 38px; opacity: .42; }

  body[data-page="inicio"] .service-strip article:hover,
  body[data-page="inicio"] .showcase-grid > article:hover,
  body[data-page="inicio"] .support-grid > a:hover,
  body:has(.services-hero) .service-card:hover,
  body:has(.services-hero) .plan-option:hover,
  body:has(.services-hero) .guide-grid article:hover,
  body:has(.tool-grid) .tool-grid article:hover,
  body:has(.tool-grid) .report-grid a:hover {
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* Destinos de Zona Usuarios: aparecen solo cuando se navega a ellos desde el menú. */
#soporte:target,
#pqr:target,
#seguimiento:target {
  display: grid !important;
  scroll-margin-top: 28px;
}
