:root {
  --primary-color: #2381f7;
  --primary-hover: #1b5ebc;
  --secondary-color: #5eaaff;
  --background: #f7faff;
  --background-light: #fff;
  --background-gradient: linear-gradient(135deg, #e5effe 0%, #f7faff 100%);
  --shadow-light: 0 2px 12px rgba(35, 129, 247, 0.08);
  --shadow-strong: 0 10px 32px rgba(35, 129, 247, 0.1);
  --border-radius: 26px;
  --border-radius-sm: 16px;
  --font-family: 'Inter', 'Segoe UI', 'Arial', sans-serif;
  --text-main: #162032;
  --text-light: #7e9bc9;
  --border-color: #e3e9f3;
}

body {
  background: var(--background-gradient);
  min-height: 100vh;
  font-family: var(--font-family);
  color: var(--text-main);
  font-size: 18px;
  margin: 0;
  padding: 0;
  width: 100%;
  overflow-x: hidden;
}

html {
  margin: 0;
  padding: 0;
  width: 100%;
  overflow-x: hidden;
}
.popup-retours {
  max-width: 220px !important;   /* largeur plus étroite */
  font-size: 12px;
  line-height: 1.2;
  padding: 6px;
}

.popup-retours h3 {
  font-size: 13px;
  margin: 0 0 4px 0;
  line-height: 1.2;
}

html { scroll-behavior: smooth; }

.pill-link { color:#2381f7; text-decoration:underline; cursor:pointer; font-weight:500; }


.popup-see-more {
    text-align: center;
    margin: 15px 0 5px;
    padding: 10px 0;
    border-top: 1px solid #e0e0e0;
}

.popup-see-more-text {
    font-size: 14px;
    color: #42484e;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}


@keyframes pulseGlow {
  0%   { box-shadow: 0 0 0 0 rgba(35,129,247,.45); transform: scale(1); }
  50%  { box-shadow: 0 0 0 10px rgba(35,129,247,.15); transform: scale(1.02); }
  100% { box-shadow: 0 0 0 0 rgba(35,129,247,0); transform: scale(1); }
}

#voir-plus-global:target {
  animation: pulseGlow 1.1s ease-out 1;
  border-radius: 12px;
}

.popup-retours p {
  margin: 0 0 6px 0;
}

.popup-retours .dates-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr); /* 2 dates par ligne */
  gap: 4px;
}

.popup-retours .date-chip {
  display: block;
  padding: 2px 4px;
  border-radius: 6px;
  background: #f8faff;
  border: 1px solid #e5e7eb;
  font-size: 11px;
  text-align: center;
}


/* Offres (landing pricing) */
.main-container {
  max-width: 900px;
  margin: 2.5rem auto;
  padding: 1rem;
}

.main-title {
  font-size: 2.15rem;
  font-weight: 800;
  margin-bottom: 1.2rem;
  color: #23292f;
  letter-spacing: -0.03em;
}

.blue-accent {
  color: #2381f7;
}

/* surbrillance quand on scrolle vers la destination */
.highlight-scroll {
  background: #e7f1ff !important;
  border-left: 5px solid #2381f7 !important;
  transition: background 0.7s, border-color 0.7s;
}

