/* =========================================================
   Visionneuse de document — modale premium, vignettes + page
   ========================================================= */

.doc-modal {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s var(--ease);
}

.doc-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

.doc-modal[hidden] {
  display: none;
}

.doc-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 7, 14, 0.74);
  -webkit-backdrop-filter: blur(10px) saturate(120%);
  backdrop-filter: blur(10px) saturate(120%);
}

.doc-modal-panel {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(1180px, 100%);
  height: min(90vh, 900px);
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 16px;
  background: #0c1524;
  box-shadow: 0 50px 120px -40px rgba(0, 0, 0, 0.85);
  transform: translateY(12px) scale(0.985);
  transition: transform 0.35s var(--ease);
}

.doc-modal.is-open .doc-modal-panel {
  transform: translateY(0) scale(1);
}

/* Barre supérieure */

.doc-modal-head {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 60px;
  flex: none;
  padding-inline: 20px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(10, 18, 32, 0.9);
}

.doc-modal-brand {
  display: inline-flex;
  align-items: center;
  flex: none;
}

.doc-modal-brand img {
  width: 88px;
  height: auto;
}

.doc-modal-title {
  font-size: 12.5px;
  font-weight: 600;
  color: #e7edf7;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.doc-modal-count {
  padding-left: 12px;
  border-left: 1px solid rgba(148, 163, 184, 0.16);
  font-size: 11px;
  font-weight: 600;
  color: #7cc8ff;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.doc-modal-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.doc-tool {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding-inline: 9px;
  border-radius: 6px;
  color: #b9c6da;
  font-size: 11px;
  font-weight: 500;
  transition: color 0.2s, background 0.2s;
}

.doc-tool:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.07);
}

.doc-tool .icon {
  width: 14px;
  height: 14px;
}

.doc-close {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  margin-left: 4px;
  border-radius: 50%;
  border: 1px solid rgba(148, 163, 184, 0.16);
  color: #c3cddf;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
}

.doc-close:hover {
  color: #fff;
  border-color: rgba(148, 163, 184, 0.35);
  background: rgba(255, 255, 255, 0.06);
}

.doc-close .icon {
  width: 15px;
  height: 15px;
}

/* Corps */

.doc-modal-body {
  display: flex;
  flex: 1;
  min-height: 0;
}

.doc-thumbs {
  display: flex;
  flex-direction: column;
  gap: 7px;
  width: 112px;
  flex: none;
  padding: 14px 12px;
  overflow-y: auto;
  border-right: 1px solid rgba(148, 163, 184, 0.12);
  background: #0a1220;
  scrollbar-width: thin;
  scrollbar-color: #26344c transparent;
}

.doc-thumb {
  position: relative;
  display: block;
  width: 100%;
  flex: none;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  transition: border-color 0.2s, transform 0.2s;
}

.doc-thumb img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 3px;
  background: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.doc-thumb span {
  position: absolute;
  left: 4px;
  bottom: 4px;
  display: grid;
  place-items: center;
  min-width: 15px;
  height: 15px;
  padding-inline: 3px;
  border-radius: 3px;
  background: rgba(5, 10, 20, 0.8);
  color: #d7e1ef;
  font-size: 8px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.doc-thumb:hover {
  border-color: rgba(17, 153, 250, 0.35);
}

.doc-thumb.is-active {
  border-color: #1199fa;
  transform: translateX(1px);
}

.doc-thumb.is-active span {
  background: #1199fa;
  color: #fff;
}

/* Scène */

.doc-stage {
  position: relative;
  display: flex;
  flex: 1;
  min-width: 0;
  align-items: center;
  justify-content: center;
  padding: 18px 62px;
  overflow: hidden;
  background:
    radial-gradient(700px 420px at 50% 42%, rgba(148, 163, 184, 0.06), transparent 70%),
    #0b1422;
}

.doc-page-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  max-height: 100%;
}

