/* MC Transports – simulateur de tarifs. Tout est préfixé « mcsim » pour ne pas heurter le thème. */
.mcsim {
  --mcsim-bg: #000;
  --mcsim-field: #111;
  --mcsim-line: #333;
  --mcsim-text: #fff;
  --mcsim-muted: #b9b9b9;
  --mcsim-cyan: #008cc1;
  --mcsim-gold: #b38728;
  --mcsim-err: #ff7b7b;
  box-sizing: border-box;
  max-width: 760px;
  margin: 0 auto;
  padding: 40px;
  background: var(--mcsim-bg);
  color: var(--mcsim-text);
  border-radius: 15px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, .2);
  font-family: 'Montserrat', sans-serif;
  line-height: 1.5;
}
.mcsim--light {
  --mcsim-bg: #fff; --mcsim-field: #f5f6f7; --mcsim-line: #d8dbde; --mcsim-text: #111; --mcsim-muted: #555; --mcsim-err: #c0392b;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .12);
}
.mcsim *, .mcsim *::before, .mcsim *::after { box-sizing: border-box; }

.mcsim-head { text-align: center; margin: 0 0 25px; }
.mcsim-head h3 { margin: 0; font-size: 1.6rem; font-weight: 800; text-transform: uppercase; color: var(--mcsim-text); }
.mcsim-head p { margin: 5px 0 0; font-size: .8rem; font-weight: 700; text-transform: uppercase; color: var(--mcsim-cyan); }

.mcsim-row { display: flex; gap: 0 20px; align-items: flex-start; }
.mcsim-row > .mcsim-field { flex: 1 1 0; min-width: 0; }
.mcsim-row[hidden] { display: none; }
.mcsim-field { position: relative; margin-bottom: 15px; }
.mcsim-field label { display: block; margin: 0 0 6px; font-size: .8rem; font-weight: 700; color: var(--mcsim-text); text-align: left; }

