/* ==============================
   🔘 Bouton principal
============================== */
main .fenetre-btn {
  background-color: #eeeeee;
  color: black;
  border: none;
  border-radius: 6px;
  padding: 0.6rem 1rem;
  width: 110px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

main .fenetre-btn:hover {
  background-color: #3d8f51;
  color: white;
}

/* ==============================
   📱 Responsive mobile (formulaire et bouton)
============================== */
@media (max-width: 768px) {
  .fenetre-container {
    flex-direction: column;
  }

  .fenetre-container>div:first-child {
    order: 1;
    width: 100%;
  }

  .fenetre-container>div:last-child {
    order: 2;
    width: 100%;
    padding-top: 2rem;
  }

  form {
    flex-direction: column;
  }

  .btn-container {
    justify-content: center !important;
  }

  .btn-container button {
    max-width: 100% !important;
  }
}

/* ==============================
   🪟 Section principale
============================== */
.fenetre-section {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 2rem;
  padding: 3rem;
  box-sizing: border-box;
}

/* ----- Image gauche ----- */
.fenetre-left {
  flex: 0 0 45%;
}

.fenetre-left img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ----- Bloc droit ----- */
.fenetre-right {
  flex: 0 0 55%;
  background: #fff;
  border: 2px solid #0b9866;
  border-radius: 5px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: stretch;
  justify-content: center;
}

.fenetre-content {
  width: 90%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.5rem 0;
}

/* ==============================
   🏷️ Titres et séparateur
============================== */
.fenetre-title {
  color: #4FA862;
  font-size: clamp(1.3rem, 2vw, 1.8rem);
  text-align: center;
  font-weight: 600;
  margin-bottom: 0.8rem;
}

.fenetre-separator {
  border: none;
  border-top: 1px solid #ddd;
  margin: 1rem 0;
}

/* ==============================
   🧩 Grilles (fenêtres / cadres)
============================== */
.fenetre-grid,
.cadre-placeholder {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
  gap: 1rem;
  justify-items: center;
}

.fenetre-item {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}

.fenetre-item img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.fenetre-item img:hover {
  transform: scale(1.05);
}

.fenetre-item span {
  color: #333;
  font-weight: 500;
  font-size: 0.9rem;
}

/* ==============================
   🧾 Formulaire deux colonnes
============================== */
.fenetre-form {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.form-columns {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
}

.form-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* ----- Labels & Inputs ----- */
label {
  display: flex;
  flex-direction: column;
  font-weight: 600;
  font-size: 0.9rem;
  color: #333;
}

input,
select {
  margin-top: 0.35rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 0.9rem;
  outline: none;
  width: 100%;
  box-sizing: border-box;
  height: 38px;
  /* ✅ assure un alignement parfait */
}

input:focus,
select:focus {
  border-color: #4FA862;
}

/* ----- Ligne de mesures (Longueur / Largeur) ----- */
.measure-row {
  display: flex;
  gap: 0.8rem;
}

.measure-row label {
  flex: 1;
}

/* ----- Bouton Envoyer ----- */
.submit-btn {
  background: #4FA862;
  color: white;
  border: none;
  padding: 0.7rem 2rem;
  font-weight: 600;
  cursor: pointer;
  align-self: center;
  border-radius: 4px;
  transition: background 0.3s ease;
}

.submit-btn:hover {
  background: #3c8a56;
}

/* ==============================
   ✅ Sélection de fenêtre
============================== */
.fenetre-item img.selected {
  outline: 3px solid #4FA862;
  transform: scale(1.1);
  transition: all 0.2s ease;
}

/* ==============================
   📱 Responsive professionnel
============================== */
@media (max-width: 991px) {
  .fenetre-section {
    flex-direction: column;
    padding: 1rem;
  }

  .fenetre-left,
  .fenetre-right {
    flex: 0 0 100%;
  }

  .fenetre-content {
    width: 100%;
    padding: 1rem;
  }

  .fenetre-grid,
  .cadre-placeholder {
    grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
    gap: 0.6rem;
  }

  .fenetre-item img {
    width: 65px;
    height: 65px;
  }

  .fenetre-item span {
    font-size: 0.8rem;
  }

  /* ✅ Tous les inputs passent en colonne */
  .form-columns {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    /* espace entre les colonnes */
  }

  .form-col {
    width: 100%;
  }

  .measure-row {
    flex-direction: column;
    gap: 1rem;
    /* espace entre longueur et largeur */
  }

  .submit-btn {
    width: 100%;
    align-self: center;
  }
}

/* --- MODAL GLOBALE --- */
.custom-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    background: white;
    padding: 1.8rem 2.5rem;
    border-radius: 14px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.25);
    opacity: 0;
    visibility: hidden;
    transition: 0.25s ease;
    z-index: 9999;
    font-family: sans-serif;
    text-align: center;
    min-width: 300px;
}

/* Apparition */
.custom-modal.show {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

/* Styles différents */
.modal-error {
    border-left: 6px solid #D9534F;
}

.modal-success {
    border-left: 6px solid #4FA862;
}

.custom-modal h3 {
    margin: 0 0 8px;
    font-size: 1.2rem;
}

.custom-modal p {
    margin: 0;
    font-size: 0.95rem;
    opacity: 0.85;
}