/* =============================================================================
   TROUVER MON LIEU IDÉAL — TUNNEL (refonte v2)
   Page : trouver_mon_lieu_idealv2.php  (/trouver-mon-lieu-ideal/)

   Chargé APRÈS /css/v2/home-refonte.css, dont il réutilise les variables
   (--hv3-*) et les composants (.hv3-btn, .hv3-pill, .hv3-chips…).
   Les classes propres à cette page utilisent le préfixe .tml-.
   Couleur de l'outil : rose (cf. bouton "Trouver mon lieu idéal" du header).

   SOMMAIRE
   1. Réglages de page
   2. Progression (5 catégories)
   3. Cartes & transitions entre étapes
   4. Écrans d'introduction
   5. En-tête des questions
   6. Choix : tuiles, pastilles, images, pièces
   7. Champs : recherche, étiquettes, budget
   8. Trajets
   9. Navigation (Retour / Continuer), envoi
   10. Responsive
   ============================================================================= */


/* =============================================================================
   1. RÉGLAGES DE PAGE
   ============================================================================= */

/* ---- Couleur de chaque catégorie ----
   Portée par tout élément [data-cat] (étapes du tunnel + indicateur de
   progression) : tous les styles .tml- utilisent --tml-c*. Les variables
   --hv3-match* sont redéfinies pour que les composants communs (.hv3-btn-match,
   .hv3-pill-match) prennent aussi la couleur de la catégorie.
     --tml-c        couleur principale        --tml-c-dark  texte sur fond clair
     --tml-c-soft   fond léger                --tml-c-line  bordure légère
     --tml-c-from / --tml-c-to   dégradé      --tml-c-rgb / --tml-c-dark-rgb  pour rgba() */

.tml-page,
.tml-page [data-cat="1"] {            /* Projet : rose */
  --tml-c: #FF1C60;      --tml-c-dark: #E0104F;  --tml-c-soft: #FFF0F4;  --tml-c-line: #FFC9D8;
  --tml-c-from: #FF1C60; --tml-c-to: #FE6A56;
  --tml-c-rgb: 255, 28, 96;            --tml-c-dark-rgb: 224, 16, 79;
}

.tml-page [data-cat="2"] {            /* Localisation : orange */
  --tml-c: #F98B1E;      --tml-c-dark: #C25E05;  --tml-c-soft: #FFF4E8;  --tml-c-line: #FFD5A6;
  --tml-c-from: #FB7A12; --tml-c-to: #FEA640;
  --tml-c-rgb: 249, 139, 30;           --tml-c-dark-rgb: 194, 94, 5;
}

.tml-page [data-cat="3"] {            /* Immobilier : bleu */
  --tml-c: #0AA5EC;      --tml-c-dark: #0072B0;  --tml-c-soft: #E8F7FE;  --tml-c-line: #A9DFF8;
  --tml-c-from: #0095E0; --tml-c-to: #22C4FF;
  --tml-c-rgb: 10, 165, 236;           --tml-c-dark-rgb: 0, 114, 176;
}

.tml-page [data-cat="4"] {            /* Cadre de vie : vert */
  --tml-c: #14B89A;      --tml-c-dark: #0B8370;  --tml-c-soft: #E6F9F4;  --tml-c-line: #A6E8D7;
  --tml-c-from: #0FB59E; --tml-c-to: #34DDB0;
  --tml-c-rgb: 20, 184, 154;           --tml-c-dark-rgb: 11, 131, 112;
}

.tml-page [data-cat="5"] {            /* À proximité : violet */
  --tml-c: #A855F7;      --tml-c-dark: #7A2FD6;  --tml-c-soft: #F5EDFF;  --tml-c-line: #DCC6FD;
  --tml-c-from: #9B4DF5; --tml-c-to: #C65BFC;
  --tml-c-rgb: 168, 85, 247;           --tml-c-dark-rgb: 122, 47, 214;
}

.tml-page .tunnel-step-panel {
  --hv3-match:      var(--tml-c);
  --hv3-match-dark: var(--tml-c-dark);
  --hv3-match-soft: var(--tml-c-soft);
  --hv3-match-grad: linear-gradient(to right, var(--tml-c-from) 0%, var(--tml-c-to) 51%, var(--tml-c-from) 100%);
}

