/* =============================================
   RFMF Formulaire Partenaire — formulaire.css v2
   Compatible Enfold / thèmes WP génériques
   ============================================= */

#rfmf-form-wrap {
  font-family: inherit;
  font-size: 15px;
  color: #1a1a2e;
  max-width: 780px;
  margin: 0 auto;
  padding: 0 4px;
}

/* ---- Alerte connexion ---- */
.rfmf-notice {
  font-size: 14px;
  color: #6b7280;
  padding: 16px 20px;
  border: 1px solid #e0e4ef;
  border-radius: 10px;
  background: #f8f9fc;
}

/* ---- Succès ---- */
#rfmf-form-success { display: none; }
.rfmf-success-box {
  text-align: center;
  padding: 48px 32px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 16px;
}
.rfmf-success-icon { font-size: 52px; display: block; margin-bottom: 16px; }
.rfmf-success-box h2 { font-size: 22px; font-weight: 700; color: #15803d; margin: 0 0 10px; }
.rfmf-success-box p  { color: #4b5563; margin-bottom: 24px; }

/* ======== FIELDSETS ======== */
.rfmf-fieldset {
  border: none;
  border-radius: 14px;
  padding: 0;
  margin: 0 0 20px;
  background: transparent;
}

.rfmf-fieldset-inner {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 24px 28px 20px;
}

.rfmf-fieldset-title {
  font-size: 15px;
  font-weight: 700;
  color: #1d4ed8;
  margin: 0 0 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid #eff6ff;
  display: flex;
  align-items: center;
  gap: 10px;
}
.rfmf-fieldset-title-icon { font-size: 18px; }

/* ======== CHAMPS ======== */
.rfmf-field { margin-bottom: 16px; }
.rfmf-field:last-child { margin-bottom: 0; }

.rfmf-field > label,
.rfmf-checkgroup-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 6px;
}

/* Étoile obligatoire */
.rfmf-req::after { content: ' *'; color: #dc2626; }

.rfmf-field input[type=text],
.rfmf-field input[type=email],
.rfmf-field input[type=url],
.rfmf-field select,
.rfmf-inline-search {
  display: block;
  width: 100%;
  font-size: 14px;
  font-family: inherit;
  padding: 10px 14px;
  border: 1.5px solid #e5e7eb;
  border-radius: 9px;
  background: #f9fafb;
  color: #111827;
  outline: none;
  transition: border-color .15s, background .15s, box-shadow .15s;
  -webkit-appearance: none;
  box-sizing: border-box;
}
.rfmf-field input:focus,
.rfmf-field select:focus,
.rfmf-inline-search:focus {
  border-color: #2563eb;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
.rfmf-field input.rfmf-invalid,
.rfmf-field select.rfmf-invalid {
  border-color: #dc2626;
  background: #fff5f5;
}
.rfmf-field input.rfmf-valid {
  border-color: #16a34a;
  background: #f0fdf4;
}

.rfmf-field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7280' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}

.rfmf-hint {
  display: block;
  font-size: 12px;
  color: #9ca3af;
  margin-top: 5px;
}
.rfmf-optional {
  font-size: 11px;
  font-weight: 400;
  color: #9ca3af;
  margin-left: 4px;
}

/* Grille 2 colonnes */
.rfmf-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 12px;
  align-items: start;
}
.rfmf-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* ======== AUTOCOMPLÉTION ADRESSE ======== */
.rfmf-addr-wrap { position: relative; }

#rfmf-addr-suggestions {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 3px);
  background: #fff;
  border: 1.5px solid #2563eb;
  border-radius: 10px;
  z-index: 9999;
  display: none;
  max-height: 220px;
  overflow-y: auto;
  box-shadow: 0 8px 24px rgba(37,99,235,.15);
}
.rfmf-addr-item {
  padding: 10px 14px;
  font-size: 13px;
  cursor: pointer;
  border-bottom: 1px solid #f0f4ff;
  color: #374151;
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: background .1s;
}
.rfmf-addr-item:last-child { border-bottom: none; }
.rfmf-addr-item:hover { background: #eff6ff; }
.rfmf-addr-item strong { font-size: 13px; color: #1a1a2e; }
.rfmf-addr-item span   { font-size: 11px; color: #9ca3af; }

/* Statut géocodage */
#rfmf-geocode-status {
  font-size: 12px;
  margin-top: 6px;
  min-height: 0;
  display: flex;
  align-items: center;
  gap: 5px;
}
#rfmf-geocode-status.ok  { color: #16a34a; }
#rfmf-geocode-status.err { color: #dc2626; }

/* ======== UPLOAD LOGO ======== */
.rfmf-upload-zone {
  border: 2px dashed #d1d5db;
  border-radius: 12px;
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  background: #f9fafb;
}
.rfmf-upload-zone:hover,
.rfmf-upload-zone.dragover {
  border-color: #2563eb;
  background: #eff6ff;
}
.rfmf-upload-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: #6b7280;
  font-size: 13px;
}
.rfmf-upload-icon { font-size: 32px; }
.rfmf-upload-preview img {
  width: 80px; height: 80px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid #e5e7eb;
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
}

/* ======== SECTION HINT ======== */
.rfmf-section-hint {
  font-size: 13px;
  color: #374151;
  margin-bottom: 20px;
  padding: 10px 14px;
  background: #eff6ff;
  border-radius: 8px;
  border-left: 3px solid #2563eb;
}

/* ======== CHECKBOXES ======== */
.rfmf-checkgroup { margin-bottom: 24px; }
.rfmf-checkgroup:last-child { margin-bottom: 0; }

.rfmf-checkgroup-label {
  font-size: 13px;
  font-weight: 700;
  color: #1d4ed8;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.rfmf-checkgroup-label::before {
  content: '';
  display: inline-block;
  width: 3px;
  height: 14px;
  background: #2563eb;
  border-radius: 2px;
  flex-shrink: 0;
}

.rfmf-inline-search {
  margin-bottom: 10px;
  font-size: 13px;
  padding: 8px 12px;
}

.rfmf-checks {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 4px 12px;
  padding: 4px 0;
}
.rfmf-checks-3col {
  grid-template-columns: repeat(auto-fill, minmax(185px, 1fr));
}

.rfmf-check {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  color: #374151;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 8px;
  transition: background .1s;
  border: 1px solid transparent;
}
.rfmf-check:hover { background: #eff6ff; border-color: #dbeafe; }
.rfmf-check input[type=checkbox] {
  width: 16px; height: 16px;
  accent-color: #2563eb;
  flex-shrink: 0;
  cursor: pointer;
}
.rfmf-check.hidden { display: none; }

/* ======== FOOTER FORMULAIRE ======== */
.rfmf-form-footer {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  margin-top: 4px;
  padding: 24px 28px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
}

.rfmf-error-msg {
  font-size: 13px;
  color: #dc2626;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 12px 16px;
  width: 100%;
  line-height: 1.6;
}

.rfmf-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-family: inherit;
  font-weight: 700;
  padding: 13px 32px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: transform .12s, box-shadow .12s, background .15s;
  text-decoration: none;
  letter-spacing: -.01em;
}
.rfmf-btn:active { transform: scale(.98); }
.rfmf-btn-primary {
  background: #2563eb;
  color: #fff !important;
  box-shadow: 0 4px 16px rgba(37,99,235,.3);
}
.rfmf-btn-primary:hover {
  background: #1d4ed8;
  box-shadow: 0 6px 20px rgba(37,99,235,.4);
  color: #fff !important;
}
.rfmf-btn-primary:disabled {
  background: #93c5fd;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

/* ======== RESPONSIVE ======== */
@media (max-width: 600px) {
  .rfmf-fieldset-inner { padding: 16px; }
  .rfmf-row { grid-template-columns: 1fr; }
  .rfmf-row-2 { grid-template-columns: 1fr; }
  .rfmf-checks { grid-template-columns: 1fr 1fr; }
}
