/* MaPrimaire - APER CM2 modernisé */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body.mp-aper-page {
  margin: 0;
  background: #eef5ff;
  color: #172033;
  font-family: Arial, Helvetica, sans-serif;
  overflow-x: hidden;
}
body.mp-aper-page img { max-width: 100%; height: auto; }
body.mp-aper-page a { color: #0b7dcc; text-decoration: none; }
body.mp-aper-page a:hover, body.mp-aper-page a:focus { text-decoration: underline; }
.mp-aper-shell {
  width: min(1120px, calc(100% - 28px));
  margin: 0 auto;
}
.mp-aper-nav-wrap {
  width: min(1120px, calc(100% - 28px));
  margin: 12px auto 10px;
  padding: 0;
}
.mp-aper-nav-wrap .navbar {
  min-height: 78px;
  margin-bottom: 0;
  border: 1px solid #dbeafe;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(37, 99, 235, .10);
}
.mp-aper-nav-wrap .navbar-header { min-height: 76px; }
.mp-aper-nav-wrap .navbar-brand { height: 76px; padding: 10px 16px; display: flex; align-items: center; }
.mp-aper-nav-wrap .navbar-brand img { width: 270px; max-width: min(270px, 52vw); height: auto; }
.mp-aper-nav-wrap .navbar-toggle { margin-top: 20px; }
.mp-aper-nav-wrap .navbar-nav > li > a {
  margin: 18px 4px 0;
  padding: 10px 12px;
  border-radius: 999px;
  color: #fff !important;
  font-weight: 700;
  font-size: 14px;
}
.mp-aper-breadcrumb {
  margin: 8px auto 12px;
  color: #64748b;
  font-size: 14px;
}
.mp-aper-breadcrumb a { font-weight: 700; }
.mp-aper-hero {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 22px;
  align-items: center;
  margin: 0 auto 18px;
  padding: 24px;
  border-radius: 24px;
  background: linear-gradient(135deg, #ffffff, #eaf5ff);
  border: 1px solid #dbeafe;
  box-shadow: 0 16px 36px rgba(37, 99, 235, .12);
}
.mp-aper-kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #e9f7ff;
  color: #006ba6;
  font-weight: 800;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.mp-aper-hero h1 {
  margin: 0 0 10px;
  color: #13233f;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.08;
}
.mp-aper-hero p { margin: 0; max-width: 760px; color: #40516f; font-size: 18px; line-height: 1.55; }
.mp-aper-hero-visual {
  min-width: 126px;
  text-align: center;
}
.mp-aper-hero-visual img {
  max-width: 118px;
  filter: drop-shadow(0 12px 16px rgba(15, 23, 42, .18));
}
.mp-aper-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 18px;
  align-items: start;
}
.mp-aper-card,
.mp-aper-side-card {
  margin-bottom: 18px;
  padding: 20px;
  border-radius: 22px;
  background: #fff;
  border: 1px solid #e6edf4;
  box-shadow: 0 10px 30px rgba(30, 58, 138, .08);
}
.mp-aper-card h2,
.mp-aper-side-card h2,
.mp-aper-side-card h3 {
  margin: 0 0 12px;
  color: #13233f;
  line-height: 1.2;
}
.mp-aper-card p,
.mp-aper-side-card p { color: #40516f; line-height: 1.55; }
.mp-aper-mini-list { margin: 0; padding-left: 18px; color: #40516f; line-height: 1.6; }
.mp-aper-progress {
  display: grid;
  gap: 10px;
}
.mp-aper-stat {
  padding: 14px;
  border-radius: 16px;
  background: #f8fbff;
  border: 1px solid #dbeafe;
}
.mp-aper-stat strong { display: block; color: #13233f; font-size: 24px; }
.mp-aper-question-list { display: grid; gap: 14px; }
.mp-aper-question {
  display: grid;
  grid-template-columns: 148px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  padding: 14px;
  border: 1px solid #e6edf4;
  border-radius: 18px;
  background: #fbfdff;
}
.mp-aper-question h3 {
  margin: 0 0 8px;
  color: #13233f;
  font-size: 18px;
}
.mp-aper-question p { margin: 0 0 10px; }
.mp-aper-select {
  width: 100%;
  min-height: 44px;
  padding: 9px 11px;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  background: #fff;
  color: #172033;
  font-size: 16px;
}
.mp-aper-select:focus { outline: 3px solid rgba(0, 156, 234, .22); border-color: #009cea; }
.mp-aper-question.is-ok { border-color: #86d39a; background: #f3fff6; }
.mp-aper-question.is-wrong { border-color: #ffb4b4; background: #fff7f7; }
.mp-aper-result-line { margin-top: 8px; font-weight: 700; }
.mp-aper-question.is-ok .mp-aper-result-line { color: #217a39; }
.mp-aper-question.is-wrong .mp-aper-result-line { color: #b42318; }
.mp-aper-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}
.mp-aper-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 16px;
  border: 0;
  border-radius: 999px;
  background: #009cea;
  color: #fff !important;
  font-weight: 800;
  text-decoration: none !important;
  cursor: pointer;
}
.mp-aper-btn:hover, .mp-aper-btn:focus { background: #0077b6; }
.mp-aper-btn-secondary { background: #e9f7ff; color: #006ba6 !important; }
.mp-aper-btn-secondary:hover, .mp-aper-btn-secondary:focus { background: #d8f0ff; }
.mp-aper-feedback {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #f8fbff;
  border: 1px solid #dbeafe;
  color: #172033;
  font-weight: 700;
}
.mp-aper-correction {
  display: none;
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 16px;
  background: #fffdf2;
  border: 1px solid #f2d27a;
}
.mp-aper-correction.is-open { display: block; }
.mp-aper-correction ol { margin: 0; padding-left: 20px; line-height: 1.7; }
.mp-sign {
  width: 130px;
  height: 130px;
  display: grid;
  place-items: center;
  margin: 0 auto;
}
.mp-sign svg { width: 128px; height: 128px; display: block; }
.mp-bike-figure {
  margin: 0 auto 16px;
  padding: 12px;
  border-radius: 18px;
  background: #f8fbff;
  border: 1px solid #dbeafe;
}
.mp-bike-figure svg { width: 100%; height: auto; display: block; }
.mp-bike-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.mp-bike-grid .mp-aper-question {
  grid-template-columns: 1fr;
  align-items: stretch;
}
.mp-bike-number {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin-right: 6px;
  border-radius: 999px;
  background: #009cea;
  color: #fff;
  font-weight: 800;
}
.mp-quizz-footer {
  width: min(1120px, calc(100% - 28px));
  margin: 18px auto 30px !important;
  padding: 22px !important;
  border-radius: 22px;
  background: #ffffff;
  border: 1px solid #e6edf4;
  color: #64748b;
  font-size: 14px;
  line-height: 1.65;
  box-shadow: none !important;
}
.mp-quizz-footer strong { color: #13233f; font-size: 15px; }
.mp-quizz-footer a { color: #009cea; font-weight: 700; text-decoration: none; }
.mp-quizz-footer a:hover, .mp-quizz-footer a:focus { color: #0077b6; text-decoration: underline; }
.mp-quizz-footer .text-right { color: #64748b; }
@media (max-width: 900px) {
  .mp-aper-layout { grid-template-columns: 1fr; }
  .mp-aper-side { order: -1; }
  .mp-bike-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 767px) {
  .mp-aper-shell, .mp-aper-nav-wrap, .mp-quizz-footer { width: calc(100% - 16px); }
  .mp-aper-hero { grid-template-columns: 1fr; padding: 18px; border-radius: 20px; }
  .mp-aper-hero p { font-size: 16px; }
  .mp-aper-hero-visual { text-align: left; }
  .mp-aper-nav-wrap .navbar-brand img { width: 230px; max-width: 70vw; }
  .mp-aper-nav-wrap .navbar-nav > li > a { margin: 6px 0; }
  .mp-aper-question { grid-template-columns: 1fr; }
  .mp-sign { width: 112px; height: 112px; }
  .mp-sign svg { width: 110px; height: 110px; }
  .mp-quizz-footer { margin: 16px auto 24px !important; padding: 18px 16px !important; border-radius: 18px; }
  .mp-quizz-footer .text-right { text-align: left !important; margin-top: 12px; }
}
@media (max-width: 520px) {
  .mp-bike-grid { grid-template-columns: 1fr; }
  .mp-aper-card, .mp-aper-side-card { padding: 16px; border-radius: 18px; }
  .mp-aper-actions { display: grid; }
  .mp-aper-btn { width: 100%; }
}