/* pastilles de dates retour */
.return-pills { margin-top: 2px; }
.pill-date {
  display:inline-block;
  margin:6px 6px 0 0;
  padding:8px 12px;
  border-radius:999px;
  border:1px solid #e5e7eb;
  background:#fff;
  cursor:pointer;
  font-size:0.95rem;
  line-height:1;
}
.pill-date:hover { background:#f3f4f6; }

.return-title { margin:6px 0 4px 0; font-weight:600; }
.return-help { margin-top:6px; color:#6b7280; font-size:0.95rem; }
.return-info-empty { color:#6b7280; }

/* popup feuille Leaflet */
.leaflet-popup-content { margin: 10px 12px; }
.popup-return { max-width: 320px; }
.popup-return-title { margin-bottom: 6px; }
.popup-return-sub { margin: 4px 0 6px 0; font-weight: 600; }




.slogan {
  font-size: 1.15rem;
  color: #465068;
  margin-bottom: 2.7rem;
}

.offer-card {
  flex: 1 1 310px;
  min-width: 290px;
  max-width: 355px;
  background: #fff;
  border-radius: 26px;
  box-shadow: 0 3px 28px #cdd8f9a8;
  padding: 2rem 1.7rem 2.2rem 1.7rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 2.5rem;
}

.offer-card ul {
  padding: 0;
  margin: 0;
  list-style: none;
  text-align: left;
  width: 100%;
}

.offer-card li {
  margin-bottom: 0.95rem;
  font-size: 1.02rem;
}

.offer-card .blue-accent {
  color: #2381f7;
}

.offer-card a,
.footer-offer-btn {
  background: #2381f7;
  color: #fff;
  font-weight: 700;
  padding: 0.95rem 2.2rem;
  border-radius: 16px;
  font-size: 1.13rem;
  box-shadow: 0 4px 18px #2381f730;
  margin-bottom: 1.6rem;
  text-decoration: none;
  transition: background .14s;
  border: none;
  display: inline-block;
}

.offer-card a:hover,
.footer-offer-btn:hover {
  background: #1559b3;
  color: #fff;
}

.offer-card[style*="border:2px"] {
  border: 2px solid #2381f7;
  position: relative;
}

.offer-card[style*="border:2px"] > div[style*="position:absolute"] {
  background: #2381f7;
  color: #fff;
  font-size: 0.98rem;
  font-weight: 700;
  padding: 2px 16px 2px 16px;
  border-radius: 14px;
  box-shadow: 0 2px 9px #2381f723;
}

/* Responsive */
@media (max-width: 900px) {
  .main-container {
    max-width: 99vw;
    padding: 0.3rem;
  }
  .main-title {
    font-size: 1.33rem;
  }
  .offer-card {
    min-width: 95vw;
    max-width: 99vw;
    margin-bottom: 2.1rem;
  }
}

/* Bouton footer */
.footer-offer-btn {
  margin: 2rem auto 0 auto;
  display: flex;
  justify-content: center;
  font-size: 1.08rem;
  letter-spacing: 0.01em;
}


/* HEADER */
.header-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  max-width: 1100px;
  margin: 0 auto 0.5rem;
  padding: 1rem 1rem 0.5rem;
  background: white;
  border-radius: 0 0 24px 24px;
  box-shadow: 0 2px 16px rgba(35, 129, 247, 0.08);
}

.logo-hero {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0;
  width: 100%;
}

.logo-img-main {
  width: 220px;
  height: 220px;
  object-fit: contain;
  display: block;
  background: none;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
  margin: 0 auto 0 auto;
}

/* TITRES */
.main-title {
  text-align: center;
  font-size: 1.6rem;
  font-weight: 900;
  letter-spacing: -0.5px;
  margin: 0.8rem auto 1rem;
  line-height: 1.3;
  color: var(--text-main);
  font-family: var(--font-family);
}

.main-title b,
.blue-accent {
  color: var(--primary-color);
}
.slogan {
  display: block;
  margin-top: 0;
  font-size: 1.13rem;
  font-weight: 600;
  color: var(--text-light);
  letter-spacing: 0.01em;
  margin-bottom: 2.3rem; /* <-- Ajout d'un espace sous le bloc headline */
}

/* FORMULAIRE ET RESTE */
.main-container {
  max-width: 1240px;
  margin: 0 auto;
  background: var(--background-light);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-strong);
  padding: 2.5rem 2.5rem 3rem 2.5rem;
}
.search-form {
  margin: 0 auto 2.2rem auto;
  padding: 2rem 1.5rem 1.5rem 1.5rem;
  background: var(--background-light);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-light);
  border: 1.5px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 1.3rem;
  max-width: 690px;
}
.form-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  align-items: flex-end;
  justify-content: center;
  padding: 0 20px;
}
.form-btn-wrapper {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-top: 1.2rem;
  gap: 0.5rem;
}
.input-container {
  display: flex;
  flex-direction: column;
  min-width: 200px;
  flex: 1 1 210px;
  position: relative;
}
label {
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 0.55rem;
  letter-spacing: 0.01em;
}
input[type='text'],
input[type='date'] {
  font-size: 16px; /* 16px minimum pour éviter le zoom auto sur mobile */
  padding: 1.1rem 1.1rem;
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  background: var(--background-light);
  color: var(--text-main);
  font-family: inherit;
  transition: border-color 0.18s, box-shadow 0.18s;
}
input[type='text']:focus,
input[type='date']:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px #2381f72a;
}

