/**
 * sober-af-giving donate form styles.
 * Scoped under .saf-giving-form to avoid leaking into theme buttons.
 */

.saf-giving-form {
  display: grid;
  gap: 1.5rem;
  max-width: 560px;
  margin: 0 auto;
  padding: 1.5rem;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
}

.saf-giving-form fieldset {
  border: 0;
  margin: 0;
  padding: 0;
}

.saf-giving-form__legend {
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0 0 0.5rem;
  color: #1f2937;
}

.saf-giving-form__frequency [role="radiogroup"],
.saf-giving-form__tiers [role="radiogroup"] {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
}

.saf-giving-form__freq,
.saf-giving-form__tier {
  appearance: none;
  border: 1px solid #d1d5db;
  background: #fff;
  color: #111827;
  font: inherit;
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  cursor: pointer;
  transition:
    background 0.15s ease,
    border-color 0.15s ease;
  min-height: 44px;
}

.saf-giving-form__freq:hover,
.saf-giving-form__tier:hover {
  border-color: #2563eb;
}

.saf-giving-form__freq.is-selected,
.saf-giving-form__tier.is-selected {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
}

.saf-giving-form__freq:focus-visible,
.saf-giving-form__tier:focus-visible,
.saf-giving-form__cta:focus-visible {
  outline: 2px solid #1d4ed8;
  outline-offset: 2px;
}

.saf-giving-form__custom {
  display: grid;
  gap: 0.35rem;
}

.saf-giving-form__label {
  font-weight: 500;
  color: #374151;
}

.saf-giving-form__input {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font: inherit;
  min-height: 44px;
}

.saf-giving-form__cta {
  appearance: none;
  border: 0;
  background: #047857;
  color: #fff;
  padding: 0.85rem 1rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  min-height: 48px;
  font-size: 1rem;
}

.saf-giving-form__cta:hover {
  background: #065f46;
}

.saf-giving-form__cta[disabled] {
  opacity: 0.6;
  cursor: progress;
}

.saf-giving-form__hint {
  color: #4b5563;
  font-size: 0.9rem;
  margin: 0;
}

.saf-giving-form__error {
  color: #b91c1c;
  font-size: 0.9rem;
  margin: 0;
}

@media (max-width: 480px) {
  /* Keep the 3 frequency pills (Monthly / Annual / One-time) on one
     row at 375px instead of wrapping 2+1; tighten button padding so
     they fit. Amount-tier grids stay at 2 columns because each
     fieldset can carry more than 3 tier buttons. */
  .saf-giving-form__frequency [role="radiogroup"] {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .saf-giving-form__frequency [role="radio"] {
    padding-inline: 8px;
    font-size: 0.95rem;
  }
  .saf-giving-form__tiers [role="radiogroup"] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
