/* Import d'une police plus agréable */
@import url('https://fonts.googleapis.com/css2?family=Lato:wght@400;700&display=swap');

/* --- Variables de couleur --- */
:root {
  --primary-color: #005a9c;
  --background-color: #f0f4f8;
  --container-bg: #ffffff;
  --feedback-bg: #f8f9fa;
  --correct-bg: #d4edda;
  --incorrect-bg: #f8d7da;
  --text-color: #333;
  --border-color: #ccc;
  --shadow-color: rgba(0,0,0,0.08);
}

/* --- Styles Généraux --- */
body {
  font-family: 'Lato', sans-serif;
  background-color: var(--background-color);
  color: var(--text-color);
  margin: 0;
  padding: 1em;
  display: flex;
  flex-direction: column;
  align-items: center;
}

header h1 {
  color: var(--primary-color);
  text-align: center;
}

main {
  width: 100%;
  max-width: 1100px; /* Largeur max pour 2 colonnes */
}

/* --- Mise en page principale en grille CSS (2 colonnes) --- */
.exercise-zone {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 1.5em;
}

/* --- Style des panneaux --- */
.panel {
  background-color: var(--container-bg);
  border-radius: 8px;
  padding: 1em 1.5em;
  box-shadow: 0 4px 15px var(--shadow-color);
}

.panel header h2 {
  margin-top: 0;
  color: var(--primary-color);
  font-size: 1.3em;
}

.worksheet-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid #eee;
  padding-bottom: 0.5em;
}

#step-indicator {
  font-weight: bold;
  color: #6c757d;
  background-color: #e9ecef;
  padding: 0.3em 0.8em;
  border-radius: 15px;
  font-size: 0.9em;
}

.panel-data {
  text-align: center;
}

/* --- Style de l'Assistant (Wizard) --- */
.wizard-step {
  border: none;
  padding: 0.5em 0;
  margin-bottom: 1em;
}

.wizard-step.hidden {
  display: none;
}

.wizard-navigation {
  display: flex;
  justify-content: space-between;
  margin-top: 1.5em;
  padding-top: 1.5em;
  border-top: 1px solid #eee;
}

/* --- Responsive Design --- */
/* Pour les tablettes et plus petit, on passe sur 1 colonne */
@media (max-width: 768px) {
  .exercise-zone {
    grid-template-columns: 1fr;
  }
}

/* --- Figure et Texte --- */
#given-lengths {
  font-weight: bold;
  font-size: 1.1em;
  line-height: 1.5;
}

svg text.label {
  font-size: 1.1em;
  fill: #000;
  font-weight: bold;
}

.angle-droit {
  fill: none;
  stroke: black;
  stroke-width: 2;
}

/* --- Champs de formulaire et Étapes --- */
fieldset {
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 0.5em 1em 1em 1em;
  margin-bottom: 1.5em;
}

legend {
  font-weight: bold;
  color: var(--primary-color);
  padding: 0 0.5em;
}

input, select {
  padding: 0.4em;
  margin: 0 0.2em;
  font-size: 1em;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  text-align: center;
  transition: border-color 0.3s, background-color 0.3s;
}

input:focus, select:focus {
  border-color: var(--primary-color);
  outline: none;
}

input.correct { background-color: var(--correct-bg); }
input.incorrect { background-color: var(--incorrect-bg); }

.equation {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
}

/* --- Boutons --- */
button {
  padding: 0.6em 1.2em;
  font-size: 1em;
  font-weight: bold;
  cursor: pointer;
  border: none;
  border-radius: 5px;
  transition: background-color 0.3s, transform 0.1s;
}

#new-exercise-btn {
  background-color: #6c757d;
  color: white;
  margin-bottom: 1em;
}

#check-btn, #next-btn {
  background-color: var(--primary-color);
  color: white;
}

#prev-btn, #solution-btn {
  background-color: #6c757d;
  color: white;
}

button:hover {
  opacity: 0.9;
}

button:active {
  transform: translateY(1px);
}

#check-all-btn, #next-btn, #check-step-btn {
  background-color: var(--primary-color);
  color: white;
}

/* --- Feedback et Solution --- */
.feedback-zone {
  margin-top: 1.5em;
}

#solution-btn {
  margin-top: 1em;
}

.solution {
  margin-top: 1em;
  background-color: #e8f5e9;
  padding: 1em;
  border-radius: 6px;
  display: none; /* Caché par défaut */
}

#feedback-message {
  margin-top: 1em;
  font-weight: bold;
  font-size: 1.1em;
}

/* --- Accessibilité --- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}