/* Page-specific rules. The design system itself (tokens, components, app shell) is in theme.css. */

.validation-summary-valid {
  display: none;
}

/* Bootstrap's display utilities (d-flex and the like) are !important and would otherwise show an element marked hidden */
[hidden] {
  display: none !important;
}

/* Reserves the line of each validation message, so clearing one on blur does not move the submit button out from under the click */
.field-validation-valid,
.field-validation-error {
  display: block;
  min-height: 1.375rem;
  margin-top: 0.125rem;
  line-height: 1.375rem;
}

/* That reserved line already spaces the fields: the usual margin under them would double it */
.mb-3:has(> .field-validation-valid, > .field-validation-error) {
  margin-bottom: 0.375rem !important;
}

.color-swatch {
  display: inline-block;
  width: 0.75em;
  height: 0.75em;
  border-radius: 50%;
  vertical-align: 0.02em;
}

/* Agenda (EventCalendar). Each event carries its practitioner's color in --lu-couleur (agenda.js).
   Every rule goes through .agenda-surface, since event-calendar.min.css loads after this file. */
.agenda-surface .ec {
  color-scheme: light;
  --ec-bg-color: var(--lu-surface);
  --ec-day-bg-color: var(--lu-surface);
  --ec-border-color: var(--lu-trait);
  --ec-today-bg-color: var(--lu-surface);
  --ec-highlight-color: var(--lu-voile);
  --ec-button-bg-color: var(--lu-surface);
  --ec-button-border-color: var(--lu-trait-fort);
  --ec-button-text-color: var(--lu-encre);
  --ec-button-active-bg-color: var(--lu-nuit);
  --ec-button-active-border-color: var(--lu-nuit);
  --ec-button-active-text-color: var(--lu-papier);
  --ec-now-indicator-color: var(--lu-nuit);
  font-variant-numeric: tabular-nums;
}

.agenda-surface .ec .ec-toolbar {
  margin-bottom: 0.875rem;
}

.agenda-surface .ec .ec-title {
  font-family: var(--lu-police-titre);
  font-size: 1.375rem;
  font-weight: 400;
}

.agenda-surface .ec .ec-title::first-letter {
  text-transform: uppercase;
}

.agenda-surface .ec .ec-button {
  min-height: 2.5rem;
  padding: 0.375rem 0.875rem;
  border-radius: var(--lu-rayon);
  font-size: 0.875rem;
  font-weight: 600;
}

.agenda-surface .ec .ec-button:not(:disabled):not(.ec-active):hover {
  background: var(--lu-voile);
}

.agenda-surface .ec .ec-button:disabled {
  color: var(--lu-mousse);
}

.agenda-surface .ec .ec-col-head {
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.5rem 0.25rem;
}

/* A day's head: its weekday above its number. Today's number sits in the ding, the glow that marks what is now. */
.agenda-surface .ec .ec-col-head .agenda-weekday {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--lu-mousse);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.agenda-surface .ec .ec-col-head .agenda-monthday {
  display: inline-grid;
  place-items: center;
  width: 1.875rem;
  height: 1.875rem;
  margin-top: 0.125rem;
  border-radius: 50%;
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--lu-encre);
}

.agenda-surface .ec .ec-col-head.ec-today .agenda-weekday {
  color: var(--lu-encre);
}

.agenda-surface .ec .ec-col-head.ec-today .agenda-monthday {
  background: var(--lu-lueur);
  box-shadow: 0 0 0 2px var(--lu-nuit);
}

/* In the week, today's column takes a veil, so the eye lands on it first. In the day view every column is today. */
.agenda-surface [data-view="timeGridWeek"] .ec {
  --ec-today-bg-color: var(--lu-voile);
}

.agenda-surface .ec .ec-sidebar {
  color: var(--lu-mousse);
  font-size: 0.8125rem;
}

/* The current time: a night line, and the ding at its start */
.agenda-surface .ec .ec-now-indicator::before {
  background: var(--lu-lueur);
  box-shadow: 0 0 0 2px var(--lu-nuit);
}

.agenda-surface .ec .ec-event {
  border-radius: 5px;
  padding: 3px 5px;
  cursor: pointer;
}

