@keyframes fgReveal {
  100% {
    opacity: 1;
  }
}

body:has(.fairing-container.fairing-container--is-active.fairing-container--prevents-body-scroll) {
  overflow: hidden;
}

.fairing {
  --fg-theme-base-25: oklch(0.99 0 0);
  --fg-theme-base-50: oklch(0.98 0 0);
  --fg-theme-base-100: oklch(0.96 0.01 0);
  --fg-theme-base-200: oklch(0.93 0.01 0);
  --fg-theme-base-300: oklch(0.91 0.01 0);
  --fg-theme-base-400: oklch(0.89 0.01 159.75);
  --fg-theme-base-500: oklch(0.85 0.02 160.46);
  --fg-theme-base-600: oklch(0.79 0.02 161.26);
  --fg-theme-base-700: oklch(0.64 0.03 160.13);
  --fg-theme-base-800: oklch(0.61 0.03 161.22);
  --fg-theme-base-900: oklch(0.5 0.02 162.13);
  --fg-theme-base-950: oklch(0.24 0.02 162.68);

  --fg-theme-brand-25: oklch(0.99 0 0);
  --fg-theme-brand-50: oklch(0.98 0.01 0);
  --fg-theme-brand-100: oklch(0.96 0.01 276.31);
  --fg-theme-brand-200: oklch(0.93 0.02 274.15);
  --fg-theme-brand-300: oklch(0.91 0.03 275.22);
  --fg-theme-brand-400: oklch(0.88 0.04 274.5);
  --fg-theme-brand-500: oklch(0.84 0.05 274.92);
  --fg-theme-brand-600: oklch(0.77 0.06 273.89);
  --fg-theme-brand-700: oklch(0.26 0.05 274.15);
  --fg-theme-brand-800: oklch(0.35 0.05 273.8);
  --fg-theme-brand-900: oklch(0.51 0.06 274.13);
  --fg-theme-brand-950: oklch(0.27 0.05 274.33);

  --fg-theme-danger-600: oklch(74.62% 0.1106 32.27);
  --fg-theme-danger-700: oklch(62.71% 0.1936 33.34);

  --fg-theme-utility-white: oklch(100% 0 0);

  --fg-bg-fill-base-primary: var(--fg-theme-brand-700);

  --fg-bg-fill-brand-primary: var(--fg-theme-brand-700);
  --fg-bg-fill-brand-primary-active: var(--fg-theme-brand-900);
  --fg-bg-fill-brand-primary-hover: var(--fg-theme-brand-800);

  --fg-bg-fill-brand-tertiary-hover: var(--fg-theme-brand-300);

  --fg-bg-fill-danger-primary: var(--fg-theme-danger-700);
  --fg-bg-fill-danger-primary-subtle: var(--fg-theme-danger-600);

  --fg-bg-surface-base-secondary: var(--fg-theme-base-50);

  --fg-bg-surface-brand-tertiary: var(--fg-theme-brand-100);

  --fg-border-base-primary: var(--fg-theme-base-500);

  --fg-border-brand-primary-active: var(--fg-theme-brand-700);
  --fg-border-brand-primary-hover: var(--fg-theme-brand-600);

  /* Font Size Scale */
  --fg-font-size-xs: clamp(10.24px, -1.3333cqi + 16.9120px, 12.64px);
  --fg-font-size-sm: clamp(12.80px, -0.7889cqi + 16.7445px, 14.22px);
  --fg-font-size-md: 16px;
  --fg-font-size-lg: clamp(18.00px,  1.1111cqi + 14.4448px, 20.00px);
  --fg-font-size-xl: clamp(20.25px,  2.6389cqi + 11.8055px, 25.00px);

  --fg-font-weight-normal: 400;
  --fg-font-weight-strong: 500;

  --fg-text-base-primary: var(--fg-theme-base-950);
  --fg-text-base-secondary: var(--fg-theme-base-900);

  --fg-text-brand-active: var(--fg-theme-brand-900);
  --fg-text-brand-hover: var(--fg-theme-brand-800);

  --fg-text-overlay-w-primary: var(--fg-theme-utility-white);

  --fg-radius-xs: clamp(2px, 0.2222px + 0.5556cqi, 3px);
  --fg-radius-sm: clamp(4px, 2.2222px + 0.5556cqi, 5px);
  --fg-radius-md: clamp(8px, 4.4444px + 1.1111cqi, 10px);

  --fg-shadow-md: 0px 0px 6px 0px oklch(from var(--fg-theme-base-950) l c h / 0.14),
                  0px 0px 19px 0px oklch(from var(--fg-theme-base-950) l c h / 0.12);

  /* Spacing Values */
  --fg-space-3xs: clamp(4px, 2.2222px + 0.5556cqi, 5px);
  --fg-space-2xs: clamp(8px, 4.4444px + 1.1111cqi, 10px);
  --fg-space-xs: clamp(12px, 6.6667px + 1.6667cqi, 15px);
  --fg-space-sm: clamp(16px, 8.8889px + 2.2222cqi, 20px);
  --fg-space-md: clamp(20px, 11.1111px + 2.7778cqi, 25px);
  --fg-space-lg: clamp(24px, 13.3333px + 3.3333cqi, 30px);

  /* Single-Step Spacing Values */
  --fg-space-md-lg: clamp(20px, 2.2222px + 5.5556cqi, 30px);
  --fg-space-2xl-3xl: clamp(32px, 8.8889px + 7.2222cqi, 45px);

  container-type: inline-size;
}

