/* ─── Couleurs état réponse ───────────────────────────────── */
.good {
  background: #28a745;
  color: #fff;
}
.bad {
  background: #dc3545;
  color: #fff;
}

/* ─── Variables thème ─────────────────────────────────────── */
:root {
  --primary: #4caf50;
  --primary-light: #66bb6a;
  --primary-dark: #2e7d32;
  --bg: #f7f9fa;
  --surface: #fff;
  --surface-alt: #f0f0f0;
  --text: #1e1e1e;
  --radius: 12px;
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
body {
  font-family: "Poppins", sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ─── Header & Nav ────────────────────────────────────────── */
header {
  background: var(--surface-alt);
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow);
  gap: 0.75rem;
}
.logo {
  flex: 0 0 auto;
}
.logo img {
  width: 60px;
  height: 60px;
  margin: -10px 0;
}

/* conteneur nav : flex-row partout */
#main-nav {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  position: relative;
}

/* boutons normaux */
.nav-btn {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 0.4rem 1.1rem;
  border-radius: 999px;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.25s;
}
.nav-btn:hover {
  background: var(--primary-dark);
}

/* burger icon (mobile only) */
.burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 6px;
  background: none;
  border: none;
  cursor: pointer;
}
.burger span {
  width: 26px;
  height: 3px;
  background: var(--primary-dark);
  border-radius: 3px;
  transition: transform 0.3s, opacity 0.3s;
}
/* X animation */
.burger.active span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}
.burger.active span:nth-child(2) {
  opacity: 0;
}
.burger.active span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* liste liens */
.nav-links {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
}

/* ─── Main layout ─────────────────────────────────────────── */
main {
  flex: 1;
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
  padding: 2.5rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}
.question-card {
  width: 100%;
  background: var(--surface);
  padding: 1.8rem 2.2rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-align: center;
  font-size: 1.4rem;
  font-weight: 600;
}
#feedback {
  min-height: 1.6rem;
  font-size: 1rem;
  font-weight: 600;
  text-align: center;
  margin-top: -0.5rem;
}
.meta {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  font-size: 0.95rem;
  color: #555;
  flex-wrap: wrap;
}
.score {
  font: 600 1.3rem/1 "Poppins", sans-serif;
  margin: 18px 0;
}
.sc-good {
  color: #28a745;
}
.sc-mid {
  color: #6c757d;
}
.sc-bold {
  color: #000;
}

.select-wrap {
  position: relative;
  display: inline-block;
}
.level-select {
  appearance: none;
  background: var(--surface);
  border: 1px solid #d0d0d0;
  padding: 0.45rem 2.2rem 0.45rem 1rem;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: border 0.2s;
}
.level-select:hover {
  border-color: var(--primary);
}
.select-wrap::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 0.9rem;
  width: 6px;
  height: 6px;
  border-right: 2px solid var(--primary-dark);
  border-bottom: 2px solid var(--primary-dark);
  transform: translateY(-50%) rotate(45deg);
  pointer-events: none;
}

/* grille des options */
.options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 3rem;
  width: 100%;
}
.option {
  background: var(--surface);
  padding: 1rem 1.2rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-align: center;
  font-size: 1.05rem;
  cursor: pointer;
  transition: transform 0.25s, box-shadow 0.25s;
  user-select: none;
  width: 100%;
}
.option:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.1);
}
.option.good {
  background: #28a745;
  color: #fff;
  border-color: #28a745;
}
.option.bad {
  background: #dc3545;
  color: #fff;
  border-color: #dc3545;
}
.option:disabled {
  cursor: not-allowed;
  opacity: 0.75;
}

.next-btn {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 0.8rem 3rem;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.25s, transform 0.15s;
}
.next-btn:hover {
  background: var(--primary-light);
  transform: translateY(-2px);
}

footer {
  text-align: center;
  padding: 1rem 0.5rem;
  font-size: 0.85rem;
  color: #888;
}

/* ─── Responsive breaks ────────────────────────────────────── */
@media (max-width: 900px) {
  main {
    padding: 2rem 1rem;
    max-width: 680px;
  }
  .question-card {
    font-size: 1.25rem;
    padding: 1.6rem 2rem;
  }
  .options-grid {
    gap: 2.2rem;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }
  .option {
    font-size: 1rem;
    padding: 0.9rem 1rem;
  }
  .next-btn {
    padding: 0.75rem 2.5rem;
    font-size: 1rem;
  }
}

@media (max-width: 640px) {
  /* logo réduit */
  .logo img {
    width: 52px;
    height: 52px;
  }

  /* burger visible */
  .burger {
    display: flex;
    margin-left: auto;
  }

  /* nav links replié */
  .nav-links {
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    flex-direction: column;
    background: var(--surface-alt);
    padding: 1rem 0;
    gap: 0.6rem;
    box-shadow: var(--shadow);
    transform-origin: top;
    transform: scaleY(0);
    opacity: 0;
    transition: transform 0.25s ease, opacity 0.25s ease;
    border-bottom-left-radius: var(--radius);
    border-bottom-right-radius: var(--radius);
    z-index: 20;
  }
  .nav-links.open {
    transform: scaleY(1);
    opacity: 1;
  }
  .nav-links .nav-btn {
    width: 90%;
  }

  main {
    padding: 1.5rem 0.8rem;
    gap: 1.2rem;
  }
  .question-card {
    font-size: 1.15rem;
    padding: 1.2rem 1rem;
  }
  .meta {
    font-size: 0.9rem;
  }
  .score {
    font-size: 1.1rem;
  }
  .options-grid {
    gap: 1.5rem;
    grid-template-columns: 1fr;
  }
  .option {
    font-size: 0.95rem;
    padding: 0.85rem;
  }
  .next-btn {
    width: 100%;
    padding: 0.7rem 0;
  }
}

@media (max-width: 500px) {
  .question-card {
    font-size: 1.2rem;
    padding: 1.4rem 1.5rem;
  }
  .option {
    font-size: 0.95rem;
  }
}
