/* ==================================================
   PAGE
   ================================================== */

.simulator-rmf {
  width: 100%;
  max-width: none;
  padding-bottom: 72px;
}

.simulator-rmf > section,
.simulator-rmf-form {
  width: calc(100% - var(--site-gutter));
  max-width: var(--site-width);
  margin-left: auto;
  margin-right: auto;
}

.simulator-rmf-hero {
  margin-top: 54px;
  padding: 78px 56px;
  color: #ffffff;
  background:
    linear-gradient(rgba(0, 0, 0, 0.72), rgba(0, 0, 0, 0.72)),
    url("/assets/images/pages/loans-card-borrower-insurance.jpg") center / cover;
}

.simulator-rmf-hero h1 {
  max-width: 620px;
  margin: 0 0 24px;
  text-align: left;
}

.simulator-rmf-hero p {
  max-width: 680px;
}

.simulator-rmf-kicker {
  margin-bottom: 12px;
  color: #f1c50e;
  font-weight: bold;
}

.simulator-rmf-form {
  padding: 58px 0 0;
}

/* ==================================================
   ETAPES
   ================================================== */

.simulator-rmf-step {
  margin-bottom: 72px;
}

.simulator-rmf-step h2,
.simulator-rmf-result h2 {
  text-align: center;
}

.simulator-rmf-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  max-width: 560px;
  margin: 0 auto;
}

.simulator-rmf-choice-grid-large {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  max-width: 860px;
}

.simulator-rmf-choice {
  display: flex;
  min-height: 118px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 22px 20px;
  color: #252a31;
  font-size: 1rem;
  font-weight: bold;
  text-align: center;
  background: #f7f7f7;
  border: 0;
  border-radius: 8px;
  box-shadow: 0 7px 16px rgba(0, 0, 0, 0.14);
  cursor: pointer;
  transition:
    background-color 0.2s ease,
    box-shadow 0.2s ease,
    color 0.2s ease,
    transform 0.2s ease;
}

.simulator-rmf-choice span {
  display: block;
  max-width: 210px;
}

.simulator-rmf-icon {
  width: 46px;
  height: 46px;
  object-fit: contain;
  filter: brightness(0) saturate(100%) invert(75%) sepia(97%) saturate(1247%) hue-rotate(357deg) brightness(101%) contrast(94%);
  transition: filter 0.2s ease;
}

.simulator-rmf-choice:hover,
.simulator-rmf-choice:focus-within {
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.18);
  transform: translateY(-2px);
}

.simulator-rmf-choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.simulator-rmf-choice:has(input:checked) {
  color: #ffffff;
  background: #f1c50e;
}

.simulator-rmf-choice:has(input:checked) .simulator-rmf-icon {
  filter: brightness(0) invert(1);
}

/* ==================================================
   CHAMPS
   ================================================== */

.simulator-rmf-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px 30px;
  max-width: 860px;
  margin: 0 auto;
}

.simulator-rmf-fields label {
  display: grid;
  gap: 8px;
}

.simulator-rmf-fields span,
.simulator-rmf-borrowers legend {
  font-weight: bold;
}

.simulator-rmf-fields input,
.simulator-rmf-fields select,
.simulator-rmf-fields textarea {
  min-height: 54px;
  padding: 0 18px;
  color: #000000;
  background: #ffffff;
  border: 1px solid #cccccc;
}

.simulator-rmf-fields input::placeholder,
.simulator-rmf-fields textarea::placeholder {
  color: #d2d2d2;
  opacity: 1;
}

.simulator-rmf-input-icon {
  position: relative;
  display: block;
  width: 100%;
  min-height: 54px;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid #cccccc;
}

.simulator-rmf-input-icon input {
  width: 100%;
  min-width: 0;
  padding-right: 74px;
  border: 0;
}

.simulator-rmf-input-symbol {
  position: absolute;
  top: 0;
  right: 0;
  display: grid;
  width: 58px;
  height: 100%;
  place-items: center;
  pointer-events: none;
  background: #f1c50e;
  border: 0;
}

