/* Formulaire de contact multistep — Terre Marrakech
   Palette reprise des couleurs globales Elementor du site :
   vert profond #0F5B4F / #062823, rouge accent #D62828, or #F4B400,
   crème #F6F1EB, brun #4B413A / #211C18, sable #D9CEC2.
   Contraste : texte blanc uniquement sur fond vert foncé (≈7:1). */

.tm-input, .tm-select, .tm-textarea { min-width: 0; max-width: 100%; }

.tm-contact-section { padding: clamp(24px, 4vw, 44px) 0; }
.tm-contact-section + .tm-contact-section { padding-top: 0; }

.tm-form {
  --tm-green: #0F5B4F;
  --tm-green-dark: #062823;
  --tm-green-pale: #E6F1EE;
  --tm-red: #D62828;
  --tm-red-dark: #C92A2A;
  --tm-gold: #F4B400;
  --tm-cream: #F6F1EB;
  --tm-sand: #D9CEC2;
  --tm-brown: #4B413A;
  --tm-ink: #211C18;
  --tm-muted: #8A7D71;
  box-sizing: border-box;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: clamp(20px, 4vw, 34px);
  background: var(--tm-cream);
  border: 1px solid var(--tm-sand);
  border-radius: 14px;
  color: var(--tm-ink);
  font-family: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
}
.tm-form * { box-sizing: border-box; }
.tm-form__title {
  margin: 0 0 6px;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(24px, 3.4vw, 32px);
  font-weight: 600;
  line-height: 1.15;
  color: var(--tm-ink);
}
.tm-form__intro { margin: 0 0 18px; color: var(--tm-brown); font-size: 15px; }

/* progression */
.tm-progress { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.tm-progress__track { flex: 1; height: 6px; background: var(--tm-sand); border-radius: 3px; overflow: hidden; }
.tm-progress__bar { display: block; height: 100%; width: 33.33%; background: var(--tm-gold); border-radius: 3px; transition: width .25s ease; }
.tm-progress__label { font-size: 13px; color: var(--tm-muted); white-space: nowrap; }
.tm-step-title {
  margin: 4px 0 16px;
  font-family: "Bricolage Grotesque", "DM Sans", sans-serif;
  font-size: 17px;
  font-weight: 600;
  color: var(--tm-green);
}
.tm-step { display: none; border: 0; margin: 0; padding: 0; }
.tm-step.is-active { display: block; }
.tm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.tm-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.tm-field--full { grid-column: 1 / -1; }
.tm-label { font-size: 15px; font-weight: 600; color: var(--tm-brown); }
.tm-req { color: var(--tm-red); }
.tm-opt { font-weight: 400; color: var(--tm-muted); font-size: 13px; }
.tm-input, .tm-select, .tm-textarea {
  width: 100%;
  padding: 12px 14px;
  font-family: inherit;
  font-size: 16px;
  color: var(--tm-ink);
  background: #fff;
  border: 1px solid var(--tm-sand);
  border-radius: 8px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.tm-textarea { min-height: 118px; resize: vertical; }
.tm-input:focus, .tm-select:focus, .tm-textarea:focus {
  outline: none;
  border-color: var(--tm-green);
  box-shadow: 0 0 0 3px rgba(15, 91, 79, .22);
}
.tm-input:user-invalid, .tm-select:user-invalid, .tm-textarea:user-invalid { border-color: var(--tm-red); }
.tm-consent { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; color: var(--tm-brown); }
.tm-consent input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--tm-green); flex: 0 0 auto; }
.tm-honey { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; }

/* navigation */
.tm-nav { display: flex; gap: 12px; align-items: center; margin-top: 22px; }
/* Le kit Elementor du site cible `button` globalement (.elementor-kit-XXXX button),
   spécificité (0,1,1) : toutes nos règles de bouton sont donc préfixées par .tm-form,
   sinon la couleur de marque du site écrase la nôtre (contraste 3:1 au lieu de 7:1). */
