.custom-form-wrapper {
  max-width: 1200px;
  margin: 24px auto;
}

.custom-form-wrapper .custom-form-logo {
  margin-bottom: 16px;
  text-align: center;
}

.custom-form-wrapper .custom-form-logo__img {
  display: block;
  max-width: 32%;
  height: auto;
  margin-inline: auto;
}

.custom-form-wrapper .custom-form-title-and-description {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.custom-form-wrapper .custom-form-title-and-description h2 {
  margin: 0;
  text-align: center;
}

.custom-form {
  text-align: right;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 24px;
}

.custom-form,
.custom-form * {
  font-family:
    CircularXX TT,
    sans-serif;
  font-weight: 450;
  font-size: 14px;
  line-height: 150%;
  color: rgba(12, 25, 55, 1);
}

.custom-form .form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  width: 100%;
}

.custom-form .form-field .input-wrapper,
.custom-form .form-row .input-wrapper {
  position: relative;
  width: 100%;
}

.custom-form .form-field {
  position: relative;
  width: 100%;
}

.custom-form .form-field-half {
  width: calc(50% - 12px);
}

.custom-form .form-field-full {
  width: 100%;
}

.custom-form label {
  position: absolute;
  z-index: 9;
  top: calc(50%);
  transform: translateY(-50%);
  right: 16px;
  background: #fff;
  padding: 0 4px;
  color: rgba(180, 184, 193, 1);
  font-family:
    CircularXX TT,
    sans-serif;
  pointer-events: none;
  font-weight: 450;
  font-size: 14px;
  line-height: 150%;
  text-align: right;
  transition: 0.3s all;
}

.custom-form .form-field:has(input[type="file"]) label {
  right: 48px;
}

.custom-form .form-field:has(input.active, select.active) label {
  top: 10px;
  transform: translateY(-19px);
  font-size: 12px;
  color: rgba(138, 147, 172, 1);
}

.custom-form .form-field:has(input[type="date"]) label {
  top: 10px;
  transform: translateY(-19px);
  font-size: 12px;
  color: rgba(138, 147, 172, 1);
}

.custom-form input[type="text"],
.custom-form input[type="email"],
.custom-form input[type="tel"],
.custom-form input[type="date"],
.custom-form select,
.custom-form textarea {
  text-align: right;
  width: 100%;
  padding: 14px 16px;
  border: 1px solid rgba(180, 184, 193, 1);
  border-radius: 8px;
}

.custom-form input:focus-visible,
.custom-form select:focus-visible,
.custom-form textarea:focus-visible {
  outline: none;
}

.custom-form .file-input-wrapper:focus-within {
  outline: none;
  border-color: rgba(0, 21, 74, 1);
}

/* File input specific styles */
.custom-form input[type="file"] {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  cursor: pointer;
  z-index: 1;
}

.custom-form .file-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  padding: 14px 16px;
  border: 1px solid rgba(180, 184, 193, 1);
  border-radius: 8px;
  background-color: #fff;
  cursor: pointer;
  transition: border-color 0.3s;
  min-height: 48px;
  overflow: hidden;
}

.custom-form .file-input-wrapper:hover {
  border-color: rgba(138, 147, 172, 1);
}

.custom-form .file-input-wrapper.has-file {
  border-color: rgba(0, 21, 74, 1);
}

.custom-form .file-input-wrapper.error {
  border-color: rgba(217, 76, 73, 1) !important;
}

.custom-form .file-input-button-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: rgba(138, 147, 172, 1);
  pointer-events: none;
  margin-left: 0;
  margin-right: 8px;
}

.custom-form .file-input-wrapper.has-file .file-input-button-icon {
  color: rgba(12, 25, 55, 1);
}

.custom-form .file-input-button {
  display: none;
  align-items: center;
  color: rgba(138, 147, 172, 1);
  font-size: 14px;
  font-weight: 450;
  pointer-events: none;
  flex: 1;
  text-align: right;
  justify-content: flex-end;
}

.custom-form .file-input-wrapper.has-file .file-input-button {
  color: rgba(12, 25, 55, 1);
}

.custom-form .file-input-display {
  font-size: 14px;
  color: rgba(12, 25, 55, 1);
  text-align: right;
  margin-right: 8px;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.custom-form .form-field:has(.file-input-wrapper.has-file) label {
  top: 10px;
  transform: translateY(-19px);
  font-size: 12px;
  color: rgba(138, 147, 172, 1);
  right: 16px;
}

.custom-form select {
  padding-left: 32px;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4 6L8 10L12 6' stroke='%238A93AC' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 8px center;
}

.custom-form select option {
  color: #000;
}

.custom-form select option:first-child {
  display: none;
}

.custom-form .submit-button {
  padding: 14px 28px;
  background: rgba(231, 232, 235, 1);
  width: fit-content;
  min-width: 140px;
  min-height: 48px;
  border-radius: 24px;
  font-family:
    CircularXX TT,
    sans-serif;
  font-weight: 700;
  font-size: 14px;
  line-height: 150%;
  color: rgba(138, 147, 172, 1);
  border: none;
  cursor: pointer;
  transition:
    background 0.2s ease,
    color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease;
}

.custom-form .submit-button.valid {
  padding: 16px 36px;
  min-height: 52px;
  font-size: 15px;
  background: rgba(0, 21, 74, 1);
  color: #fff;
  box-shadow:
    0 4px 14px rgba(0, 21, 74, 0.35),
    0 1px 2px rgba(0, 21, 74, 0.12);
}

.custom-form .submit-button:not(.valid):hover {
  background: rgba(220, 222, 228, 1);
  color: rgba(100, 110, 130, 1);
}

.custom-form .submit-button.valid:hover {
  background: rgba(0, 32, 110, 1);
  box-shadow:
    0 8px 24px rgba(0, 21, 74, 0.45),
    0 2px 4px rgba(0, 21, 74, 0.15);
  transform: translateY(-2px);
}

.custom-form .submit-button.valid:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(0, 21, 74, 0.35);
}

