/* Ma Primaire — habillage des anciens exercices Hot Potatoes / pages .htm
   Chargé après les styles anciens pour harmoniser les pages avec la nouvelle charte.
*/

html {
  font-size: 18px;
}

body#TheBody,
body {
  margin: 0 !important;
  padding: 24px 14px 36px !important;
  background: linear-gradient(180deg, #f3f6ff 0%, #f8fafc 100%) !important;
  color: #172033 !important;
  font-family: Arial, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
  font-size: 1rem !important;
  line-height: 1.55 !important;
}

/* Grande table ancienne qui contient l'exercice */
body > table,
body table[width="760"] {
  width: min(980px, calc(100vw - 28px)) !important;
  max-width: 980px !important;
  margin: 22px auto !important;
  background: #ffffff !important;
  border-collapse: separate !important;
  border-spacing: 0 !important;
  border-radius: 26px !important;
  overflow: hidden !important;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.10) !important;
}

/* Neutralise les couleurs datées dans les cellules principales */
body > table td,
body table[width="760"] td {
  color: #172033 !important;
}

/* En-tête exercice */
.style7,
.ExerciseTitle,
div.Titles,
div.Titles * {
  color: #173c8f !important;
}

.style7,
.ExerciseTitle {
  font-size: clamp(1.7rem, 2.6vw, 2.6rem) !important;
  font-weight: 850 !important;
  letter-spacing: -0.03em !important;
}

.Style8,
.ExerciseSubtitle {
  font-size: clamp(1rem, 1.2vw, 1.25rem) !important;
  color: #5f6f89 !important;
  font-weight: 700 !important;
}

div.Titles {
  padding: 1.1rem 1rem !important;
  background: linear-gradient(135deg, #eef4ff, #ffffff) !important;
  border-top: 1px solid #e8edf7 !important;
  border-bottom: 1px solid #e8edf7 !important;
}

/* Boîtes d'instructions et exercice */
div.StdDiv,
#InstructionsDiv,
#MainDiv {
  width: auto !important;
  margin: 1rem clamp(12px, 3vw, 36px) !important;
  padding: clamp(1rem, 2vw, 1.5rem) !important;
  background: #ffffff !important;
  border: 1px solid #dbe5f4 !important;
  border-radius: 22px !important;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.06) !important;
  color: #172033 !important;
}

/* Textes de l'exercice */
p,
table,
div,
span,
td,
.LeftItem,
.RightItem {
  color: #172033 !important;
  font-size: 1rem !important;
  line-height: 1.55 !important;
}

.LeftItem {
  font-weight: 700 !important;
  font-size: 1.08rem !important;
}

.RightItem {
  font-weight: 800 !important;
  font-size: 1.08rem !important;
}

#Instructions,
.Instructions,
.ExerciseText {
  color: #334155 !important;
  font-size: 1.08rem !important;
}

/* Images */
img {
  max-width: 100% !important;
  height: auto !important;
}

img[src*="swf/accueil"],
img[src*="swf/accueil_quizz"] {
  border-radius: 999px !important;
  box-shadow: none !important;
}

/* Formulaires */
select,
input,
textarea {
  min-height: 46px !important;
  padding: 0.55rem 0.8rem !important;
  border: 1px solid #c9d6ea !important;
  border-radius: 14px !important;
  background: #ffffff !important;
  color: #172033 !important;
  font-size: 1rem !important;
  font-family: inherit !important;
}

select {
  min-width: 190px !important;
}

button,
.FuncButton,
#CheckButton2,
#FeedbackOKButton {
  min-height: 48px !important;
  padding: 0.75rem 1.25rem !important;
  border: 0 !important;
  border-radius: 999px !important;
  background: #1f5fbf !important;
  color: #ffffff !important;
  font-size: 1.02rem !important;
  font-weight: 850 !important;
  font-family: inherit !important;
  cursor: pointer !important;
  box-shadow: 0 8px 20px rgba(31, 95, 191, 0.24) !important;
}

button:hover,
.FuncButton:hover,
#CheckButton2:hover,
#FeedbackOKButton:hover {
  background: #164a99 !important;
}

/* Feedback correction */
div.Feedback {
  position: fixed !important;
  left: 50% !important;
  top: 50% !important;
  transform: translate(-50%, -50%) !important;
  width: min(440px, calc(100vw - 36px)) !important;
  background: #ffffff !important;
  border: 1px solid #dbe5f4 !important;
  border-radius: 22px !important;
  padding: 1.2rem !important;
  box-shadow: 0 25px 70px rgba(15, 23, 42, 0.22) !important;
  color: #172033 !important;
  z-index: 9999 !important;
}

.FeedbackText,
.FeedbackText * {
  color: #172033 !important;
  font-size: 1.05rem !important;
}

/* Table de questions */
#QForm table {
  width: 100% !important;
  max-width: 880px !important;
  margin: 1rem auto !important;
}

#QForm td {
  padding: 0.45rem 0.55rem !important;
  vertical-align: middle !important;
}

/* Anciens emplacements pub / scripts bas de page */
td[height="123"] {
  background: #ffffff !important;
  padding: 1rem !important;
}

/* Mobile / tablette */
@media (max-width: 760px) {
  html {
    font-size: 18px;
  }

  body#TheBody,
  body {
    padding: 10px 8px 28px !important;
  }

  body > table,
  body table[width="760"] {
    width: calc(100vw - 16px) !important;
    margin: 8px auto 18px !important;
    border-radius: 18px !important;
  }

  body > table > tbody > tr > td,
  body table[width="760"] > tbody > tr > td {
    display: block !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  div.StdDiv,
  #InstructionsDiv,
  #MainDiv {
    margin: 0.8rem 0.65rem !important;
    padding: 1rem !important;
    border-radius: 18px !important;
  }

  #QForm table,
  #QForm tbody,
  #QForm tr,
  #QForm td {
    display: block !important;
    width: 100% !important;
    box-sizing: border-box !important;
    text-align: left !important;
  }

  #QForm td[rowspan] {
    text-align: center !important;
    margin-bottom: 0.8rem !important;
  }

  .LeftItem,
  .RightItem {
    font-size: 1.08rem !important;
  }

  select {
    width: 100% !important;
    min-width: 0 !important;
    font-size: 1.05rem !important;
  }

  button,
  .FuncButton,
  #CheckButton2,
  #FeedbackOKButton {
    width: 100% !important;
    margin-top: 0.6rem !important;
    font-size: 1.05rem !important;
  }
}