/**
 * Vatupassi survey
 * Visual language from vatupassi.fi: Vatupassi red, CAT yellow, Roboto Condensed, pill buttons with a circled arrow.
 * Fields are styled here so the Bricks builder preview reads the same as the frontend;
 * the slide behaviour itself comes from survey.js (frontend only).
 *
 * Direction: an extension of the established vatupassi.fi world, specified precisely by the brief
 * (country cards first, one question per slide), so no concept roll was run.
 * THESIS: one clear question per screen, in Vatupassi's own language; the Bricks form stays the source of truth.
 * OWN-WORLD: red #AF0E0E bar + logo lockup, yellow #FFCC00 progress, Roboto Condensed, pill buttons with circled arrow.
 * FIRST VIEWPORT: red bar, 760px column, question title, country cards with round flags, sticky Back / Next nav.
 */

@font-face {
  font-family: 'Roboto Condensed';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url(fonts/roboto-condensed-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Roboto Condensed';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url(fonts/roboto-condensed-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --vs-red: #af0e0e;
  --vs-red-dark: #8c0a0a;
  --vs-red-tint: #fbe4e4;
  --vs-yellow: #ffcc00;
  --vs-ink: #111;
  --vs-ink-2: #4d4d4d;
  --vs-ink-3: #6b6b6b;
  --vs-ground: #f2f2f0;
  --vs-surface: #fff;
  --vs-line: #d9d9d6;
  --vs-line-strong: #b9b9b5;
  --vs-on-red: #fff;
  --vs-on-red-2: #f8d6d6;
  --vs-font: 'Roboto Condensed', 'Arial Narrow', 'Helvetica Neue', Arial, sans-serif;
  --vs-ease: cubic-bezier(0.16, 1, 0.3, 1);
  --vs-radius: 16px;
  --vs-radius-card: 24px;
  --vs-column: 760px;
  --vs-gutter: clamp(16px, 5vw, 48px);
}

body:has(.vs-survey) {
  background: var(--vs-ground);
}

.vs-survey {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--vs-ground);
  color: var(--vs-ink);
  font-family: var(--vs-font);
  font-size: 18px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  caret-color: var(--vs-red);
  transition: background-color 0.4s var(--vs-ease);
}

.vs-survey ::selection {
  background: var(--vs-yellow);
  color: var(--vs-ink);
}

.vs-survey *,
.vs-survey *::before,
.vs-survey *::after {
  box-sizing: border-box;
}

.vs-survey svg {
  fill: currentColor;
}

.vs-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ------------------------------------------------------------------------ */
/* Top bar                                                                  */
/* ------------------------------------------------------------------------ */

.vs-survey__bar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: clamp(14px, 2.4vw, 32px);
  width: 100%;
  padding: 14px var(--vs-gutter) 18px;
  background: var(--vs-red);
  color: var(--vs-on-red);
}

.vs-survey__logo {
  flex: none;
  width: clamp(124px, 13vw, 176px);
  height: auto;
  line-height: 0;
}

.vs-survey__logo svg,
.vs-survey__logo img {
  display: block;
  width: 100%;
  height: auto;
}

