.ffe-rb {
  --ffe-rb-primary: #334537;
  --ffe-rb-primary-hover: #243428;
  --ffe-rb-surface: #fbf9f4;
  --ffe-rb-surface-low: #f5f3ee;
  --ffe-rb-text: #1b1c19;
  --ffe-rb-text-soft: #434843;
  --ffe-rb-outline: #c3c8c1;
  --ffe-rb-accent: #e9c176;
  --ffe-rb-error: #ba1a1a;
  --ffe-rb-radius: 18px;
  --ffe-rb-space: clamp(20px, 4vw, 48px);
  color: var(--ffe-rb-text);
  font-family: "Source Sans 3", sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

.ffe-rb *,
.ffe-rb *::before,
.ffe-rb *::after {
  box-sizing: border-box;
}

.ffe-rb [hidden] {
  display: none !important;
}

.ffe-rb__config {
  display: none;
}

.ffe-rb__intro {
  max-width: 660px;
  margin-bottom: clamp(28px, 5vw, 56px);
}

.ffe-rb__intro h2,
.ffe-rb__details h3,
.ffe-rb__action-result h3 {
  margin: 0;
  color: var(--ffe-rb-primary);
  font-family: "Libre Baskerville", serif;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.ffe-rb__intro h2 {
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.18;
}

.ffe-rb__intro > p:last-child {
  max-width: 560px;
  margin: 14px 0 0;
  color: var(--ffe-rb-text-soft);
  font-size: 18px;
}

.ffe-rb__eyebrow {
  margin: 0 0 8px;
  color: var(--ffe-rb-primary);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.ffe-rb__workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  border-block: 1px solid var(--ffe-rb-outline);
}

.ffe-rb__calendar,
.ffe-rb__details {
  min-width: 0;
  padding: var(--ffe-rb-space);
}

.ffe-rb__calendar {
  padding-left: 0;
}

.ffe-rb__details {
  min-height: 560px;
  border-left: 1px solid var(--ffe-rb-outline);
  background: var(--ffe-rb-surface-low);
}

.ffe-rb--form-active .ffe-rb__workspace {
  grid-template-columns: 1fr;
}

.ffe-rb--form-active .ffe-rb__calendar {
  display: none;
}

.ffe-rb--form-active .ffe-rb__details {
  min-height: 0;
  border-left: 0;
}

.ffe-rb--form-active .ffe-rb__form {
  animation: ffe-rb-reveal 260ms ease both;
}

.ffe-rb__calendar-header {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}

.ffe-rb__month-title {
  margin: 0;
  color: var(--ffe-rb-primary);
  font-family: "Libre Baskerville", serif;
  font-size: clamp(20px, 2.5vw, 26px);
  font-weight: 600;
  text-align: center;
  text-transform: capitalize;
}

.ffe-rb__month-button {
  display: grid;
  width: 44px;
  height: 44px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--ffe-rb-outline);
  border-radius: 50%;
  color: var(--ffe-rb-primary);
  background: transparent;
  font: inherit;
  cursor: pointer;
  transition:
    color 160ms ease,
    border-color 160ms ease,
    background-color 160ms ease,
    transform 160ms ease;
}

.ffe-rb__month-button:hover:not(:disabled) {
  border-color: var(--ffe-rb-primary);
  color: #fff;
  background: var(--ffe-rb-primary);
  transform: translateY(-1px);
}

.ffe-rb__month-button:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.ffe-rb__weekdays,
.ffe-rb__days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 7px;
}

.ffe-rb__weekdays {
  margin-bottom: 9px;
  color: var(--ffe-rb-text-soft);
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  text-transform: uppercase;
}

.ffe-rb__day,
.ffe-rb__day-spacer,
.ffe-rb__day-skeleton {
  aspect-ratio: 1;
}

.ffe-rb__day {
  appearance: none;
  position: relative;
  display: grid;
  min-width: 0;
  padding: 0;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 50%;
  color: var(--ffe-rb-text-soft);
  background: transparent !important;
  box-shadow: none;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition:
    color 160ms ease,
    background-color 160ms ease,
    transform 160ms ease;
}

.ffe-rb__day::after {
  position: absolute;
  bottom: 12%;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--ffe-rb-outline);
  content: "";
}

