/* Composants façon Apple : cartes profondes, boutons pill, segmented control, blur. */
.carte {
  background: var(--surface);
  border: none;
  border-radius: 18px;
  padding: 1.5rem;
  margin-bottom: 1.1rem;
  box-shadow: var(--ombre);
}
@media (prefers-color-scheme: dark) {
  .carte { border: 0.5px solid var(--bordure); }
}
.carte > h2:first-child, .carte > .ligne:first-child > h2 { margin-top: 0; }

.grille-cartes {
  display: grid;
  gap: 1.1rem;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.grille-cartes .carte { margin-bottom: 0; transition: transform 0.25s ease, box-shadow 0.25s ease; }
a .carte:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08); }

/* Boutons pill */
.bouton {
  display: inline-block;
  padding: 0.5rem 1.15rem;
  border-radius: 980px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font-weight: 500;
  font-size: 0.92rem;
  transition: background 0.2s, border-color 0.2s, color 0.2s, opacity 0.2s;
}
.bouton:hover { background: var(--accent-hover); border-color: var(--accent-hover); text-decoration: none; }
.bouton.secondaire {
  background: transparent;
  color: var(--accent);
}
.bouton.secondaire:hover { background: var(--accent); color: #fff; }
.bouton.discret {
  background: transparent;
  border-color: var(--grille);
  color: var(--encre);
}
.bouton.discret:hover { background: rgba(0, 0, 0, 0.04); border-color: var(--encre-muette); }
.bouton.danger {
  background: transparent;
  border-color: var(--statut-critique);
  color: var(--statut-critique);
}
.bouton.danger:hover { background: var(--statut-critique); color: #fff; }
.bouton:disabled { opacity: 0.4; cursor: not-allowed; }
.bouton.petit { padding: 0.28rem 0.8rem; font-size: 0.8rem; }

/* Badges pills discrets */
.badge {
  display: inline-block;
  padding: 0.12rem 0.65rem;
  border-radius: 980px;
  font-size: 0.72rem;
  font-weight: 550;
  border: none;
  color: var(--encre-2);
  background: rgba(0, 0, 0, 0.05);
}
@media (prefers-color-scheme: dark) {
  .badge { background: rgba(255, 255, 255, 0.1); }
}
.badge.site { color: var(--accent); background: var(--accent-doux); }
.badge.disc { background: var(--accent-doux); color: var(--accent-fort); font-weight: 650; }
.badge.renforcement { color: var(--renforcement); background: var(--accent-doux); }
.badge.ajustement { color: var(--ajustement); background: rgba(245, 99, 0, 0.1); }

/* Alertes : statut = icône + libellé, jamais la couleur seule */
.alerte {
  display: flex;
  gap: 0.65rem;
  align-items: baseline;
  padding: 0.7rem 0.95rem;
  border-radius: 12px;
  border: none;
  border-left: 4px solid var(--statut-serieux);
  margin-bottom: 0.55rem;
  font-size: 0.9rem;
  background: var(--page);
}
.alerte.critique { border-left-color: var(--statut-critique); }
.alerte.attention { border-left-color: var(--statut-attention); }

/* Tuiles de stats */
.tuiles {
  display: grid;
  gap: 1.1rem;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  margin-bottom: 1.1rem;
}
.tuile {
  background: var(--surface);
  border: none;
  border-radius: 18px;
  padding: 1.15rem 1.3rem;
  box-shadow: var(--ombre);
}
@media (prefers-color-scheme: dark) {
  .tuile { border: 0.5px solid var(--bordure); }
}
.tuile .valeur { font-size: 2rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; }
.tuile .libelle { font-size: 0.8rem; color: var(--encre-2); margin-top: 0.1rem; }

/* Jauge (barre simple, libellé toujours présent) */
.jauge {
  height: 8px;
  border-radius: 980px;
  background: rgba(0, 0, 0, 0.08);
  overflow: hidden;
  margin: 0.5rem 0 0.25rem;
}
@media (prefers-color-scheme: dark) {
  .jauge { background: rgba(255, 255, 255, 0.14); }
}
.jauge > div {
  height: 100%;
  border-radius: 980px;
  background: var(--accent);
  transition: width 0.4s ease;
}
.jauge > div.depassement { background: var(--statut-critique); }

/* Barre renforcement / ajustement : 2 séries + espaceur 2px + légende texte */
.barre-double { display: flex; height: 10px; border-radius: 980px; overflow: hidden; gap: 2px; margin: 0.5rem 0; }
.barre-double .renf { background: var(--renforcement); }
.barre-double .ajus { background: var(--ajustement); }

/* La fusée : progression dans les 5 temps */
.fusee-etapes { display: flex; gap: 4px; margin-top: 0.4rem; }
.fusee-etapes span {
  flex: 1;
  height: 6px;
  border-radius: 980px;
  background: rgba(0, 0, 0, 0.08);
  transition: background 0.3s;
}
@media (prefers-color-scheme: dark) {
  .fusee-etapes span { background: rgba(255, 255, 255, 0.14); }
}
.fusee-etapes span.acquis { background: var(--accent); }
.fusee-etapes span.courant { background: var(--accent); opacity: 0.45; }

/* Le train de la délégation */
.train { display: flex; flex-direction: column; gap: 0; margin: 0.6rem 0; }
.gare { display: flex; align-items: center; gap: 0.65rem; padding: 0.22rem 0; }
.gare .point {
  width: 13px; height: 13px; border-radius: 50%;
  border: 2px solid var(--grille); background: var(--surface); flex: none;
  transition: background 0.3s, border-color 0.3s;
}
.gare.atteinte .point { background: var(--accent); border-color: var(--accent); }
.gare.suivante .point { border-color: var(--accent); }

.ligne { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.espace { flex: 1; }
.liste-simple { list-style: none; }
.liste-simple li {
  padding: 0.6rem 0;
  border-bottom: 0.5px solid var(--bordure);
  display: flex;
  gap: 0.6rem;
  align-items: baseline;
  flex-wrap: wrap;
}
.liste-simple li:last-child { border-bottom: none; padding-bottom: 0; }

/* Onglets : segmented control */
.onglets {
  display: inline-flex;
  gap: 2px;
  border-bottom: none;
  margin: 1.25rem 0;
  overflow-x: auto;
  max-width: 100%;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 980px;
  padding: 3px;
  scrollbar-width: none;
  scroll-snap-type: x proximity;
}
@media (prefers-color-scheme: dark) {
  .onglets { background: rgba(255, 255, 255, 0.1); }
}
.onglets button {
  background: none;
  border: none;
  border-radius: 980px;
  padding: 0.4rem 0.85rem;
  cursor: pointer;
  color: var(--encre-2);
  font-size: 0.85rem;
  font-weight: 500;
  white-space: nowrap;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}
.onglets button.actif {
  color: var(--encre);
  background: var(--surface);
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}

.case-action { display: flex; gap: 0.55rem; align-items: center; padding: 0.32rem 0; }
.case-action input[type="checkbox"] {
  width: 18px; height: 18px; margin: 0;
  accent-color: var(--accent);
}
.case-action .fait { text-decoration: line-through; color: var(--encre-muette); }

.aide {
  font-size: 0.85rem;
  color: var(--encre-2);
  background: var(--accent-doux);
  border-radius: 14px;
  padding: 0.7rem 0.95rem;
  margin-bottom: 0.9rem;
  line-height: 1.5;
}

#toasts {
  position: fixed;
  bottom: calc(5rem + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  width: min(92vw, 400px);
  align-items: center;
}
@media (min-width: 900px) { #toasts { bottom: 2rem; } }
.toast {
  background: rgba(29, 29, 31, 0.92);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  color: #f5f5f7;
  padding: 0.65rem 1.3rem;
  border-radius: 980px;
  font-size: 0.88rem;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}
@media (prefers-color-scheme: dark) {
  .toast { background: rgba(245, 245, 247, 0.92); color: #1d1d1f; }
}
.toast.erreur { background: var(--statut-critique); color: #fff; }

/* Guide : contenu pédagogique */
.guide-contenu { max-width: 660px; }
.guide-contenu h1 { font-size: 2.2rem; }
.guide-contenu h2 { margin-top: 2rem; }
.guide-contenu ul, .guide-contenu ol { margin: 0 0 0.85rem 1.25rem; }
.guide-contenu li { margin-bottom: 0.3rem; }
.guide-contenu blockquote {
  border-left: none;
  padding: 0.4rem 1.5rem;
  margin: 1.25rem 0;
  color: var(--encre);
  font-size: 1.15rem;
  font-weight: 550;
  letter-spacing: -0.01em;
  text-align: center;
  font-style: normal;
}
.guide-contenu .encart {
  background: var(--surface);
  border: none;
  border-radius: 18px;
  padding: 1.15rem 1.3rem;
  margin: 1.1rem 0;
  box-shadow: var(--ombre);
}
@media (prefers-color-scheme: dark) {
  .guide-contenu .encart { border: 0.5px solid var(--bordure); }
}

.formulaire-etroit { max-width: 560px; }
.deux-colonnes { display: grid; grid-template-columns: 1fr 1fr; gap: 0 0.85rem; }
@media (max-width: 500px) { .deux-colonnes { grid-template-columns: 1fr; } }

/* Écran de connexion */
.ecran-login {
  min-height: 80dvh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ecran-login .carte { width: min(92vw, 400px); text-align: center; padding: 2.25rem 2rem; }
.ecran-login h1 { font-size: 1.6rem; }
