/* Global CSS Polish aligned with INA Brand Colors */
  /* [class*="membership-application"] af-form .crm-block {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  } */

/* Core Layout Container Engine */
.af-layout-row {
  display: flex;
  flex-wrap: wrap;
  margin-right: -15px;
  margin-left: -15px;
  box-sizing: border-box;
}

/* Explicit Item Wrapper Isolation */
[class*="af-layout-col-"] {
  position: relative;
  width: 100%;
  padding-right: 15px;
  padding-left: 15px;
  box-sizing: border-box;
}

/* 12-Column Mathematical Proportions */
.af-layout-col-1  { flex: 0 0 8.333333%;  max-width: 8.333333%; }
.af-layout-col-2  { flex: 0 0 16.666667%; max-width: 16.666667%; }
.af-layout-col-3  { flex: 0 0 25%;        max-width: 25%; }
.af-layout-col-4  { flex: 0 0 33.333333%; max-width: 33.333333%; }
.af-layout-col-5  { flex: 0 0 41.666667%; max-width: 41.666667%; }
.af-layout-col-6  { flex: 0 0 50%;        max-width: 50%; }
.af-layout-col-7  { flex: 0 0 58.333333%; max-width: 58.333333%; }
.af-layout-col-8  { flex: 0 0 66.666667%; max-width: 66.666667%; }
.af-layout-col-9  { flex: 0 0 75%;        max-width: 75%; }
.af-layout-col-10 { flex: 0 0 83.333333%; max-width: 8333333%; }
.af-layout-col-11 { flex: 0 0 91.666667%; max-width: 91.666667%; }
.af-layout-col-12 { flex: 0 0 100%;       max-width: 100%; }

/* Mobile Optimization: Forces Stacking Below 768px Tablet Resolution */
@media (max-width: 767px) {
  [class*="af-layout-col-"] {
    flex: 0 0 100% !important;
    max-width: 100% !important;
    margin-bottom: 15px;
  }
}


  /* Position the legend cleanly inside the fieldset box container */
[class*="membership-application"] af-form fieldset {
    position: relative !important;
    padding-top: 50px !important; /* Creates buffer space so fields do not overlap the title */
    margin-bottom:20px !important;
    border: 1px solid #777 !important;
    border-radius: 4px;
    padding: 20px !important;
}

[class*="membership-application"] af-form fieldset legend {
    position: absolute !important;
    top: 15px !important; /* Distance from the very top inside edge of the container box */
    left: 15px !important; /* Distance from the inside left edge */
    width: calc(100% - 30px) !important; /* Forces it to span wide while respecting inner padding */
    float: none !important; /* Strips browser agent layouts that force straddling */
    margin: 0 !important;

    margin-top: 0;
    margin-bottom: 20px !important;
    padding: 10px !important;
    border-bottom: 2px solid #2A87CE !important; 
    background-color: #cde8fe !important;
    font-size:24px !important;
    color: #104469 !important; 
    font-size: 1.25rem !important;
    font-weight: 600 !important;
}

[class*="membership-application"] af-form fieldset legend + div{
    margin-top:50px;
}

   /* .af-container > *,
  .af-container .af-container > *{
    margin:0 0 10px;
  } */

  [class*="membership-application"] af-form h4 {
    color: #004B76; 
    font-size: 1.1rem;
    margin-top: 20px;
    margin-bottom: 15px;
  }
  [class*="membership-application"] af-form label {
    display: block !important;
    font-weight: 600 !important;
    margin-bottom: 6px !important;
    padding-top:10px;
    color: #334155;
    font-size: 1.1rem;
  }
  [class*="membership-application"] af-form input, 
  [class*="membership-application"] af-form select,
  [class*="membership-application"] af-form .select2-container {
    /* display: block !important; */
    width: 100% !important;
    height: 40px !important;
    padding: 8px 12px !important;
    font-size: 0.95rem !important;
    line-height: 1.5 !important;
    color: #334155 !important;
    background-color: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 6px !important;
    transition: border-color 0.15s ease-in-out !important;
    margin-bottom:10px !important;
  }
  [class*="membership-application"] af-form input:focus, [class*="membership-application"] af-form select:focus {
    border-color: #2A87CE; 
    outline: 0;
    box-shadow: 0 0 0 2px rgba(42,135,206,0.2);
  }

  [class*="membership-application"] af-form .crm-af-field-help-post{
    font-size:.98rem;
    font-style:italic;
    margin:0 0 -5px 4px;
  }
  
/* Remove the outer container border styling completely */
[class*="afform-"] .select2-container.form-control {
    border: none !important;
    background: transparent !important;
    padding: 0 !important;
    box-shadow: none !important;
    height: auto !important;
    width: 100% !important;
}

/* Force the inner element to become the single, primary form input boundary */
[class*="afform-"] .select2-container.form-control .select2-choice {
    width: 100% !important;
    height: 38px !important; /* Matches the clean height of your standard inputs */
    line-height: 36px !important;
    background: #ffffff !important;
    border: 1px solid #cccccc !important; /* The single true field outline */
    border-radius: 4px !important;
    box-shadow: none !important;
    box-sizing: border-box !important;
    display: block !important;
}

/* Fix text spacing and alignment within the now clean field area */
[class*="afform-"] .select2-container.form-control .select2-chosen {
    padding-left: 10px !important;
    color: #333333 !important;
    font-size: 14px !important;
    text-align: left !important;
}

/* Blend the dropdown toggle arrow into the background */
[class*="afform-"] .select2-container.form-control .select2-arrow {
    background: transparent !important;
    border-left: none !important;
    top: 1px !important;
    right: 5px !important;
}

/* Clean up the clear/remove 'x' icon positioning */
[class*="afform-"] .select2-container.form-control .select2-search-choice-close {
    top: 12px !important;
    right: 24px !important;
}

/* Smooth focus transition effect on click */
[class*="afform-"] .select2-container-active .select2-choice {
    border-color: #66afea !important;
    box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102,175,233,.6) !important;
}


  /* [class*="membership-application"] af-form .crm-row {
    display: flex;
    flex-wrap: wrap;
    margin-right: -10px;
    margin-left: -10px;
    margin-bottom: 15px;
  }
  [class*="membership-application"] af-form .col-6 {
    flex: 0 0 50%;
    max-width: 50%;
    padding-left: 10px;
    padding-right: 10px;
  }
  [class*="membership-application"] af-form .col-4 {
    flex: 0 0 33.333%;
    max-width: 33.333%;
    padding-left: 10px;
    padding-right: 10px;
  }
  [class*="membership-application"] af-form .col-12 {
    flex: 0 0 100%;
    max-width: 100%;
    padding-left: 10px;
    padding-right: 10px;
  } */
  [class*="membership-application"] af-form .af-button.btn-primary,
  .CRM_Profile_Form_Edit .crm-form-submit.crm-button {
    background-color: #004B76 !important; 
    color: white !important;
    border: none !important;
    padding: 12px 30px !important;
    font-size: 1rem !important;
    font-weight: 600 !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    transition: background 0.15s ease;
  }
  [class*="membership-application"] af-form .af-button.btn-primary:hover,
  .CRM_Profile_Form_Edit .crm-form-submit.crm-button:hover{
    background-color: #2A87CE; 
  }

  /* Hide the background automation activity block from front-end users */
[class*="membership-application"] af-form fieldset[af-fieldset="Activity1"] {
    display: none !important;
}
