/* ════════════════════════════════════════════════
   MODAL CONTACT — Styles réutilisables
════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: color-mix(in srgb, var(--ink) 60%, transparent);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.modal-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  width: min(calc(var(--max) - 96px), calc(100% - 96px));
  max-width: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 30px;
  padding: 48px;
  padding-top: 64px;
  position: relative;
  box-shadow: 0 20px 60px color-mix(in srgb, var(--ink) 15%, transparent);
  opacity: 0;
  transform: translateY(16px) scale(0.98);
  transition:
    opacity 0.28s ease,
    transform 0.4s cubic-bezier(0.22, 1, 0.36, 1),
    width 0.3s ease,
    height 0.3s ease;
  overflow-y: auto;
}

.modal-overlay.is-open .modal-panel {
  opacity: 1;
  transform: none;
}

/* Contenu de la modale : apparaît juste après le panneau */
.modal-infos,
.modal-form-wrapper {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.25s ease, transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.modal-overlay.is-open .modal-infos,
.modal-overlay.is-open .modal-form-wrapper {
  opacity: 1;
  transform: none;
}

.modal-overlay.is-open .modal-form-wrapper {
  transition-delay: 0.06s;
}

.modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--surface) 94%, var(--ink)) 0%,
    var(--surface) 50%,
    color-mix(in srgb, var(--surface) 95%, var(--ink)) 100%);
  box-shadow: inset 1px 1px 0 var(--surface),
    0 2px 8px -4px color-mix(in srgb, var(--ink) 25%, transparent);
  color: var(--ink);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: filter 0.2s;
  z-index: 10;
}

.modal-close svg {
  width: 18px;
  height: 18px;
}

.modal-close:hover {
  filter: brightness(1.04);
}

.modal-close:focus {
  outline: none;
}

button:focus {
  outline: none;
}

.modal-infos {
  padding-top: 0px;
}

.modal-infos h3,
.modal-form-wrapper h3 {
  font-size: 32px;
  color: var(--black);
  margin-bottom: 16px;
  margin-top: 0;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.modal-infos > p {
  font-size: 18px;
  line-height: 1.55;
  color: var(--grey-text);
  margin-bottom: 32px;
  margin-top: 0;
}

.contact-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 32px;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 18px;
  color: var(--grey-text);
  background: var(--grey);
  padding: 14px 18px;
  border-radius: 16px;
}

.contact-item svg {
  flex-shrink: 0;
  color: var(--blue);
}

.contact-item a {
  color: var(--grey-text);
  text-decoration: none;
  transition: color 0.2s;
}

.contact-item a:hover {
  color: var(--blue);
}

.modal-form-wrapper {
  display: flex;
  flex-direction: column;
  background: var(--bg);
  padding: 32px;
  border-radius: 24px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.form-group label {
  font-size: 16px;
  font-weight: 600;
  color: var(--black);
}

.form-group label span {
  color: var(--blue);
}

.form-group input,
.form-group textarea {
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--black);
  transition: border-color 0.2s;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--grey-mid);
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-light);
}

.form-group textarea {
  resize: vertical;
  min-height: 120px;
}

button,
input[type="submit"] {
  border: none;
}

.form-error {
  padding: 12px 16px;
  border-radius: 16px;
  background: color-mix(in srgb, var(--error) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--error) 30%, transparent);
  color: var(--error);
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 16px;
  display: none;
}