/* Le texte de la pastille "Étape x / 5" et des boutons reste lisible sur les couleurs claires */
.tml-page .tunnel-step-panel .hv3-pill-match { color: var(--tml-c-dark); }

.tml-page .tunnel-step-panel .hv3-btn-match {
  text-shadow: 0 1px 2px rgba(var(--tml-c-dark-rgb), .35);
  box-shadow: 0 8px 20px -6px rgba(var(--tml-c-rgb), .55);
}

.tml-page .tunnel-step-panel .hv3-btn-match:hover {
  box-shadow: 0 14px 26px -8px rgba(var(--tml-c-rgb), .62);
}

/* overflow-x: clip (et non hidden) pour que la navigation "sticky" fonctionne sur mobile */
.tml-page main.tml-main {
  min-height: 100vh;
  overflow-x: clip;
  background-size: 100% 900px;
}

.tml-shell {
  max-width: 760px;
  margin: 0 auto;
  padding: 26px 20px 80px;
}

/* Champs masqués mais accessibles au clavier */
.tml-opt input,
.tml-chip input,
.tml-pic input,
.tml-room input,
.tml-mode input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
  pointer-events: none;
}

/* Bootstrap ajoute une marge sous chaque <label> */
.tml-page .tml-opt,
.tml-page .tml-chip,
.tml-page .tml-pic,
.tml-page .tml-room,
.tml-page .tml-mode {
  position: relative;
  margin: 0;
  cursor: pointer;
}

/* Pastille "cochée" commune (tuiles, images) */
.tml-opt-box::after,
.tml-pic-box::after {
  content: "";
  position: absolute;
  top: 10px;
  right: 10px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background-color: #FFFFFF;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 11px 9px;
  border: 1.5px solid #D9D8E8;
  transition: background-color var(--hv3-ease), border-color var(--hv3-ease), transform var(--hv3-ease);
}

.tml-opt input:checked + .tml-opt-box::after,
.tml-pic input:checked + .tml-pic-box::after {
  background-color: var(--tml-c);
  border-color: var(--tml-c);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 11 9'%3E%3Cpath d='M1 4.6 3.9 7.5 10 1.4' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  transform: scale(1.06);
}

/* Repère clavier */
.tml-opt input:focus-visible + .tml-opt-box,
.tml-chip input:focus-visible + .tml-chip-box,
.tml-pic input:focus-visible + .tml-pic-box,
.tml-room input:focus-visible + .tml-room-box,
.tml-mode input:focus-visible + .tml-mode-box {
  box-shadow: var(--hv3-focus);
}

.tml-page .tml-main button:focus-visible { box-shadow: var(--hv3-focus); }


/* =============================================================================
   2. PROGRESSION (5 catégories)
   ============================================================================= */

.tml-top {
  margin-bottom: 18px;
}

.tml-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin: 0 0 14px;
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: .2px;
  color: var(--hv3-navy);
  text-align: center;
}

.tml-cats {
  display: flex;
  gap: 8px;
}

.tml-page .tml-cat {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: none;
  cursor: pointer;
  transition: flex-grow var(--hv3-ease);
}

.tml-cat-ico {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #FFFFFF;
  border: 1.5px solid var(--hv3-border);
  font-size: 16px;
  line-height: 1;
  filter: grayscale(.6);
  opacity: .75;
  transition: all var(--hv3-ease);
}

.tml-cat-name {
  max-width: 100%;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--hv3-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color var(--hv3-ease);
}

.tml-cat-bar {
  display: block;
  width: 100%;
  height: 5px;
  border-radius: 100px;
  background: #E9E7F4;
  overflow: hidden;
}

.tml-cat-bar span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(to right, var(--tml-c-from), var(--tml-c-to));
  transition: width .45s cubic-bezier(.4, 0, .2, 1);
}

.tml-cat:hover .tml-cat-ico { opacity: 1; filter: none; }

