/* Donate page. Uses the site design tokens defined in site.css (:root) so the
   spacing, colour and radius language matches the rest of energysafety.africa. */

.donate-wrap {
  padding: 3.5rem 0 4.5rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
}

.donate-intro { padding-top: .5rem; }
.donate-intro .headline-lg { margin: .4rem 0 1rem; }

.donate-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.donate-field { display: flex; flex-direction: column; gap: .4rem; border: 0; margin: 0; padding: 0; }
.donate-field legend { font-weight: 700; color: var(--text); padding: 0; margin-bottom: .1rem; }
.donate-field label { font-weight: 600; color: var(--text-soft); font-size: .95rem; }
.donate-field .optional { font-weight: 400; color: var(--muted); }

.amount-legend-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .6rem;
}
.amount-legend-row legend { margin-bottom: 0; }

.amount-clear {
  border: 0;
  background: none;
  padding: 0;
  color: var(--muted);
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: .15em;
}
.amount-clear:hover { color: var(--primary); }
.amount-clear[hidden] { display: none; }

.donate-field input[type="text"],
.donate-field input[type="email"],
.donate-field textarea {
  width: 100%;
  padding: .6rem .9rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  font: inherit;
  color: var(--text);
  background: var(--surface-alt);
}
.donate-field input:focus,
.donate-field textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

/* Amount presets */
.amount-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: .5rem;
}
/* Two lines now -- the Rand figure that is actually charged, and the dollar
   guide under it -- so the tile stacks rather than centring one line. */
.amount-option {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .1rem;
  padding: .5rem .3rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-weight: 700;
  color: var(--text);
  background: var(--surface-alt);
  transition: border-color .15s, background .15s, color .15s;
}
.amount-option input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.amount-option:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}
.amount-option:hover { border-color: var(--primary); }

.amount-zar { line-height: 1.2; }

/* Clearly secondary to the Rand figure: this is the guide, not the charge. */
.amount-usd {
  font-size: .7rem;
  font-weight: 500;
  line-height: 1.2;
  color: var(--muted);
  white-space: nowrap;
}
/* On the selected (solid green) tile the muted grey would all but vanish. */
.amount-option:has(input:checked) .amount-usd { color: rgba(255, 255, 255, .82); }

/* Live conversion under the free-text field. Holds its line height while
   empty so the form does not shift as the donor types the first digit. */
.amount-usd-live {
  min-height: 1.2em;
  margin: .35rem 0 0;
  font-size: .82rem;
  color: var(--muted);
}

.amount-note {
  margin: .1rem 0 0;
  font-size: .8rem;
  line-height: 1.55;
  color: var(--muted);
}

.other-amount { margin: .3rem 0 .6rem; }
.amount-input { display: flex; align-items: center; }
.amount-input .currency {
  /* Same vertical padding as the input beside it -- they were mismatched
     (.75rem vs .6rem), so the "R" box stood taller than the field itself. */
  padding: .6rem .8rem;
  border: 1px solid var(--line-strong);
  border-right: 0;
  border-radius: var(--radius-md) 0 0 var(--radius-md);
  background: var(--primary-soft);
  color: var(--primary-strong);
  font-weight: 700;
  line-height: 1.4;
}
.amount-input input { border-radius: 0 var(--radius-md) var(--radius-md) 0 !important; }

.field-error { color: #b00020; font-size: .88rem; margin: .1rem 0 0; }

.donate-submit { margin-top: .4rem; }
.btn-block { width: 100%; justify-content: center; }
.donate-secure { color: var(--muted); font-size: .85rem; text-align: center; margin: 0; }

/* Result pages (return / cancel) */
.donate-result {
  grid-column: 1 / -1;
  max-width: 640px;
  margin: 0 auto;
  text-align: center;
  padding: 3rem 0;
}
.result-icon {
  width: 76px; height: 76px;
  margin: 0 auto 1.2rem;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 2.4rem; font-weight: 700; color: #fff;
}
.result-icon.success { background: var(--primary); }
.result-icon.cancel  { background: var(--muted); }
.donate-result .headline-lg { margin-bottom: .8rem; }
.result-actions { display: flex; gap: .8rem; justify-content: center; flex-wrap: wrap; margin-top: 1rem; }

@media (max-width: 860px) {
  .donate-wrap { grid-template-columns: 1fr; gap: 1.6rem; padding: 2.5rem 0 3.5rem; }
  .amount-grid { grid-template-columns: repeat(2, 1fr); }
  .amount-usd { font-size: .72rem; }
}
