/* Sign Plugin - Public CSS */
@import url('https://fonts.googleapis.com/css2?family=Heebo:wght@400;500;600;700;800&display=swap');

.sign-page {
  font-family: 'Heebo', sans-serif;
  direction: rtl;
  min-height: 80vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 20px;
  background: linear-gradient(160deg, #f0f4f8 0%, #e8f0fe 100%);
}

.sign-step-panel {
  width: 100%;
  max-width: 560px;
}

/* Panel */
.sign-panel {
  background: #ffffff;
  border-radius: 24px;
  padding: 48px 40px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.10);
  text-align: center;
  border: 1px solid rgba(255,255,255,0.8);
}
.sign-panel--wide {
  max-width: 640px;
  text-align: right;
  padding: 36px 36px;
}
.sign-panel--success {
  border-top: 5px solid #10b981;
}

.sign-panel__icon {
  font-size: 56px;
  margin-bottom: 20px;
  display: block;
}
.sign-panel__title {
  color: #1e293b;
  font-size: 26px;
  font-weight: 800;
  margin: 0 0 12px;
  line-height: 1.2;
}
.sign-panel__subtitle {
  color: #64748b;
  font-size: 15px;
  line-height: 1.7;
  margin: 0 0 32px;
}

/* Field */
.sign-field {
  margin-bottom: 24px;
  text-align: right;
}
.sign-field label {
  display: block;
  color: #374151;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
}
.sign-field input {
  width: 100%;
  padding: 14px 18px;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  font-size: 18px;
  font-family: 'Heebo', sans-serif;
  color: #1e293b;
  text-align: center;
  letter-spacing: 4px;
  transition: all 0.2s;
  box-sizing: border-box;
  direction: ltr;
}
.sign-field input:focus {
  outline: none;
  border-color: #0f3460;
  box-shadow: 0 0 0 4px rgba(15,52,96,0.12);
}
.sign-field input.error {
  border-color: #dc2626;
  box-shadow: 0 0 0 3px rgba(220,38,38,0.12);
}
.sign-field__error {
  color: #dc2626;
  font-size: 13px;
  margin-top: 8px;
}

/* CTA Button */
.sign-cta-btn {
  width: 100%;
  padding: 16px 24px;
  background: linear-gradient(135deg, #0f3460, #16213e);
  color: white;
  border: none;
  border-radius: 14px;
  font-family: 'Heebo', sans-serif;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.2s;
  box-shadow: 0 6px 20px rgba(15,52,96,0.3);
}
.sign-cta-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(15,52,96,0.4);
}
.sign-cta-btn:active {
  transform: translateY(0);
}
.sign-cta-btn--green {
  background: linear-gradient(135deg, #059669, #047857);
  box-shadow: 0 6px 20px rgba(5,150,105,0.3);
}
.sign-cta-btn--green:hover {
  box-shadow: 0 10px 28px rgba(5,150,105,0.4);
}

/* Welcome bar */
.sign-welcome-bar {
  background: linear-gradient(135deg, #0f3460, #16213e);
  color: white;
  padding: 14px 20px;
  border-radius: 12px;
  margin-bottom: 24px;
  font-size: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
}
.sign-welcome-bar__emoji {
  font-size: 22px;
}

/* Doc info */
.sign-doc-info {
  display: flex;
  gap: 16px;
  background: #f8fafc;
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 24px;
}
.sign-doc-info__item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sign-doc-info__label {
  color: #94a3b8;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.sign-doc-info__value {
  color: #1e293b;
  font-size: 14px;
  font-weight: 600;
}

/* Signature */
.sign-signature-section {
  margin-bottom: 24px;
}
.sign-signature-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.sign-signature-header h3 {
  color: #1e293b;
  font-size: 15px;
  font-weight: 700;
  margin: 0;
}
.sign-clear-btn {
  background: none;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 5px 12px;
  font-family: 'Heebo', sans-serif;
  font-size: 13px;
  color: #64748b;
  cursor: pointer;
  transition: all 0.15s;
}
.sign-clear-btn:hover {
  border-color: #dc2626;
  color: #dc2626;
}
.sign-canvas-wrap {
  position: relative;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  background: #fafafa;
  transition: border-color 0.2s;
}
.sign-canvas-wrap:hover {
  border-color: #0f3460;
}
.sign-canvas-wrap.active {
  border-color: #0f3460;
  box-shadow: 0 0 0 3px rgba(15,52,96,0.1);
}
.sign-canvas-wrap.error {
  border-color: #dc2626;
}
#signature-canvas {
  display: block;
  width: 100%;
  height: 160px;
  touch-action: none;
}
.sign-canvas-hint {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #cbd5e1;
  font-size: 14px;
  pointer-events: none;
  transition: opacity 0.2s;
}

/* Confirm */
.sign-confirm-section {
  margin-bottom: 20px;
}
.sign-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
}
.sign-checkbox input {
  display: none;
}
.sign-checkbox__box {
  width: 20px;
  height: 20px;
  border: 2px solid #e2e8f0;
  border-radius: 6px;
  flex-shrink: 0;
  margin-top: 2px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sign-checkbox input:checked + .sign-checkbox__box {
  background: #0f3460;
  border-color: #0f3460;
}
.sign-checkbox input:checked + .sign-checkbox__box::after {
  content: '✓';
  color: white;
  font-size: 13px;
}
.sign-checkbox__label {
  color: #475569;
  font-size: 14px;
  line-height: 1.6;
}

/* Success */
.sign-success-animation {
  margin-bottom: 24px;
}
.sign-success-circle {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, #10b981, #059669);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  box-shadow: 0 8px 24px rgba(16,185,129,0.35);
  animation: sign-pop 0.4s ease-out;
}
@keyframes sign-pop {
  0% { transform: scale(0); }
  70% { transform: scale(1.1); }
  100% { transform: scale(1); }
}
.sign-success-check {
  background: #f0fdf4;
  border: 1px solid #86efac;
  border-radius: 10px;
  padding: 12px 20px;
  color: #166534;
  font-size: 14px;
  font-weight: 600;
  margin-top: 24px;
}

/* Error page */
.sign-error-page {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 60vh;
  padding: 40px;
  direction: rtl;
}
.sign-error-box {
  background: white;
  border-radius: 20px;
  padding: 48px;
  text-align: center;
  box-shadow: 0 8px 40px rgba(0,0,0,0.1);
  max-width: 400px;
}
.sign-error-icon {
  font-size: 52px;
  display: block;
  margin-bottom: 16px;
}
.sign-error-box h2 {
  color: #dc2626;
  margin: 0 0 12px;
}
.sign-error-box p {
  color: #64748b;
  line-height: 1.7;
}

/* Loading overlay */
.sign-loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sign-loading-box {
  background: white;
  border-radius: 20px;
  padding: 36px 48px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.sign-spinner {
  width: 44px;
  height: 44px;
  border: 4px solid #e2e8f0;
  border-top-color: #0f3460;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 16px;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
.sign-loading-box p {
  color: #475569;
  font-size: 15px;
  margin: 0;
  font-family: 'Heebo', sans-serif;
}

/* Responsive */
@media (max-width: 600px) {
  .sign-panel {
    padding: 32px 24px;
  }
  .sign-panel--wide {
    padding: 24px 20px;
  }
  .sign-page {
    padding: 20px 12px;
  }
}
