body, input, button, label {
  font-family: Arial, Helvetica, 'Open Sans', sans-serif !important;
}

#custom-popup-overlay {
  position: fixed !important;
  top: 0 !important; left: 0 !important;
  width: 100vw !important; height: 100vh !important;
  background: rgba(0, 0, 0, 0.75) !important;
  display: none !important; /* Keep this as 'none' initially to hide it */
  align-items: center !important;
  justify-content: center !important;
  z-index: 9999 !important;
}

#custom-popup-container {
  position: relative !important;
  border-radius: 14px !important;
  padding: 2px !important;
  background: linear-gradient(135deg, #c62828, #fbca1f) !important;
  animation: pulse 2.5s infinite !important;
  /* --- DESKTOP Changes --- */
  max-width: 400px !important; /* Slightly wider than last, but still compact */
  width: 90% !important;
}

.logo-bar {
  background: #231f20 !important;
  padding: 10px 15px 2px !important; /* Adjusted padding */
  text-align: center !important;
  border-top-left-radius: 12px !important;
  border-top-right-radius: 12px !important;
}

.popup-logo {
  max-width: 90px !important; /* Slightly larger logo for desktop, still smaller than original */
  height: auto !important;
}

.popup-card {
  background: white !important;
  padding: 1.2rem !important; /* Adjusted padding */
  border-bottom-left-radius: 12px !important;
  border-bottom-right-radius: 12px !important;
  text-align: center !important;
}

.form-title {
  font-size: 1.6rem !important; /* Increased font size for readability */
  font-weight: bold !important;
  margin-top: 0.3rem !important;
  margin-bottom: 0.7rem !important;
  color: #231f20 !important;
  text-align: left !important;
}

.popup-form label {
  display: block !important;
  font-weight: bold !important;
  font-size: 0.9rem !important; /* Increased font size for readability */
  margin-bottom: 0.3rem !important;
  color: #231f20 !important;
  text-align: left !important;
}

.form-subtext {
  font-size: 13px !important; /* Increased font size for readability */
  color: #333 !important;
  margin-bottom: 1.2rem !important; /* Adjusted margin */
  line-height: 1.4 !important;
  text-align: left !important;
}

.popup-input {
  width: 100% !important;
  padding: 0.7rem !important; /* Adjusted padding */
  border: 1px solid #1f2937 !important;
  border-radius: 6px !important;
  margin-bottom: 0.9rem !important; /* Adjusted margin */
  font-size: 14px !important; /* Increased font size for readability */
  box-sizing: border-box !important;
}

.checkbox-wrapper {
  display: flex !important;
  align-items: center !important; /* <<< FIX: Aligns text with checkbox vertically */
  gap: 8px !important;
  text-align: left !important;
  font-size: 12px !important; /* Increased font size for readability */
  margin-bottom: 1.2rem !important; /* Adjusted margin */
  color: #555 !important;
}
.checkbox-wrapper a {
  color: #c5a725 !important;
  text-decoration: underline !important;
}
.checkbox-wrapper a:hover {
  text-decoration: none !important;
}

.required {
  color: #c62828 !important;
  font-weight: bold !important;
}

.popup-submit {
  background: #fbca1f !important;
  font-family: inherit !important;
  padding: 0.55em 1.1em !important; /* Adjusted padding */
  font-weight: 900 !important;
  font-size: 15px !important; /* Increased font size for readability */
  border: 3px solid #000 !important;
  border-radius: 0.4em !important;
  box-shadow: 0.1em 0.1em !important;
  cursor: pointer !important;
  width: 100% !important;
  transition: 0.1s ease-in-out !important;
}

.popup-submit:hover {
  background: #fbca1f !important;
  transform: translate(-0.05em, -0.05em) !important;
  box-shadow: 0.15em 0.15em !important;
  border: 3px solid #000 !important;
}
.popup-submit:active {
  background: #fbca1f !important;
  transform: translate(0.05em, 0.05em) !important;
  box-shadow: 0.05em 0.05em !important;
  border: 3px solid #000 !important;
}

#form-messages {
  margin-top: 0.8rem !important;
  padding: 0.6rem !important;
  border-radius: 6px !important;
  font-size: 0.9rem !important; /* Increased font size for readability */
  text-align: center !important;
}
.message-success {
  background-color: #d4edda !important;
  color: #155724 !important;
  border: 1px solid #c3e6cb !important;
}
.message-error {
  background-color: #f8d7da !important;
  color: #721c24 !important;
  border: 1px solid #f5c6cb !important;
}