.tml-cat.cat-done .tml-cat-ico {
  filter: none;
  opacity: 1;
  border-color: var(--tml-c-line);
  background: var(--tml-c-soft);
}
.tml-cat.cat-done .tml-cat-name { color: var(--hv3-navy); }

.tml-cat.cat-active .tml-cat-ico {
  filter: none;
  opacity: 1;
  border-color: var(--tml-c);
  background: var(--tml-c-soft);
  box-shadow: 0 0 0 4px rgba(var(--tml-c-rgb), .12);
}
.tml-cat.cat-active .tml-cat-name { color: var(--tml-c-dark); font-weight: 700; }


/* =============================================================================
   3. CARTES & TRANSITIONS ENTRE ÉTAPES
   ============================================================================= */

.tunnel-step-panel { display: none; }

.tunnel-step-panel.step-panel-active {
  display: block;
  animation: tml-in .38s cubic-bezier(.4, 0, .2, 1) both;
}

.tunnel-step-panel.step-panel-back { animation-name: tml-in-back; }

@keyframes tml-in {
  from { opacity: 0; transform: translateX(22px); }
  to   { opacity: 1; transform: none; }
}

@keyframes tml-in-back {
  from { opacity: 0; transform: translateX(-22px); }
  to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .tunnel-step-panel.step-panel-active { animation: none; }
}

.tml-card {
  position: relative;
  padding: 30px 32px 26px;
  border-radius: var(--hv3-radius);
  background: #FFFFFF;
  border: 1px solid var(--tml-c-line);
  box-shadow: 0 34px 60px -38px rgba(var(--tml-c-rgb), .45), var(--hv3-shadow-sm);
}


/* =============================================================================
   4. ÉCRANS D'INTRODUCTION
   ============================================================================= */

.tml-intro {
  padding: 40px 36px 34px;
  text-align: center;
}

.tml-intro-ico {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin: 0 auto 14px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--tml-c-from) 0%, var(--tml-c-to) 100%);
  box-shadow: 0 12px 22px -12px rgba(var(--tml-c-rgb), .75);
  transform: rotate(-4deg);
}

.tml-intro-ico img {
  width: 26px;
  height: 26px;
  object-fit: contain;
  transform: rotate(4deg);
  filter: brightness(0) invert(1); /* pictos en blanc (crosshair.svg est foncé) */
}

.tml-intro-pill { margin-bottom: 12px; }

.tml-intro-title {
  margin: 0 0 10px;
  font-size: 32px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -.6px;
  color: var(--hv3-navy);
  overflow-wrap: anywhere;
}

.tml-intro-title:focus { outline: none; }

.tml-accent {
  background-image: linear-gradient(100deg, var(--tml-c-from) 0%, var(--tml-c-to) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--tml-c);
}

.tml-intro-desc {
  max-width: 470px;
  margin: 0 auto 22px;
  font-size: 16.5px;
  line-height: 1.6;
  color: var(--hv3-muted);
}

.tml-intro-desc strong { color: var(--hv3-navy); font-weight: 700; }

.tml-intro-chips {
  justify-content: center;
  margin-bottom: 26px;
}

.tml-intro-cta { min-width: 230px; }

/* Retour sous "C'est parti" (sélecteur renforcé : .tml-prev, plus bas, est en inline-flex) */
.tml-page .tml-intro .tml-intro-back {
  display: flex;
  margin: 12px auto 0;
}


/* =============================================================================
   5. EN-TÊTE DES QUESTIONS
   ============================================================================= */

.tml-q-num {
  display: block;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.3px;
  text-transform: uppercase;
  color: var(--tml-c-dark);
}

.tml-q-num b { font-weight: 800; }

.tml-q-title {
  margin: 0;
  font-size: 26px;
  font-weight: 800;
  line-height: 1.22;
  letter-spacing: -.4px;
  color: var(--hv3-navy);
}

.tml-q-title:focus { outline: none; }

.tml-q-sub {
  margin: 8px 0 0;
  font-size: 15px;
  line-height: 1.55;
  color: var(--hv3-muted);
}


/* =============================================================================
   6. CHOIX
   ============================================================================= */

