* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #f3efe7;
  --text: #1c1714;
  --header: #14100e;
  --gold: #c9a45c;
  --red: #8b1e1e;
  --paper: #fffaf1;
  --muted: #6b5a48;
}

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Georgia, "Times New Roman", serif;
}

.header {
  min-height: 88px;
  padding: 18px 28px;
  background: var(--header);
  color: #f5e9d0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand h1 {
  font-size: 34px;
  letter-spacing: 2px;
}

.brand p {
  margin-top: 4px;
  color: #c7b895;
}

.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

button,
.btn,
.pay {
  border: 0;
  cursor: pointer;
  padding: 11px 16px;
  border-radius: 8px;
  background: var(--gold);
  color: #15110f;
  font-weight: 700;
  text-decoration: none;
  font-family: Arial, sans-serif;
  font-size: 14px;
}

button:hover,
.btn:hover,
.pay:hover {
  opacity: 0.86;
}

.donate,
.pay {
  background: var(--red);
  color: white;
}

.viewer-wrap {
  height: calc(100vh - 88px);
  padding: 16px;
}

.pdf-viewer {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 14px;
  background: white;
  box-shadow: 0 6px 28px rgba(0, 0, 0, 0.18);
}

/* Donate popup */

.modal {
  position: fixed;
  inset: 0;
  display: none;
  place-items: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.78);
  z-index: 1000;
}

.modal.show {
  display: grid;
}

.modal-card {
  position: relative;
  width: min(430px, 100%);
  padding: 28px;
  border-radius: 16px;
  background: var(--paper);
  color: var(--text);
  text-align: center;
  box-shadow: 0 10px 38px rgba(0, 0, 0, 0.36);
}

.close {
  position: absolute;
  top: 8px;
  right: 14px;
  padding: 0;
  background: transparent;
  color: var(--text);
  font-size: 32px;
  line-height: 1;
}

.modal-card h2 {
  margin-bottom: 8px;
}

.modal-card p {
  color: var(--muted);
  margin-bottom: 16px;
}

.qr {
  width: 240px;
  max-width: 100%;
  display: block;
  margin: 12px auto 18px;
  border-radius: 12px;
  border: 2px solid #1c1714;
}

.upi-box {
  margin-bottom: 14px;
  padding: 14px;
  border: 1px dashed #8b6f3e;
  border-radius: 10px;
  background: #f5ead6;
}

.upi-box span {
  display: block;
  margin-bottom: 4px;
  color: #66594a;
  font-size: 13px;
  font-family: Arial, sans-serif;
}

.upi-box strong {
  font-size: 18px;
  word-break: break-word;
}

#copyUpiBtn {
  margin-bottom: 12px;
}

.pay {
  display: inline-block;
}

/* Dark mode */

body.dark {
  --bg: #0f0f0f;
  --text: #f5e9d0;
  --header: #000;
  --paper: #181818;
  --muted: #c7b895;
}

body.dark .upi-box {
  background: #222;
  border-color: var(--gold);
}

body.dark .upi-box span {
  color: #c7b895;
}

body.dark .close {
  color: #f5e9d0;
}

/* Mobile */

@media (max-width: 700px) {
  .header {
    align-items: flex-start;
    flex-direction: column;
  }

  .brand h1 {
    font-size: 28px;
  }

  .actions {
    width: 100%;
  }

  .actions button,
  .actions .btn {
    flex: 1;
    text-align: center;
  }

  .viewer-wrap {
    height: calc(100vh - 150px);
    padding: 10px;
  }

  .pdf-viewer {
    border-radius: 10px;
  }
}
