/* =====================================================
   TENSTEP QSM EXAM DESIGN
   FULL CLEAN VERSION
   Replace ALL previous QSM CSS with this
===================================================== */

/* =====================================================
   MAIN CONTAINER
===================================================== */

.mlw_qmn_quiz,
.qsm-quiz-container {
  max-width: 980px !important;
  margin: 60px auto !important;
  padding: 45px !important;
  background: #ffffff !important;
  border-radius: 20px !important;
  box-shadow: 0 18px 45px rgba(0, 31, 84, 0.08) !important;
  font-family: Arial, sans-serif !important;
  color: #001f54 !important;
  position: relative !important;
}

/* =====================================================
   WELCOME TITLE
===================================================== */

.mlw_qmn_message_before p,
.mlw_qmn_quiz .mlw_qmn_message_before p {
  text-align: center !important;
  color: #001f54 !important;
  font-size: 28px !important;
  font-weight: 700 !important;
  margin: 0 0 45px 0 !important;
  padding: 0 !important;
  width: 100% !important;
}

/* =====================================================
   CONTACT FORM PAGE
===================================================== */

.qsm_contact_div {
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  margin: 0 0 24px 0 !important;
}

/* Labels */
.qsm_contact_div span.mlw_qmn_question,
.qsm_contact_div .mlw_qmn_question,
.qsm_contact_div .qsm_question,
.qsm_contact_div label {
  display: block !important;
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  margin: 0 0 10px 0 !important;
  font-size: 16px !important;
  font-weight: 700 !important;
  color: #001f54 !important;
}

/* Inputs */
.qsm_contact_div input[type="text"],
.qsm_contact_div input[type="email"],
.qsm_contact_div input[type="tel"] {
  width: 100% !important;
  max-width: 100% !important;
  height: 60px !important;
  padding: 0 20px !important;
  background: #ffffff !important;
  border: 1px solid #cfd8e3 !important;
  border-radius: 14px !important;
  color: #001f54 !important;
  font-size: 15px !important;
  box-sizing: border-box !important;
  outline: none !important;
  box-shadow: none !important;
}

/* Focus */
.qsm_contact_div input:focus {
  border-color: #2d9be8 !important;
  box-shadow: 0 0 0 3px rgba(45, 155, 232, 0.12) !important;
}

/* =====================================================
   QUESTION CARD
===================================================== */

.quiz_section,
.qsm-question-wrapper {
  background: #f8fbff !important;
  border: 1px solid #d7e1ec !important;
  border-radius: 18px !important;
  padding: 34px !important;
  margin: 0 auto 35px auto !important;
  max-width: 820px !important;
}

/* Question number and question on same line */
.quiz_section .mlw_qmn_question_number,
.qsm-question-wrapper .mlw_qmn_question_number {
  display: inline !important;
  margin-right: 8px !important;
  font-size: 21px !important;
  font-weight: 700 !important;
  color: #001f54 !important;
  vertical-align: baseline !important;
}

/* Question text */
.quiz_section div.mlw_qmn_new_question,
.qsm-question-wrapper div.mlw_qmn_new_question {
  display: inline !important;
  width: auto !important;
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  margin: 0 !important;
  font-size: 21px !important;
  font-weight: 700 !important;
  line-height: 1.6 !important;
  color: #001f54 !important;
  vertical-align: baseline !important;
}

/* Space between question title and answers */
.quiz_section div.mlw_qmn_question.qsm_remove_bold,
.qsm-question-wrapper div.mlw_qmn_question.qsm_remove_bold {
  display: block !important;
  height: 30px !important;
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  border: none !important;
}

/* Hide empty content inside old question box */
.quiz_section div.mlw_qmn_question.qsm_remove_bold *,
.qsm-question-wrapper div.mlw_qmn_question.qsm_remove_bold * {
  display: none !important;
}

/* =====================================================
   ANSWER AREA
===================================================== */