/* ════════════════════════════════════════════════
   SUCCESS MODAL & ANIMATION
════════════════════════════════════════════════ */
.modal-success {
  width: 500px !important;
  height: 350px !important;
  grid-template-columns: 1fr !important;
  gap: 0 !important;
  padding: 48px 48px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.success-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.lottie-animation-sent {
  width: 150px;
  height: 150px;
}

.success-message {
  font-size: 16px;
  color: var(--grey-text);
  text-align: center;
  margin: 0;
  line-height: 1.6;
  max-width: 400px;
  font-weight: 600;
}

.modal-form-wrapper .btn-primary {
  width: 100%;
  margin-top: 12px;
    outline: none;
}

@media (max-width: 1024px) {
  .modal-overlay {
    align-items: flex-end;
  }

  .modal-panel {
    grid-template-columns: 1fr;
    gap: 0;
    padding: 36px 28px;
    width: 100%;
    max-width: none;
    border-radius: 30px 30px 0 0;
    transform: translateY(100%);
    transition: opacity 0.28s ease, transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
    height: auto;
    max-height: 85vh;
    overflow-y: auto;
  }

  .modal-infos {
    display: block;
    grid-column: 1 / -1;
    padding: 0;
    margin: 0;
    height: auto;
  }

  .modal-infos h3 {
    margin-bottom: 0;
  }

  .modal-form-wrapper {
    padding: 0;
    background: transparent;
  }

  .modal-infos .contact-list {
    display: flex;
  }

  .modal-infos .btn-download-cv {
    display: none;
  }

  .modal-overlay.is-open .modal-panel {
    transform: translateY(0);
  }

  .modal-close {
    top: 16px;
    right: 16px;
  }

  .modal-success {
    width: 100% !important;
    height: auto !important;
    border-radius: 30px 30px 0 0 !important;
  }
}

/* Mobile : coordonnées sans encadré, espacements resserrés, tout le contenu visible sans scroll */
@media (max-width: 1024px) {
  .modal-panel {
    padding: 20px 20px 20px;
    max-height: 100vh;
    max-height: 100dvh;
  }

  .modal-close {
    top: 20px;
    right: 20px;
  }

  /* Le titre partage la ligne de la croix (même hauteur, texte centré) */
  .modal-infos h3 {
    line-height: 44px;
    margin: 0 0 16px;
    padding-right: 56px; /* le titre ne passe pas sous la croix */
  }

  .modal-infos .contact-list {
    gap: 0;
    margin-bottom: 20px;
  }

  /* Séparateurs entre les coordonnées (pas de trait après la dernière) */
  .modal-infos .contact-item {
    background: none;
    padding: 10px 0;
    border-radius: 0;
    border-bottom: 1px solid var(--border);
    font-size: 16px;
  }

  .modal-infos .contact-item:last-child {
    border-bottom: 0;
  }

  .modal-form-wrapper .form-group {
    margin-bottom: 10px;
  }

  .modal-form-wrapper .form-group textarea {
    min-height: 88px;
  }

  .modal-form-wrapper .btn-primary {
    margin-top: 8px;
  }
}

/* ════════════════════════════════════════════════
   FORMULAIRE DE CONTACT — champs plus lisibles, mention d'utilisation des données
════════════════════════════════════════════════ */
.form-group {
  gap: 8px;
  margin-bottom: 16px;
}

.form-group label {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.form-group input,
.form-group textarea {
  min-height: 52px;
  padding: 14px 16px;
  border: 1px solid color-mix(in srgb, var(--ink) 14%, transparent);
  border-radius: 14px;
  line-height: 1.5;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:hover,
.form-group textarea:hover {
  border-color: color-mix(in srgb, var(--ink) 28%, transparent);
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--blue) 14%, transparent);
}

.form-group textarea {
  min-height: 140px;
}

/* Mobile : texte d'introduction visible, formulaire avant les coordonnées */
@media (max-width: 1024px) {
  .modal-panel {
    display: flex;
    flex-direction: column;
  }

  .modal-infos {
    display: contents;
  }

  .modal-infos h3 {
    order: 1;
  }

  .modal-infos > p {
    order: 2;
    margin-bottom: 24px;
  }

  .modal-form-wrapper {
    order: 3;
  }

  .modal-infos .contact-list {
    order: 4;
    margin-top: 24px;
    margin-bottom: 0;
  }
}

/* ════════════════════════════════════════════════
   POPIN DE CONTACT EN PLEIN ÉCRAN (mobile) — croix en haut, défilement de la page entière
════════════════════════════════════════════════ */
@media (max-width: 1024px) {
  #contactModal .modal-panel {
    width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    border: 0;
    border-radius: 0;
    padding: 20px 20px 32px;
    transform: translateY(16px);
  }

  #contactModal.is-open .modal-panel {
    transform: none;
  }

  #contactModal .modal-infos h3 {
    padding-right: 56px;
    font-weight: 500;
  }
}

/* Case de consentement (reCAPTCHA v3) */
.form-consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0 0 12px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--grey-text);
  cursor: pointer;
}

.form-consent input {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  accent-color: var(--accent);
}

.form-consent a {
  color: var(--accent);
}