.mcsim input[type="text"], .mcsim input[type="date"], .mcsim input[type="time"], .mcsim select {
  display: block; width: 100%; height: 48px; margin: 0; padding: 0 15px;
  background: var(--mcsim-field); color: var(--mcsim-text);
  border: 1px solid var(--mcsim-line); border-radius: 5px; box-shadow: none;
  font: inherit; font-size: .95rem;
}
.mcsim input::placeholder { color: #777; }
.mcsim input:focus, .mcsim select:focus { outline: none; border-color: var(--mcsim-cyan); }
.mcsim input[type="date"], .mcsim input[type="time"] { color-scheme: dark; }
.mcsim--light input[type="date"], .mcsim--light input[type="time"] { color-scheme: light; }
.mcsim select {
  -webkit-appearance: none; appearance: none; cursor: pointer; padding-right: 40px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path d='M1 1l5 5 5-5' fill='none' stroke='%23888' stroke-width='2'/></svg>");
  background-repeat: no-repeat; background-position: right 15px center;
}
.mcsim select option { background: var(--mcsim-field); color: var(--mcsim-text); }
.mcsim select option:disabled { color: #777; }

/* Inversion départ / arrivée */
.mcsim-swap {
  flex: 0 0 auto; align-self: flex-start; margin-top: 29px; width: 40px; height: 48px; padding: 0;
  background: transparent; color: var(--mcsim-cyan); border: 1px solid var(--mcsim-line); border-radius: 5px;
  font-size: 1.2rem; cursor: pointer; transition: .2s;
}
.mcsim-swap:hover { background: var(--mcsim-cyan); color: #fff; border-color: var(--mcsim-cyan); }
.mcsim-row:first-child { gap: 0 10px; }

/* Suggestions */
.mcsim-list {
  position: absolute; z-index: 20; left: 0; right: 0; top: 100%; margin: -10px 0 0; padding: 4px 0;
  list-style: none; max-height: 280px; overflow-y: auto;
  background: var(--mcsim-field); border: 1px solid var(--mcsim-cyan); border-radius: 5px; box-shadow: 0 12px 30px rgba(0, 0, 0, .35);
}
.mcsim-list[hidden] { display: none; }
.mcsim-list li { margin: 0; padding: 10px 15px; font-size: .9rem; cursor: pointer; color: var(--mcsim-text); }
.mcsim-list li small { margin-right: 8px; color: var(--mcsim-gold); font-size: .7rem; }
.mcsim-list li.is-active { background: var(--mcsim-cyan); color: #fff; }
.mcsim-list li.is-active small { color: #fff; }

.mcsim-check { display: flex; align-items: center; gap: 10px; margin: 0 0 15px; font-size: .9rem; font-weight: 600; cursor: pointer; color: var(--mcsim-text); }
.mcsim-check input { width: 18px; height: 18px; margin: 0; accent-color: var(--mcsim-cyan); }
.mcsim-hint { margin: -5px 0 15px; font-size: .8rem; color: var(--mcsim-gold); }
.mcsim-hint[hidden] { display: none; }

.mcsim-btn {
  display: block; width: 100%; padding: 15px; border: 0; border-radius: 5px; cursor: pointer; text-align: center; text-decoration: none;
  background: var(--mcsim-cyan); color: #fff !important; font: inherit; font-weight: 800; text-transform: uppercase; transition: .3s;
}
.mcsim-btn:hover:not(:disabled) { background: #fff; color: #000 !important; }
.mcsim--light .mcsim-btn:hover:not(:disabled) { background: #111; color: #fff !important; }
.mcsim-btn:disabled { opacity: .6; cursor: progress; }

/* Résultat */
.mcsim-out { margin-top: 25px; }
.mcsim-loading { margin: 0; text-align: center; color: var(--mcsim-muted); font-size: .9rem; }
.mcsim-error { padding: 15px 18px; border: 1px solid var(--mcsim-err); border-radius: 8px; color: var(--mcsim-err); font-size: .9rem; }
.mcsim-error p { margin: 0 0 10px; }
.mcsim-error p:last-child { margin: 0; }

.mcsim-total { text-align: center; padding: 22px 15px; border: 1px solid var(--mcsim-cyan); border-radius: 10px; background: rgba(0, 140, 193, .08); }
.mcsim-total span { display: block; font-size: .8rem; font-weight: 700; text-transform: uppercase; color: var(--mcsim-cyan); }
.mcsim-total strong { display: block; font-size: 3rem; font-weight: 900; line-height: 1.1; color: var(--mcsim-text); }
.mcsim-total small { display: block; margin-top: 6px; font-size: .78rem; color: var(--mcsim-muted); }
.mcsim-route { margin: 18px 0 12px; font-size: .88rem; color: var(--mcsim-muted); text-align: center; }
.mcsim-route b { color: var(--mcsim-text); font-weight: 700; }

.mcsim-leg { margin: 0 0 10px; border: 1px solid var(--mcsim-line); border-radius: 8px; overflow: hidden; }
.mcsim-leg summary {
  display: flex; justify-content: space-between; gap: 12px; padding: 12px 15px; cursor: pointer; list-style: none;
  font-size: .9rem; font-weight: 700; background: var(--mcsim-field);
}
.mcsim-leg summary::-webkit-details-marker { display: none; }
.mcsim-leg summary small { margin-left: 6px; font-weight: 500; color: var(--mcsim-muted); }
.mcsim .mcsim-leg table, .mcsim .mcsim-leg thead, .mcsim .mcsim-leg tbody, .mcsim .mcsim-leg tr {
  width: 100%; margin: 0; border: 0 !important; border-collapse: collapse; font-size: .85rem;
  background: transparent !important; box-shadow: none !important;
}
.mcsim .mcsim-leg table { display: table; }
.mcsim .mcsim-leg tr:nth-child(odd), .mcsim .mcsim-leg tr:nth-child(even), .mcsim .mcsim-leg tr:hover { background: transparent !important; }
.mcsim .mcsim-leg td {
  padding: 8px 15px; border: 0 !important; border-top: 1px solid var(--mcsim-line) !important; vertical-align: top;
  background: transparent !important; color: #000 !important; font-size: .85rem; line-height: 1.4; text-align: left;
}
.mcsim .mcsim-leg td:last-child { text-align: right; white-space: nowrap; font-weight: 600; }
.mcsim .mcsim-leg td small { color: var(--mcsim-muted) !important; font-weight: 500; font-size: .75rem; }
.mcsim .mcsim-leg tr.is-sub td { font-weight: 700; }
.mcsim .mcsim-leg tr.is-chosen td { color: var(--mcsim-muted) !important; }
.mcsim .mcsim-leg tr.is-total td { font-weight: 800; color: var(--mcsim-cyan) !important; }
.mcsim .mcsim-leg summary { color: var(--mcsim-text) !important; }

.mcsim-note { margin: 12px 0 0; font-size: .78rem; color: var(--mcsim-muted); text-align: center; }
.mcsim-credit { margin: 8px 0 0; font-size: .7rem; color: var(--mcsim-muted); text-align: center; opacity: .8; }

.mcsim-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: stretch; margin-top: 18px; }
.mcsim-actions .mcsim-btn { flex: 1 1 240px; width: auto; }
.mcsim-link {
  flex: 1 1 160px; display: flex; align-items: center; justify-content: center; padding: 14px; border: 1px solid var(--mcsim-cyan);
  border-radius: 5px; color: var(--mcsim-cyan) !important; font-weight: 800; text-transform: uppercase; text-decoration: none; font-size: .85rem; transition: .2s;
}
.mcsim-link:hover { background: var(--mcsim-cyan); color: #fff !important; }

@media (max-width: 640px) {
  .mcsim { padding: 25px 18px; }
  .mcsim-row { flex-wrap: wrap; }
  .mcsim-row > .mcsim-field { flex: 1 1 100%; }
  .mcsim-row:first-child { flex-wrap: nowrap; flex-direction: column; align-items: stretch; gap: 0; }
  .mcsim-row:first-child .mcsim-swap { align-self: center; margin: -6px 0 6px; transform: rotate(0deg); height: 36px; }
  .mcsim-total strong { font-size: 2.4rem; }
  .mcsim .mcsim-leg td { padding: 8px 12px; }
}
