/* ===================== */
/* MAIN FORM CONTAINER */
/* ===================== */
.nd-pro-signup-form-container {
  max-width: 650px;
  margin: 20px auto;
  padding: 25px;
  background-color: #ffffff;
  border: 1px solid #dddddd;
  border-radius: 5px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  overflow: visible !important; /* Fix overflow */
}

/* ===================== */
/* FORM STRUCTURE - Restored Original Float Layout */
/* ===================== */
.nd-pro-form::after {
  content: "";
  display: table;
  clear: both;
}

/* ===================== */
/* FIELD WIDTHS */
/* ===================== */
/* Full width fields */
.nd-pro-signup-form-container .nd-pro-width-full,
.nd-pro-signup-form-container .nd-pro-form-group.nd-pro-width-full,
.nd-pro-signup-form-container .nd-pro-width-1-1,
.nd-pro-signup-form-container .username-field.nd-pro-width-1-1,
.nd-pro-signup-form-container .email-field.nd-pro-width-1-1,
.nd-pro-signup-form-container .custom-field.nd-pro-width-1-1 {
  width: 100% !important;
  float: none;
  clear: both;
  margin-right: 0;
}

/* Half width fields */
.nd-pro-signup-form-container .nd-pro-width-half,
.nd-pro-signup-form-container .nd-pro-form-group.nd-pro-width-half,
.nd-pro-signup-form-container .nd-pro-width-1-2,
.nd-pro-signup-form-container .username-field.nd-pro-width-1-2,
.nd-pro-signup-form-container .email-field.nd-pro-width-1-2,
.nd-pro-signup-form-container .custom-field.nd-pro-width-1-2 {
  width: 48% !important;
  float: left;
  margin-right: 4%;
}

/* Third width fields */
.nd-pro-signup-form-container .nd-pro-width-third,
.nd-pro-signup-form-container .nd-pro-form-group.nd-pro-width-third,
.nd-pro-signup-form-container .nd-pro-width-1-3,
.nd-pro-signup-form-container .username-field.nd-pro-width-1-3,
.nd-pro-signup-form-container .email-field.nd-pro-width-1-3,
.nd-pro-signup-form-container .custom-field.nd-pro-width-1-3 {
  width: 30.66% !important;
  float: left;
  margin-right: 4%;
}

/* Clear the margin for every 2nd half-width and 3rd third-width field */
.nd-pro-signup-form-container .nd-pro-width-half:nth-of-type(2n),
.nd-pro-signup-form-container .nd-pro-form-group.nd-pro-width-half:nth-of-type(2n),
.nd-pro-signup-form-container .nd-pro-width-1-2:nth-of-type(2n),
.nd-pro-signup-form-container .nd-pro-form-group.nd-pro-width-1-2:nth-of-type(2n) {
  margin-right: 0 !important;
}

.nd-pro-signup-form-container .nd-pro-width-third:nth-of-type(3n),
.nd-pro-signup-form-container .nd-pro-form-group.nd-pro-width-third:nth-of-type(3n),
.nd-pro-signup-form-container .nd-pro-width-1-3:nth-of-type(3n),
.nd-pro-signup-form-container .nd-pro-form-group.nd-pro-width-1-3:nth-of-type(3n) {
  margin-right: 0 !important;
}

/* ===================== */
/* FORM ELEMENTS */
/* ===================== */
.nd-pro-input {
  width: 100%;
  padding: 10px 12px;
  margin-bottom: 12px;
  border: 1px solid #dddddd;
  border-radius: 4px;
  font-size: 14px;
  line-height: 1.5;
  color: #333333;
  background-color: #ffffff;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
  box-sizing: border-box;
}

.nd-pro-input:focus {
  border-color: #1E3A8A;
  outline: 0;
}

.nd-pro-input[type="text"]:focus,
.nd-pro-input[type="textarea"]:focus,
.nd-pro-input[type="url"]:focus,
.nd-pro-input[type="email"]:focus,
.nd-pro-input[type="number"]:focus {
  border: 1px solid green;
  outline: none !important;
}

.nd-pro-input::placeholder {
  color: #999999;
  opacity: 1;
}

.nd-pro-input[type="textarea"] {
  min-height: 100px;
  resize: vertical;
}

.nd-pro-input[type="select"] {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px;
}

/* Labels */
.nd-pro-label {
  display: block;
  margin-bottom: 8px;
  margin-top: 5px;
  font-weight: 500;
  color: #333333;
  font-size: 14px;
}

