/*
 * crm_bookings: the booking stage's day and time picker.
 *
 * Theme-neutral. A theme sets the colours through these properties rather than
 * overriding the rules:
 *   --bk-accent      selected day and time, focus ring
 *   --bk-on-accent   text on the accent
 *   --bk-border      the outline of a day or time
 *   --bk-muted       secondary text
 */

.bk-picker {
  --bk-accent-fallback: #1f3a5f;
  margin: 0 0 1.5rem;
}

.bk-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 1rem;
  margin: 0 0 0.5rem;
}

.bk-summary span,
.bk-description,
.bk-weekday,
.bk-day small {
  color: var(--bk-muted, inherit);
  opacity: 0.8;
}

.bk-notice,
.bk-error,
.bk-empty {
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  border: 1px solid var(--bk-border, rgba(0, 0, 0, 0.15));
}

.bk-error {
  border-color: #b42318;
  color: #b42318;
}

.bk-label {
  display: block;
  margin: 0 0 0.5rem;
  padding: 0;
  font-weight: 600;
  font-size: 1rem;
}

.bk-columns {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 768px) {
  .bk-columns {
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  }
}

/* Days: a week per row, Monday first. */
.bk-days__grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.375rem;
}

.bk-weekday {
  font-size: 0.75rem;
  text-align: center;
  text-transform: uppercase;
}

.bk-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0.25rem 0;
  border: 1px solid var(--bk-border, rgba(0, 0, 0, 0.15));
  border-radius: 0.5rem;
  color: inherit;
  font-weight: 600;
  line-height: 1.1;
  text-decoration: none;
}

.bk-day small {
  font-size: 0.625rem;
  font-weight: 400;
  text-transform: uppercase;
}

a.bk-day:hover,
a.bk-day:focus-visible,
.bk-day.is-selected {
  border-color: var(--bk-accent, var(--bk-accent-fallback));
  box-shadow: inset 0 0 0 1px var(--bk-accent, var(--bk-accent-fallback));
  text-decoration: none;
}

.bk-day.is-disabled {
  font-weight: 400;
  opacity: 0.35;
}

.bk-day.is-blank {
  border-color: transparent;
}

/* Times for the chosen day. */
.bk-slots {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.bk-slots.htmx-request {
  opacity: 0.5;
}

.bk-slots__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(6.5rem, 1fr));
  gap: 0.5rem;
}

.bk-slot {
  position: relative;
  margin: 0;
}

.bk-slot input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.bk-slot span {
  display: block;
  padding: 0.625rem 0.5rem;
  border: 1px solid var(--bk-border, rgba(0, 0, 0, 0.15));
  border-radius: 0.5rem;
  text-align: center;
}

.bk-slot input:checked + span {
  border-color: transparent;
  background: var(--bk-accent, var(--bk-accent-fallback));
  color: var(--bk-on-accent, #fff);
}

.bk-slot input:focus-visible + span {
  outline: 2px solid var(--bk-accent, var(--bk-accent-fallback));
  outline-offset: 2px;
}

.bk-tz {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.25rem;
  font-size: 0.875rem;
}

.bk-tz select {
  max-width: 100%;
}

.bk-confirm {
  margin-top: 1rem;
}

.bk-cancel textarea {
  display: block;
  width: 100%;
}

/* The booking as shown on the opportunity's resume page. */
.bk-booked {
  margin: 1rem auto;
  max-width: 32rem;
}

.bk-booked p {
  margin-bottom: 0.5rem;
}
