* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Nunito sans", sans-serif;
  min-height: 100vh;
  overflow: hidden;
}

#map {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 100%;
}

.stop-selector {
  width: 100%;
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 5px;
  background-color: #f9f9f9;
  font-size: 14px;
  color: #333;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: border-color 0.3s, box-shadow 0.3s;
}

.stop-selector:focus {
  border-color: #007bff;
  box-shadow: 0 0 5px rgba(0, 123, 255, 0.5);
  outline: none;
}

#tools {
  position: absolute;
  z-index: 999;
  background-color: #ffff;
  box-shadow: 4px 4px 10px 0px #00000026;
  padding: 15px;
  margin: 15px;
  border-radius: 10px;
  overflow: auto;
  max-height: 95vh;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

#recaptcha {
  align-self: center;
}

.mapboxgl-popup-content {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  font-family: 'Nunito sans', sans-serif;
}

.mapboxgl-popup-content h3,
.mapboxgl-popup-content p {
  margin: 5px;
  text-align: center;
}

.mapboxgl-popup-content .popup-btn {

  padding: 10px 20px;
  font-size: 14px;
  font-weight: bold;
  color: #fff;
  background: #514FBA;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: backgr
}


.form-header {
  text-align: center;
  margin-bottom: 32px;
}

.form-header h1 {
  font-size: 28px;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 8px;
  background: #514FBA;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.form-header p {
  color: #6b7280;
  font-size: 16px;
  font-weight: 400;
}

.form-section {
  margin-bottom: 28px;
  transform: translateY(20px);
  animation: slideIn 0.5s ease forwards;
}

#aller-retour {
  display: none;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 18px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 20px;
}


.section-icon {
  width: 24px;
  height: 24px;
  background: #514FBA;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 12px;
}


.input-group {
  margin-bottom: 20px;
}

.input-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  margin-bottom: 16px;
}

.input-wrapper {
  position: relative;
}

.input-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: #374151;
  margin-bottom: 8px;
}

.input-field {
  width: 100%;
  padding: 16px 20px;
  font-size: 16px;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  background: white;
  transition: all 0.3s ease;
  font-family: inherit;
}

.input-field:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
  transform: translateY(-1px);
}

.input-field:hover {
  border-color: #d1d5db;
}

.select-field {
  appearance: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 16px center;
  background-repeat: no-repeat;
  background-size: 16px;
  padding-right: 48px;
}

.input-with-icon {
  position: relative;
}

.input-with-icon .input-icon {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(30%);
  color: #9ca3af;
  font-size: 16px;
  pointer-events: none;
}

.input-with-icon .input-field {
  padding-left: 52px;
}

.date-picker {
  position: relative;
}

.date-picker::after {
  content: '\f073';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  color: #9ca3af;
  pointer-events: none;
}


.journey-card {
  background: linear-gradient(135deg, #f8fafc, #e2e8f0);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 20px;
  border: 2px solid transparent;
  transition: all 0.3s ease;
}

.journey-card:hover {
  border-color: #667eea;
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(102, 126, 234, 0.1);
}

.journey-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.journey-type {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: #374151;
}

.route-visual {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
}

.route-point {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #667eea;
}

.route-point.departure {
  background: #10b981;
}

.route-point.arrival {
  background: #ef4444;
}


.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.contact-grid.full-width {
  grid-template-columns: 1fr;
}

.textarea-field {
  min-height: 100px;
  resize: vertical;
}

.form-actions {
  display: flex;
  gap: 16px;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid #e5e7eb;
}

.btn {
  flex: 1;
  padding: 16px 24px;
  font-size: 16px;
  font-weight: 600;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.btn-secondary {
  background: #f3f4f6;
  color: #374151;
  border: 2px solid #e5e7eb;
}

.btn-secondary:hover {
  background: #e5e7eb;
  transform: translateY(-2px);
}

.btn-primary {
  background: #514FBA;
  color: white;
  box-shadow: 0 4px 15px rgba(81, 79, 186, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(81, 79, 186, 0.4);
}

.btn-primary:active {
  transform: translateY(0);
}

.progress-bar {
  height: 4px;
  background: #e5e7eb;
  border-radius: 2px;
  margin-bottom: 24px;
  overflow: hidden;
}

.hidden {
  display: none;
}

.select-heure {
  width: fit-content;
}

@media (max-width: 768px) {
  #tools {
    left: 15px;
    right: 15px;
    width: auto;
    top: 20px;
    margin: 0;
    transform: none;
    max-height: calc(100vh - 40px - 63px);
  }

  #tools:hover {
    transform: none;
  }

  .input-row,
  .contact-grid {
    grid-template-columns: 1fr;
  }

  .form-actions {
    flex-direction: column;
  }
}

/* Custom Scrollbar */
#tools::-webkit-scrollbar {
  width: 6px;
}