/* ---- Tuiles (icône + libellé) ---- */

.tml-opts {
  display: grid;
  gap: 12px;
  margin-top: 22px;
}

.tml-opts-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tml-opts-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tml-opts-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.tml-opt-box {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 100%;
  min-height: 118px;
  padding: 22px 12px 18px;
  border-radius: 18px;
  background: #FFFFFF;
  border: 1.5px solid var(--hv3-border);
  text-align: center;
  transition: border-color var(--hv3-ease), background-color var(--hv3-ease), box-shadow var(--hv3-ease), transform var(--hv3-ease);
}

.tml-opt:hover .tml-opt-box {
  border-color: var(--tml-c-line);
  transform: translateY(-2px);
  box-shadow: 0 14px 26px -20px rgba(24, 20, 87, .5);
}

.tml-opt input:checked + .tml-opt-box {
  border-color: var(--tml-c);
  background: var(--tml-c-soft);
  box-shadow: 0 0 0 3px rgba(var(--tml-c-rgb), .12), 0 14px 26px -20px rgba(var(--tml-c-rgb), .6);
}

.tml-opt-img {
  width: 42px;
  height: 42px;
  object-fit: contain;
}

.tml-opt-emoji {
  font-size: 40px;
  line-height: 1;
}

.tml-opt-txt {
  font-size: 14.5px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--hv3-navy);
}

.tml-opts-big .tml-opt-box { min-height: 146px; }
.tml-opts-big .tml-opt-emoji { font-size: 46px; }
.tml-opts-big .tml-opt-txt { font-size: 16px; }

/* ---- Pastilles ---- */

.tml-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.tml-chip-box {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 11px 18px 11px 12px;
  border-radius: 100px;
  background: #FFFFFF;
  border: 1.5px solid var(--hv3-border);
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--hv3-navy);
  user-select: none;
  transition: border-color var(--hv3-ease), background-color var(--hv3-ease), color var(--hv3-ease), box-shadow var(--hv3-ease);
}

.tml-chip-box::before {
  content: "";
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.5px solid #D9D8E8;
  background: #FFFFFF no-repeat center / 10px 8px;
  transition: background-color var(--hv3-ease), border-color var(--hv3-ease);
}

.tml-chip:hover .tml-chip-box { border-color: var(--tml-c-line); }

.tml-chip input:checked + .tml-chip-box {
  border-color: var(--tml-c);
  background: var(--tml-c-soft);
  color: var(--tml-c-dark);
  box-shadow: 0 8px 18px -14px rgba(var(--tml-c-rgb), .8);
}

.tml-chip input:checked + .tml-chip-box::before {
  border-color: var(--tml-c);
  background-color: var(--tml-c);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 11 9'%3E%3Cpath d='M1 4.6 3.9 7.5 10 1.4' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

/* ---- Images ---- */

.tml-pics {
  display: grid;
  gap: 12px;
  margin-top: 22px;
}

.tml-pics-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tml-pics-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.tml-pic-box {
  position: relative;
  display: block;
  aspect-ratio: 1 / 1;
  border-radius: 18px;
  overflow: hidden;
  background-color: var(--hv3-navy-soft);
  background-size: cover;
  background-position: center;
  box-shadow: 0 0 0 1px rgba(24, 20, 87, .06);
  transition: box-shadow var(--hv3-ease), transform var(--hv3-ease);
}

.tml-pics-4 .tml-pic-box { aspect-ratio: 4 / 3; }

/* Voile pour la lisibilité du libellé */
.tml-pic-box::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(24, 20, 87, 0) 38%, rgba(24, 20, 87, .78) 100%);
  transition: background var(--hv3-ease);
}

.tml-pic-txt {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 11px;
  z-index: 1;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  color: #FFFFFF;
  text-shadow: 0 1px 4px rgba(0, 0, 0, .3);
}

.tml-pic:hover .tml-pic-box {
  transform: translateY(-2px);
  box-shadow: 0 0 0 1px rgba(24, 20, 87, .06), 0 16px 28px -18px rgba(24, 20, 87, .6);
}

