/* ECEP · Dossier completo para lectura e impresión en PDF */
.ecep-pdf-tile-wrap {
  position: relative;
  display: flex;
  min-width: 0;
}

.ecep-pdf-tile-wrap > .ecp-tile {
  width: 100%;
  min-width: 0;
  padding-bottom: 74px;
}

.ecep-pdf-tile-link {
  position: absolute;
  right: 20px;
  bottom: 20px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  padding: 8px 13px;
  border: 1px solid color-mix(in srgb, var(--tc, #0e7d8a) 34%, #dbe4e6);
  border-radius: 10px;
  background: #fff;
  color: var(--tc, #0e7d8a);
  box-shadow: 0 6px 18px -12px rgba(15, 23, 42, .5);
  font: 700 13px/1.2 Inter, system-ui, sans-serif;
  text-decoration: none;
}

.ecep-pdf-tile-link:hover,
.ecep-pdf-tile-link:focus-visible {
  border-color: var(--tc, #0e7d8a);
  background: var(--ts, #e4f1f2);
  color: var(--tc, #0e7d8a);
  outline: none;
}

.ecep-pdf-index-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 14px;
  border: 1px solid rgba(255, 255, 255, .58);
  border-radius: 999px;
  background: #fff;
  color: var(--acc-ink, #0a444e) !important;
  box-shadow: 0 8px 24px -16px rgba(15, 23, 42, .7);
  font: 800 13px/1.2 Inter, system-ui, sans-serif;
  text-decoration: none;
}

.ecep-pdf-index-link:hover,
.ecep-pdf-index-link:focus-visible {
  background: var(--acc-soft, #e4f1f2);
  outline: 3px solid rgba(255, 255, 255, .38);
  outline-offset: 2px;
}

body.ecep-pdf-view {
  margin: 0;
  background: #e7ecef !important;
  color: #172033;
}

body.ecep-pdf-view > main,
body.ecep-pdf-view > footer,
body.ecep-pdf-view > .ecep-watermark,
body.ecep-pdf-view > .ec-cta-portafolio {
  display: none !important;
}

.ecep-pdf-status {
  max-width: 660px;
  margin: 14vh auto 0;
  padding: 30px;
  border: 1px solid #d9e2e6;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 24px 70px -42px rgba(15, 23, 42, .7);
  text-align: center;
  font-family: Inter, system-ui, sans-serif;
}

.ecep-pdf-status h1 { margin: 0 0 9px; font: 800 23px/1.25 Poppins, Inter, sans-serif; }
.ecep-pdf-status p { margin: 0; color: #526170; line-height: 1.6; }
.ecep-pdf-status progress { width: 100%; height: 10px; margin-top: 20px; accent-color: #0e7d8a; }
.ecep-pdf-status.is-error { border-color: #fecaca; }
.ecep-pdf-status.is-error h1 { color: #b91c1c; }
.ecep-pdf-status button { margin-top: 18px; border: 0; border-radius: 10px; padding: 10px 16px; background: #0e7d8a; color: #fff; font-weight: 800; cursor: pointer; }

.ecep-pdf-toolbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 18px;
  background: rgba(15, 23, 42, .94);
  color: #fff;
  backdrop-filter: blur(12px);
  font-family: Inter, system-ui, sans-serif;
}

.ecep-pdf-toolbar .label { margin-right: 8px; font-size: 13px; color: #cbd5e1; }
.ecep-pdf-toolbar button,
.ecep-pdf-toolbar a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  padding: 9px 15px;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 10px;
  background: #fff;
  color: #0f172a;
  font: 800 13px/1.2 Inter, system-ui, sans-serif;
  text-decoration: none;
  cursor: pointer;
}

.ecep-pdf-toolbar button { background: #fbbf24; border-color: #fbbf24; }
.ecep-pdf-toolbar button:hover,
.ecep-pdf-toolbar a:hover { filter: brightness(.97); }

.ecep-pdf-watermark {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  overflow: hidden;
  pointer-events: none;
  user-select: none;
}

.ecep-pdf-watermark span {
  width: 190mm;
  color: rgba(14, 125, 138, .05);
  font: 800 22pt/1 Poppins, Inter, system-ui, sans-serif;
  letter-spacing: .12em;
  text-align: center;
  text-transform: uppercase;
  white-space: nowrap;
  transform: rotate(-27deg);
}

.ecep-pdf-document {
  width: min(100% - 32px, 210mm);
  margin: 24px auto 60px;
  background: #fff;
  box-shadow: 0 24px 80px -48px rgba(15, 23, 42, .85);
}

.ecep-pdf-document .ec { background: #fff; }
.ecep-pdf-cover {
  position: relative;
  min-height: 270mm;
  padding: 30mm 20mm 22mm;
  overflow: hidden;
  color: #fff;
  background: linear-gradient(145deg, var(--acc, #0e7d8a), color-mix(in srgb, var(--acc, #0e7d8a) 55%, #0f172a));
}

.ecep-pdf-cover::after {
  content: '';
  position: absolute;
  right: -45mm;
  bottom: -45mm;
  width: 135mm;
  height: 135mm;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 50%;
  box-shadow: 0 0 0 18mm rgba(255, 255, 255, .04), 0 0 0 36mm rgba(255, 255, 255, .025);
}

.ecep-pdf-cover > * { position: relative; z-index: 1; }
.ecep-pdf-cover .brand { margin: 0 0 28mm; font: 800 12px/1.2 Poppins, Inter, sans-serif; letter-spacing: .12em; text-transform: uppercase; }
.ecep-pdf-document .ecep-pdf-cover h1 { max-width: 15ch; margin: 0 0 8mm; color: #fff; font: 800 34pt/1.08 Poppins, Inter, sans-serif; letter-spacing: -.035em; }
.ecep-pdf-cover .lede { max-width: 70ch; margin: 0; color: rgba(255, 255, 255, .92); font: 500 12pt/1.62 Inter, sans-serif; }
.ecep-pdf-cover .edition { margin: 9mm 0 0; color: rgba(255, 255, 255, .78); font: 700 9.5pt/1.4 Inter, sans-serif; }
.ecep-pdf-cover .contents { margin: 20mm 0 0; padding: 8mm; border: 1px solid rgba(255, 255, 255, .24); border-radius: 5mm; background: rgba(15, 23, 42, .18); }
.ecep-pdf-cover .contents h2 { margin: 0 0 4mm; color: #fff; font: 800 14pt/1.2 Poppins, Inter, sans-serif; }
.ecep-pdf-cover ol { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5mm 8mm; margin: 0; padding-left: 6mm; }
.ecep-pdf-cover li { padding-left: 1mm; color: #fff; font: 600 9.5pt/1.35 Inter, sans-serif; }

.ecep-pdf-chapter { break-before: page; page-break-before: always; }
.ecep-pdf-chapter-head {
  padding: 18mm 16mm 10mm;
  border-bottom: 1px solid #dbe4e6;
  background: linear-gradient(180deg, var(--acc-soft, #e4f1f2), #fff);
}
.ecep-pdf-chapter-head .number { display: inline-flex; padding: 2mm 3.5mm; border-radius: 99px; background: var(--acc, #0e7d8a); color: #fff; font: 800 8.5pt/1 Poppins, Inter, sans-serif; letter-spacing: .06em; text-transform: uppercase; }
.ecep-pdf-chapter-head h2 { margin: 4mm 0 3mm; color: #0f172a; font: 800 24pt/1.1 Poppins, Inter, sans-serif; letter-spacing: -.025em; }
.ecep-pdf-chapter-head p { max-width: 72ch; margin: 0; color: #475569; font: 500 10.5pt/1.55 Inter, sans-serif; }

.ecep-pdf-chapter .ec-section { padding: 9mm 0; }
.ecep-pdf-chapter .ec-wrap { max-width: none; padding: 0 16mm; }
.ecep-pdf-chapter .ec-section > .ec-wrap > h2 { font-size: 19pt; }
.ecep-pdf-chapter .ec-card { box-shadow: none; }
.ecep-pdf-chapter .ec-card p,
.ecep-pdf-chapter .ec-card li { font-size: 10.5pt; line-height: 1.55; }
.ecep-pdf-chapter .ec-card header { break-after: avoid-page; page-break-after: avoid; }
.ecep-pdf-chapter .ec-card header h3 { font-size: 14pt; }
.ecep-pdf-chapter .ec-card .body { padding: 5mm 6mm; }
.ecep-pdf-chapter .note,
.ecep-pdf-chapter .ec-check,
.ecep-pdf-chapter .ec-caso,
.ecep-pdf-chapter .ec-lectura,
.ecep-pdf-chapter figure,
.ecep-pdf-chapter table { break-inside: avoid-page; page-break-inside: avoid; }
.ecep-pdf-chapter .ec-caso .a,
.ecep-pdf-chapter .ec-check .a { display: block !important; }
.ecep-pdf-chapter .ec-caso button,
.ecep-pdf-chapter .ec-check button,
.ecep-pdf-chapter .ec-done,
.ecep-pdf-chapter .ec-progress,
.ecep-pdf-chapter .ec-caso-hint,
.ecep-pdf-chapter .veredicto { display: none !important; }
.ecep-pdf-chapter img,
.ecep-pdf-chapter svg { max-width: 100%; height: auto; max-height: 180mm; object-fit: contain; }
.ecep-pdf-chapter a { color: inherit; text-decoration-color: #94a3b8; }

@media (max-width: 680px) {
  .ecep-pdf-tile-wrap > .ecp-tile { padding-bottom: 78px; }
  .ecep-pdf-toolbar { flex-wrap: wrap; }
  .ecep-pdf-toolbar .label { width: 100%; margin: 0; text-align: center; }
  .ecep-pdf-document { width: 100%; margin: 0; }
  .ecep-pdf-cover { min-height: auto; padding: 42px 24px; }
  .ecep-pdf-cover .brand { margin-bottom: 46px; }
  .ecep-pdf-cover h1 { font-size: 31px; }
  .ecep-pdf-cover ol { grid-template-columns: 1fr; }
  .ecep-pdf-chapter-head { padding: 34px 22px 24px; }
  .ecep-pdf-chapter-head h2 { font-size: 26px; }
  .ecep-pdf-chapter .ec-wrap { padding: 0 22px; }
}

@page {
  size: A4;
  margin: 15mm 13mm 17mm;
}

@media print {
  html,
  body.ecep-pdf-view { background: #fff !important; }
  html.ecep-protected body.ecep-pdf-view { display: block !important; }
  html.ecep-protected::after { content: none !important; display: none !important; }
  .ecep-pdf-toolbar,
  .ecep-pdf-status { display: none !important; }
  .ecep-pdf-watermark {
    display: grid !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .ecep-pdf-watermark span { color: rgba(14, 125, 138, .05) !important; }
  .ecep-pdf-document { width: auto; margin: 0; box-shadow: none; }
  .ecep-pdf-cover {
    min-height: 267mm;
    margin: -15mm -13mm -17mm;
    padding: 30mm 26mm 22mm;
    break-after: page;
    page-break-after: always;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .ecep-pdf-chapter-head { margin: -15mm -13mm 8mm; padding: 18mm 16mm 10mm; }
  .ecep-pdf-chapter .ec-wrap { padding: 0; }
  .ecep-pdf-chapter .ec-section { padding: 5mm 0; }
  .ecep-pdf-chapter .ec-card { margin: 5mm 0; }
  .ecep-pdf-chapter p,
  .ecep-pdf-chapter li { orphans: 3; widows: 3; }
  .ecep-pdf-chapter h2,
  .ecep-pdf-chapter h3,
  .ecep-pdf-chapter h4 { break-after: avoid-page; page-break-after: avoid; }
  .ecep-pdf-chapter .note,
  .ecep-pdf-chapter .ec-check,
  .ecep-pdf-chapter .ec-caso,
  .ecep-pdf-chapter .ec-lectura,
  .ecep-pdf-chapter figure,
  .ecep-pdf-chapter table,
  .ecep-pdf-chapter .ec-pista {
    box-shadow: none;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}