.quiz_section fieldset {
  border: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

/* Answer wrapper */
.qmn_mc_answer_wrap,
.mrq_checkbox_class {
  display: grid !important;
  grid-template-columns: 24px 1fr !important;
  align-items: center !important;
  column-gap: 14px !important;
  margin: 14px 0 !important;
}

/* Radio button */
.qmn_mc_answer_wrap input[type="radio"],
.mrq_checkbox_class input[type="radio"],
.quiz_section input[type="radio"],
.qsm-question-wrapper input[type="radio"] {
  width: 18px !important;
  height: 18px !important;
  margin: 0 !important;
  accent-color: #2d9be8 !important;
  align-self: center !important;
  justify-self: center !important;
}

/* Answer label */
.qmn_mc_answer_wrap label,
.mrq_checkbox_class label,
.qsm-input-label,
.quiz_section label,
.qsm-question-wrapper label {
  width: 100% !important;
  margin: 0 !important;
  display: flex !important;
  align-items: center !important;
  min-height: 62px !important;
  padding: 18px 22px !important;
  background: #ffffff !important;
  border: 1px solid #d8e0ea !important;
  border-radius: 14px !important;
  color: #001f54 !important;
  font-size: 16px !important;
  cursor: pointer !important;
  box-sizing: border-box !important;
  transition: all 0.2s ease !important;
}

/* Hover */
.quiz_section label:hover,
.qsm-question-wrapper label:hover {
  background: #f0f7ff !important;
  border-color: #2d9be8 !important;
  transform: translateY(-1px) !important;
}

/* =====================================================
   TIMER
===================================================== */

.mlw_qmn_timer {
  position: fixed !important;
  top: 105px !important;
  right: 30px !important;
  z-index: 999999 !important;

  min-width: 190px !important;
  height: 64px !important;
  padding: 14px 28px !important;

  display: flex !important;
  align-items: center !important;
  justify-content: center !important;

  background: #263f5f !important;
  color: #ffffff !important;
  border-radius: 0 0 18px 18px !important;

  font-size: 30px !important;
  font-weight: 800 !important;
  line-height: 1 !important;

  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.22) !important;
}

/* =====================================================
   COUNTER
===================================================== */

.pages_count,
.qsm-pagination-info {
  text-align: center !important;
  color: #001f54 !important;
  font-size: 18px !important;
  font-weight: 700 !important;
  margin: 28px 0 !important;
}

/* Hide duplicate counter */
.qsm-page-counter {
  display: none !important;
}

/* =====================================================
   NAVIGATION + PROGRESS
===================================================== */

.qsm-pagination,
.qsm-navigation {
  max-width: 820px !important;
  margin: 35px auto 0 auto !important;
  display: grid !important;
  grid-template-columns: auto 1fr auto !important;
  align-items: center !important;
  gap: 24px !important;
}

/* Progress bar */
.qsm-progress-bar,
.qsm-progress-bar-2,
.qsm-progress-bar-container {
  position: relative !important;
  width: 100% !important;
  height: 24px !important;
  background: #dfe5ec !important;
  border-radius: 999px !important;
  overflow: hidden !important;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.08) !important;
}

/* Blue progress */
.qsm-progress-bar div,
.qsm-progress-bar-2 div,
.qsm-progress-bar-full {
  height: 100% !important;
  background: #2d9be8 !important;
  border-radius: 999px !important;
}

/* Percentage */
.progressbar-text,
.qsm-progress-bar .progressbar-text,
.qsm-progress-bar-2 .progressbar-text {
  position: absolute !important;
  right: 14px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  color: #ffffff !important;
  font-size: 14px !important;
  font-weight: 800 !important;
  white-space: nowrap !important;
  background: transparent !important;
  z-index: 10 !important;
}

/* Remove progress overlays */
.qsm-progress-bar::before,
.qsm-progress-bar::after,
.qsm-progress-bar-2::before,
.qsm-progress-bar-2::after {
  display: none !important;
}

/* =====================================================
   BUTTONS
   Important: no forced display here.
   QSM needs to control which buttons appear.
===================================================== */

.qsm-btn,
.qsm-submit-btn,
.mlw_qmn_quiz button,
.mlw_qmn_quiz input[type="submit"],
.mlw_qmn_quiz input[type="button"] {
  background: #2d9be8 !important;
  color: #ffffff !important;
  border: none !important;
  padding: 16px 34px !important;
  border-radius: 14px !important;
  font-size: 16px !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  box-shadow: 0 8px 16px rgba(45, 155, 232, 0.22) !important;
  transition: all 0.2s ease !important;
  white-space: nowrap !important;
  min-width: 140px !important;
  min-height: 58px !important;
  line-height: 1.2 !important;
  text-align: center !important;
  box-sizing: border-box !important;
}

/* Hover */
.qsm-btn:hover,
.qsm-submit-btn:hover,
.mlw_qmn_quiz button:hover,
.mlw_qmn_quiz input[type="submit"]:hover,
.mlw_qmn_quiz input[type="button"]:hover {
  background: #1664c0 !important;
  transform: translateY(-1px) !important;
}

/* Previous button style */
.qsm-previous,
.qsm-previous-btn,
.qsm-previous-button,
.mlw_qmn_quiz input[value="Précédent"] {
  background: #ffffff !important;
  color: #2d9be8 !important;
  border: 2px solid #2d9be8 !important;
  box-shadow: none !important;
}