.tml-pic input:checked + .tml-pic-box {
  box-shadow: 0 0 0 3px var(--tml-c), 0 16px 28px -18px rgba(var(--tml-c-rgb), .8);
}

.tml-pic input:checked + .tml-pic-box::before {
  background: linear-gradient(180deg, rgba(var(--tml-c-rgb), .05) 30%, rgba(var(--tml-c-dark-rgb), .82) 100%);
}

/* ---- Nombre de pièces ---- */

.tml-rooms {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-top: 22px;
}

.tml-room-box {
  display: grid;
  place-items: center;
  height: 68px;
  border-radius: 16px;
  background: #FFFFFF;
  border: 1.5px solid var(--hv3-border);
  font-size: 21px;
  font-weight: 800;
  color: var(--hv3-navy);
  transition: all var(--hv3-ease);
}

.tml-room:hover .tml-room-box { border-color: var(--tml-c-line); transform: translateY(-2px); }

.tml-room input:checked + .tml-room-box {
  border-color: transparent;
  color: #FFFFFF;
  background: linear-gradient(135deg, var(--tml-c-from) 0%, var(--tml-c-to) 100%);
  box-shadow: 0 12px 22px -12px rgba(var(--tml-c-rgb), .8);
}


/* =============================================================================
   7. CHAMPS : RECHERCHE, ÉTIQUETTES, BUDGET
   ============================================================================= */

/* ---- Champ de recherche (autocomplétion) ---- */

.tml-field {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 58px;
  margin-top: 22px;
  padding: 0 18px;
  border-radius: 100px;
  background: #FFFFFF;
  border: 1.5px solid var(--hv3-border);
  box-shadow: 0 12px 26px -20px rgba(24, 20, 87, .5);
  transition: border-color var(--hv3-ease), box-shadow var(--hv3-ease);
}

.tml-field:focus-within {
  border-color: var(--tml-c);
  box-shadow: 0 0 0 4px rgba(var(--tml-c-rgb), .12), 0 12px 26px -20px rgba(24, 20, 87, .5);
}

.tml-field-ico {
  flex: 0 0 auto;
  width: 21px;
  height: 21px;
  fill: var(--tml-c);
}

.tml-field-spin {
  display: none;
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2.5px solid var(--tml-c-soft);
  border-top-color: var(--tml-c);
  animation: hv3-spin .7s linear infinite;
}

.tml-field.is-loading .tml-field-ico  { display: none; }
.tml-field.is-loading .tml-field-spin { display: block; }

/* width: 0 + flex-grow : évite qu'un <input> élargisse la carte sur mobile */
.tml-page .tml-field .tml-input {
  flex: 1 1 0%;
  width: 0;
  min-width: 0;
  height: 100%;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  outline: none;
  font-family: inherit;
  font-size: 16px;   /* 16px minimum : pas de zoom automatique sur iOS */
  font-weight: 500;
  color: var(--hv3-navy);
}

.tml-page .tml-input::placeholder {
  color: #A3A5C2;
  opacity: 1;
}

/* Suggestions */
.tml-ac-list {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 30;
  max-height: 320px;
  overflow-y: auto;
  list-style: none;
  margin: 0;
  padding: 6px;
  border-radius: 18px;
  background: #FFFFFF;
  border: 1px solid var(--hv3-border);
  box-shadow: 0 26px 50px -22px rgba(24, 20, 87, .5);
}

.tml-ac-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  cursor: pointer;
}

.tml-ac-option.is-active { background: var(--tml-c-soft); }

.tml-ac-name {
  min-width: 0;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--hv3-navy);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tml-ac-type {
  flex: 0 0 auto;
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .4px;
  text-transform: uppercase;
  color: var(--hv3-navy);
  background: var(--hv3-navy-soft);
}

.tml-ac-type-region,
.tml-ac-type-departement { color: var(--hv3-place); background: var(--hv3-place-soft); }
.tml-ac-type-adresse     { color: var(--hv3-match); background: var(--hv3-match-soft); }

.tml-ac-msg {
  padding: 14px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--hv3-muted);
}

/* ---- Étiquettes des zones choisies ---- */

