/* Booking page and the palette passed to the Cal.com embed. */
.reference-book {
  --book-dark: #101416;
  --book-paper: #fcfbf9;
  --book-warm: #f4f1ed;
  --book-white: #ffffff;
  --book-line: var(--line-strong);
  --book-field-border: var(--border);
  --book-muted: var(--muted);
  --book-orange: #ff5800;
  --book-accent: #bb3900;
  --book-accent-hover: var(--book-dark);
  --accent: var(--book-accent);
  --ink: var(--book-dark);
  background: var(--book-warm);
  color: var(--book-dark);

  & [hidden] {
    display: none !important;
  }

  & .book-wrap {
    width: min(100% - 48px, 1152px);
    margin-inline: auto;
  }

  & .book-hero {
    position: relative;
    isolation: isolate;
    overflow: clip;
    padding-block: clamp(27px, 2.9vw, 43px) clamp(58px, 5.6vw, 82px);
    background: var(--book-dark);
    color: var(--book-white);
  }

  & .book-art {
    position: absolute;
    z-index: -1;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: right center;
  }

  & .book-label {
    border-inline-start: 5px solid var(--book-orange);
    padding-inline-start: 11px;
    font-size: clamp(12px, 1.32vw, 16px);
    font-weight: 800;
    letter-spacing: 0.025em;
    line-height: 1.35;
    text-transform: uppercase;
  }

  & h1 {
    max-width: 740px;
    margin-top: 12px;
    color: var(--book-white);
    font-size: clamp(37px, 5vw, 64px);
    font-weight: 880;
    letter-spacing: -0.058em;
    line-height: 0.98;
  }

  & .book-duration {
    white-space: nowrap;
  }

  & h1 [data-book-title] {
    display: block;
    color: var(--book-orange);
  }

  & .book-lede {
    max-width: 540px;
    margin-top: 15px;
    font-size: clamp(16px, 1.5vw, 19px);
    line-height: 1.4;
  }

  & .book-stage {
    display: flow-root;
    padding-bottom: clamp(24px, 3.2vw, 43px);
  }

  & .book-panel {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 0.88fr) minmax(0, 1.12fr);
    align-items: start;
    gap: 20px clamp(18px, 3vw, 37px);
    margin-top: clamp(-46px, -3.3vw, -30px);
    padding: clamp(18px, 2.7vw, 36px);
    border: 1px solid var(--book-line);
    border-radius: 17px;
    background: var(--book-paper);
    box-shadow: 0 9px 25px rgb(16 20 22 / 8%);
  }

  & :is(.book-form, .book-calendar) h2 {
    font-size: clamp(23px, 2.35vw, 31px);
    font-weight: 850;
    letter-spacing: -0.046em;
    line-height: 1.08;
  }

  & :is(.book-form, .book-calendar-heading) > p {
    margin-top: 6px;
    color: var(--book-muted);
    line-height: 1.45;
  }

  & .book-form {
    padding-inline-end: clamp(18px, 3vw, 37px);
    border-inline-end: 1px solid var(--book-line);
  }

  & .book-fields {
    display: grid;
    gap: 15px;
    margin-block: 21px;
  }

  & .book-fields label {
    display: block;
    margin-bottom: 6px;
    font-weight: 750;
    line-height: 1.3;
  }

  & .book-fields label span {
    color: var(--book-accent);
  }

  & .book-input {
    position: relative;
  }

  & .book-input .reference-icon {
    position: absolute;
    inset: 50% auto auto 13px;
    transform: translateY(-50%);
    color: var(--book-dark);
    font-size: 20px;
    pointer-events: none;
  }

  & .book-select .reference-icon {
    inset-inline: auto 13px;
  }

  & .book-input :is(input, select) {
    display: block;
    width: 100%;
    min-height: 47px;
    padding: 8px 12px 8px 42px;
    border: 1px solid var(--book-field-border);
    border-radius: 7px;
    background: var(--book-paper);
    color: var(--book-dark);
    font: inherit;
    font-size: 16px;
  }

  & .book-input select {
    appearance: none;
    padding-inline: 12px 38px;
  }

  & .book-input :is(input[readonly], select:disabled) {
    background: var(--book-warm);
    opacity: 1;
  }

  & .book-input input::placeholder {
    color: var(--book-muted);
    opacity: 1;
  }

  & .book-load {
    display: inline-flex;
    width: 100%;
    min-height: 52px;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 8px 13px;
    border: 0;
    border-radius: 9px;
    background: var(--book-accent);
    color: var(--book-white);
    font: inherit;
    font-size: clamp(15px, 1.55vw, 20px);
    font-weight: 850;
    cursor: pointer;
  }

  & .book-load:hover {
    background: var(--book-accent-hover);
  }

  & .book-load .reference-icon:first-child {
    font-size: 23px;
  }

  & .book-form > .book-form-note {
    margin-top: 9px;
    font-size: 13px;
    line-height: 1.35;
  }

  & .book-edit {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding-inline: 0;
    border: 0;
    background: transparent;
    color: var(--book-accent);
    font: inherit;
    font-weight: 700;
    text-decoration: underline;
    cursor: pointer;
  }

  & .book-calendar {
    min-width: 0;
    border: 1px solid var(--book-line);
    border-radius: 12px;
    background: var(--book-paper);
  }

  & .book-calendar-heading {
    padding: 18px 18px 15px;
    border-bottom: 1px solid var(--book-line);
  }

  & .book-calendar-instructions {
    display: grid;
    min-height: 223px;
    align-content: center;
    justify-items: center;
    gap: 8px;
    padding: 18px;
    background: var(--book-warm);
    color: var(--book-muted);
    text-align: center;
  }

  & .book-calendar-instructions .reference-icon {
    color: var(--book-accent);
    font-size: 33px;
  }

  & .cal-inline {
    width: 100%;
    min-height: 380px;
    max-height: min(680px, 75svh);
    overflow-y: auto;
    scrollbar-color: var(--book-muted) var(--book-paper);
  }

  & .book-fallback {
    display: flex;
    align-items: center;
    gap: 5px;
    padding-inline: 18px;
    border-top: 1px solid var(--book-line);
    font-size: 14px;
    font-weight: 650;
  }

  & .book-fallback a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }

  & .book-fallback .reference-icon {
    color: var(--book-accent);
  }

  & .book-assurance {
    grid-column: 2;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: var(--book-muted);
    font-size: 15px;
    line-height: 1.4;
  }

  & .book-assurance strong {
    color: var(--book-dark);
  }

  & .book-assurance .reference-icon {
    flex: none;
    color: var(--book-dark);
    font-size: 27px;
  }

  & .book-next {
    padding-block: 16px;
    border-bottom: 1px solid rgb(255 255 255 / 20%);
    background: var(--book-dark);
    color: var(--book-white);
    text-align: center;
    font-size: clamp(15px, 1.65vw, 21px);
    font-weight: 750;
  }

  & .book-next a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 44px;
    margin-inline-start: 4px;
    color: var(--book-orange);
  }

  & :is(.book-hero, .book-next) :focus-visible {
    outline-color: var(--book-orange);
  }

  & .book-panel:not(:has(.book-form:not([hidden]))) {
    grid-template-columns: minmax(0, 1fr);

    & .book-assurance {
      grid-column: 1;
    }
  }
}

@media (max-width: 980px) {
  .reference-book {
    & .book-art {
      opacity: 0.53;
    }

    & .book-hero h1 {
      max-width: min(620px, 100%);
    }
  }
}

@media (max-width: 760px) {
  .reference-book {
    & .book-wrap {
      width: min(100% - 32px, 640px);
    }

    & .book-art {
      opacity: 0.32;
      object-position: 64% center;
    }

    & .book-hero h1 {
      font-size: clamp(32px, 9vw, 48px);
    }

    & .book-panel {
      grid-template-columns: minmax(0, 1fr);
    }

    & .book-form {
      padding-inline-end: 0;
      border-inline-end: 0;
    }

    & .book-calendar-instructions {
      min-height: 96px;
      grid-auto-flow: column;
      align-items: center;
      justify-content: start;
      text-align: start;
    }

    & .book-assurance {
      grid-column: 1;
    }
  }
}
