/* ═══════════════════════════════════════════════
   FORMULAIRE PREMIER CONTACT — CSS isolé
   Toutes les règles sont scopées sous .form-section
   pour ne pas affecter le reste du site.
═══════════════════════════════════════════════ */

/* ── Variables (locales au formulaire) ── */
.form-section {
  --f-purple: #534ab7;
  --f-purple-lt: #eeedfe;
  --f-purple-dk: #3c3489;
  --f-teal: #0f6e56;
  --f-teal-lt: #e1f5ee;
  --f-coral: #d85a30;
  --f-text: #1a1a2e;
  --f-text-2: #6b6b80;
  --f-text-3: #a0a0b0;
  --f-bg: #f8f7fc;
  --f-surface: #ffffff;
  --f-border: rgba(83, 74, 183, 0.12);
  --f-border-2: rgba(83, 74, 183, 0.25);
  --f-radius: 12px;
  --f-radius-sm: 8px;
  --f-shadow: 0 2px 24px rgba(83, 74, 183, 0.08);

  /* Layout de la section */
  width: 100%;
  padding: 3rem 1rem;
  background: var(--f-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  font-family: "DM Sans", sans-serif;
  color: var(--f-text);
}

/* ── Fond radial (scopé à la section) ── */
.form-section::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(
      circle at 20% 20%,
      rgba(83, 74, 183, 0.06) 0%,
      transparent 50%
    ),
    radial-gradient(
      circle at 80% 80%,
      rgba(15, 110, 86, 0.05) 0%,
      transparent 50%
    );
  pointer-events: none;
  z-index: 0;
}

/* ── Container interne ── */
.form-section .f-container {
  width: 100%;
  max-width: 560px;
  position: relative;
  z-index: 1;
}

/* ── Brand header ── */
.form-section .brand {
  text-align: center;
  margin-bottom: 2rem;
  animation: fadeUp 0.5s ease both;
}
.form-section .brand-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 1.5rem;
}
.form-section .brand-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--f-purple);
}
.form-section .brand-name {
  font-family: "DM Serif Display", serif;
  font-size: 18px;
  letter-spacing: -0.01em;
  color: var(--f-text);
}
.form-section .brand h1 {
  font-family: "DM Serif Display", serif;
  font-size: clamp(26px, 5vw, 34px);
  font-weight: 400;
  line-height: 1.2;
  color: var(--f-text);
  margin-bottom: 10px;
  letter-spacing: -0.02em;
}
.form-section .brand h1 em {
  font-style: italic;
  color: var(--f-purple);
}
.form-section .brand p {
  font-size: 14px;
  color: var(--f-text-2);
  line-height: 1.6;
}

/* ── Card ── */
.form-section .f-card {
  background: var(--f-surface);
  border-radius: var(--f-radius);
  border: 1px solid var(--f-border);
  box-shadow: var(--f-shadow);
  padding: 2rem;
  animation: fadeUp 0.5s 0.1s ease both;
}

/* ── Progress ── */
.form-section .progress-wrap {
  margin-bottom: 1.75rem;
}
.form-section .progress-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--f-text-3);
  margin-bottom: 6px;
}
.form-section .progress-track {
  height: 3px;
  background: var(--f-border);
  border-radius: 2px;
  overflow: hidden;
}
.form-section .progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--f-purple), #7f77dd);
  border-radius: 2px;
  width: 0%;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Champs ── */
.form-section .row2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 440px) {
  .form-section .row2 {
    grid-template-columns: 1fr;
  }
}

.form-section .field {
  margin-bottom: 1.25rem;
}
.form-section .field:last-child {
  margin-bottom: 0;
}

.form-section label.lbl {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--f-text-2);
  margin-bottom: 5px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.form-section label.lbl .req {
  color: var(--f-coral);
  margin-left: 2px;
}

.form-section input[type="text"],
.form-section input[type="email"],
.form-section textarea {
  width: 100%;
  padding: 10px 13px;
  font-size: 14px;
  font-family: "DM Sans", sans-serif;
  border: 1px solid var(--f-border-2);
  border-radius: var(--f-radius-sm);
  background: #fcfbff;
  color: var(--f-text);
  outline: none;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
  box-sizing: border-box;
}
.form-section input[type="text"]:focus,
.form-section input[type="email"]:focus,
.form-section textarea:focus {
  border-color: var(--f-purple);
  box-shadow: 0 0 0 3px rgba(83, 74, 183, 0.1);
}
.form-section input::placeholder,
.form-section textarea::placeholder {
  color: var(--f-text-3);
}
.form-section textarea {
  min-height: 80px;
  resize: vertical;
  line-height: 1.5;
}
.form-section .char-count {
  text-align: right;
  font-size: 11px;
  color: var(--f-text-3);
  margin-top: 4px;
}
.form-section .hint {
  font-size: 11px;
  color: var(--f-text-3);
  margin-top: 4px;
  font-style: italic;
}

