/* ================================================================
   search.css — Formulaire de recherche de trains et autocomplete
   ================================================================ */

/* ── Carte de recherche ───────────────────────────────────── */
.search-section {
  margin-bottom: 28px;
}

.search-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 24px;
}

/* ── Ligne gares : départ / swap / arrivée ────────────────── */
.search-stations {
  display: grid;
  grid-template-columns: 1fr 44px 1fr;
  align-items: end;
  gap: 8px;
  margin-bottom: 16px;
}

/* ── Bouton swap ──────────────────────────────────────────── */
.swap-btn {
  align-self: end;
  width: 40px;
  height: 42px;
  border: 1.5px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  color: var(--primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), border-color var(--transition);
  flex-shrink: 0;
  margin-bottom: 0;
}
.swap-btn:hover {
  background: var(--primary-light);
  border-color: var(--primary);
}
.swap-btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ── Bas du formulaire : date + bouton ────────────────────── */
.search-bottom {
  display: flex;
  gap: 12px;
  align-items: flex-end;
}

.field-date { flex: 0 0 180px; }

.search-submit {
  flex: 1;
  padding: 10px;
  font-size: .95rem;
}

/* ── Erreur de recherche ──────────────────────────────────── */
#search-error { margin-top: 12px; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 640px) {
  .search-card { padding: 16px; }

  .search-stations {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
  }

  .swap-btn {
    width: 36px;
    height: 36px;
    justify-self: center;
    transform: rotate(90deg);
  }

  .search-bottom {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .field-date {
    flex: unset;
    width: 100%;
    min-width: 0;
  }
  .field-date input { width: 100%; }
}

@media (min-width: 641px) and (max-width: 768px) {
  .search-stations {
    grid-template-columns: 1fr 40px 1fr;
  }

  .field-date { flex: 0 0 160px; }
}
