/*
 * 1.1.0 : plus d'@import Google Fonts (Space Grotesk, IBM Plex Sans). Le simulateur utilise les polices
 * déjà chargées par le site (Divi) : Inter pour le texte, Poppins pour les titres.
 */

#mb-inotax-simulator-root {
  --mb-bg: linear-gradient(145deg, #fff8ee 0%, #eff8f3 46%, #d7edf8 100%);
  --mb-ink: #1f2529;
  --mb-muted: #5b666d;
  --mb-brand: #0f8c78;
  --mb-brand-strong: #066c5c;
  --mb-card: rgba(255, 255, 255, 0.88);
  --mb-border: rgba(15, 140, 120, 0.2);
  --mb-alert: #a52f2f;
  --mb-shadow: 0 24px 42px rgba(18, 54, 62, 0.16);
  --mb-font-body: "Inter", Helvetica, Arial, Lucida, sans-serif;
  --mb-font-heading: "Poppins", Helvetica, Arial, Lucida, sans-serif;
  padding: clamp(16px, 3vw, 32px);
  border-radius: 24px;
  background: var(--mb-bg);
  border: 1px solid rgba(255, 255, 255, 0.75);
  /*
   * Réserve la hauteur de l'étape 1 avant le montage de l'application React (CLS, constat PERF-02).
   * Valeurs = hauteur maximale mesurée de l'étape 1 sur chaque plage de largeur, arrondie au-dessus
   * (version 1.1.0, polices du site chargées) : 745 px au-delà de 600 px de large, 764 px de 411 à 600 px,
   * 810 px de 375 à 410 px, 855 px à 360 px, 1 013 px à 320 px. À remesurer si l'étape 1 change.
   */
  box-sizing: border-box;
  min-height: 750px;
}

@media (max-width: 600px) {
  #mb-inotax-simulator-root {
    min-height: 770px;
  }
}

@media (max-width: 410px) {
  #mb-inotax-simulator-root {
    min-height: 815px;
  }
}

@media (max-width: 374px) {
  #mb-inotax-simulator-root {
    min-height: 860px;
  }
}

@media (max-width: 359px) {
  #mb-inotax-simulator-root {
    min-height: 1020px;
  }
}

#mb-inotax-simulator-root * {
  box-sizing: border-box;
}

.mb-inotax-card {
  position: relative;
  max-width: 920px;
  margin: 0 auto;
  padding: clamp(18px, 3vw, 34px);
  border-radius: 20px;
  backdrop-filter: blur(4px);
  border: 1px solid var(--mb-border);
  background: var(--mb-card);
  box-shadow: var(--mb-shadow);
  color: var(--mb-ink);
  font-family: var(--mb-font-body);
}

.mb-submit-wow {
  animation: mb-wow-pop 520ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.mb-submit-wow::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 22px;
  border: 2px solid rgba(17, 160, 143, 0.35);
  pointer-events: none;
  animation: mb-wow-ring 850ms ease-out;
}

.mb-is-submitting .mb-btn:not(.mb-btn-secondary) {
  animation: mb-submit-shimmer 1s linear infinite;
}