.tm-form .tm-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 12px 22px;
  font-family: inherit; font-size: 16px; font-weight: 600;
  border-radius: 8px; border: 1px solid transparent; cursor: pointer;
  text-decoration: none; transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.tm-form .tm-btn--primary { background: var(--tm-green); color: #fff; }
.tm-form .tm-btn--primary:hover, .tm-form .tm-btn--primary:focus-visible { background: var(--tm-green-dark); color: #fff; }
.tm-form .tm-btn--ghost { background: transparent; color: var(--tm-green); border-color: var(--tm-green); }
.tm-form .tm-btn--ghost:hover, .tm-form .tm-btn--ghost:focus-visible { background: var(--tm-green-pale); color: var(--tm-green-dark); }
.tm-form .tm-btn[disabled] { opacity: .6; cursor: progress; }
.tm-form .tm-btn:focus-visible { outline: 3px solid rgba(15, 91, 79, .35); outline-offset: 2px; }
.tm-back { margin-inline-end: auto; }

/* statut */
.tm-status { margin-top: 14px; font-size: 15px; }
.tm-status:empty { display: none; }
.tm-status[data-state="error"] { color: var(--tm-red-dark); font-weight: 600; }
.tm-status[data-state="ok"] { color: var(--tm-green); font-weight: 600; }
.tm-success { padding: 22px; border-inline-start: 4px solid var(--tm-green); background: var(--tm-green-pale); border-radius: 8px; }
.tm-success h3 { margin: 0 0 6px; font-family: "Cormorant Garamond", Georgia, serif; font-size: 24px; color: var(--tm-ink); }
.tm-success p { margin: 0; color: var(--tm-brown); }
.tm-noscript { margin: 0; padding: 14px; background: #fff; border: 1px solid var(--tm-sand); border-radius: 8px; font-size: 15px; }

/* RTL (arabe) */
[dir="rtl"] .tm-form { text-align: right; }
[dir="rtl"] .tm-back { margin-inline-end: auto; margin-inline-start: 0; }

@media (max-width: 640px) {
  .tm-grid { grid-template-columns: 1fr; gap: 12px; }
  .tm-form { padding: 20px 16px; border-radius: 12px; }
  .tm-nav { flex-direction: column-reverse; align-items: stretch; }
  .tm-form .tm-btn { width: 100%; }
  .tm-back { margin-inline-end: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .tm-progress__bar, .tm-btn, .tm-input, .tm-select, .tm-textarea { transition: none; }
}

/* Le kit Elementor du site habille TOUS les champs
   (.elementor-kit-XXXX input:not([type="button"]):not([type="submit"]), textarea),
   spécificité (0,3,1) : cette reprise ciblée (0,4,1) garantit la bordure sable et
   l'absence de fond crème hérité — sinon les champs blancs n'ont plus de contour. */
.tm-contact-section .tm-form .tm-step input.tm-input,
.tm-contact-section .tm-form .tm-step select.tm-select,
.tm-contact-section .tm-form .tm-step textarea.tm-textarea {
  width: 100%;
  padding: 12px 14px;
  font-family: inherit;
  font-size: 16px;
  line-height: 1.45;
  color: var(--tm-ink);
  background: #fff;
  border: 1px solid var(--tm-sand);
  border-radius: 8px;
}
.tm-contact-section .tm-form .tm-step input.tm-input:focus,
.tm-contact-section .tm-form .tm-step select.tm-select:focus,
.tm-contact-section .tm-form .tm-step textarea.tm-textarea:focus {
  outline: none;
  border-color: var(--tm-green);
  box-shadow: 0 0 0 3px rgba(15, 91, 79, .22);
}
.tm-contact-section .tm-form .tm-step input.tm-input:user-invalid,
.tm-contact-section .tm-form .tm-step select.tm-select:user-invalid,
.tm-contact-section .tm-form .tm-step textarea.tm-textarea:user-invalid {
  border-color: var(--tm-red);
}