/* Indicateur de chargement sur les boutons de recherche */
button[type='submit'].loading,
#smart-go.loading,
#giga-go.loading {
  position: relative;
  pointer-events: none;
  opacity: 0.8;
}

button[type='submit'].loading span,
#smart-go.loading span {
  opacity: 0.7;
}

/* Message de chargement sous le bouton */
.search-loading-text {
  display: none;
  text-align: center;
  margin-top: 0.75rem;
  color: #2381f7;
  font-size: 0.9rem;
  font-weight: 600;
  animation: fadeIn 0.3s ease;
}

.search-loading-text.active {
  display: block;
}

.search-loading-text::before {
  content: '⬇️ ';
  display: inline-block;
  animation: bounceDown 1s ease-in-out infinite;
  margin-right: 0.25rem;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
input[type='text']::placeholder {
  color: var(--text-light);
  opacity: 1;
  font-size: 1rem;

  @keyframes slideDown {
  0% {
    opacity: 0;
    transform: translateY(-12px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* === MAP SMART MOBILE SPACING === */
@media (max-width: 640px) {
  #map-smart {
    margin-bottom: 20px !important;
  }
}



}
/* Autocomplete */
/* === Autocomplétion classique === */
#gare-list {
  position: absolute;
  left: 0;
  top: 105%;
  width: 100%;
  background: #fff;
  border: 2px solid var(--primary-color);
  border-top: none;
  z-index: 50;
  max-height: 250px;
  overflow-y: auto;
  border-radius: 0 0 var(--border-radius-sm) var(--border-radius-sm);
  box-shadow: var(--shadow-strong);
  animation: slideDown .19s ease;
}

#gare-list div {
  padding: 1rem 1.2rem;
  cursor: pointer;
  color: var(--primary-color);
  font-size: 1.03rem;
  border-bottom: 1px solid #f0f2f9;
  background: #fff;
  transition: background .17s, color .17s;
}

#gare-list div:hover {
  background: #f0f4ff;
  color: #1b5ebc;
}


