/**
 * 406 Leadership - Donation Selector + Modal Styles
 * Matches the site design system: Oswald headings, Source Sans 3 body,
 * #033f73 navy, #5b8ac2 blue-mid, #9e2a2f crimson, #e2d2c5 sand
 */

/* ==========================================
   ON-PAGE SELECTOR
   ========================================== */

.donate-selector {
  max-width: 420px;
  margin: 0 auto;
}

/* Frequency Toggle */
.donate-selector__frequency {
  display: flex;
  border-radius: 6px;
  overflow: hidden;
  border: 2px solid #e2d2c5;
  margin-bottom: 20px;
}

.freq-toggle {
  flex: 1;
  padding: 11px;
  text-align: center;
  font-family: 'Oswald', sans-serif;
  font-weight: 500;
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6B7280;
  background: #fff;
  border: none !important;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  outline: none !important;
  box-shadow: none !important;
}

.freq-toggle.active {
  background: #033f73;
  color: #fff;
}

.freq-toggle:hover:not(.active) {
  background: #f7f2ed;
  color: #033f73;
}

.freq-toggle:focus,
.freq-toggle:focus-visible,
.freq-toggle:active {
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
}

/* Amount Cards */
.donate-selector__amounts {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}

.amount-card {
  padding: 14px;
  text-align: center;
  background: #f7f2ed;
  border: none !important;
  border-radius: 6px;
  font-family: 'Oswald', sans-serif;
  font-weight: 600;
  font-size: 18px;
  color: #033f73;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, outline-color 0.2s;
  outline: 2px solid transparent;
  outline-offset: -2px;
  box-shadow: none !important;
}

.amount-card:hover {
  outline-color: #5b8ac2;
  background: #fff;
  color: #033f73;
  border: none !important;
}

.amount-card:focus,
.amount-card:focus-visible,
.amount-card:active {
  border: none !important;
  box-shadow: none !important;
  outline: 2px solid transparent;
  outline-offset: -2px;
}

.amount-card.active {
  outline: 2px solid #5b8ac2 !important;
  outline-offset: -2px;
  background: #fff;
  color: #5b8ac2;
  border: none !important;
  box-shadow: none !important;
}

/* Other Amount */
.donate-selector__other {
  display: flex;
  align-items: center;
  margin-bottom: 20px;
  border: 2px solid #e2d2c5;
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
  transition: border-color 0.2s;
}

.donate-selector__other:focus-within {
  border-color: #5b8ac2;
}

.other-prefix {
  padding: 12px 12px 12px 16px;
  font-family: 'Oswald', sans-serif;
  font-weight: 600;
  font-size: 17px;
  color: #033f73;
  background: #f7f2ed;
  line-height: 1;
}

#other-amount-input {
  flex: 1;
  padding: 12px 14px;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 16px;
  border: none;
  outline: none;
  background: transparent;
}

/* Submit Button */
.donate-selector__submit {
  width: 100%;
  padding: 15px;
  font-family: 'Oswald', sans-serif;
  font-weight: 600;
  font-size: 16px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: #9e2a2f;
  color: #fff;
  border: 2px solid #9e2a2f;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.donate-selector__submit:hover {
  background: #7a2025;
  border-color: #7a2025;
  color: #fff;
}

.donate-selector__submit:focus,
.donate-selector__submit:focus-visible,
.donate-selector__submit:active {
  background: #7a2025;
  border-color: #7a2025;
  color: #fff;
  outline: none !important;
  box-shadow: none !important;
}

/* Tax Note */
.donate-selector__note {
  text-align: center;
  font-size: 13px;
  color: #8B919A;
  margin-top: 12px;
}

/* ==========================================
   MODAL OVERLAY
   ========================================== */

.donate-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(2, 43, 82, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}

.donate-modal-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

.donate-modal {
  background: #fff;
  border-radius: 12px;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  padding: 40px 32px 32px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  transform: translateY(20px);
  transition: transform 0.3s;
}

.donate-modal-overlay.is-open .donate-modal {
  transform: translateY(0);
}

/* Close Button */
.donate-modal__close {
  position: absolute !important;
  top: 12px !important;
  right: 16px !important;
  left: auto !important;
  background: none !important;
  border: none !important;
  font-size: 28px;
  color: #8B919A;
  cursor: pointer;
  width: 36px !important;
  height: 36px !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.2s, color 0.2s;
  line-height: 1;
  padding: 0 !important;
  margin: 0 !important;
  outline: none !important;
  box-shadow: none !important;
  z-index: 10;
  transform: none !important;
  float: none !important;
}

.donate-modal__close:hover {
  background: #f7f2ed !important;
  color: #033f73;
}

.donate-modal__close:focus,
.donate-modal__close:focus-visible,
.donate-modal__close:active {
  position: absolute !important;
  top: 12px !important;
  right: 16px !important;
  left: auto !important;
  background: none !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  transform: none !important;
}

/* Summary Line */
.donate-modal__summary {
  margin-bottom: 28px;
}

.summary-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: #f7f2ed;
  border-radius: 8px;
  border: 1px solid #e2d2c5;
}

.summary-label {
  font-family: 'Oswald', sans-serif;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #6B7280;
}

.summary-amount {
  font-family: 'Oswald', sans-serif;
  font-size: 24px;
  font-weight: 700;
  color: #033f73;
}

