/* ================================================================
   LaraCopilot Marketplace — Signing Page Styles
   ================================================================ */

.lcm-signing-wrap {
  max-width: 760px;
  margin: 40px auto;
  padding: 0 16px;
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

/* ── Header ──────────────────────────────────────────────── */
.lcm-signing-header {
  margin-bottom: 32px;
}

.lcm-signing-title {
  font-size: 24px;
  font-weight: 700;
  color: #111827;
  margin: 0 0 10px;
  line-height: 1.3;
}

.lcm-signing-meta {
  font-size: 14px;
  color: #6b7280;
  margin: 0;
}

.lcm-expiry--urgent {
  color: #d97706;
  font-weight: 600;
}

/* ── Sections ────────────────────────────────────────────── */
.lcm-signing-section {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 28px;
  margin-bottom: 24px;
}

.lcm-section-title {
  font-size: 16px;
  font-weight: 700;
  color: #111827;
  margin: 0 0 20px;
}

/* ── PDF Preview ─────────────────────────────────────────── */
.lcm-pdf-preview-wrap {
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  overflow: hidden;
  background: #f9fafb;
}

.lcm-pdf-frame {
  width: 100%;
  height: 520px;
  border: none;
  display: block;
}

/* ── Signature Tabs ──────────────────────────────────────── */
.lcm-sig-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  border-bottom: 2px solid #e5e7eb;
  padding-bottom: 0;
}

.lcm-sig-tab {
  padding: 8px 20px;
  font-size: 14px;
  font-weight: 500;
  color: #6b7280;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

.lcm-sig-tab:hover {
  color: #dc2626;
}

.lcm-sig-tab--active {
  color: #dc2626;
  border-bottom-color: #dc2626;
  font-weight: 600;
}

.lcm-sig-panel {
  display: none;
}

.lcm-sig-panel--active {
  display: block;
}

/* ── Canvas ──────────────────────────────────────────────── */
.lcm-canvas-wrap {
  position: relative;
  border: 2px dashed #d1d5db;
  border-radius: 6px;
  background: #fafafa;
  cursor: crosshair;
  overflow: hidden;
  margin-bottom: 12px;
}

.lcm-canvas {
  display: block;
  width: 100%;
  height: auto;
  touch-action: none;
}

.lcm-canvas-hint {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 14px;
  color: #d1d5db;
  pointer-events: none;
  user-select: none;
  font-style: italic;
}

/* ── Type mode ───────────────────────────────────────────── */
.lcm-type-wrap {
  margin-bottom: 12px;
}

.lcm-typed-input {
  width: 100%;
  font-size: 16px;
  padding: 12px 16px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  color: #111827;
  margin-bottom: 16px;
  box-sizing: border-box;
  transition: border-color 0.15s;
}

.lcm-typed-input:focus {
  outline: none;
  border-color: #dc2626;
  box-shadow: 0 0 0 3px rgba(220,38,38,.12);
}

.lcm-typed-preview {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 36px;
  color: #111827;
  min-height: 60px;
  padding: 8px 0;
  border-bottom: 2px solid #111827;
  margin-bottom: 4px;
  word-break: break-word;
}

/* ── Errors ──────────────────────────────────────────────── */
.lcm-sig-error,
.lcm-form-error {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fca5a5;
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 14px;
  margin-top: 12px;
}

/* ── Consent ─────────────────────────────────────────────── */
.lcm-signing-submit-section {
  background: #f9fafb;
}

.lcm-consent-label {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-size: 14px;
  color: #374151;
  line-height: 1.5;
  cursor: pointer;
  margin-bottom: 20px;
}

.lcm-consent-check {
  margin-top: 2px;
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: #dc2626;
}

/* ── Actions ─────────────────────────────────────────────── */
.lcm-submit-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  align-items: center;
}

.lcm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 24px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  border: none;
  transition: background 0.15s, opacity 0.15s;
}

.lcm-btn--primary {
  background: #dc2626;
  color: #fff;
}

.lcm-btn--primary:hover:not(:disabled) {
  background: #b91c1c;
}

.lcm-btn--primary:disabled {
  background: #fca5a5;
  cursor: not-allowed;
  opacity: 0.7;
}

.lcm-btn--ghost {
  background: transparent;
  color: #6b7280;
  border: 1px solid #d1d5db;
}

.lcm-btn--ghost:hover {
  background: #f3f4f6;
}

.lcm-btn--danger {
  background: #dc2626;
  color: #fff;
}

.lcm-btn--danger:hover:not(:disabled) {
  background: #b91c1c;
}

.lcm-btn-link {
  background: none;
  border: none;
  color: #6b7280;
  font-size: 13px;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}

.lcm-btn-link:hover {
  color: #374151;
}

/* ── Modal ───────────────────────────────────────────────── */
.lcm-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.lcm-modal {
  background: #fff;
  border-radius: 10px;
  padding: 32px;
  max-width: 460px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.lcm-modal-title {
  font-size: 18px;
  font-weight: 700;
  color: #111827;
  margin: 0 0 12px;
}

.lcm-decline-reason {
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 14px;
  color: #111827;
  box-sizing: border-box;
  resize: vertical;
  margin: 12px 0 20px;
}

.lcm-modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* ── Result states ───────────────────────────────────────── */
.lcm-signing-result {
  text-align: center;
  padding: 60px 32px;
  max-width: 560px;
  margin: 60px auto;
}

.lcm-result-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: #d1fae5;
  color: #065f46;
  font-size: 32px;
  line-height: 72px;
  margin: 0 auto 24px;
}

.lcm-result-icon--warn {
  background: #fef3c7;
  color: #92400e;
}

.lcm-result-icon--info {
  background: #e0e7ff;
  color: #3730a3;
}

.lcm-signing-result h2 {
  font-size: 22px;
  font-weight: 700;
  color: #111827;
  margin: 0 0 16px;
}

.lcm-signing-result p {
  font-size: 15px;
  color: #6b7280;
  line-height: 1.6;
  margin: 0 0 12px;
}

/* ── PDF.js inline preview ───────────────────────────────── */
.lcm-pdf-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 320px;
  background: #f9fafb;
  border-radius: 6px;
  color: #6b7280;
  font-size: 14px;
  border: 1px solid #e5e7eb;
}

.lcm-contract-canvas {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 4px;
  border: 1px solid #e5e7eb;
}

.lcm-pdf-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 10px 0 4px;
}

.lcm-pdf-nav-btn {
  background: #f3f4f6;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  padding: 6px 14px;
  font-size: 14px;
  cursor: pointer;
  color: #374151;
  transition: background 0.15s;
}

.lcm-pdf-nav-btn:hover:not(:disabled) {
  background: #e5e7eb;
}

.lcm-pdf-nav-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.lcm-pdf-page-info {
  font-size: 13px;
  color: #6b7280;
  min-width: 60px;
  text-align: center;
}

.lcm-pdf-download-fallback {
  margin: 12px 0 0;
  font-size: 13px;
  text-align: center;
}

.lcm-pdf-download-fallback a {
  color: #dc2626;
  text-decoration: underline;
}

/* ── Responsive ──────────────────────────────────────────── */
@media ( max-width: 640px ) {
  .lcm-signing-section {
    padding: 20px 16px;
  }

  .lcm-pdf-frame {
    height: 360px;
  }

  .lcm-submit-actions {
    flex-direction: column-reverse;
  }

  .lcm-btn {
    width: 100%;
  }
}