.vs-survey__title {
  margin: 0;
  min-width: 0;
  color: var(--vs-on-red);
  font-family: var(--vs-font);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.vs-status {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-left: auto;
  font-size: 16px;
  white-space: nowrap;
}

.vs-status__section {
  color: var(--vs-on-red-2);
}

.vs-status__count {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.vs-progress {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  gap: 3px;
  height: 5px;
}

.vs-progress__seg {
  flex: 1 1 0;
  overflow: hidden;
  background: rgb(255 255 255 / 0.22);
}

.vs-progress__fill {
  display: block;
  height: 100%;
  background: var(--vs-yellow);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.6s var(--vs-ease);
}

@media (max-width: 639px) {
  .vs-survey__title,
  .vs-status__section {
    display: none;
  }

  .vs-survey__bar {
    padding-top: 12px;
    padding-bottom: 15px;
  }
}

@media (min-width: 640px) and (max-width: 959px) {
  .vs-status__section {
    display: none;
  }
}

/* ------------------------------------------------------------------------ */
/* Form canvas + slides                                                     */
/* ------------------------------------------------------------------------ */

.vs-survey .brxe-form {
  display: block;
  flex: 1 0 auto;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
}

/* Builder preview + no-JS: a readable stacked form */
.vs-survey:not(.is-ready) .brxe-form {
  max-width: calc(var(--vs-column) + 2 * var(--vs-gutter));
  margin: 0 auto;
  padding: 48px var(--vs-gutter) 96px;
}

.vs-survey:not(.is-ready) .form-group {
  padding-bottom: 40px;
}

.vs-survey:not(.is-ready) .brxe-form .options-wrapper label {
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 17px;
}

.vs-survey:not(.is-ready) .brxe-form .options-wrapper input:checked + label {
  border-color: var(--vs-red);
  background: var(--vs-red);
  color: var(--vs-on-red);
}

.vs-survey .brxe-form > .message,
.vs-survey .brxe-form .form-group[hidden] {
  display: none;
}

.vs-survey.is-ready .brxe-form {
  display: flex;
  flex-direction: column;
}

.vs-slide {
  display: flex;
  flex: 1 0 auto;
  width: 100%;
  padding: clamp(32px, 9vh, 104px) var(--vs-gutter) clamp(40px, 8vh, 96px);
}

.vs-slide[hidden] {
  display: none;
}

.vs-slide__inner {
  width: 100%;
  max-width: var(--vs-column);
  margin: 0 auto;
}

.vs-slide.is-entering .vs-slide__head,
.vs-slide.is-entering .vs-slide__body,
.vs-slide.is-entering .vs-review,
.vs-slide--section.is-entering .form-group,
.vs-slide--section.is-entering .vs-section__meta,
.vs-slide--done.is-entering .vs-slide__inner > * {
  animation: vs-enter 0.55s var(--vs-ease) both;
}

.vs-slide.is-entering .vs-slide__body,
.vs-slide.is-entering .vs-review,
.vs-slide--section.is-entering .vs-section__meta {
  animation-delay: 0.06s;
}

@keyframes vs-enter {
  from {
    opacity: 0;
    transform: translate3d(calc(var(--vs-dir, 1) * 40px), 0, 0);
  }
}

/* ------------------------------------------------------------------------ */
/* Question head                                                            */
/* ------------------------------------------------------------------------ */

.vs-survey .vs-slide__head {
  margin-bottom: clamp(24px, 4vh, 40px);
}

.vs-survey .vs-slide__title,
.vs-survey .brxe-form .vs-slide__title {
  display: block;
  max-width: 30ch;
  margin: 0;
  color: var(--vs-ink);
  font-family: var(--vs-font);
  font-size: clamp(28px, 1.6vw + 20px, 44px);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.01em;
  text-transform: none;
  text-wrap: balance;
  cursor: default;
}

/* Titles take programmatic focus so screen readers announce each new slide; they are not controls */
.vs-survey .vs-slide__title:focus,
.vs-survey .vs-slide__title:focus-visible {
  outline: none;
}

.vs-survey .brxe-form .required::after {
  content: none;
}

.vs-optional {
  display: inline-block;
  margin-left: 6px;
  padding: 3px 10px 2px;
  border: 1.5px solid var(--vs-line-strong);
  border-radius: 999px;
  color: var(--vs-ink-2);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  vertical-align: 0.45em;
  white-space: nowrap;
}

.vs-slide__lead,
.vs-survey .vs-field--lead {
  max-width: 62ch;
  margin-top: 14px;
  color: var(--vs-ink-2);
  font-size: 19px;
  line-height: 1.5;
}

.vs-slide__lead > :first-child {
  margin-top: 0;
}

.vs-slide__lead > :last-child {
  margin-bottom: 0;
}

.vs-slide__lead .vs-slide__title + * {
  margin-top: 14px;
}

.vs-survey .brxe-form .vs-field {
  padding: 0;
}

.vs-survey .brxe-form .vs-field--companion {
  margin-top: 32px;
}

.vs-slide--text .vs-field--companion {
  margin-top: 20px;
}

/* Small labels (companion fields, grouped text fields, builder preview) */
.vs-survey .brxe-form .vs-field__label,
.vs-survey:not(.is-ready) .brxe-form .form-group > label,
.vs-survey:not(.is-ready) .brxe-form .form-group > .label {
  display: block;
  margin: 0 0 10px;
  color: var(--vs-ink);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0;
  text-transform: none;
}

.vs-survey .vs-field__label .vs-optional {
  font-size: 12px;
  vertical-align: 0.1em;
}

/* ------------------------------------------------------------------------ */
/* Text inputs                                                              */
/* ------------------------------------------------------------------------ */

.vs-survey .brxe-form textarea,
.vs-survey .brxe-form input[type='text'],
.vs-survey .brxe-form input[type='email'],
.vs-survey .brxe-form input[type='tel'],
.vs-survey .brxe-form input[type='number'],
.vs-survey .brxe-form input[type='url'] {
  display: block;
  width: 100%;
  margin: 0;
  padding: 16px 18px;
  border: 2px solid var(--vs-line);
  border-radius: var(--vs-radius);
  background: var(--vs-surface);
  color: var(--vs-ink);
  font-family: var(--vs-font);
  font-size: 19px;
  line-height: 1.5;
  box-shadow: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
  appearance: none;
}

.vs-survey .brxe-form input[type='text'] {
  min-height: 60px;
}

.vs-survey .brxe-form textarea {
  min-height: 220px;
  resize: none;
}

.vs-survey .brxe-form .vs-field--companion textarea {
  min-height: 120px;
}

.vs-survey .brxe-form textarea::placeholder,
.vs-survey .brxe-form input::placeholder {
  color: var(--vs-ink-3);
  opacity: 1;
}

@media (hover: hover) {
  .vs-survey .brxe-form textarea:hover,
  .vs-survey .brxe-form input[type='text']:hover {
    border-color: var(--vs-line-strong);
  }
}

.vs-survey .brxe-form textarea:focus,
.vs-survey .brxe-form input[type='text']:focus,
.vs-survey .brxe-form input[type='email']:focus,
.vs-survey .brxe-form input[type='tel']:focus,
.vs-survey .brxe-form input[type='number']:focus,
.vs-survey .brxe-form input[type='url']:focus {
  border-color: var(--vs-ink);
  outline: none;
  box-shadow: inset 0 0 0 1px var(--vs-ink);
}

.vs-survey .brxe-form .has-error textarea,
.vs-survey .brxe-form .has-error input[type='text'] {
  border-color: var(--vs-red);
  box-shadow: inset 0 0 0 1px var(--vs-red);
}

/* ------------------------------------------------------------------------ */
/* Shared option controls                                                   */
/* ------------------------------------------------------------------------ */

.vs-survey .brxe-form .options-wrapper {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.vs-survey .brxe-form .options-wrapper li {
  position: relative;
  display: block;
  margin: 0;
}

.vs-survey .brxe-form .options-wrapper input[type='radio'],
.vs-survey .brxe-form .options-wrapper input[type='checkbox'] {
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
  pointer-events: none;
}

.vs-survey .brxe-form .options-wrapper label {
  display: flex;
  width: 100%;
  height: 100%;
  margin: 0;
  border: 2px solid var(--vs-line);
  background: var(--vs-surface);
  color: var(--vs-ink);
  font-family: var(--vs-font);
  letter-spacing: 0;
  text-transform: none;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition:
    border-color 0.15s,
    background-color 0.2s,
    color 0.2s,
    transform 0.2s var(--vs-ease),
    box-shadow 0.25s var(--vs-ease);
}

@media (hover: hover) {
  .vs-survey .brxe-form .options-wrapper label:hover {
    border-color: var(--vs-ink);
  }
}

.vs-survey .brxe-form .options-wrapper label:active {
  transform: scale(0.98);
}

.vs-survey .brxe-form .options-wrapper input:focus-visible + label {
  outline: 3px solid var(--vs-ink);
  outline-offset: 3px;
}

.vs-survey .brxe-form .has-error .options-wrapper label {
  border-color: var(--vs-red);
}

/* ------------------------------------------------------------------------ */
/* Numbered scale (1-5)                                                     */
/* ------------------------------------------------------------------------ */

.vs-survey .brxe-form .vs-field--scale .options-wrapper {
  grid-template-columns: repeat(var(--vs-options, 5), minmax(0, 1fr));
}

.vs-survey .brxe-form .vs-field--scale label {
  flex-direction: column;
  justify-content: space-between;
  gap: 20px;
  min-height: 132px;
  padding: 16px 16px 15px;
  border-radius: var(--vs-radius);
}

.vs-scale__num {
  font-size: 44px;
  font-weight: 800;
  line-height: 0.9;
  font-variant-numeric: tabular-nums;
}

.vs-scale__text {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
}

.vs-survey .brxe-form .vs-field--scale input:checked + label {
  border-color: var(--vs-red);
  background: var(--vs-red);
  color: var(--vs-on-red);
  box-shadow: 0 10px 24px -14px rgb(140 10 10 / 0.7);
}

@media (max-width: 639px) {
  .vs-survey .brxe-form .vs-field--scale .options-wrapper {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }

  .vs-survey .brxe-form .vs-field--scale label {
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 16px;
    min-height: 60px;
    padding: 10px 16px;
    border-radius: 14px;
  }

  .vs-scale__num {
    flex: none;
    width: 1ch;
    font-size: 30px;
  }

  .vs-scale__text {
    font-size: 18px;
  }
}

/* ------------------------------------------------------------------------ */
/* Choice cards (country)                                                   */
/* ------------------------------------------------------------------------ */

.vs-survey .brxe-form .vs-field--choice .options-wrapper {
  grid-template-columns: repeat(auto-fit, minmax(176px, 1fr));
  gap: 16px;
}

.vs-survey .brxe-form .vs-field--choice label {
  position: relative;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  min-height: 236px;
  padding: 36px 20px 30px;
  border-radius: var(--vs-radius-card);
  font-size: 26px;
  font-weight: 700;
  line-height: 1.1;
  text-align: center;
}

@media (hover: hover) {
  .vs-survey .brxe-form .vs-field--choice label:hover {
    border-color: var(--vs-line-strong);
    box-shadow: 0 16px 32px -20px rgb(0 0 0 / 0.35);
    transform: translateY(-3px);
  }
}

.vs-choice__flag {
  display: block;
  flex: none;
  width: 88px;
  height: 88px;
  border-radius: 50%;
  transition: transform 0.35s var(--vs-ease);
}

.vs-choice__flag--initial {
  display: grid;
  place-items: center;
  background: var(--vs-ground);
  color: var(--vs-ink-2);
  font-size: 36px;
  font-weight: 800;
}

.vs-choice__check {
  position: absolute;
  top: 16px;
  right: 16px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--vs-red);
  color: var(--vs-on-red);
  opacity: 0;
  transform: scale(0.4);
  transition:
    opacity 0.2s,
    transform 0.35s var(--vs-ease);
}

.vs-choice__check svg {
  width: 18px;
  height: 18px;
}

.vs-survey .brxe-form .vs-field--choice input:checked + label {
  border-color: var(--vs-red);
  box-shadow:
    inset 0 0 0 1px var(--vs-red),
    0 16px 32px -20px rgb(140 10 10 / 0.55);
}

.vs-survey .brxe-form .vs-field--choice input:checked + label .vs-choice__check {
  opacity: 1;
  transform: scale(1);
}

.vs-survey .brxe-form .vs-field--choice input:checked + label .vs-choice__flag {
  transform: scale(1.06);
}

@media (max-width: 639px) {
  .vs-survey .brxe-form .vs-field--choice .options-wrapper {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }

  .vs-survey .brxe-form .vs-field--choice label {
    flex-direction: row;
    justify-content: flex-start;
    gap: 16px;
    min-height: 80px;
    padding: 14px 64px 14px 16px;
    border-radius: 18px;
    font-size: 22px;
    text-align: left;
  }

  .vs-choice__flag {
    width: 48px;
    height: 48px;
  }

  .vs-choice__flag--initial {
    font-size: 22px;
  }

  .vs-choice__check {
    top: 50%;
    right: 18px;
    margin-top: -16px;
  }
}

/* ------------------------------------------------------------------------ */
/* Errors                                                                   */
/* ------------------------------------------------------------------------ */

.vs-error {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 0 0;
  color: var(--vs-red);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.3;
}

.vs-error svg {
  flex: none;
  width: 20px;
  height: 20px;
}

.vs-error span {
  animation: vs-nudge 0.4s var(--vs-ease);
}

@keyframes vs-nudge {
  0% {
    transform: translateX(0);
  }
  30% {
    transform: translateX(-4px);
  }
  60% {
    transform: translateX(3px);
  }
}

/* ------------------------------------------------------------------------ */
/* Section intro slides: the page turns Vatupassi red                       */
/* ------------------------------------------------------------------------ */

.vs-survey[data-kind='section'],
.vs-survey[data-kind='done'] {
  background: var(--vs-red);
}

body:has(.vs-survey[data-kind='section']),
body:has(.vs-survey[data-kind='done']) {
  background: var(--vs-red);
}

.vs-slide--section,
.vs-slide--done {
  align-items: center;
  color: var(--vs-on-red);
}

.vs-survey .brxe-form .vs-slide--section .vs-slide__title,
.vs-survey .vs-slide--done .vs-slide__title {
  max-width: 13ch;
  color: var(--vs-on-red);
  font-size: clamp(52px, 6vw + 14px, 120px);
  font-weight: 800;
  line-height: 0.92;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  text-wrap: balance;
}

.vs-slide--section .vs-field--section p,
.vs-done__text {
  max-width: 46ch;
  margin: 24px 0 0;
  color: var(--vs-on-red-2);
  font-size: clamp(19px, 0.5vw + 16px, 22px);
  line-height: 1.5;
}

.vs-done__text p {
  margin: 0;
}

.vs-section__meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 32px 0 0;
  color: var(--vs-yellow);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.vs-section__meta::before {
  content: '';
  width: 32px;
  height: 3px;
  background: currentColor;
}

/* Builder preview: section HTML fields read as dividers */
.vs-survey:not(.is-ready) .vs-field--section,
.vs-survey:not(.is-ready) .form-group:has(> h2) {
  margin: 24px 0 32px;
  padding: 32px !important;
  border-radius: var(--vs-radius);
  background: var(--vs-red);
  color: var(--vs-on-red);
}

.vs-survey:not(.is-ready) .form-group:has(> h2) h2 {
  margin: 0 0 8px;
  color: var(--vs-on-red);
  font-size: 32px;
  text-transform: uppercase;
}

/* ------------------------------------------------------------------------ */
/* Review                                                                   */
/* ------------------------------------------------------------------------ */

.vs-review__section + .vs-review__section {
  margin-top: 40px;
}

.vs-review__heading {
  margin: 0 0 4px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--vs-ink);
  color: var(--vs-ink);
  font-family: var(--vs-font);
  font-size: 15px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.vs-review__item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 24px;
  width: 100%;
  margin: 0;
  padding: 16px 12px 16px 0;
  border: 0;
  border-bottom: 1px solid var(--vs-line);
  border-radius: 0;
  background: none;
  color: var(--vs-ink);
  font-family: var(--vs-font);
  text-align: left;
  cursor: pointer;
  transition: background-color 0.15s;
}

@media (hover: hover) {
  .vs-review__item:hover {
    background: rgb(0 0 0 / 0.035);
  }
}

.vs-review__item:focus-visible {
  outline: 3px solid var(--vs-ink);
  outline-offset: 2px;
}

.vs-review__q {
  grid-column: 1;
  color: var(--vs-ink-2);
  font-size: 16px;
  line-height: 1.35;
}

.vs-review__a {
  display: -webkit-box;
  grid-column: 1;
  overflow: hidden;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.4;
  white-space: pre-line;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}

.vs-review__item.is-missing .vs-review__a {
  color: var(--vs-red);
}

.vs-review__item.is-empty .vs-review__a {
  color: var(--vs-ink-3);
  font-weight: 400;
}

.vs-review__edit {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  color: var(--vs-red);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
  text-transform: uppercase;
}

.vs-review__error {
  margin: 28px 0 0;
  padding: 14px 18px;
  border-radius: 14px;
  background: var(--vs-red-tint);
  color: var(--vs-red-dark);
  font-weight: 700;
}

/* ------------------------------------------------------------------------ */
/* Bottom navigation                                                        */
/* ------------------------------------------------------------------------ */

.vs-nav {
  position: sticky;
  bottom: 0;
  z-index: 20;
  width: 100%;
  border-top: 1px solid var(--vs-line);
  background: var(--vs-ground);
  transition:
    background-color 0.4s var(--vs-ease),
    border-color 0.4s;
}

.vs-nav[hidden] {
  display: none;
}

.vs-nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: calc(var(--vs-column) + 2 * var(--vs-gutter));
  margin: 0 auto;
  padding: 12px var(--vs-gutter) calc(12px + env(safe-area-inset-bottom));
}

