* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--cap-font), system-ui, -apple-system, sans-serif;
  color: var(--cap-foreground);
  background: var(--cap-bg);
}

.cap-form {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  max-width: 40rem;
  margin: 0 auto;
  padding: 4rem 1.25rem;
  gap: 2rem;
}

.cap-brand {
  display: flex;
  justify-content: center;
  width: 100%;
  min-height: 1rem;
}

.cap-brand img {
  max-height: var(--cap-brand-max-size, 4rem);
  max-width: var(--cap-brand-max-size, 4rem);
  object-fit: contain;
}

.cap-screens {
  flex: 1;
  width: 100%;
  min-height: 12rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cap-screen {
  display: none;
  width: 100%;
  flex-direction: column;
  gap: 1rem;
  text-align: center;
}

.cap-screen.cap-active {
  display: flex;
}

.cap-step-count {
  font-size: 0.875rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  opacity: 0.55;
}

.cap-intro-title,
.cap-completion-title {
  font-size: 1.75rem;
  font-weight: 600;
  margin: 0;
}

.cap-intro-description,
.cap-completion-message {
  font-size: 1.05rem;
  opacity: 0.8;
  margin: 0;
}

.cap-label,
.cap-question {
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.3;
}

.cap-input {
  width: 100%;
  padding: 0.625rem 0.875rem;
  font-size: 1rem;
  font-family: inherit;
  color: inherit;
  background-color: color-mix(in srgb, var(--cap-foreground) 5%, transparent);
  border: 1px solid color-mix(in srgb, var(--cap-foreground) 10%, transparent);
  border-radius: var(--cap-radius-input);
  outline: none;
  transition: border-color 0.15s ease;
}

.cap-input::placeholder {
  color: color-mix(in srgb, var(--cap-foreground) 45%, transparent);
}

.cap-input:focus {
  border-color: var(--cap-accent);
}

.cap-textarea {
  resize: vertical;
  min-height: 7rem;
}

/* Type icons, on free-text answers only — choice and scale have no single
   field. `mask-image` rather than `background-image` so `background-color`
   paints the glyph and it tracks the form's foreground; the mask cannot go on
   the input itself, which would clip the field's own fill and text.

   Inlined rather than kept as files beside this stylesheet: a relative URL
   resolves off the blob but not in the builder, whose bundler rewrites every
   .svg to a .js module (the Turbopack rule in next.config.ts), and an absolute
   one would resolve against the form's domain. A data URI is the only form
   that works from both, which keeps the two copies byte-identical. */
.cap-icon {
  display: inline-block;
  width: 1.125rem;
  height: 1.125rem;
  background-color: color-mix(in srgb, var(--cap-foreground) 45%, transparent);
  mask-repeat: no-repeat;
  mask-size: contain;
}

.cap-field {
  position: relative;
}

.cap-field .cap-icon {
  position: absolute;
  left: 0.875rem;
  top: 0.9375rem;
  pointer-events: none;
}

.cap-field .cap-input {
  padding-left: 2.625rem;
}

.cap-icon[data-cap-type='Name'] {
  mask-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='-0.5 -0.5 14 14'><g id='user-identifier-card'><path id='Rectangle 56' stroke='%23000' stroke-linecap='round' stroke-linejoin='round' d='M1.261 2.104h10.478s0.797 0 0.797 0.797v7.198s0 0.797 -0.797 0.797H1.261s-0.797 0 -0.797 -0.797V2.901s0 -0.797 0.797 -0.797' stroke-width='1'></path><path id='Rectangle 433' stroke='%23000' stroke-linecap='round' stroke-linejoin='round' d='m8.691 5.46 1.844 0' stroke-width='1'></path><path id='Rectangle 434' stroke='%23000' stroke-linecap='round' stroke-linejoin='round' d='m8.691 7.288 1.844 0' stroke-width='1'></path><path id='Vector' stroke='%23000' stroke-linecap='round' stroke-linejoin='round' d='M3.257 5.765a1.523 1.523 0 1 0 3.048 0 1.523 1.523 0 0 0 -3.048 0Z' stroke-width='1'></path><path id='Vector_2' stroke='%23000' stroke-linecap='round' stroke-linejoin='round' d='M2.464 8.796a2.944 2.944 0 0 1 0.988 -1.105 2.433 2.433 0 0 1 1.328 -0.403c0.466 0 0.923 0.139 1.329 0.403a2.944 2.944 0 0 1 0.988 1.105' stroke-width='1'></path></g></svg>");
}

.cap-icon[data-cap-type='Email'] {
  mask-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 14 14'><g id='mail-send-envelope--envelope-email-message-unopened-sealed-close'><path id='Vector' stroke='%23000' stroke-linecap='round' stroke-linejoin='round' d='M12.5 1.75h-11a1 1 0 0 0-1 1v8.5a1 1 0 0 0 1 1h11a1 1 0 0 0 1-1v-8.5a1 1 0 0 0-1-1Z'></path><path id='Vector_2' stroke='%23000' stroke-linecap='round' stroke-linejoin='round' d='m.5 3 5.86 3.524c.18.106.406.163.64.163.234 0 .46-.057.64-.163L13.5 3'></path></g></svg>");
}

.cap-icon[data-cap-type='Mobile'] {
  mask-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 14 14' id='Phone--Streamline-Core.svg'><g id='phone--android-phone-mobile-device-smartphone-iphone'><path id='Vector' stroke='%23000' stroke-linecap='round' stroke-linejoin='round' d='M5.24782 12.9817c-0.61454 0.3964 -1.34685 0.5692 -2.0738 0.4893 -0.72694 -0.08 -1.40419 -0.4078 -1.91785 -0.9284l-0.449065 -0.4391C0.610232 11.9021 0.5 11.6317 0.5 11.3501c0 -0.2816 0.110232 -0.5521 0.307105 -0.7534L2.71312 8.71061c0.19969 -0.19624 0.46846 -0.3062 0.74844 -0.3062 0.27997 0 0.54875 0.10996 0.74843 0.3062 0.20137 0.19688 0.47181 0.30711 0.75343 0.30711 0.28162 0 0.55205 -0.11023 0.75342 -0.30711l2.99374 -2.99374c0.09987 -0.09842 0.17918 -0.21571 0.23331 -0.34505 0.05413 -0.12934 0.08201 -0.26816 0.08201 -0.40837 0 -0.14022 -0.02788 -0.27903 -0.08201 -0.40838 -0.05413 -0.12934 -0.13344 -0.24663 -0.23331 -0.34505 -0.19624 -0.19968 -0.3062 -0.46846 -0.3062 -0.74843 0 -0.27998 0.10996 -0.54875 0.3062 -0.74844L10.6066 0.817115c0.2014 -0.196874 0.4718 -0.307105 0.7534 -0.307105 0.2817 0 0.5521 0.110231 0.7535 0.307105l0.4391 0.449065c0.5205 0.51366 0.8483 1.19091 0.9283 1.91785 0.08 0.72695 -0.0928 1.45926 -0.4893 2.0738 -2.0657 3.04437 -4.69409 5.66597 -7.74378 7.72387Z' stroke-width='1'></path></g></svg>");
}

.cap-icon[data-cap-type='ShortText'] {
  mask-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'><g><path d='M12.5%2C12.5a1%2C1%2C0%2C0%2C1-1%2C1h-9a1%2C1%2C0%2C0%2C1-1-1V1.5a1%2C1%2C0%2C0%2C1%2C1-1h5l5%2C5Z' fill='none' stroke='%23000' stroke-linecap='round' stroke-linejoin='round'></path><line x1='4.5' y1='4.5' x2='6.5' y2='4.5' fill='none' stroke='%23000' stroke-linecap='round' stroke-linejoin='round'></line><line x1='4.5' y1='7.5' x2='9.5' y2='7.5' fill='none' stroke='%23000' stroke-linecap='round' stroke-linejoin='round'></line><line x1='4.5' y1='10.5' x2='9.5' y2='10.5' fill='none' stroke='%23000' stroke-linecap='round' stroke-linejoin='round'></line></g></svg>");
}

.cap-icon[data-cap-type='LongText'] {
  mask-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='1.5' stroke='%23000'> <path stroke-linecap='round' stroke-linejoin='round' d='M19.5 14.25v-2.625a3.375 3.375 0 0 0-3.375-3.375h-1.5A1.125 1.125 0 0 1 13.5 7.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H8.25m0 12.75h7.5m-7.5 3H12M10.5 2.25H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 0 0-9-9Z' /> </svg>");
}




.cap-fieldset {
  border: 0;
  margin: 0;
  padding: 0;
}

/* A <fieldset> ignores `display: flex`/`gap` (special rendering of the legend
   + anonymous content box), so space its children with margins instead. Keeps
   the semantic fieldset/legend grouping. */
.cap-fieldset > * + * {
  margin-top: 1rem;
}

.cap-options {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.cap-option {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.875rem 1rem;
  font-size: 1rem;
  text-align: left;
  background-color: color-mix(in srgb, var(--cap-foreground) 5%, transparent);
  border: 1px solid color-mix(in srgb, var(--cap-foreground) 10%, transparent);
  border-radius: var(--cap-radius-input);
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.cap-option:hover {
  border-color: var(--cap-accent);
}

.cap-option input {
  accent-color: var(--cap-accent);
  width: 1.1rem;
  height: 1.1rem;
}

.cap-scale {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
}

.cap-scale-item {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  font-size: 1rem;
  font-weight: 600;
  background-color: color-mix(in srgb, var(--cap-foreground) 5%, transparent);
  border: 1px solid color-mix(in srgb, var(--cap-foreground) 10%, transparent);
  border-radius: var(--cap-radius-input);
  cursor: pointer;
  transition: all 0.15s ease;
}

.cap-scale-item input {
  position: absolute;
  opacity: 0;
  inset: 0;
  cursor: pointer;
}

.cap-scale-item:has(input:checked) {
  background: var(--cap-accent);
  border-color: var(--cap-accent);
  color: var(--cap-accent-foreground);
}

.cap-error {
  font-size: 0.875rem;
  color: var(--cap-accent);
  min-height: 1rem;
}

.cap-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
}

.cap-btn {
  padding: 0.75rem 2rem;
  font-size: 1rem;
  font-weight: 500;
  font-family: inherit;
  border: 0;
  border-radius: var(--cap-radius-button);
  cursor: pointer;
  transition: opacity 0.15s ease, background 0.15s ease;
}

.cap-btn[hidden] {
  display: none;
}

.cap-btn-primary {
  background: var(--cap-accent);
  color: var(--cap-accent-foreground);
  margin-left: auto;
}

.cap-btn-primary:hover {
  opacity: 0.9;
}

.cap-btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.cap-btn-secondary {
  background: transparent;
  color: inherit;
  border: 1px solid color-mix(in srgb, var(--cap-foreground) 15%, transparent);
}

/* Larger screens: group branding, question/input and buttons into a single
   left-aligned block centred on the page, instead of stretching them across
   the full viewport height. Mobile keeps the vertically-centred, buttons-at-
   the-bottom layout. */
@media (min-width: 768px) {
  .cap-form {
    justify-content: center;
    gap: 4rem;
  }

  .cap-screens {
    flex: initial;
  }

  .cap-screen {
    text-align: left;
  }

  /* Intro and completion are standalone messages with nothing to scan, so they
     stay centred where a question goes left. */
  .cap-screen[data-screen='intro'],
  .cap-screen[data-screen='completion'] {
    text-align: center;
  }

  /* Centre their button too. The nav is one shared element sibling to the
     screens rather than a child of each, so the active screen has to reach it
     with `:has()`. */
  .cap-screens:has([data-screen='intro'].cap-active) ~ .cap-nav .cap-btn-primary,
  .cap-screens:has([data-screen='completion'].cap-active)
    ~ .cap-nav
    .cap-btn-primary {
    margin-inline: auto;
  }

  .cap-brand {
    justify-content: flex-start;
  }

  .cap-scale {
    justify-content: flex-start;
  }

  .cap-btn-primary {
    margin-left: 0;
  }
}

/* Consent / "accept terms" row, shown above the nav on the submit step. */
.cap-terms {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  text-align: left;
}

.cap-terms[hidden] {
  display: none;
}

.cap-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  font-size: 1rem;
  line-height: 1.4;
  color: inherit;
  cursor: pointer;
}

.cap-checkbox__input {
  width: 1.1rem;
  height: 1.1rem;
  margin-top: 0.15rem;
  flex-shrink: 0;
  accent-color: var(--cap-accent);
  cursor: pointer;
}

.cap-checkbox__label {
  user-select: none;
}

.cap-terms__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.875rem;
}