/* BUTTON */
#searchBtn {
  display: flex;
  align-items: center;
  gap: 0.5em;
  background: linear-gradient(
    90deg,
    var(--primary-color),
    var(--secondary-color) 80%
  );
  color: #fff;
  border: none;
  padding: 1.08rem 2.7rem;
  font-size: 1.08rem;
  font-weight: 900;
  border-radius: var(--border-radius-sm);
  cursor: pointer;
  box-shadow: var(--shadow-light);
  transition: background 0.19s, box-shadow 0.18s, transform 0.13s;
  text-transform: uppercase;
  letter-spacing: 1px;
}
#searchBtn:hover {
  background: linear-gradient(
    90deg,
    var(--secondary-color),
    var(--primary-color)
  );
  transform: translateY(-1px) scale(1.03);
  box-shadow: var(--shadow-strong);
}
#searchBtn:active {
  transform: scale(0.98);
}
/* Résumé recherche */
#search-summary {
  text-align: center;
  margin-top: 18px;
  margin-bottom: 10px;
  font-weight: 700;
  color: var(--primary-color);
  font-size: 1.14rem;
  letter-spacing: 0.01em;
}
/* RESULTATS + MAP */
.container-flex {
  display: flex;
  gap: 2.2rem;
  align-items: flex-start;
  margin-top: 2.7rem;
  flex-wrap: wrap;
}
.results {
  flex: 1 1 390px;
  min-width: 350px;
  max-width: 900px;
  background: var(--background-light);
  border-radius: var(--border-radius);
  padding: 2.2rem;
  box-shadow: var(--shadow-strong);
  border: 1px solid var(--border-color);
  animation: fadeInUp 0.4s;
  min-height: 450px;
  max-height: 600px;
  overflow-y: auto;
}
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.results h3 {
  font-size: 1.23rem;
  font-weight: 900;
  margin-bottom: 1.2rem;
  padding-bottom: 0.7rem;
  border-bottom: 2px solid #eaf3ff;
  color: var(--primary-color);
  letter-spacing: 0.01em;
}
.results ul {
  list-style: none;
}
.results > ul > li {
  margin-bottom: 1.05rem;
  background: #f3f8ff;
  padding: 1.14rem 1rem;
  border-radius: var(--border-radius-sm);
  border-left: 5px solid var(--primary-color);
  box-shadow: var(--shadow-light);
  transition: all 0.19s;
}
.results > ul > li:hover {
  box-shadow: 0 4px 18px #2381f72a;
  background: #e7f1ff;
  transform: translateX(3px) scale(1.013);
}
.results > ul > li > b {
  font-size: 1.08rem;
  color: var(--primary-color);
  margin-bottom: 0.6rem;
  display: block;
}
.results ul ul {
  margin-top: 0.45rem;
}
.results ul ul li {
  background: #fff;
  margin-bottom: 0.55rem;
  padding: 0.92rem 0.95rem 0.86rem 0.95rem;
  border-radius: var(--border-radius-sm);
  border: 1.4px solid #ddeafc;
  font-size: 0.99rem;
  transition: all 0.18s;
}
.results ul ul li:hover {
  border-color: var(--primary-color);
  background: #f3f8ff;
}
.results ul ul li b {
  color: var(--primary-color);
}
.results hr {
  border: none;
  height: 1px;
  background: linear-gradient(90deg, transparent, #eaf3ff, transparent);
  margin: 1rem 0 1.1rem 0;
}
.results:empty:before {
  content: 'Sélectionnez une gare et une date pour commencer votre recherche';
  color: var(--text-light);
  font-style: italic;
  display: block;
  text-align: center;
  padding: 3rem 1rem;
}
#map {
  flex: 1 1 400px;
  min-width: 340px;
  height: 600px;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-strong);
  border: 1.5px solid var(--border-color);
  overflow: hidden;
  animation: fadeInUp 0.6s 0.12s both;
}
/* FOOTER */
footer {
  max-width: 1240px;
  margin: 2.7rem auto 0 auto;
  padding: 2.1rem 1rem;
  border-radius: var(--border-radius);
  background: #fff;
  box-shadow: var(--shadow-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 1.07rem;
  color: var(--text-light);
  gap: 1rem;
}
.footer-link {
  color: var(--primary-color);
  margin-left: 2rem;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.13s;
}
.footer-link:hover {
  color: var(--secondary-color);
  text-decoration: underline;
}
/* RESPONSIVE */


@media (max-width: 1050px) {
  .main-container,
  footer,
  .header-main {
    max-width: 98vw;
  }
  .container-flex {
    flex-direction: column;
    gap: 2rem;
  }
  #map,
  .results {
    min-width: 0;
    width: 100%;
    max-width: none;
  }
  #map,
  .results {
    max-height: 420px;
  }
  #map {
    height: 420px;
  }
}
@media (max-width: 600px) {
  /* Dézoome général pour mobile avec débordements */
  html {
    font-size: 11px; /* Dézoome fort pour plus d'espace */
  }
  
  body {
    zoom: 0.8; /* Dézoome encore plus */
    margin: 0;
    padding: 0 8px; /* Petites marges latérales */
  }
  
  .header-main {
    max-width: 100%;
    padding: 0.6rem 0.5rem;
    margin: 0;
    border-radius: 0 0 16px 16px;
  }
  
  .form-fields {
    padding: 0 12px;
  }
  
  .main-container {
    max-width: 100%;
    padding: 0.6rem;
    margin: 0;
  }
  
  footer,
  .header-main {
    padding: 0.6rem;
  }
  
  .results,
  .search-form {
    padding: 0.6rem;
  }
  
  h1.main-title {
    font-size: 1.2rem;
    margin: 0.5rem auto 0.8rem;
  }
  
  #map,
  .results {
    max-height: 380px;
    margin-left: 10%;
    margin-right: 10%;
    width: 80%;
    box-sizing: border-box;
  }
  
  #map {
    height: 380px;
  }
  
  /* Marges pour les cartes et résultats des autres modes sur mobile */
  #map-reverse,
  #map-smart,
  #map-giga,
  #results.smart-fullwidth,
  .giga-results-section {
    margin-left: 10% !important;
    margin-right: 10% !important;
    width: 80% !important;
    box-sizing: border-box;
  }
  
  .logo-img-main {
    width: 100px;
    height: 100px;
  }
}
/* Scrollbar for autocomplete */
#gare-list::-webkit-scrollbar {
  width: 7px;
}
#gare-list::-webkit-scrollbar-track {
  background: #e3f0ff;
}
#gare-list::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 4px;
}

