/* ------------------------------------------------------------------ */
/* SCALP – Réservation d'œuvre : calendrier + formulaire (front)        */
/* Couleurs reprises du thème (scss/settings/_variables.scss)           */
/* ------------------------------------------------------------------ */
.sro-wrap {
  --sro-primary: #0075bf;
  --sro-dark: #2c486a;
  --sro-light: #f9f4ec;
  --sro-danger: #ec0058;
  --sro-warning: #ff8800;
  --sro-success: #00a438;
  --sro-muted: #b9c2cc;
  --sro-border: rgba(44, 72, 106, 0.15);
  --sro-radius: 6px;
  max-width: 100%;
}

.sro-preview-banner {
  background: #fff4e0;
  border: 1px solid var(--sro-warning);
  color: #7a4100;
  padding: 0.6rem 1rem;
  border-radius: var(--sro-radius);
  margin-bottom: 1.25rem;
  font-size: 0.9em;
}

.sro-intro { margin-bottom: 1.25rem; }

/* Légende */
.sro-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  font-size: 0.85em;
  margin-bottom: 0.75rem;
  color: var(--sro-dark);
}
.sro-legend span { display: inline-flex; align-items: center; gap: 0.4rem; }
.sro-swatch {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 3px;
  border: 1px solid var(--sro-border);
}
.sro-swatch-free { background: #fff; }
.sro-swatch-unavailable { background: var(--sro-muted); }
.sro-swatch-pending { background: #ffd9a8; }
.sro-swatch-selected { background: var(--sro-primary); }

/* Calendrier */
.sro-calendar {
  border: 1px solid var(--sro-border);
  border-radius: var(--sro-radius);
  padding: 1rem;
  background: #fff;
  position: relative;
}
.sro-calendar.is-loading .sro-months { opacity: 0.4; pointer-events: none; }

.sro-cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  gap: 0.5rem;
}
.sro-cal-status { font-size: 0.85em; color: var(--sro-dark); flex: 1; text-align: center; min-height: 1.2em; }
.sro-nav {
  appearance: none;
  border: 1px solid var(--sro-border);
  background: #fff;
  color: var(--sro-primary);
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.sro-nav:hover, .sro-nav:focus { background: var(--sro-primary); color: #fff; outline: none; }

.sro-months {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
}
.sro-month-title {
  text-align: center;
  font-weight: 600;
  color: var(--sro-dark);
  margin-bottom: 0.5rem;
  text-transform: capitalize;
}
.sro-weekdays, .sro-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
}
.sro-weekdays span {
  text-align: center;
  font-size: 0.75em;
  text-transform: uppercase;
  color: var(--sro-dark);
  opacity: 0.7;
  padding-bottom: 0.25rem;
}
.sro-day, .sro-day-empty {
  aspect-ratio: 1 / 1;
  min-height: 34px;
}
.sro-day {
  appearance: none;
  width: 100%;
  border: 1px solid transparent;
  background: #fff;
  border-radius: 4px;
  font: inherit;
  font-size: 0.9em;
  color: var(--sro-dark);
  cursor: pointer;
  padding: 0;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.sro-day.is-free:hover, .sro-day.is-free:focus-visible {
  border-color: var(--sro-primary);
  outline: none;
}
.sro-day:disabled { cursor: not-allowed; }
.sro-day.is-past { color: #b0b7bf; background: #fafafa; text-decoration: line-through; }
.sro-day.is-unavailable { background: var(--sro-muted); color: #fff; }
.sro-day.is-pending { background: #ffd9a8; color: #7a4100; }

.sro-day.is-hover { background: rgba(0, 117, 191, 0.12); }
.sro-day.is-range { background: rgba(0, 117, 191, 0.22); color: var(--sro-dark); }
.sro-day.is-start, .sro-day.is-end {
  background: var(--sro-primary) !important;
  color: #fff !important;
  font-weight: 600;
}

/* Sélection / messages */
.sro-selection {
  margin: 1rem 0;
  padding: 0.75rem 1rem;
  background: var(--sro-light);
  border-radius: var(--sro-radius);
  color: var(--sro-dark);
}
.sro-selection.has-range { background: rgba(0, 117, 191, 0.08); border: 1px solid rgba(0, 117, 191, 0.3); }
.sro-selection.is-error { background: #fdeaf1; border: 1px solid var(--sro-danger); color: #8a0035; }
.sro-link {
  appearance: none;
  background: none;
  border: 0;
  padding: 0;
  margin-left: 0.5rem;
  color: var(--sro-primary);
  text-decoration: underline;
  cursor: pointer;
  font: inherit;
  font-size: 0.9em;
}

/* Formulaire */
.sro-form { margin-top: 1rem; }
.sro-form-title { margin: 1.5rem 0 1rem; }
.sro-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem 1.25rem;
}
@media (max-width: 640px) { .sro-grid { grid-template-columns: 1fr; } }
.sro-field { display: flex; flex-direction: column; gap: 0.3rem; }
.sro-field-full { grid-column: 1 / -1; }
.sro-field label { font-weight: 600; font-size: 0.9em; color: var(--sro-dark); }
.sro-field-check label { font-weight: 400; display: flex; gap: 0.5rem; align-items: flex-start; }
.sro-field-check input[type="checkbox"] { flex: 0 0 auto; margin-top: 0.25em; }
.sro-field-check a { color: var(--sro-primary); text-decoration: underline; }
.sro-field input[type="text"], .sro-field input[type="email"], .sro-field input[type="tel"], .sro-field textarea {
  width: 100%;
  border: 1px solid var(--sro-border);
  border-radius: 4px;
  padding: 0.55rem 0.75rem;
  font: inherit;
  background: #fff;
  color: inherit;
}
.sro-field input:focus, .sro-field textarea:focus {
  border-color: var(--sro-primary);
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 117, 191, 0.15);
}
.sro-field.has-error input, .sro-field.has-error textarea { border-color: var(--sro-danger); }
.sro-field-error { color: var(--sro-danger); font-size: 0.85em; margin: 0; }
.sro-req { color: var(--sro-danger); }
.sro-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

.sro-message { margin: 1rem 0 0; min-height: 0; }
.sro-message.is-error {
  background: #fdeaf1;
  border: 1px solid var(--sro-danger);
  color: #8a0035;
  padding: 0.75rem 1rem;
  border-radius: var(--sro-radius);
}
.sro-message.is-success {
  background: #e6f7ec;
  border: 1px solid var(--sro-success);
  color: #0b5a26;
  padding: 1rem 1.25rem;
  border-radius: var(--sro-radius);
  font-weight: 600;
}
.sro-actions { margin-top: 1.25rem; }
.sro-btn {
  appearance: none;
  border: 0;
  background: var(--sro-primary);
  color: #fff;
  padding: 0.75rem 1.5rem;
  border-radius: 30px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.sro-btn:hover, .sro-btn:focus { background: var(--sro-dark); outline: none; }
.sro-btn:disabled { opacity: 0.6; cursor: wait; }
.sro-note { font-size: 0.85em; color: var(--sro-dark); opacity: 0.8; margin-top: 0.75rem; }

/* Éléments masqués après envoi (prime sur display:grid/flex) */
.sro-wrap [hidden] { display: none !important; }
