/* ============================================
   SIGNATURE CHECKBOX STYLES
   Respecte CSP - Aucun style inline
   ============================================ */

/* Conteneur principal de la coche de signature */
.signature-checkbox-container {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  border-radius: 8px;
  border-left: 4px solid #4a90e2;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  animation: slideInDown 0.3s ease-out;
}

/* Animation d'apparition */
@keyframes slideInDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Option de signature */
.signature-option {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Label avec style moderne */
.signature-option .checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  user-select: none;
  font-weight: 500;
  color: #2c3e50;
  transition: color 0.2s ease;
}

.signature-option .checkbox-label:hover {
  color: #4a90e2;
}

/* Coche personnalisée */
.signature-option .checkbox-label input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  cursor: pointer;
}

.signature-option .checkbox-label .checkmark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border: 2px solid #4a90e2;
  border-radius: 4px;
  background-color: white;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* État au survol */
.signature-option .checkbox-label:hover .checkmark {
  border-color: #357abd;
  box-shadow: 0 2px 6px rgba(74, 144, 226, 0.3);
}

/* Coche activée */
.signature-option input[type="checkbox"]:checked + .checkmark {
  background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%);
  border-color: #357abd;
  box-shadow: 0 2px 8px rgba(74, 144, 226, 0.4);
}

/* Coche visuelle (checkmark) */
.signature-option input[type="checkbox"]:checked + .checkmark::after {
  content: "✓";
  color: white;
  font-weight: bold;
  font-size: 13px;
}

/* Coche désactivée */
.signature-option input[type="checkbox"]:disabled + .checkmark {
  background-color: #f0f0f0;
  border-color: #ccc;
  cursor: not-allowed;
}

.signature-option .checkbox-label:has(input[type="checkbox"]:disabled) {
  color: #999;
  cursor: not-allowed;
}

/* Texte du label */
.signature-option .label-text {
  font-size: 0.95rem;
  letter-spacing: 0.3px;
}

/* Information de crédit */
.signature-info {
  margin: 0;
  padding: 0 0 0 1.95rem;
  font-size: 0.85rem;
  transition: all 0.2s ease;
}

/* Textes informatifs */
.info-text {
  color: #4a90e2;
  font-weight: 500;
}

.success-text {
  color: #27ae60;
  font-weight: 500;
}

.warning-text {
  color: #e74c3c;
  font-weight: 500;
}

/* Mode sombre */
@media (prefers-color-scheme: dark) {
  .signature-checkbox-container {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    border-left-color: #3498db;
  }

  .signature-option .checkbox-label {
    color: #ecf0f1;
  }

  .signature-option .checkbox-label:hover {
    color: #3498db;
  }

  .signature-option .checkmark {
    border-color: #3498db;
    background-color: #34495e;
  }

  .signature-option .checkbox-label:hover .checkmark {
    border-color: #2980b9;
    box-shadow: 0 2px 6px rgba(52, 152, 219, 0.3);
  }

  .signature-option input[type="checkbox"]:checked + .checkmark {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    border-color: #2980b9;
  }

  .signature-option input[type="checkbox"]:disabled + .checkmark {
    background-color: #3a4a5a;
    border-color: #555;
  }

  .info-text {
    color: #3498db;
  }

  .success-text {
    color: #2ecc71;
  }

  .warning-text {
    color: #e74c3c;
  }
}

/* Responsive */
@media (max-width: 768px) {
  .signature-checkbox-container {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .signature-option {
    width: 100%;
  }

  .signature-option .checkbox-label {
    font-size: 0.9rem;
  }
}

/* État focus pour l'accessibilité */
.signature-option input[type="checkbox"]:focus + .checkmark {
  outline: 2px solid #4a90e2;
  outline-offset: 2px;
}

/* Animation du texte d'info */
.signature-info {
  animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
/* ============================================================
   PATCH courrier-signature-styles.css
   Ajouter ces règles à la fin du fichier existant
   ============================================================ */

/* Indentation option signature sous "Joindre PDF" */
.signature-option--indented {
  margin-left: 1.5rem;
  margin-top: 0.25rem;
}

/* Option SMS masquée par défaut (remplace style="display:none") */
.signature-sms-option--hidden {
  display: none;
}

/* Hint SMS (remplace style="margin-left:2rem; font-size:0.85rem") */
.sms-info-hint {
  margin-left: 2rem;
  font-size: 0.85rem;
  color: var(--text-muted, #6b7280);
  margin-top: 0.25rem;
}

/* Ligne principale flex (Joindre + sep + Signer) */
.sig-row {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.sig-option {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.sig-sep {
  color: #d1d5db;
  font-size: 1rem;
  line-height: 1.75rem;
  user-select: none;
}

/* Badges credit */
.sig-credit-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  color: #6366f1;
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  border-radius: 20px;
  padding: 0.1rem 0.5rem;
  margin-left: 1.6rem;
  white-space: nowrap;
}
.sig-credit-badge--sms {
  color: #7c3aed;
  background: #f5f3ff;
  border-color: #ddd6fe;
}

/* Ligne SMS sur ligne separee */
.sig-sms-row {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px dashed #e5e7eb;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.sig-sms-row--hidden {
  display: none;
}

/* Hint texte sous SMS */
.sms-info-hint {
  margin-left: 1.6rem;
  font-size: 0.78rem;
  color: #9ca3af;
  margin-top: 0.1rem;
}

/* Conteneur global signature */
.signature-checkbox-container {
  padding: 0.6rem 0.75rem;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  margin-bottom: 0.75rem;
}
/* ============================================
   Modal overlay — partagé entre showUpgradeModal
   et showStorageQuotaModal (courrier-signature-handler.js)
   ============================================ */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10500;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  animation: modalFadeIn 0.2s ease-out;
}

.modal-content {
  position: relative;
  background: #fff;
  border-radius: 20px;
  padding: 36px 32px 28px;
  width: 90%;
  max-width: 460px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.22);
  animation: modalSlideUp 0.25s ease-out;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.modal-header h3 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
  color: #1f2937;
}

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

.modal-close:hover {
  color: #1f2937;
}

.modal-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 0.9rem;
  color: #374151;
}

.modal-body p {
  margin: 0;
}

.modal-footer {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}

.btn-primary {
  flex: 2;
  padding: 11px;
  border: none;
  border-radius: 8px;
  background: var(--fv-forest-500, #447240);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-primary:hover {
  background: var(--fv-forest-700, #2a4828);
}

.btn-secondary {
  flex: 1;
  padding: 11px;
  border: 1.5px solid #e5e7eb;
  border-radius: 8px;
  background: transparent;
  color: #6b7280;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-secondary:hover {
  background: #f1f5f9;
  color: #1f2937;
}

.upgrade-benefits {
  background: #f8fafc;
  border-radius: 10px;
  padding: 14px 16px;
}

.upgrade-benefits h4 {
  margin: 0 0 8px;
  font-size: 0.9rem;
  font-weight: 700;
  color: #374151;
}

.upgrade-benefits ul {
  margin: 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.upgrade-benefits li {
  font-size: 0.86rem;
  color: #6b7280;
}

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

@keyframes modalSlideUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
