/**
 * Contract Print.
 * Prefix: pdcpr-  (note: pdcp- belongs to the contract portfolio — not the same)
 */

/* ---- Print button ---- */

/* Sits beside the Edit button, so it matches its shape and is scoped the same
   way. The surrounding styles colour links inside the panel, which would win
   against a single class — hence the wrapper selector and the forced colour. */
.pdcp-wrap .pdcpr-print-btn,
a.pdcpr-print-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 132px;
  padding: 5px 14px;
  border: 1px solid #1a5c38;
  border-radius: 5px;
  background: #1a5c38;
  color: #fff !important;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.6;
  text-decoration: none !important;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, opacity .15s ease;
}

.pdcp-wrap .pdcpr-print-btn:hover,
a.pdcpr-print-btn:hover {
  background: #15492c;
  border-color: #15492c;
  color: #fff !important;
  text-decoration: none !important;
}

/* Label and icon must inherit, or the same link colouring reaches them. */
.pdcpr-print-btn .pdcpr-btn-label,
.pdcpr-print-btn .pdcpr-btn-icon {
  color: #fff !important;
}

/* Print & File — the deliberate, occasional action, so it sits quieter than
   everyday printing. */
.pdcp-wrap .pdcpr-file-btn,
a.pdcpr-file-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 124px;
  padding: 5px 14px;
  border: 1px solid #1a5c38;
  border-radius: 5px;
  background: #fff;
  color: #1a5c38 !important;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.6;
  text-decoration: none !important;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}

.pdcp-wrap .pdcpr-file-btn:hover,
a.pdcpr-file-btn:hover {
  background: #f0faf5;
  color: #15492c !important;
  text-decoration: none !important;
}

.pdcpr-file-btn .pdcpr-btn-label,
.pdcpr-file-btn .pdcpr-btn-icon {
  color: inherit !important;
}

.pdcp-wrap .pdcpr-file-btn.is-busy,
a.pdcpr-file-btn.is-busy {
  cursor: progress;
  opacity: .75;
  pointer-events: none;
}

.pdcpr-file-btn.is-busy .pdcpr-btn-icon {
  border: 2px solid rgba(26, 92, 56, .3);
  border-top-color: #1a5c38;
  border-radius: 50%;
  font-size: 0;
  box-sizing: border-box;
  animation: pdcpr-spin .7s linear infinite;
}

.pdcp-wrap .pdcpr-file-btn.is-done,
a.pdcpr-file-btn.is-done {
  background: #dcfce7;
  border-color: #166534;
  color: #166534 !important;
}

.pdcpr-print-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(29, 158, 117, .28);
}

.pdcp-wrap .pdcpr-print-btn.is-busy,
a.pdcpr-print-btn.is-busy {
  cursor: progress;
  opacity: .75;
  pointer-events: none;
}

.pdcp-wrap .pdcpr-print-btn.is-done,
a.pdcpr-print-btn.is-done {
  background: #166534;
  border-color: #166534;
}

/* Spinner replaces the icon while working, so the button never changes width. */
.pdcpr-btn-icon {
  display: inline-block;
  width: 14px;
  height: 14px;
  line-height: 14px;
  text-align: center;
  font-size: 13px;
}

.pdcpr-print-btn.is-busy .pdcpr-btn-icon {
  border: 2px solid rgba(255, 255, 255, .35);
  border-top-color: #fff;
  border-radius: 50%;
  font-size: 0;
  box-sizing: border-box;
  animation: pdcpr-spin .7s linear infinite;
}

@keyframes pdcpr-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .pdcpr-print-btn.is-busy .pdcpr-btn-icon { animation: none; }
}

/* ---- Toast ---- */

.pdcpr-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 1200;
  max-width: min(460px, calc(100vw - 32px));
  padding: 12px 18px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  background: #111827;
  color: #fff;
  font-size: 13.5px;
  line-height: 1.45;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
  transform: translate(-50%, 12px);
  opacity: 0;
  transition: opacity .25s ease, transform .25s ease;
}

.pdcpr-toast.pdcpr-toast-in {
  opacity: 1;
  transform: translate(-50%, 0);
}

.pdcpr-toast-error {
  background: #7f1d1d;
  border-color: #991b1b;
}

/* ---- Missing-details prompt ---- */

.pdcpr-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(17, 24, 39, .48);
}

.pdcpr-modal {
  width: 100%;
  max-width: 440px;
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
  box-shadow: 0 18px 48px rgba(0, 0, 0, .24);
}

.pdcpr-modal-head {
  padding: 16px 20px;
  border-bottom: 1px solid #ebedf0;
  color: #111827;
  font-size: 15px;
  font-weight: 700;
}

.pdcpr-modal-note {
  padding: 14px 20px 0;
  color: #6b7280;
  font-size: 13px;
  line-height: 1.5;
}

.pdcpr-modal-body {
  padding: 14px 20px 18px;
}

.pdcpr-modal-row {
  display: block;
  margin-bottom: 12px;
}

.pdcpr-modal-row:last-child {
  margin-bottom: 0;
}

.pdcpr-modal-lbl {
  display: block;
  margin-bottom: 5px;
  color: #374151;
  font-size: 12.5px;
  font-weight: 600;
}

.pdcpr-modal-input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 14px;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.pdcpr-modal-input:focus {
  border-color: #1d9e75;
  outline: none;
  box-shadow: 0 0 0 3px rgba(29, 158, 117, .12);
}

.pdcpr-modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid #ebedf0;
  background: #f8f9fb;
}

.pdcpr-modal-btn {
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}

.pdcpr-modal-btn:disabled {
  opacity: .7;
  cursor: progress;
}

.pdcpr-modal-skip {
  border: 1px solid #d1d5db;
  background: #fff;
  color: #4b5563;
}

.pdcpr-modal-skip:hover:not(:disabled) {
  border-color: #9ca3af;
  background: #f9fafb;
}

.pdcpr-modal-save {
  border: 1px solid #1a5c38;
  background: #1a5c38;
  color: #fff;
}

.pdcpr-modal-save:hover:not(:disabled) {
  background: #15492c;
  border-color: #15492c;
}

/* ---- "Official Contract Details" form group ---- */

/* The surrounding form styling supplies the grid and inputs; only the
   collapsed wrapper needs styling here. */
.pdcpr-official {
  margin: 8px 32px 20px !important;
  padding: 0 !important;
  border: 1px solid #e2e5ea !important;
  border-radius: 10px !important;
  background: #fbfcfd !important;
}

.pdcpr-official > summary {
  padding: 12px 16px;
  color: #0f6e56;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .8px;
  text-transform: uppercase;
  cursor: pointer;
  list-style: none;
}

.pdcpr-official > summary::-webkit-details-marker {
  display: none;
}

.pdcpr-official > summary::before {
  content: '▸';
  display: inline-block;
  margin-right: 8px;
  color: #1d9e75;
  transition: transform .15s ease;
}

.pdcpr-official[open] > summary::before {
  transform: rotate(90deg);
}

.pdcpr-official > .details-wrapper,
.pdcpr-official > div:not(summary) {
  padding: 0 16px 16px;
}
