/* =====================================================
   COLLER TOUT ÇA À LA FIN DE style.css
   ===================================================== */

/* ===== FORMULAIRE DE COMMANDE ===== */
#order-form {
  position: relative;
}

/* Barre de progression */
.form-progress {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

.progress-step {
  padding: 8px 18px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  font-family: Georgia, serif;
  background: #f0ebe0;
  color: #aaa;
  border: 2px solid #e8dcc8;
  transition: all 0.3s ease;
}

.progress-step.active {
  background: linear-gradient(135deg, #d4a574 0%, #b8860b 100%);
  color: white;
  border-color: #b8860b;
}

.progress-step.done {
  background: #e8f5e9;
  color: #4caf50;
  border-color: #4caf50;
}

/* Étapes */
.form-step { animation: fadeInUp 0.4s ease-out; }
.form-step.hidden { display: none; }

/* Grille nœuds */
.form-knots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.form-knot-card {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  border: 3px solid #f0ebe0;
  cursor: pointer;
  transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.3s ease;
  box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

.form-knot-card:hover {
  border-color: #d4a574;
  transform: scale(1.6);
  box-shadow: 0 15px 40px rgba(212,165,116,0.45);
  z-index: 10;
  position: relative;
}

.form-knot-card.selected {
  border-color: #b8860b;
  box-shadow: 0 0 0 3px rgba(184,134,11,0.3);
  transform: scale(1.6);
}

.form-knot-card img {
  width: 100%;
  height: 130px;
  object-fit: contain;
  display: block;
  padding: 8px;
}

.form-knot-card p {
  padding: 10px;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  color: #3d2817;
  margin: 0;
  font-family: Georgia, serif;
}

/* Grille attaches / fermetures */
.form-choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.form-choice-card {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  border: 3px solid #f0ebe0;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

.form-choice-card:hover {
  border-color: #d4a574;
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(212,165,116,0.25);
}

.form-choice-card.selected {
  border-color: #b8860b;
  box-shadow: 0 0 0 3px rgba(184,134,11,0.3);
  transform: translateY(-5px);
}

.form-choice-card img {
  width: 100%;
  height: 160px;
  object-fit: contain;
  display: block;
  padding: 15px;
}

.form-choice-card p {
  padding: 12px;
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  color: #3d2817;
  margin: 0;
  font-family: Georgia, serif;
}

/* Sélecteurs couleurs */
#color-selectors {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-top: 20px;
}

.color-selector-row {
  display: flex;
  align-items: center;
  gap: 15px;
}

.color-selector-row label {
  font-weight: 700;
  color: #3d2817;
  font-family: Georgia, serif;
  min-width: 80px;
  font-size: 15px;
}

.color-selector-row select {
  flex: 1;
  padding: 12px 16px;
  border: 2px solid #e8dcc8;
  border-radius: 10px;
  font-family: Georgia, serif;
  font-size: 14px;
  color: #3d2817;
  background: white;
  cursor: pointer;
  transition: border-color 0.3s ease;
  appearance: none;
  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 fill='%23b8860b' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

.color-selector-row select:focus {
  outline: none;
  border-color: #d4a574;
}

.color-selector-row select:disabled {
  background-color: #f5f0e8;
  color: #888;
  cursor: default;
}

.color-badge-noir {
  background: #222;
  color: white;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  font-family: Georgia, serif;
  white-space: nowrap;
}

/* Champs formulaire */
.form-field {
  margin-bottom: 25px;
}

.form-field label {
  display: block;
  font-weight: 700;
  color: #3d2817;
  font-family: Georgia, serif;
  font-size: 15px;
  margin-bottom: 8px;
}

.form-field input[type="text"],
.form-field input[type="tel"],
.form-field input[type="email"],
.form-field input[type="number"] {
  width: 100%;
  padding: 13px 16px;
  border: 2px solid #e8dcc8;
  border-radius: 10px;
  font-family: Georgia, serif;
  font-size: 15px;
  color: #3d2817;
  transition: border-color 0.3s ease;
  background: white;
}

.form-field input:focus {
  outline: none;
  border-color: #d4a574;
  box-shadow: 0 0 0 3px rgba(212,165,116,0.15);
}

.form-radio-group {
  display: flex;
  gap: 30px;
  margin-top: 8px;
}

.form-radio {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: Georgia, serif;
  font-size: 15px;
  color: #3d2817;
  cursor: pointer;
}

.form-radio input[type="radio"] {
  width: 18px;
  height: 18px;
  accent-color: #b8860b;
  cursor: pointer;
}

.form-hint {
  font-size: 14px !important;
  color: #888 !important;
  font-style: italic;
  margin-top: 8px !important;
  margin-bottom: 0 !important;
  line-height: 1.6 !important;
}

/* Navigation */
.form-nav {
  display: flex;
  gap: 15px;
  justify-content: center;
  margin-top: 40px;
  flex-wrap: wrap;
}

.form-btn-primary {
  padding: 14px 40px;
  background: linear-gradient(135deg, #d4a574 0%, #b8860b 100%);
  color: white;
  border: none;
  border-radius: 30px;
  font-size: 15px;
  font-weight: 700;
  font-family: Georgia, serif;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 6px 20px rgba(212,165,116,0.35);
}

.form-btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(212,165,116,0.5);
}

.form-btn-secondary {
  padding: 14px 40px;
  background: white;
  color: #b8860b;
  border: 2px solid #d4a574;
  border-radius: 30px;
  font-size: 15px;
  font-weight: 700;
  font-family: Georgia, serif;
  cursor: pointer;
  transition: all 0.3s ease;
}

.form-btn-secondary:hover {
  background: #fdf6ec;
  transform: translateY(-3px);
}

.form-error {
  color: #e53935;
  font-family: Georgia, serif;
  font-size: 14px;
  text-align: center;
  margin-top: 15px;
  font-weight: 700;
}

.form-error.hidden { display: none; }
.form-success.hidden { display: none; }

/* ===== POPUP RÉCAP ===== */
.recap-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.7);
  z-index: 5000;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.recap-overlay.hidden { display: none; }

.recap-modal {
  background: white;
  border-radius: 20px;
  padding: 40px;
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  animation: fadeInUp 0.3s ease-out;
}

.recap-modal h2 {
  font-family: 'Pink Beach', cursive;
  font-size: 36px;
  color: #d4a574;
  text-align: center;
  margin-bottom: 25px;
  font-weight: normal;
}

.recap-line {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 12px 0;
  border-bottom: 1px solid #f0ebe0;
  gap: 20px;
}

.recap-line:last-child { border-bottom: none; }

.recap-label {
  font-weight: 700;
  color: #b8860b;
  font-family: Georgia, serif;
  font-size: 14px;
  min-width: 140px;
}

.recap-value {
  color: #3d2817;
  font-family: Georgia, serif;
  font-size: 14px;
  text-align: right;
}

.recap-buttons {
  display: flex;
  gap: 15px;
  justify-content: center;
  margin-top: 30px;
  flex-wrap: wrap;
}

.form-success {
  color: #4caf50;
  font-family: Georgia, serif;
  font-size: 15px;
  text-align: center;
  margin-top: 20px;
  font-weight: 700;
}

/* Responsive form */
@media (max-width: 768px) {
  .form-knots-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; }
  .form-choice-grid { grid-template-columns: repeat(2, 1fr); }
  .color-selector-row { flex-direction: column; align-items: flex-start; }
  .color-selector-row select { width: 100%; }
  .recap-modal { padding: 25px 20px; }
  .recap-line { flex-direction: column; gap: 4px; }
  .recap-value { text-align: left; }
}

/* ===== GRILLE COULEURS (comme les nœuds) ===== */
.color-slot-title {
  display: flex;
  align-items: center;
  gap: 15px;
  margin: 25px 0 12px 0;
  flex-wrap: wrap;
}

.color-slot-label {
  font-weight: 700;
  color: #b8860b;
  font-family: Georgia, serif;
  font-size: 16px;
  min-width: 90px;
}

.color-selected-indicator {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.color-selected-value {
  font-family: Georgia, serif;
  font-size: 14px;
  color: #aaa;
  font-style: italic;
}

.color-selected-value.selected-ok {
  color: #4caf50;
  font-style: normal;
  font-weight: 700;
}

.form-color-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 15px;
  margin-bottom: 10px;
}

.form-color-card {
  background: white;
  border-radius: 10px;
  overflow: hidden;
  border: 3px solid #f0ebe0;
  cursor: pointer;
  transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.3s ease;
  box-shadow: 0 4px 12px rgba(0,0,0,0.07);
}

.form-color-card:hover {
  border-color: #d4a574;
  transform: scale(1.6);
  box-shadow: 0 15px 40px rgba(212,165,116,0.45);
  z-index: 10;
  position: relative;
}

.form-color-card.selected {
  border-color: #b8860b;
  box-shadow: 0 0 0 3px rgba(184,134,11,0.3);
  transform: scale(1.6);
}

.form-color-card img {
  width: 100%;
  height: 80px;
  object-fit: contain;
  display: block;
  padding: 6px;
}

.form-color-card p {
  padding: 8px;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: #3d2817;
  margin: 0;
  font-family: Georgia, serif;
  line-height: 1.3;
}

.color-slot-separator {
  border: none;
  border-top: 2px dashed #e8dcc8;
  margin: 20px 0;
}

@media (max-width: 768px) {
  .form-color-grid {
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 10px;
  }
}

/* ===== TOOLTIP MOUSEOVER ===== */
.img-tooltip {
  position: fixed;
  z-index: 9999;
  pointer-events: none;
  background: rgba(61,40,23,0.92);
  color: #fff;
  font-family: Georgia, serif;
  font-size: 13px;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: 10px;
  white-space: nowrap;
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
  opacity: 0;
  transition: opacity 0.2s ease;
  transform: translateX(-50%);
}
.img-tooltip::after {
  content: '';
  position: absolute;
  top: 100%; left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: rgba(61,40,23,0.92);
}
.img-tooltip.visible { opacity: 1; }

/* ===== RESPONSIVE FORM MOBILE ===== */
@media (max-width: 480px) {
  .form-knots-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
  .form-color-grid { grid-template-columns: repeat(auto-fill, minmax(95px, 1fr)); gap: 8px; }
  .form-choice-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .form-knot-card img { height: 100px; }
  .form-color-card img { height: 65px; }
  .progress-step { padding: 6px 10px; font-size: 11px; }
  .form-btn-primary, .form-btn-secondary { padding: 12px 25px; font-size: 13px; }
  .recap-modal { padding: 20px 15px; }
}