.vs-survey[data-kind='section'] .vs-nav {
  border-color: rgb(255 255 255 / 0.18);
  background: var(--vs-red);
}

.vs-btn {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  margin: 0;
  border: 0;
  border-radius: 999px;
  font-family: var(--vs-font);
  font-size: 17px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition:
    background-color 0.2s,
    color 0.2s,
    transform 0.2s var(--vs-ease);
}

.vs-btn:active {
  transform: scale(0.97);
}

.vs-btn:focus-visible {
  outline: 3px solid var(--vs-ink);
  outline-offset: 3px;
}

.vs-survey[data-kind='section'] .vs-btn:focus-visible {
  outline-color: var(--vs-yellow);
}

.vs-btn svg {
  width: 20px;
  height: 20px;
}

.vs-btn--back {
  padding: 0 18px 0 12px;
  background: transparent;
  color: var(--vs-ink);
}

@media (hover: hover) {
  .vs-btn--back:hover {
    background: rgb(0 0 0 / 0.06);
  }
}

.vs-btn__icon--back svg {
  transform: scaleX(-1);
}

.vs-survey[data-kind='section'] .vs-btn--back {
  color: var(--vs-on-red);
}

@media (hover: hover) {
  .vs-survey[data-kind='section'] .vs-btn--back:hover {
    background: rgb(255 255 255 / 0.12);
  }
}