.mb-result-wow {
  animation: mb-result-rise 650ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes mb-wow-pop {
  0% {
    transform: scale(1);
  }

  35% {
    transform: scale(1.015);
  }

  100% {
    transform: scale(1);
  }
}

@keyframes mb-wow-ring {
  0% {
    opacity: 0.9;
    transform: scale(0.985);
  }

  100% {
    opacity: 0;
    transform: scale(1.035);
  }
}

@keyframes mb-submit-shimmer {
  0% {
    filter: brightness(1);
  }

  50% {
    filter: brightness(1.15);
  }

  100% {
    filter: brightness(1);
  }
}

@keyframes mb-result-rise {
  0% {
    opacity: 0;
    transform: translateY(14px) scale(0.985);
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.mb-header h2 {
  margin: 0;
  font-family: var(--mb-font-heading);
  font-weight: 600;
  font-size: clamp(1.45rem, 3vw, 2rem);
  letter-spacing: -0.02em;
}

.mb-tag {
  margin: 0 0 6px;
  color: var(--mb-brand-strong);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
}

.mb-progress {
  margin: 14px 0 18px;
  color: var(--mb-muted);
  font-weight: 500;
}

.mb-step-title {
  margin: 0 0 14px;
  font-size: 1.1rem;
  font-family: var(--mb-font-heading);
  font-weight: 600;
}

.mb-step-hint {
  margin: -6px 0 14px;
  padding: 0;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--mb-muted);
}

.mb-choice,
.mb-field,
.mb-consent {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
  border: 1px solid #d7e4df;
  border-radius: 12px;
  padding: 10px 12px;
  background: #ffffff;
}

.mb-choice input,
.mb-consent input {
  accent-color: var(--mb-brand);
}

.mb-field {
  flex-direction: column;
  align-items: flex-start;
}

.mb-field span {
  font-size: 0.9rem;
  color: var(--mb-muted);
}

.mb-field input,
.mb-field select {
  width: 100%;
  border-radius: 10px;
  border: 1px solid #bfceca;
  padding: 10px;
  font: inherit;
  color: var(--mb-ink);
}

.mb-actions {
  margin-top: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.mb-btn {
  border: 0;
  border-radius: 12px;
  padding: 10px 18px;
  font-family: var(--mb-font-heading);
  font-weight: 700;
  letter-spacing: 0.01em;
  background: linear-gradient(135deg, var(--mb-brand) 0%, #11a08f 100%);
  color: #fff;
  cursor: pointer;
  transition:
    transform 140ms ease,
    box-shadow 140ms ease;
}

.mb-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(15, 140, 120, 0.25);
}

.mb-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.mb-btn-secondary {
  background: #eaf2ef;
  color: #21423e;
}

.mb-error {
  margin: 12px 0 0;
  color: var(--mb-alert);
  font-weight: 600;
}

.mb-inotax-result h2 {
  margin-top: 0;
  font-family: var(--mb-font-heading);
}

.mb-result-intro {
  margin: -4px 0 8px;
  padding: 0;
  line-height: 1.5;
  color: var(--mb-muted);
}

.mb-result-cta {
  margin: 12px 0 16px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid #c8d9d4;
  background: #fff;
}

.mb-result-cta-title {
  margin: 0 0 8px;
  font-family: var(--mb-font-heading);
  font-size: 1.05rem;
}

.mb-result-cta-content {
  color: inherit;
}

.mb-result-cta-content p {
  margin: 0 0 10px;
  padding: 0;
}

.mb-result-cta-content p:last-child {
  margin-bottom: 0;
}

.mb-result-cta-btn {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.mb-btn-restart {
  border: 1px solid #c8d9d4;
}

.mb-btn-rdv {
  border: 1px solid transparent;
}

.mb-result-actions {
  margin-top: 14px;
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: space-between;
}

.mb-result-actions .mb-btn {
  width: auto;
}

.mb-result-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 14px 0;
}

.mb-kpi {
  border: 1px solid #c8d9d4;
  border-radius: 14px;
  padding: 14px;
  background: #fff;
}

.mb-kpi strong {
  display: block;
  font-size: 1.35rem;
  font-family: var(--mb-font-heading);
}

.mb-kpi span {
  color: var(--mb-muted);
}

.mb-kpi .mb-kpi-label {
  display: block;
  margin-bottom: 4px;
  font-weight: 600;
  color: var(--mb-ink);
}

.mb-kpi .mb-kpi-note {
  display: block;
  margin-top: 6px;
  font-size: 0.9rem;
  line-height: 1.45;
}

.mb-result-notice {
  margin: 4px 0 14px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid #c8d9d4;
  border-left: 4px solid var(--mb-brand);
  background: #f7faf9;
  color: var(--mb-ink);
  font-size: 0.92rem;
  line-height: 1.5;
}

.mb-result-notice-title {
  margin: 0 0 6px;
  padding: 0;
  font-family: var(--mb-font-heading);
  font-size: 1rem;
}

#mb-inotax-simulator-root .mb-result-notice ul {
  margin: 0;
  padding: 0 0 0 1.1em;
  list-style: disc;
}

#mb-inotax-simulator-root .mb-result-notice li {
  margin: 0 0 4px;
  padding: 0;
  line-height: 1.5;
}

.mb-info {
  margin: 8px 0;
  color: #1d3f3a;
}

.mb-warning {
  color: #8f2f2f;
  font-weight: 600;
}

.mb-acquisition {
  font-size: 0.9rem;
  color: var(--mb-muted);
}

@media (max-width: 700px) {
  .mb-result-grid {
    grid-template-columns: 1fr;
  }

  .mb-result-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .mb-result-actions .mb-btn {
    width: 100%;
    justify-content: center;
  }

  .mb-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .mb-btn {
    width: 100%;
  }
}