.fairing-container.fairing-container--full-screen {
  align-items: center;
  background-color: lch(from var(--fg-theme-base-50) l c h / 0.8);
  display: grid;
  grid-auto-rows: minmax(max-content, calc(100dvh - 48px));
  inset: 0;
  opacity: 0;
  overflow-y: auto;
  padding: var(--fg-space-lg);
  position: fixed;
  transform: scale(0);
  transition: opacity 400ms,
              transform 0s;
  z-index: 2147483640;
}

.fairing-container.fairing-container--full-screen.fairing-container--is-active {
  opacity: 1;
  transform: scale(1);
}

.fairing__survey,
.fairing-question {
  background: hsl(0, 0%, 100%);
  border: 1px solid var(--fg-border-base-primary);
  border-radius: var(--fg-radius-md);
  box-sizing: border-box;
  color: var(--fg-text-base-primary);
  display: block;
  overflow: hidden;
  width: 100%;
}

.fairing-container .fairing__survey,
.fairing-container .fairing-question {
  background: hsl(0, 0%, 100%);
  border: none;
  box-shadow: var(--fg-shadow-md);
  display: flex;
  flex-direction: column;
  min-height: 440px;
  margin: 24px auto;
  max-width: 500px;
  position: relative;
  width: 100%;
}

.fairing__error-notice {
  align-items: center;
  animation: fgReveal 300ms 50ms cubic-bezier(0.38, 0.97, 0.56, 0.76) forwards;
  background: var(--fg-bg-fill-danger-primary);
  color: var(--fg-text-overlay-w-primary);
  display: flex;
  font-size: var(--fg-font-size-md);
  gap: var(--fg-space-3xs);
  line-height: var(--fg-space-md);
  margin: 0;
  opacity: 0;
  padding: var(--fg-space-3xs) var(--fg-space-md-lg);
}

.fairing__error-notice::before {
  align-items: center;
  background: var(--fg-text-overlay-w-primary);
  border-radius: 50%;
  display: inline-flex;
  content: "!";
  color: var(--fg-bg-fill-danger-primary-subtle);
  font-size: var(--fg-font-size-sm);
  font-weight: bolder;
  height: var(--fg-space-xs);
  justify-content: center;
  line-height: var(--fg-space-sm);
  position: relative;
  width: var(--fg-space-xs);
}

.fairing-survey__title {
  font-size: var(--fg-font-size-xl);
  font-weight: var(--fg-font-weight-strong);
  line-height: var(--fg-space-lg);
  margin: 0;
  padding: var(--fg-space-md-lg) var(--fg-space-md-lg) 0;
  text-wrap: pretty;
}

.fairing__question-description {
  color: var(--fg-text-base-secondary);
  font-size: var(--fg-font-size-md);
  font-weight: var(--fg-font-weight-normal);
  line-height: var(--fg-space-md);
  margin: 0;
  opacity: initial;
  padding: 0 var(--fg-space-md-lg);
  text-wrap: pretty;
}

.fairing__responses,
.fairing__date-response {
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  padding: var(--fg-space-sm) var(--fg-space-md-lg);
}

