/* ====================================================
   Donation Page CSS Styles
   Migrated from inline styles in DonationPage.html
   ==================================================== */

/* Non-header content wrapper */
#nonHeaderContent {
  height: 100%;
  margin-top: 0;
  max-width: 98%;
  margin-left: auto;
  margin-right: auto;
  padding: 0 32px 80px; /* a little more horizontal breathing room */
}

/* Donation outer wrapper */
.donation-outer-wrapper {
  position: relative;
  padding-bottom: 80px; /* Space for fixed bottom bar */
  width: 100%;
}

/* Form group styling - base container for inputs */
#donationForm .c-form-group {
  padding-right: 10px;
}

/* Header with tabs container */
.header-with-tabs {
  display: flex;
  flex-direction: row; /* explicit to override previous column after resize */
  justify-content: space-between;
  align-items: flex-start;
  gap: 32px;
  width: 100%;
  margin-bottom: 10px;
}

.header-clob {
  flex: 1;
  max-width: 100%;
  display: flex;
  flex-direction: column;
}

/* Limit images inside the header clob */
.header-clob img {
  max-width: 250px;
  max-height: 200px;
  height: auto;
  display: block;
}

/* Centered donation form container */
.donation-form-container {
  max-width: 90%;
  margin: 0 auto 40px auto;
}

.donation-page-title {
  margin-top: 0;
}

/* Card styling for the form */
.donation-card {
  background: #ffffff;
  border: 1px solid #e3e8ef;
  border-radius: 8px;
  padding: 0 28px 20px 28px; /* extra bottom padding above fixed nav */
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

@media only screen and (max-width: 770px) {
  .donation-card {
    padding: 0 18px 20px 18px;
    border-radius: 6px;
  }
}

.donation-outer-wrapper .form input[type=text],
.donation-outer-wrapper .form select {
  width: 100%;
}

/* Remove redundant international phone margin - now handled by grid gap */
.countryInputInternational {
  margin-right: 10px !important;
}

/* Donation specific heading */
.donationH3 {
  font-weight: bold !important;
  font-size: 18px !important;
  color: #000000 !important;
  margin: 5px 0 10px !important;
}

/* Phone input styles */
/* Phone input styles - base properties */
.c-form-input-phone,
.c-form-input-phone-int {
  border: 1px solid #d8d8d8;
  border-radius: .5em;
  color: #4a4a4a;
  padding: .1em .5em;
  background: #fff;
  margin-right: 5px;
}

.c-form-input-phone {
  flex: 1 1 90px;
  min-width: 90px;
  max-width: 160px;
}

.c-form-input-phone-int {
  min-width: 140px;
  max-width: 240px;
}

.checkbox,
.radio-button {
  width: 16px;
  height: 16px;
  padding: 0;
  cursor: pointer;
  display: inline-block;
  vertical-align: middle;
  accent-color: #000000;
  appearance: checkbox;
}

/* Step Headers */
.step-headers {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0;
  flex-shrink: 0;
  padding-bottom: 5px;
  margin-left: auto;
}

.step-header {
  padding: 0 10px;
  font-size: 16px;
  color: #999;
  cursor: pointer; /* allow user to attempt navigation; JS will gate forward moves */
  position: relative;
  background-color: transparent;
  border: none;
  border-right: 1px solid #999;
  transition: color 0.2s ease;
  font-family: inherit;
  white-space: nowrap;
  text-decoration: none;
}

.step-header:last-child {
  border-right: none;
}

.step-header.visited {
  cursor: pointer;
}

.step-header.active {
  color: #000;
  font-weight: 600;
}

.step-header .step-number {
  font-weight: 600;
}

/* Tab content styles */
.tab-content {
  display: none;            /* hide by default */
  max-width: 100%;
}

.tab-content.active {
  display: flex;            /* show only the active tab */
  justify-content: center;
}

.tab-content .form {
  width: 70%;               
  max-width: 900px;         
  box-sizing: border-box;
}

/* Inputs in both tabs fill the centered column */
.tab-content .form input[type="text"],
.tab-content .form input[type="email"],
.tab-content .form input[type="number"],
.tab-content .form select,
.tab-content .form textarea {
  width: 100%;
}

/* Mobile: full width for readability */
@media only screen and (max-width: 770px) {
  .tab-content .form {
    width: 100%;
    max-width: 100%;
    padding-left: 12px;
    padding-right: 12px;
  }
}

.donation-form-header {
  display: flex;
  justify-content: center;
}

.donation-form-header .donation-page-title {
  width: 70%;                
  max-width: 900px;          
  margin: 0 auto;            
  text-align: left;          
}

/* Bottom Navigation Bar */
.bottom-navigation-bar {
  position: fixed !important;
  bottom: 0 !important;
  left: 0 !important;
  right: 0 !important;
  padding: 5px 10px !important;
  display: flex !important;
  justify-content: flex-end !important;
  align-items: center !important;
  gap: 12px !important;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1) !important;
  background-color: var(--footerbar-color-background) !important;
}