.simulator-rmf-input-symbol .simulator-rmf-icon {
  width: 24px;
  height: 24px;
  filter: brightness(0) invert(1);
}

.simulator-rmf-fields textarea {
  min-height: 118px;
  padding-top: 14px;
  resize: vertical;
}

.simulator-rmf-borrowers {
  display: grid;
  gap: 22px;
  margin-top: 36px;
}

.simulator-rmf-borrower-card {
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
  padding: 20px 24px 24px;
  overflow: visible;
  background: #ffffff;
  border: 0;
  border-radius: 8px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.1);
}

.simulator-rmf-borrower-card > legend {
  float: left;
  width: 100%;
  padding: 0;
  margin-bottom: 24px;
  font-size: 1.25rem;
}

.simulator-rmf-borrower-card > legend + .simulator-rmf-fields {
  clear: both;
  max-width: 800px;
  overflow: visible;
}

.simulator-rmf-range-field {
  display: grid;
  align-content: start;
  gap: 10px;
  max-width: 400px;
  padding: 0;
  overflow: visible;
}

.simulator-rmf-label-with-info {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: bold;
}

.simulator-rmf-fields input[type="range"] {
  min-height: 0;
  padding: 0;
  border: 0;
}

.simulator-rmf-range-field input[type="range"] {
  display: block;
  appearance: none;
  box-sizing: border-box;
  width: 100%;
  height: 28px;
  margin: 8px 0 0;
  background: transparent;
  cursor: pointer;
}

.simulator-rmf-range-field input[type="range"]::-webkit-slider-runnable-track {
  height: 12px;
  background: linear-gradient(
    to right,
    #f1c50e 0,
    #f1c50e var(--quota-progress, 100%),
    #555555 var(--quota-progress, 100%),
    #555555 100%
  );
  border: 1px solid #777777;
  border-radius: 999px;
}

.simulator-rmf-range-field input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 24px;
  height: 24px;
  margin-top: -7px;
  background: #f1c50e;
  border: 0;
  border-radius: 50%;
}

.simulator-rmf-range-field input[type="range"]::-moz-range-track {
  height: 12px;
  background: #555555;
  border: 1px solid #777777;
  border-radius: 999px;
}

.simulator-rmf-range-field input[type="range"]::-moz-range-progress {
  height: 12px;
  background: #f1c50e;
  border-radius: 999px;
}

.simulator-rmf-range-field input[type="range"]::-moz-range-thumb {
  width: 24px;
  height: 24px;
  background: #f1c50e;
  border: 0;
  border-radius: 50%;
}

.simulator-rmf-range-field output {
  font-weight: bold;
}

.simulator-rmf-inline-field {
  display: flex;
  flex-wrap: wrap;
  align-content: start;
  gap: 12px 22px;
  padding: 0;
  overflow: visible;
  background: transparent;
  border: 0;
  border-radius: 0;
}

.simulator-rmf-inline-field legend {
  display: flex;
  flex: 0 0 100%;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 0;
  margin-bottom: 6px;
}

.simulator-rmf-inline-field label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.simulator-rmf-info-button {
  display: inline-flex;
  width: 24px;
  height: 24px;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: #f1c50e;
  font-weight: bold;
  line-height: 1;
  background: #000000;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
}

.simulator-rmf-info {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
}

.simulator-rmf-info-text {
  position: absolute;
  z-index: 10;
  top: calc(100% + 8px);
  left: 50%;
  width: 260px;
  max-width: calc(100vw - 40px);
  padding: 12px 14px;
  color: #333333;
  font-size: 0.875rem;
  font-weight: normal;
  line-height: 1.4;
  background: #f7f7f7;
  border-left: 6px solid #f1c50e;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.14);
  transform: translateX(-50%);
}

.simulator-rmf-inline-field .simulator-rmf-info-text {
  right: 0;
  left: auto;
  transform: none;
}