.fairing-container .fairing-question:has(.fairing__autosuggest) {
  height: clamp(440px, 70dvh, 520px);
}

.fairing__response {
  display: flex;
  gap: var(--fg-space-2xs);
  margin: 0;
  padding: var(--fg-space-3xs) 0;
}

.fairing__response-label {
  flex: 1 1 0;
  font-size: var(--fg-font-size-md);
  line-height: var(--fg-space-sm);
  cursor: pointer;
  padding: var(--fg-space-3xs) 0;
}

.fairing__radio-control {
  appearance: none;
  aspect-ratio: 1 / 1;
  background-color: var(--fg-bg-surface-base-secondary);
  border: 1px solid var(--fg-border-base-primary);
  border-radius: 50%;
  box-sizing: border-box;
  cursor: pointer;
  height: var(--fg-space-sm);
  margin: var(--fg-space-3xs) 0 0;
  outline: none;
  transition: border 100ms;
  width: var(--fg-space-sm);
}

.fairing__response:hover .fairing__radio-control {
  border-color: var(--fg-border-brand-primary-active);
}

.fairing__radio-control:checked {
  background-clip: content-box;
  border-color: var(--fg-border-brand-primary-active);
  border-width: 6px;
}

.fairing__checkbox-control {
  appearance: none;
  /* For iOS < 15 to remove gradient background */
  background-color: var(--fg-bg-surface-base-secondary);
  border: 1px solid var(--fg-border-base-primary);
  border-radius: var(--fg-radius-xs);
  cursor: pointer;
  height: var(--fg-space-sm);
  margin: var(--fg-space-3xs) 0 0;
  transition: background 150ms ease-in,
              border 150ms ease-in;
  width: var(--fg-space-sm);
}

.fairing__checkbox-control:hover {
  border-color: var(--fg-border-brand-primary-active);
}

.fairing__checkbox-control:checked {
  --check-shape: 25% 51%, 41% 68%, 74% 34%, 69% 29%, 41% 56%, 31% 45%, 25% 51%;
  background-color: var(--fg-bg-fill-brand-primary);
  border-color: var(--fg-border-brand-primary-active);
  /* This cuts a hole in the shape of a check mark */
  clip-path: polygon(0 0, 100% 0,100% 100%,0 100%,0 0px,var(--check-shape));
}

.fairing__responses[data-fg-component="fg-nps"] {
  display: flex;
  gap: var(--fg-space-sm) 0;
}

.fairing__nps-labels {
  display: grid;
  gap: var(--fg-space-3xs);
  grid-template-columns: auto 1fr;
  margin: 0 0 var(--fg-space-2xs);
  order: 0;
}

@container (width >= 390px) {
  .fairing__nps-labels {
    grid-template-columns: 1fr 1fr;
    margin: 0;
    order: 2;
  }
}

.fairing__nps-labels span {
  display: contents;
  padding: var(--fg-space-2xs) var(--fg-space-3xs);
  text-align: left;
}

.fairing__nps-labels span:first-child::before {
  content: "0 –";
  text-align: right;
}

.fairing__nps-labels span:last-child::before {
  content: "10 –";
  text-align: right;
}

@container (width >= 390px) {
  .fairing__nps-labels span {
    display: block;
    padding: 0;
  }

  .fairing__nps-labels span:last-child {
    text-align: right;
  }

  .fairing__nps-labels span:first-child::before,
  .fairing__nps-labels span:last-child::before {
    content: '';
    display: none;
  }
}

.fairing__nps-controls {
  display: grid;
  gap: var(--fg-space-2xs);
  grid-template-columns: repeat(6, 1fr);
  justify-content: space-between;
  order: 1;
}

@container (width >= 390px) {
  .fairing__nps-controls {
    gap: 0;
    grid-template-columns: repeat(11, 1fr);
  }
}

.fairing__nps-control {
  aspect-ratio: 1 / 1;
  align-items: center;
  border: 1px solid var(--fg-border-base-primary);
  border-radius: var(--fg-radius-xs);
  display: flex;
  font-weight: bold;
  justify-content: center;
  text-align: center;
  transition: all 150ms ease-out;
}

@container (width >= 390px) {
  .fairing__nps-control {
    border-radius: 0;
    border-right-width: 0;
  }

  .fairing__nps-control:first-of-type {
    border-radius: var(--fg-radius-xs) 0 0 var(--fg-radius-xs);
  }

  .fairing__nps-control:last-of-type {
    border-radius: 0 var(--fg-radius-xs) var(--fg-radius-xs) 0;
    border-right-width: 1px;
  }
}

