.fc-roi {
  --fc-blue: var(--brand--blue, #0070e0);
  --fc-blue-light: var(--brand--blue-light, #1f81e4);
  --fc-blue-dark: var(--brand--blue-dark, #021a49);
  --fc-border: #c9def5;
  --fc-highlight: #e0f0ff;
  --fc-muted: #808ca4;
  --fc-danger: #f13b22;
  --fc-dot-idle: #e6e6e6;
  --fc-control-height: 44px;

  font-family: var(--font-family--body, Poppins, Arial, sans-serif);
  color: var(--fc-blue-dark);
}

.fc-roi,
.fc-roi *,
.fc-roi *::before,
.fc-roi *::after {
  box-sizing: border-box;
}

/* ---- Step slide ---- */

.fc-roi {
  position: relative;
}

.fc-roi--sliding {
  overflow-x: clip;
}

.fc-roi-slide {
  position: relative;
  z-index: 1;
  animation-duration: 0.8192s;
  animation-fill-mode: backwards;
}

.fc-roi-slide--exit-forward,
.fc-roi-slide--exit-backward {
  position: absolute;
  top: 0;
  z-index: 0;
  width: 100%;
  opacity: 0;
  pointer-events: none;
}

.fc-roi-slide--enter-forward {
  animation-name: fc-roi-slide-in-from-right;
}

.fc-roi-slide--enter-backward {
  animation-name: fc-roi-slide-in-from-left;
}

.fc-roi-slide--exit-forward {
  animation-name: fc-roi-slide-out-to-left;
}

.fc-roi-slide--exit-backward {
  animation-name: fc-roi-slide-out-to-right;
}

@keyframes fc-roi-slide-in-from-right {
  from {
    opacity: 0;
    transform: translate3d(100%, 0, 0);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes fc-roi-slide-in-from-left {
  from {
    opacity: 0;
    transform: translate3d(-100%, 0, 0);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes fc-roi-slide-out-to-left {
  from {
    opacity: 1;
  }

  to {
    opacity: 0;
    transform: translate3d(-100%, 0, 0);
  }
}

@keyframes fc-roi-slide-out-to-right {
  from {
    opacity: 1;
  }

  to {
    opacity: 0;
    transform: translate3d(100%, 0, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .fc-roi-slide {
    animation-duration: 1ms;
  }
}

/* ---- Step shell ---- */

.fc-roi-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2.5rem;
  padding: 2.5rem 1.5rem;
}

.fc-roi-step__title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  text-align: center;
}

.fc-roi-step__body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.fc-roi-step__fields {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2.5rem;
}

/* ---- Fields ---- */

.fc-roi-field {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.fc-roi-field__label {
  display: inline-flex;
  align-items: center;
  font-size: 1rem;
  font-weight: 600;
}

.fc-roi-step--question .fc-roi-field__label {
  font-size: 1.25rem;
  text-align: center;
}

@media (min-width: 834px) {
  .fc-roi-step__fields--wide-labels {
    align-items: stretch;
  }

  .fc-roi-step__fields--wide-labels .fc-roi-field {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: 2.5rem;
  }

  .fc-roi-step__fields--wide-labels .fc-roi-field__label {
    justify-self: end;
    width: 282px;
    justify-content: flex-end;
    text-align: right;
  }
}

@media (min-width: 1087px) {
  .fc-roi-step__fields {
    align-items: stretch;
  }

  .fc-roi-field {
    flex-direction: row;
    align-items: center;
    gap: 2.5rem;
  }

  .fc-roi-field__label {
    flex: none;
    width: 265px;
    justify-content: flex-end;
    text-align: right;
  }

  .fc-roi-step--question .fc-roi-field__label {
    width: auto;
    justify-content: center;
    text-align: center;
  }

  .fc-roi-step__fields .fc-roi-field {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .fc-roi-step__fields .fc-roi-field__label {
    justify-self: end;
  }
}

.fc-roi-input {
  display: inline-flex;
  align-items: center;
  width: 192px;
  height: var(--fc-control-height);
  padding: 0 1rem;
  border: 2px solid var(--fc-blue);
  border-radius: 8px;
  background-color: #fff;
  color: var(--fc-blue-dark);
}

.fc-roi-input--narrow {
  width: 96px;
}

.fc-roi-input--invalid {
  border-color: var(--fc-danger);
}

.fc-roi-input__control {
  width: 100%;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 1rem;
}

.fc-roi-input__control::placeholder {
  color: var(--fc-border);
}

/* Spinners crowd a field that already carries a suffix. */
.fc-roi-input__control::-webkit-outer-spin-button,
.fc-roi-input__control::-webkit-inner-spin-button {
  margin: 0;
  -webkit-appearance: none;
}

.fc-roi-input__control[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

.fc-roi-input__prefix,
.fc-roi-input__suffix {
  flex: none;
  color: #000;
  font-size: 1rem;
}

.fc-roi-input__prefix {
  padding-right: 0.25rem;
}

.fc-roi-input__suffix {
  padding-left: 0.5rem;
}

.fc-roi-field-group {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.fc-roi-error {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  margin: 0;
  color: var(--fc-danger);
  font-size: 0.875rem;
}

.fc-roi-error__icon {
  flex: none;
  width: 16px;
  height: 16px;
}

/* ---- Radios ---- */

.fc-roi-radios {
  display: flex;
  flex-direction: column;
  /* Zero gap plus per-option padding below: the rows tile with no dead strip
     between them, while the negative margin keeps the group the same size. */
  gap: 0;
  margin: -0.5rem 0;
  padding: 0;
  border: none;
}

.fc-roi-radios__option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0.5rem 0;
  font-size: 0.875rem;
  line-height: 20px;
  cursor: pointer;
  user-select: none;
}

.fc-roi-radios__option input {
  appearance: none;
  display: grid;
  place-content: center;
  width: 16px;
  height: 16px;
  margin: 0;
  flex: none;
  border: 1px solid var(--fc-blue);
  border-radius: 50%;
  background-color: #fff;
  cursor: pointer;
}

.fc-roi-radios__option input::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: transparent;
}

.fc-roi-radios__option input:checked {
  background-color: var(--fc-blue);
}

.fc-roi-radios__option input:checked::before {
  background-color: #fff;
}

.fc-roi-radios__option input:focus-visible {
  outline: 2px solid var(--fc-blue);
  outline-offset: 2px;
}

/* ---- Tooltip ---- */

.fc-roi-tooltip {
  position: relative;
  display: inline-flex;
  vertical-align: middle;
}

.fc-roi-tooltip__trigger {
  display: inline-flex;
  padding: 0 0.5rem;
  border: none;
  background: none;
  color: var(--fc-muted);
  cursor: pointer;
}

.fc-roi-tooltip__icon {
  width: 20px;
  height: 20px;
}

.fc-roi-tooltip__bubble {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 14.5rem;
  padding: 0.75rem 1rem;
  transform: translateX(-50%);
  border-radius: 8px;
  background-color: #fff;
  box-shadow: 0 4px 16px rgb(2 26 73 / 18%);
  color: var(--fc-blue-dark);
  font-size: 0.875rem;
  font-weight: 400;
  text-align: left;
  white-space: normal;
}

.fc-roi-tooltip__bubble[hidden] {
  display: none;
}

.fc-roi-tooltip__bubble::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  height: 6px;
}

.fc-roi-tooltip__bubble--pinned {
  box-shadow: 0 4px 16px rgb(2 26 73 / 28%);
}

.fc-roi-tooltip__blanket {
  position: fixed;
  inset: 0;
  z-index: 2;
}

/* ---- State combo box ---- */

.fc-roi-combo {
  position: relative;
  width: 190px;
  height: var(--fc-control-height);
}

.fc-roi-combo__trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: var(--fc-control-height);
  padding: 1px 8px 0 16px;
  border: 2px solid var(--fc-blue);
  border-radius: 8px;
  background-color: #fff;
  color: var(--fc-blue);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.fc-roi-combo--invalid .fc-roi-combo__trigger {
  border-color: var(--fc-danger);
}

.fc-roi-combo--open .fc-roi-combo__trigger {
  border-bottom: none;
  border-bottom-right-radius: 0;
  border-bottom-left-radius: 0;
}

.fc-roi-combo--open .fc-roi-combo__trigger svg {
  transform: rotate(180deg);
}

.fc-roi-combo__trigger svg {
  width: 24px;
  height: 24px;
  flex: none;
}

.fc-roi-combo__menu {
  position: absolute;
  top: var(--fc-control-height);
  left: 0;
  z-index: 2;
  width: 100%;
  padding-top: 7px;
  border: 2px solid var(--fc-blue);
  border-top: none;
  border-radius: 8px;
  border-top-right-radius: 0;
  border-top-left-radius: 0;
  background-color: #fff;
}

.fc-roi-combo__blanket {
  position: fixed;
  inset: 0;
  z-index: 1;
}

.fc-roi-combo__menu .fc-select__control {
  margin: 0 15px;
  min-height: 0;
  border: 1px solid var(--fc-border);
  border-radius: 16px;
  flex-flow: row-reverse;
  box-shadow: none;
}

.fc-roi-combo__menu .fc-select__placeholder {
  color: var(--fc-border);
}

.fc-roi-combo__menu .fc-select__menu {
  position: relative;
  margin: 0;
  border: none;
  box-shadow: none;
}

.fc-roi-combo__menu .fc-select__menu-list {
  max-height: 267px;
  scrollbar-width: none;
  margin-top: 7px;
  margin-bottom: 7px;
}

.fc-roi-combo__menu .fc-select__menu-list::-webkit-scrollbar {
  display: none;
}

.fc-roi-combo__menu .fc-select__option {
  padding: 8px 20px;
  background-color: #fff;
  color: var(--fc-blue-dark);
  font-weight: 400;
  cursor: pointer;
}

.fc-roi-combo__menu .fc-select__option:hover {
  color: var(--fc-blue);
  font-weight: 600;
}

/* ---- Navigation ---- */

.fc-roi-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2.5rem;
}

.fc-roi-button {
  min-width: 9rem;
  height: var(--fc-control-height);
  padding: 0 1.5rem;
  border-radius: 8px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}

.fc-roi-button--primary {
  border: 2px solid var(--fc-blue);
  background-color: var(--fc-blue);
  color: #fff;
}

.fc-roi-button--outline {
  border: 2px solid var(--fc-blue);
  background-color: transparent;
  color: var(--fc-blue);
}

.fc-roi-button--primary:hover {
  border-color: var(--fc-blue-light);
  background-color: var(--fc-blue-light);
}

.fc-roi-button--outline:hover {
  border-color: var(--fc-blue-light);
  color: var(--fc-blue-light);
}

.fc-roi-button--link {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  min-width: 0;
  padding: 0 0.5rem;
  border: none;
  background: none;
  color: var(--fc-blue);
}

.fc-roi-replay {
  display: inline-flex;
  width: 1.5rem;
}

.fc-roi-replay svg {
  width: 100%;
  height: auto;
}

/* ---- Progress dots ---- */

.fc-roi-dots {
  display: flex;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.fc-roi-dots__dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background-color: var(--fc-dot-idle);
}

.fc-roi-dots__dot--done {
  background-color: var(--fc-blue-dark);
}

/* ---- Results ---- */

.fc-roi-step--results {
  gap: 1.5rem;
}

.fc-roi-results__headline {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 1.5rem;
}

.fc-roi-results__label {
  font-size: 1.25rem;
  font-weight: 600;
}

.fc-roi-results__amount {
  font-size: 1.5rem;
  font-weight: 600;
}

/* ---- Breakdown ---- */

.fc-roi-breakdown__toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.5rem;
  border: none;
  background: none;
  color: var(--fc-blue);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}

.fc-roi-caret {
  display: inline-flex;
  width: 0.875rem;
}

.fc-roi-caret svg {
  width: 100%;
  height: auto;
}

.fc-roi-caret--open {
  transform: rotate(180deg);
}

.fc-roi-breakdown {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  width: 100%;
  padding-top: 1rem;
}

.fc-roi-breakdown__row {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.fc-roi-breakdown__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.fc-roi-breakdown__formula {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.5rem;
}

.fc-roi-breakdown__operator--times {
  color: var(--fc-muted);
}

.fc-roi-breakdown__result {
  flex: none;
  font-size: 1.25rem;
  font-weight: 600;
}

.fc-roi-result__wrapper {
  padding-top: 0.5rem;
}

.fc-roi-breakdown__formula > .fc-roi-breakdown__operator--times {
  padding-top: 0.5rem;
  font-size: 1.25rem;
}

.fc-roi-breakdown__total {
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 0.5rem;
  font-size: 1.25rem;
  font-weight: 600;
}

.fc-roi-breakdown__total .fc-roi-breakdown__title,
.fc-roi-breakdown__total .fc-roi-breakdown__result {
  font-size: inherit;
}

.fc-roi-breakdown__total--highlighted {
  align-self: flex-end;
  padding: 1.25rem;
  border-radius: 8px;
  background-color: var(--fc-highlight);
  font-size: 1.5rem;
}

.fc-roi-factor {
  display: flex;
  flex: 1 1 8rem;
  flex-direction: column;
}

.fc-roi-factor__value {
  padding: 0.5rem;
  border-radius: 8px;
  background-color: var(--fc-highlight);
  font-size: 1.25rem;
  font-weight: 600;
  text-align: center;
}

/* An upward bracket gathering the figure above it into the label below it. */
.fc-roi-factor__bracket {
  height: 1rem;
  margin-top: 0.5rem;
  border: 2px solid #000;
  border-top: none;
}

.fc-roi-factor__description {
  margin-top: 1.25rem;
  font-size: 0.8125rem;
  text-align: center;
}

@media screen and (width <= 661px) {
  .fc-roi-result__wrapper {
    margin-inline: auto;
  }
}

@media (width < 640px) {
  .fc-roi-step__body,
  .fc-roi-step__fields {
    align-self: stretch;
    align-items: stretch;
  }

  .fc-roi-step--question .fc-roi-field__label {
    max-width: 20rem;
  }

  .fc-roi-input,
  .fc-roi-input--narrow,
  .fc-roi-combo {
    width: min(20rem, 100%);
  }

  .fc-roi-step:not(.fc-roi-step--results) .fc-roi-nav {
    flex-direction: column-reverse;
    align-items: stretch;
    gap: 1.25rem;
    width: min(20rem, 100%);
  }
}