.ffe-rb__day--available::after {
  background: var(--ffe-rb-primary);
}

.ffe-rb__day--partial::after {
  background: var(--ffe-rb-accent);
}

.ffe-rb__day:hover:not(:disabled) {
  color: #fff;
  background: var(--ffe-rb-primary) !important;
  transform: scale(1.05);
}

.ffe-rb__day:hover:not(:disabled)::after,
.ffe-rb__day[aria-pressed="true"]::after {
  background: #fff;
}

.ffe-rb__day[aria-pressed="true"] {
  color: #fff;
  background: var(--ffe-rb-primary) !important;
}

.ffe-rb__day:disabled,
.ffe-rb__day:disabled:hover {
  border-color: transparent !important;
  color: var(--ffe-rb-text-soft) !important;
  background: transparent !important;
  box-shadow: none !important;
  opacity: 0.38;
  cursor: not-allowed;
  transform: none;
}

.ffe-rb__day-skeleton {
  border-radius: 50%;
  background: linear-gradient(
    90deg,
    var(--ffe-rb-surface-low) 25%,
    #eae8e3 50%,
    var(--ffe-rb-surface-low) 75%
  );
  background-size: 200% 100%;
  animation: ffe-rb-shimmer 1.2s infinite linear;
}

.ffe-rb__legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  margin-top: 28px;
  color: var(--ffe-rb-text-soft);
  font-size: 12px;
}

.ffe-rb__legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.ffe-rb__legend-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ffe-rb-outline);
}

.ffe-rb__legend-dot--available {
  background: var(--ffe-rb-primary);
}

.ffe-rb__legend-dot--partial {
  background: var(--ffe-rb-accent);
}

.ffe-rb__empty {
  display: grid;
  min-height: 430px;
  align-content: center;
  justify-items: start;
}

.ffe-rb__empty h3,
.ffe-rb__details-heading h3,
.ffe-rb__form-heading h3,
.ffe-rb__success h3,
.ffe-rb__action-result h3 {
  font-size: clamp(22px, 2.7vw, 30px);
  line-height: 1.3;
}

.ffe-rb__empty p {
  max-width: 340px;
  margin: 12px 0 0;
  color: var(--ffe-rb-text-soft);
}

.ffe-rb__step {
  display: inline-grid;
  min-width: 34px;
  height: 34px;
  margin-bottom: 22px;
  padding: 0 8px;
  place-items: center;
  border-radius: 999px;
  color: #fff;
  background: var(--ffe-rb-primary);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.ffe-rb__details-heading,
.ffe-rb__form-heading {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px;
  align-items: start;
  margin-bottom: 28px;
}

.ffe-rb__details-heading .ffe-rb__step,
.ffe-rb__form-heading .ffe-rb__step {
  margin: 2px 0 0;
}

.ffe-rb__required-note {
  margin: 8px 0 0;
  color: var(--ffe-rb-text-soft);
  font-size: 13px;
}

.ffe-rb__slots {
  display: grid;
  gap: 1px;
  border-block: 1px solid var(--ffe-rb-outline);
}

.ffe-rb__slot {
  appearance: none;
  display: flex;
  width: 100%;
  min-height: 62px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 2px;
  border: 0;
  border-bottom: 1px solid var(--ffe-rb-outline);
  color: var(--ffe-rb-text);
  background: transparent !important;
  box-shadow: none;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition:
    background-color 160ms ease,
    color 160ms ease;
}

.ffe-rb__slot:last-child {
  border-bottom: 0;
}

.ffe-rb__slot strong {
  color: var(--ffe-rb-primary);
  font-size: 17px;
  white-space: nowrap;
}

.ffe-rb__slot:hover:not(:disabled) {
  color: var(--ffe-rb-primary);
  background: rgb(51 69 55 / 8%) !important;
}

.ffe-rb__slot:focus-visible {
  outline: 2px solid var(--ffe-rb-primary);
  outline-offset: -2px;
  color: var(--ffe-rb-primary);
  background: rgb(51 69 55 / 8%) !important;
}

.ffe-rb__slot:disabled {
  opacity: 0.38;
  background: transparent !important;
  cursor: not-allowed;
  text-decoration: line-through;
}

.ffe-rb__slots-empty {
  color: var(--ffe-rb-text-soft);
}

.ffe-rb__fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.ffe-rb__field {
  display: grid;
  gap: 7px;
  color: var(--ffe-rb-text-soft);
  font-size: 13px;
  font-weight: 600;
}

.ffe-rb__field--wide {
  grid-column: 1 / -1;
}

.ffe-rb__field input,
.ffe-rb__field textarea {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--ffe-rb-outline);
  border-radius: calc(var(--ffe-rb-radius) * 0.45);
  color: var(--ffe-rb-text);
  background: var(--ffe-rb-surface);
  font: inherit;
  font-size: 16px;
  transition:
    border-color 160ms ease,
    background-color 160ms ease;
}