.agenda-surface .ec .ec-event:not(.ec-list .ec-event) {
  color: var(--lu-encre);
  background-color: color-mix(in srgb, var(--lu-couleur, #858e9e) 17%, #fff) !important;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--lu-couleur, #858e9e) 50%, #fff);
}

.agenda-surface .ec .ec-event-title {
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.25;
}

.agenda-surface .ec .ec-event-time {
  font-size: 0.8125rem;
  color: var(--lu-mousse);
}

/* A free slot is a path not taken yet: dashed, in its practitioner's color */
.agenda-surface .ec .ec-event.agenda-slot:not(.ec-list .ec-event) {
  background-color: var(--lu-surface) !important;
  box-shadow: none;
  border: 1.5px dashed color-mix(in srgb, var(--lu-couleur, #858e9e) 70%, #fff);
}

.agenda-surface .ec .ec-event.agenda-slot .ec-event-title {
  color: var(--lu-mousse);
  font-weight: 400;
}

.agenda-surface .ec .ec-event.agenda-cancelled {
  opacity: 0.55;
  text-decoration: line-through;
}

/* The day's list, on a phone */
.agenda-surface .ec-list .ec-day-head {
  padding: 0.625rem 0.875rem;
  font-size: 0.9375rem;
  font-weight: 650;
  background: var(--lu-papier);
}

.agenda-surface .ec-list .ec-day-head * {
  font-size: inherit;
}

.agenda-surface .ec-list .ec-event {
  align-items: center;
  padding: 0.75rem 0.875rem;
  border-bottom: 1px solid var(--lu-trait);
  min-height: 3.25rem;
}

.agenda-surface .ec-list .ec-event-tag {
  inline-size: 0.625rem;
  block-size: 0.625rem;
  border-radius: 50%;
  margin-inline-end: 0.75rem;
  flex: none;
}

.agenda-surface .ec-list .ec-event.agenda-slot .ec-event-tag {
  background: transparent !important;
  border: 1.5px dashed var(--lu-couleur, #858e9e);
}

.agenda-surface .ec-list .ec-event-time {
  min-width: 6.5rem;
  font-size: 0.875rem;
}

.agenda-surface .ec-list .ec-event-title {
  font-size: 1rem;
}

.agenda-surface .ec .ec-no-events {
  color: var(--lu-mousse);
  padding: 3rem 0;
}

.agenda-surface {
  background: var(--lu-surface);
  border: 1px solid var(--lu-trait);
  border-radius: var(--lu-rayon-grand);
  padding: 0.875rem;
}

@media (max-width: 767.98px) {
  .agenda-surface {
    padding: 0.625rem 0 0;
    border-radius: var(--lu-rayon);
  }

  .agenda-surface .ec-toolbar {
    padding: 0 0.625rem;
  }

  /* Seven days across a phone, as in Google Calendar: the name alone, small, wrapping where it must */
  .agenda-surface [data-view="timeGridWeek"] .ec .ec-event {
    padding: 1px 2px;
  }

  .agenda-surface [data-view="timeGridWeek"] .ec .ec-event-time {
    display: none;
  }

  .agenda-surface [data-view="timeGridWeek"] .ec .ec-event-title {
    font-size: 0.6875rem;
    line-height: 1.15;
    overflow-wrap: anywhere;
  }

  /* A free slot is its dashed outline: « Libre » no longer fits */
  .agenda-surface [data-view="timeGridWeek"] .ec .ec-event.agenda-slot .ec-event-title {
    visibility: hidden;
  }

  .agenda-surface [data-view="timeGridWeek"] .ec .ec-col-head {
    font-size: 0.75rem;
  }
}

/* Public booking page: narrow enough to read in the clinic's site */
.booking-container {
  max-width: 46rem;
}

/* A day name that starts a line takes a capital: « Mardi 20 octobre » */
.first-letter-upper::first-letter {
  text-transform: uppercase;
}

/* In an iframe of the clinic's site, the site shows its own header */
.booking-embedded .booking-header {
  display: none;
}

.booking-embedded body {
  padding-top: 0.5rem;
}

/* The clinic's color, chosen in the Intégration page */
.booking-colored .btn-primary {
  --bs-btn-bg: var(--booking-color);
  --bs-btn-border-color: var(--booking-color);
  --bs-btn-hover-bg: var(--booking-color);
  --bs-btn-hover-border-color: var(--booking-color);
  --bs-btn-active-bg: var(--booking-color);
  --bs-btn-active-border-color: var(--booking-color);
}

.booking-colored .btn-outline-primary {
  --bs-btn-color: var(--booking-color);
  --bs-btn-border-color: var(--booking-color);
  --bs-btn-hover-bg: var(--booking-color);
  --bs-btn-hover-border-color: var(--booking-color);
  --bs-btn-hover-color: #fff;
  --bs-btn-active-bg: var(--booking-color);
  --bs-btn-active-border-color: var(--booking-color);
  --bs-btn-active-color: #fff;
}

.booking-colored .btn-primary:hover,
.booking-colored .btn-outline-primary:hover {
  filter: brightness(0.9);
}

.booking-colored .nav-pills {
  --bs-nav-pills-link-active-bg: var(--booking-color);
}

.booking-colored .nav-pills .nav-link.active {
  border-color: var(--booking-color);
}

/* Off screen rather than display: none, which some robots skip */
.booking-trap {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Patient pages: white, since they often sit inside the clinic's own site */
.lu-reservation {
  --bs-body-bg: var(--lu-surface);
  background: var(--lu-surface);
}

.booking-header {
  border-bottom: 1px solid var(--lu-trait);
  padding: 1.125rem 0;
}

.booking-clinique {
  font-family: var(--lu-police-titre);
  font-size: 1.375rem;
  line-height: 1.2;
  color: var(--lu-encre);
  text-decoration: none;
}

.booking-par {
  display: inline-flex;
  align-items: baseline;
  gap: 0.375rem;
}

.booking-par .lu-marque {
  height: 1.127rem;
  width: auto;
  color: var(--lu-encre);
  align-self: center;
  /* Centres the letters, not the bell's button above them nor the g's tail */
  margin-top: -0.099rem;
  margin-bottom: -0.228rem;
}

.booking-par .lu-ding {
  fill: #9cb526;
}

/* An hour to choose: big enough for any finger, the practitioner's name under the time */
.booking-slot {
  min-width: 5.5rem;
  padding-top: 0.625rem;
  padding-bottom: 0.625rem;
  line-height: 1.2;
}

.booking-slot .small {
  font-weight: 400;
  margin-top: 0.125rem;
}

.booking-slots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(5.75rem, 1fr));
  gap: 0.5rem;
}

/* Wide enough for the practitioner's name on one line */
.booking-slots-names {
  grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr));
}
