/* ==========================================================================
   Page Contact BAM — /nous-contacter
   Portée : body#contact uniquement. Chargée par templates/contact.tpl.
   Jetons : DESIGN.md (violet BAM, papier, échelle 11/12/13/14/16/18/22).
   ========================================================================== */

#contact {
  --ct-purple: #6b3d8f;
  --ct-purple-dark: #4a2a66;
  --ct-purple-soft: #f3eef7;
  --ct-paper: #fcfafd;
  --ct-border: #e8e0ef;
  --ct-border-soft: #e2d6ec;
  --ct-border-ghost: #9a79bd;
  --ct-text: #1f2937;
  --ct-text-2: #4b5563;
  --ct-muted: #6b7280;
  --ct-ring: 0 0 0 3px rgb(107 61 143 / 0.22);
  --ct-ease: cubic-bezier(0.16, 1, 0.3, 1);
}

#contact ::selection { background: var(--ct-purple-soft); color: var(--ct-purple-dark); }

/* --- En-tête ----------------------------------------------------------- */

#contact .ct-header { margin: 0 0 2.5rem; }

#contact .ct-header .page-title {
  color: var(--ct-purple-dark);
  font-size: clamp(1.75rem, 4vw, 2.35rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 0 0.75rem;
}

#contact .ct-lead {
  max-width: 60ch;
  margin: 0;
  color: var(--ct-text-2);
  font-size: 1.125rem;
  line-height: 1.6;
  text-wrap: pretty;
}

/* --- Grille ------------------------------------------------------------ */

#contact .ct-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 2.5rem;
  align-items: start;
}

#contact .ct-visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* --- Boutons ----------------------------------------------------------- */

#contact .ct-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 48px;
  padding: 0 1.5rem;
  border: 0;
  border-radius: 8px;
  background: var(--ct-purple);
  color: var(--ct-paper);
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s var(--ct-ease), transform 0.2s var(--ct-ease);
}
/* custom_s_1.css colore tous les a:link : on reprend la main. */
#contact a.ct-btn:link,
#contact a.ct-btn:visited,
#contact a.ct-btn:hover { color: var(--ct-paper); text-decoration: none; }
#contact .ct-btn:hover { background: var(--ct-purple-dark); }
#contact .ct-btn:active { transform: translateY(1px); }
#contact .ct-btn:focus-visible { outline: none; box-shadow: var(--ct-ring); }

/* --- Colonne « Nous joindre » ----------------------------------------- */

#contact .ct-wa {
  background: var(--ct-purple-soft);
  border-radius: 16px;
  padding: 1.5rem;
}

#contact .ct-wa__title {
  margin: 0;
  color: var(--ct-purple-dark);
  font-size: 1.375rem;
  font-weight: 800;
  line-height: 1.25;
}

#contact .ct-wa__sub {
  margin: 0.25rem 0 1.25rem;
  color: var(--ct-text-2);
  font-size: 0.875rem;
  line-height: 1.5;
}

#contact .ct-btn--wa { width: 100%; }
#contact .ct-btn--wa .fa { font-size: 1.375rem; }
#contact .ct-wa__num {
  margin-inline-start: auto;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  opacity: 0.9;
}

#contact .ct-lines { margin: 1.5rem 0 0; }

#contact .ct-line {
  display: grid;
  grid-template-columns: 7.5rem minmax(0, 1fr);
  gap: 0.5rem 1rem;
  align-items: baseline;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--ct-border);
}
#contact .ct-line:first-child { border-top: 1px solid var(--ct-border); }

#contact .ct-line dt {
  margin: 0;
  color: var(--ct-text-2);
  font-size: 0.875rem;
  font-weight: 700;
  white-space: nowrap;
}
#contact .ct-line dt .fa {
  width: 1rem;
  margin-inline-end: 0.375rem;
  color: var(--ct-purple);
  font-size: 1rem;
  text-align: center;
}

#contact .ct-line dd {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.25rem;
  margin: 0;
}
#contact .ct-line dd a:link,
#contact .ct-line dd a:visited {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--ct-purple-dark);
  font-size: 1rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-decoration: none;
  overflow-wrap: anywhere;
}
#contact .ct-line dd a:hover {
  color: var(--ct-purple);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}
#contact .ct-line dd a:focus-visible {
  outline: 2px solid var(--ct-purple);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Horaires : texte libre de la configuration du module. */
#contact .ct-hours {
  margin-top: 1rem;
  color: var(--ct-text-2);
  font-size: 0.875rem;
  line-height: 1.6;
}
#contact .ct-hours p { margin: 0; }

/* Isolement LTR des numéros et de l'e-mail en arabe. */
html[dir="rtl"] #contact .ct-ltr { direction: ltr; justify-content: flex-end; }

/* --- Formulaire -------------------------------------------------------- */

#contact .ct-form {
  scroll-margin-top: 6rem; /* sous l'en-tête collant */
  background: var(--ct-paper);
  border: 1px solid var(--ct-border);
  border-radius: 16px;
  padding: 2rem;
}

#contact .ct-form__title {
  margin: 0;
  color: var(--ct-purple-dark);
  font-size: 1.375rem;
  font-weight: 800;
  line-height: 1.25;
}

