/* ===================================
   FORMULAIRE PREMIUM - LEAD FORM
   Section de prise de rendez-vous
   =================================== */

/* ========== SECTION WRAPPER ========== */
.lead-form-wrap {
  background: #F9F4ED;
  padding: 48px 8% 48px !important;
  width: 100%;
}

/* ========== LAYOUT PRINCIPAL ========== */
.lead-form {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 50px;
  align-items: start;
}

/* ========== COLONNE GAUCHE : PHOTO + AVIS ========== */
.lead-left {
  position: relative;
  padding-right: 40px;
}

/* Ligne de séparation verticale plus visible */
.lead-left::after {
  content: '';
  position: absolute;
  right: 0;
  top: 10%;
  height: 80%;
  width: 1px;
  background: rgba(184, 144, 81, 0.2);
}

/* Texte descriptif au-dessus de l'image */
.lead-image-caption {
  text-align: center;
  color: #6b7280;
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 20px;
  font-weight: 400;
  letter-spacing: 0.2px;
}

.lead-photo {
  width: 100%;
  height: min(64vh, 720px);
  object-fit: cover;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* Carte d'avis superposée avec effet de verre */
.review-card {
  position: absolute;
  left: 40px;
  bottom: 40px;
  width: min(520px, 85%);
  background: rgba(255, 255, 255, 0.92);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15), 0 2px 8px rgba(0, 0, 0, 0.08);
  padding: 26px 24px 24px;
  color: #1f2937;
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.5);
  animation: slideUpCard 0.8s ease-out 0.3s both;
}

@keyframes slideUpCard {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.review-header {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 10px;
}

.avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #e8eefc 0%, #d1dff7 100%);
  color: #1f3a6e;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 1rem;
  flex-shrink: 0;
}

.name {
  font-weight: 700;
  font-size: 1rem;
  color: #111827;
}

.stars {
  color: #f59e0b;
  font-size: 14px;
  margin-top: 2px;
}

.source {
  font-size: 12px;
  color: #6b7280;
  margin-top: 2px;
}

.review-text {
  margin: 12px 0 0;
  font-size: 1.05rem;
  color: #1f2937;
  line-height: 1.75;
  font-style: italic;
  font-weight: 400;
}

/* ========== COLONNE DROITE : FORMULAIRE ========== */
.lead-right {
  padding: 40px;
  background: #FFFFFF;
  border-radius: 20px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.lead-title {
  font-size: 2.5rem;
  line-height: 1.2;
  margin: 0 0 10px;
  font-weight: 800;
  color: #2b1e13;
  font-family: 'Playfair Display', serif;
}

.lead-title span {
  color: #B89051;
  display: block;
}

.lead-sub {
  color: #4b5563;
  margin: 8px 0 28px;
  max-width: 52ch;
  line-height: 1.6;
}

/* ========== CHAMPS DU FORMULAIRE ========== */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 24px;
  position: relative;
}

.field label {
  font-size: 0.93rem;
  color: #374151;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

.field label::after {
  content: '*';
  color: #1a1a1a;
  font-weight: 700;
}

.field input,
.field textarea {
  appearance: none;
  width: 100%;
  border: 1.5px solid #e5e7eb;
  background: transparent;
  border-radius: 14px;
  padding: 15px 16px;
  font-size: 1rem;
  color: #111827;
  outline: none;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
  font-family: inherit;
}

/* Icônes dans les champs */
.field[data-icon]::before {
  content: attr(data-icon);
  position: absolute;
  left: 16px;
  top: 43px;
  font-size: 1.2rem;
  color: #9ca3af;
  pointer-events: none;
  transition: color 0.25s ease;
}

.field:has(input:focus)::before {
  color: #B89051;
}

.field input:focus,
.field textarea:focus {
  border-color: #B89051;
  box-shadow: 0 0 0 4px rgba(184, 144, 81, 0.15);
  background: transparent;
}

.field input::placeholder,
.field textarea::placeholder {
  color: #9ca3af;
}

.field textarea {
  resize: vertical;
  min-height: 100px;
}

/* Messages d'erreur */
.err {
  color: #dc2626;
  font-size: 0.85rem;
  min-height: 1em;
  font-weight: 500;
  margin-top: -2px;
}

/* Error state for fields */
.field.error input,
.field.error textarea {
  border-color: #dc2626 !important;
  background: transparent !important;
}

.field.error input:focus,
.field.error textarea:focus {
  box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.15) !important;
}

/* ========== BOUTON SUBMIT ========== */
.lead-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 20px 40px;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, #B89051 0%, #A67E44 100%);
  color: #FFFFFF;
  font-weight: 700;
  font-size: 1.125rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  box-shadow:
    0 8px 30px rgba(184, 144, 81, 0.45),
    0 4px 15px rgba(184, 144, 81, 0.35);
  width: 100%;
  letter-spacing: 0.02em;
}

