@import url("https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700;800&display=swap");

:root {
  --hmf-primary: #792516;
  --hmf-accent: #df8729;
  --hmf-ink: #111827;
  --hmf-muted: #6b7280;
  --hmf-line: #e5e7eb;
  --hmf-bg: #f8fafc;
}

.hmf-donation-form *,
.hmf-donation-form *::before,
.hmf-donation-form *::after {
  box-sizing: border-box;
}

.hmf-donation-form,
.hmf-donor-dashboard,
.hmf-campaign-card {
  color: var(--hmf-ink);
  font-family: "Montserrat", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.hmf-donation-form {
  width: min(100%, 820px);
  max-width: 820px;
  margin: 24px auto;
  padding: 28px;
  border: 1px solid var(--hmf-line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 20px 60px rgba(121, 37, 22, .12);
  overflow: hidden;
  -webkit-text-size-adjust: 100%;
}

.hmf-form-header span {
  color: var(--hmf-primary);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

.hmf-form-header h2 {
  margin: 6px 0 18px;
  font-size: 28px;
  line-height: 1.2;
}

.hmf-steps {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin: 0 0 22px;
}

.hmf-steps span {
  height: 4px;
  border-radius: 999px;
  background: var(--hmf-line);
}

.hmf-steps .is-active,
.hmf-progress span {
  background: var(--hmf-primary);
}

.hmf-selected-amount {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 22px;
  border: 1px solid rgba(121, 37, 22, .2);
  border-radius: 6px;
  padding: 14px 16px;
  background: #fff8ef;
}

.hmf-selected-amount.is-visible {
  display: flex;
}

.hmf-selected-amount span {
  color: var(--hmf-muted);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.hmf-selected-amount strong {
  color: var(--hmf-primary);
  font-size: 24px;
  font-weight: 800;
  line-height: 1.1;
  white-space: nowrap;
}

.hmf-thankyou-amount {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: min(100%, 520px);
  margin: 22px auto 30px;
  padding: 18px 22px 20px;
  border: 1px solid rgba(121, 37, 22, .18);
  border-radius: 8px;
  background: linear-gradient(180deg, #fffaf4 0%, #fff 100%);
  box-shadow: 0 16px 36px rgba(121, 37, 22, .1);
  color: var(--hmf-ink);
  font-family: "Montserrat", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  text-align: center;
}

.hmf-thankyou-amount__message {
  color: var(--hmf-primary);
  font-size: 18px;
  font-weight: 800;
  line-height: 1.25;
}

.hmf-thankyou-amount__label {
  margin-top: 8px;
  color: var(--hmf-muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.2;
  text-transform: uppercase;
}

.hmf-thankyou-amount__value {
  margin-top: 6px;
  color: var(--hmf-accent);
  font-size: 50px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1;
}

.hmf-grid,
.hmf-settings-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  width: 100%;
}

.hmf-settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.hmf-donation-form [hidden],
.hmf-step[hidden],
.hmf-screen-reader {
  display: none !important;
}

.hmf-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.hmf-tabs button {
  min-height: 48px;
  border: 1px solid rgba(121, 37, 22, .25);
  border-radius: 6px;
  padding: 12px;
  background: var(--hmf-bg);
  color: var(--hmf-ink);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.hmf-tabs button.is-active {
  border-color: var(--hmf-accent);
  background: var(--hmf-accent);
  color: var(--hmf-ink);
}

.hmf-tabs button:hover,
.hmf-tabs button:focus-visible {
  border-color: var(--hmf-accent);
  background: var(--hmf-accent);
  color: var(--hmf-ink);
}

.hmf-field-width {
  flex: 0 1 calc(50% - 8px);
  min-width: 150px;
  max-width: 100%;
}

.hmf-field-width-50 {
  flex: 0 1 calc(50% - 8px);
  min-width: 150px;
}

.hmf-field-width-100 {
  flex: 0 1 100%;
  min-width: 0;
}

.hmf-donation-form label,
.hmf-donation-form legend {
  display: grid;
  gap: 7px;
  font-weight: 700;
  font-size: 14px;
}

.hmf-donation-form input,
.hmf-donation-form select,
.hmf-donation-form textarea {
  width: 100%;
  max-width: 100%;
  min-height: 44px;
  border: 1px solid var(--hmf-line);
  border-radius: 6px;
  padding: 10px 12px;
  font: inherit;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.4;
}

.hmf-amounts {
  border: 0;
  padding: 0;
  margin: 22px 0;
}

.hmf-amounts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.hmf-amounts legend {
  grid-column: 1 / -1;
}

.hmf-amounts label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  min-height: 44px;
  gap: 8px;
  padding: 10px 14px;
  border: 1px solid var(--hmf-line);
  border-radius: 6px;
  background: var(--hmf-bg);
  text-align: center;
  line-height: 1.25;
  overflow: hidden;
}

.hmf-amounts label:not(.hmf-custom) {
  min-height: 72px;
  padding: 14px 10px;
  font-size: clamp(14px, 2.8vw, 17px);
  font-weight: 800;
  white-space: normal;
  overflow-wrap: anywhere;
}

.hmf-amounts label:not(.hmf-custom) input {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 0;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.hmf-amounts label:has(input:checked) {
  border-color: var(--hmf-accent);
  background: rgba(223, 135, 41, .12);
}

.hmf-inline-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-weight: 500;
}

.hmf-custom input {
  width: 100%;
}

.hmf-currency-input {
  position: relative;
  display: block !important;
  width: 100%;
  color: var(--hmf-ink);
}

.hmf-currency-input > span {
  position: absolute;
  left: 14px;
  top: 50%;
  z-index: 2;
  transform: translateY(-50%);
  color: var(--hmf-ink);
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  pointer-events: none;
}

.hmf-currency-input input {
  padding-left: 38px;
}

.hmf-custom > span:first-child {
  text-align: left;
}

.hmf-custom {
  grid-column: 1 / -1;
  display: grid !important;
  grid-template-columns: minmax(90px, max-content) minmax(160px, 1fr);
  align-items: center;
  justify-content: stretch;
  min-height: 72px;
}

.hmf-submit,
.hmf-secondary {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 48px;
  border: 0;
  border-radius: 6px;
  padding: 12px 20px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  touch-action: manipulation;
}

.hmf-submit {
  background: var(--hmf-primary);
  color: #fff;
}

.hmf-secondary {
  border: 1px solid var(--hmf-accent);
  background: #fff;
  color: var(--hmf-ink);
}

.hmf-secondary:hover,
.hmf-secondary:focus-visible {
  border-color: var(--hmf-primary);
  background: var(--hmf-primary);
  color: #fff;
  filter: none;
}

.hmf-submit:hover {
  background: var(--hmf-accent);
  color: var(--hmf-ink);
  filter: none;
}

.hmf-submit:focus-visible {
  background: var(--hmf-accent);
  color: var(--hmf-ink);
}

.hmf-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.hmf-tax-exemption {
  display: grid;
  gap: 16px;
  margin-top: 22px;
  padding: 0;
  border: 0;
  background: transparent;
}

.hmf-check {
  display: inline-flex !important;
  align-items: center;
  gap: 8px;
  width: auto;
  color: #111827;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
}

.hmf-check input {
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  min-height: 0;
  margin: 0;
  padding: 0;
}

.hmf-check span {
  min-width: 0;
}

.hmf-pan-field {
  width: 100%;
  max-width: 100%;
}

.hmf-pan-field input {
  min-height: 44px;
  border-color: var(--hmf-line);
  border-radius: 6px;
  font-size: 16px;
  font-weight: 400;
}

.hmf-form-message {
  min-height: 22px;
  color: var(--hmf-muted);
}

.hmf-retry-notice {
  display: grid;
  gap: 12px;
  margin-top: 14px;
  border: 1px solid rgba(121, 37, 22, .18);
  border-radius: 8px;
  padding: 14px;
  background: #fff8ef;
}

.hmf-retry-notice__text {
  margin: 0;
  color: var(--hmf-ink);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.5;
}

.hmf-retry-notice__button {
  width: fit-content;
}

.hmf-payment-overlay {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: none;
  place-items: center;
  padding: 24px;
  background: rgba(17, 24, 39, .72);
  backdrop-filter: blur(6px);
}

.hmf-payment-overlay.is-visible {
  display: grid;
}

.hmf-payment-overlay__panel {
  width: min(100%, 420px);
  border-radius: 8px;
  padding: 30px 26px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .28);
  color: var(--hmf-ink);
  text-align: center;
}

.hmf-payment-overlay__spinner {
  width: 54px;
  height: 54px;
  margin: 0 auto 18px;
  border: 5px solid rgba(121, 37, 22, .14);
  border-top-color: var(--hmf-primary);
  border-radius: 50%;
  animation: hmf-spin .85s linear infinite;
}

.hmf-payment-overlay__title {
  margin: 0 0 8px;
  color: var(--hmf-primary);
  font-size: 20px;
  font-weight: 800;
  line-height: 1.25;
}

.hmf-payment-overlay__message {
  margin: 0;
  color: var(--hmf-muted);
  font-size: 14px;
  line-height: 1.6;
}

@keyframes hmf-spin {
  to {
    transform: rotate(360deg);
  }
}

.hmf-campaign-card {
  border: 1px solid var(--hmf-line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.hmf-campaign-card > img {
  width: 100%;
  aspect-ratio: 16 / 7;
  object-fit: cover;
}

.hmf-campaign-card__body {
  padding: 22px;
}

.hmf-progress {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--hmf-line);
}

.hmf-progress span {
  display: block;
  height: 100%;
}

.hmf-table-wrap {
  overflow-x: auto;
}

.hmf-donor-dashboard table {
  width: 100%;
  border-collapse: collapse;
}

.hmf-donor-dashboard th,
.hmf-donor-dashboard td {
  border-bottom: 1px solid var(--hmf-line);
  padding: 10px;
  text-align: left;
}

.hmf-dashboard-downloads {
  min-width: 190px;
}

.hmf-mini-button {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  margin: 3px 6px 3px 0;
  border: 1px solid rgba(121, 37, 22, .25);
  border-radius: 6px;
  padding: 7px 10px;
  background: #fff8ef;
  color: var(--hmf-primary);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  text-decoration: none;
}

.hmf-mini-button:hover,
.hmf-mini-button:focus-visible {
  border-color: var(--hmf-accent);
  background: var(--hmf-accent);
  color: var(--hmf-ink);
}

.hmf-thank-you {
  min-height: 78vh;
  display: grid;
  align-items: center;
  padding: 72px 24px;
  background: linear-gradient(135deg, #792516, #3f140c);
  background-size: cover;
  background-position: center;
  color: #fff;
}

.hmf-thank-you > div {
  max-width: 760px;
  margin: auto;
}

.hmf-thank-you h1 {
  color: inherit;
  font-size: clamp(34px, 6vw, 64px);
  line-height: 1.05;
}

.hmf-social-share {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.hmf-social-share a {
  border: 1px solid rgba(223,135,41,.75);
  border-radius: 999px;
  color: #fff;
  padding: 8px 12px;
  text-decoration: none;
}

@media (max-width: 700px) {
  .hmf-donation-form {
    width: 100%;
    padding: 16px;
    margin: 12px auto;
  }

  .hmf-settings-grid,
  .hmf-tabs {
    grid-template-columns: 1fr;
  }

  .hmf-form-header h2 {
    font-size: 23px;
  }

  .hmf-submit,
  .hmf-secondary {
    width: 100%;
  }

  .hmf-actions {
    width: 100%;
  }

  .hmf-selected-amount {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .hmf-thankyou-amount {
    margin: 18px auto 24px;
    padding: 16px;
  }

  .hmf-thankyou-amount__message {
    font-size: 16px;
  }

  .hmf-thankyou-amount__value {
    font-size: 38px;
  }

  .hmf-actions .hmf-submit,
  .hmf-actions .hmf-secondary {
    flex: 1 1 calc(50% - 6px);
    width: auto;
    min-width: 0;
  }

  .hmf-grid {
    gap: 14px;
  }

  .hmf-field-width {
    flex-basis: 100%;
    min-width: 100%;
  }

  .hmf-field-key-state,
  .hmf-field-key-city {
    flex: 0 1 calc(50% - 7px);
    min-width: 0;
  }

  .hmf-donation-form input[type="text"],
  .hmf-donation-form input[type="email"],
  .hmf-donation-form input[type="tel"],
  .hmf-donation-form input[type="number"],
  .hmf-donation-form input[type="date"],
  .hmf-donation-form select,
  .hmf-donation-form textarea {
    font-size: 16px !important;
  }

  .hmf-amounts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .hmf-amounts label {
    width: 100%;
  }

  .hmf-custom {
    align-items: stretch;
    flex-direction: column;
    grid-column: 1 / -1;
    grid-template-columns: 1fr;
  }

  .hmf-custom input {
    width: 100%;
  }

}

@media (max-width: 420px) {
  .hmf-donation-form {
    padding: 14px;
    border-left: 0;
    border-right: 0;
  }

  .hmf-tabs {
    gap: 8px;
  }

  .hmf-tabs button,
  .hmf-submit,
  .hmf-secondary {
    min-height: 46px;
    padding: 10px 12px;
    font-size: 14px;
  }

  .hmf-field-key-state,
  .hmf-field-key-city {
    flex-basis: calc(50% - 7px);
  }

  .hmf-amounts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
