/* ============================================================
   BEFORMA — Modale Téléchargement PDF
   Fichier partagé — inclus dans toutes les pages formation
   ============================================================ */

/* ── Overlay ── */
.pdf-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(11, 31, 79, 0.72);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 9000;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: overlayFadeIn .2s ease;
}
.pdf-overlay.active {
  display: flex;
}
@keyframes overlayFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ── Carte modale ── */
.pdf-modal {
  background: #fff;
  border-radius: 20px;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 32px 80px rgba(11,31,79,.35);
  overflow: hidden;
  animation: modalSlideUp .25s cubic-bezier(.34,1.56,.64,1);
  position: relative;
}
@keyframes modalSlideUp {
  from { opacity: 0; transform: translateY(28px) scale(.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── En-tête ── */
.pdf-modal-header {
  background: linear-gradient(135deg, #0b1f4f 0%, #1a3a7c 100%);
  padding: 28px 28px 22px;
  position: relative;
}
.pdf-modal-header .modal-icon {
  width: 44px;
  height: 44px;
  background: rgba(247,168,0,.18);
  border: 1.5px solid rgba(247,168,0,.4);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  margin-bottom: 14px;
}
.pdf-modal-header h3 {
  color: #fff;
  font-size: 1.15rem;
  font-weight: 800;
  margin: 0 0 4px;
  letter-spacing: -.01em;
}
.pdf-modal-formation-name {
  color: rgba(255,255,255,.65);
  font-size: 0.82rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Bouton fermer ── */
.pdf-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  background: rgba(255,255,255,.12);
  border: none;
  border-radius: 50%;
  color: #fff;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s;
  line-height: 1;
}
.pdf-modal-close:hover {
  background: rgba(255,255,255,.22);
}

/* ── Corps ── */
.pdf-modal-body {
  padding: 24px 28px 28px;
}
.pdf-modal-body .modal-intro {
  font-size: 0.84rem;
  color: #6b7280;
  margin-bottom: 20px;
  line-height: 1.5;
}

/* ── Grille de champs ── */
.pdf-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}
.pdf-form-full {
  margin-bottom: 12px;
}

/* ── Champ input ── */
.pdf-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.pdf-field label {
  font-size: 0.78rem;
  font-weight: 600;
  color: #374151;
  letter-spacing: .01em;
}
.pdf-field label span.req {
  color: #f7a800;
  margin-left: 2px;
}
.pdf-field input[type="text"],
.pdf-field input[type="email"],
.pdf-field input[type="tel"] {
  padding: 10px 14px;
  border: 1.5px solid #e5e7eb;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.9rem;
  color: #111827;
  transition: border-color .15s, box-shadow .15s;
  outline: none;
  background: #f9fafb;
}
.pdf-field input:focus {
  border-color: #0b1f4f;
  box-shadow: 0 0 0 3px rgba(11,31,79,.08);
  background: #fff;
}
.pdf-field input.error {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239,68,68,.08);
}
.pdf-field .field-error {
  font-size: 0.74rem;
  color: #ef4444;
  display: none;
}
.pdf-field .field-error.visible {
  display: block;
}

/* ── Cases à cocher ── */
.pdf-check-group {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.pdf-check-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
}
.pdf-check-item input[type="checkbox"] {
  width: 17px;
  height: 17px;
  min-width: 17px;
  accent-color: #0b1f4f;
  margin-top: 1px;
  cursor: pointer;
}
.pdf-check-item .check-label {
  font-size: 0.81rem;
  color: #4b5563;
  line-height: 1.45;
}
.pdf-check-item .check-label a {
  color: #0b1f4f;
  text-decoration: underline;
}
.pdf-check-item.rgpd-required .check-label {
  font-weight: 500;
}

/* ── Bouton submit ── */
.pdf-submit-btn {
  width: 100%;
  margin-top: 20px;
  padding: 14px 20px;
  background: linear-gradient(135deg, #f7a800 0%, #e09500 100%);
  color: #0b1f4f;
  border: none;
  border-radius: 12px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform .15s, box-shadow .15s, opacity .15s;
  letter-spacing: .01em;
}
.pdf-submit-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(247,168,0,.35);
}
.pdf-submit-btn:disabled {
  opacity: .6;
  cursor: not-allowed;
}
.pdf-submit-btn .btn-spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(11,31,79,.25);
  border-top-color: #0b1f4f;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
.pdf-submit-btn.loading .btn-spinner {
  display: block;
}
.pdf-submit-btn.loading .btn-text {
  display: none;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Message de succès ── */
.pdf-success-state {
  display: none;
  padding: 32px 28px;
  text-align: center;
}
.pdf-success-state.visible {
  display: block;
}
.pdf-modal-body.hidden {
  display: none;
}
.pdf-success-icon {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, #d1fae5, #a7f3d0);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  margin: 0 auto 16px;
}
.pdf-success-state h4 {
  font-size: 1.1rem;
  font-weight: 800;
  color: #111827;
  margin-bottom: 8px;
}
.pdf-success-state p {
  font-size: 0.85rem;
  color: #6b7280;
  line-height: 1.55;
}
.pdf-success-state .success-close {
  margin-top: 20px;
  padding: 10px 24px;
  background: #f3f4f6;
  border: none;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  color: #374151;
  cursor: pointer;
  transition: background .15s;
}
.pdf-success-state .success-close:hover {
  background: #e5e7eb;
}

/* ── Bouton "Télécharger" dans la sidebar ── */
.sidebar-download-wrap {
  display: flex;
  justify-content: center;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,.08);
}

.btn-download-pdf {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 10px;
  transition: background .15s;
  font-family: inherit;
  position: relative;
}
.btn-download-pdf:hover {
  background: rgba(255,255,255,.06);
}

/* Icône ronde */
.btn-download-pdf .dl-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(247,168,0,.12);
  border: 1.5px solid rgba(247,168,0,.35);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #f7a800;
  transition: background .2s, border-color .2s, transform .2s;
}
.btn-download-pdf:hover .dl-icon {
  background: rgba(247,168,0,.22);
  border-color: #f7a800;
  transform: translateY(2px);
}
.btn-download-pdf .dl-icon svg {
  width: 18px;
  height: 18px;
}

/* Label sous l'icône */
.btn-download-pdf .dl-label {
  font-size: 0.70rem;
  font-weight: 600;
  color: rgba(255,255,255,.5);
  letter-spacing: .02em;
  white-space: nowrap;
  transition: color .15s;
  max-width: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-width .25s ease, opacity .2s ease, color .15s;
}
.btn-download-pdf:hover .dl-label {
  max-width: 160px;
  opacity: 1;
  color: rgba(255,255,255,.75);
}

/* ── Responsive ── */
@media (max-width: 520px) {
  .pdf-modal {
    border-radius: 16px;
    max-height: 90vh;
    overflow-y: auto;
  }
  .pdf-form-row {
    grid-template-columns: 1fr;
  }
  .pdf-modal-header,
  .pdf-modal-body {
    padding-left: 20px;
    padding-right: 20px;
  }
}