.tml-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.tml-tags:empty { display: none; }

.tml-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 6px 6px 6px 14px;
  border-radius: 100px;
  background: var(--tml-c-soft);
  border: 1px solid var(--tml-c-line);
  font-size: 14px;
  font-weight: 600;
  color: var(--tml-c-dark);
  animation: tml-pop .25s ease both;
}

.tml-tag-txt {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tml-page .tml-tag-del {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #FFFFFF;
  color: var(--tml-c);
  font-size: 17px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: background-color var(--hv3-ease), color var(--hv3-ease);
}

.tml-page .tml-tag-del:hover { background: var(--tml-c); color: #FFFFFF; }

@keyframes tml-pop {
  from { opacity: 0; transform: scale(.85); }
  to   { opacity: 1; transform: none; }
}

/* ---- Budget ---- */

.tml-budget {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 22px;
}

.tml-page .tml-budget-field label {
  display: block;
  margin: 0 0 7px;
  font-size: 13px;
  font-weight: 700;
  color: var(--hv3-navy);
}

.tml-money { position: relative; }

.tml-page .tml-money .tml-input {
  display: block;
  width: 100%;
  height: 58px;
  margin: 0;
  padding: 0 40px 0 18px;
  border-radius: 16px;
  background: #FFFFFF;
  border: 1.5px solid var(--hv3-border);
  box-shadow: none;
  outline: none;
  font-family: inherit;
  font-size: 18px;
  font-weight: 700;
  color: var(--hv3-navy);
  -moz-appearance: textfield;
  transition: border-color var(--hv3-ease), box-shadow var(--hv3-ease);
}

.tml-money .tml-input::-webkit-outer-spin-button,
.tml-money .tml-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.tml-page .tml-money .tml-input:focus {
  border-color: var(--tml-c);
  box-shadow: 0 0 0 4px rgba(var(--tml-c-rgb), .12);
}

.tml-money > span {
  position: absolute;
  top: 50%;
  right: 18px;
  transform: translateY(-50%);
  font-size: 17px;
  font-weight: 700;
  color: var(--hv3-muted);
  pointer-events: none;
}

.tml-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

/* Un seul jeu de raccourcis affiché : achat ou location (cf. JS) */
.tml-presets[hidden] { display: none; }

.tml-page .tml-preset {
  padding: 9px 15px;
  border-radius: 100px;
  border: 1.5px solid transparent;
  background: var(--hv3-soft);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--hv3-navy);
  cursor: pointer;
  transition: all var(--hv3-ease);
}

.tml-page .tml-preset:hover { border-color: var(--tml-c-line); background: #FFFFFF; }

.tml-page .tml-preset.is-active {
  border-color: var(--tml-c);
  background: var(--tml-c-soft);
  color: var(--tml-c-dark);
}


/* =============================================================================
   8. TRAJETS
   ============================================================================= */

.tml-trips {
  display: grid;
  gap: 14px;
  margin-top: 22px;
}

.tml-trip {
  padding: 16px 16px 16px;
  border-radius: 18px;
  background: #FAF9FE;
  border: 1px solid var(--hv3-border);
  animation: tml-pop .25s ease both;
}

.tml-trip.is-set {
  background: #FFFFFF;
  border-color: var(--tml-c-line);
}

.tml-trip-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.tml-trip-title {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--hv3-navy);
}

.tml-trip-num {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--tml-c-from) 0%, var(--tml-c-to) 100%);
  font-size: 12px;
  font-weight: 800;
  color: #FFFFFF;
}

.tml-page .tml-trip-del {
  padding: 4px 2px;
  border: 0;
  background: none;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--hv3-muted);
  cursor: pointer;
}

.tml-page .tml-trip-del:hover { color: var(--tml-c); text-decoration: underline; }

.tml-trip .tml-field {
  height: 52px;
  margin-top: 0;
  box-shadow: none;
}

/* ---- Durée (curseur) ---- */

.tml-range { margin: 16px 2px 14px; }

.tml-range-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--hv3-muted);
}

.tml-range-val {
  font-size: 15px;
  font-weight: 800;
  color: var(--tml-c-dark);
}

