/* =====================================================================
   BOSDGA Booker — interface publique
   ===================================================================== */
.bosdga-app {
  --bosdga-ink: #1f2937;
  --bosdga-muted: #6b7280;
  --bosdga-line: #e2e6ec;
  --bosdga-soft: #f4f7fb;
  --bosdga-primary: #1e5aa8;
  --bosdga-primary-dark: #174a8c;
  --bosdga-danger: #b42318;
  --bosdga-success: #157347;
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  color: var(--bosdga-ink);
  font-size: 16px;
  line-height: 1.55;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  box-sizing: border-box;
  overflow-wrap: anywhere;
}
.bosdga-app *,
.bosdga-app *::before,
.bosdga-app *::after { box-sizing: border-box; }
/* Les règles display ci-dessous ne doivent jamais neutraliser l'attribut hidden. */
.bosdga-app [hidden] { display: none !important; }

.bosdga-head h2 { margin: 0 0 4px; font-size: 1.6rem; line-height: 1.25; }
.bosdga-head p { margin: 0 0 20px; color: var(--bosdga-muted); }

/* Étapes */
.bosdga-steps {
  display: flex;
  gap: 6px;
  list-style: none;
  margin: 0 0 22px;
  padding: 0;
  flex-wrap: wrap;
}
.bosdga-steps li {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 1 1 0;
  min-width: 150px;
  padding: 8px 10px;
  border: 1px solid var(--bosdga-line);
  border-radius: 8px;
  color: var(--bosdga-muted);
  background: #fff;
  font-size: .86rem;
  font-weight: 600;
}
.bosdga-steps li span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--bosdga-soft);
  color: var(--bosdga-muted);
  font-size: .75rem;
  flex: 0 0 22px;
}
.bosdga-steps li.is-active { border-color: var(--bosdga-primary); color: var(--bosdga-primary); }
.bosdga-steps li.is-active span { background: var(--bosdga-primary); color: #fff; }
.bosdga-steps li.is-done { border-color: #cfd9e6; color: var(--bosdga-ink); }
.bosdga-steps li.is-done span { background: #dbe7f5; color: var(--bosdga-primary); }

/* Panneaux */
.bosdga-panel {
  border: 1px solid var(--bosdga-line);
  border-radius: 10px;
  padding: 22px;
  background: #fff;
}
.bosdga-panel h3 { margin: 0 0 16px; font-size: 1.15rem; }
.bosdga-panel.is-active { display: block; }
.bosdga-panel[hidden] { display: none !important; }

.bosdga-label { display: block; margin: 0 0 6px; font-weight: 600; font-size: .9rem; }
.bosdga-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  background: #fff;
  color: var(--bosdga-ink);
  font-size: 1rem;
  line-height: 1.4;
}
.bosdga-input:focus { outline: 2px solid rgba(30, 90, 168, .25); border-color: var(--bosdga-primary); }
.bosdga-hint, .bosdga-muted { color: var(--bosdga-muted); font-size: .86rem; margin: 8px 0 0; }

/* Champs */
.bosdga-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.bosdga-field { min-width: 0; }
.bosdga-co {
  margin: 20px 0 0;
  padding: 16px;
  border: 1px dashed #cbd5e1;
  border-radius: 9px;
}
.bosdga-co legend { padding: 0 6px; font-weight: 600; font-size: .92rem; }
.bosdga-check { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 12px; font-size: .92rem; cursor: pointer; }
.bosdga-check input { width: 17px; height: 17px; margin: 0; accent-color: var(--bosdga-primary); }
.bosdga-check--standalone { font-weight: 600; }

.bosdga-honeypot { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; }

/* Actions */
.bosdga-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; flex-wrap: wrap; }
.bosdga-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 10px 18px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  background: #fff;
  color: var(--bosdga-ink);
  font-size: .95rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.bosdga-btn:hover { background: var(--bosdga-soft); }
.bosdga-btn--primary { background: var(--bosdga-primary); border-color: var(--bosdga-primary); color: #fff; }
.bosdga-btn--primary:hover { background: var(--bosdga-primary-dark); }
.bosdga-btn:disabled { opacity: .6; cursor: not-allowed; }
.bosdga-btn-icon {
  width: 34px;
  height: 34px;
  border: 1px solid var(--bosdga-line);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
}
.bosdga-btn-icon:disabled { opacity: .35; cursor: not-allowed; }
.bosdga-link { border: 0; background: none; color: var(--bosdga-primary); font-size: .85rem; cursor: pointer; text-decoration: underline; padding: 0; }

/* Alertes */
.bosdga-alert {
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid #f1c6c0;
  background: #fdf1ef;
  color: var(--bosdga-danger);
  font-size: .92rem;
}
.bosdga-alert--success { border-color: #bfe3cd; background: #eef9f2; color: var(--bosdga-success); }

/* Calendrier + créneaux */
.bosdga-booking-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; }
.bosdga-calendar-wrap,
.bosdga-slots-wrap { min-width: 0; }
.bosdga-calendar-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.bosdga-calendar-head strong { font-size: .98rem; }
.bosdga-calendar { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.bosdga-cal-name { text-align: center; font-size: .72rem; font-weight: 700; color: var(--bosdga-muted); padding: 4px 0; }
.bosdga-cal-cell {
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 7px;
  background: #fff;
  color: var(--bosdga-muted);
  font-size: .9rem;
  cursor: default;
}
.bosdga-cal-cell.is-blank { background: transparent; }
.bosdga-cal-cell.is-open { background: var(--bosdga-soft); border-color: #cfdced; color: var(--bosdga-ink); cursor: pointer; font-weight: 600; }
.bosdga-cal-cell.is-open:hover { border-color: var(--bosdga-primary); }
.bosdga-cal-cell.is-selected { background: var(--bosdga-primary); border-color: var(--bosdga-primary); color: #fff; }

.bosdga-slots-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.bosdga-slots-head strong { font-size: .95rem; }
.bosdga-slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 8px; }
.bosdga-slot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 11px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  background: #fff;
  color: var(--bosdga-ink);
  font-size: .93rem;
  font-weight: 600;
  cursor: pointer;
}
.bosdga-slot:hover { border-color: var(--bosdga-primary); }
.bosdga-slot.is-selected { background: var(--bosdga-primary); border-color: var(--bosdga-primary); color: #fff; }
.bosdga-slot-dot { width: 8px; height: 8px; border-radius: 50%; background: #9fb3cc; }
.bosdga-slot.is-selected .bosdga-slot-dot { background: #fff; }

/* Récapitulatif */
.bosdga-recap {
  display: grid;
  grid-template-columns: minmax(0, 190px) minmax(0, 1fr);
  gap: 0;
  margin: 0 0 18px;
  border: 1px solid var(--bosdga-line);
  border-radius: 9px;
  overflow: hidden;
}
.bosdga-recap dt,
.bosdga-recap dd { margin: 0; padding: 11px 14px; border-bottom: 1px solid var(--bosdga-line); font-size: .93rem; }
.bosdga-recap dt { background: var(--bosdga-soft); font-weight: 600; }
.bosdga-recap dd { word-break: break-word; }
.bosdga-recap dt:nth-last-of-type(1),
.bosdga-recap dd:nth-last-of-type(1) { border-bottom: 0; }

.bosdga-notice {
  margin: 0 0 8px;
  padding: 14px 16px;
  border-left: 4px solid var(--bosdga-primary);
  background: var(--bosdga-soft);
  border-radius: 0 8px 8px 0;
  font-size: .93rem;
}

/* Confirmation */
.bosdga-done { text-align: center; }
.bosdga-done-icon {
  width: 54px;
  height: 54px;
  margin: 0 auto 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #e6f4ec;
  color: var(--bosdga-success);
  font-size: 1.7rem;
  font-weight: 700;
}
.bosdga-done h3 { margin-bottom: 8px; }

/* Responsive */
/* Dès que le contenu de l'article est condensé, on passe en une colonne
   pour éviter que calendrier et créneaux se chevauchent. */
@media (max-width: 900px) {
  .bosdga-booking-grid { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .bosdga-fields { grid-template-columns: minmax(0, 1fr); }
  .bosdga-recap { grid-template-columns: minmax(0, 1fr); }
  .bosdga-recap dt { border-bottom: 0; padding-bottom: 2px; }
  .bosdga-recap dd { padding-top: 2px; }
  .bosdga-steps li { min-width: 0; flex: 1 1 45%; font-size: .8rem; }
}

@media (max-width: 600px) {
  .bosdga-app { font-size: 15px; }
  .bosdga-head h2 { font-size: 1.35rem; }
  .bosdga-steps { gap: 4px; }
  .bosdga-steps li { flex: 1 1 100%; padding: 7px 9px; }
  .bosdga-panel { padding: 12px; }
  .bosdga-panel h3 { font-size: 1.05rem; }
  .bosdga-calendar { gap: 3px; }
  .bosdga-cal-cell { aspect-ratio: auto; min-height: 38px; font-size: .85rem; }
  .bosdga-slots { grid-template-columns: repeat(auto-fill, minmax(68px, 1fr)); gap: 6px; }
  .bosdga-slot { flex-direction: column; justify-content: center; gap: 4px; padding: 9px 6px; font-size: .86rem; }
  .bosdga-co { padding: 12px; }
  .bosdga-actions { flex-direction: column-reverse; }
  .bosdga-actions .bosdga-btn { width: 100%; }
  .bosdga-input { font-size: 16px; } /* évite le zoom automatique sur iOS */
}
