#dispo {max-width: 640px; margin: 0 auto; }

.dispo-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  margin-bottom: 15px;
}

.dispo-nav-btn {
  background: none;
  border: 1px solid #ccc;
  border-radius: 4px;
  width: 36px;
  height: 36px;
  font-size: 20px;
  cursor: pointer;
  color: var(--dispo-accent);
}

.dispo-nav-btn:hover { background: #f5f5f5; }
.dispo-nav-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.dispo-month-title {
  font: 600 1.05rem/1.4 system-ui;
  text-transform: capitalize;
  color: var(--dispo-accent);
  margin: 0;
  min-width: 140px;
  text-align: center;
}

.dispo-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px;   width: 100%;
  max-width: 100%;}

.dispo-dow {
  font: 600 11px/1 system-ui;
  text-align: center;
  padding: 6px 0;
  color: #777;
}

.dispo-day {
  aspect-ratio: 1 / 1;
  display: flex;
  flex-direction: column; 
  align-items: center; 
  justify-content: center; 
  gap: 2px; 
  padding: 3px 0;        /* moins de padding interne */
  font-family: system-ui, sans-serif;
  font-size: clamp(15px, 4.5vw, 19px);
  font-weight: 600;
  border-radius: 4px;
  min-height: 0;     /* permet le flex-shrink si besoin */
  max-height: 80px;  /* limite absolue */
  overflow: hidden;  /* coupe ce qui déborde */
  box-sizing: border-box;
}


.dispo-free { background: color-mix(in srgb, var(--dispo-accent) 50%, #fff); color: #fff; }
.dispo-busy { background: #eef2f5; color: #55606a; }
.dispo-empty { background: transparent; }
.dispo-today { outline: 2px solid #222; outline-offset: -2px; }
.dispo-past { opacity: 0.4; background: #eef2f5; color: #55606a; }

.dispo-busy .dispo-day-num {
  text-decoration: line-through;
  text-decoration-thickness: 2px;
}
.dispo-past .dispo-day-num {
  text-decoration: line-through;
  text-decoration-thickness: 2px;
}

.dispo-status {
  font: 400 12px/1.5 system-ui;
  color: #666;
  text-align: center;
  margin: 15px 0 0;
}

.dispo-error { color: #b3261e; }
.dispo-count { font-weight: 500; color: #333; }


/* --- Sélection de période ------------------------------------------- */

.dispo-clickable { cursor: pointer; }

.dispo-clickable:hover {
  box-shadow: inset 0 0 0 2px var(--dispo-accent);
}

.dispo-clickable:focus-visible {
  outline: 2px solid var(--dispo-accent);
  outline-offset: 2px;
}

/* Jours intermédiaires de la période */
.dispo-in-range {
  background: #ececec;                                              /* repli */
  background: color-mix(in srgb, var(--dispo-accent) 90%, #fff);
}

/* Bornes de la période */
.dispo-start,
.dispo-end {
  background: var(--dispo-accent);
  color: #fff;
  font-weight: 600;
}

/* --- Prix sur dates sélectionnées (texte blanc pour contraste) --- */

.dispo-start .dispo-price,
.dispo-end .dispo-price {
  color: #fff !important;
}

.dispo-in-range .dispo-price {
  color: #fff !important;
}

.dispo-start .dispo-day-num,
.dispo-end .dispo-day-num { color: #fff; }

/* Message sous le calendrier */
.dispo-hint {
  margin-top: .75rem;
  min-height: 1.4em;
  font-size: .9rem;
  text-align: center;
  color: var(--gray, #666);
}
.dispo-hint.is-error {
  color: #c0392b;
  font-weight: 600;
}

/* Surbrillance du formulaire au moment du report */
.flash-target { animation: dispoFlash 1.4s ease-out; }

@keyframes dispoFlash {
  from { box-shadow: 0 0 0 3px rgba(109, 74, 255, .55); }
  to   { box-shadow: 0 0 0 3px rgba(109, 74, 255, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .flash-target { animation: none; }
}

/* Date frontière : première date indisponible après sélection */
.dispo-frontier {
  border: 2px dashed var(--dispo-accent);
  background-color: rgba(192, 57, 43, 0.15);
  cursor: pointer;
}

.dispo-frontier:hover {
  background-color: rgba(192, 57, 43, 0.3);
}


/* --- Prix sous chaque date --- */
.dispo-available .dispo-price {
  display: block;
  font-size: 0.7em;
  font-weight: bold;
  color: var(--dispo-accent);
  margin-top: 0;
  
  position: relative;
  max-width: 100%;
}

.dispo-unavailable .dispo-price,
.dispo-past .dispo-price {
  display: none;
}

.price-missing {
  opacity: 0.5;
}


/* --- Layout deux colonnes --- */
.dispo-layout {
  display: flex;
  gap: 30px;
  max-width: 1200px;
  margin: 0 auto;
}

.dispo-sidebar {
  flex: 0 0 320px;
  padding: 20px;
  background: #fafafa;
  border-radius: 8px;
  height: fit-content;
}

.dispo-sidebar h3 {
  margin: 0 0 20px;
  color: var(--dispo-accent);
}

.dispo-calendar-wrapper {
  flex: 1 1 auto;
}

/* Formulaire : labels au-dessus des champs */
.dispo-sidebar label {
  display: block;
  margin-bottom: 4px;
  font-weight: 500;
  color: #555;
  font-size: 0.9rem;
}

.dispo-sidebar input[type="date"],
.dispo-sidebar select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 1rem;
  background: #fff;
}

/* Champs readonly : grisés, non focussables */
.dispo-sidebar input[readonly] {
  background: #f0f0f0;
  color: #666;
  cursor: not-allowed;
}

.dispo-sidebar input[readonly]:focus {
  outline: none;
  border-color: #ccc;
}

/* Sélecteur de personnes */
.dispo-person-select {
  margin-bottom: 20px;
}

/* Récapitulatif tarifaire */
.dispo-price-summary {
  background: #fff;
  padding: 15px;
  margin: 20px 0;
  border-left: 4px solid var(--dispo-accent);
  border-radius: 0 4px 4px 0;
  font-size: 1.05em;
}

.dispo-submit-btn {
  width: 100%;
  padding: 12px;
  background: var(--dispo-accent);
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.dispo-submit-btn:hover {
  filter: brightness(1.1);
}

/* --- Responsive : mobile = une colonne --- */
@media (max-width: 768px) {
  .dispo-layout {
    flex-direction: column;
    gap: 20px;
  }

  .dispo-sidebar {
    flex: none;
    width: 100%;
  }

  .dispo-calendar-wrapper {
    width: 100%;
  }
}

.dispo-price-hidden .dispo-price {
  display: none;  /* <- déjà géré par JS, mais safe fallback */
}

/* --- Calendrier bloqué (attente de sélection de personnes) --- */
.dispo-disabled {
  opacity: 0.4;
  filter: grayscale(1);
  pointer-events: none;  /* Empêche TOUT clic sur le calendrier */
}

/* Les boutons de navigation doivent aussi être grisés */
.dispo-disabled .dispo-nav-btn {
  opacity: 0.5;
  cursor: not-allowed;
}
