.dt-unisender-form-wrapper {
  position: relative;
}

#dt-unisender-form {
  transition: opacity 0.25s ease;

  .dt-unisender-form-fields {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .dt-unisender-consent {
    display: flex;
    align-items: center;
  }

  .dt-unisender-consent .dt-unisender-consent-text,
  .dt-unisender-consent .dt-unisender-consent-text a {
    font-size: 10px;
  }

  .dt-unisender-field label .required-asterisk {
    color: red;
    margin-left: 4px;
  }

  /* Hide the default checkbox */
  .dt-unisender-consent input[type='checkbox'] {
    opacity: 0;
    position: absolute;
    width: 0;
    height: 0;
  }

  /* Create a custom checkbox box */
  .dt-unisender-custom-checkbox {
    position: relative;
    display: inline-block;
    width: 16px;
    height: 16px;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 3px;
    margin-right: 8px;
    flex-shrink: 0;
  }

  /* Style the checkmark (SVG) */
  .dt-unisender-consent
    input[type='checkbox']:checked
    + .dt-unisender-custom-checkbox {
    background-color: #007cba;
    border-color: #007cba;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M4 8l3 3 5-5'/%3e%3c/svg%3e");
    background-size: contain;
  }

  /* Add a focus style */
  .dt-unisender-consent
    input[type='checkbox']:focus
    + .dt-unisender-custom-checkbox {
    box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.3);
  }
}

/* Dim the form while loading or showing message */
.dt-unisender-form-wrapper.is-loading #dt-unisender-form,
.dt-unisender-form-wrapper.has-message #dt-unisender-form {
  opacity: 0.15;
  pointer-events: none;
}

/* Loader overlay */
.dt-unisender-loader {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.dt-unisender-form-wrapper.is-loading .dt-unisender-loader {
  opacity: 1;
  pointer-events: all;
}

/* Spinner */
.dt-unisender-spinner {
  display: block;
  width: 36px;
  height: 36px;
  border: 3px solid rgba(0, 0, 0, 0.1);
  border-top-color: #007cba;
  border-radius: 50%;
  animation: dt-unisender-spin 0.7s linear infinite;
}

@keyframes dt-unisender-spin {
  to {
    transform: rotate(360deg);
  }
}

/* Message overlay */
.dt-unisender-message {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  text-align: center;
  font-size: 15px;
  line-height: 1.5;
  z-index: 20;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

.dt-unisender-message.is-visible {
  opacity: 1;
  pointer-events: all;
}