.ffe-rb__field textarea {
  resize: vertical;
}

.ffe-rb__field input:focus,
.ffe-rb__field textarea:focus {
  border-color: var(--ffe-rb-primary);
  outline: 0;
  background: #fff;
}

.ffe-rb__check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: 18px;
  color: var(--ffe-rb-text-soft);
  font-size: 14px;
  cursor: pointer;
}

.ffe-rb__check input {
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  accent-color: var(--ffe-rb-primary);
}

.ffe-rb__forget,
.ffe-rb__text-button {
  padding: 0;
  border: 0;
  color: var(--ffe-rb-primary);
  background: transparent;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.ffe-rb__forget {
  margin-top: 8px;
}

.ffe-rb__form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 28px;
}

.ffe-rb__button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  padding: 12px 22px;
  border: 1px solid var(--ffe-rb-primary);
  border-radius: 999px;
  color: #fff;
  background: var(--ffe-rb-primary);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition:
    background-color 160ms ease,
    transform 160ms ease;
}

.ffe-rb__button:hover:not(:disabled) {
  background: var(--ffe-rb-primary-hover);
  transform: translateY(-1px);
}

.ffe-rb__button:disabled {
  opacity: 0.55;
  cursor: wait;
}

.ffe-rb__success {
  display: grid;
  min-height: 430px;
  align-content: center;
  animation: ffe-rb-reveal 260ms ease both;
}

.ffe-rb__success p:not(.ffe-rb__eyebrow) {
  color: var(--ffe-rb-text-soft);
}

.ffe-rb__action-result {
  margin-bottom: 32px;
  padding: clamp(22px, 4vw, 40px);
  border-left: 4px solid var(--ffe-rb-accent);
  border-radius: 0 var(--ffe-rb-radius) var(--ffe-rb-radius) 0;
  background: var(--ffe-rb-surface-low);
  animation: ffe-rb-reveal 260ms ease both;
}

.ffe-rb__action-result .ffe-rb__button {
  margin-top: 12px;
}

.ffe-rb__notice {
  min-height: 24px;
  margin: 18px 0 0;
  color: var(--ffe-rb-text-soft);
  font-size: 14px;
}

.ffe-rb__notice.is-error {
  color: var(--ffe-rb-error);
}

.ffe-rb button:focus-visible,
.ffe-rb input:focus-visible,
.ffe-rb textarea:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--ffe-rb-accent) 80%, transparent);
  outline-offset: 3px;
}

@keyframes ffe-rb-shimmer {
  to {
    background-position: -200% 0;
  }
}

@keyframes ffe-rb-reveal {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 880px) {
  .ffe-rb__workspace {
    grid-template-columns: 1fr;
  }

  .ffe-rb__calendar {
    padding-right: 0;
  }

  .ffe-rb__details {
    min-height: 0;
    border-top: 1px solid var(--ffe-rb-outline);
    border-left: 0;
  }

  .ffe-rb__empty {
    min-height: 240px;
  }
}

@media (max-width: 520px) {
  .ffe-rb__weekdays,
  .ffe-rb__days {
    gap: 4px;
  }

  .ffe-rb__calendar-header {
    margin-bottom: 20px;
  }

  .ffe-rb__legend {
    gap: 8px 14px;
  }

  .ffe-rb__fields {
    grid-template-columns: 1fr;
  }

  .ffe-rb__field--wide {
    grid-column: auto;
  }

  .ffe-rb__form-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .ffe-rb__button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ffe-rb *,
  .ffe-rb *::before,
  .ffe-rb *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