.vs-btn--next {
  padding: 6px 7px 6px 26px;
  background: var(--vs-red);
  color: var(--vs-on-red);
}

@media (hover: hover) {
  .vs-btn--next:hover {
    background: var(--vs-red-dark);
  }
}

.vs-btn--next .vs-btn__icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--vs-on-red);
  color: var(--vs-red);
  transition: transform 0.3s var(--vs-ease);
}

@media (hover: hover) {
  .vs-btn--next:hover .vs-btn__icon {
    transform: translateX(3px);
  }
}

.vs-survey[data-kind='section'] .vs-btn--next {
  background: var(--vs-on-red);
  color: var(--vs-red);
}

.vs-survey[data-kind='section'] .vs-btn--next .vs-btn__icon {
  background: var(--vs-red);
  color: var(--vs-on-red);
}

@media (hover: hover) {
  .vs-survey[data-kind='section'] .vs-btn--next:hover {
    background: var(--vs-yellow);
    color: var(--vs-ink);
  }
}

.vs-btn--next.is-submit {
  padding-left: 30px;
}

.vs-btn--next.is-loading {
  cursor: progress;
}

.vs-btn--next.is-loading .vs-btn__icon svg {
  display: none;
}

.vs-btn--next.is-loading .vs-btn__icon::after {
  content: '';
  width: 18px;
  height: 18px;
  border: 2.5px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: vs-spin 0.7s linear infinite;
}