.fairing__nps-control:hover {
  background-color: var(--fg-bg-fill-brand-tertiary-hover);
  border-color: var(--fg-border-brand-primary-hover);
  color: var(--fg-text-brand-hover);
  cursor: pointer;
}

[data-enquire-response]:checked + .fairing__nps-control {
  background-color: var(--fg-bg-fill-brand-primary-hover);
  border: 1px solid var(--fg-border-brand-primary-active);
  color: var(--fg-text-overlay-w-primary);
}

.fairing__open-ended-response {
  appearance: none;
  background: var(--fg-bg-surface-base-secondary);
  border: none;
  border-radius: var(--fg-radius-xs);
  box-sizing: border-box;
  display: block;
  font-size: var(--fg-font-size-md);
  height: calc(4 * var(--fg-space-md) + 2 * var(--fg-space-2xs));
  line-height: var(--fg-space-md);
  outline: 1px solid var(--fg-border-base-primary);
  outline-offset: -1px;
  padding: var(--fg-space-2xs);
  resize: vertical;
  transition: outline 100ms;
  width: 100%;
}

.fairing__open-ended-response:focus {
  outline-color: var(--fg-border-brand-primary-active);
}

.fairing__autosuggest {
  display: grid;
  flex: 1 1 0;
  grid-template-rows: auto 1fr;
  gap: var(--fg-space-sm);
  overflow: hidden;
}

[data-fg-component="fg-autosuggest"] {
  opacity: 0;
}

.fairing__autosuggest__input {
  appearance: none;
  background: var(--fg-bg-surface-base-secondary);
  border: none;
  border-radius: var(--fg-radius-xs);
  box-sizing: border-box;
  display: block;
  font-size: var(--fg-font-size-md);
  line-height: var(--fg-space-sm);
  outline: 1px solid var(--fg-border-base-primary);
  outline-offset: -1px;
  margin: 0;
  padding: 12px 18px;
  transition: outline 100ms, opacity 100ms;
  width: 100%;
}

.fairing__autosuggest__input--ready {
  opacity: 1;
}

.fairing__autosuggest__input::-webkit-calendar-picker-indicator,
.fairing__autosuggest__input::-webkit-list-button {
  appearance: none;
  display: none;
  margin: 0;
}

.fairing__autosuggest__input:focus {
  outline-color: var(--fg-border-brand-primary-active);
}

.fairing__autosuggest__list {
  align-self: start;
  border: 1px solid var(--fg-border-base-primary);
  border-radius: var(--fg-radius-xs);
  box-sizing: border-box;
  margin: 0;
  max-height: 100%;
  opacity: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 0;
  position: relative;
  transition: opacity 175ms ease-out;
  width: 100%;
  word-break: normal;
  z-index: -1;
}

.fairing__autosuggest__list--visible {
  opacity: 1;
  z-index: 1;
}

.fairing__autosuggest__option {
  color: black;
  cursor: pointer;
  padding: var(--fg-space-2xs) var(--fg-space-sm);
  transition: background-color 150ms ease-out,
              color 200ms ease-out;
}

.fairing__autosuggest__option:hover,
.fairing__autosuggest__option--selected {
  background-color: var(--fg-bg-surface-brand-tertiary);
  color: var(--fg-text-brand-active);
}

.fairing__autosuggest__highlight {
  font-weight: 700;
}