.simulator-rmf-actions {
  display: flex;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
}

.simulator-rmf-error {
  margin-top: 24px;
  color: #b00020;
  font-weight: bold;
  text-align: center;
}

/* ==================================================
   RESULTAT ET DEMANDE
   ================================================== */

.simulator-rmf-result {
  margin-top: 12px;
  padding: 42px;
  background: #252a31;
  color: #ffffff;
}

.simulator-rmf-result-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  margin-bottom: 28px;
}

.simulator-rmf-result article {
  display: grid;
  gap: 8px;
  padding: 24px;
  background: rgba(255, 255, 255, 0.08);
  text-align: center;
}

.simulator-rmf-result strong {
  color: #f1c50e;
  font-size: 2rem;
}

.simulator-rmf-result > p {
  max-width: 820px;
  margin: 0 auto 34px;
  font-size: 1rem;
  text-align: center;
}

.simulator-rmf-request {
  max-width: 860px;
  margin: 42px auto 0;
  padding-top: 38px;
  border-top: 1px solid rgba(255, 255, 255, 0.25);
}

.simulator-rmf-request .primary-button {
  display: flex;
  margin: 28px auto 0;
}

.simulator-rmf-consent {
  display: flex;
  gap: 12px;
  max-width: 760px;
  margin: 24px auto 0;
  font-size: 1rem;
}

.simulator-rmf-request-message {
  margin-top: 22px;
  color: #f1c50e;
  font-weight: bold;
  text-align: center;
}

.simulator-rmf-request-message.is-error {
  color: #ffb3b3;
}

.simulator-rmf-honeypot {
  position: absolute;
  left: -9999px;
}

.simulator-rmf-home-preview {
  margin-top: 62px;
}

.simulator-rmf-page .simulator-rmf-home-preview {
  display: none;
}

.simulator-rmf-home-preview > h2 {
  margin-bottom: 24px;
  text-align: center;
}

.simulator-rmf-home-stage {
  min-height: 0;
  padding: 34px 42px;
  background:
    linear-gradient(rgba(0, 0, 0, 0.48), rgba(0, 0, 0, 0.48)),
    url("/assets/images/pages/loans-card-borrower-insurance.jpg") center / cover;
}

.simulator-rmf-home-widget {
  display: grid;
  grid-template-columns: minmax(260px, 0.85fr) minmax(360px, 1fr);
  gap: 34px;
  width: min(100%, 1180px);
  margin: 0 auto;
  align-items: center;
  color: #ffffff;
  background: transparent;
  box-shadow: none;
}

.simulator-rmf-home-widget.is-result {
  display: block;
}

.simulator-rmf-home-widget.is-result .simulator-rmf-home-header,
.simulator-rmf-home-widget.is-result .simulator-rmf-home-fields {
  display: none;
}

.simulator-rmf-home-header {
  display: grid;
  align-content: center;
  min-height: 0;
  padding: 24px 20px;
  text-align: center;
}

.simulator-rmf-home-header h3 {
  margin: 0 0 18px;
  color: #ffffff;
  font-size: 1.95rem;
  line-height: 1.35;
  text-align: center;
  text-transform: uppercase;
}

.simulator-rmf-home-header p {
  margin: 0;
  color: #ffffff;
  font-size: 1.15rem;
  line-height: 1.55;
}

.simulator-rmf-home-fields {
  display: grid;
  align-content: center;
  gap: 12px;
  padding: 0;
}

.simulator-rmf-home-input {
  display: grid;
  box-sizing: border-box;
  grid-template-columns: minmax(0, 1fr) 64px;
  width: 100%;
  min-height: 52px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.92);
  border: 2px solid #000000;
  border-radius: 0;
}

.simulator-rmf-home-input input {
  width: 100%;
  min-width: 0;
  padding: 0 18px;
  color: #000000;
  font-size: 1.05rem;
  font-weight: bold;
  background: transparent;
  border: 0;
}