.tml-range-input {
  --tml-fill: 18%;
  display: block;
  width: 100%;
  height: 6px;
  margin: 0;
  border-radius: 100px;
  background: linear-gradient(to right, var(--tml-c-from) 0, var(--tml-c-to) var(--tml-fill), #E6E5F1 var(--tml-fill));
  -webkit-appearance: none;
  appearance: none;
  outline: none;
  cursor: pointer;
}

.tml-range-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #FFFFFF;
  border: 3px solid var(--tml-c);
  box-shadow: 0 4px 10px -2px rgba(var(--tml-c-rgb), .5);
  transition: transform .15s ease;
}

.tml-range-input::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #FFFFFF;
  border: 3px solid var(--tml-c);
  box-shadow: 0 4px 10px -2px rgba(var(--tml-c-rgb), .5);
}

.tml-range-input:active::-webkit-slider-thumb { transform: scale(1.12); }
.tml-range-input:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 5px rgba(var(--tml-c-rgb), .2); }

/* ---- Mode de transport ---- */

.tml-modes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.tml-mode-box {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 100%;
  padding: 10px 8px;
  border-radius: 12px;
  background: #FFFFFF;
  border: 1.5px solid var(--hv3-border);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--hv3-navy);
  text-align: center;
  transition: all var(--hv3-ease);
}

.tml-mode-box img {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.tml-mode:hover .tml-mode-box { border-color: var(--tml-c-line); }

.tml-mode input:checked + .tml-mode-box {
  border-color: var(--tml-c);
  background: var(--tml-c-soft);
  color: var(--tml-c-dark);
}

/* ---- Ajouter un trajet ---- */

.tml-page .tml-add {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: 12px;
  padding: 13px 18px;
  border-radius: 16px;
  border: 1.5px dashed var(--tml-c-line);
  background: transparent;
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--tml-c-dark);
  cursor: pointer;
  transition: background-color var(--hv3-ease), border-color var(--hv3-ease);
}

.tml-page .tml-add:hover { background: var(--tml-c-soft); border-color: var(--tml-c); }
.tml-add span { font-size: 19px; line-height: 1; }


/* =============================================================================
   9. NAVIGATION (Retour / Continuer), ENVOI
   ============================================================================= */

.tml-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid #F1EFF7;
}

.tml-page .tml-prev {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 12px 8px;
  border: 0;
  border-radius: 100px;
  background: none;
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--hv3-muted);
  cursor: pointer;
  transition: color var(--hv3-ease);
}

.tml-page .tml-prev:hover { color: var(--hv3-navy); }
.tml-prev span { transition: transform var(--hv3-ease); }
.tml-prev:hover span { transform: translateX(-3px); }

.tml-page .tml-next {
  min-width: 190px;
  cursor: pointer;
}

/* Chargement à l'envoi */
.tml-spin {
  display: none;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  border: 2.5px solid rgba(255, 255, 255, .45);
  border-top-color: #FFFFFF;
  animation: hv3-spin .7s linear infinite;
}

.tml-next.is-loading { cursor: wait; transform: none; }
.tml-next.is-loading .tml-spin { display: inline-block; }
.tml-next.is-loading .hv3-btn-arrow { display: none; }

.tml-error {
  margin: 18px 0 0;
  padding: 12px 16px;
  border-radius: 14px;
  background: var(--hv3-match-soft);
  border: 1px solid #FFD3DF;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
  color: #B30D41;
}

.tml-error[hidden] { display: none; }


/* =============================================================================
   10. RESPONSIVE
   ============================================================================= */

