:root {
  --formful-padding-top: 50px;
  --formful-padding-right: 45px;
  --formful-padding-bottom: 35px;
  --formful-padding-left: 45px;

  --formful--phone-padding-left: 60px;

  /* Colors — minimal palette: one accent (blue), one error (red), neutrals */
  --formful-color-error: #e02229;
  --formful-color-error-rgb: 224, 34, 41;

  --formful-color-interactive: #2c6ecb;
  --formful-color-interactive-rgb: 44, 110, 203;

  --formful-color-on-surface-rgb: 0, 0, 0;
  --formful-color-surface: #fff;
  --formful-color-neutral-soft: #f3f3f3;
  --formful-color-neutral-border: #dcdcdc;
  --formful-color-neutral-text-muted: #666;
}

.formful__wrapper {
  position: relative;
  margin: 0 auto;
}

.formful__form {
  padding-left: 1.6rem;
  padding-right: 1.6rem;
}

.formful__field-wrapper {
  position: relative;
}

.formful__field-wrapper label:first-of-type {
  display: flex;
  margin-block-end: 5px;
}

.formful__radio-group {
  border: none;
  padding: 0;
  margin: 0;
  display: flex;
  column-gap: 1rem;
  row-gap: 0.5rem;
  flex-wrap: wrap;
  flex-direction: column;
}

.formful__checkbox-group-wrapper {
  display: flex;
  flex-direction: column;
}

.formful__checkbox-group {
  border: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.formful__error {
  color: var(--formful-color-error);
  font-size: small;
  margin-top: 5px;
  display: block;
}

.formful__input--error {
  border-color: var(--formful-color-error) !important;
  outline-color: var(--formful-color-error) !important;
  box-shadow: 0 0 0 1px var(--formful-color-error) !important;
  background-color: rgba(var(--formful-color-error-rgb), 0.05) !important;
}

.formful__radio-group label {
  cursor: pointer;
  display: flex;
  align-items: center;
  column-gap: 5px;
  margin: 0;
  /* padding: 0; */
}

.formful__radio-group input {
  margin: 0 !important;
  cursor: pointer;
  /* width: fit-content; */
  min-width: fit-content;
}

.formful__checkbox-label {
  display: grid !important;
  grid-auto-flow: column;
  grid-auto-columns: minmax(auto, max-content);
  align-items: center;
  column-gap: 10px;
  cursor: pointer;
}

.formful__checkbox-label input {
  margin: 0 !important;
  inset-block-start: auto;
}

.formful__checkbox-label span,
.formful__checkbox-label .rte p {
  cursor: pointer;
  margin: 0;
  font-size: inherit;
  color: inherit;
}

.formful__form .rte,
.formful__form .rte p {
  font-size: inherit;
  line-height: inherit;
  letter-spacing: inherit;
}

.formful__checkbox-label p {
  margin: 0;
}

.formful__fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  column-gap: 2rem;
  row-gap: 1rem;
  text-align: start;
}

.formful__fields label,
.formful__fields textarea,
.formful__fields input {
  text-align: start;
}

.formful__fields input:not([type="checkbox"]):not([type="radio"]),
.formful__fields .input {
  margin: 0 !important;
}

@media screen and (min-width: 769px) {
  .formful__fields {
    grid-template-columns: repeat(2, 1fr);
  }
  .formful__fullwidth {
    grid-row-start: span 2;
    grid-column-start: span 2;
  }
}

/* Dropzone */
.formful__dropzone {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 0.875rem 1rem;
  border: 1.5px dashed color-mix(in srgb, currentColor 30%, transparent);
  border-radius: 6px;
  background-color: transparent;
  cursor: pointer;
  transition:
    border-color 0.2s ease,
    background-color 0.2s ease;
  gap: 0.625rem;
  margin: 0; /* reset default label spacing */
}

.formful__dropzone:hover {
  border-color: color-mix(in srgb, currentColor 45%, transparent);
  background-color: color-mix(in srgb, currentColor 2%, transparent);
}

.formful__dropzone--dragover {
  border-color: var(--formful-color-interactive);
  background-color: rgba(var(--formful-color-interactive-rgb), 0.04);
}

/* WCAG 2.4.7: visible focus ring (file input is visually hidden; remove buttons are inside the label) */
.formful__dropzone:focus-within {
  outline: 2px solid rgba(var(--formful-color-interactive-rgb), 0.65);
  outline-offset: 2px;
  border-color: color-mix(in srgb, currentColor 50%, transparent);
}

.formful__dropzone-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.formful__dropzone-input:focus {
  outline: none;
}

.formful__dropzone-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 0;
}

.formful__dropzone--has-files .formful__dropzone-content {
  display: none;
}

/* Let clicks pass to the dropzone (then delegated to the hidden input) so behavior is consistent. */
.formful__dropzone-content,
.formful__dropzone-content * {
  pointer-events: none;
}

.formful__dropzone-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  color: inherit;
}

.formful__dropzone-text {
  margin: 0;
  font-size: 1em;
  line-height: 1.4;
  color: inherit;
  opacity: 0.85;
}