.simulator-rmf-home-input input::placeholder {
  color: #777777;
  opacity: 1;
}

.simulator-rmf-home-input input[type="date"],
.simulator-rmf-home-input input[type="date"]::-webkit-datetime-edit,
.simulator-rmf-home-input input[type="date"]::-webkit-datetime-edit-text,
.simulator-rmf-home-input input[type="date"]::-webkit-datetime-edit-month-field,
.simulator-rmf-home-input input[type="date"]::-webkit-datetime-edit-day-field,
.simulator-rmf-home-input input[type="date"]::-webkit-datetime-edit-year-field {
  color: #777777;
}

.simulator-rmf-home-input > span,
.simulator-rmf-home-submit {
  display: grid;
  place-items: center;
}

.simulator-rmf-home-input > span {
  color: #ffffff;
  font-size: 1.7rem;
  font-weight: bold;
  background: #f1c50e;
  cursor: pointer;
}

.simulator-rmf-home-input .simulator-rmf-icon {
  width: 24px;
  height: 24px;
  filter: brightness(0) invert(1);
}

.simulator-rmf-home-radio {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 22px;
  padding: 0;
  margin: 0;
  color: #ffffff;
  border: 0;
}

.simulator-rmf-home-radio legend {
  flex: 0 0 100%;
  padding: 0;
  margin-bottom: 2px;
  font-size: 0.95rem;
  font-weight: bold;
}

.simulator-rmf-home-radio label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: bold;
  line-height: 1.1;
}

.simulator-rmf-home-radio input {
  width: 18px;
  height: 18px;
  accent-color: #f1c50e;
}

.simulator-rmf-home-submit {
  justify-self: stretch;
  min-height: 44px;
  margin: 4px 0 0;
  border: 0;
}

.simulator-rmf-home-result {
  padding: 0;
  color: #ffffff;
  background: transparent;
}

.simulator-rmf-home-result h3 {
  margin: 0 0 10px;
  color: #ffffff;
  font-size: 1.9rem;
  text-align: center;
  text-transform: uppercase;
}

.simulator-rmf-home-result > p {
  margin: 0 0 22px;
  color: #ffffff;
  font-size: 1.05rem;
  text-align: center;
}

.simulator-rmf-home-result-grid {
  display: grid;
  grid-template-columns: minmax(240px, 0.85fr) minmax(320px, 1.15fr);
  gap: 34px;
  align-items: center;
}

.simulator-rmf-home-result article {
  display: grid;
  min-height: 170px;
  place-items: center;
  padding: 24px;
  text-align: center;
  background: rgba(0, 0, 0, 0.34);
  border: 4px solid #f1c50e;
}

.simulator-rmf-home-result article strong {
  display: flex;
  align-items: baseline;
  justify-content: center;
  color: #f1c50e;
  font-size: 3.1rem;
  line-height: 1;
}

.simulator-rmf-home-result article small {
  margin-left: 6px;
  color: #ffffff;
  font-size: 1.1rem;
}

.simulator-rmf-home-result article > span {
  color: #ffffff;
  font-size: 1rem;
}

.simulator-rmf-home-result article i {
  display: none;
}

.simulator-rmf-home-guarantees p {
  margin: 0 0 10px;
  color: #ffffff;
  font-size: 1.3rem;
  font-weight: bold;
}

.simulator-rmf-home-guarantees details {
  padding: 8px 0;
  color: #ffffff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.55);
}

.simulator-rmf-home-guarantees summary {
  position: relative;
  display: flex;
  min-height: 26px;
  align-items: center;
  padding-right: 34px;
  color: #ffffff;
  font-size: 1.08rem;
  font-weight: bold;
  list-style: none;
  cursor: pointer;
}

.simulator-rmf-home-guarantees summary::-webkit-details-marker {
  display: none;
}