@keyframes vs-spin {
  to {
    transform: rotate(1turn);
  }
}

@media (max-width: 639px) {
  .vs-btn--back {
    padding: 0 14px 0 8px;
  }

  .vs-btn--next {
    flex: 1;
    justify-content: space-between;
  }
}

/* ------------------------------------------------------------------------ */
/* Toast                                                                    */
/* ------------------------------------------------------------------------ */

.vs-toast {
  position: fixed;
  bottom: calc(96px + env(safe-area-inset-bottom));
  left: 50%;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 6px 14px;
  width: max-content;
  max-width: calc(100vw - 32px);
  padding: 10px 8px 10px 20px;
  border-radius: 16px;
  background: var(--vs-ink);
  color: #fff;
  font-size: 16px;
  line-height: 1.35;
  box-shadow: 0 18px 40px -16px rgb(0 0 0 / 0.5);
  transform: translateX(-50%);
  animation: vs-toast-in 0.5s var(--vs-ease) both;
}

.vs-toast p {
  margin: 0;
}

.vs-toast.is-leaving {
  opacity: 0;
  transform: translate(-50%, 12px);
  transition:
    opacity 0.2s,
    transform 0.25s;
}

.vs-toast__action,
.vs-toast__close {
  flex: none;
  min-height: 40px;
  margin: 0;
  padding: 0 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--vs-yellow);
  font-family: var(--vs-font);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
}