.formful__dropzone-file-list {
  display: none;
  width: 100%;
  list-style: none;
  margin: 0;
  padding: 0;
}

.formful__dropzone--has-files .formful__dropzone-file-list {
  display: block;
}

.formful__dropzone-file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.3rem 0;
  border-bottom: 1px solid color-mix(in srgb, currentColor 6%, transparent);
  gap: 0.5rem;
  margin: 0;
}

.formful__dropzone-file-item:last-child {
  border-bottom: none;
}

.formful__dropzone--has-oversize {
  border-color: var(--formful-color-error);
  background-color: rgba(var(--formful-color-error-rgb), 0.03);
}

.formful__dropzone--has-oversize:hover {
  border-color: var(--formful-color-error);
  background-color: rgba(var(--formful-color-error-rgb), 0.05);
}

.formful__dropzone--has-error {
  border-color: var(--formful-color-error) !important;
  background-color: rgba(var(--formful-color-error-rgb), 0.05) !important;
  box-shadow: 0 0 0 1px var(--formful-color-error);
}

.formful__dropzone--has-error:hover {
  border-color: var(--formful-color-error) !important;
  background-color: rgba(var(--formful-color-error-rgb), 0.08) !important;
}

.formful__dropzone-file-item--oversize {
  padding-left: 0.5rem;
  background-color: rgba(var(--formful-color-error-rgb), 0.08);
  box-shadow: inset 3px 0 0 0 var(--formful-color-error);
  animation: formful-oversize-fade-in 0.3s ease-out;
}

@keyframes formful-oversize-fade-in {
  from {
    opacity: 0;
    background-color: rgba(var(--formful-color-error-rgb), 0.22);
  }
  to {
    opacity: 1;
    background-color: rgba(var(--formful-color-error-rgb), 0.08);
  }
}

@media (prefers-reduced-motion: reduce) {
  .formful__dropzone-file-item--oversize {
    animation: none;
  }
}

.formful__dropzone-file-main {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  min-width: 0;
  flex: 1;
}

.formful__dropzone-file-name {
  font-size: 0.9375em;
  color: inherit;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  flex: 1 1 0;
  font-weight: 500;
}

.formful__dropzone-file-size {
  font-size: 0.875em;
  color: inherit;
  opacity: 0.55;
  flex-shrink: 0;
  white-space: nowrap;
}

.formful__dropzone-file-name--oversize {
  color: var(--formful-color-error);
}

.formful__dropzone-file-size--oversize {
  opacity: 1;
  color: var(--formful-color-error);
  font-weight: 600;
}

.formful__dropzone-file-remove {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  /* ~44×44px minimum target (WCAG 2.5.5) */
  width: 2.75rem;
  height: 2.75rem;
  min-width: 2.75rem;
  min-height: 2.75rem;
  padding: 0;
  margin: 0;
  flex-shrink: 0;
  background: none;
  border: none;
  color: color-mix(in srgb, currentColor 40%, transparent);
  cursor: pointer;
  border-radius: 4px;
  transition: color 0.15s ease;
}

.formful__dropzone-file-remove svg {
  width: 14px;
  height: 14px;
  pointer-events: none;
  flex-shrink: 0;
}

.formful__dropzone-file-remove:hover {
  color: var(--formful-color-error);
}

.formful__dropzone-file-remove:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(var(--formful-color-interactive-rgb), 0.65);
  border-radius: 4px;
}

.formful__hide {
  opacity: 0;
  width: 100%;
  height: 100%;
  position: absolute;
  z-index: -1; /* Check if this work on all themes for upload field */
}

.formful__show {
  position: relative;
  opacity: 1;
  transition: opacity 0.5s;
  z-index: 1;
}

.formful__footer {
  background-color: var(--formful-color-neutral-soft);
  padding: 10px;
  text-align: center;
  font-size: 12px;
  opacity: 0.8;
  margin-top: 10px;
}

.formful__reverse {
  display: flex;
  flex-direction: column-reverse;
}

.formful__no-padding-y {
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

.formful__info-banner {
  border: 1px solid rgba(var(--formful-color-interactive-rgb), 0.35);
  background-color: rgba(var(--formful-color-interactive-rgb), 0.08);
  border-radius: 10px; /* Round borders */
  padding: 20px;
  max-width: 500px;
  margin: 30px auto;
  display: flex;
}

.formful__info-banner__text {
  margin-left: 25px;
}

.formful_items-center {
  align-items: center;
}

.formful__thanks-message {
  margin-bottom: 15px;
  padding-left: 1.6rem;
  padding-right: 1.6rem;
}

.formful__thanks-message.formful__hide {
  height: 0;
}

.formful__thanks-message.formful__show {
  height: auto;
}

.formful__spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  border: 4px solid var(--formful-color-neutral-soft);
  border-top: 4px solid var(--formful-color-interactive);
  border-radius: 50%;
  width: 24px;
  height: 24px;
  animation: spin 1s linear infinite;
  display: none; /* Initially the spinner is hidden */
}