.simulator-rmf-home-guarantees summary::after {
  position: absolute;
  right: 3px;
  width: 13px;
  height: 13px;
  content: "";
  border-right: 4px solid #f1c50e;
  border-bottom: 4px solid #f1c50e;
  transform: rotate(45deg) translateY(-3px);
}

.simulator-rmf-home-guarantees details[open] summary::after {
  transform: rotate(225deg) translate(-2px, -1px);
}

.simulator-rmf-home-guarantees details p {
  margin: 6px 34px 0 0;
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: normal;
  line-height: 1.35;
}

.simulator-rmf-home-result-actions {
  display: flex;
  gap: 18px;
  justify-content: center;
  margin-top: 24px;
}

.simulator-rmf-home-result-actions a {
  min-width: 0;
  min-height: 44px;
  flex: 0 1 360px;
  padding: 0 16px;
  font-size: 0.9rem;
  font-weight: bold;
}

.simulator-rmf-legal {
  margin-top: 46px;
  text-align: center;
}

.simulator-rmf-legal a {
  color: #f1c50e;
  text-decoration: none;
}

.simulator-rmf-legal a:hover,
.simulator-rmf-legal a:focus {
  text-decoration: underline;
}

/* ==================================================
   MEDIA
   ================================================== */

/* Tablette paysage / petit ordinateur */
@media (max-width: 991px) {
  .simulator-rmf-choice-grid-large {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .simulator-rmf-result-grid {
    grid-template-columns: 1fr;
  }

  .simulator-rmf-home-stage {
    min-height: 0;
    padding: 38px 30px 34px;
  }

  .simulator-rmf-home-widget {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .simulator-rmf-home-header {
    min-height: 0;
  }

  .simulator-rmf-home-fields {
    padding: 0 34px 24px;
  }

  .simulator-rmf-home-submit {
    margin: 0;
  }

  .simulator-rmf-home-result-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .simulator-rmf-home-result-actions {
    flex-direction: column;
    gap: 12px;
  }
}

/* Tablette */
@media (max-width: 767px) {
  .simulator-rmf-hero {
    padding: 58px 32px;
  }

  .simulator-rmf-choice-grid,
  .simulator-rmf-choice-grid-large,
  .simulator-rmf-fields,
  .simulator-rmf-home-fields {
    grid-template-columns: 1fr;
  }
}

/* Mobile */
@media (max-width: 575px) {
  .simulator-rmf-hero {
    padding: 42px 24px;
  }

  .simulator-rmf-choice {
    min-height: 92px;
  }

  .simulator-rmf-choice-grid,
  .simulator-rmf-choice-grid-large {
    width: min(100%, 340px);
  }

  .simulator-rmf-input-symbol {
    width: 52px;
  }

  .simulator-rmf-input-icon input {
    padding-right: 66px;
  }

  .simulator-rmf-range-field {
    max-width: 100%;
  }

  .simulator-rmf-borrower-card,
  .simulator-rmf-result {
    padding: 24px;
  }

  .simulator-rmf-actions {
    gap: 16px;
  }

  .simulator-rmf-home-stage {
    padding: 30px 16px 28px;
  }

  .simulator-rmf-home-widget {
    padding: 0;
  }

  .simulator-rmf-home-header {
    padding: 28px 18px;
  }

  .simulator-rmf-home-header h3 {
    font-size: 1.7rem;
  }

  .simulator-rmf-home-header p,
  .simulator-rmf-home-radio,
  .simulator-rmf-home-result > p {
    font-size: 1.05rem;
  }

  .simulator-rmf-home-fields {
    padding: 0 0 26px;
  }

  .simulator-rmf-home-input {
    grid-template-columns: minmax(0, 1fr) 52px;
    min-height: 54px;
  }

  .simulator-rmf-home-input input {
    font-size: 1rem;
  }

  .simulator-rmf-home-submit {
    min-height: 52px;
    margin: 0;
  }

  .simulator-rmf-home-result h3 {
    font-size: 1.45rem;
  }

  .simulator-rmf-home-result article strong {
    font-size: 3rem;
  }
}