.custom-form .submit-button:focus-visible {
  outline: 2px solid rgba(0, 21, 74, 0.45);
  outline-offset: 3px;
}

.custom-form .submit-button.valid:focus-visible {
  outline-color: rgba(100, 160, 255, 0.95);
}

.custom-form .checkbox-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
}

.custom-form .checkbox-wrapper input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  min-width: 20px;
  height: 20px;
  border: 1px solid rgba(180, 184, 193, 1);
  border-radius: 4px;
  margin: 0;
  cursor: pointer;
}

.custom-form .checkbox-wrapper input[type="checkbox"]:checked {
  background-color: rgba(0, 21, 74, 1);
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='9' viewBox='0 0 12 9' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 4L4.5 7.5L11 1' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  border-color: rgba(0, 21, 74, 1);
}

.custom-form .checkbox-wrapper label {
  position: static;
  transform: none;
  background: none;
  padding: 0;
  color: rgba(12, 25, 55, 1);
  pointer-events: auto;
}

.custom-form .checkbox-wrapper label a {
  text-decoration: none;
  color: rgba(0, 21, 74, 1);
}

.custom-form .checkbox-wrapper label a:hover {
  text-decoration: underline;
  color: rgb(34, 129, 170);
}

.custom-form .error-message {
  color: rgba(217, 76, 73, 1);
  font-size: 12px;
  margin-top: 5px;
  text-align: right;
}

.custom-form input.error,
.custom-form textarea.error,
.custom-form select.error {
  border: 1px solid rgba(217, 76, 73, 1) !important;
}

.custom-form .form-submit-wrapper {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  width: 100%;
  flex-basis: 100%;
  padding-top: 8px;
  gap: 12px;
}

.custom-form .form-message {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.4;
}

.custom-form .form-message.success {
  background-color: rgba(76, 175, 80, 0.1);
  border: 1px solid rgba(76, 175, 80, 0.3);
  color: rgba(76, 175, 80, 0.9);
}

.custom-form .form-message.error {
  background-color: rgba(217, 76, 73, 0.1);
  border: 1px solid rgba(217, 76, 73, 0.3);
  color: rgba(217, 76, 73, 0.9);
}

.custom-form .submit-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.custom-form .submit-button.valid:disabled:hover {
  transform: none;
  box-shadow:
    0 4px 14px rgba(0, 21, 74, 0.35),
    0 1px 2px rgba(0, 21, 74, 0.12);
}

/* Spinner styles */
.custom-form .submit-button .spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 0.8s linear infinite;
  vertical-align: middle;
}

.custom-form .submit-button:not(.valid) .spinner {
  border-color: rgba(138, 147, 172, 0.3);
  border-top-color: rgba(138, 147, 172, 1);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.custom-form .custom-form-success-message {
  width: 100%;
}

.custom-form .custom-form-success-message-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
}

.custom-form .custom-form-success-message img {
  width: 56px;
  height: 56px;
}

.custom-form .custom-form-success-message h2 {
  font-family:
    CircularXX TT,
    sans-serif;
  font-weight: 450;
  font-size: 40px;
  line-height: 130%;
  color: rgba(12, 25, 55, 1);
}

.custom-form .custom-form-success-message p {
  font-family:
    CircularXX TT,
    sans-serif;
  font-weight: 450;
  font-size: 20px;
  line-height: 130%;
  text-align: center;
  color: rgba(12, 25, 55, 1);
}

.custom-form .custom-form-success-message a {
  text-decoration: none;
  background: rgba(50, 186, 246, 1);
  color: #fff;
  padding: 12px 24px;
  border-radius: 24px;
  font-family:
    CircularXX TT,
    sans-serif;
  font-weight: 700;
  font-size: 14px;
  line-height: 150%;
}

/* Date input specific styles */
.custom-form input[type="date"] {
  position: relative;
  color: rgba(12, 25, 55, 1);
}

.custom-form input[type="date"]::-webkit-calendar-picker-indicator {
  background: transparent;
  bottom: 0;
  color: transparent;
  cursor: pointer;
  height: auto;
  left: 0;
  position: absolute;
  right: 0;
  top: 0;
  width: auto;
}

.custom-form input[type="date"]::-webkit-datetime-edit {
  padding: 0;
}

.custom-form input[type="date"]::-webkit-datetime-edit-fields-wrapper {
  padding: 0;
}

.custom-form input[type="date"]::-webkit-datetime-edit-text {
  padding: 0 2px;
}

.custom-form input[type="date"]::-webkit-datetime-edit-month-field,
.custom-form input[type="date"]::-webkit-datetime-edit-day-field,
.custom-form input[type="date"]::-webkit-datetime-edit-year-field {
  padding: 0 2px;
}

.custom-form input[type="date"]:in-range::-webkit-datetime-edit-year-field,
.custom-form input[type="date"]:in-range::-webkit-datetime-edit-month-field,
.custom-form input[type="date"]:in-range::-webkit-datetime-edit-day-field,
.custom-form input[type="date"]:in-range::-webkit-datetime-edit-text {
  color: rgba(12, 25, 55, 1);
}

@media (max-width: 992px) {
  .custom-form {
    flex-direction: column;
  }

  .custom-form .form-field-half {
    width: 100%;
  }
}

.wForm .reqMark:after {
  color: #8a93ac !important;
}
