div#frm_compatibilite_cadre {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem 0;    
  border: 0;
}
#frm_compatibilite_cadre,
#frm_compatibilite_cadre *,
#frm_compatibilite_cadre *::before,
#frm_compatibilite_cadre *::after {
  box-sizing: border-box;
}
.card {
  background: #fff;
  border: 1.5px solid #d0dbe8;
  border-radius: 14px;
  padding: 2rem 2.2rem 1.6rem;
  /*max-width: 780px;*/
  width: 100%;
  box-shadow: 0 4px 24px rgba(30, 60, 120, 0.07);
}

/* Header */
.card-header {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.6rem;
}
.check-icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  background: #e6f9f0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: -4px;
}
.check-icon svg { width: 14px; height: 14px; }
.card-header p.frm_titre {
  font-size: 1.25rem;
  font-weight: 700;
  color: #2a628d;
  line-height: 1.3;
  margin:0;
  padding:0;
}

.card-subtitle {
  font-size: 0.9rem;
  color: #4a5568;
  margin: 0 auto;
  line-height: 1.5;
}
.card-subtitle a {
  color: #e87722;
  text-decoration: none;
  font-weight: 600;
}
.card-subtitle a:hover { text-decoration: underline; }

/* Bouton toggle */
#frm_compatibilite_cadre .card-header {
    justify-content: space-between; /* pousse le bouton à droite */
    align-items: center;
}

#frm_compatibilite_cadre .frm-toggle-btn {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 2px solid #d0dbe8;
    background: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s, background 0.2s;
    padding: 0;
    margin-left: auto;
}
#frm_compatibilite_cadre .frm-toggle-btn:hover {
    border-color: #e87722;
    background: #fff8f3;
}
#frm_compatibilite_cadre .frm-toggle-btn svg {
    width: 16px;
    height: 16px;
    stroke: #4a5568;
    transition: transform 0.3s ease, stroke 0.2s;
}
#frm_compatibilite_cadre .frm-toggle-btn:hover svg {
    stroke: #e87722;
}
#frm_compatibilite_cadre .frm-toggle-btn.ouvert svg {
    transform: rotate(180deg);
}

/* Contenu masquable */
#frm_compatibilite_cadre .frm-contenu {
    display: none;
    /*overflow: hidden;*/
    margin: 25px 0 0 0;
}
#frm_compatibilite_cadre .frm-contenu.ouvert {
    display: block;
}

/* Tabs */
.tabs {
  display: flex;
  border-bottom: 2px solid #e2e8f0;
  margin-bottom: 1.6rem;
  gap: 0;
}
.tab-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.55rem 1.1rem 0.75rem;
  font-family: inherit;
  font-size: 0.93rem;
  font-weight: 500;
  color: #718096;
  position: relative;
  transition: color 0.2s;
  outline: none;
}
.tab-btn::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0; right: 0;
  height: 2.5px;
  background: #e87722;
  border-radius: 2px 2px 0 0;
  transform: scaleX(0);
  transition: transform 0.22s ease;
}
.tab-btn.active {
  color: #1a2d5a;
  font-weight: 700;
}
.tab-btn.active::after { transform: scaleX(1); }
.tab-btn:hover:not(.active) { color: #2d3748; }

/* Panels */
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* Form grid */
.form-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1.2rem 1.5rem;
  align-items: start;
}

.form-left { display: flex; flex-direction: column; gap: 1.1rem; }

.field-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #4a5568;
  margin-bottom: 0.45rem;
}

.form-input {
  width: 100%;
  border: 1.5px solid #cbd5e0;
  border-radius: 7px;
  padding: 0.72rem 1rem;
  font-family: inherit;
  font-size: 0.93rem;
  color: #2d3748;
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s;
  background: #fff;
}
.form-input::placeholder { color: #a0aec0; }
.form-input:focus {
  border-color: #e87722;
  box-shadow: 0 0 0 3px rgba(232, 119, 34, 0.12);
}


/* Upload area */
.upload-area {
  width: 240px;
  min-height: 120px;
  border: 2px dashed #cbd5e0;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  padding: 1rem;
  position: relative;
}

.upload-area:hover {
  border-color: #e87722;
  background: #fff8f3;
}
.upload-area.has-image { border-style: solid; border-color: #e87722; }
.upload-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #4a5568;
  margin-bottom: 0.5rem;
  align-self: flex-start;
}
.upload-wrapper { display: flex; flex-direction: column; align-items: flex-start; }
.upload-area svg { color: #a0aec0; transition: color 0.2s; }
.upload-area:hover svg { color: #e87722; }
.upload-area span {
  font-size: 0.8rem;
  color: #a0aec0;
  text-align: center;
}
.upload-area input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.upload-preview {
  width: 100%;
  height: 100%;
  object-fit: contain;
  max-height: 120px;
  border-radius: 6px;
  display: none;
}
.upload-area.has-image .upload-preview { display: block; }
.upload-area.has-image svg,
.upload-area.has-image span { display: none; }

.photo-conservee {
    font-size: 0.78rem;
    color: #28a745;
    margin-top: 0.4rem;
    font-style: italic;
}

/* Submit button */
.submit-btn {
  display: block;
  width: 100%;
  margin-top: 1.4rem;
  background: #e87722;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 1rem;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.18s, transform 0.12s, box-shadow 0.18s;
  box-shadow: 0 2px 10px rgba(232, 119, 34, 0.25);
}
.submit-btn:hover {
  background: #d06815;
  box-shadow: 0 4px 18px rgba(232, 119, 34, 0.35);
  transform: translateY(-1px);
}
.submit-btn:active { transform: translateY(0); }

/* Footer tip */
.card-tip {
  margin-top: 1.1rem;
  font-size: 0.78rem;
  color: #718096;
  font-style: italic;
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
}
.card-tip svg { flex-shrink: 0; margin-top: 0; }

/* Toast */
#toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #1a2d5a;
  color: #fff;
  padding: 0.8rem 1.6rem;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 500;
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: none;
  z-index: 999;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.ch_frm_name {
    position: absolute;
    z-index: -1;
    left: -9999px;
    width: 0px;
    height: 0px;
}
.frm_checksnmvr_champ2 {margin:0 !important;}
.frm_checksnmvr_champ2 input {padding:0 !important;}

div#frm_compatibilite_cadre p.error {
    font-size: 0.9em;
    margin: 5px auto;
    color: #8B0002;
    background: #ffcaca;
    padding: 10px 20px;
    border-radius: 0.3em;
    display: table;
}

.frm_check_envoiok {position:relative;padding:25px; border-radius:0.5em; border:1px solid #28a745; background:#d1ffdb; color:#28a745; text-align:center; width:90%; max-width:700px; margin:25px auto;font-size: 0.9em;}

@media (max-width: 580px) {
  .form-grid { grid-template-columns: 1fr; }
  .upload-area { width: 100%; min-height: 110px; }
  .upload-wrapper { width: 100%; }
}