/* ==========================================
   GRAVITY FORM OVERRIDES INSIDE MODAL
   ========================================== */

.donate-modal__form .gform_wrapper {
  margin: 0 !important;
}

/* Hide the price field visually but keep it in the layout flow
   so GF's gformCalculateTotalPrice still includes it in the total.
   Using display:none causes GF to skip it = $0 sent to Stripe. */
.donate-modal__form #field_3_13 {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
  padding: 0 !important;
  margin: -1px !important;
}

/* Hide the hidden frequency field */
.donate-modal__form #field_3_15 {
  display: none !important;
}

/* Remove default GF top padding */
.donate-modal__form .gform_body {
  padding: 0 !important;
}

/* Field spacing */
.donate-modal__form .gform_fields {
  gap: 12px !important;
}

.donate-modal__form .gfield {
  margin-bottom: 0 !important;
  padding: 0 !important;
}

/* Labels */
.donate-modal__form .gfield_label,
.donate-modal__form .gform-field-label {
  font-family: 'Source Sans 3', sans-serif !important;
  font-weight: 600 !important;
  font-size: 13px !important;
  color: #033f73 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.05em !important;
  margin-bottom: 5px !important;
}

/* Text inputs */
.donate-modal__form input[type="text"],
.donate-modal__form input[type="email"],
.donate-modal__form input[type="tel"] {
  width: 100% !important;
  padding: 11px 14px !important;
  font-family: 'Source Sans 3', sans-serif !important;
  font-size: 15px !important;
  border: 2px solid #e2d2c5 !important;
  border-radius: 6px !important;
  background: #fff !important;
  outline: none !important;
  transition: border-color 0.2s !important;
  box-shadow: none !important;
}

.donate-modal__form input[type="text"]:focus,
.donate-modal__form input[type="email"]:focus,
.donate-modal__form input[type="tel"]:focus {
  border-color: #5b8ac2 !important;
}

/* Name field - side by side */
.donate-modal__form .ginput_complex {
  display: flex !important;
  gap: 12px !important;
}

.donate-modal__form .ginput_complex .name_first,
.donate-modal__form .ginput_complex .name_last {
  flex: 1 !important;
}

/* Sub-labels under name fields */
.donate-modal__form .ginput_complex label,
.donate-modal__form .ginput_complex .gform-field-label {
  font-size: 12px !important;
  color: #8B919A !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
  margin-top: 3px !important;
  font-weight: 400 !important;
}

/* Stripe card field container */
.donate-modal__form .gfield--type-stripe_creditcard {
  margin-top: 8px !important;
}

.donate-modal__form .gfield--type-stripe_creditcard .gfield_label {
  margin-bottom: 8px !important;
}

/* Stripe Elements iframe container */
.donate-modal__form #input_3_14 .StripeElement,
.donate-modal__form .ginput_container_stripe .StripeElement {
  padding: 12px 14px !important;
  border: 2px solid #e2d2c5 !important;
  border-radius: 6px !important;
  background: #fff !important;
  transition: border-color 0.2s !important;
}

.donate-modal__form .StripeElement--focus {
  border-color: #5b8ac2 !important;
}

.donate-modal__form .StripeElement--invalid {
  border-color: #9e2a2f !important;
}

/* Submit button */
.donate-modal__form .gform_button,
.donate-modal__form input[type="submit"],
.donate-modal__form .gform_footer button {
  width: 100% !important;
  padding: 14px !important;
  font-family: 'Oswald', sans-serif !important;
  font-weight: 600 !important;
  font-size: 16px !important;
  letter-spacing: 0.08em !important;
  text-transform: uppercase !important;
  background: #033f73 !important;
  color: #fff !important;
  border: 2px solid #033f73 !important;
  border-radius: 6px !important;
  cursor: pointer !important;
  transition: all 0.2s !important;
  margin-top: 8px !important;
}

.donate-modal__form .gform_button:hover,
.donate-modal__form input[type="submit"]:hover {
  background: #022b52 !important;
  border-color: #022b52 !important;
  color: #fff !important;
}

/* GF footer alignment */
.donate-modal__form .gform_footer {
  padding: 8px 0 0 !important;
  margin: 0 !important;
}

/* Validation errors */
.donate-modal__form .gfield_error input,
.donate-modal__form .gfield_error .StripeElement {
  border-color: #9e2a2f !important;
}

.donate-modal__form .gfield_error .gfield_label {
  color: #9e2a2f !important;
}

.donate-modal__form .validation_message {
  font-size: 13px !important;
  color: #9e2a2f !important;
  margin-top: 4px !important;
}

/* Confirmation message after successful payment */
.donate-modal__form .gform_confirmation_message {
  text-align: center;
  padding: 32px 16px;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 17px;
  color: #033f73;
  line-height: 1.7;
}

/* ==========================================
   RESPONSIVE
   ========================================== */

@media (max-width: 520px) {
  .donate-modal {
    padding: 32px 20px 24px;
    margin: 16px;
    max-height: 95vh;
  }

  .donate-selector__amounts {
    grid-template-columns: repeat(2, 1fr);
  }

  .donate-modal__form .ginput_complex {
    flex-direction: column !important;
    gap: 8px !important;
  }
}