:root {
  --primary-color: #0078d4;
  --primary-hover-color: #005a9e;
  --white-color: #ffffff;
  --shadow-color: rgba(0, 0, 0, 0.15);
  --overlay-color: rgba(0, 0, 0, 0.6);
  --error-color: #d93025;
}

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


.hidden {
  display: none !important;
}

#popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--overlay-color);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000; /* High z-index for WordPress compatibility */
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
    'Helvetica Neue', Arial, sans-serif;
  animation: fadeIn 0.3s ease-out;
}

#popup-modal {
  background: var(--white-color);
  padding: 2.5rem;
  border-radius: 12px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.25);
  text-align: center;
  max-width: 500px;
  width: 90%;
  position: relative;
  animation: slideIn 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

#popup-modal h2 {
  margin-top: 0;
  font-size: 1.8rem;
  color: #000;
}

#popup-modal p {
  font-size: 1.1rem;
  /*margin-bottom: 2rem;*/
  color: #555;
  line-height: 1.6;
}

#popup-close {
  position: absolute;
  top: 10px;
  right: 15px;
  background: none;
  border: none;
  font-size: 2rem;
  font-weight: bold;
  color: #aaa;
  cursor: pointer;
  transition: color 0.2s;
  padding: 0.5rem;
  line-height: 1;
}

#popup-close:hover {
  color: #333;
}

#popup-cta, #form-submit {
  background-color: var(--primary-color);
  color: var(--white-color);
  border: none;
  border-radius: 6px;
  padding: 1rem 2rem;
  font-size: 1.1rem;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.2s ease-in-out;
  width: 100%;
  margin-bottom: 1rem;
}

#popup-cta:hover, #form-submit:hover {
  background-color: var(--primary-hover-color);
}

#form-submit:disabled {
    background-color: #aaa;
    cursor: not-allowed;
}

#popup-alternative, #form-back-link {
  color: #777;
  font-size: 0.9rem;
  text-decoration: none;
  cursor: pointer;
  display: inline-block;
}

#popup-alternative:hover, #form-back-link:hover {
  text-decoration: underline;
}

/* --- Form Specific Styles --- */
#lead-form {
    display: flex;
    flex-direction: column;
    /*gap: 1rem;*/
}

.form-group {
    text-align: left;
}

#lead-form input {
    width: 100%;
    padding: 0.8rem 1rem;
    font-size: 1rem;
    border: 1px solid #ccc;
    border-radius: 6px;
    box-sizing: border-box;
}

#lead-form input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(0, 120, 212, 0.3);
}

#lead-form input.is-invalid {
    border-color: var(--error-color);
}
#lead-form input.is-invalid:focus {
    box-shadow: 0 0 0 2px rgba(217, 48, 37, 0.3);
}

.error-message {
    color: var(--error-color);
    font-size: 0.85rem;
    margin: 0.25rem 0 0;
    padding: 0;
    min-height: 1.2em; /* Prevents layout shift */
}

#form-submit {
    margin-top: 0.5rem;
}


/* --- Success Message Styles --- */
#popup-success h2 {
    color: #28a745;
}


/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideIn {
  from {
    transform: translateY(-50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}
