@layer modules {
  .booking-error {
    border-radius: var(--radius-md);
    background-color: var(--color-red-50);
    padding: 1rem;
    margin-block: 1rem;
  }

  .booking-error__layout {
    display: flex;
  }

  .booking-error__icon-wrap {
    flex-shrink: 0;
  }

  .booking-error__icon {
    height: 1.25rem;
    width: 1.25rem;
    color: var(--color-red-400);
  }

  .booking-error__body {
    margin-left: 0.75rem;
  }

  .booking-error__title {
    font-size: var(--text-sm);
    line-height: var(--text-sm--line-height);
    font-weight: var(--font-weight-medium);
    color: var(--color-red-800);
  }

  .booking-error__message {
    margin-top: 0.5rem;
    font-size: var(--text-sm);
    line-height: var(--text-sm--line-height);
    color: var(--color-red-700);
  }

  .booking-success {
    text-align: center;
    padding-block: 2rem;
  }

  .booking-success__icon-wrap {
    margin-bottom: 1rem;
  }

  .booking-success__icon {
    margin-inline: auto;
    height: 3rem;
    width: 3rem;
    color: var(--color-green-500);
  }

  .booking-success__title {
    font-size: var(--text-2xl);
    line-height: var(--text-2xl--line-height);
    font-weight: var(--font-weight-semibold);
    color: var(--color-gray-900);
    margin-bottom: 0.5rem;
  }

  .booking-success__lead {
    color: var(--color-gray-600);
  }

  .booking-success__time {
    font-size: var(--text-lg);
    line-height: var(--text-lg--line-height);
    font-weight: var(--font-weight-medium);
    color: var(--color-gray-800);
    margin-top: 0.5rem;
  }

  .booking-success__meet {
    margin-top: 1rem;
  }

  .booking-success__address {
    font-size: var(--text-sm);
    line-height: var(--text-sm--line-height);
    color: var(--color-gray-500);
    margin-top: 0.75rem;
    white-space: pre-line;
  }

  .booking-success__note {
    font-size: var(--text-sm);
    line-height: var(--text-sm--line-height);
    color: var(--color-gray-500);
    margin-top: 0.75rem;
  }

  .booking-meet-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding-inline: 0.75rem;
    padding-block: 0.25rem;
    font-size: var(--text-sm);
    line-height: var(--text-sm--line-height);
    font-weight: var(--font-weight-medium);
    border-radius: var(--radius-full);
  }

  .booking-meet-pill--in-person {
    background-color: var(--color-violet-50);
    color: var(--color-violet-700);
  }

  .booking-meet-pill--telehealth {
    background-color: var(--color-blue-50);
    color: var(--color-blue-700);
  }

  .booking-meet-pill__icon {
    height: 1rem;
    width: 1rem;
  }

  .booking-page {
    /* No max-width: there is no 8xl container token in the build. */
    margin-inline: auto;
    padding-block: 4rem;
    padding-inline: 1rem;

    @media (min-width: 40rem) {
      padding-inline: 1.5rem;
    }

    @media (min-width: 64rem) {
      padding-inline: 2rem;
    }
  }

  .booking-page__main {
    flex: 1;
    min-width: 0;
  }

  .booking-hero {
    background-image: linear-gradient(to right in oklab, var(--color-blue-600), var(--color-indigo-700));
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 2rem;
    margin-bottom: 2rem;
  }

  .booking-hero__row {
    display: flex;
    align-items: center;
  }

  .booking-hero__intro {
    flex: 1;
  }

  .booking-hero__title {
    font-weight: var(--font-weight-bold);
    font-size: var(--text-4xl);
    line-height: var(--text-4xl--line-height);
    color: var(--color-white);
  }

  .booking-hero__subtitle {
    color: var(--color-blue-100);
    margin-top: 0.5rem;
    font-size: var(--text-lg);
    line-height: var(--text-lg--line-height);
  }

  .booking-hero__art {
    display: none;
    margin-left: 4rem;
    font-size: var(--text-8xl);
    line-height: var(--text-8xl--line-height);

    @media (min-width: 48rem) {
      display: block;
    }
  }

  .booking-hero__art-icon {
    color: var(--color-white);
    height: 8rem;
    width: 8rem;
  }

  .booking-panel {
    background-color: var(--color-white);
    box-shadow: var(--shadow-sm);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
  }

  .booking-section-title {
    font-size: var(--text-lg);
    line-height: var(--text-lg--line-height);
    font-weight: var(--font-weight-semibold);
    margin-bottom: 1rem;
  }

  .booking-timezone {
    margin-bottom: 1.5rem;
  }

  .booking-timezone__control {
    margin-top: 0.25rem;
  }

  .booking-timezone__select {
    margin-top: 0.25rem;
    display: block;
    width: 100%;
    padding-left: 0.75rem;
    padding-right: 2.5rem;
    padding-block: 0.5rem;
    font-size: var(--text-base);
    line-height: var(--text-base--line-height);
    border-color: var(--color-gray-300);
    border-radius: var(--radius-md);

    &:focus {
      --focus-ring-color: var(--color-indigo-500);
    }

    @media (min-width: 40rem) {
      font-size: var(--text-sm);
      line-height: var(--text-sm--line-height);
    }
  }

  .booking-events {
    margin-bottom: 1.5rem;
  }

  .booking-event-grid {
    display: grid;
    grid-template-columns: repeat(1, minmax(0, 1fr));
    gap: 1.5rem;

    @media (min-width: 48rem) {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    @media (min-width: 64rem) {
      grid-template-columns: repeat(3, minmax(0, 1fr));
    }
  }

  .booking-event {
    cursor: pointer;
    background-color: var(--color-white);
    border-style: solid;
    border-width: 1px;
    border-color: var(--color-gray-200);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    transition: var(--default-transition-duration) var(--default-transition-timing-function);
    transition-property: color, background-color, border-color, outline-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, translate, scale, rotate, filter, -webkit-backdrop-filter, backdrop-filter, display, content-visibility, overlay, pointer-events;

    &:hover {
      border-color: var(--color-blue-500);
      box-shadow: var(--shadow-md);
    }
  }

  .booking-event__inner {
    display: flex;
    flex-direction: column;
    height: 100%;
  }

  .booking-event__title {
    font-weight: var(--font-weight-semibold);
    color: var(--color-gray-900);
    font-size: var(--text-lg);
    line-height: var(--text-lg--line-height);
    margin-bottom: 0.5rem;

    .booking-event:hover & {
      color: var(--color-blue-600);
    }
  }

  .booking-event__description {
    color: var(--color-gray-600);
    font-size: var(--text-sm);
    line-height: var(--text-sm--line-height);
    margin-bottom: 1rem;
    flex-grow: 1;
  }

  .booking-event__meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--color-gray-500);
    font-size: var(--text-sm);
    line-height: var(--text-sm--line-height);
  }

  .booking-event__meta-item {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
  }

  .booking-event__meta-item--video {
    color: var(--color-blue-600);
  }

  .booking-event__meta-item--in-person {
    color: var(--color-violet-600);
  }

  .booking-event__meta-icon {
    height: 1rem;
    width: 1rem;
  }

  .booking-visit-type {
    margin-bottom: 1.5rem;
  }

  .booking-visit-type__grid {
    display: grid;
    grid-template-columns: repeat(1, minmax(0, 1fr));
    gap: 1rem;

    @media (min-width: 48rem) {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }
  }

  .booking-visit-option {
    display: flex;
    flex-direction: column;
    cursor: pointer;
    border-style: solid;
    border-width: 2px;
    border-color: var(--color-gray-200);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    text-align: left;
    transition: var(--default-transition-duration) var(--default-transition-timing-function);
    transition-property: color, background-color, border-color, outline-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, translate, scale, rotate, filter, -webkit-backdrop-filter, backdrop-filter, display, content-visibility, overlay, pointer-events;

    &:hover {
      border-color: var(--color-blue-500);
      box-shadow: var(--shadow-md);
    }
  }

  .booking-visit-option__head {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
  }

  .booking-visit-option__icon {
    height: 1.5rem;
    width: 1.5rem;
    color: var(--color-blue-600);
  }

  .booking-visit-option__title {
    font-weight: var(--font-weight-semibold);
    color: var(--color-gray-900);
    font-size: var(--text-lg);
    line-height: var(--text-lg--line-height);
  }

  .booking-visit-option__text {
    font-size: var(--text-sm);
    line-height: var(--text-sm--line-height);
    color: var(--color-gray-600);
  }

  .booking-visit-option__address {
    font-size: var(--text-xs);
    line-height: var(--text-xs--line-height);
    color: var(--color-gray-400);
    margin-top: 0.5rem;
    white-space: pre-line;
  }

  .booking-visit-type__prompt {
    font-size: var(--text-sm);
    line-height: var(--text-sm--line-height);
    color: var(--color-gray-500);
    margin-top: 0.75rem;
  }

  .booking-calendar {
    width: 100%;
    display: flex;
    flex-direction: column;
    background-color: var(--color-white);
    border-style: solid;
    border-width: 1px;
    border-color: var(--color-gray-200);
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius-xl);
    overflow: hidden;
  }

  .booking-calendar__nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom-style: solid;
    border-bottom-width: 1px;
    border-bottom-color: var(--color-gray-200);
  }

  .booking-calendar__nav-link {
    display: flex;
    align-items: center;
    color: var(--color-gray-800);

    &:hover {
      color: var(--color-blue-600);
    }
  }

  .booking-calendar__nav-link--disabled {
    color: var(--color-gray-400);
    cursor: not-allowed;

    &:hover {
      color: var(--color-gray-400);
    }
  }

  .booking-calendar__nav-icon {
    width: 1rem;
    height: 1rem;
  }

  .booking-calendar__nav-icon--prev {
    margin-right: 0.25rem;
  }

  .booking-calendar__nav-icon--next {
    margin-left: 0.25rem;
  }

  .booking-calendar__nav-label {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .booking-calendar__nav-range {
    color: var(--color-gray-800);
    font-weight: var(--font-weight-medium);
  }

  .booking-calendar__nav-timezone {
    font-size: var(--text-xs);
    line-height: var(--text-xs--line-height);
    color: var(--color-gray-500);
  }

  .booking-calendar__week {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 1px;
    background-color: var(--color-gray-200);
  }

  .booking-day {
    background-color: var(--color-white);
    padding: 1rem;
    transition: 0.2s var(--default-transition-timing-function);
    transition-property: color, background-color, border-color, outline-color, text-decoration-color, fill, stroke;

    &:hover {
      background-color: var(--color-gray-100);
    }

    &:disabled {
      opacity: 0.5;
      cursor: not-allowed;
    }

    &:disabled:hover {
      background-color: var(--color-white);
    }

    &:focus-visible {
      outline: var(--focus-ring);
      outline-offset: var(--focus-ring-offset);
    }
  }

  .booking-day__weekday {
    display: block;
    font-size: var(--text-sm);
    line-height: var(--text-sm--line-height);
    color: var(--color-gray-500);
  }

  .booking-day__date {
    display: block;
    margin-top: 0.5rem;
    font-size: var(--text-sm);
    line-height: var(--text-sm--line-height);
    color: var(--color-gray-800);
  }

  .booking-day__count {
    margin-top: 0.25rem;
    display: block;
    font-size: var(--text-xs);
    line-height: var(--text-xs--line-height);
    color: var(--color-blue-600);
  }

  .booking-slots {
    padding: 1rem;
    border-top-style: solid;
    border-top-width: 1px;
    border-top-color: var(--color-gray-200);
  }

  .booking-slots__date {
    font-size: var(--text-lg);
    line-height: var(--text-lg--line-height);
    font-weight: var(--font-weight-medium);
    color: var(--color-gray-900);
    margin-bottom: 1rem;
  }

  .booking-slots__list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;

    @media (min-width: 40rem) {
      grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    @media (min-width: 48rem) {
      grid-template-columns: repeat(4, minmax(0, 1fr));
    }
  }

  .booking-dialog {
    position: fixed;
    inset: 0;
    background-color: var(--color-gray-500-75);
    align-items: center;
    justify-content: center;
    overscroll-behavior: contain;
  }

  .booking-dialog__panel {
    background-color: var(--color-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    max-width: 28rem;
    width: 100%;
    margin-inline: 1rem;
  }

  .booking-dialog__body {
    padding: 1.5rem;
  }

  .booking-dialog__title {
    font-size: var(--text-lg);
    line-height: var(--text-lg--line-height);
    font-weight: var(--font-weight-medium);
    color: var(--color-gray-900);
    margin-bottom: 0.25rem;
  }

  .booking-dialog__subtitle {
    font-size: var(--text-sm);
    line-height: var(--text-sm--line-height);
    color: var(--color-gray-500);
    margin-bottom: 1rem;
  }

  .booking-dialog__meet-icon {
    height: 1rem;
    width: 1rem;
    display: inline-block;
    margin-top: -0.125rem;
  }

  .booking-dialog__meet-icon--in-person {
    color: var(--color-violet-600);
  }

  .booking-dialog__meet-icon--telehealth {
    color: var(--color-blue-600);
  }

  .booking-dialog__fields {
    & > :not(:last-child) {
      margin-block-end: 1rem;
    }
  }

  .booking-dialog__input {
    margin-top: 0.25rem;
    display: block;
    width: 100%;
    border-radius: var(--radius-md);
    border-color: var(--color-gray-300);
    box-shadow: var(--shadow-xs);
    font-size: var(--text-sm);
    line-height: var(--text-sm--line-height);

    &:focus {
      --focus-ring-color: var(--color-blue-500);
    }
  }

  .booking-dialog__actions {
    margin-top: 1.5rem;
    display: flex;
    justify-content: flex-end;

    & > :not(:last-child) {
      margin-inline-end: 0.75rem;
    }
  }

}

@layer modules {
  /* Selection state is toggled from bookings_controller.js. Rings are flattened to a 2px box-shadow. */
  .booking-event--selected {
    box-shadow: 0 0 0 2px var(--color-blue-500);
  }

  /* Preserve the base hover shadow alongside the ring when a card is selected. */
  .booking-event--selected:hover {
    box-shadow:
      0 0 0 2px var(--color-blue-500),
      var(--shadow-md);
  }

  .booking-visit-option--selected {
    border-color: var(--color-blue-500);
    background-color: var(--color-blue-50);
    box-shadow: 0 0 0 2px var(--color-blue-500);
  }

  .booking-visit-option--selected:hover {
    border-color: var(--color-blue-500);
    box-shadow:
      0 0 0 2px var(--color-blue-500),
      var(--shadow-md);
  }
}
