/* ================================================================
   courrier-pdf-review.css
   Modale de lecture obligatoire du PDF avant envoi
   Inspiré de cosign.css — à lier dans courriers.html
   ================================================================ */

/* ── Backdrop ─────────────────────────────────────────────────── */
.prm-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.72);
  z-index: 10150;
  align-items: flex-start;
  justify-content: center;
  padding: 24px 16px 40px;
  overflow-y: auto;
  backdrop-filter: blur(3px);
}
.prm-backdrop.prm-visible {
  display: flex;
  animation: prm-fadeIn 0.22s ease both;
}

/* ── Card ─────────────────────────────────────────────────────── */
.prm-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  padding: 28px 28px 24px;
  width: 100%;
  max-width: 820px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  animation: prm-slideUp 0.28s ease both;
}

/* ── Header ───────────────────────────────────────────────────── */
.prm-header {
  border-bottom: 1px solid #e4e8ed;
  padding-bottom: 14px;
}
.prm-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #1a2332;
  margin: 0 0 4px;
}
.prm-subtitle {
  font-size: 0.85rem;
  color: #6b7a99;
  margin: 0;
}

/* ── Viewer PDF ───────────────────────────────────────────────── */
.prm-pdf-wrapper {
  background: #e8ecf0;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #e4e8ed;
}
.prm-pdf-pages {
  width: 100%;
  height: 58vh;
  min-height: 420px;
  overflow-y: auto;
  overflow-x: auto;
  background: #525659;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 14px 8px;
  scroll-behavior: smooth;
}
.prm-pdf-canvas {
  display: block;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  border-radius: 2px;
  max-width: 100%;
}
.prm-pdf-loading {
  color: #ccc;
  font-size: 0.9rem;
  padding: 40px;
  text-align: center;
}

/* ── Scroll indicator ─────────────────────────────────────────── */
.prm-scroll-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: #6b7a99;
  padding: 8px 14px;
  background: #f8fafc;
  border-radius: 999px;
  border: 1px solid #e4e8ed;
  align-self: center;
  transition: all 0.2s;
}
.prm-scroll-indicator.done {
  color: #166534;
  background: #dcfce7;
  border-color: #86efac;
}
.prm-scroll-icon {
  font-size: 1rem;
}

/* ── Read requirement ─────────────────────────────────────────── */
.prm-read-requirement {
  background: #f7f9fc;
  border: 1px solid #e4e8ed;
  border-radius: 10px;
  padding: 18px;
}
.prm-read-timer {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  font-size: 0.88rem;
  color: #6b7a99;
}
.prm-timer-bar-bg {
  flex: 1;
  height: 6px;
  background: #e4e8ed;
  border-radius: 3px;
  overflow: hidden;
  --prm-pct: 0%;
}
.prm-timer-bar {
  height: 100%;
  width: var(--prm-pct);
  background: linear-gradient(90deg, #2196f3, #4caf50);
  border-radius: 3px;
  transition: width 1s linear;
}
.prm-timer-label {
  font-size: 0.8rem;
  font-weight: 700;
  min-width: 32px;
  text-align: right;
  color: #1a2332;
}
.prm-checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: default;
  opacity: 0.4;
  transition: opacity 0.22s;
  user-select: none;
}
.prm-checkbox-row.enabled {
  opacity: 1;
  cursor: pointer;
}
.prm-checkbox {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 2px;
  accent-color: #4caf50;
  cursor: inherit;
}
.prm-checkbox-label {
  font-size: 0.87rem;
  color: #1a2332;
  line-height: 1.45;
}

/* ── Actions ──────────────────────────────────────────────────── */
.prm-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  align-items: center;
}
.prm-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0.55rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition:
    background 0.15s,
    box-shadow 0.15s,
    opacity 0.15s;
}
.prm-btn--cancel {
  background: #f1f5f9;
  color: #475569;
  border-color: #cbd5e1;
}
.prm-btn--cancel:hover {
  background: #e2e8f0;
}
.prm-btn--confirm {
  background: linear-gradient(135deg, #4caf50, #2e7d32);
  color: #fff;
  box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}
.prm-btn--confirm:hover:not(:disabled) {
  box-shadow: 0 6px 16px rgba(76, 175, 80, 0.4);
}
.prm-btn--confirm:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  box-shadow: none;
}

/* ── Hint ─────────────────────────────────────────────────────── */
.prm-hint {
  font-size: 0.8rem;
  color: #6b7a99;
  text-align: center;
  margin: 0;
}
.prm-hint[hidden] {
  display: none;
}

/* ── Animations ───────────────────────────────────────────────── */
@keyframes prm-fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes prm-slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 640px) {
  .prm-card {
    padding: 20px 16px 18px;
  }
  .prm-pdf-pages {
    height: 50vh;
    min-height: 300px;
  }
  .prm-actions {
    flex-direction: column;
  }
  .prm-btn {
    width: 100%;
    justify-content: center;
  }
}