.nd-pro-label.required::after {
  content: " *";
  color: #e53935;
}

/* Radio and Checkbox groups */
.nd-pro-radio-group,
.nd-pro-checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nd-pro-radio-label,
.nd-pro-checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 400;
  cursor: pointer;
}

/* ===================== */
/* BUTTON STYLES - With Fixes */
/* ===================== */
.nd-pro-button {
  display: inline-block;
  padding: 10px 20px;
  background-color: #1E3A8A;
  color: #ffffff;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s ease-in-out;
}

.nd-pro-button:hover {
  background-color: #142a5e;
}

.nd-pro-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Button Container - With Positioning Fixes */
.signup-button-container {
  position: relative;
  margin: 20px 0 10px;
  clear: both;
  overflow: visible !important; /* Fix overflow */
}

/* Button Position Classes */
.nd-pro-button-position-left .signup-button-container {
  text-align: left;
}

.nd-pro-button-position-center .signup-button-container {
  text-align: center;
}

.nd-pro-button-position-right .signup-button-container {
  text-align: right;
}

.nd-pro-button-position-stretch .signup-button-container {
  display: block;
}

.nd-pro-button-position-stretch .nd-pro-button {
  display: block;
  width: 100%;
}

/* ===================== */
/* HOVER MESSAGE TOOLTIP - FIXED POSITIONING */
/* ===================== */
.nd-pro-signup-hover-message {
    position: absolute;
    bottom: calc(100% + 8px); /* Position above the button */
    width: auto;
    min-width: 200px;
    max-width: 400px;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 13px;
    color: #495057;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    overflow: visible !important;
    white-space: normal;
    box-sizing: border-box;
}

/* Show state */
.nd-pro-signup-hover-message.show {
    opacity: 1;
}

/* Left-aligned button message */
.nd-pro-button-position-left .nd-pro-signup-hover-message {
    left: 0;
    right: auto;
}

/* Center-aligned button message */
.nd-pro-button-position-center .nd-pro-signup-hover-message {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
}

/* Right-aligned button message */
.nd-pro-button-position-right .nd-pro-signup-hover-message {
    left: auto;
    right: 0;
}

/* Full-width button message */
.nd-pro-button-position-stretch .nd-pro-signup-hover-message {
    left: 50%;
    right: auto;
    width: 100%;
    max-width: 100%;
    transform: translateX(-50%);
}

/* Tooltip Arrows - Now pointing downward (since message is above button) */
.nd-pro-signup-hover-message::before,
.nd-pro-signup-hover-message::after {
    content: '';
    position: absolute;
    top: 100%; /* Arrow at the bottom of the message */
    border-style: solid;
    pointer-events: none;
}

.nd-pro-signup-hover-message::before {
    border-width: 8px 8px 0 8px;
    border-color: #dee2e6 transparent transparent transparent;
}

.nd-pro-signup-hover-message::after {
    border-width: 7px 7px 0 7px;
    border-color: #f8f9fa transparent transparent transparent;
    margin-top: 1px;
}

/* Arrow positioning */
.nd-pro-button-position-left .nd-pro-signup-hover-message::before,
.nd-pro-button-position-left .nd-pro-signup-hover-message::after {
    left: var(--arrow-offset, 15px);
    right: auto;
}

.nd-pro-button-position-center .nd-pro-signup-hover-message::before,
.nd-pro-button-position-center .nd-pro-signup-hover-message::after,
.nd-pro-button-position-stretch .nd-pro-signup-hover-message::before,
.nd-pro-button-position-stretch .nd-pro-signup-hover-message::after {
    left: 50%;
    right: auto;
    margin-left: -8px;
}

.nd-pro-button-position-right .nd-pro-signup-hover-message::before,
.nd-pro-button-position-right .nd-pro-signup-hover-message::after {
    left: auto;
    right: var(--arrow-offset, 15px);
}

/* Ensure button container has enough space for the hover message */
.signup-button-container {
    position: relative;
    margin: 30px 0 10px; /* Increased top margin to accommodate hover message */
    clear: both;
    overflow: visible !important;
    min-height: 50px; /* Ensure there's space for the message */
}

/* ===================== */
/* VALIDATION & FEEDBACK */
/* ===================== */
.field-invalid {
  border-color: #dc3545 !important;
}

