/* Maison Lérins – Estimateur de revenus locatifs */

.mle {
  --mle-primary: #1d3b53;
  --mle-accent: #e8b04b;
  --mle-text: #f7f1e6;
  --mle-muted: rgba(247, 241, 230, .72);
  --mle-line: rgba(247, 241, 230, .22);
  --mle-fill: rgba(247, 241, 230, .07);
  --mle-ink: #13263a;
  --mle-sel: color-mix(in srgb, var(--mle-accent) 16%, transparent);
  max-width: 560px;
  margin: 0 auto;
  color: var(--mle-text);
  font-size: 16px;
  line-height: 1.5;
  text-align: left;
}

.mle *,
.mle *::before,
.mle *::after { box-sizing: border-box; }

/* Neutralise les styles de thème les plus envahissants */
.mle h2, .mle p, .mle label, .mle small, .mle em {
  margin: 0; padding: 0; color: inherit; text-transform: none; letter-spacing: normal;
}
.mle button, .mle input, .mle select, .mle textarea {
  font: inherit; color: inherit; letter-spacing: normal; text-transform: none;
  margin: 0; box-shadow: none; min-height: 0; width: auto; max-width: none;
}
.mle [hidden] { display: none !important; }

/* Carte */
.mle .mle-card {
  display: block;
  background: var(--mle-primary);
  border-radius: 22px;
  padding: clamp(22px, 5vw, 36px);
  margin: 0;
  border: 0;
}
.mle .mle-card:focus { outline: none; }

.mle .mle-title {
  font-size: clamp(1.55rem, 1.2rem + 1.5vw, 2.1rem);
  line-height: 1.12;
  font-weight: 600;
  color: var(--mle-text);
  margin: 0 0 .5em;
  border: 0;
}
.mle .mle-sub { color: var(--mle-muted); font-size: .95rem; max-width: 46ch; }

/* Progression */
.mle .mle-progress {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px;
  margin: 26px 0 10px;
}
.mle .mle-progress span {
  height: 4px; border-radius: 4px; background: var(--mle-line);
  transition: background-color .3s ease;
}
.mle .mle-progress span.is-on { background: var(--mle-accent); }
.mle .mle-stepinfo { font-size: .85rem; color: var(--mle-muted); margin-bottom: 22px; }
.mle .mle-stepinfo b { color: var(--mle-text); font-weight: 600; }

/* Étapes */
.mle .mle-step { display: none; }
.mle .mle-step.is-active { display: block; animation: mle-in .28s ease both; }
@keyframes mle-in { from { opacity: 0; transform: translateX(10px); } to { opacity: 1; transform: none; } }
.mle .mle-step.is-back { animation-name: mle-in-back; }
@keyframes mle-in-back { from { opacity: 0; transform: translateX(-10px); } to { opacity: 1; transform: none; } }

.mle .mle-q {
  display: block; font-size: 1.08rem; font-weight: 600; color: var(--mle-text);
  margin-bottom: 14px; line-height: 1.35;
}
.mle .mle-q small { display: block; font-size: .82rem; font-weight: 400; color: var(--mle-muted); margin-top: 2px; }
.mle .mle-q--next { margin-top: 26px; }

/* Entrées masquées mais accessibles */
.mle .mle-tile input, .mle .mle-chip input, .mle .mle-row input {
  position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none;
}

/* Tuiles type de bien */
.mle .mle-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.mle .mle-tile { position: relative; display: block; cursor: pointer; }
.mle .mle-tile__in {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  min-height: 116px; padding: 16px 8px;
  border: 1.5px solid var(--mle-line); border-radius: 14px; background: var(--mle-fill);
  font-weight: 600; font-size: .98rem; text-align: center;
  transition: border-color .15s ease, background-color .15s ease;
}
.mle .mle-ico { width: 34px; height: 34px; display: block; }
.mle .mle-tile:hover .mle-tile__in { border-color: var(--mle-muted); }
.mle .mle-tile input:checked + .mle-tile__in { border-color: var(--mle-accent); background: var(--mle-sel); }
.mle .mle-tile input:checked + .mle-tile__in .mle-ico { color: var(--mle-accent); }

