/* NDC Lead Form - Modern UI (Improved) */
@import url('https://fonts.googleapis.com/css2?family=League+Spartan:wght@400;500;600;700&display=swap');

.ndclf-form{
  max-width: 980px;
  margin: 0 auto;
  padding: 40px;
  border: 1px solid #e5e7eb;
  border-radius: 24px;
  background: #ffffff;
  box-shadow: 0 20px 60px rgba(0,0,0,.08);
  font-family: 'League Spartan', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  position: relative;
  overflow: hidden;
}

.ndclf-form::before{
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: linear-gradient(90deg, #EE4039 0%, #ff6b63 100%);
  opacity: 0;
  transition: opacity 0.6s ease;
}

.ndclf-form.ndclf-success::before{
  background: linear-gradient(90deg, #10b981 0%, #34d399 100%);
  opacity: 1;
}

.ndclf-form, .ndclf-form *{ box-sizing: border-box; }

.ndclf-grid{
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 24px 20px;
}

.ndclf-field{
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.ndclf-field > label{
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.02em;
  color: #1f2937;
  text-align: left !important;
  justify-content: flex-start !important;
  transition: color 0.2s ease;
}

/* Inputs */
.ndclf-field input[type="text"],
.ndclf-field input[type="email"],
.ndclf-field input[type="tel"],
.ndclf-field input[type="number"],
.ndclf-field textarea,
.ndclf-field select{
  width: 100%;
  padding: 16px 18px;
  min-height: 56px;
  border: 2px solid #e5e7eb;
  border-radius: 16px;
  outline: none;
  background: #fafbfc;
  color: #1f2937;
  font-size: 15px;
  font-family: 'League Spartan', sans-serif;
  line-height: 1.4;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.ndclf-field textarea{
  min-height: 140px;
  resize: vertical;
  line-height: 1.6;
}

.ndclf-field input:focus,
.ndclf-field textarea:focus,
.ndclf-field select:focus{
  border-color: #EE4039;
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(238, 64, 57, 0.1);
  transform: translateY(-1px);
}

.ndclf-field input::placeholder,
.ndclf-field textarea::placeholder{
  color: #9ca3af;
  font-family: 'League Spartan', sans-serif;
}

/* Required star */
.ndclf-req{ 
  color: #EE4039; 
  font-weight: 700;
  margin-left: 2px;
}

/* Section blocks (HTML fields) */
.ndclf-type-html{
  grid-column: 1 / -1;
  margin: 24px 0 0 0;
}

.ndclf-type-html:first-child{
  margin-top: 0;
}

.ndclf-type-html h3{
  font-size: 28px;
  font-weight: 700;
  margin: 0 0 8px;
  letter-spacing: -0.02em;
  color: #111827;
  position: relative;
  padding-bottom: 12px;
}

.ndclf-type-html h3::after{
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 60px;
  height: 4px;
  background: linear-gradient(90deg, #EE4039, #ff6b63);
  border-radius: 2px;
}

.ndclf-type-html p{
  margin: 8px 0 0;
  color: #6b7280;
  font-size: 15px;
  line-height: 1.6;
}

.ndclf-type-html em{
  color: #9ca3af;
  font-style: italic;
}

/* Note blocks */
.ndclf-note{
  padding: 18px 20px;
  border: 2px solid #fef3c7;
  border-radius: 16px;
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  color: #92400e;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(251, 191, 36, 0.1);
}

.ndclf-note strong{
  color: #78350f;
  font-weight: 700;
}

/* Primary action button */
.ndclf-actions{
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 2px solid #f3f4f6;
}

.ndclf-btn{
  padding: 18px 36px;
  min-height: 58px;
  border-radius: 16px;
  border: 0;
  cursor: pointer;
  background: #EE4039;
  color: #ffffff;
  font-weight: 700;
  font-size: 16px;
  font-family: 'League Spartan', sans-serif;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  box-shadow: 0 8px 24px rgba(238, 64, 57, 0.3);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.ndclf-btn::before{
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s ease;
}

.ndclf-btn:hover{
  background: #111827;
  box-shadow: 0 12px 32px rgba(17, 24, 39, 0.4);
  transform: translateY(-2px);
}

.ndclf-btn:hover::before{
  left: 100%;
}

.ndclf-btn:active{
  transform: translateY(0);
  box-shadow: 0 4px 16px rgba(238, 64, 57, 0.3);
}

.ndclf-btn:disabled{
  background: #d1d5db;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.ndclf-status{ 
  font-size: 15px;
  font-weight: 600;
  color: #6b7280;
  padding: 12px 20px;
  border-radius: 12px;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0;
  transform: translateX(-10px);
}

.ndclf-status.ndclf-visible{
  opacity: 1;
  transform: translateX(0);
}

.ndclf-status.ndclf-success{
  color: #047857;
  background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
  border: 2px solid #6ee7b7;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.2);
  animation: successPulse 0.6s ease;
}

.ndclf-status.ndclf-error{
  color: #991b1b;
  background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
  border: 2px solid #fca5a5;
  box-shadow: 0 4px 16px rgba(239, 68, 68, 0.2);
  animation: shake 0.5s ease;
}

@keyframes successPulse {
  0%, 100% { transform: translateX(0) scale(1); }
  50% { transform: translateX(0) scale(1.05); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-8px); }
  75% { transform: translateX(8px); }
}

/* SUCCESS STATE */
.ndclf-form.ndclf-success{
  border-color: #6ee7b7;
  background: linear-gradient(135deg, #ffffff 0%, #f0fdf4 100%);
  box-shadow: 0 20px 60px rgba(16, 185, 129, 0.15);
  animation: formSuccess 0.6s ease;
}

@keyframes formSuccess {
  0% { transform: scale(1); }
  50% { transform: scale(1.02); }
  100% { transform: scale(1); }
}

/* OPTIONS (radio + checkbox groups) */
.ndclf-radio,
.ndclf-checkgroup{
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 16px;
  margin-top: 4px;
}

/* Force labels to be left-aligned */
.ndclf-form .ndclf-radio label,
.ndclf-form .ndclf-checkgroup label,
.ndclf-form label.ndclf-option{
  display: flex !important;
  justify-content: flex-start !important;
  align-items: flex-start !important;
  gap: 12px !important;
  text-align: left !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 16px 18px !important;
  border: 2px solid #e5e7eb !important;
  border-radius: 14px !important;
  background: #fafbfc !important;
  line-height: 1.4 !important;
  font-weight: 500 !important;
  font-size: 15px !important;
  color: #374151 !important;
  cursor: pointer !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.ndclf-form .ndclf-radio label:hover,
.ndclf-form .ndclf-checkgroup label:hover,
.ndclf-form label.ndclf-option:hover{
  background: #ffffff !important;
  border-color: #EE4039 !important;
  box-shadow: 0 4px 12px rgba(238, 64, 57, 0.1) !important;
  transform: translateY(-2px) !important;
}

.ndclf-form .ndclf-radio input:checked + *,
.ndclf-form .ndclf-checkgroup input:checked + *,
.ndclf-form .ndclf-radio label:has(input:checked),
.ndclf-form .ndclf-checkgroup label:has(input:checked){
  background: linear-gradient(135deg, #fff1f0 0%, #ffe4e1 100%) !important;
  border-color: #EE4039 !important;
  color: #991b1b !important;
  font-weight: 600 !important;
}

.ndclf-form .ndclf-radio input,
.ndclf-form .ndclf-checkgroup input,
.ndclf-form .ndclf-checkbox input{
  margin: 2px 0 0 0 !important;
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  cursor: pointer;
  accent-color: #EE4039;
}

/* Single checkbox row (consent) */
.ndclf-type-checkbox{ grid-column: 1 / -1; }
.ndclf-checkbox{ 
  font-weight: 600;
  color: #1f2937;
  cursor: pointer;
  transition: color 0.2s ease;
}

.ndclf-checkbox:hover{
  color: #EE4039;
}

/* Hide hidden fields */
.ndclf-type-hidden{ display: none !important; }

/* Fix grid gap issues for conditionally hidden fields */
.ndclf-field[style*="display: none"],
.ndclf-field[style*="display:none"]{
  display: none !important;
  grid-column: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  height: 0 !important;
  min-height: 0 !important;
  visibility: hidden !important;
}

/* Honeypot */
.ndclf-hp{
  position: absolute !important;
  left: -99999px !important;
  top: auto !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* Loading state */
.ndclf-form.ndclf-loading{
  pointer-events: none;
  opacity: 0.7;
}

.ndclf-form.ndclf-loading .ndclf-btn::after{
  content: '';
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255,255,255,0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: translateY(-50%) rotate(360deg); }
}

/* Responsive */
@media (max-width: 780px){
  .ndclf-form{ 
    padding: 28px 20px;
    border-radius: 20px;
  }
  
  .ndclf-grid{ 
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .ndclf-radio, 
  .ndclf-checkgroup{ 
    grid-template-columns: 1fr;
  }
  
  .ndclf-type-html h3{
    font-size: 24px;
  }
  
  .ndclf-btn{
    width: 100%;
    padding: 16px 24px;
  }
  
  .ndclf-actions{
    flex-direction: column;
    align-items: stretch;
  }
  
  .ndclf-status{
    text-align: center;
  }
}

/* Focus visible for accessibility */
.ndclf-form *:focus-visible{
  outline: 3px solid #EE4039;
  outline-offset: 2px;
}

/* Smooth scrolling for form errors */
html{
  scroll-behavior: smooth;
}