#contact .ct-form__sub {
  margin: 0.25rem 0 1.5rem;
  color: var(--ct-muted);
  font-size: 0.875rem;
}

#contact .ct-field { margin-bottom: 1.25rem; }

#contact .ct-field > label {
  display: block;
  margin: 0 0 0.375rem;
  color: var(--ct-text);
  font-size: 0.875rem;
  font-weight: 700;
  text-align: start;
}

#contact .ct-optional {
  color: var(--ct-muted);
  font-weight: 400;
}

#contact .ct-form .form-control {
  min-height: 48px;
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--ct-border-ghost);
  border-radius: 8px;
  background-color: #fff;
  color: var(--ct-text);
  font-size: 1rem; /* 16 px : pas de zoom auto sur iOS */
  line-height: 1.5;
  box-shadow: none;
  transition: border-color 0.15s var(--ct-ease), box-shadow 0.15s var(--ct-ease);
}
#contact .ct-form .form-control::placeholder { color: var(--ct-muted); opacity: 1; }
#contact .ct-form .form-control:hover { border-color: var(--ct-purple); }
#contact .ct-form .form-control:focus {
  border-color: var(--ct-purple);
  box-shadow: var(--ct-ring);
  outline: none;
}
#contact .ct-form textarea.form-control {
  min-height: 9.5rem;
  resize: vertical;
}
html[dir="rtl"] #contact .ct-form input[type="email"] { text-align: right; }

/* Pièce jointe : bouton natif habillé, sans bootstrap-filestyle. */
#contact .ct-file {
  display: block;
  width: 100%;
  color: var(--ct-text-2);
  font-size: 0.875rem;
}
#contact .ct-file::file-selector-button {
  min-height: 44px;
  margin-inline-end: 0.875rem;
  padding: 0 1rem;
  border: 1px solid var(--ct-border-ghost);
  border-radius: 8px;
  background: transparent;
  color: var(--ct-purple);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.15s var(--ct-ease), background-color 0.15s var(--ct-ease);
}
#contact .ct-file::file-selector-button:hover {
  border-color: var(--ct-purple);
  background: var(--ct-purple-soft);
}
#contact .ct-file:focus-visible { outline: none; }
#contact .ct-file:focus-visible::file-selector-button { box-shadow: var(--ct-ring); }

#contact .ct-form__footer {
  display: flex;
  justify-content: flex-start;
  margin-top: 1.75rem;
}

/* Piège anti-robot (champ "url") : invisible, hors tabulation. */
#contact .ct-hp { display: none !important; }

/* Messages après envoi. Succès : violet du système. Erreur : seul rouge
   de la page, réservé à ce cas. */
#contact .ct-notice {
  margin: 0 0 1.5rem;
  padding: 0.875rem 1rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1.5;
}
#contact .ct-notice ul { margin: 0; padding: 0; list-style: none; }
#contact .ct-notice--ok { background: var(--ct-purple-soft); color: var(--ct-purple-dark); }
#contact .ct-notice--error { background: #fbeeee; color: #9b2226; }

/* --- Carte -------------------------------------------------------------- */

#contact .ct-map { margin: 4rem 0 2.5rem; }

#contact .ct-map__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem 2rem;
  margin-bottom: 1rem;
}

#contact .ct-map__title {
  margin: 0;
  color: var(--ct-purple-dark);
  font-size: 1.375rem;
  font-weight: 800;
  line-height: 1.25;
}

#contact .ct-map__text {
  margin: 0;
  color: var(--ct-text-2);
  font-size: 0.875rem;
  line-height: 1.6;
}
#contact .ct-map__text a:link,
#contact .ct-map__text a:visited {
  color: var(--ct-purple);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}
#contact .ct-map__text a:hover { color: var(--ct-purple-dark); }

#contact .ct-map__frame {
  overflow: hidden;
  aspect-ratio: 16 / 6;
  border: 1px solid var(--ct-border);
  border-radius: 16px;
  background: var(--ct-purple-soft);
}
#contact #iqitcontactpage-map iframe {
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  border: 0;
}

/* --- Mobile et tablette -------------------------------------------------- */

@media (max-width: 991.98px) {
  #contact .ct-grid { grid-template-columns: minmax(0, 1fr); gap: 2rem; }
  #contact .ct-header { margin-bottom: 1.75rem; }
}

@media (max-width: 575.98px) {
  #contact .ct-lead { font-size: 1rem; }
  #contact .ct-form { padding: 1.5rem 1.25rem; }
  #contact .ct-wa { padding: 1.25rem; }
  #contact .ct-line { grid-template-columns: minmax(0, 1fr); gap: 0; padding: 0.75rem 0 0.25rem; }
  #contact .ct-btn--submit { width: 100%; }
  #contact .ct-map { margin-top: 3rem; }
  #contact .ct-map__frame { aspect-ratio: 4 / 3; }
}

@media (prefers-reduced-motion: reduce) {
  #contact .ct-btn,
  #contact .ct-form .form-control,
  #contact .ct-file::file-selector-button { transition: none; }
}