.lead-btn::before {
  content: '✓';
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  font-size: 13px;
  font-weight: 700;
}

.lead-btn:hover {
  background: linear-gradient(135deg, #A67E44 0%, #9a7644 100%);
  transform: translateY(-2px);
  box-shadow:
    0 12px 40px rgba(184, 144, 81, 0.55),
    0 6px 20px rgba(184, 144, 81, 0.4);
}

.lead-btn:active {
  transform: translateY(0);
  box-shadow:
    0 6px 25px rgba(184, 144, 81, 0.45),
    0 3px 12px rgba(184, 144, 81, 0.35);
}

.lead-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Variante bouton ghost */
.lead-btn--ghost {
  background: #FFFFFF;
  color: #374151;
  border: 2px solid #e5e7eb;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.lead-btn--ghost:hover {
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
  border-color: #B68B3C;
}

/* Note de confidentialité */
.privacy-note {
  margin: 14px 0 0;
  color: #6b7280;
  font-size: 0.9rem;
  text-align: center;
}

/* ========== MODAL DE CONFIRMATION ========== */
.lead-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.lead-modal[aria-hidden="false"] {
  display: flex;
}

.lead-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17, 24, 39, 0.6);
  backdrop-filter: blur(8px);
}

.lead-modal__dialog {
  position: relative;
  width: min(560px, 92vw);
  background: #FFFFFF;
  border-radius: 22px;
  padding: 36px 28px;
  text-align: center;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.3);
  animation: modalPop 0.4s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

@keyframes modalPop {
  from {
    transform: translateY(20px) scale(0.95);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

.lead-modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1.5px solid #e5e7eb;
  background: #FFFFFF;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
  color: #6b7280;
  transition: all 0.2s ease;
}

.lead-modal__close:hover {
  background: #f3f4f6;
  color: #111827;
  transform: rotate(90deg);
}

/* Icône de succès animée */
.success-svg {
  width: 90px;
  height: 90px;
  margin: 0 auto 20px;
}

.success-ring {
  stroke: #B68B3C;
  stroke-width: 4;
  opacity: 0;
  transform-origin: 50% 50%;
  animation: ringIn 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) 0.1s forwards;
  filter: drop-shadow(0 6px 16px rgba(182, 139, 60, 0.4));
}

.success-check {
  stroke: #2b1e13;
  stroke-width: 5;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 52;
  stroke-dashoffset: 52;
  animation: checkDraw 0.6s ease 0.35s forwards;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.15));
}

@keyframes ringIn {
  from {
    opacity: 0;
    transform: scale(0.8) rotate(-12deg);
  }
  to {
    opacity: 1;
    transform: scale(1) rotate(0);
  }
}

@keyframes checkDraw {
  to {
    stroke-dashoffset: 0;
  }
}

/* ========== RESPONSIVE ========== */
@media (max-width: 1024px) {
  .lead-form-wrap {
    padding: 40px 6% 40px !important;
  }

  .lead-form {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .lead-left {
    padding-right: 0;
    padding-bottom: 40px;
  }

  .lead-left::after {
    display: none;
  }

  .lead-right {
    padding: 30px;
  }

  .review-card {
    /* Keep overlaid on mobile like desktop */
    left: 20px;
    bottom: 20px;
    width: min(480px, calc(100% - 40px));
    padding: 22px 20px;
  }

  .lead-photo {
    height: 50vh;
    object-fit: cover;
    border-radius: 12px;
  }

  .lead-image-caption {
    font-size: 0.9rem;
    margin-bottom: 16px;
  }
}

@media (max-width: 768px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }

  .lead-form-wrap {
    padding: 32px 5% 32px !important;
  }

  .lead-title {
    font-size: 2.5rem;
  }

  .field input,
  .field textarea {
    padding: 16px;
    min-height: 48px;
    font-size: 16px;
  }

  .field input::-webkit-outer-spin-button,
  .field input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
  }

  .field input[type=number] {
    -moz-appearance: textfield;
    appearance: textfield;
  }

  .lead-btn {
    padding: 20px 40px !important;
    font-size: 1.125rem !important;
    min-height: 58px !important;
    width: 100% !important;
  }

  .lead-btn::before {
    display: none !important;
  }

  .review-card {
    left: 12px;
    bottom: 12px;
    width: calc(100% - 24px);
    padding: 12px 14px;
  }

  .review-header {
    gap: 10px;
    margin-bottom: 8px;
  }

  .avatar {
    width: 40px;
    height: 40px;
    font-size: 0.875rem;
  }

  .name {
    font-size: 0.85rem;
  }

  .stars {
    font-size: 12px;
  }

  .source {
    font-size: 11px;
  }

  .review-text {
    font-size: 0.8rem;
    line-height: 1.5;
    margin: 6px 0 0;
  }

  .lead-photo {
    height: 42vh;
    min-height: 300px;
  }

  .lead-image-caption {
    font-size: 0.88rem;
  }
}
