/* PRATINIUM v367 — alignement réel et complet du formulaire /identite.
   Cause réelle confirmée par inspection DOM : la cellule de contrôle de la
   ligne "Titre" (civilité M./Mme + case "Je suis une entreprise / association")
   porte un attribut style="width: auto !important; flex: 0 0 auto !important; ..."
   écrit en dur par un script du coeur PrestaShop (hors thème). Un style inline
   !important ne peut jamais être vaincu par une feuille de style externe : la
   correction principale se fait donc en JavaScript (voir
   pratinium-identity-page-v367-full-alignment.js), qui réécrit cet attribut.
   Ce fichier CSS complète en figeant : 1) le même habillage de carte pour
   TOUT .form-group du formulaire (avec ou sans .row) et 2) l'alignement
   extérieur du formulaire sur celui du bandeau bleu au-dessus. Chargé en
   dernier (priorité la plus haute). */

body#identity,
body.page-identity,
body.pratinium-identity-page-v367 {
  --pi367-label-width: 220px;
  --pi367-height: 58px;
  --pi367-radius: 15px;
  --pi367-line: #cedae8;
  --pi367-max: 1440px;
  --pi367-pad: 24px;
}

/* =========================
   1) Alignement extérieur : bandeau bleu / content-wrapper / formulaire
   strictement identiques (même max-width, même padding, même box-sizing).
   ========================= */
body#identity #content-wrapper,
body.page-identity #content-wrapper,
body.pratinium-identity-page-v367 #content-wrapper,
body#identity .pratinium-account-shortcuts-v353,
body.page-identity .pratinium-account-shortcuts-v353,
body.pratinium-identity-page-v367 .pratinium-account-shortcuts-v353 {
  width: 100% !important;
  max-width: var(--pi367-max) !important;
  margin-left: auto !important;
  margin-right: auto !important;
  padding-left: var(--pi367-pad) !important;
  padding-right: var(--pi367-pad) !important;
  box-sizing: border-box !important;
}

body#identity #customer-form,
body#identity form.js-customer-form,
body.page-identity #customer-form,
body.pratinium-identity-page-v367 #customer-form,
body#identity .page-footer,
body.page-identity .page-footer,
body.pratinium-identity-page-v367 .page-footer {
  width: 100% !important;
  max-width: 100% !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  box-sizing: border-box !important;
}

/* =========================
   2) TOUTE ligne du formulaire (.form-group, avec ou sans .row) reçoit
   exactement la même carte : mêmes marges gauche/droite, même padding.
   ========================= */
body#identity #customer-form section > .form-group,
body#identity form.js-customer-form section > .form-group,
body.page-identity #customer-form section > .form-group,
body.pratinium-identity-page-v367 #customer-form section > .form-group,
body#identity #customer-form section > .form-group.row,
body#identity form.js-customer-form section > .form-group.row,
body.page-identity #customer-form section > .form-group.row {
  position: relative !important;
  display: grid !important;
  grid-template-columns: var(--pi367-label-width) minmax(0, 1fr) !important;
  column-gap: 24px !important;
  row-gap: 8px !important;
  align-items: start !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 20px 26px !important;
  overflow: visible !important;
  box-sizing: border-box !important;
  border: 1px solid rgba(201, 213, 227, .86) !important;
  border-radius: 19px !important;
  background: linear-gradient(145deg, rgba(255,255,255,.985), rgba(248,251,255,.975)) !important;
  box-shadow: 0 9px 26px rgba(15, 35, 62, .045), inset 0 1px 0 rgba(255,255,255,.95) !important;
}

/* Ligne sans label propre (ex : case "Je suis une entreprise / association"
   seule) : le contenu occupe toute la largeur utile, mais garde la même
   carte / le même alignement gauche-droite que les autres lignes. */
body#identity #customer-form section > .form-group.pi358-no-label,
body#identity form.js-customer-form section > .form-group.pi358-no-label,
body.page-identity #customer-form section > .form-group.pi358-no-label {
  grid-template-columns: minmax(0, 1fr) !important;
}

/* Neutralise les restes de grille Bootstrap (col-lg-*, etc.) qui pourraient
   décaler le contenu à l'intérieur d'un .form-group non pris en charge. */
body#identity #customer-form section > .form-group > [class*="col-"],
body#identity form.js-customer-form section > .form-group > [class*="col-"],
body.page-identity #customer-form section > .form-group > [class*="col-"] {
  float: none !important;
  flex: none !important;
  width: auto !important;
  max-width: none !important;
  min-width: 0 !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

/* Groupes de radios / cases à cocher (civilité, "Je suis une entreprise", etc.)
   qui n'ont pas encore été normalisés en cellule label/champ par le JS :
   alignement et espacement cohérents, sans casser la carte. */
body#identity #customer-form section > .form-group:not(.pi358-row) input[type="radio"],
body#identity #customer-form section > .form-group:not(.pi358-row) input[type="checkbox"],
body.page-identity #customer-form section > .form-group:not(.pi358-row) input[type="radio"],
body.page-identity #customer-form section > .form-group:not(.pi358-row) input[type="checkbox"] {
  accent-color: #18afe9 !important;
}

body#identity #customer-form section > .form-group:not(.pi358-row) .radio-inline,
body#identity #customer-form section > .form-group:not(.pi358-row) .checkbox,
body.page-identity #customer-form section > .form-group:not(.pi358-row) .radio-inline,
body.page-identity #customer-form section > .form-group:not(.pi358-row) .checkbox {
  display: inline-flex !important;
  align-items: center !important;
  margin: 0 20px 0 0 !important;
}

/* =========================
   3) Le conteneur direct de la grille (section) ne doit jamais réintroduire
   une marge/largeur différente d'une ligne à l'autre.
   ========================= */
body#identity #customer-form > section,
body#identity form.js-customer-form > section,
body.page-identity #customer-form > section,
body.pratinium-identity-page-v367 #customer-form > section {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 13px !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  margin: 0 0 12px !important;
  padding: 0 !important;
  box-sizing: border-box !important;
}

@media (max-width: 1050px) {
  body#identity,
  body.page-identity,
  body.pratinium-identity-page-v367 {
    --pi367-label-width: 190px;
  }
}

@media (max-width: 860px) {
  body#identity #customer-form section > .form-group,
  body#identity form.js-customer-form section > .form-group,
  body.page-identity #customer-form section > .form-group {
    grid-template-columns: minmax(0, 1fr) !important;
    padding: 18px !important;
  }
}

@media (max-width: 991px) {
  body#identity #content-wrapper,
  body.page-identity #content-wrapper,
  body.pratinium-identity-page-v367 #content-wrapper,
  body#identity .pratinium-account-shortcuts-v353,
  body.page-identity .pratinium-account-shortcuts-v353,
  body.pratinium-identity-page-v367 .pratinium-account-shortcuts-v353 {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }
}