#tools::-webkit-scrollbar-track {
  background: transparent;
}

#tools::-webkit-scrollbar-thumb {
  background: rgba(102, 126, 234, 0.3);
  border-radius: 3px;
}

#tools::-webkit-scrollbar-thumb:hover {
  background: rgba(102, 126, 234, 0.5);
}

/* Loading Animation */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid #f3f3f3;
  border-top: 2px solid #667eea;
  border-radius: 50%;
}

.return-toggle {
  text-align: center;
  margin: 20px 0;
}

.return-btn {
  background: #02B095;
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.return-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(2, 176, 149, 0.3);
}

.return-btn.active {
  background: #FFAB00;
}

.return-card {
  border: 2px solid #02B095;
  background: linear-gradient(135deg, #ecfdf5, #d1fae5);
  animation: slideDown 0.3s ease;
}

.remove-btn {
  background: #FF3F37;
  color: white;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  transition: all 0.3s ease;
}

.remove-btn:hover {
  background: #dc2626;
  transform: scale(1.1);
}

.input-field:disabled,
.select-field:disabled {
  background: #f3f4f6 !important;
  /* gris clair */
  color: #b0b3b8 !important;
  /* texte gris */
  border-color: #d1d5db !important;
  /* bordure grise */
  cursor: not-allowed !important;
  opacity: 1 !important;
  /* pour garder le texte lisible */
}

/* Loader Styles */
.loader-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #514FBA;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loader-container.hidden {
  opacity: 0;
  visibility: hidden;
}

.loader {
  width: 60px;
  height: 60px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top: 4px solid white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 24px;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

.loader-text {
  color: white;
  font-size: 18px;
  font-weight: 500;
  margin-bottom: 8px;
}

.loader-subtext {
  color: rgba(255, 255, 255, 0.8);
  font-size: 14px;
  text-align: center;
}

.loader-progress {
  width: 200px;
  height: 4px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 2px;
  margin-top: 16px;
  overflow: hidden;
}

.loader-progress-fill {
  height: 100%;
  background: white;
  border-radius: 2px;
  width: 0%;
  transition: width 0.3s ease;
}

.select-heure {
  width: auto;
  min-width: 90px;
  max-width: 140px;
}

.switch-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: white;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  transition: all 0.3s ease;
}

.switch-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  color: #374151;
}

.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 26px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: .4s;
  border-radius: 26px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

input:checked+.slider {
  background-color: #667eea;
}

input:checked+.slider:before {
  transform: translateX(24px);
}

.checkbox-container {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 20px;
  background: white;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  transition: all 0.3s ease;
  cursor: pointer;
}

.checkbox-container:hover {
  border-color: #d1d5db;
}

.checkbox-container:has(.checkbox-field:checked) {
  border-color: #667eea;
  background: #f0f4ff;
}

.checkbox-field {
  width: 18px;
  height: 18px;
  accent-color: #667eea;
  cursor: pointer;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
  color: #374151;
  cursor: pointer;
  margin: 0;
}

.checkbox-label i {
  color: #667eea;
  font-size: 16px;
}

#popup-background {
  display: none;
  z-index: 999;
  position: absolute;
  width: 100vw;
  height: 100vh;
  backdrop-filter: blur(10px);
}

#popup {
  background-color: white;
  width: fit-content;
  margin: auto;
  padding: 10px 25px;
  border-radius: 25px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  align-self: center;
}