.doc-page {
  display: block;
  max-width: 100%;
  max-height: calc(90vh - 60px - 66px - 36px);
  width: auto;
  height: auto;
  border-radius: 2px;
  background: #fff;
  box-shadow: 0 28px 60px -18px rgba(0, 0, 0, 0.7);
  transition: opacity 0.18s ease;
  user-select: none;
}

.doc-page.is-fading {
  opacity: 0.15;
}

.doc-nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 50%;
  background: rgba(12, 21, 36, 0.92);
  color: #fff;
  transform: translateY(-50%);
  transition: background 0.2s, border-color 0.2s, opacity 0.2s;
}

.doc-nav:hover:not(:disabled) {
  background: #1199fa;
  border-color: #1199fa;
}

.doc-nav:disabled {
  opacity: 0.22;
  cursor: not-allowed;
}

.doc-nav .icon {
  width: 17px;
  height: 17px;
}

.doc-prev {
  left: 14px;
}

.doc-next {
  right: 14px;
}

/* Zoom */

.doc-modal.is-zoomed .doc-stage {
  overflow: auto;
  align-items: flex-start;
  padding-block: 22px;
}

.doc-modal.is-zoomed .doc-page {
  max-height: none;
  max-width: none;
  width: min(900px, 140%);
  margin-inline: auto;
}

/* Barre inférieure */

.doc-modal-foot {
  flex: none;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(10, 18, 32, 0.95);
}

.doc-progress {
  height: 2px;
  background: rgba(255, 255, 255, 0.07);
}

.doc-progress span {
  display: block;
  width: 10%;
  height: 100%;
  background: #1199fa;
  transition: width 0.25s var(--ease);
}

.doc-foot-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 62px;
  padding-inline: 20px;
}

.doc-foot-btn {
  height: 30px;
  padding-inline: 9px;
  border-radius: 6px;
  color: #9fb0c7;
  font-size: 11px;
  font-weight: 500;
  transition: color 0.2s, background 0.2s;
}

.doc-foot-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.doc-foot-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.doc-foot-count {
  min-width: 104px;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: #d7e1ef;
  font-variant-numeric: tabular-nums;
}

.doc-cta {
  height: 40px;
  margin-left: auto;
  padding-inline: 17px;
  border-radius: 7px;
  background: #1199fa;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  transition: background 0.2s, transform 0.2s;
}

.doc-cta:hover {
  background: #0b8ae6;
  transform: translateY(-1px);
}

@media (max-width: 900px) {
  .doc-modal {
    padding: 0;
  }

  .doc-modal-panel {
    width: 100%;
    height: 100dvh;
    border: 0;
    border-radius: 0;
    transform: none;
  }

  .doc-modal-head {
    height: 54px;
    padding-inline: 12px;
    gap: 10px;
  }

  .doc-modal-brand img {
    width: 72px;
  }

  .doc-modal-title {
    display: none;
  }

  .doc-modal-count {
    padding-left: 0;
    border-left: 0;
  }

  .doc-tool span {
    display: none;
  }

  .doc-tool {
    width: 32px;
    padding: 0;
    justify-content: center;
  }

  .doc-thumbs {
    display: none;
  }

  .doc-stage {
    padding: 12px 10px 60px;
  }

  .doc-page {
    max-height: calc(100dvh - 54px - 62px - 40px);
  }

  .doc-nav {
    top: auto;
    bottom: 12px;
    width: 34px;
    height: 34px;
    transform: none;
  }

  .doc-prev {
    left: 12px;
  }

  .doc-next {
    right: 12px;
  }

  .doc-modal.is-zoomed .doc-nav {
    position: absolute;
    top: auto;
    bottom: 12px;
  }

  .doc-foot-inner {
    min-height: 58px;
    padding-inline: 12px;
  }

  .doc-foot-btn {
    display: none;
  }

  .doc-foot-count {
    min-width: 0;
    text-align: left;
    font-size: 10.5px;
  }

  .doc-cta {
    height: 36px;
    padding-inline: 12px;
    font-size: 11px;
  }
}
