/* =========================================================
   FSI72 — Module de réservation d'audit gratuit
   Grille : 5 jours ouvrés × 2 demi-journées
   ========================================================= */

.audit-card [hidden] { display: none !important; }

.audit-card {
  grid-column: 1 / -1;
  margin-top: 8px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 32px 34px 34px;
}

.audit-head {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 22px;
}

.audit-head h2 { font-size: 22px; margin: 0 0 8px; }
.audit-head p { margin: 0; color: var(--ink-soft); font-size: 14.5px; max-width: 560px; }

.audit-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 8px;
}

.audit-nav button {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--ink);
  font-size: 17px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background .18s ease, color .18s ease, border-color .18s ease;
}

.audit-nav button:hover:not(:disabled) { background: var(--navy); color: #fff; border-color: var(--navy); }
.audit-nav button:disabled { opacity: .35; cursor: not-allowed; }

.audit-nav span {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  min-width: 150px;
  text-align: center;
}

/* ---------- Grille de la semaine ---------- */

.audit-week {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}

.audit-day {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 12px 14px;
  background: var(--bg-soft);
}

.audit-day-head {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 10px;
}

.audit-day-head strong {
  font-family: var(--font-display);
  font-size: 14px;
  text-transform: capitalize;
  color: var(--ink);
}

.audit-day-head span { font-size: 12.5px; color: var(--muted); text-transform: capitalize; }

.audit-half { margin-top: 10px; }

.audit-half-label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--muted);
  margin-bottom: 6px;
}

.audit-slots { display: flex; flex-wrap: wrap; gap: 6px; }

.audit-slot,
.audit-slot-off {
  flex: 1 1 auto;
  min-width: 52px;
  padding: 7px 6px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  text-align: center;
  color: var(--blue-600);
  background: #fff;
  border: 1.5px solid #dbeafe;
  border-radius: 8px;
  transition: border-color .15s ease, background .15s ease, color .15s ease;
}

.audit-slot:hover { border-color: var(--blue); background: var(--bg-blue); }
.audit-slot[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }

/* Horaire devenu indisponible : barré et grisé, jamais cliquable. */
.audit-slot-off {
  color: #94a3b8;
  background: transparent;
  border-color: #e2e8f0;
  text-decoration: line-through;
  cursor: default;
}

.audit-half-note {
  display: block;
  font-size: 12px;
  font-style: italic;
  color: #94a3b8;
}

.audit-day.closed .audit-half-note { color: #b45309; }

.audit-week-loader,
.audit-week-error {
  grid-column: 1 / -1;
  padding: 26px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
}

.audit-week-error { color: #b91c1c; border-color: #fecaca; background: #fef2f2; }

.audit-legend {
  margin-top: 16px;
  font-size: 13px;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
}

.audit-legend span::before {
  content: "";
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
  background: var(--blue);
}

.audit-legend span.unavailable::before { background: #cbd5e1; }

/* ---------- Formulaire de confirmation ---------- */

.audit-form {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border-soft);
}

.audit-choice {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 0 0 18px;
  padding: 12px 16px;
  background: var(--bg-blue);
  border: 1px solid #dbeafe;
  border-radius: var(--radius-sm);
  font-size: 14.5px;
  color: var(--ink-soft);
}

.audit-choice strong { color: var(--ink); }

.audit-choice button {
  margin-left: auto;
  background: none;
  border: 0;
  padding: 0;
  color: var(--blue-600);
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: underline;
}

.audit-form .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.audit-consent {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 13.5px;
  color: var(--ink-soft);
  margin: 6px 0 18px;
}

.audit-consent input { margin-top: 3px; flex: none; }

.audit-error {
  display: none;
  margin-top: 14px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  font-size: 14px;
}

.audit-error.show { display: block; }

.audit-success {
  display: none;
  padding: 22px 24px;
  border-radius: var(--radius-sm);
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
}

.audit-success.show { display: block; }
.audit-success h3 { margin: 0 0 8px; font-size: 18px; color: #065f46; }
.audit-success p { margin: 0 0 10px; font-size: 14.5px; }
.audit-success a { font-weight: 700; color: #047857; }

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  .audit-week { grid-template-columns: repeat(2, 1fr); }
  .audit-card { padding: 26px 22px; }
}

@media (max-width: 620px) {
  .audit-week { grid-template-columns: 1fr; }
  .audit-nav { width: 100%; justify-content: space-between; }
  .audit-form .form-row { grid-template-columns: 1fr; }
}
