/* Reset and base styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Main container */
.leadgen-form-container {
  display: flex;
  width: 408px;
  max-width: 100%;
  padding: 24px;
  flex-direction: column;
  align-items: flex-start;
  gap: 30px;
  align-self: stretch;
  border-radius: 24px;
  border: 1px solid #e4e4e4;
  background: #f7f7f7;
  font-family: "DM Sans", sans-serif;
}

/* Remove background variant */
.leadgen-form-container.no-background {
  border: none !important;
  background: none !important;
  padding: 0 !important;
}

/* Form title */
.leadgen-form-title {
  color: #313131;
  text-align: center;
  font-family: "DM Sans", sans-serif;
  font-size: 22px;
  font-style: normal;
  font-weight: 700;
  line-height: 130%;
  width: 100%;
}

/* Form element */
.leadgen-form {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 30px;
  align-self: stretch;
  width: 100%;
}

/* Input container */
.leadgen-input-container {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  align-self: stretch;
  width: 100%;
}

/* Input wrapper for icon positioning */
.leadgen-input-wrapper {
  position: relative;
  width: 100%;
}

/* Validation icons */
.leadgen-error-icon,
.leadgen-success-icon {
  position: absolute;
  right: 16px;
  top: 8px;
  width: 24px;
  height: 24px;
  pointer-events: none;
  z-index: 2;
}

/* Floating label */
.leadgen-floating-label {
  position: absolute;
  top: -17px;
  left: 0;
  color: #313131;
  font-family: "DM Sans", sans-serif;
  font-size: 12px;
  font-style: normal;
  font-weight: 500;
  line-height: 120%;
  transition: opacity 0.3s ease;
  opacity: 0;
  pointer-events: none;
}

.leadgen-floating-label.leadgen-label-active {
  opacity: 1;
}

/* Input styling */
.leadgen-input {
  display: flex;
  max-height: 40px;
  padding: 16px;
  align-items: center;
  align-self: stretch;
  border-radius: 8px;
  border: 1px solid #c2c2c2;
  background: #fff;
  color: #313131;
  font-family: "DM Sans", sans-serif;
  font-size: 16px;
  font-style: normal;
  font-weight: 400;
  line-height: 120%;
  width: 100%;
  box-sizing: border-box;
  transition: border-color 0.3s ease;
}

.leadgen-input::placeholder {
  color: #c2c2c2;
}

.leadgen-input:focus {
  outline: none;
  border-color: #3a7766;
}

.leadgen-input:focus::placeholder {
  color: transparent;
}

/* Input error state */
.leadgen-input-error {
  border-color: #d32f2f !important;
}

.leadgen-input-error:focus {
  border-color: #d32f2f !important;
}

.leadgen-input-error + .leadgen-floating-label.leadgen-label-active {
  color: #d32f2f;
}

/* Input success state */
.leadgen-input-success {
  border-color: #3a7766;
}

/* Error message */
.leadgen-validation-error {
  color: #d32f2f;
  font-family: "DM Sans", sans-serif;
  font-size: 12px;
  font-style: normal;
  font-weight: 400;
  line-height: 16px;
  margin: 0;
  padding: 0;
  display: none;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.leadgen-validation-error-show {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

/* General error container */
.leadgen-general-error {
  color: #e53935;
  font-family: "DM Sans", sans-serif;
  font-size: 14px;
  font-style: normal;
  font-weight: 400;
  line-height: 120%;
  text-align: center;
  display: none;
  width: 100%;
  padding: 8px;
  background: #ffebee;
  border-radius: 8px;
}

.leadgen-general-error.show {
  display: block;
}

/* CTA Button */
.leadgen-submit-button {
  display: flex;
  height: 56px;
  padding: 8px 16px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  align-self: stretch;
  border-radius: 8px;
  background: #09880d;
  border: none;
  cursor: pointer;
  transition: background-color 0.3s ease;
  width: 100%;
  position: relative;
}

.leadgen-submit-button:hover:not(:disabled) {
  background: #077a0b;
}

.leadgen-submit-button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.leadgen-button-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.leadgen-button-text {
  color: #fff;
  text-align: center;
  font-family: "DM Sans", sans-serif;
  font-size: 18px;
  font-style: normal;
  font-weight: 700;
  line-height: 120%;
  text-transform: uppercase;
}

/* Spinner */
.leadgen-spinner {
  display: none;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.leadgen-spinner.show {
  display: inline-block;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Secure icons container */
.leadgen-secure-icons {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 24px;
  align-self: stretch;
  width: 100%;
}

.leadgen-secure-icons img {
  display: block;
}

.leadgen-secure-icons.hidden {
  display: none;
}

/* Mobile styles */
@media (max-width: 768px) {
  .leadgen-form-container {
    width: 100%;
    padding: 20px 16px;
    gap: 24px;
    border-radius: 16px;
  }

  .leadgen-form-container.no-background {
    padding: 0 !important;
  }

  .leadgen-form-title {
    font-size: 20px;
  }

  .leadgen-input {
    height: 52px;
    font-size: 16px;
  }

  .leadgen-floating-label {
    font-size: 12px;
  }

  .leadgen-validation-icon {
    right: 14px;
    width: 18px;
    height: 18px;
  }

  .leadgen-error-message {
    font-size: 12px;
    margin-top: 6px;
  }

  .leadgen-general-error {
    font-size: 12px;
    padding: 6px;
  }

  .leadgen-submit-button {
    height: 52px;
    padding: 8px 12px;
  }

  .leadgen-button-text {
    font-size: 16px;
  }

  .leadgen-spinner {
    width: 18px;
    height: 18px;
    border-width: 2.5px;
  }

  .leadgen-secure-icons {
    gap: 16px;
    flex-wrap: wrap;
  }

  .leadgen-secure-icons img {
    max-width: 70px;
    height: auto;
  }
}