@media (max-width: 767px) {

  .tml-shell { padding: 14px 14px 40px; }

  /* Progression compacte : seul le nom de la catégorie en cours est affiché */
  .tml-top { margin-bottom: 12px; }
  .tml-title { margin-bottom: 10px; font-size: 13px; }
  .tml-cats { gap: 6px; }
  .tml-page .tml-cat { gap: 6px; }
  .tml-page .tml-cat.cat-active { flex-grow: 2.4; }
  .tml-cat-ico { width: 32px; height: 32px; font-size: 14px; }
  .tml-cat-name { display: none; font-size: 11.5px; }
  .tml-cat.cat-active .tml-cat-name { display: block; }
  .tml-cat.cat-active { flex-direction: row; flex-wrap: wrap; justify-content: center; column-gap: 6px; }
  .tml-cat.cat-active .tml-cat-bar { flex-basis: 100%; }

  .tml-card { padding: 20px 16px 0; }

  .tml-intro { padding: 28px 18px 26px; }
  .tml-intro-ico { width: 46px; height: 46px; border-radius: 14px; margin-bottom: 12px; }
  .tml-intro-ico img { width: 23px; height: 23px; }
  .tml-intro-title { font-size: 25px; }
  .tml-intro-desc { font-size: 15.5px; margin-bottom: 18px; }
  .tml-intro-chips { gap: 8px 16px; margin-bottom: 22px; }
  .tml-intro-cta { width: 100%; min-width: 0; }

  .tml-q-num { font-size: 11.5px; margin-bottom: 6px; }
  .tml-q-title { font-size: 21px; }
  .tml-q-sub { font-size: 14px; margin-top: 6px; }

  .tml-opts,
  .tml-chips,
  .tml-pics,
  .tml-rooms,
  .tml-budget,
  .tml-trips { margin-top: 18px; }
  .tml-field { margin-top: 18px; }
  .tml-trip .tml-field { margin-top: 0; }

  .tml-opts { gap: 10px; }
  .tml-opts-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tml-opt-box { min-height: 96px; padding: 16px 8px 14px; gap: 8px; border-radius: 16px; }
  .tml-opt-box::after { top: 8px; right: 8px; width: 20px; height: 20px; }
  .tml-opt-img { width: 34px; height: 34px; }
  .tml-opt-txt { font-size: 13.5px; }
  .tml-opts-big .tml-opt-box { min-height: 120px; }
  .tml-opts-big .tml-opt-emoji { font-size: 38px; }
  .tml-opts-big .tml-opt-txt { font-size: 15px; }

  .tml-chips { gap: 8px; }
  .tml-chip-box { padding: 10px 15px 10px 10px; font-size: 14px; gap: 8px; }

  .tml-pics { gap: 10px; }
  .tml-pics-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tml-pics-4 .tml-pic-box { aspect-ratio: 16 / 9; }
  .tml-pic-box { border-radius: 14px; }
  .tml-pic-box::after { top: 7px; right: 7px; width: 20px; height: 20px; }
  .tml-pic-txt { left: 9px; right: 9px; bottom: 8px; font-size: 13px; }

  .tml-rooms { gap: 7px; }
  .tml-room-box { height: 56px; border-radius: 14px; font-size: 19px; }

  .tml-budget { gap: 10px; }
  .tml-page .tml-money .tml-input { height: 54px; padding: 0 34px 0 14px; font-size: 17px; }
  .tml-money > span { right: 14px; }
  .tml-page .tml-preset { padding: 8px 12px; font-size: 13px; }

  .tml-field { height: 54px; padding: 0 16px; }

  .tml-trip { padding: 14px 12px; }
  .tml-mode-box { flex-direction: column; gap: 4px; padding: 9px 4px; font-size: 12.5px; }

  /* Navigation toujours visible en bas de l'écran */
  .tml-nav {
    position: sticky;
    bottom: 0;
    z-index: 20;
    margin: 20px -16px 0;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
    border-radius: 0 0 var(--hv3-radius) var(--hv3-radius);
    background: rgba(255, 255, 255, .94);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
  }

  .tml-page .tml-prev { flex: 0 0 auto; padding: 12px 4px; font-size: 14px; }
  .tml-page .tml-next { flex: 1 1 auto; min-width: 0; padding: 15px 18px; }

  .tml-error { margin-top: 14px; }
}

@media (max-width: 359px) {
  .tml-q-title { font-size: 19.5px; }
  .tml-intro-title { font-size: 22px; }
  .tml-opts-3 .tml-opt-txt { font-size: 12.5px; }
  .tml-pics-3 .tml-pic-txt { font-size: 12px; }
}