@keyframes spin {
  0% {
    transform: translate(-50%, -50%) rotate(0deg);
  }
  100% {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

.formful__text-left {
  /* text-align: left; */
  display: flex;
  justify-content: left;
}
.formful__text-center {
  /* text-align: center; */
  display: flex;
  justify-content: center;
}
.formful__text-right {
  /* text-align: right; */
  display: flex;
  justify-content: right;
}

.formful__w-100 {
  width: 100% !important;
}

.formful__max-w-100 {
  max-width: 100% !important;
}

.formful__d-block {
  display: block !important;
}

.formful__button {
  position: relative;
  margin-top: 2rem;
}

.flatpickr-wrapper {
  width: 100%;
}

.formful__datepicker {
  color: inherit;
}

.formful__button-label {
  position: relative;
  z-index: 2;
}

.formful__branding {
  color: inherit;
  font-size: 12px;
  text-align: right;
  margin-left: auto;
  display: block !important;
  visibility: visible !important;
  margin-top: 10px;
}

.pretty-select {
  width: 100%;
}

.formful__input {
  min-width: 100%;
}

.formful__input--phone {
  padding-left: 60px !important;
}

/* START Align theme */
.formful__form .grid-archive__subnav {
  gap: initial;
  align-items: initial;
}

.formful__form .grid-archive__subnav .sort-by {
  display: block;
}

.formful__form .grid-archive__subnav .sort-by select {
  padding: 1.6rem;
  line-height: normal;
}
/* END Align theme */

.formful__form .d-none {
  display: none !important;
}

.formful__form .d-flex {
  display: flex !important;
}

.formful__form .m-0 {
  margin: 0 !important;
}

.formful__form .pt-15 {
  padding-top: 15px !important;
}

.formful__form .d-block {
  display: block !important;
}

.formful__form .normalize-padding {
  /* padding-top: 1.5rem !important; */
  /* padding-bottom: 1.5rem !important; */
  padding: 1.5rem;
}

.formful__form .show-placeholder::placeholder {
  opacity: 1;
}

.formful__form .min-w-fit-content {
  min-width: fit-content;
}

.formful__form .min-h-fit-content {
  min-height: fit-content;
}

.formful__form .w-fit-content {
  width: fit-content;
}

.formful__form .transform-unset {
  transform: unset !important;
}

.formful__form .align-items-start {
  align-items: start !important;
}

.formful__form .position-relative {
  position: relative !important;
}

.formful__overlay {
  background-color: rgba(var(--formful-color-on-surface-rgb), 0.4);
  width: 100%;
  height: 100%;
  text-align: center;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 50;
  backdrop-filter: blur(5px);
}

.formful__overlay-box {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--formful-color-surface);
  padding: 20px;
  max-width: 80%;
  max-height: 80%;
  overflow-y: auto;
}

.formful__form .step {
  background: transparent;
  display: none;
}

.formful__form .step.active {
  display: block;
}

.formful__button-group {
  display: flex;
  justify-content: space-between;
  column-gap: 2rem;
}

/* Styles for Progress Bar */
.formful__progressbar {
  position: relative;
  display: flex;
  counter-reset: step;
  margin: 2rem 0 2rem;
  flex-direction: column;
  gap: 1rem;
}

@media screen and (min-width: 426px) {
  .formful__progressbar {
    justify-content: space-around;
    flex-direction: row;
    margin: 2rem 0 6rem;
  }
}

.formful__progressbar::before,
.formful__progress {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  height: 4px;
  width: 100%;
  background-color: var(--formful-color-neutral-border);
}
.formful__progress {
  background-color: var(--formful-color-interactive);
  width: 0%;
  transition: 0.3s;
  display: none;
  left: 0;
  transition: all 0.3s linear;
}

@media screen and (min-width: 426px) {
  .formful__progressbar::before {
    content: "";
  }
  .formful__progress {
    display: block !important;
  }
}

.formful__progress-step {
  width: 40px;
  height: 40px;
  background-color: var(--formful-color-neutral-border);
  border-radius: 50%;
  display: flex !important;
  justify-content: center;
  align-items: center;
  z-index: 1;
  transition: all 0.15s 0.15s linear;
}

.formful__progress-step::before {
  counter-increment: step;
  content: counter(step);
  font-weight: bold;
}
.formful__progress-step::after {
  content: attr(data-title);
  position: absolute;
  color: var(--formful-color-neutral-text-muted);
  left: 5rem;
}
@media screen and (min-width: 426px) {
  .formful__progress-step::after {
    top: calc(100% + 0.5rem);
    left: auto;
  }
}

.formful__progress-step-active {
  background-color: var(--formful-color-interactive);
  color: var(--formful-color-surface);
}

.formful__button-prev {
  margin-top: 2rem;
}

.formful__button-next {
  transition: unset;
  margin-top: 2rem;
}

.formful__country-picker {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  border-right: 1px solid color-mix(in srgb, currentColor 10%, transparent);
  z-index: 3;
  margin: 0;
}

.formful__country-picker select {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  opacity: 0;
  cursor: pointer;
}

.formful__country-picker img {
  display: block;
  cursor: pointer;
  height: 25px;
  width: 25px;
}

.border-none {
  border: none !important;
}
