/* ==========================================================================
   WP ROOT – plein écran
========================================================================== */
#fret-emissions-root {
  width: 100vw !important;
  margin-left: calc(50% - 50vw);
  padding: 0 1rem;
  box-sizing: border-box;
  font-family: "Inter", "Segoe UI", sans-serif;
}

/* ==========================================================================
   PAGE GLOBALE
========================================================================== */
#co2-page {
  display: flex;
  flex-direction: column;
  gap: 3rem;
  width: 100%;
}

/* ==========================================================================
   ZONE DU HAUT (MAP + FORM)
========================================================================== */
.co2-top {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 2rem;
  width: 100%;
}

/* ==========================================================================
   MAP
========================================================================== */
.co2-map-wrapper {
  flex: 3; /* 60% */
  height: 780px;
  background: #f1f5f9;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 80, 130, 0.15);
  border: 1px solid rgba(0, 115, 170, 0.20);
}

.leaflet-container {
  height: 100% !important;
}

/* ==========================================================================
   FORMULAIRE
========================================================================== */
.co2-form-wrapper {
  flex: 2; /* 40% */
  padding: 2rem;
  border-radius: 20px;
  box-shadow: 0 10px 40px rgba(0, 80, 130, 0.12);
  background: #fff;
  border: 1px solid rgba(0, 115, 170, 0.15);
  font-size: 0.85rem;
}

/* Sections */
.section {
  margin-bottom: 2rem;
}

.section h2 {
  font-size: 1.15rem;
  font-weight: 700;
  color: #004c91;
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

/* Group box */
.group-box {
  background: #fff;
  border: 1.5px solid #d1d9e0;
  border-radius: 14px;
  padding: 1.4rem 1.6rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

/* Champs */
.field {
  margin-bottom: 1.2rem;
}

.field label {
  font-weight: 600;
  color: #0f172a;
  margin-bottom: 0.35rem;
  display: block;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1.6px solid #d1d9e0;
  border-radius: 10px;
  padding: 0.7rem 0.95rem;
  background: #f9fafb;
  font-size: 0.95rem;
  transition: 0.2s ease;
}

/* Focus */
.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: #0073aa;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(0,115,170,0.15);
  outline: none;
}

/* Grille */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1.2rem;
}

/* Submit */
.co2-submit-btn {
  width: 100%;
  padding: 0.9rem 1.5rem;
  font-size: 1rem;
  font-weight: 700;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(90deg, #0073aa, #00b7ff);
  transition: all 0.25s ease;
}

.co2-submit-btn:hover {
  transform: translateY(-2px);
  background: linear-gradient(90deg, #005c85, #009adf);
  box-shadow: 0 6px 18px rgba(0,115,170,0.25);
}

/* ==========================================================================
   RÉSULTATS — en dessous, 100% largeur
========================================================================== */
/* ===============================
      SECTION RÉSULTATS
=================================*/

.co2-results-wrapper {
  animation: fadein 0.25s ease;
  font-size: 0.85rem !important;
  line-height: 1.35rem;
}

/* TITRE SECTIONS */
.result-subtitle,
.result-title-2 {
  font-size: 1rem !important;      
  margin-bottom: 0.6rem;
  font-weight: 700;
  color: #004c91;
  margin-bottom: 1rem;
}

/* Lignes du résumé global */
.result-global {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.5rem 0;
}

.result-item {
  text-align: center;
  flex: 1;
}

.result-item strong {
  font-size: 1.2rem;
  color: #004b7d;
  display: block;
}

.result-item span {
  font-size: 0.85rem;
  opacity: 0.7;
}

/* TITRE SEGMENT */
.segment-title {
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 0.6rem;
}
/* Réduction du gros titre "ÉMISSION TOTALE DE CO₂" */
.co2-results-wrapper h3 {
  font-size: 1.05rem !important;
}

/* Réduction chiffres du résumé */
.result-item strong {
  font-size: 1.1rem !important;
}

/* Placeholder */
.segment-placeholder {
  font-style: italic;
  color: #6b7280;
}

/* Animation smooth */
@keyframes fadein {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}


/* ------------------------------ */
/* LÉGENDE LEAFLET CUSTOM         */
/* ------------------------------ */
.fret-legend {
  background: #fff;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,0.25);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  font-size: 13px;
  line-height: 1.4;
  color: #0f172a;
  width: 180px;
}

.legend-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend-line {
  width: 28px;
  height: 4px;
  border-radius: 4px;
  display: inline-block;
}

.legend-line.maritime {
  background: #0066cc;
}

.legend-line.road {
  background: #ff6600;
}

.legend-icons {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
}

.legend-dot.start {
  background: #2ecc71;
}

.legend-dot.end {
  background: #e74c3c;
}

.legend-icon {
  width: 14px;
  height: 14px;
}


/* ==========================================================================
   RESPONSIVE
========================================================================== */
@media (max-width: 1024px) {
  .co2-top {
    flex-direction: column;
  }

  .co2-map-wrapper {
    height: 420px;
  }
}

/* Partie autocomplete ports */

.address-autocomplete {
  position: relative;
  width: 100%;
}

.suggestions-box {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #ffffff;
  border-radius: 10px;
  border: 1.6px solid #d1d9e0;
  box-shadow: 0 6px 20px rgba(0,0,0,0.08);
  max-height: 200px;
  overflow-y: auto;
  z-index: 9999;
  animation: fadein 0.15s ease;
}

.suggestion {
  padding: 0.7rem 0.95rem;
  font-size: 0.9rem;
  cursor: pointer;
  border-bottom: 1px solid #f1f5f9;
  color: #0f172a;
}

.suggestion:last-child {
  border-bottom: none;
}

.suggestion:hover,
.suggestion.active {
  background: #e7f4ff;
}

.suggestions-box::-webkit-scrollbar {
  width: 6px;
}

.suggestions-box::-webkit-scrollbar-thumb {
  background: #c2ceda;
  border-radius: 8px;
}

.suggestion-loading {
  opacity: 0.6;
}


/* ===============================
   VALIDATION FORMULAIRE
=============================== */

.field.error input,
.field.error select {
  border-color: #e53935;
  background: #fff5f5;
}

.error-text {
  color: #e53935;
  font-size: 0.8rem;
  margin-top: 0.25rem;
  font-weight: 500;
}