/* ====== RESET + BASE ====== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
}

/* Sur mobile, 100vh peut bug (barre d’adresse). On préfère min-height + dvh */
.travel-form {
  min-height: 100dvh;
  display: flex;
}

/* ====== CONTAINER RESPONSIVE ====== */
.contact-us {
  background: #f8f4e5;
  color: #d28864;

  /* responsive padding */
  padding: clamp(24px, 5vw, 50px) clamp(16px, 8vw, 100px);

  /* largeur lisible sur desktop */
  width: 100%;
  max-width: 900px;

  /* centre la carte */
  margin: auto;

  /* optionnel mais agréable */
  border-radius: 12px;
}

/* ====== TITRES ====== */
h1 {
  text-align: center;
  margin: 0 0 clamp(24px, 5vw, 60px) 0;
  padding: 0;
  font-family: "Montserrat", sans-serif;
  font-size: clamp(22px, 3.2vw, 36px);
  line-height: 1.2;
}

/* ====== FORM ELEMENTS ====== */
label,
input,
textarea,
select {
  display: block;
  width: 100%;
  font-size: clamp(14px, 1.8vw, 16px);
  line-height: 1.5;
  font-family: "Inter", "Montserrat", system-ui, sans-serif;
  font-weight: 700;
}

label {
  margin-bottom: 8px;
}

input,
textarea,
select {
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 8px;
  background: #f8f4e5;
  padding: 12px 12px;
  outline: none;
}

input {
  margin-bottom: 18px;
}

textarea {
  resize: vertical; /* mieux sur mobile */
  min-height: 120px;
}

input:focus,
textarea:focus,
select:focus {
  border: 1px solid #6bd4b1;
}

/* ====== BOUTON RESPONSIVE ====== */
button {
  display: inline-flex;
  justify-content: center;
  align-items: center;

  float: none; /* important pour mobile */
  width: 100%;
  margin-top: 16px;

  min-height: 48px;
  padding: 0 20px;

  border: none;
  border-radius: 10px;

  background-color: #d28864;
  color: white;
  letter-spacing: 2px;
  font-weight: 700;

  transition: 0.2s all ease-in-out;
  border-bottom: 2px solid transparent;
  outline: none;

  cursor: pointer;
}

button:hover {
  background: inherit;
  color: #f45702;
  border-bottom: 2px solid #f45702;
}

input[type="date"] {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  display: block;
  -webkit-appearance: none;
}

/* ====== AUTOFILL ====== */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
textarea:-webkit-autofill,
textarea:-webkit-autofill:hover,
textarea:-webkit-autofill:focus {
  border: 1px solid #6bd4b1;
  -webkit-text-fill-color: #2a293e;
  -webkit-box-shadow: 0 0 0px 1000px #f8f4e5 inset;
  transition: background-color 5000s ease-in-out 0s;
}

::selection {
  background: #ffc7b8;
}

/* ====== TABLET/DESKTOP : layout plus aéré ====== */
@media (min-width: 768px) {
  form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px 18px;
  }

  /* éléments qui doivent prendre toute la largeur */
  label[for="customerEmail"],
  #customerEmail,
  label[for="departureDate"],
  #departureDate,
  label[for="tripDuration"],
  #tripDuration,
  label[for="customerPhone"],
  #customerPhone,
  label[for="orderNumber"],
  #orderNumber,
  label[for="customerNote"],
  #customerNote,
  button {
    grid-column: 1 / -1;
  }

  input {
    margin-bottom: 0; /* géré par grid gap */
  }

  button {
    width: auto;
    justify-self: end;
    padding: 0 28px;
  }
}

/* ====== RESPONSIVE MOBILE (à ajouter en bas) ====== */
@media (max-width: 767px) {
  /* évite les soucis du 100vh sur mobile (barre d’adresse) */
  .travel-form {
    height: auto !important;
    min-height: 100dvh;
    padding: 16px;
  }

  .contact-us {
    height: auto;
    padding: 24px 16px;
    margin: 0 auto;
    border-radius: 12px;
  }

  h1 {
    padding-bottom: 0;
    margin-bottom: 24px;
    font-size: 24px;
    line-height: 1.2;
  }

  /* Empêche le zoom iOS sur focus (font-size >= 16px) */
  label,
  input,
  textarea,
  select {
    font-size: 16px;
    line-height: 1.4;
  }

  input {
    margin-bottom: 16px;
  }

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

  /* bouton full width */
  button {
    float: none;
    width: 100%;
    margin-top: 16px;
    min-height: 48px;
  }
}

/* ====== FIX MOBILE : inputs qui se réduisent vraiment ====== */
@media (max-width: 767px) {
  /* Le padding desktop (100px) empêche souvent la page de rentrer */
  .contact-us {
    padding: 24px 16px !important;
    max-width: 100% !important;
    width: 100% !important;
  }

  /* Empêche les éléments flex/grid de déborder */
  .contact-us,
  form {
    min-width: 0 !important;
  }

  form {
    width: 100% !important;
  }

  input,
  select,
  textarea {
    width: 100% !important;
    max-width: 100% !important;
  }

  /* Si un parent a un padding/marge étrange */
  .travel-form {
    padding: 16px !important;
  }
}