.cap-terms__links a {
  color: var(--cap-accent);
  text-decoration: underline;
}

.cap-terms__links a:hover {
  opacity: 0.8;
}

/* GDPR cookie-consent popup — mirrors the website builder's cap-gdpr-modal. */
.cap-gdpr-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
  font-family: var(--cap-font), system-ui, sans-serif;
}

.cap-gdpr-modal--visible {
  display: flex;
}

.cap-gdpr-modal__content {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 32px;
  margin: 16px;
  background-color: var(--cap-bg);
  border-radius: 12px;
  color: var(--cap-foreground);
  box-sizing: border-box;
}

.cap-gdpr-modal__title {
  font-weight: 600;
  font-size: 18px;
  line-height: 1.3;
}

.cap-gdpr-modal__description {
  font-size: 14px;
  line-height: 1.6;
  opacity: 0.8;
}

.cap-gdpr-modal__links {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.cap-gdpr-modal__links a {
  color: var(--cap-accent);
  font-size: 13px;
  text-decoration: underline;
}

.cap-gdpr-modal__links a:hover {
  opacity: 0.75;
}

.cap-gdpr-modal__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.cap-gdpr-modal__btn {
  flex: 1;
  padding: 12px 20px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
  font-family: inherit;
  min-width: 120px;
  text-align: center;
}

.cap-gdpr-modal__btn:hover {
  opacity: 0.85;
}

.cap-gdpr-modal__btn--accept {
  background-color: var(--cap-accent);
  color: var(--cap-accent-foreground);
}

.cap-gdpr-modal__btn--reject {
  background-color: transparent;
  color: var(--cap-foreground);
  border: 1px solid color-mix(in srgb, var(--cap-foreground) 20%, transparent);
}