/* Button base styles */
.btn-back,
.btn-proceed {
  padding: 5px 25px !important;
  border-radius: .3em !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  cursor: pointer !important;
  transition: all 0.3s ease !important;
  align-items: center !important;
  justify-content: center !important;
}

/* Responsive styles */
@media only screen and (max-width: 770px) {
  #nonHeaderContent {
    margin: 0 auto;
    width: 100%;
    padding-left: 12px;
    padding-right: 12px;
  }
  /* Align donation header title properly on small screens */
  .donation-form-header .donation-page-title {
    width: 100%;
    max-width: 100%;
    text-align: left;
  }
  
  .c-form-group {
    margin: 5px;
  }

  .donation-form-container {
    max-width: 100%;
  }
  
  .header-with-tabs {
    flex-direction: column;
    gap: 15px;
  }

  .step-headers {
    flex-direction: row;
    gap: 0;
    width: auto;
    flex-wrap: wrap;
    font-size: 16px;
    color: #999;
    margin-left: 0;
  }
    
  .step-header {
    margin-right: 0;
    padding: 6px 10px;
    /* keep base font size for readability */
    font-size: 16px;
  }

  .bottom-navigation-bar {
    padding: 5px 20px;
    justify-content: center;
    gap: 20px;
  }

  .btn-back,
  .btn-proceed {
    padding: 5px 24px;
    font-size: 15px;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: initial;
    line-height: initial;
}
  
  .btn-add-purpose {
    max-width: 96% !important;
  }


/* Allow phone sections to wrap cleanly */
  #donationPhoneNumber .usDiv,
  #donationPhoneNumber .intlDiv,
  #donationCellPhone .usCellDiv,
  #donationCellPhone .intlCellDiv,
  #donationBusinessPhone .usBusinessDiv,
  #donationBusinessPhone .intlBusinessDiv {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
  }

  #donationPhoneNumber input.c-form-input-phone,
  #donationPhoneNumber input.c-form-input-phone-int,
  #donationCellPhone input.c-form-input-phone,
  #donationCellPhone input.c-form-input-phone-int,
  #donationBusinessPhone input.c-form-input-phone,
  #donationBusinessPhone input.c-form-input-phone-int {
    flex: 1 1 calc(50% - 10px); /* equal half-width inputs */
    max-width: calc(50% - 10px);
    box-sizing: border-box;
  }
}

/* Error message styles */
.error-message {
  background-color: #f8d7da;
  border: 1px solid #f5c6cb;
  color: #721c24;
  padding: 5px 10px;
  border-radius: 5px;
  margin-bottom: 20px;
}

.success-message {
  background-color: #d4edda;
  border: 1px solid #c3e6cb;
  color: #155724;
  padding: 12px 20px;
  border-radius: 5px;
  margin-bottom: 20px;
}

/* Field error styles */
.field-error {
  color: #dc3545;
  font-size: 14px;
  margin-top: 5px;
  display: block;
}

