/* Calendrier de rendez-vous du site (public/js/calendrier.js) : fin du diagnostic, fenêtres « Être rappelé » et
   « Je veux le même » (22/11/2026). Chargé sur toutes les pages (mise-en-page.js) et sur la page des démos ;
   ces règles étaient avant dans diagnostic.css. */
/* ---------- Calendrier de rendez-vous (après le formulaire) ----------
   Même présentation que la page de rendez-vous du CRM : mois avec flèches, jours libres en pastilles tomate clair,
   jour choisi plein, horaires du jour en pilules à côté du mois (en dessous quand la carte est étroite). */
.diag-calendrier { container-type: inline-size; scroll-margin-top: calc(var(--site-entete-hauteur) + var(--space-4)); }
.diag-calendrier__titre { margin: 0; font: 700 22px/30px var(--font-sans); }
.diag-calendrier__titre:focus { outline: none; }
.diag-calendrier__texte { margin: var(--space-1) 0 0; color: var(--ink-muted); }
.diag-calendrier__etape { margin: 0 0 var(--space-3); padding: 0; font: 700 16px/24px var(--font-sans); }
.diag-calendrier__info { margin: var(--space-3) 0 0; color: var(--ink-muted); font-size: 15px; line-height: 22px; }
.diag-calendrier__info:empty { display: none; }
@media (max-width: 479px) { .diag-calendrier > .ajh-card__body { padding: var(--space-4); } }

/* 1. Type de rendez-vous */
.diag-types { min-width: 0; margin: 0; padding: 0; border: 0; }
.diag-types__liste { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-2); }
.diag-type {
  display: flex; align-items: center; gap: var(--space-3); margin: 0; padding: var(--space-3) var(--space-4);
  border: 1px solid var(--line); border-radius: var(--radius-lg); cursor: pointer; transition: border-color .15s ease, background-color .15s ease;
}
.diag-type:hover { border-color: var(--line-strong); }
.diag-type input { flex: none; width: 18px; height: 18px; margin: 0; accent-color: var(--ink); }
.diag-type__nom { font-weight: 700; }
.diag-type__duree { margin-left: auto; color: var(--ink-muted); font-size: 14px; }
.diag-type:has(input:checked) { border-color: var(--ink); background: var(--surface-sunken); }

/* 2. Mois et horaires */
.diag-agenda { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-5); }
.diag-mois__tete { display: flex; align-items: center; justify-content: center; gap: var(--space-4); margin-bottom: var(--space-3); }
.diag-mois__nom { min-width: 150px; font-weight: 700; text-align: center; }
.diag-mois__fleche { width: 36px; height: 36px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--ink); font-size: 24px; line-height: 1; cursor: pointer; }
.diag-mois__fleche:hover:not(:disabled) { background: var(--surface-sunken); }
.diag-mois__fleche:disabled { color: var(--line-strong); cursor: default; }
.diag-grille { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; text-align: center; }
.diag-grille__jsem { padding-bottom: 4px; color: var(--ink-muted); font-size: 12px; line-height: 16px; }
.diag-jour { position: relative; display: flex; align-items: center; justify-content: center; aspect-ratio: 1; border-radius: 50%; font-variant-numeric: tabular-nums; }
.diag-jour--ferme { color: var(--ink-muted); opacity: .55; }
.diag-jour--libre {
  padding: 0; border: 0; background: var(--accent-soft); color: var(--accent-ink); font: 700 15px/1 var(--font-sans); cursor: pointer;
  transition: background-color .3s ease, color .3s ease, transform .3s ease;
}
.diag-jour--libre:hover { transform: scale(1.06); }
.diag-jour--libre[aria-pressed="true"] { background: var(--ink); color: var(--surface); }
.diag-jour.is-aujourdhui::after { content: ""; position: absolute; bottom: 5px; left: 50%; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: currentColor; }
.diag-agenda__fuseau { margin: var(--space-3) 0 0; color: var(--ink-muted); font-size: 13px; line-height: 18px; }
.diag-horaires__vide { margin: 0; color: var(--ink-muted); }
.diag-horaires__jour { min-width: 0; margin: 0; padding: 0; border: 0; }
.diag-horaires__jour legend { margin-bottom: var(--space-3); padding: 0; font-weight: 700; }
.diag-creneaux { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.diag-creneau { position: relative; margin: 0; }
.diag-creneau input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.diag-creneau span {
  display: inline-block; min-width: 76px; padding: 8px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-pill);
  font-weight: 700; font-variant-numeric: tabular-nums; text-align: center; transition: background-color .3s ease, color .3s ease, border-color .3s ease;
}
.diag-creneau:hover span { border-color: var(--ink); }
.diag-creneau input:checked + span { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.diag-creneau input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }

/* Résumé du choix et confirmation */
.diag-calendrier__pied { display: flex; flex-direction: column; gap: var(--space-3); }
.diag-calendrier__resume { margin: 0; font: 700 17px/24px var(--font-sans); }
.diag-calendrier__resume:empty { display: none; }
.diag-calendrier__confirmer { width: 100%; }

@container (min-width: 500px) {
  .diag-types__liste { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .diag-agenda { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: start; }
  .diag-creneaux { flex-direction: column; flex-wrap: nowrap; max-height: 380px; overflow: auto; padding: 2px; }
  .diag-creneau span { display: block; width: 100%; }
  .diag-calendrier__confirmer { width: auto; align-self: flex-start; }
}

/* ---------- Dans une fenêtre (22/11/2026) : « Être rappelé » et « Je veux le même » (calendrier.js, dansFenetre) ----------
   La fenêtre s'élargit pour le mois et les horaires côte à côte ; la carte du calendrier perd son cadre. */
@media (min-width: 640px) { dialog.site-dialogue--calendrier { width: min(760px, calc(100% - 2 * var(--space-4))); } }
.site-dialogue .diag-calendrier { border: 0; box-shadow: none; background: transparent; }
.site-dialogue .diag-calendrier > .ajh-card__body { padding: 0; }
/* Badge « Provisoire » du calendrier simulé (copie locale seulement) : il passe à la ligne sur téléphone. */
.site-dialogue .site-provisoire__badge { white-space: normal; height: auto; padding-block: 2px; }
/* « Rappelez-moi plutôt » : à gauche, loin de « Fermer ». */
.site-dialogue [data-rappelez-moi] { margin-right: auto; }
.site-dialogue [data-rappelez-moi][hidden] { display: none; }
/* Confirmation du rendez-vous pris. */
.site-rdv-confirme:focus { outline: none; }
.site-rdv-confirme p { margin: var(--space-1) 0 0; }
.site-rdv-confirme .site-rdv-confirme__date { font-weight: 700; color: var(--ink); }
.site-rdv-confirme__demonstration { color: var(--ink-muted); font-size: 13px; }
