
/* ============================================
   CONTACT FORM 
   ============================================ */

/* Overlay backdrop */
.contact-overlay{
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(12px);
  z-index: 900;
  opacity: 0;
  pointer-events: none;
  transition: opacity 400ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* Modal contact */
#contact{
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(0.96);
  
  width: min(920px, calc(100vw - 2rem));
  max-height: calc(100vh - 4rem);
  
  background: linear-gradient(135deg, rgba(255,255,255,0.98), rgba(249,250,251,0.98));
  border-radius: 28px;
  border: 1px solid rgba(226, 232, 240, 0.8);
  box-shadow: 
    0 0 0 1px rgba(255,255,255,0.1),
    0 50px 100px -20px rgba(50, 50, 93, 0.25),
    0 30px 60px -30px rgba(0, 0, 0, 0.3);
  
  padding: 3.5rem 2.5rem 2.5rem;
  overflow: auto;
  
  z-index: 950;
  opacity: 0;
  pointer-events: none;
  
  transition: all 500ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* Header avec titre et bouton fermer */
.contact-header{
  position: relative;
  margin-bottom: 1rem;
  text-align: center;
}

/* Bouton fermer */
.contact-close{
  position: absolute;
  top: -0.5rem;
  right: -1rem;
  
  width: 46px;
  height: 46px;
  border-radius: 50%;
  
  display: flex;
  align-items: center;
  justify-content: center;
  
  background: linear-gradient(135deg, #fff, #f8fafc);
  border: 2px solid rgba(226, 232, 240, 0.8);
  color: #64748b;
  
  cursor: pointer;
  transition: all 200ms ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  
  z-index: 10;
}

.contact-close:hover{
  background: linear-gradient(135deg, #fee2e2, #fecaca);
  color: #dc2626;
  border-color: #fca5a5;
  transform: rotate(90deg) scale(1.08);
  box-shadow: 0 8px 20px rgba(220, 38, 38, 0.15);
}

.contact-close svg{
  width: 20px;
  height: 20px;
}

/* États actifs */
body.contact-focus{
  overflow: hidden;
  overscroll-behavior: none;
}

body.contact-focus .contact-overlay{
  opacity: 1;
  pointer-events: auto;
}

body.contact-focus #contact{
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

body.contact-focus main{
  transform: scale(0.98);
  filter: blur(3px);
  opacity: 0.5;
  transition: all 400ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* Layout contact (centré, 1 colonne) */
.contact{
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
  padding-top: 1rem;
  max-width: 600px;
  margin: 0 auto;
  text-align: center;
}

.contact-copy{
  width: 100%;
}

.contact-copy h2{
  margin: 0;
  font-size: 2rem;
  background: linear-gradient(135deg, #2563EB, #5B21B6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.contact-copy p{
  margin-bottom: 0.2rem;
  line-height: 1.6;
  color: #334155;
}

.contact-links{
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}

.contact-links .link{
  color: #2563EB;
  text-decoration: none;
  font-weight: 600;
  transition: color 200ms;
}

.contact-links .link:hover{
  color: #1d4ed8;
  text-decoration: underline;
}

.contact-links .dot{
  color: #94a3b8;
}

.muted{
  font-size: 0.9rem;
  color: #64748b;
  font-style: italic;
}

/* Formulaire */
.contact-form{
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
}

.contact-form label{
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  text-align: left;
}

.contact-form label span{
  font-weight: 600;
  font-size: 0.95rem;
  color: #1e293b;
}

.contact-form input,
.contact-form textarea{
  padding: 0.85rem 1rem;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  font: inherit;
  background: #fff;
  transition: all 200ms ease;
}

.contact-form input:focus,
.contact-form textarea:focus{
  outline: none;
  border-color: #2563EB;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.08);
  transform: translateY(-1px);
}

.contact-form textarea{
  resize: vertical;
  min-height: 130px;
}

.btn{
  padding: 1rem 2rem;
  border: none;
  border-radius: 10px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: all 250ms cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-primary{
  background: linear-gradient(135deg, #2563EB, #5B21B6);
  color: white;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3);
}

.btn-primary:hover{
  background: linear-gradient(135deg, #1d4ed8, #4c1d95);
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.5);
}

.btn-primary:active{
  transform: translateY(0) scale(1);
}

.form-note{
  font-size: 0.9rem;
  padding: 0.5rem;
  border-radius: 6px;
  min-height: 1.5rem;
}

/* Mobile responsive */
@media (max-width: 768px){
  #contact{
    width: calc(100vw - 1rem);
    max-height: calc(100vh - 1rem);
    padding: 3rem 1.2rem 1.2rem;
    border-radius: 20px;
    top: 50%;
    left: 50%;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .contact{
    gap: 0.8rem;
    padding-top: 0;
    max-width: 100%;
  }

  .contact-header{
    margin-bottom: 0.5rem;
  }

  .contact-close{
    top: 0.5rem !important;
    right: -0.8rem !important;
    width: 30px !important;
    height: 30px !important;
    min-width: 30px !important;
    min-height: 30px !important;
    background: rgba(255, 255, 255, 0.95) !important;
    border: 1.5px solid rgba(226, 232, 240, 0.9) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
    padding: 0 !important;
  }

  .contact-close svg{
    width: 14px !important;
    height: 14px !important;
  }

  .contact-copy h2{
    font-size: 1.3rem;
  }

  /* Formulaire optimisé pour mobile */
  .contact-form{
    gap: 0.7rem;
  }

  /* Grouper Nom et Email sur 2 colonnes si écran >= 400px */
  @media (min-width: 400px){
    .contact-form{
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 0.7rem;
    }

    .contact-form label:nth-child(1),
    .contact-form label:nth-child(2){
      grid-column: span 1;
    }

    .contact-form label:nth-child(3),
    .contact-form button,
    .contact-form .form-note{
      grid-column: span 2;
    }
  }

  .contact-form label{
    gap: 0.25rem;
  }

  .contact-form label span{
    font-size: 0.85rem;
  }

  .contact-form input,
  .contact-form textarea{
    padding: 0.65rem 0.8rem;
    font-size: 16px; /* Évite le zoom automatique sur iOS */
    border-radius: 8px;
  }

  .contact-form textarea{
    min-height: 80px;
    resize: none;
  }

  .btn{
    padding: 0.75rem 1.2rem;
    font-size: 0.9rem;
  }

  /* Fixes pour le fond qui bug */
  body.contact-focus{
    position: fixed;
    width: 100%;
    overflow: hidden;
  }

  body.contact-focus .contact-overlay{
    position: fixed;
    overflow: hidden;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce){
  *{
    transition: none !important;
    animation: none !important;
  }
}