.has-error input,
.has-error select {
  border-color: #dc3545;
}

/* Client-side aggregated error list */
.client-error-list {
  list-style: disc;
  margin: 0 0 0 20px;
  padding: 0;
}

.client-error-list li {
  font-size: 14px;
  margin: 4px 0;
}

/* Individual input error highlighting */
.input-error {
  border-color: #dc3545 !important;
  background-color: #fffafa;
}

.u-heading--1 {
  font-size: 26px;
  margin-top: 10px !important;
}

.l-grid--row {
  margin-bottom: 10px !important;
}

/* Add Purpose Button Styles */
.btn-add-purpose {
  padding: 5px 10px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 0.3em;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-left: 0;
}

.btn-add-purpose:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Disabled visual state managed via JS-added class instead of inline styles */
.btn-add-purpose.is-disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* Gift Purpose Sections - ensure contained layout */
#giftPurposeSection2,
#giftPurposeSection3 {
  overflow: visible;
}

/* Remove Purpose Button Styles */
.btn-remove-purpose {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  width: 25px;
  height: 25px;
  padding: 0;
  border: none;
  background-color: transparent;
  color: #dc3545;
  font-size: 26px;
  font-weight: bold;
  line-height: 1;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex !important;
  align-items: center;
  justify-content: center;
  font-family: Arial, sans-serif;
  z-index: 10;
  margin-top: 12px;
}

.btn-remove-purpose:hover {
  color: #c82333;
  font-size: 26px;
}

.btn-remove-purpose:active {
  transform: translateY(-50%) scale(0.9);
}

/* Hidden state for remove button */
.btn-remove-hidden {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* Total Amount Display Styles */
.total-amount-display {
  background-color: #e8f1fb;
  border: 1px solid #d0dff0;
  border-radius: 4px;
  padding: 8px 5px;
  font-size: 15px;
  color: #1a1a1a;
  font-weight: 500;
  margin-right: 10px;
  margin-top: 5px;
}

/* Question with Toggle Button Styles */
.question-with-toggle {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  padding: 15px 0;
}

.question-label {
  font-size: 16px;
  font-weight: 500;
  color: #1a1a1a;
  margin: 0;
  cursor: default;
  display: flex;
  align-items: center;
  padding: 10px;
}

.toggle-buttons {
  display: flex;
}

.toggle-btn {
  padding: 8px 20px;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid #ccc;
  background-color: var(--admPortal-tab-inactive-background);
  color: #333;
  cursor: pointer;
  transition: all 0.3s ease;
}

@media (min-width: 768px) {
  .toggle-btn:hover {
    border-color: var(--button-primary-hover-background-color);
    background-color: var(--admPortal-tab-hover-background);
    color: var(--admPortal-tab-hover-color);
  }
}

.toggle-btn-active {
  background-color: var(--admPortal-tab-active-background);
  color: var(--admPortal-tab-active-color);
  border-color: var(--admPortal-tab-active-background);
}

/* Matching Gifts Section Styles */
.donation-section-description {
  font-size: 16px;
  color: #000;
  margin-bottom: 15px;
  font-style: italic;
}

.matching-gift-subsection {
  background-color: #f9f9f9;
  border-left: 3px solid #aaa;
  padding: 15px;
  margin-bottom: 15px;
  border-radius: 4px;
}

.matching-gift-subsection .form-selector {
  margin-bottom: 10px;
}

.matching-gift-subsection .form-selector:first-child {
  padding-bottom: 10px;
  border-bottom: 1px solid #e8e8e8;
  margin-bottom: 15px;
}

.matching-gift-subsection .checkbox {
  margin-right: 8px;
}

.matching-gift-subsection label {
  font-size: 14px;
  color: #1a1a1a;
}

/* Planned Giving Section Styles */
.planned-giving-question {
  margin-bottom: 20px;
}

#plannedGivingSection {
  margin-bottom: 30px;
}