/* ── Chips ── */
.form-section .chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}
.form-section .chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 13px;
  border: 1px solid var(--f-border-2);
  border-radius: 20px;
  font-size: 13px;
  font-family: "DM Sans", sans-serif;
  cursor: pointer;
  background: #fcfbff;
  color: var(--f-text-2);
  transition: all 0.18s ease;
  user-select: none;
}
.form-section .chip:hover {
  border-color: var(--f-purple);
  color: var(--f-purple);
  background: var(--f-purple-lt);
}
.form-section .chip.on {
  border-color: var(--f-purple);
  background: var(--f-purple-lt);
  color: var(--f-purple-dk);
  font-weight: 500;
}
.form-section .chip input {
  display: none;
}

/* ── Séparateur ── */
.form-section .sep {
  border: none;
  border-top: 1px solid var(--f-border);
  margin: 1.5rem 0;
}

/* ── CTA ── */
.form-section .cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.form-section .reassure {
  font-size: 12px;
  color: var(--f-text-3);
  line-height: 1.5;
}
.form-section .reassure strong {
  display: block;
  color: var(--f-text-2);
  font-weight: 500;
}
.form-section .btn-submit {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 24px;
  background: var(--f-purple);
  color: #fff;
  border: none;
  border-radius: var(--f-radius-sm);
  font-size: 14px;
  font-weight: 500;
  font-family: "DM Sans", sans-serif;
  cursor: pointer;
  transition:
    background 0.2s,
    transform 0.15s;
  white-space: nowrap;
}
.form-section .btn-submit:hover {
  background: var(--f-purple-dk);
}
.form-section .btn-submit:active {
  transform: scale(0.97);
}
.form-section .btn-submit svg {
  width: 15px;
  height: 15px;
  transition: transform 0.2s;
}
.form-section .btn-submit:hover svg {
  transform: translateX(3px);
}

/* ── Success ── */
.form-section .success {
  display: none;
  text-align: center;
  padding: 2.5rem 1.5rem;
  animation: fadeUp 0.4s ease both;
}
.form-section .success-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--f-teal-lt);
  margin: 0 auto 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.form-section .success-icon svg {
  width: 24px;
  height: 24px;
}
.form-section .success h2 {
  font-family: "DM Serif Display", serif;
  font-size: 24px;
  font-weight: 400;
  margin-bottom: 10px;
  color: var(--f-text);
}
.form-section .success p {
  font-size: 14px;
  color: var(--f-text-2);
  line-height: 1.65;
  max-width: 360px;
  margin: 0 auto;
}

/* ── Footer formulaire ── */
.form-section .f-footer {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 11px;
  color: var(--f-text-3);
  animation: fadeUp 0.5s 0.2s ease both;
}

/* ── Animations ── */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── États d'erreur ── */
.form-section .field.error input,
.form-section .field.error textarea {
  border-color: var(--f-coral);
  box-shadow: 0 0 0 3px rgba(216, 90, 48, 0.1);
}
.form-section .error-msg {
  font-size: 11px;
  color: var(--f-coral);
  margin-top: 4px;
  display: none;
}
.form-section .field.error .error-msg {
  display: block;
}

/* --------------------------------------------------------------------------
   Compléments de la refonte
   -------------------------------------------------------------------------- */

/* Message d'erreur global renvoyé par le serveur */
.form-alert {
  margin: 0 0 16px;
  padding: 11px 14px;
  border-radius: 8px;
  background: #FCEBEB;
  border: 1px solid rgba(163, 45, 45, 0.2);
  color: #A32D2D;
  font-size: 13px;
  line-height: 1.5;
}

/* Référence de suivi affichée après l'envoi */
.success-reference {
  margin-top: 14px;
  font-size: 13px;
  color: #6b6b80;
}

.success-reference strong {
  color: #534AB7;
  letter-spacing: 0.02em;
}

/* Bouton d'envoi pendant le traitement */
.btn-submit:disabled {
  cursor: progress;
}
