:root {
  --bg: #f4f6fa;
  --card: #ffffff;
  --text: #333;
  --muted: #666;
  --brand: #2a5298;
  --brand-strong: #1e3c72;
  --chip: #f9f9f9;
  --chip-border: #cfd6e4;
  --chip-hover: #eef3fc;
  --danger: #e74c3c;
  --success-bg: #d4f8d4;
  --success-bd: #2ecc71;
  --success-tx: #2c662d;
  --shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
}

body {
  font-family: "Segoe UI", Roboto, sans-serif;
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

header {
  background: linear-gradient(135deg, var(--brand), var(--brand-strong));
  color: white;
  text-align: center;
  padding: 30px 16px;
}

header h1 {
  margin: 0;
  font-size: clamp(1.4rem, 2.5vw, 2.2rem);
}

header p {
  margin: 10px 0 0;
  opacity: .95;
}

.card {
  background: var(--card);
  max-width: 1100px;
  margin: 16px auto;
  padding: 16px;
  border-radius: 14px;
  box-shadow: var(--shadow);
}

#equipe {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 12px;
  align-items: center;
}

#equipe select {
  padding: 10px 12px;
  border: 1px solid #d6dbe6;
  border-radius: 10px;
  font-size: 1rem;
}

.grid {
  max-width: 1200px;
  margin: 22px auto;
  padding: 0 14px;
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.q-card {
  background: var(--card);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.q-text {
  font-size: 1.1rem;
  font-weight: 600;
  color: #1f2d3d;
}

/* Règle principale pour les options: utilise 2 colonnes par défaut et s'adapte automatiquement */
.options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}

.option {
  min-width: 0;
  max-width: 100%;
  justify-self: stretch;
  padding: 10px 12px;
  text-align: center;
  border-radius: 10px;
  border: 2px solid var(--chip-border);
  background: var(--chip);
  cursor: pointer;
  transition: all 0.2s;
  word-break: break-word;
}

.option:hover {
  background: var(--chip-hover);
  border-color: var(--brand);
}

.option.selected {
  background: var(--brand);
  border-color: var(--brand);
  color: white;
  font-weight: bold;
}

/* 📱 Responsive mobile : une seule colonne */
@media (max-width: 520px) {
  #equipe {
    grid-template-columns: 1fr;
  }

  .grid {
    grid-template-columns: repeat(2, 1fr);
    /* ⬅️ Modification ici */
  }
}

/* ============================= */
/* Actions et messages           */
/* ============================= */
.actions {
  text-align: center;
  margin: 20px 0;
}

button {
  padding: 12px 20px;
  border: none;
  border-radius: 10px;
  background: var(--brand);
  color: white;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: background .2s;
}

button:hover {
  background: var(--brand-strong);
}

#confirmation {
  display: none;
  margin: 10px auto 30px;
  max-width: 700px;
  padding: 12px;
  background: var(--success-bg);
  border: 1px solid var(--success-bd);
  border-radius: 10px;
  color: var(--success-tx);
  font-weight: 600;
  text-align: center;
}

/* ============================= */
/* Toasts modernes               */
/* ============================= */
#toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 9999;
}

.toast {
  min-width: 220px;
  padding: 12px 18px;
  border-radius: 8px;
  color: #fff;
  font-weight: 500;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  opacity: 0;
  transform: translateX(100%);
  animation: slideIn 0.3s forwards, fadeOut 0.3s ease 4.5s forwards;
}

.toast.error {
  background: #e74c3c;
}

.toast.info {
  background: #3498db;
}

.toast.success {
  background: #2ecc71;
}

@keyframes slideIn {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeOut {
  to {
    opacity: 0;
    transform: translateX(100%);
  }
}