/* ================================
   STABLE MODERN LAYOUT (NO order/nth)
   - Labels on top
   - 2 columns
   - Captcha input left / image right
   ================================ */

/* 1) Neutraliser l’ancien layout Zoho (float/width) */
#crmWebToEntityForm .zcwf_col_lab,
#crmWebToEntityForm .zcwf_col_fld,
#crmWebToEntityForm .zcwf_col_help{
  float: none !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* 2) Form = grid 2 colonnes */
#crmWebToEntityForm form{
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 18px !important;
}

/* 3) Chaque row = bloc vertical */
#crmWebToEntityForm .zcwf_row{
  margin: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
}

/* 4) Labels au-dessus */
#crmWebToEntityForm .zcwf_col_lab label{
  display:block;
  font-size: 13px;
  font-weight: 700;
  color: #111827;
}

/* 5) Inputs modern */
#crmWebToEntityForm input[type="text"],
#crmWebToEntityForm textarea{
  width: 100% !important;
  padding: 14px 14px !important;
  border-radius: 12px !important;
  border: 1px solid #d6dbe3 !important;
  background: #fff !important;
  font-size: 14.5px !important;
  outline: none !important;
}

#crmWebToEntityForm input[type="text"]:focus,
#crmWebToEntityForm textarea:focus{
  border-color: #45DEBF !important;
  box-shadow: 0 0 0 4px rgba(69,222,191,.18) !important;
}

/* 6) Full width rows (Description, Privacy, Buttons) */
#crmWebToEntityForm .zcwf_row:has(textarea),
#crmWebToEntityForm .zcwf_row:has(.zcwf_privacy),
#crmWebToEntityForm .zcwf_row:has(#formsubmit){
  grid-column: 1 / -1 !important;
}

/* ==========================================================
   ✅ 7) FORCE EXACT ORDER BY FIELD ID (stable)
   We assign each field row to a specific grid position
   (grid-row / grid-column)
   ========================================================== */

/* Row 1: Nom (col 1) / Prénom (col 2) */
#crmWebToEntityForm .zcwf_row:has(#Last_Name){ grid-column: 1; grid-row: 1; }
#crmWebToEntityForm .zcwf_row:has(#First_Name){ grid-column: 2; grid-row: 1; }

/* Row 2: Email (col 1) / Phone (col 2) */
#crmWebToEntityForm .zcwf_row:has(#Email){ grid-column: 1; grid-row: 2; }
#crmWebToEntityForm .zcwf_row:has(#Phone){ grid-column: 2; grid-row: 2; }

/* Row 3: Société (col 1) / Titre (col 2) */
#crmWebToEntityForm .zcwf_row:has(#Company){ grid-column: 1; grid-row: 3; }
#crmWebToEntityForm .zcwf_row:has(#Designation){ grid-column: 2; grid-row: 3; }

/* Row 4: Nbre employés (col 1) / Site Web (col 2) */
#crmWebToEntityForm .zcwf_row:has(#No_of_Employees){ grid-column: 1; grid-row: 4; }
#crmWebToEntityForm .zcwf_row:has(#Website){ grid-column: 2; grid-row: 4; }

/* Row 5: Description full width */
#crmWebToEntityForm .zcwf_row:has(#Description){
  grid-column: 1 / -1 !important;
  grid-row: 5 !important;
}

/* ==========================================================
   ✅ 8) Captcha in ONE visual row:
   - input left
   - image + relancer right
   ========================================================== */

/* Captcha input row (left) */
#crmWebToEntityForm .zcwf_row:has(#captchaField6223354000002029005){
  grid-column: 1 !important;
  grid-row: 6 !important;
}

/* Captcha image row (right) */
#crmWebToEntityForm .zcwf_row:has(#imgid6223354000002029005){
  grid-column: 2 !important;
  grid-row: 6 !important;
  align-items: flex-start;
}

/* Make captcha image look good */
#crmWebToEntityForm #imgid6223354000002029005{
  max-width: 240px !important;
  border-radius: 10px !important;
  border: 1px solid #e5e7eb !important;
  display:block;
  margin-top: 2px;
}

/* Relancer spacing */
#crmWebToEntityForm .zcwf_row:has(#imgid6223354000002029005) a{
  display:inline-block;
  margin-top: 10px;
  font-weight: 700;
  color:#316FF5;
  text-decoration:none;
}
#crmWebToEntityForm .zcwf_row:has(#imgid6223354000002029005) a:hover{
  text-decoration: underline;
}

/* Privacy row after captcha */
#crmWebToEntityForm .zcwf_row:has(.zcwf_privacy){
  grid-column: 1 / -1 !important;
  grid-row: 7 !important;
}

/* Buttons row after privacy */
#crmWebToEntityForm .zcwf_row:has(#formsubmit){
  grid-column: 1 / -1 !important;
  grid-row: 8 !important;
}

/* Buttons side-by-side */
#crmWebToEntityForm .zcwf_row:has(#formsubmit) .zcwf_col_fld{
  display:flex !important;
  gap: 12px !important;
  flex-wrap: wrap;
}

/* Mobile: 1 column, keep order */
@media (max-width: 768px){
  #crmWebToEntityForm form{
    grid-template-columns: 1fr !important;
  }
  #crmWebToEntityForm .zcwf_row{
    grid-column: 1 / -1 !important;
  }
}

/* ================================
   MAIN CARD – ROUNDED CORNERS FIX
   ================================ */

#crmWebToEntityForm{
  background: #ffffff !important;
  border-radius: 20px !important;
  overflow: hidden !important; /* 👈 clé pour coins visibles */
  padding: 32px !important;
  box-shadow: 0 14px 40px rgba(0,0,0,.08);
}

/* Empêche le fond extérieur de "couper" la card */
#crmWebToEntityForm *{
  box-sizing: border-box;
}
#crmWebToEntityForm form{
  padding-bottom: 16px;
}

#crmWebToEntityForm .zcwf_title{
  display: none !important;
}
