/* PDF popup: preview + download */
body.conf-pdf-open {
  overflow: hidden;
}

.conf-pdf-modal[hidden] {
  display: none !important;
}

.conf-pdf-modal {
  position: fixed;
  inset: 0;
  z-index: 1300;
  display: grid;
  place-items: center;
  padding: clamp(0.4rem, 1.5vw, 1rem);
}

.conf-pdf-modal__backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 40%, rgba(212, 175, 55, 0.22), transparent 70%),
    rgba(10, 18, 32, 0.84);
  backdrop-filter: blur(8px);
  animation: confPdfFade 0.3s ease both;
}

.conf-pdf-modal__panel {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(96vw, 1100px);
  height: min(92vh, 1200px);
  height: min(92dvh, 1200px);
  border-radius: 1rem;
  overflow: hidden;
  background: var(--conf-cream, #f6f1ea);
  border: 1px solid rgba(212, 175, 55, 0.5);
  box-shadow: 0 28px 60px rgba(0, 0, 0, 0.45), 0 0 70px rgba(212, 175, 55, 0.15);
  animation: confPdfPanelIn 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
  outline: none;
}

.conf-pdf-modal__head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0.85rem 0.75rem 1rem;
  color: #fff;
  background: linear-gradient(115deg, #13233d 0%, var(--conf-navy, #1a2e4e) 50%, var(--conf-navy-mid, #243d63) 100%);
  border-bottom: 2px solid rgba(212, 175, 55, 0.7);
}

.conf-pdf-modal__icon {
  flex: 0 0 auto;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1.15rem;
  color: #b42318;
  background: radial-gradient(circle at 35% 30%, #fff 0%, #fbeec4 55%, var(--conf-gold, #d4af37) 100%);
}

.conf-pdf-modal__titles {
  flex: 1 1 auto;
  min-width: 0;
}

.conf-pdf-modal__eyebrow {
  margin: 0;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--conf-gold, #d4af37);
}

.conf-pdf-modal__titles h2 {
  margin: 0;
  font-size: clamp(0.95rem, 1.8vw, 1.1rem);
  font-weight: 600;
  line-height: 1.35;
  color: #fff;
}

.conf-pdf-modal__actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.conf-pdf-modal__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.42rem 0.85rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--conf-navy, #1a2e4e);
  background: linear-gradient(135deg, #fbeec4, var(--conf-gold, #d4af37));
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.2s ease, filter 0.2s ease;
}

.conf-pdf-modal__btn:hover,
.conf-pdf-modal__btn:focus-visible {
  color: var(--conf-navy, #1a2e4e);
  transform: translateY(-1px);
  filter: brightness(1.06);
}

.conf-pdf-modal__btn--ghost {
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
}

.conf-pdf-modal__btn--ghost:hover,
.conf-pdf-modal__btn--ghost:focus-visible {
  color: #fff;
  background: rgba(255, 255, 255, 0.24);
}

.conf-pdf-modal__close {
  width: 2.25rem;
  height: 2.25rem;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1.1rem;
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.conf-pdf-modal__close:hover,
.conf-pdf-modal__close:focus-visible {
  background: rgba(255, 255, 255, 0.26);
  transform: rotate(90deg);
}

.conf-pdf-modal__body {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  background: #525659;
}

.conf-pdf-modal__loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 1rem;
  text-align: center;
  color: #f5f5f5;
  font-weight: 500;
}

.conf-pdf-modal__loading[hidden],
.conf-pdf-modal__frame[hidden],
.conf-pdf-pages[hidden] {
  display: none;
}

.conf-pdf-modal__frame {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.conf-pdf-pages {
  position: relative;
  height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-x pan-y pinch-zoom;
  padding: 0.5rem;
}

.conf-pdf-pages__page {
  display: block;
  width: 100%;
  height: auto;
  margin: 0 auto 0.5rem;
  background: #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

.conf-pdf-modal__hint {
  margin: 0;
  padding: 0.45rem 0.85rem;
  font-size: 0.78rem;
  text-align: center;
  color: var(--conf-navy, #1a2e4e);
  background: #fbeec4;
}

@media (min-width: 768px) {
  .conf-pdf-modal__hint {
    display: none;
  }
}

@media (max-width: 575.98px) {
  .conf-pdf-modal__head {
    flex-wrap: wrap;
  }

  .conf-pdf-modal__titles {
    flex-basis: calc(100% - 3.5rem);
  }

  .conf-pdf-modal__actions {
    width: 100%;
    justify-content: flex-end;
  }
}

@keyframes confPdfFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes confPdfPanelIn {
  from { opacity: 0; transform: translateY(18px) scale(0.97); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .conf-pdf-modal__backdrop,
  .conf-pdf-modal__panel {
    animation: none;
  }

  .conf-pdf-modal__btn:hover,
  .conf-pdf-modal__close:hover {
    transform: none;
  }
}