.field-validation-message {
  display: none;
  color: #dc3545;
  font-size: 12px;
  margin-top: 1px;
}

.nd-pro-feedback {
  font-size: 0.9em;
  margin-top: 1px;
}

.nd-pro-feedback.error {
  color: #dc3545;
}

.nd-pro-feedback.success {
  color: #28a745;
}

/* Form Messages */
.nd-pro-error-message {
  padding: 12px;
  margin-bottom: 20px;
  background-color: #f8d7da;
  color: #721c24;
  border-radius: 4px;
  font-size: 14px;
}

.nd-pro-success-message {
  padding: 12px;
  margin-bottom: 20px;
  background-color: #d4edda;
  color: #155724;
  border-radius: 4px;
  font-size: 14px;
}

/* ===================== */
/* CAPTCHA STYLES */
/* ===================== */
.nd-pro-captcha-row {
  margin: 25px 0;
  clear: both;
}

#nd_pro_math_input {
  max-width: 100%;
  border: 1px solid #dddddd;
}

#nd_pro_math_input:focus {
  border: 1px solid green;
  outline: none !important;
}

#nd-pro-math-captcha-msg {
  font-size: 0.9em;
  margin: 5px 0;
}

.g-recaptcha {
  margin-bottom: 10px;
}

/* ===================== */
/* FORM LINKS */
/* ===================== */
.nd-pro-form-links {
  margin-top: 20px;
  text-align: left;
}

.nd-pro-form-links a {
  color: #1E3A8A;
  text-decoration: none;
  font-size: 14px;
}

.nd-pro-form-links a:hover {
  text-decoration: underline;
}

/* ===================== */
/* RESPONSIVE ADJUSTMENTS */
/* ===================== */
@media (max-width: 767px) {
  .nd-pro-signup-form-container {
    padding: 20px 15px;
    overflow: visible !important; /* Fix mobile overflow */
  }
  
  /* Force full width on mobile */
  .nd-pro-signup-form-container .nd-pro-form-group,
  .nd-pro-signup-form-container .nd-pro-width-half,
  .nd-pro-signup-form-container .nd-pro-width-third,
  .nd-pro-signup-form-container .nd-pro-width-1-2,
  .nd-pro-signup-form-container .nd-pro-width-1-3 {
    width: 100% !important;
    float: none;
    margin-right: 0 !important;
  }
  
  /* Mobile Button Positioning */
  .signup-button-container {
    text-align: center !important;
    overflow: visible !important; /* Fix mobile overflow */
  }
  
  .nd-pro-button {
    width: 100%;
    display: block;
  }
}

/* Validation states */
.nd-pro-feedback.checking {
    color: #666;
    font-style: italic;
}

.nd-pro-feedback.success {
    color: #28a745;
}

.nd-pro-feedback.error {
    color: #dc3545;
}

.field-validation-message {
    display: inline;
    color: #dc3545;
    font-size: 12px;
    margin-left: 5px;
}

/* Fix for Elementor popups and general overflow */
.elementor-popup-modal .nd-pro-signup-form-container,
.elementor-popup-modal .signup-button-container,
.elementor-popup-modal .nd-pro-signup-hover-message {
    overflow: visible !important;
}

/* Ensure form doesn't cause overflow */
.nd-pro-form {
    overflow: visible !important;
}

/* Prevent horizontal scroll */
.nd-pro-signup-form-container {
    max-width: 100%;
    box-sizing: border-box;
}

/* Signup Messages */

.nd-pro-countdown-message {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
    padding: 12px;
    border-radius: 4px;
    text-align: center;
    margin: 10px 0;
    font-weight: bold;
}

.nd-pro-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.nd-pro-auto-dismiss {
    font-size: 0.8em;
    opacity: 0.7;
    font-style: italic;
}

.nd-pro-dismiss-countdown {
    font-weight: bold;
}

.nd-pro-message-container {
    margin-bottom: 15px;
}

/* Ensure messages are properly styled */
.nd-pro-success-message {
    background: #d1edff;
    border: 1px solid #b3d9ff;
    color: #004085;
    padding: 15px;
    border-radius: 4px;
    text-align: center;
    margin: 10px 0;
}

.nd-pro-error-message {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 15px;
    border-radius: 4px;
    text-align: center;
    margin: 10px 0;
}

.nd-pro-countdown-message {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
    padding: 12px;
    border-radius: 4px;
    text-align: center;
    margin: 10px 0;
    font-weight: bold;
}