/* ---------------------------------------------------------------------------
   Tutoriel de première visite (src/tutoriel.js). Reprend les couleurs du
   thème de style.css, clair comme sombre.
   --------------------------------------------------------------------------- */
.tuto {
  width: min(640px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: var(--card-bg);
  color: var(--text);
  box-shadow: var(--shadow-lift);
  overflow: hidden;
}
.tuto[open] { display: flex; flex-direction: column; }
.tuto::backdrop { background: rgba(0, 0, 0, .4); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }

/* La fenêtre se matérialise (léger agrandissement + fondu) et repart par le
   même chemin. Pas de rebond : rien ne l'a « lancée ». */
.tuto {
  transition: opacity .28s var(--ease-out), transform .32s var(--ease-out),
    overlay .32s allow-discrete, display .32s allow-discrete;
}
.tuto:not([open]) { opacity: 0; transform: scale(.96) translateY(8px); }
.tuto::backdrop { transition: opacity .28s ease, overlay .32s allow-discrete, display .32s allow-discrete; }
.tuto:not([open])::backdrop { opacity: 0; }
@starting-style {
  .tuto[open] { opacity: 0; transform: scale(.96) translateY(8px); }
  .tuto[open]::backdrop { opacity: 0; }
}

/* Chaque étape arrive depuis la droite, dans le sens de « Suivant ». */
.tuto-corps.entree > * { animation: tuto-entree .34s var(--ease-out) both; }
.tuto-corps.entree > :nth-child(2) { animation-delay: .03s; }
.tuto-corps.entree > :nth-child(3) { animation-delay: .06s; }
.tuto-corps.entree > :nth-child(n+4) { animation-delay: .09s; }
@keyframes tuto-entree { from { opacity: 0; transform: translateX(14px); } }
.tuto-corps.retour > * { animation-name: tuto-retour; }
@keyframes tuto-retour { from { opacity: 0; transform: translateX(-14px); } }

@media (prefers-reduced-motion: reduce) {
  .tuto, .tuto:not([open]) { transform: none; }
  @starting-style { .tuto[open] { transform: none; } }
  .tuto-corps.entree > *, .tuto-corps.retour > * { animation-name: tuto-fondu; }
  @keyframes tuto-fondu { from { opacity: 0; } }
}

.tuto-entete {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem 0;
}
.tuto-compteur { font-size: .82rem; font-weight: 700; color: var(--muted); letter-spacing: .02em; }
.tuto-points { display: flex; gap: 6px; }
.tuto-points span { width: 7px; height: 7px; border-radius: 4px; background: var(--border-strong); transition: width .3s var(--ease-out), background-color .3s ease; }
.tuto-points span.fait { background: var(--accent); opacity: .45; }
.tuto-points span.actif { width: 20px; background: var(--accent); }

.tuto-corps { padding: .4rem 1.5rem 1rem; overflow-y: auto; }
.tuto-corps h2 { font-size: 1.45rem; font-weight: 700; letter-spacing: -0.022em; line-height: 1.2; margin: .5rem 0 .6rem; }
.tuto-corps p { margin: 0 0 .8rem; }
.tuto-note { font-size: .9rem; color: var(--muted); }

.tuto-resume { margin: 0 0 1.1rem; padding-left: 1.3rem; }
.tuto-resume li { margin: .25rem 0; font-weight: 600; }

.tuto-lien {
  display: inline-block;
  margin: .1rem 0 .9rem;
  padding: .55rem 1rem;
  border-radius: 980px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}
.tuto-lien:hover { text-decoration: underline; }

.tuto-image { margin: 0 0 .8rem; }
.tuto-image img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
}

.tuto-actions {
  display: flex;
  justify-content: space-between;
  gap: .75rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
}
/* « Passer » reste à gauche, discret ; « Précédent » et « Suivant » à droite. */
.tuto-actions .secondary { margin-left: auto; }
.tuto-actions .tuto-passer[hidden] + .secondary,
.tuto-actions .secondary[hidden] + .tuto-suivant { margin-left: auto; }
.tuto-passer {
  padding-left: .4rem;
  padding-right: .4rem;
  background: none;
  border-color: transparent;
  color: var(--muted);
}
.tuto-passer:hover { background: none; border-color: transparent; color: var(--text); }

.tuto-revoir {
  display: inline-block;
  margin: -.2rem 0 1rem;
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  font-size: .92rem;
  font-weight: 600;
  letter-spacing: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.tuto-revoir:hover { background: none; color: var(--accent-strong); }
.tuto-revoir:active:not(:disabled) { transform: none; opacity: .6; }

@media (max-width: 520px) {
  .tuto-corps, .tuto-entete, .tuto-actions { padding-left: 1rem; padding-right: 1rem; }
  .tuto-corps h2 { font-size: 1.15rem; }
  .tuto-actions button { padding: .7rem 1.1rem; }
}

/* Le lien « Y aller → » sous le mot de passe (src/main.js). */
.password-help a { color: var(--accent); font-weight: 600; text-decoration: none; white-space: nowrap; }
.password-help a:hover { text-decoration: underline; }

/* --- « Se connecter avec Microsoft » (src/formulaire-microsoft.js) ---
   Reprend la charte de Microsoft : fond blanc, filet gris, logo à 4 carrés. */
.bouton-microsoft {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .7rem;
  width: 100%;
  padding: .72rem 1rem;
  border-radius: 10px;
  border: 1px solid #8c8c8c;
  background: #fff;
  color: #5e5e5e;
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0;
}
.bouton-microsoft:hover { background: #f3f3f3; border-color: #8c8c8c; color: #3b3b3b; }
:root[data-theme="dark"] .bouton-microsoft { background: #2f2f2f; border-color: #6b6b6b; color: #fff; }
:root[data-theme="dark"] .bouton-microsoft:hover { background: #3a3a3a; }
.bouton-microsoft svg { flex: none; }
.microsoft-field.connecte .bouton-microsoft { color: var(--muted); }
.microsoft-etat strong { color: var(--ok); }
.microsoft-etat strong.alerte { color: var(--danger); }

/* Proposer la démo dès l'explication. */
.tuto-demo { display: flex; align-items: center; justify-content: space-between; gap: 0.8rem; flex-wrap: wrap; margin-top: 0.4rem; padding: 0.8rem 1rem; border-radius: 14px; background: var(--accent-soft); }
.tuto-demo span { font-weight: 600; }
.danger-zone a { color: var(--accent); font-weight: 600; text-decoration: none; }
.danger-zone a:hover { text-decoration: underline; }
