/* ========= Transpo'Vélo — FRONT (simulateur) ========= */
:root{
  --tvelo-primary:#ff9703;
  --tvelo-bg:#fff;
  --tvelo-text:#1a1a1a;
  --tvelo-muted:#6b7280;
  --tvelo-border:#e5e7eb;
  --tvelo-card:#ffffff;
  --tvelo-shadow:0 6px 16px rgba(0,0,0,.07);
}

.tvelo{color:var(--tvelo-text);font-size:16px;line-height:1.5}
.tvelo *{box-sizing:border-box}

.tvelo-header{margin-bottom:1rem}
.tvelo-header h2{margin:0 0 .25rem;font-size:1.5rem}
.tvelo-sub{margin:0;color:var(--tvelo-muted)}

.tvelo-form{margin-top:.5rem}
.tvelo-grid{display:grid;gap:1rem}
@media (min-width: 800px){
  .tvelo-grid{grid-template-columns:1fr 1fr}
}

.tvelo-card{
  background:var(--tvelo-card);
  border:1px solid var(--tvelo-border);
  border-radius:12px;
  padding:1rem;
  box-shadow:var(--tvelo-shadow);
}
.tvelo-card legend{
  background-color:var(--tvelo-primary);
  border:1px solid var(--tvelo-primary);
  border-radius:6px;
  font-weight:700;
  padding:.25rem .25rem;
  color:var(--tvelo-text);
}

.tvelo-field{margin:.75rem 0}
.tvelo-inline{display:grid;gap:.75rem}
@media (min-width: 520px){
  .tvelo-inline{grid-template-columns:1fr 1fr}
}
.tvelo-col{}

.tvelo-field label{display:block;font-weight:600;margin-bottom:.25rem}
.tvelo-field input[type="text"],
.tvelo-field input[type="number"],
.tvelo-field input[type="date"],
.tvelo-field input[type="tel"],
.tvelo-field select{
  width:100%;
  background:#fff;
  border:1px solid var(--tvelo-border);
  border-radius:10px;
  padding:.65rem .8rem;
  outline:none;
  transition:border-color .15s ease, box-shadow .15s ease;
  font-size:1rem;
}
.tvelo-field input:focus,
.tvelo-field select:focus{
  border-color:var(--tvelo-primary);
  box-shadow:0 0 0 3px rgba(255,151,3,.2);
}

/* Harmoniser la hauteur des champs input et select */
.tvelo-field select,
.tvelo-field input[type="text"],
.tvelo-field input[type="number"],
.tvelo-field input[type="email"],
.tvelo-field input[type="tel"],
.tvelo-field input[type="date"]{
  display:block;
  width:100%;
  padding:.5rem .6rem;
  font-size:1rem;
  line-height:1.4;
  border:1px solid var(--tvelo-border);
  border-radius:8px;
  background:#fff;
  height:42px; /* hauteur fixe harmonisée */
  box-sizing:border-box;
}

.tvelo-field select:focus,
.tvelo-field input:focus{
  outline:3px solid rgba(255,151,3,.25);
  outline-offset:2px;
  border-color:var(--tvelo-primary);
}

/* Textarea harmonisé */
.tvelo-field textarea{
  width:100%;
  min-height:120px;
  padding:.6rem .7rem;
  font-size:1rem;
  line-height:1.4;
  border:1px solid var(--tvelo-border);
  border-radius:8px;
  background:#fff;
  box-sizing:border-box;
  resize:vertical;
}

/* Petites grilles pour infos collecte */
@media (min-width: 720px){
  /* les champs marqués "span 3" prennent 3 colonnes quand on est en 4-col */
  .tvelo-grid > .tvelo-field[style*="grid-column: span 3"]{ grid-column: span 3 !important; }
}


.tvelo-help{
  display:block;
  margin-top:.25rem;
  color:var(--tvelo-muted);
  font-size:.9rem;
}

.tvelo-actions{
  display:flex;
  align-items:center;
  gap:1rem;
  margin-top:1rem;
  flex-wrap:wrap;
}

.tvelo-actions-inline { margin-top:.5rem }