/* --- Correction du footer mobile --- */
footer {
  max-width: 1240px;
  margin: 2.7rem auto 0 auto;
  padding: 2.1rem 1rem;
  border-radius: var(--border-radius);
  background: #fff;
  box-shadow: var(--shadow-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 1.07rem;
  color: var(--text-light);
  gap: 1rem;
  flex-wrap: wrap;
  box-sizing: border-box;
}

.footer-link {
  color: var(--primary-color);
  margin-left: 2rem;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.13s;
  word-break: break-word;
}

.footer-link:first-child {
  margin-left: 0;
}

/* RESPONSIVE FOOTER propre et liens bien alignés */
@media (max-width: 600px) {
  footer {
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    padding: 1.2rem 1.2rem 1.4rem 1.2rem;
    gap: 0.5rem;
  }
  .footer-link {
    margin-left: 0;
    margin-right: 1.2rem;
    font-size: 1.08rem;
    display: inline-block;
    margin-top: 0.5rem;
  }
  footer > span:last-child {
    width: 100%;
    display: flex;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 0.5rem 1.5rem;
    margin-top: 0.5rem;
  }
}

/* --- Correction du débordement de la liste de résultats --- */
.container-flex,
.results,
#map {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
}

@media (max-width: 1050px) {
  .container-flex {
    flex-direction: column;
    gap: 2rem;
    width: 100%;
    box-sizing: border-box;
    margin: 0 auto;
    padding: 0;
  }
  .results,
  #map {
    min-width: 0;
    width: 100%;
    max-width: none;
    margin: 0;
    border-radius: 18px !important;
    box-sizing: border-box;
  }
}

/* Pour s'assurer qu'aucune div ne dépasse */
.results {
  overflow-x: auto;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}

@media (max-width: 600px) {
  .results,
  #map {
    max-height: 320px;
    border-radius: 15px !important;
    padding-left: 0.3rem;
    padding-right: 0.3rem;
    margin-left: 10%;
    margin-right: 10%;
    width: 80%;
    box-sizing: border-box;
  }
  
  /* Forcer le paywall à respecter les marges du conteneur sur mobile */
  .results .premium-blur-overlay {
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  .results .premium-blur-content {
    max-width: 90% !important;
    margin: 0 auto !important;
    padding: 1rem !important;
    box-sizing: border-box !important;
  }
  
  .results .premium-content-wrapper {
    width: 100% !important;
    box-sizing: border-box !important;
  }
}


@media (max-width: 600px) {
  .results > ul > li {
    margin-left: -0.8rem !important; /* Colle vraiment à gauche */
    padding-left: 0 !important;
    width: calc(100% + 0.8rem) !important;
    box-sizing: border-box;
    /* Si tu veux encore plus collé, augmente la valeur négative */
    
  }
}

@media (max-width: 800px) {
  .container-flex {
    flex-direction: column !important;
  }
  #map {
    order: 1 !important;
  }
  .results {
    order: 2 !important;
  }
}