/* Navigation alignment */
.qsm-next,
.qsm-next-btn,
.qsm-next-button {
  justify-self: end !important;
}

.qsm-previous,
.qsm-previous-btn,
.qsm-previous-button {
  justify-self: start !important;
}

/* =====================================================
   BUTTON VISIBILITY FIXES
   This hides only the wrong buttons.
   It does NOT force hidden buttons to show.
===================================================== */

/* Contact page: hide Previous, Next, Submit, and progress */
.qsm-quiz-form:has(.qsm-page:not([style*="display: none"]) .quiz_begin) .qsm-previous-btn,
.qsm-quiz-form:has(.qsm-page:not([style*="display: none"]) .quiz_begin) .qsm-next-btn,
.qsm-quiz-form:has(.qsm-page:not([style*="display: none"]) .quiz_begin) .qsm-submit-btn,
.qsm-quiz-form:has(.qsm-page:not([style*="display: none"]) .quiz_begin) input[value="Précédent"],
.qsm-quiz-form:has(.qsm-page:not([style*="display: none"]) .quiz_begin) input[value="Suivant"],
.qsm-quiz-form:has(.qsm-page:not([style*="display: none"]) .quiz_begin) input[value="Submit"],
.qsm-quiz-form:has(.qsm-page:not([style*="display: none"]) .quiz_begin) .qsm-progress-bar,
.qsm-quiz-form:has(.qsm-page:not([style*="display: none"]) .quiz_begin) .qsm-progress-bar-2,
.qsm-quiz-form:has(.qsm-page:not([style*="display: none"]) .quiz_begin) .qsm-progress-bar-container,
.qsm-quiz-form:has(.qsm-page:not([style*="display: none"]) .quiz_begin) .pages_count,
.qsm-quiz-form:has(.qsm-page:not([style*="display: none"]) .quiz_begin) .qsm-pagination-info {
  display: none !important;
}

/* Contact page: center Start Quiz */
.qsm-quiz-form:has(.qsm-page:not([style*="display: none"]) .quiz_begin) .qsm-pagination,
.qsm-quiz-form:has(.qsm-page:not([style*="display: none"]) .quiz_begin) .qsm-navigation {
  grid-template-columns: 1fr !important;
  justify-items: center !important;
}

/* Exam pages: hide Start Quiz */
.qsm-quiz-form:has(.qsm-question-page:not([style*="display: none"])) .qsm-start-btn,
.qsm-quiz-form:has(.qsm-question-page:not([style*="display: none"])) input[value="Start Quiz"] {
  display: none !important;
}

/* Exam pages before last question: hide Submit */
.qsm-quiz-form:has(.qsm-question-page:not([style*="display: none"]):not(.qsm-page-14)) .qsm-submit-btn,
.qsm-quiz-form:has(.qsm-question-page:not([style*="display: none"]):not(.qsm-page-14)) input[value="Submit"] {
  display: none !important;
}

/* Last question: hide Next, keep Submit controlled by QSM */
.qsm-quiz-form:has(.qsm-page-14:not([style*="display: none"])) .qsm-next-btn,
.qsm-quiz-form:has(.qsm-page-14:not([style*="display: none"])) input[value="Suivant"] {
  display: none !important;
}

/* =====================================================
   MOBILE
===================================================== */

@media (max-width: 768px) {

  .mlw_qmn_quiz,
  .qsm-quiz-container {
    margin: 25px 15px !important;
    padding: 25px !important;
  }

  .mlw_qmn_message_before p {
    font-size: 22px !important;
  }

  .quiz_section,
  .qsm-question-wrapper {
    padding: 24px !important;
  }

  .quiz_section .mlw_qmn_question_number,
  .quiz_section div.mlw_qmn_new_question,
  .qsm-question-wrapper .mlw_qmn_question_number,
  .qsm-question-wrapper div.mlw_qmn_new_question {
    font-size: 18px !important;
  }

  .mlw_qmn_timer {
    position: static !important;
    width: 100% !important;
    min-width: 100% !important;
    height: 60px !important;
    margin-bottom: 20px !important;
    border-radius: 16px !important;
    font-size: 26px !important;
  }

  .qsm-pagination,
  .qsm-navigation {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }

  .qsm-btn,
  .qsm-submit-btn,
  .mlw_qmn_quiz button,
  .mlw_qmn_quiz input[type="submit"],
  .mlw_qmn_quiz input[type="button"] {
    width: 100% !important;
  }
}