/* Recherche par agent sur l'accueil (comptes Autopilote) : une pilule de mode, un champ
   texte au-dessus des offres, puis la barre descend et la page devient Autopilote. */
.agent-search { display: flex; flex-direction: column; align-items: center; margin-top: 18px; }
.agent-search__modes-row { display: flex; justify-content: center; margin: 14px 0 4px; }
.agent-search__modes { position: relative; isolation: isolate; display: inline-flex; padding: 3px; border: 1px solid #e5e5e5; border-radius: 999px; background: #fff; }
.agent-search__modes button { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 14px; border-radius: 999px; font-size: .8125rem; font-weight: 500; color: #737373; transition: background-color .2s, color .3s; }
.agent-search__modes button:hover { color: #0a0a0a; }
.agent-search__modes button[aria-checked="true"] { background: #0a0a0a; color: #fff; }
/* Avec JavaScript, un fond unique glisse d'une option à l'autre (agent_search.js). */
.agent-search__modes-thumb { position: absolute; top: 3px; bottom: 3px; left: 0; z-index: -1; border-radius: 999px; background: #0a0a0a; pointer-events: none; }
.agent-search__modes[data-thumb] button[aria-checked="true"] { background: transparent; }
.agent-search__modes[data-thumb-ready] .agent-search__modes-thumb { transition: transform .42s cubic-bezier(.22, 1, .36, 1), width .42s cubic-bezier(.22, 1, .36, 1); }
.agent-search__modes button:focus-visible { outline: 1.5px solid #0a0a0a; outline-offset: 2px; }
/* Étoiles IA, de la couleur du texte (blanches sur l'option active). */
.agent-search__sparkles { flex: none; width: 14px; height: 14px; }

.agent-search__form { display: flex; align-items: flex-end; gap: 8px; width: calc(100% + 12px); margin-inline: -6px; padding: 8px 8px 8px 16px; border: 1px solid #e5e5e5; border-radius: 14px; background: #fff; box-shadow: 0 1px 2px #0000000a; transition: border-color .15s, box-shadow .15s; }
.agent-search__form:focus-within { border-color: #a3a3a3; box-shadow: 0 2px 10px #0000000d; }
.agent-search__form textarea { flex: 1 1 auto; min-height: 38px; max-height: 160px; padding: 8px 0; border: 0; background: transparent; font-size: 1rem; line-height: 1.5; color: #0a0a0a; resize: none; }
.agent-search__form textarea:focus { outline: none; box-shadow: none; }
.agent-search__form textarea::placeholder { overflow: hidden; color: #a3a3a3; text-indent: 8px; text-overflow: ellipsis; white-space: nowrap; } /* décollé du curseur, sur une ligne */
.agent-search__form button { display: flex; flex: none; align-items: center; justify-content: center; width: 34px; height: 34px; margin: 2px; border-radius: 9px; background: #0a0a0a; color: #fff; transition: opacity .15s, transform .15s; }
.agent-search__form button:hover { opacity: .85; }
.agent-search__form button:active { transform: scale(.94); }
.agent-search__form button svg { width: 16px; height: 16px; }

/* Ordinateur : barre plus large ; un reflet gris clair glisse le long de la bordure à vitesse
   constante. Le reflet suit le contour arrondi (offset-path) et n'apparaît que sur la bordure (masque). */
.agent-search__ring { display: none; }
@media (min-width: 768px) {
  /* Le titre du mode agent prend la place du titre classique, le champ celle de la barre noire. */
  .agent-search { margin-top: 0; }
  .agent-search__form { width: 100%; margin-inline: 0; }
}
@media (min-width: 1024px) {
  .agent-search__form { position: relative; }
}
@supports (offset-path: inset(0 round 14px)) {
  @media (min-width: 1024px) {
    .agent-search__ring { display: block; position: absolute; inset: -1px; padding: 1px; border-radius: 14px; pointer-events: none; -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0); }
    .agent-search__ring i { position: absolute; top: 0; left: 0; width: 180px; height: 180px; border-radius: 50%; background: radial-gradient(circle, #a3a3a3 0, #a3a3a399 25%, transparent 65%); offset-path: inset(0 round 14px); offset-rotate: 0deg; animation: agent-border-light 6s linear infinite; }
  }
}
@keyframes agent-border-light { to { offset-distance: 100%; } }

/* Mode agent : son propre titre, ni barre de recherche classique, ni filtres rapides.
   Le titre classique reste lu par les lecteurs d'écran. */
.offer-search-hero[data-search-mode="agent"] .offer-search-heading:not(.agent-search__heading) { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.offer-search-hero[data-search-mode="agent"] #search-form,
.offer-search-hero[data-search-mode="agent"] .offer-quick-filters { display: none; }
.offer-search-hero[data-search-mode="classic"] .agent-search,
.offer-search-hero[data-search-mode="classic"] .agent-search__heading { display: none; }

/* Départ vers Autopilote : la page s'efface, la barre glisse en bas de l'écran. */
.agent-search-leaving main > *:not(.agent-search__ghost) { opacity: 0; transition: opacity .3s ease; }
.agent-search__ghost { position: fixed; z-index: 70; margin: 0; }
/* Même rendu que la bulle de question d'Autopilote, qui prend le relais à l'arrivée. */
.agent-search__bubble { position: fixed; z-index: 71; margin: 0; padding: 8px 14px; border-radius: 12px; font-size: .9375rem; line-height: 1.65; color: #0a0a0a; white-space: pre-wrap; overflow-wrap: anywhere; }
@media (max-width: 767px) {
  .agent-search { margin-top: 12px; }
  .agent-search__modes button { padding: 0 10px; font-size: .75rem; }
  .agent-search__form { width: calc(100% + 6px); margin-inline: -3px; }
}
/* Téléphone : pendant la saisie, le champ glisse se poser au-dessus du clavier (agent_search.js). */
.agent-search__veil { position: fixed; inset: 0; z-index: 59; background: #fff; opacity: 0; pointer-events: none; transition: opacity .3s ease; }
.agent-search__veil.is-visible { opacity: 1; pointer-events: auto; }
.agent-search__form.is-docked { position: fixed; left: 12px; right: 12px; z-index: 60; width: auto; margin: 0; box-shadow: 0 8px 28px #0000001f; transition: top .34s cubic-bezier(.22, 1, .36, 1), border-color .15s, box-shadow .15s; }
@media (prefers-reduced-motion: reduce) {
  .agent-search-leaving main > * { transition: none; }
  .agent-search__modes[data-thumb-ready] .agent-search__modes-thumb { transition: none; }
  .agent-search__form.is-docked, .agent-search__veil { transition: none; }
  .agent-search__ring { display: none; }
}

/* Exemples de demandes : repère Tab discret. */
.prompt-tab { flex: none; align-self: center; padding: 1px 6px; border: 1px solid #e5e5e5; border-radius: 5px; font-family: inherit; font-size: .6875rem; line-height: 1.5; color: #a3a3a3; }
.prompt-tab[hidden] { display: none; }
/* Sans clavier physique, Tab ne veut rien dire. */
@media (hover: none) { .prompt-tab { display: none; } }