/* Puces (chambres, atouts) */
.mle .mle-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.mle .mle-chip { position: relative; display: inline-block; cursor: pointer; }
.mle .mle-chip span {
  display: inline-flex; align-items: center; min-height: 42px; padding: 8px 16px;
  border: 1.5px solid var(--mle-line); border-radius: 999px; background: var(--mle-fill);
  font-size: .93rem; transition: border-color .15s ease, background-color .15s ease;
}
.mle .mle-chip:hover span { border-color: var(--mle-muted); }
.mle .mle-chip input:checked + span { border-color: var(--mle-accent); background: var(--mle-sel); }
.mle .mle-chip input[type="checkbox"]:checked + span::before {
  content: ""; width: 10px; height: 6px; margin-right: 8px; margin-top: -3px;
  border-left: 2px solid var(--mle-accent); border-bottom: 2px solid var(--mle-accent);
  transform: rotate(-45deg);
}

/* Liste de choix (disponibilité) */
.mle .mle-list { display: grid; gap: 8px; }
.mle .mle-row { position: relative; display: block; cursor: pointer; }
.mle .mle-row span {
  display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 10px 16px;
  border: 1.5px solid var(--mle-line); border-radius: 12px; background: var(--mle-fill);
  transition: border-color .15s ease, background-color .15s ease;
}
.mle .mle-row span::before {
  content: ""; flex: none; width: 18px; height: 18px; border-radius: 50%;
  border: 1.5px solid var(--mle-muted);
}
.mle .mle-row:hover span { border-color: var(--mle-muted); }
.mle .mle-row input:checked + span { border-color: var(--mle-accent); background: var(--mle-sel); }
.mle .mle-row input:checked + span::before { border: 5px solid var(--mle-accent); }

/* Focus clavier */
.mle .mle-tile input:focus-visible + .mle-tile__in,
.mle .mle-chip input:focus-visible + span,
.mle .mle-row input:focus-visible + span,
.mle .mle-consent input:focus-visible {
  outline: 2px solid var(--mle-accent); outline-offset: 3px;
}
.mle button:focus-visible, .mle a:focus-visible { outline: 2px solid var(--mle-accent); outline-offset: 3px; }

/* Liste déroulante */
.mle .mle-select { position: relative; }
.mle .mle-select::after {
  content: ""; position: absolute; right: 18px; top: 50%; width: 8px; height: 8px; margin-top: -6px;
  border-right: 2px solid var(--mle-muted); border-bottom: 2px solid var(--mle-muted);
  transform: rotate(45deg); pointer-events: none;
}
.mle select,
.mle .mle-field input,
.mle .mle-field textarea {
  display: block; width: 100%;
  background: var(--mle-fill); color: var(--mle-text);
  border: 1.5px solid var(--mle-line); border-radius: 12px;
  padding: 12px 14px; min-height: 50px; font-size: 16px; line-height: 1.4;
  outline: none; -webkit-appearance: none; appearance: none;
  transition: border-color .15s ease;
}
.mle select { padding-right: 44px; cursor: pointer; }
.mle select option { color: var(--mle-ink); background: #fff; }
.mle .mle-field textarea { min-height: 76px; resize: vertical; }
.mle select:focus, .mle .mle-field input:focus, .mle .mle-field textarea:focus { border-color: var(--mle-accent); }
.mle [aria-invalid="true"] { border-color: #f19a8e !important; }

/* Coordonnées */
.mle .mle-fields { display: grid; gap: 14px; }
.mle .mle-field { display: block; }
.mle .mle-field > span { display: block; font-size: .88rem; color: var(--mle-muted); margin-bottom: 6px; }
.mle .mle-field em { font-style: normal; opacity: .75; }
.mle .mle-hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.mle .mle-consent { display: flex; gap: 12px; align-items: flex-start; font-size: .84rem; color: var(--mle-muted); cursor: pointer; }
.mle .mle-consent input { flex: none; width: 20px; height: 20px; margin-top: 1px; accent-color: var(--mle-accent); cursor: pointer; }
.mle .mle-consent a { color: var(--mle-text); text-decoration: underline; }

/* Erreur */
.mle .mle-error {
  margin-top: 18px; padding: 10px 14px; border-radius: 10px;
  background: rgba(241, 154, 142, .14); color: #ffd9d3; font-size: .9rem;
}

/* Navigation */
.mle .mle-nav { display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin-top: 28px; }
.mle .mle-back {
  margin-right: auto; background: none; border: 0; padding: 12px 4px; cursor: pointer;
  color: var(--mle-muted); font-size: .95rem; text-decoration: underline; text-underline-offset: 3px;
}
.mle .mle-back:hover { color: var(--mle-text); }
.mle .mle-next,
.mle .mle-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 12px 28px; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--mle-accent); color: var(--mle-ink); font-weight: 700; font-size: 1rem; line-height: 1.2;
  text-decoration: none; transition: filter .15s ease, transform .1s ease;
}
.mle .mle-next:hover, .mle .mle-btn:hover { filter: brightness(1.06); color: var(--mle-ink); }
.mle .mle-next:active, .mle .mle-btn:active { transform: translateY(1px); }
.mle .mle-next[disabled] { opacity: .6; cursor: progress; }
.mle .mle-btn--ghost { background: transparent; color: var(--mle-text); border: 1.5px solid var(--mle-line); }
.mle .mle-btn--ghost:hover { color: var(--mle-text); border-color: var(--mle-muted); }
.mle .mle-foot { margin-top: 22px; text-align: center; font-size: .8rem; color: var(--mle-muted); }

