@import url("https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;600;700&family=Plus+Jakarta+Sans:wght@600;700;800&display=swap");

* { box-sizing: border-box; }

body {
  font-family: 'Open Sans', system-ui, sans-serif;
  color: #212121;
  background: #f5f5f5;
  margin: 0;
  padding: 24px 16px;
  line-height: 1.5;
}

/* transparent background when embedded in an iframe (donate.php?embed=1) */
body.embed { background: transparent; }

.donate-wrap { display: flex; justify-content: center; }

.donate-card {
  width: 100%;
  max-width: 440px;
  background: #fff;
  border-radius: 24px;
  padding: 24px;
  box-shadow: 0 25px 25px rgba(0, 0, 0, 0.25);
}

.donate-title {
  margin: 0;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-weight: 800;
  font-size: 20px;
  line-height: 30px;
  color: #1a1a2e;
  text-align: center;
}

.donate-sub {
  margin: 4px 0 0;
  font-size: 14px;
  line-height: 20px;
  color: #777;
  text-align: center;
}

/* ---- Step 1: frequency toggle ---- */
.freq-toggle {
  display: flex;
  gap: 4px;
  margin-top: 20px;
  padding: 4px;
  background: #f0f0f0;
  border-radius: 999px;
}
.freq-btn {
  flex: 1;
  border: none;
  background: transparent;
  border-radius: 999px;
  padding: 8px;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-weight: 600;
  font-size: 14px;
  color: #555;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease, box-shadow 0.12s ease;
}
.freq-btn.is-active {
  background: #ffcb1d;
  color: #1a1a2e;
  box-shadow: 0 1px 1.5px rgba(0, 0, 0, 0.1);
}

/* ---- Step 1: amounts ---- */
.amount-grid {
  display: grid;
  /* 4-across by default; long-label currencies (e.g. IDR "Rp500,000") switch to a clean 2x2
     via .is-long (toggled in script.js) so they never overflow or wrap to an uneven 3+1. */
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 20px;
}
.amount-grid.is-long { grid-template-columns: repeat(2, 1fr); }
.amount-btn {
  background: #fff;
  border: 1.833px solid #e0e0e0;
  border-radius: 14px;
  padding: 13px 2px;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-weight: 700;
  font-size: 13px;
  color: #444;
  cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease, color 0.12s ease;
}
.amount-btn:hover { border-color: #ffcb1d; }
.amount-btn.is-active { background: #fffde7; border-color: #ffcb1d; color: #1a1a2e; }

.amount-custom { position: relative; margin-top: 12px; }
.amount-custom__prefix {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-weight: 600;
  font-size: 16px;
  color: #888;
}
.amount-custom input {
  width: 100%;
  height: 48px;
  border: 1.833px solid #e0e0e0;
  border-radius: 14px;
  padding: 0 18px 0 34px;
  font-family: 'Open Sans', system-ui, sans-serif;
  font-size: 14px;
  color: #212121;
}
.amount-custom input:focus { outline: none; border-color: #2397cb; }
/* 2-char symbols (Rp / RM / S$) are wider than "$" — give the input extra left room so the
   prefix never overlaps the placeholder/value (class toggled in script.js). */
.amount-custom.has-wide-prefix input { padding-left: 48px; }

/* ---- Step 2: donor details ---- */
.field-row { display: flex; gap: 12px; margin-top: 20px; }
.field-row .field { flex: 1; margin-top: 0; }

.field { margin-top: 20px; }
.field label {
  display: block;
  font-family: 'Open Sans', system-ui, sans-serif;
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #424242;
  margin-bottom: 6px;
}
.field input {
  width: 100%;
  height: 42px;
  border: 1.041px solid #ccc;
  border-radius: 10px;
  padding: 0 12px;
  font-family: 'Open Sans', system-ui, sans-serif;
  font-size: 14px;
  color: #212121;
}
.field input:focus { outline: none; border-color: #2397cb; }
.field input.input-error { border-color: #ea4134; background: rgba(234, 65, 52, 0.05); }

/* ---- Shared primary button ---- */
.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-top: 20px;
  background: #ffcb1d;
  color: #1a1a2e;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-weight: 700;
  font-size: 16px;
  border: none;
  border-radius: 14px;
  padding: 16px;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(255, 203, 29, 0.45); }

/* ---- Messages / misc ---- */
.form-error {
  margin-top: 12px;
  font-size: 13px;
  font-weight: 600;
  color: #ea4134;
  text-align: center;
}
#processing {
  margin-top: 12px;
  text-align: center;
  font-weight: 600;
  color: #9e9e9e;
}
.link-back {
  display: block;
  margin: 12px auto 0;
  background: none;
  border: none;
  color: #9e9e9e;
  font-family: 'Open Sans', system-ui, sans-serif;
  font-size: 13px;
  cursor: pointer;
}

.stripe-link { display: block; text-align: center; margin-top: 16px; }
.stripe-logo { display: inline-block; width: 40%; max-width: 120px; height: auto; opacity: 0.85; }