.vs-toast__close {
  display: grid;
  place-items: center;
  width: 40px;
  padding: 0;
  color: #fff;
}

.vs-toast__close svg {
  width: 18px;
  height: 18px;
}

@media (hover: hover) {
  .vs-toast__action:hover,
  .vs-toast__close:hover {
    background: rgb(255 255 255 / 0.1);
  }
}

.vs-toast__action:focus-visible,
.vs-toast__close:focus-visible {
  outline: 2px solid var(--vs-yellow);
}

@keyframes vs-toast-in {
  from {
    opacity: 0;
    transform: translate(-50%, 16px);
  }
}

@media (max-width: 639px) {
  .vs-toast {
    bottom: calc(88px + env(safe-area-inset-bottom));
    flex-wrap: wrap;
  }
}

/* ------------------------------------------------------------------------ */
/* Builder editor note (hidden on frontend by Bricks)                       */
/* ------------------------------------------------------------------------ */

.vs-editor-note {
  max-width: calc(var(--vs-column) + 2 * var(--vs-gutter));
  margin: 0 auto 48px;
  padding: 24px var(--vs-gutter);
  border: 2px dashed var(--vs-line-strong);
  border-radius: var(--vs-radius);
  color: var(--vs-ink-2);
  font-size: 16px;
}

/* ------------------------------------------------------------------------ */
/* Reduced motion                                                           */
/* ------------------------------------------------------------------------ */

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