:root {
  --ink: #25322c;
  --forest: #355f4b;
  --sage: #dfe9dd;
  --cream: #fffaf0;
  --peach: #f5d8c7;
  --white: #ffffff;
  --danger: #a33b35;
  --shadow: 0 12px 35px rgba(37, 50, 44, 0.12);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, ""Segoe UI"", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--cream);
  line-height: 1.5;
}

button, input, textarea { font: inherit; }

button, a { -webkit-tap-highlight-color: transparent; }

.hero {
  padding: 4.5rem 1.25rem 3rem;
  background:
    radial-gradient(circle at 15% 10%, var(--peach), transparent 32%),
    radial-gradient(circle at 85% 15%, var(--sage), transparent 36%),
    var(--cream);
  text-align: center;
}

.hero__content, .page-shell {
  width: min(1100px, 100%);
  margin-inline: auto;
}

h1 {
  max-width: 760px;
  margin: 0.4rem auto 1rem;
  font-family: Georgia, serif;
  font-size: clamp(2.2rem, 7vw, 4.8rem);
  line-height: 1.04;
}

h2 { font-family: Georgia, serif; }

.eyebrow {
  margin: 0;
  color: var(--forest);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.intro {
  max-width: 650px;
  margin-inline: auto;
  font-size: 1.06rem;
}

.page-shell { padding: 2.5rem 1.25rem 4rem; }

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.admin-link { color: var(--forest); }

.gift-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
}

.gift-card {
  overflow: hidden;
  border: 1px solid rgba(53, 95, 75, 0.14);
  border-radius: 22px;
  background: var(--white);
  box-shadow: var(--shadow);
}

.gift-image {
  width: 100%;
  aspect-ratio: 4 / 3;
  display: block;
  object-fit: contain;
  background: #f7f3e8;
}

.gift-content { padding: 1.25rem; }

.gift-content h3 {
  margin: 0.2rem 0 0.4rem;
  font-family: Georgia, serif;
  font-size: 1.45rem;
}

.gift-description { min-height: 3rem; }

.amount-summary {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.92rem;
}

.progress-track {
  height: 10px;
  margin: 0.7rem 0 1.1rem;
  overflow: hidden;
  border-radius: 999px;
  background: #e9ece7;
}

.progress-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--forest);
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.primary-button,
.secondary-button,
.amount-buttons button,
.copy-row button {
  border: 0;
  border-radius: 999px;
  padding: 0.75rem 1rem;
  cursor: pointer;
}

.primary-button {
  background: var(--forest);
  color: var(--white);
  font-weight: 750;
}

.primary-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.secondary-button,
.amount-buttons button,
.copy-row button {
  background: var(--sage);
  color: var(--ink);
}

.link-button {
  display: block;
  text-align: center;
  text-decoration: none;
}

.funded-badge {
  display: inline-block;
  border-radius: 999px;
  padding: 0.7rem 1rem;
  background: var(--peach);
  font-weight: 800;
}

.status-message {
  padding: 1rem;
  border-radius: 12px;
  background: var(--sage);
}

.status-message:empty { display: none; }

footer {
  padding: 2rem 1rem 3rem;
  text-align: center;
}

.dialog {
  width: min(520px, calc(100% - 2rem));
  max-height: 90vh;
  overflow: auto;
  border: 0;
  border-radius: 24px;
  padding: 0;
  box-shadow: var(--shadow);
}

.dialog::backdrop { background: rgba(19, 28, 23, 0.6); }

.dialog form {
  position: relative;
  padding: 2rem;
}

.close-button {
  position: absolute;
  top: 0.75rem;
  right: 0.9rem;
  border: 0;
  background: transparent;
  font-size: 2rem;
  cursor: pointer;
}

label {
  display: grid;
  gap: 0.4rem;
  margin: 1rem 0;
  font-weight: 700;
}

input, textarea {
  width: 100%;
  border: 1px solid #b9c6be;
  border-radius: 12px;
  padding: 0.78rem;
  color: var(--ink);
  background: var(--white);
}

fieldset {
  margin: 1.2rem 0;
  border: 0;
  padding: 0;
}

legend { font-weight: 800; }

.amount-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.6rem;
}

.amount-buttons button.selected {
  outline: 3px solid var(--forest);
}

.amount-buttons button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.error {
  min-height: 1.5rem;
  color: var(--danger);
  font-weight: 700;
}

.muted { font-weight: 400; opacity: 0.7; }

.upi-qr {
  width: min(260px, 100%);
  display: block;
  margin: 1rem auto;
  border-radius: 16px;
}

.copy-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin: 1rem 0;
  padding: 0.75rem;
  border-radius: 12px;
  background: var(--sage);
}

.instruction, .privacy-note {
  padding: 0.85rem;
  border-radius: 12px;
  background: #f7f3e8;
}

.text-button {
  width: 100%;
  margin-top: 0.7rem;
  border: 0;
  background: transparent;
  color: var(--forest);
  cursor: pointer;
}

.thank-you { text-align: center; }

/* Admin */
.admin-shell {
  width: min(1050px, calc(100% - 2rem));
  margin: 2rem auto;
}

.panel {
  padding: 1.4rem;
  border-radius: 20px;
  background: var(--white);
  box-shadow: var(--shadow);
}

.admin-grid {
  display: grid;
  gap: 1rem;
}

.contribution-row {
  display: grid;
  grid-template-columns: 1.4fr 1fr auto;
  gap: 1rem;
  align-items: center;
  padding: 1rem;
  border: 1px solid #dce3dd;
  border-radius: 14px;
}

.admin-actions {
  display: flex;
  gap: 0.5rem;
}

.danger-button {
  border: 0;
  border-radius: 999px;
  padding: 0.7rem 1rem;
  background: #f2d2cf;
  color: #742722;
  cursor: pointer;
}

@media (max-width: 800px) {
  .gift-grid { grid-template-columns: 1fr; }
  .section-heading { align-items: start; flex-direction: column; }
  .contribution-row { grid-template-columns: 1fr; }
}