.tvelo-btn{
  appearance:none;
  border:none;
  border-radius:999px;
  background:var(--tvelo-primary);
  color:#111;
  font-weight:700;
  padding:.7rem 1.1rem;
  cursor:pointer;
  box-shadow:var(--tvelo-shadow);
}
.tvelo-btn:hover{filter:brightness(.97)}
.tvelo-mandatory{margin:0;color:var(--tvelo-muted);font-size:.95rem}

.tvelo-results {
  margin-top: 1.25rem;
  padding:.65rem 1rem;
}
.tvelo-results.is-hidden { display: none !important; }


@media (min-width: 700px){
  .tvelo-results{grid-template-columns:1fr 1fr}
}

.tvelo-subline { margin-top: .25rem; font-size: .9375rem; opacity: .85; }
.tvelo-sep { margin: 0 .4rem; }

/* Les articles prennent le style des cartes */
.tvelo-plan {
  background: var(--tvelo-card);
  border: 1px solid var(--tvelo-border);
  border-radius: 14px;
  padding: 1rem;
  box-shadow: var(--tvelo-shadow);
}

.tvelo-plan header{
  display:flex;
  align-items:center;
  gap:.5rem;
  margin-bottom:.5rem;
}
.tvelo-badge{
  display:inline-block;
  padding:.2rem .5rem;
  border-radius:999px;
  font-weight:800;
  font-size:.8rem;
  letter-spacing:.02em;
  border:1px solid var(--tvelo-border);
  background:#f8fafc;
  color:#111;
}
.tvelo-badge-eco{background:#f1f9f1;border-color:#d9f0d9}
.tvelo-badge-premium{background:#f4f2ff;border-color:#e5e0ff}
.tvelo-plan h3{margin:0;font-size:1.1rem}
.tvelo-price{font-size:2rem;font-weight:800;margin:.25rem 0}
.tvelo-note{margin:0;color:var(--tvelo-muted)}

.tvelo-placeholder{opacity:.75;font-style:italic}

/* ===== Wizard (réservation) ===== */
/* ===== Overlay "sablier" (loader) ===== */
.tvelo-wizard {
  position: relative; /* pour positionner l’overlay */
}

.tvelo-loader {
  position: absolute;
  inset: 0;
  display: none; /* par défaut */
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,.6);
  backdrop-filter: blur(2px);
  z-index: 50;
}

.tvelo-wizard.tvelo-is-loading .tvelo-loader {
  display: flex;
}

.tvelo-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(0,0,0,.15);
  border-top-color: var(--tvelo-primary, #ff9703);
  border-radius: 50%;
  animation: tvelo-spin 0.8s linear infinite;
}

@keyframes tvelo-spin {
  to { transform: rotate(360deg); }
}


.tvelo-steps{
  list-style:none;margin:0 0 1rem;padding:0;
  display:flex;flex-wrap:wrap;gap:.5rem 1rem;
  position: relative;
  overflow: hidden; /* masque le glissement */
/*  min-height: 200px; /* évite les sauts de layout pendant l’anim */
}
.tvelo-steps li{
  display:flex;align-items:center;gap:.5rem;
  color:var(--tvelo-muted);
}
.tvelo-steps .tvelo-step-index{
  display:inline-flex;align-items:center;justify-content:center;
  width:28px;height:28px;border-radius:999px;
  background:#f3f4f6;border:1px solid var(--tvelo-border);font-weight:700;
}
.tvelo-steps li.is-active,
.tvelo-steps li[aria-selected="true"]{
  color:var(--tvelo-text);
}
.tvelo-steps li.is-active .tvelo-step-index{
  background:var(--tvelo-primary);color:#111;border-color:var(--tvelo-primary);
}

.tvelo-steps-panels{
	position:relative;
    overflow:hidden;           /* masque le glissement */
/*    min-height: 200px;         /* évite le saut de layout pendant l’anim */
}
.tvelo-step-panel{
  display:none;
  transition: transform .28s ease, opacity .28s ease;
  will-change: transform, opacity;
}
.tvelo-step-panel.is-active{display:block}
.tvelo-step-panel.is-animating{
  position:absolute; inset:0;
}

.tvelo-wizard-nav{
  display:flex;align-items:center;gap:.5rem;margin-top:1rem;
}
.tvelo-wizard-spacer{flex:1}
.tvelo-btn-secondary{
  background:#f3f4f6;color:#111;border:1px solid var(--tvelo-border);
}
.tvelo-btn-primary{
  background:var(--tvelo-primary);color:#111;
}

/* Summary box */
.tvelo-summary h3{margin:.25rem 0 0}

/* Champs fixes (lecture seule) */
.tvelo-input-fixed[readonly]{
  background:#f3f4f6;
  color:#4b5563;
  border-color:var(--tvelo-border);
  cursor:not-allowed;
}



/* ====== Étape 1 — Itinéraire ====== */

/* Grille 2 colonnes pour Pays / CP de départ */
.tvelo-inline-2{
  display:grid;
  gap:.75rem;
  grid-template-columns: 1fr; /* mobile */
}
@media (min-width: 800px){
  .tvelo-inline-2{
    grid-template-columns: 180px 160px; /* Pays étroit + CP */
  }
}


/* Grille 3 colonnes pour Pays / CP / Localité */
.tvelo-inline-3{
  display:grid;
  gap:.75rem;
}
.tvelo-inline-3 .tvelo-col{
  min-width:0;
}
@media (min-width: 800px){
  .tvelo-inline-3{
    grid-template-columns: 180px 160px 1fr; /* Pays + CP petits, Localité prend le reste  */
  }
}





/* ====== Étape 2 — Cards choix service ====== */
.tvelo-legend-like{
  display:inline-block;font-weight:700;margin-bottom:.25rem;
}
.tvelo-required{color:#b91c1c;margin-left:.25rem}

.tvelo-choice-grid{
  display:grid;
  gap:1rem;
  margin-top:.5rem;
}
@media (min-width: 700px){
  .tvelo-choice-grid{
    grid-template-columns: 1fr 1fr; /* côte à côte sur PC */
  }
}

.tvelo-choice-card{
  position:relative;
  display:block;
  cursor:pointer;
  border:1px solid var(--tvelo-border);
  border-radius:14px;
  background:var(--tvelo-card);
  box-shadow:var(--tvelo-shadow);
  transition:box-shadow .15s ease, border-color .15s ease, transform .04s ease;
  padding:.75rem .9rem;
}
.tvelo-choice-card:hover{ box-shadow:0 8px 20px rgba(0,0,0,.08); }
.tvelo-choice-card:active{ transform:scale(.998); }

.tvelo-choice-card input[type="radio"]{
  position:absolute;
  opacity:0;
  pointer-events:none;
}

.tvelo-choice-body{ display:flex; flex-direction:column; gap:.35rem; }
.tvelo-choice-head{
  display:flex; align-items:center; justify-content:space-between;
}
.tvelo-logo{ opacity:.8 }

/* Logos dans les cards service (ECO/PREMIUM) */
.tvelo-logo-img{
  display:block;
  max-height:24px; /* taille adaptable plus tard si besoin */
  width:auto;
  object-fit:contain;
  opacity:.9;
}


.tvelo-choice-title{ margin:.1rem 0 0; font-size:1.1rem; }
.tvelo-choice-text{ margin:.2rem 0 0; color:var(--tvelo-muted); }

.tvelo-choice-card input[type="radio"]:focus + .tvelo-choice-body,
.tvelo-choice-card:has(input[type="radio"]:focus){
  outline:3px solid rgba(255,151,3,.25);
  outline-offset:2px;
}

.tvelo-choice-card input[type="radio"]:checked + .tvelo-choice-body,
.tvelo-choice-card:has(input[type="radio"]:checked){
  border-color: var(--tvelo-primary);
  box-shadow: 0 0 0 3px rgba(255,151,3,.18), var(--tvelo-shadow);
}

/* État visuel forcé par le JS (équivalent de :has(input:checked)) */
.tvelo-choice-card.is-selected{
  border-color: var(--tvelo-primary);
  box-shadow: 0 0 0 3px rgba(255,151,3,.18), var(--tvelo-shadow);
}


/* ===== Répétition de colis (ECO) ===== */
.tvelo-repeater{ margin-top:.25rem; }
.tvelo-repeater .tvelo-repeater-actions{
  display:flex; align-items:center; gap:.75rem; margin-top:.5rem;
}

.tvelo-parcels{ display:grid; gap:1rem; }
.tvelo-parcel-card{ padding:1rem; }
.tvelo-parcel-head{
  display:flex; align-items:center; justify-content:space-between; gap:.5rem; margin-bottom:.5rem;
}
.tvelo-parcel-title{ margin:0; font-size:1rem; font-weight:800; }

.tvelo-parcel-grid{
  display:grid;
  gap:.75rem;
}
@media (min-width: 640px){
  .tvelo-parcel-grid{
    grid-template-columns: repeat(4, 1fr);
  }
  .tvelo-parcel-grid > .tvelo-field[style*="grid-column:1/-1"]{
    grid-column: 1 / -1 !important;
  }
}

/* Boutons icône */
.tvelo-icon-btn{
  appearance:none; background:#f3f4f6; border:1px solid var(--tvelo-border);
  border-radius:10px; padding:.35rem .5rem; cursor:pointer;
}
.tvelo-icon-btn:hover{ filter:brightness(.98); }

/* Checkbox */
.tvelo-check{ display:flex; gap:.5rem; align-items:flex-start; }
.tvelo-check input{ margin-top:.25rem; }

/* Erreurs (feedback simple) */
.tvelo-error{
  outline:3px solid rgba(210,28,28,.18);
  outline-offset:2px;
  margin-top:20px;
}
.tvelo-error.is-hidden { display: none !important; }

/* ===== Répétition de vélos (PREMIUM) ===== */
.tvelo-bikes{ display:grid; gap:1rem; }
.tvelo-bike-card{ padding:1rem; }
.tvelo-bike-head{
  display:flex; align-items:center; justify-content:space-between; gap:.5rem; margin-bottom:.5rem;
}
.tvelo-bike-title{ margin:0; font-size:1rem; font-weight:800; }

.tvelo-bike-grid{
  display:grid; gap:.75rem;
}
@media (min-width: 720px){
  .tvelo-bike-grid{
    grid-template-columns: repeat(4, 1fr);
  }
  .tvelo-bike-grid > .tvelo-field[style*="grid-column: span 3"]{
    grid-column: span 3 !important;
  }
  .tvelo-bike-grid > .tvelo-field[style*="grid-column:1/-1"]{
    grid-column:1 / -1 !important;
  }
}


/* Alerte avertissement */
.tvelo-alert{
  border-radius:12px; padding:.75rem .9rem; margin:.25rem 0 1rem;
  border:1px solid var(--tvelo-border); background:#fff;
}
.tvelo-alert-warning{
  background:#fffbea; border-color:#fde68a; color:#92400e;
}

/* Champ grisé quand désactivé par design (readonly) */
.tvelo-input-fixed[readonly]{
  background:#f3f4f6; color:#4b5563; border-color:var(--tvelo-border); cursor:not-allowed;
}


/* ===== Grille coordonnées (PC = 3 colonnes 2fr/1fr/1fr) ===== */
.tvelo-grid-coord{
  display:grid;
  gap:.75rem;
  grid-template-columns: 1fr; /* mobile: empilé */
}
@media (min-width: 900px){
  .tvelo-grid-coord{
    grid-template-columns: 2fr 1fr 1fr; /* email large, le reste étroit */
  }
  /* utilitaires de position/étendue sur PC */
  .tvelo-grid-coord .col-1-2{ grid-column: 1 / span 2; }   /* colonnes 1-2 */
  .tvelo-grid-coord .col-2-3{ grid-column: 2 / span 2; }   /* colonnes 2-3 */
  .tvelo-grid-coord .col-1-3{ grid-column: 1 / -1; }       /* pleine largeur */
  .tvelo-grid-coord .col-3{   grid-column: 3 / span 1; }   /* colonne 3 seule */
}


/* ===== Résumé ===== */
.tvelo-summary-grid{
  display:grid; gap:1rem; margin-bottom:1rem;
}
@media (min-width: 900px){
  .tvelo-summary-grid{
    grid-template-columns: repeat(2, minmax(0, 1fr)); /* 2 cards par ligne */
  }
}

.tvelo-summary-card h4{ margin:0 0 .35rem; }
.tvelo-summary-body p{ margin:.2rem 0; }

/* Totaux */
.tvelo-totaux{ margin:1rem 0; }
.tvelo-totaux h4{ margin:0 0 .35rem; }
.tvelo-totaux-grid{ display:grid; gap:.25rem .75rem; grid-template-columns: 1fr auto; }
.tvelo-totaux-grid dt{ color:var(--tvelo-muted); }
.tvelo-totaux-grid dd{ margin:0; font-weight:800; }

/* Légal + toggles */
.tvelo-legal{ margin:1rem 0; }
.tvelo-cgdv-link{ color:blue;text-decoration: underline; }
.tvelo-radio{ display:flex; align-items:center; gap:.5rem; margin:.25rem 0; }
.tvelo-pay{ margin-top:1rem; }
.tvelo-pay-btn {width:438px; margin-left:auto; margin-right:auto;}
.tvelo-pay-logos img{ display:block; max-width:100%; height:auto; opacity:.9; }
.tvelo-pay-toggle{ margin:.5rem 0 0; }

/* Modal CGDV */
.tvelo-modal[hidden]{ display:none; }
.tvelo-modal-backdrop{
  position:fixed; inset:0; background:rgba(0,0,0,.35);
}
.tvelo-modal-dialog{
  position:fixed; inset:auto 0 0 0; margin:auto; top:10%;
  max-width:760px; width:92%; background:#fff; border-radius:12px;
  border:1px solid var(--tvelo-border); box-shadow:var(--tvelo-shadow);
}
.tvelo-modal-header, .tvelo-modal-footer{ padding:.75rem .9rem; border-bottom:1px solid var(--tvelo-border); }
.tvelo-modal-footer{ border-top:1px solid var(--tvelo-border); border-bottom:none; }
.tvelo-modal-body{ padding:.9rem; max-height:60vh; overflow:auto; }

/* Empêche la page de scroller quand la modale est ouverte */
html.tvelo-modal-open,
body.tvelo-modal-open{ overflow: hidden; }


/* ==============================
   Barre d'avancement cliquable
   ============================== */
.tvelo-steps{
  display:flex; gap:.5rem; align-items:center; list-style:none; padding:0; margin:0 0 1rem;
  counter-reset: tvelo-step;
}
.tvelo-step{
  position:relative;
  transition: transform .28s ease, opacity .28s ease;
  will-change: transform, opacity;
}
/* États pour animation (les steps non actives sont retirées du flux pendant l’anim) */
.tvelo-step.is-animating {
  position: absolute;
  inset: 0;
}

/* Entrée depuis la droite (Next) */
.tvelo-enter-from-right {
  transform: translateX(20%);
  opacity: 0;
}
.tvelo-enter-to-center {
  transform: translateX(0%);
  opacity: 1;
}

/* Sortie vers la gauche (Next) */
.tvelo-exit-to-left {
  transform: translateX(-20%);
  opacity: 0;
}

/* Entrée depuis la gauche (Back) */
.tvelo-enter-from-left {
  transform: translateX(-20%);
  opacity: 0;
}

/* Sortie vers la droite (Back) */
.tvelo-exit-to-right {
  transform: translateX(20%);
  opacity: 0;
}

/* Accessibilité : si l’utilisateur préfère réduire les animations */
@media (prefers-reduced-motion: reduce) {
  .tvelo-step-panel {
    transition: none !important;
  }
}
.tvelo-step-btn{
  display:flex; align-items:center; gap:.5rem;
  background:transparent; border:0; padding:.25rem .5rem; cursor:pointer;
}
.tvelo-step-btn:focus-visible{
  outline: 2px solid #2c6eba; outline-offset: 2px;
}

/* Pastilles numérotées */
.tvelo-step-num{
  display:inline-grid; place-items:center;
  width:2rem; height:2rem; border-radius:999px;
  background:#e5e7eb; /* gris clair */
  font-weight:600;
}
.tvelo-step[data-state="done"] .tvelo-step-num{ background:#cfe3ff; }
.tvelo-step[data-state="current"] .tvelo-step-num{ background:#2c6eba; color:#fff; }

/* Libellé : visible uniquement pour l'étape courante */
.tvelo-step-label{
  font-weight:600; white-space:nowrap;
  display:none;
}
.tvelo-step[data-state="current"] .tvelo-step-label{
  display:inline;
}

/* Tooltip au survol/focus pour les autres étapes
   Utilise l'attribut data-label comme source du contenu */
.tvelo-step:not([data-state="current"]) .tvelo-step-btn:hover::after,
.tvelo-step:not([data-state="current"]) .tvelo-step-btn:focus-visible::after{
  content: attr(data-label);
  position:absolute; left:50%; transform:translateX(-50%);
  bottom: calc(100% + .5rem);
  background:#111; color:#fff; font-size:.85rem; padding:.25rem .5rem; border-radius:.375rem;
  white-space:nowrap; pointer-events:none; z-index:10;
  box-shadow:0 6px 16px rgba(0,0,0,.2);
}
.tvelo-step:not([data-state="current"]) .tvelo-step-btn:hover::before,
.tvelo-step:not([data-state="current"]) .tvelo-step-btn:focus-visible::before{
  content:"";
  position:absolute; left:50%; transform:translateX(-50%);
  bottom: 100%;
  border:6px solid transparent; border-top-color:#111;
}

/* Connexions (optionnel, petit séparateur) */
.tvelo-step + .tvelo-step { margin-left:.25rem; }

/* Pastilles verrouillées */
.tvelo-step[data-locked="1"] .tvelo-step-btn { cursor:not-allowed; opacity:.7; }

/* Micro-animation "shake" quand on clique une pastille verrouillée */
@keyframes tvelo-shake {
  0%,100% { transform: translateX(0); }
  25% { transform: translateX(-3px); }
  75% { transform: translateX(3px); }
}
.tvelo-step.shake { animation: tvelo-shake .3s; }

.tvelo-error-msg {
  color: #dc2626;       /* rouge discret */
  font-size: 0.875rem;  /* ~14px */
  margin-top: 0.25rem;
}


.tvelo-testfill-btn{
  margin-left:.75rem;
  font-size:.75rem;
  line-height:1;
  padding:.35rem .55rem;
  border-radius:999px;
  border:1px solid var(--tvelo-border, #e5e7eb);
  background:#f9fafb;
  cursor:pointer;
  vertical-align:middle;
}
.tvelo-testfill-btn:hover{ background:#f3f4f6 }
.tvelo-step-panel legend .tvelo-testfill-btn{ position:relative; top:-1px }


.tvelo-table.tvelo-compact th,
.tvelo-table.tvelo-compact td{ padding:.35rem .5rem; }
.tvelo-table .num{ text-align:right; white-space:nowrap; }
.tvelo-items-note{ margin-top:.25rem; font-size:.85rem; color:var(--tvelo-muted,#6b7280); }


.tvelo-line-list{ display:grid; gap:.35rem; }
.tvelo-line{
  display:flex; align-items:baseline; justify-content:space-between; gap:.75rem;
  padding:.25rem 0; border-bottom:1px solid var(--tvelo-border,#e5e7eb);
}
.tvelo-line:last-child{ border-bottom:none; }
.tvelo-line-left{ min-width:0; }
.tvelo-line-right{ white-space:nowrap; text-align:right; margin-left:1rem; }
.tvelo-line-total{ font-weight:600; padding-top:.4rem; border-top:1px solid var(--tvelo-border,#e5e7eb); }
.tvelo-items-note{ margin-top:.25rem; font-size:.85rem; color:var(--tvelo-muted,#6b7280); }

.tvelo-summary-body .tvelo-addr div{ line-height:1.35; }


/* ===== Simulateur — Itinéraire: 1/3 (CP) + 2/3 (Localité) ===== */
.tvelo-inline.tvelo-inline-13-23 {
  display: grid;
  gap: .75rem;
  grid-template-columns: 1fr; /* mobile: empilé */
}
.tvelo-inline.tvelo-inline-13-23 > * { min-width: 0; } /* évite overflow */

@media (min-width: 520px){
  .tvelo-inline.tvelo-inline-13-23 {
    grid-template-columns: 1fr 2fr; /* 1/3 + 2/3 */
  }
}
