/* ── Reset & base ────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: #222;
  background: #f4f6f9;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── En-tête bandeau ─────────────────────────────────────────────────────── */
header.bandeau {
  position: relative;
  background-image: url('/static/BandeauFactureElectronique.jpg');
  background-size: cover;
  background-position: center 30%;
  color: #fff;
  text-align: center;
  overflow: hidden;
  min-height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Calque sombre pour rendre le texte lisible sans cacher l'image */
.bandeau-overlay {
  position: relative;
  z-index: 2;
  background: rgba(10, 28, 50, 0.62);
  width: 100%;
  padding: 2rem 1.5rem 1.6rem;
}

header.bandeau h1 {
  font-size: 1.9rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}

header.bandeau .intro {
  margin-top: 0.5rem;
  font-size: 1rem;
  color: #cce0f5;
  text-shadow: 0 1px 3px rgba(0,0,0,0.4);
}

/* ── Contenu principal ───────────────────────────────────────────────────── */
main {
  flex: 1;
  max-width: 860px;
  width: 100%;
  margin: 2rem auto;
  padding: 0 1rem;
}

/* ── Alerte erreur ───────────────────────────────────────────────────────── */
.alerte-erreur {
  background: #fff0f0;
  border-left: 4px solid #cc3333;
  color: #cc3333;
  padding: 0.8rem 1rem;
  border-radius: 6px;
  margin-bottom: 1.5rem;
  font-weight: 500;
}

/* ── Bloc question ───────────────────────────────────────────────────────── */
.question-bloc {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
  padding: 1.5rem 1.8rem;
  margin-bottom: 1.5rem;
}

.question-bloc h2 {
  font-size: 1.05rem;
  font-weight: 600;
  color: #1a3a5c;
  margin-bottom: 1rem;
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
}

.numero {
  background: #1a3a5c;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  min-width: 26px;
  height: 26px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

/* ── Liste de choix (boutons radio stylisés) ─────────────────────────────── */
.choix-liste {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.choix-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.65rem 1rem;
  border: 1.5px solid #d0dbe8;
  border-radius: 7px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  background: #fafcff;
}

.choix-item:hover {
  border-color: #1a3a5c;
  background: #eef4fb;
}

.choix-item input[type="radio"] {
  margin-top: 3px;
  accent-color: #1a3a5c;
  flex-shrink: 0;
}

.choix-item.selectionne,
.choix-item:has(input:checked) {
  border-color: #1a3a5c;
  background: #e8f0fa;
}

.libelle {
  font-size: 0.97rem;
  color: #333;
}

/* ── Boutons ─────────────────────────────────────────────────────────────── */
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  margin-top: 2rem;
}

.btn-principal {
  background: #1a3a5c;
  color: #fff;
  border: none;
  padding: 0.85rem 2.2rem;
  font-size: 1.05rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-principal:hover { background: #122a44; }

.btn-pdf {
  background: #0066cc;
  color: #fff;
  border: none;
  padding: 0.85rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-pdf:hover { background: #0051a3; }

.btn-secondaire {
  display: inline-block;
  padding: 0.85rem 1.8rem;
  border: 2px solid #1a3a5c;
  color: #1a3a5c;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}

.btn-secondaire:hover { background: #1a3a5c; color: #fff; }

/* ── Page résultats ──────────────────────────────────────────────────────── */
.resultats-grille {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 1.4rem;
  margin-bottom: 2rem;
}

.resultat-carte {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  border-top: 4px solid #1a3a5c;
}

.logo-zone {
  display: flex;
  align-items: center;
  min-height: 60px;
}

.logo {
  max-width: 160px;
  max-height: 60px;
  object-fit: contain;
}

.resultat-corps {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.resultat-titre {
  font-size: 1.1rem;
  font-weight: 700;
  color: #1a3a5c;
}

.resultat-desc {
  font-size: 0.95rem;
  color: #444;
  line-height: 1.5;
}

.lien-externe {
  display: inline-block;
  margin-top: 0.4rem;
  color: #0066cc;
  font-weight: 600;
  text-decoration: none;
  font-size: 0.92rem;
}

.lien-externe:hover { text-decoration: underline; }

/* ── Pied de page ────────────────────────────────────────────────────────── */
footer {
  text-align: center;
  padding: 1.2rem;
  font-size: 0.85rem;
  color: #888;
  background: #fff;
  border-top: 1px solid #e0e0e0;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 560px) {
  header h1 { font-size: 1.4rem; }
  .question-bloc { padding: 1.1rem; }
  .resultats-grille { grid-template-columns: 1fr; }
}

/* ── Podium résultats ────────────────────────────────────────────────────── */
.podium {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.2rem;
  margin-bottom: 2rem;
}

.carte {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  padding: 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  border-top: 5px solid #1a3a5c;
  transition: transform 0.15s;
}
.carte:hover { transform: translateY(-3px); }

.carte.rang-1 { border-top-color: #c9a227; }
.carte.rang-2 { border-top-color: #8e9aaa; }
.carte.rang-3 { border-top-color: #b87333; }

.carte-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.medaille { font-size: 1.8rem; line-height: 1; }

.score-badge {
  background: #eef4fb;
  color: #1a3a5c;
  font-size: 1.1rem;
  font-weight: 700;
  padding: 0.25rem 0.7rem;
  border-radius: 20px;
  border: 1px solid #c8daf0;
}
.score-max { font-size: 0.8rem; font-weight: 400; color: #888; }

.solution-nom {
  font-size: 1.05rem;
  font-weight: 700;
  color: #1a3a5c;
  margin: 0;
}
.solution-desc {
  font-size: 0.92rem;
  color: #444;
  line-height: 1.5;
  margin: 0;
}

/* ── Récapitulatif ───────────────────────────────────────────────────────── */
.recap {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  padding: 1.4rem 1.6rem;
  margin-bottom: 2rem;
}
.recap h3 {
  font-size: 1rem;
  font-weight: 600;
  color: #1a3a5c;
  margin-bottom: 0.9rem;
}
.recap-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.93rem;
}
.recap-table tr:nth-child(even) { background: #f7f9fc; }
.recap-table td {
  padding: 0.55rem 0.8rem;
  border-bottom: 1px solid #e8edf3;
  vertical-align: top;
}
.recap-q { color: #555; width: 60%; }
.recap-r { color: #1a3a5c; font-weight: 600; }

@media (max-width: 560px) {
  .podium { grid-template-columns: 1fr; }
  .recap-q { width: auto; }
}

/* ── Encart contact ──────────────────────────────────────────────────────── */
.encart-contact {
  background: #eef4fb;
  border: 1.5px solid #1a3a5c;
  border-radius: 10px;
  padding: 1.2rem 1.6rem;
  margin-bottom: 2rem;
  font-size: 0.97rem;
  color: #1a3a5c;
  line-height: 1.6;
}
.encart-contact a {
  color: #0066cc;
  font-weight: 600;
  text-decoration: none;
}
.encart-contact a:hover { text-decoration: underline; }

/* ── Page d'erreur ───────────────────────────────────────────────────────── */
.erreur-bloc {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
  padding: 2.5rem 2rem;
  margin: 2rem auto;
  max-width: 560px;
  text-align: center;
}
.erreur-message {
  font-size: 1.05rem;
  color: #444;
  line-height: 1.7;
  margin-bottom: 1.8rem;
}
