/* modal.css — PDF preview modal overlay */

.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 10, 0.75);
  z-index: 500;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: backdropIn 0.2s ease;
}

.modal-backdrop.open {
  display: flex;
}

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

.modal {
  background: var(--white);
  border-radius: 12px;
  width: 100%;
  max-width: 860px;
  height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.4);
  animation: modalIn 0.22s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.modal-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--ink);
}

.modal-title span {
  font-weight: 400;
  color: var(--muted);
  font-size: 14px;
  margin-left: 8px;
  font-family: 'Source Sans 3', sans-serif;
}

.modal-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  background: transparent;
  color: var(--muted);
  font-family: 'Source Sans 3', sans-serif;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid var(--border);
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.12s;
}

.btn-ghost:hover {
  border-color: var(--ink);
  color: var(--ink);
}

.btn-download {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 20px;
  background: var(--amber);
  color: var(--white);
  font-family: 'Source Sans 3', sans-serif;
  font-size: 13px;
  font-weight: 600;
  border: none;
  border-radius: 7px;
  cursor: pointer;
  transition: background 0.12s, transform 0.1s;
}

.btn-download:hover  { background: #b86e08; }
.btn-download:active { transform: scale(0.98); }

.modal-body {
  flex: 1;
  position: relative;
  background: #e8e4de;
}

.modal-body iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

.modal-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: var(--muted);
  font-size: 13px;
}

.modal-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--amber);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* iframe starts hidden, JS fades it in on load */
.preview-frame {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
  opacity: 0;
  transition: opacity 0.2s;
}

/* Error state shown inside modal-loading */
.modal-error {
  color: #b93c2c;
  text-align: center;
  padding: 24px;
}

.modal-error-icon  { font-size: 20px; margin-bottom: 8px; }
.modal-error-title { font-weight: 600; margin-bottom: 6px; }
.modal-error-msg   { font-size: 12px; color: #777; }