.close-button {
  position: absolute !important;
  top: 10px !important;
  right: 10px !important;
  width: 2.5em !important; /* Adjusted size */
  height: 2.5em !important;
  border: none !important;
  background: rgba(180, 83, 107, 0.11) !important;
  border-radius: 5px !important;
  transition: background 0.5s !important;
  cursor: pointer !important;
  z-index: 10000 !important;
}
.X, .Y {
  position: absolute !important;
  top: 50% !important;
  left: 50% !important;
  width: 1.4em !important; /* Adjusted size */
  height: 1.5px !important;
  background-color: white !important;
}
.X { transform: translateX(-50%) rotate(45deg) !important; }
.Y { transform: translateX(-50%) rotate(-45deg) !important; }

.close {
  position: absolute !important;
  display: flex !important;
  padding: 0.4rem 0.8rem !important;
  align-items: center !important;
  justify-content: center !important;
  transform: translateX(-50%) !important;
  top: -60% !important;
  left: 50% !important;
  font-size: 10px !important;
  background-color: #131618 !important;
  color: #bbe5ec !important;
  border-radius: 3px !important;
  pointer-events: none !important;
  opacity: 0 !important;
}
.close-button:hover {
  background-color: rgb(211, 21, 21) !important;
}
.close-button:hover > .close {
  animation: close 0.2s forwards 0.25s !important;
}

@keyframes close {
  100% { opacity: 1; }
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 0, 0, 0.3); }
  50% { box-shadow: 0 0 0 10px rgba(255, 0, 0, 0); }
}

/* --- MOBILE Changes Start (Aggressive Scaling for Mobile, with text focus) --- */
/* For screens up to 768px (tablets and smaller phones) */
@media (max-width: 768px) {
    #custom-popup-container {
        max-width: 300px !important; /* Even narrower for general mobile */
        width: 95% !important; /* Allow it to take up more screen width */
    }
    .popup-card {
        padding: 0.9rem !important; /* Adjusted padding */
    }
    .form-title {
        font-size: 1.3rem !important; /* Adjusted font size */
        margin-bottom: 0.4rem !important;
    }
    .form-subtext {
        font-size: 12px !important; /* Adjusted font size */
        margin-bottom: 0.8rem !important;
        line-height: 1.3 !important;
    }
    .popup-input {
        padding: 0.5rem !important; /* Adjusted padding */
        font-size: 13px !important; /* Adjusted font size */
        margin-bottom: 0.6rem !important;
    }
    .checkbox-wrapper {
        font-size: 11px !important; /* Adjusted font size */
        margin-bottom: 1rem !important;
        align-items: center !important; /* <<< FIX: Aligns text with checkbox vertically */
    }
    .popup-submit {
        font-size: 13px !important; /* Adjusted font size */
        padding: 0.4em 0.8em !important; /* Adjusted padding */
    }
    .popup-logo {
        max-width: 60px !important; /* Smaller logo for general mobile */
    }
    .logo-bar {
        padding: 6px 10px 1px !important; /* Adjusted padding */
    }
    .close-button {
        top: 6px !important;
        right: 6px !important;
        width: 2em !important;
        height: 2em !important;
    }
    .X, .Y {
        width: 1.1em !important;
    }
}


/* Your existing mobile styles for screens up to 480px (smaller phones) - fine-tuning */
@media (max-width: 480px) {
  .popup-card {
    padding: 0.7rem !important; /* Very small padding for very small screens */
  }
  .form-title {
    font-size: 1.1rem !important; /* Adjusted font size */
    margin-bottom: 0.3rem !important;
  }
  .form-subtext {
    font-size: 10px !important; /* Adjusted font size */
    margin-bottom: 0.6rem !important;
  }
  .popup-input {
    font-size: 12px !important; /* Adjusted font size */
    padding: 0.4rem !important;
    margin-bottom: 0.5rem !important;
  }
  .checkbox-wrapper {
    font-size: 10px !important; /* Adjusted font size */
    margin-bottom: 0.7rem !important;
    align-items: center !important; /* <<< FIX: Aligns text with checkbox vertically */
  }
  .popup-submit {
    font-size: 12px !important; /* Adjusted font size */
    padding: 0.3em 0.6em !important;
  }
  .popup-logo {
    max-width: 45px !important; /* Smallest logo for smallest screens */
  }
  .logo-bar {
    padding: 4px 8px 1px !important;
  }
  .close-button {
    top: 4px !important;
    right: 4px !important;
    width: 1.6em !important;
    height: 1.6em !important;
  }
  .X, .Y {
    width: 0.9em !important;
  }
}
/* --- MOBILE Changes End --- */

/* ========= CREDITS =========
    Gradient Border Effect: Copyright 2025 themrsami
    Button Animation:      Copyright 2025 adamgiebl
    Close Hover Reveal:    Copyright 2025 javierBarroso
    Licensed under the MIT License.
*/