/**
 * Public Proposal View Styles
 */

.cmp-proposal-view {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;
  color: #1f2937;
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

/* Loading */
.cmp-pv-loading {
  text-align: center;
  padding: 4rem 1rem;
  color: #6b7280;
  font-size: 16px;
}

/* Error */
.cmp-pv-error {
  text-align: center;
  padding: 4rem 1rem;
  color: #6b7280;
  font-size: 16px;
}

/* Top toolbar - always visible */
.cmp-pv-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
}

.cmp-pv-btn-pdf-top {
  background-color: #374151;
  color: white;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.15s;
}

.cmp-pv-btn-pdf-top:hover:not(:disabled) {
  background-color: #1f2937;
}

.cmp-pv-btn-pdf-top:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Proposal HTML container */
.cmp-pv-proposal-html {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 2rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  margin-bottom: 2rem;
}

.cmp-pv-proposal-html img {
  max-width: 100%;
  height: auto;
}

.cmp-pv-proposal-html table {
  border-collapse: collapse;
  width: 100%;
}

.cmp-pv-proposal-html th,
.cmp-pv-proposal-html td {
  border: 1px solid #d1d5db;
  padding: 8px;
}

/* Actions */
.cmp-pv-actions {
  text-align: center;
  padding: 2rem;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  margin-bottom: 2rem;
}

.cmp-pv-actions-label {
  font-size: 18px;
  font-weight: 600;
  color: #1f2937;
  margin: 0 0 1.5rem 0;
}

.cmp-pv-actions-buttons {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Buttons */
.cmp-pv-btn {
  padding: 0.75rem 2rem;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid transparent;
  transition: background-color 0.15s, opacity 0.15s, transform 0.1s;
}

.cmp-pv-btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

.cmp-pv-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.cmp-pv-btn-accept {
  background-color: #3F9B0B;
  color: white;
}

.cmp-pv-btn-accept:hover:not(:disabled) {
  background-color: #368509;
}

.cmp-pv-btn-decline {
  background-color: white;
  color: #dc2626;
  border-color: #dc2626;
}

.cmp-pv-btn-decline:hover:not(:disabled) {
  background-color: #fef2f2;
}

.cmp-pv-btn-pdf {
  background-color: #f3f4f6;
  color: #374151;
  border-color: #d1d5db;
}

.cmp-pv-btn-pdf:hover:not(:disabled) {
  background-color: #e5e7eb;
}

/* Status Messages */
.cmp-pv-status {
  text-align: center;
  padding: 2rem;
  border-radius: 8px;
  margin-bottom: 2rem;
}

.cmp-pv-status-accepted {
  font-size: 18px;
  font-weight: 600;
  color: #3F9B0B;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  padding: 1.5rem;
  margin: 0;
}

.cmp-pv-status-declined {
  font-size: 18px;
  font-weight: 600;
  color: #dc2626;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 1.5rem;
  margin: 0;
}

/* Pending countersign status */
.cmp-pv-status-pending {
  font-size: 18px;
  font-weight: 600;
  color: #b45309;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 8px;
  padding: 1.5rem;
  margin: 0;
}

/* ─────────────────────────────────────────────────────────────────
   Modal Styles (E-Sign & Decline)
   ───────────────────────────────────────────────────────────────── */

/* Import Great Vibes font for signature */
@import url('https://fonts.googleapis.com/css2?family=Great+Vibes&display=swap');

.cmp-pv-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 1rem;
}

.cmp-pv-modal {
  background: white;
  border-radius: 12px;
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.cmp-pv-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid #e5e7eb;
}

.cmp-pv-modal-title {
  font-size: 20px;
  font-weight: 700;
  color: #1f2937;
  margin: 0;
}

.cmp-pv-modal-close {
  background: none;
  border: none;
  font-size: 28px;
  color: #9ca3af;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  transition: color 0.15s;
}

.cmp-pv-modal-close:hover {
  color: #6b7280;
}

.cmp-pv-modal-body {
  padding: 1.5rem;
}

.cmp-pv-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid #e5e7eb;
  background: #f9fafb;
  border-radius: 0 0 12px 12px;
}

/* E-Sign specific styles */
.cmp-pv-esign-intro {
  color: #4b5563;
  margin: 0 0 1.5rem 0;
  line-height: 1.5;
}

.cmp-pv-esign-field {
  margin-bottom: 1.25rem;
}

.cmp-pv-esign-label {
  display: block;
  font-weight: 600;
  color: #374151;
  margin-bottom: 0.5rem;
  font-size: 14px;
}

.cmp-pv-esign-name,
.cmp-pv-esign-email {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 16px;
  transition: border-color 0.15s, box-shadow 0.15s;
  box-sizing: border-box;
}

.cmp-pv-esign-name:focus,
.cmp-pv-esign-email:focus {
  outline: none;
  border-color: #3F9B0B;
  box-shadow: 0 0 0 3px rgba(63, 155, 11, 0.15);
}

/* Signature preview with Dancing Script font */
.cmp-pv-esign-preview {
  margin-top: 0.75rem;
  padding: 1rem 1.5rem;
  background: linear-gradient(180deg, #fafafa 0%, #f5f5f5 100%);
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  min-height: 60px;
  font-family: 'Dancing Script', cursive;
  font-size: 36px;
  font-weight: 700;
  color: #1a365d;
  text-align: center;
  line-height: 1.2;
}

/* Consent checkbox */
.cmp-pv-esign-consent {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid #e5e7eb;
}

.cmp-pv-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  cursor: pointer;
  font-size: 13px;
  color: #4b5563;
  line-height: 1.5;
}

.cmp-pv-checkbox input[type="checkbox"] {
  margin-top: 2px;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  cursor: pointer;
  accent-color: #3F9B0B;
}

/* Sign button (green) */
.cmp-pv-btn-sign {
  background-color: #3F9B0B;
  color: white;
}

.cmp-pv-btn-sign:hover:not(:disabled) {
  background-color: #368509;
}

/* Cancel button */
.cmp-pv-btn-cancel {
  background-color: white;
  color: #6b7280;
  border-color: #d1d5db;
}

.cmp-pv-btn-cancel:hover:not(:disabled) {
  background-color: #f3f4f6;
}

/* Decline modal styles */
.cmp-pv-decline-field {
  margin-top: 1rem;
}

.cmp-pv-decline-label {
  display: block;
  font-weight: 600;
  color: #374151;
  margin-bottom: 0.5rem;
  font-size: 14px;
}

.cmp-pv-decline-reason {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
  min-height: 80px;
  box-sizing: border-box;
}

.cmp-pv-decline-reason:focus {
  outline: none;
  border-color: #dc2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15);
}

/* Decline confirm button (red) */
.cmp-pv-btn-decline-confirm {
  background-color: #dc2626;
  color: white;
}

.cmp-pv-btn-decline-confirm:hover:not(:disabled) {
  background-color: #b91c1c;
}

/* Responsive */
@media (max-width: 768px) {
  .cmp-proposal-view {
    padding: 1rem 0.5rem;
  }

  .cmp-pv-proposal-html {
    padding: 1rem;
  }

  .cmp-pv-btn {
    padding: 0.6rem 1.5rem;
    font-size: 14px;
  }

  .cmp-pv-actions-buttons {
    flex-direction: column;
    align-items: center;
  }
}