.fairing__autosuggest__hint {
  color: gray;
  font-style: italic;
  overflow: hidden;
  padding: var(--fg-space-3xs) var(--fg-space-2xs);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fairing__date-response {
  align-items: start;
  display: flex;
  flex-direction: column;
  gap: var(--fg-space-2xs);
}

@container (width > 499px) {
  .fairing__date-response {
    flex-direction: row;
  }
}

.fairing__response:has(.fairing__other-response-wrapper) {
  align-items: center;
}

.fairing__other-response-wrapper {
  flex: 1 1 0;
}

.fairing__response:has(.fairing__other-response-wrapper) {
  input[type="radio"],
  input[type="checkbox"] {
    margin-top: 0;
  }
}

.fairing__other-response,
.fairing__date-response__input {
  appearance: none;
  background: var(--fg-bg-surface-base-secondary);
  border: none;
  border-radius: var(--fg-radius-xs);
  box-sizing: border-box;
  color: var(--fg-text-base-primary);
  display: block;
  font-size: var(--fg-font-size-md);
  line-height: var(--fg-space-sm);
  outline: 1px solid var(--fg-border-base-primary);
  margin: 0;
  padding: var(--fg-space-2xs);
  transition: outline 100ms;
  width: 100%;
}

.fairing__date-response__input option {
  color: var(--fg-text-base-primary);
}

.fairing__other-response:focus {
  outline: 2px solid var(--fg-border-brand-primary-active);
}

.fairing__other-response__label {
  clip: rect(0 0 0 0); 
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap; 
  width: 1px;
}

.fairing__success-message {
  font-size: var(--fg-font-size-lg);
  font-weight: var(--fg-font-weight-strong);
  line-height: var(--fg-space-md);
  margin: auto 0;
  padding: var(--fg-space-2xl-3xl);
  text-align: center;
}

.fairing__survey-actions {
  background-color: var(--fg-bg-surface-base-secondary);
  display: grid;
  gap: var(--fg-space-3xs);
  padding: var(--fg-space-sm) var(--fg-space-md-lg) var(--fg-space-3xs);
}

.fairing__action--submit {
  background-color: var(--fg-bg-fill-brand-primary);
  border-radius: var(--fg-radius-sm);
  border-width: 0;
  color: #FFFFFF;
  cursor: pointer;
  font-size: var(--fg-font-size-md);
  font-weight: var(--fg-font-weight-strong);
  line-height: var(--fg-space-md);
  padding: var(--fg-space-2xs) var(--fg-space-sm);
}

.fairing__action--submit:hover {
  box-shadow: 0px 1px 3px 1px rgba(1, 38, 83, 0.25),
              0px 1px 1px 1px rgba(87, 101, 171, 0.25);
}

.fairing__action--submit:active {
  background-color: var(--fg-bg-fill-brand-primary);
}

.fairing__branding {
  font-size: var(--fg-font-size-xs);
  line-height: var(--fg-space-sm);
  margin: 0;
  padding: 0;
  text-align: center;
  white-space: nowrap;
}

.fairing__branding-link {
  color: var(--fg-text-base-secondary);
}

.fairing__close-button {
  display: none;
}

.fairing:is(.fairing-container--full-screen) .fairing__close-button {
  appearance: none;
  background: transparent;
  background-image: 
    linear-gradient(45deg, transparent calc(50% - 0.5px), var(--fg-border-base-primary) calc(50% - 0.5px), var(--fg-border-base-primary) calc(50% + 0.5px), transparent calc(50% + 0.5px)),
    linear-gradient(135deg, transparent calc(50% - 0.5px), var(--fg-border-base-primary) calc(50% - 0.5px), var(--fg-border-base-primary) calc(50% + 0.5px), transparent calc(50% + 0.5px));
  background-position: center center, center center;
  background-repeat: no-repeat, no-repeat;
  background-size: var(--fg-space-xs) var(--fg-space-xs), var(--fg-space-xs) var(--fg-space-xs);
  border: none;
  border-radius: var(--fg-radius-xs);
  cursor: pointer;
  display: block;
  height: var(--fg-space-md);
  margin: 0;
  outline: none;
  padding: 0;
  position: absolute;
  right: var(--fg-space-2xs);
  top: var(--fg-space-2xs);
  transition: background-color 150ms ease-out,
              background-image 150ms ease-out;
  width: var(--fg-space-md);
  z-index: 2147483641;

  &:hover {
    background-color: var(--fg-bg-surface-base-secondary);
    background-image: 
      linear-gradient(45deg, transparent calc(50% - 0.5px), var(--fg-text-base-primary) calc(50% - 0.5px), var(--fg-text-base-primary) calc(50% + 0.5px), transparent calc(50% + 0.5px)),
      linear-gradient(135deg, transparent calc(50% - 0.5px), var(--fg-text-base-primary) calc(50% - 0.5px), var(--fg-text-base-primary) calc(50% + 0.5px), transparent calc(50% + 0.5px));
  }

  &:focus-visible {
    outline: 1px solid var(--fg-border-brand-primary-active);
    outline-offset: 2px;
  }
}
