/* =========================================================
   MODULE : Evaluation du niveau en solfège (Musiclic)
   Styles principaux
   ========================================================= */

.musiclic-eval-solfege-app {
  max-width: 980px;
  margin: 0 auto;
}

/* Haut du questionnaire */

.es-top-intro {
  margin: 0 0 14px 0;
}

.es-summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  width: 100%;
  margin-bottom: 10px;
}

.es-summary-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
}

.es-summary-item {
  background: #f4f7fb;
  border: 1px solid #d9dee6;
  border-radius: 12px;
  min-height: 48px;
  padding: 0 18px;
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

.es-summary-cta {
  margin-left: auto;
  flex: 0 0 auto;
}

.es-summary-action {
  min-height: 48px;
  padding: 0 22px;
  border-radius: 12px;
  border: 1px solid #111;
  background: #fff;
  color: #111;
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.es-summary-action:hover {
  background: #111;
  color: #fff;
}
/* Intro */

.es-intro {
  background: #fff;
  border: 1px solid #e5e8ee;
  border-radius: 14px;
  padding: 18px 20px;
  line-height: 1.6;
}

.es-intro p {
  margin: 0 0 10px 0;
}

.es-intro p:last-child {
  margin-bottom: 0;
}

/* Progression */

.es-progress-wrap {
  margin: 3px 0 24px 0;
}

.es-progress-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
  font-size: 14px;
}

.es-progress-bar {
  height: 10px;
  background: #edf1f6;
  border-radius: 999px;
  overflow: hidden;
}

.es-progress-bar-fill {
  height: 100%;
  width: 0;
  background: #111;
  border-radius: 999px;
  transition: width 0.25s ease;
}

/* Bloc thème */

.es-theme {
  margin-top: 26px;
}

/* Carte question */

.es-question {
  background: #fff;
  border: 1px solid #e2e6ee;
  border-radius: 16px;
  padding: 18px 20px;
  transition: box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
  margin-top: 18px;
}

.es-question:hover {
  box-shadow: 0 6px 18px rgba(0,0,0,0.06);
}

/* Question non répondue mise en évidence */

.es-question.es-question-unanswered {
  border-color: #d04f4f;
  background: #fff7f7;
}

/* Numéro question */

.es-question-head {
  margin-bottom: 18px;
}

.es-question-head p {
  font-size: 14px;
  color: #6b7280;
  margin: 0 0 10px 0;
}

/* Titre question */

.es-question-title {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.5;
}

/* Layout question */

.es-question-body {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: center;
}

/* Bloc image */

.es-question-image {
  flex: 0 0 auto;
  text-align: center;
  padding-right: 10px;
  display: flex;
  align-items: center;
  align-self: center;
}

/* IMPORTANT : ne jamais agrandir l’image */

.es-question-image img {
  width: auto;
  height: auto;
  max-width: 100%;
  display: inline-block;
  border-radius: 8px;
}

/* Bloc réponses */

.es-question-answers {
  flex: 1 1 420px;
  min-width: 0;
}

/* Réponses en grille */

.es-answers-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: stretch;
}

/* Réponse */

.es-answer {
  display: flex;
  align-items: center;
  min-height: 56px;
  padding: 12px 14px;
  border: 1px solid #d9dee6;
  border-radius: 12px;
  background: #fafbfc;
  cursor: pointer;
  transition: all 0.15s ease;
  box-sizing: border-box;
}

.es-answer:hover {
  border-color: #aab4c2;
  background: #f4f7fb;
}

.es-answer input[type="radio"] {
  margin-right: 10px;
  flex: 0 0 auto;
}

.es-answer span {
  display: block;
  line-height: 1.45;
}

/* Etats correction */

.es-answer.correct {
  border-color: #3d9b52;
  background: #eef9f0;
}

.es-answer.incorrect {
  border-color: #d04f4f;
  background: #fff1f1;
}

/* Feedback */

.es-feedback {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.6;
}

/* Actions */

.es-actions,
.es-result-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin: 26px 0;
}

.es-btn {
  min-height: 46px;
  padding: 0 22px;
  border-radius: 12px;
  border: 1px solid #111;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  text-decoration: none;
  box-sizing: border-box;
}

.es-btn-primary {
  background: #111;
  color: #fff;
}

.es-btn-primary:hover {
  background: #222;
  border-color: #222;
}

.es-btn-secondary {
  background: #fff;
  color: #111;
}

.es-btn-secondary:hover {
  background: #f4f7fb;
}

/* Résultat global */

.es-result-main {
  font-size: 16px;
  line-height: 1.6;
  background: #fff;
  border: 1px solid #e5e8ee;
  border-radius: 16px;
  padding: 20px;
  margin: 18px 0 24px 0;
}

/* Cartes résultats par thème */

.es-theme-results {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.es-theme-result-card {
  background: #fff;
  border: 1px solid #e5e8ee;
  border-radius: 14px;
  padding: 16px;
}

.es-theme-result-card h3 {
  margin-top: 0;
  font-size: 18px;
}

/* Recommandations */

.es-theme-links p {
  margin: 0 0 8px 0;
}

.es-theme-links p:last-child {
  margin-bottom: 0;
}

.es-theme-ok {
  color: #1f6a31;
  font-weight: 600;
  margin-bottom: 0;
}

/* Chargement / erreur / noscript */

.es-loading,
.es-error,
.eval-noscript {
  border-radius: 12px;
  padding: 16px 18px;
}

.es-loading {
  text-align: center;
  background: #fff;
  border: 1px solid #e5e8ee;
}

.es-error,
.eval-noscript {
  background: #fff5f5;
  border: 1px solid #e3c7c7;
  color: #8a2c2c;
}

/* Responsive */

@media (max-width: 980px) {
  .es-summary-row {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
  }

  .es-summary-bar {
    justify-content: center;
  }

  .es-summary-cta {
    margin-left: 0;
    display: flex;
    justify-content: center;
  }
}

@media (max-width: 760px) {
  .es-question-body {
    flex-direction: column;
    align-items: flex-start;
  }

  .es-question-image {
    text-align: left;
    padding-right: 0;
    align-self: flex-start;
  }

  .es-question-answers {
    flex: 1 1 auto;
    width: 100%;
  }

  .es-answers-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .es-actions,
  .es-result-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .es-btn {
    width: 100%;
  }

  .es-progress-top {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 520px) {
  .es-summary-bar {
    justify-content: stretch;
    gap: 10px;
  }

  .es-summary-item {
    width: 100%;
  }

  .es-summary-cta {
    display: block;
  }

  .es-summary-action {
    width: 100%;
  }
}