/* ---------- Résultat ---------- */
.mle .mle-result { animation: mle-in .35s ease both; }
.mle .mle-r-kicker { font-size: .9rem; color: var(--mle-muted); margin-bottom: 6px; }
.mle .mle-r-amount {
  font-size: clamp(1.9rem, 1.3rem + 3vw, 2.7rem); font-weight: 700; line-height: 1.08;
  color: var(--mle-text); font-variant-numeric: tabular-nums; letter-spacing: -.01em;
}
.mle .mle-r-amount bdi { white-space: nowrap; }
.mle .mle-r-amount span { color: var(--mle-muted); font-weight: 400; font-size: .55em; letter-spacing: 0; }
.mle .mle-r-per { color: var(--mle-muted); font-size: .92rem; margin-top: 6px; }

/* Barre de répartition par saison : l'élément signature */
.mle .mle-season { margin: 28px 0 8px; }
.mle .mle-season__bar {
  display: flex; height: 14px; border-radius: 7px; overflow: hidden; gap: 2px;
  background: var(--mle-fill);
}
.mle .mle-season__bar i {
  display: block; height: 100%; width: 0;
  transition: width .9s cubic-bezier(.2, .7, .2, 1);
}
.mle .mle-season__bar i:nth-child(1), .mle .mle-season__list li:nth-child(1)::before { background: var(--mle-accent); }
.mle .mle-season__bar i:nth-child(2), .mle .mle-season__list li:nth-child(2)::before { background: color-mix(in srgb, var(--mle-accent) 55%, var(--mle-primary)); }
.mle .mle-season__bar i:nth-child(3), .mle .mle-season__list li:nth-child(3)::before { background: color-mix(in srgb, var(--mle-text) 45%, var(--mle-primary)); }
.mle .mle-season__list { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 8px; }
.mle .mle-season__list li {
  display: grid; grid-template-columns: 10px 1fr auto; align-items: center; gap: 10px;
  font-size: .92rem; margin: 0; padding: 0;
}
.mle .mle-season__list li::before { content: ""; width: 10px; height: 10px; border-radius: 3px; }
.mle .mle-season__list b { font-weight: 600; font-variant-numeric: tabular-nums; }
.mle .mle-season__list small { color: var(--mle-muted); font-size: .82rem; }

.mle .mle-r-facts {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1px; margin: 24px 0 0;
  background: var(--mle-line); border-radius: 14px; overflow: hidden;
}
.mle .mle-r-facts div { background: var(--mle-primary); padding: 14px 16px; }
.mle .mle-r-facts div:only-child, .mle .mle-r-facts .is-wide { grid-column: 1 / -1; }
.mle .mle-r-facts dt { font-size: .82rem; color: var(--mle-muted); }
.mle .mle-r-facts dd { margin: 2px 0 0; font-weight: 600; font-size: 1.05rem; font-variant-numeric: tabular-nums; }

.mle .mle-r-note { margin-top: 16px; font-size: .8rem; color: var(--mle-muted); }
.mle .mle-r-next {
  margin-top: 24px; padding: 16px 18px; border-radius: 14px;
  border: 1.5px solid var(--mle-accent);
}
.mle .mle-r-next p + p { margin-top: 4px; color: var(--mle-muted); font-size: .92rem; }
.mle .mle-r-next strong { font-weight: 600; }
.mle .mle-r-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.mle .mle-r-actions .mle-btn { flex: 1 1 200px; }

@media (max-width: 420px) {
  .mle .mle-tiles { gap: 8px; }
  .mle .mle-tile__in { min-height: 104px; font-size: .9rem; padding: 14px 4px; }
  .mle .mle-ico { width: 30px; height: 30px; }
  .mle .mle-next { padding: 12px 22px; }
}

@media (prefers-reduced-motion: reduce) {
  .mle *, .mle *::before, .mle *::after { animation: none !important; transition: none !important; }
}
