/* RankPilot Donate — box under posts + VietQR transfer page. Uses the theme's base font (Nunito on Learn AI Mindset). */
.rpd-box,
.rpd-page {
  --rpd-font: var(--cs-font-base-family, "Nunito"), "Nunito", system-ui, sans-serif;
  --rpd-accent: #5b3fe0;
  --rpd-accent-soft: #7c63ff;
  --rpd-button: #8b74ff;
  --rpd-ink: #17112e;
  --rpd-muted: #dcd6ff;
  font-family: var(--rpd-font);
}
.rpd-box *,
.rpd-page * {
  font-family: inherit;
  box-sizing: border-box;
}

/* ---------- box under the post ---------- */
/* Sized to sit with the article: body text is 18px, H2 24px, the key-takeaways box 20/24px padding. */
.rpd-box {
  margin: 32px 0 24px;
  padding: 22px 26px 18px;
  border-radius: 14px;
  color: #fff;
  background-color: #4b37d4;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 800 400' preserveAspectRatio='none'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='.06' stroke-width='1.2'%3E%3Cpath d='M-20 300 C 160 200 300 380 480 270 S 760 120 840 190'/%3E%3Cpath d='M-20 320 C 170 220 310 400 490 290 S 770 140 840 210'/%3E%3Cpath d='M-20 340 C 180 240 320 420 500 310 S 780 160 840 230'/%3E%3Cpath d='M-20 90 C 200 30 360 170 560 90 S 760 10 840 40'/%3E%3Cpath d='M-20 110 C 210 50 370 190 570 110 S 770 30 840 60'/%3E%3C/g%3E%3C/svg%3E"),
    linear-gradient(135deg, #5d49ea 0%, #4b37d4 55%, #3e2bbd 100%);
  background-size: 100% 100%, 100% 100%;
}
.rpd-box .rpd-title {
  margin: 0 0 6px;
  font-size: 1.0625rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: #fff;
}
.rpd-box .rpd-text {
  margin: 0 0 12px;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.92);
}
.rpd-box .rpd-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.45;
  color: var(--rpd-muted);
}
.rpd-box .rpd-note svg { flex: none; width: 16px; height: 16px; }

/* amount picker (box and transfer page) */
.rpd-amounts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(0, 2fr);
  gap: 8px;
  margin: 0 0 12px;
}
.rpd-chip {
  position: relative;
  display: block;
  margin: 0;
  cursor: pointer;
}
.rpd-chip input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
}
.rpd-chip span {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  border-radius: 8px;
  background: #fff;
  color: var(--rpd-ink);
  font-size: 0.9375rem;
  font-weight: 600;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.rpd-chip:hover span { background: #f1eeff; }
.rpd-chip input:checked + span {
  background: var(--rpd-accent-soft);
  color: #fff;
}
.rpd-chip input:checked + span::after {
  content: "";
  position: absolute;
  top: -7px;
  right: -7px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid #fff;
  background: var(--rpd-accent-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6.5 12.5l3.5 3.5 7.5-8' fill='none' stroke='%23fff' stroke-width='2.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 12px no-repeat;
}
.rpd-chip input:focus-visible + span { outline: 2px solid #ffd54a; outline-offset: 2px; }

.rpd-other {
  display: flex;
  align-items: stretch;
  height: 40px;
  margin: 0;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}
.rpd-other > span {
  display: flex;
  align-items: center;
  padding: 0 12px;
  border-right: 1px solid #e4e1ee;
  color: var(--rpd-ink);
  font-size: 0.9375rem;
  font-weight: 600;
}
.rpd-box .rpd-other input,
.rpd-page .rpd-other input,
.rpd-other input:focus {
  flex: 1;
  min-width: 0;
  height: auto;
  margin: 0;
  padding: 0 12px;
  border: 0;
  border-radius: 0;
  outline: 0;
  background: transparent;
  box-shadow: none;
  color: var(--rpd-ink);
  font-size: 0.875rem;
  line-height: normal;
}
.rpd-other input::placeholder { color: #8b8799; opacity: 1; }
.rpd-other:focus-within { box-shadow: inset 0 0 0 2px var(--rpd-accent-soft); }

.rpd-error {
  margin: -4px 0 12px;
  font-size: 0.9rem;
  font-weight: 700;
  color: #ffd54a;
}

.rpd-btn,
a.rpd-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 42px;
  margin: 0;
  padding: 0 18px;
  border: 0;
  border-radius: 8px;
  background: var(--rpd-button);
  background-image: none;
  color: #fff;
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease;
}
.rpd-btn:hover,
a.rpd-btn:hover { background: #9a86ff; color: #fff; }
.rpd-btn:focus-visible { outline: 2px solid #ffd54a; outline-offset: 2px; }

/* The theme underlines content links with a background gradient and its own colour: undo both here. */
.rpd-box .rpd-links,
.rpd-page .rpd-links {
  margin: 12px 0 0;
  text-align: center;
  font-size: 0.8125rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.85);
}
.rpd-box .rpd-links a,
.rpd-box .rpd-links a:visited,
.rpd-page .rpd-links a,
.rpd-page .rpd-links a:visited {
  padding: 0 !important;
  border: 0 !important;
  background: none !important;
  box-shadow: none !important;
  color: inherit !important;
  font-weight: 500;
  text-decoration: none !important;
  white-space: nowrap;
}
.rpd-box .rpd-links a:hover,
.rpd-page .rpd-links a:hover { color: #fff !important; text-decoration: underline !important; text-underline-offset: 3px; }

@media (max-width: 680px) {
  .rpd-box { padding: 18px 16px 14px; border-radius: 12px; }
  .rpd-box .rpd-title { font-size: 1rem; }
  .rpd-box .rpd-text { font-size: 0.875rem; }
  .rpd-box .rpd-note { font-size: 0.8125rem; align-items: flex-start; }
  .rpd-amounts { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .rpd-other { grid-column: 1 / -1; }
}

/* ---------- transfer page ---------- */
/* One screen, like a payment page: purple panel, one white card (details | QR), a quiet back button. */
.rpd-donate-page .cs-entry__header,
.rpd-donate-page .cs-entry__header-standard { display: none; }

.rpd-hero {
  padding: 36px 32px 28px;
  border-radius: 20px;
  color: #fff;
  text-align: center;
  background-color: #4b37d4;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 800 400' preserveAspectRatio='none'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='.06' stroke-width='1.2'%3E%3Cpath d='M-20 300 C 160 200 300 380 480 270 S 760 120 840 190'/%3E%3Cpath d='M-20 320 C 170 220 310 400 490 290 S 770 140 840 210'/%3E%3Cpath d='M-20 90 C 200 30 360 170 560 90 S 760 10 840 40'/%3E%3Cpath d='M-20 110 C 210 50 370 190 570 110 S 770 30 840 60'/%3E%3C/g%3E%3C/svg%3E"),
    linear-gradient(135deg, #5d49ea 0%, #4b37d4 55%, #3e2bbd 100%);
  background-size: 100% 100%, 100% 100%;
}
.rpd-hero-title {
  margin: 0 0 8px;
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.3;
  color: #fff;
}
.rpd-hero-lead {
  max-width: 620px;
  margin: 0 auto 24px;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.88);
}
.rpd-card {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  text-align: left;
  border-radius: 16px;
  background: #fff;
  color: var(--rpd-ink);
  box-shadow: 0 16px 40px -24px rgba(10, 6, 40, 0.6);
}
.rpd-card-main { padding: 24px 26px; }
.rpd-card-qr {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 26px;
  border-left: 1px solid #ece9f5;
  text-align: center;
}
.rpd-h {
  margin: 0 0 12px;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.35;
  color: var(--rpd-ink);
}
.rpd-article,
.rpd-article:visited {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  color: inherit !important;
  background: none !important;
  text-decoration: none !important;
}
.rpd-thumb {
  flex: none;
  width: 96px;
  height: 60px;
  border-radius: 8px;
  object-fit: cover;
}
.rpd-article-text { display: flex; flex-direction: column; gap: 4px; }
.rpd-article-title { font-size: 0.9375rem; font-weight: 700; line-height: 1.4; }
.rpd-article:hover .rpd-article-title { color: var(--rpd-accent); }
.rpd-article-cat { font-size: 0.8125rem; color: #6d6880; }
.rpd-sep { height: 1px; margin: 18px 0; border: 0; background: #ece9f5; }

.rpd-rows { margin: 0; }
.rpd-rows > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 7px 0;
}
.rpd-rows dt { flex: none; margin: 0; font-size: 0.875rem; font-weight: 400; color: #6d6880; }
.rpd-rows dd {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 700;
  text-align: right;
  overflow-wrap: anywhere;
}
.rpd-copy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 26px;
  height: 26px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #8b86a0;
  cursor: pointer;
}
.rpd-copy:hover { background: #f1eeff; color: var(--rpd-accent); }
.rpd-copy.is-done { background: var(--rpd-accent); color: #fff; }
.rpd-change {
  margin: 0;
  padding: 2px 8px;
  border: 1px solid #d9d4ee;
  border-radius: 6px;
  background: transparent;
  color: var(--rpd-accent);
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1.4;
  cursor: pointer;
}
.rpd-change:hover { border-color: var(--rpd-accent); }
.rpd-amount-edit { display: inline-flex; align-items: center; gap: 4px; }
.rpd-amount-edit[hidden], [data-rpd-amount][hidden], .rpd-change[hidden] { display: none; }
.rpd-page .rpd-amount-edit input {
  width: 110px;
  height: 30px;
  margin: 0;
  padding: 0 8px;
  border: 1px solid var(--rpd-accent);
  border-radius: 6px;
  background: #fff;
  color: var(--rpd-ink);
  font-size: 0.9375rem;
  font-weight: 700;
  text-align: right;
}
.rpd-page .rpd-error { margin: 8px 0 0; font-size: 0.8125rem; color: #c62828; text-align: right; }

.rpd-card-qr img {
  display: block;
  width: 100%;
  max-width: 220px;
  height: auto;
  margin: 0 auto 10px;
}
.rpd-qr-note { margin: 0 0 8px; font-size: 0.8125rem; line-height: 1.5; color: #6d6880; }
.rpd-save,
.rpd-save:visited {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--rpd-accent) !important;
  background: none !important;
  text-decoration: none !important;
}
.rpd-save:hover { text-decoration: underline !important; }

.rpd-actions { margin-top: 20px; }
.rpd-ghost,
.rpd-ghost:visited {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 200px;
  height: 42px;
  padding: 0 22px;
  border-radius: 10px;
  background: #fff !important;
  color: var(--rpd-ink) !important;
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none !important;
}
.rpd-ghost:hover { background: #f1eeff !important; }

.rpd-privacy { margin: 16px 0 0; text-align: center; font-size: 0.8125rem; line-height: 1.6; opacity: 0.7; }
.rpd-page .rpd-links { margin-top: 6px; color: inherit; opacity: 0.85; }
.rpd-page .rpd-links a:hover { color: var(--rpd-accent) !important; }

@media (max-width: 720px) {
  .rpd-hero { padding: 24px 14px 20px; border-radius: 16px; }
  .rpd-hero-title { font-size: 1.2rem; }
  .rpd-card { grid-template-columns: minmax(0, 1fr); }
  .rpd-card-qr { order: -1; border-left: 0; border-bottom: 1px solid #ece9f5; }
  .rpd-card-main, .rpd-card-qr { padding: 18px 16px; }
}

/* ---------- light theme (v1.0.5): soft lavender like the key-takeaways box, dark text ---------- */
.rpd-box,
.rpd-hero {
  color: var(--rpd-ink);
  background-color: #f1eeff;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 800 400' preserveAspectRatio='none'%3E%3Cg fill='none' stroke='%235b3fe0' stroke-opacity='.07' stroke-width='1.2'%3E%3Cpath d='M-20 300 C 160 200 300 380 480 270 S 760 120 840 190'/%3E%3Cpath d='M-20 320 C 170 220 310 400 490 290 S 770 140 840 210'/%3E%3Cpath d='M-20 90 C 200 30 360 170 560 90 S 760 10 840 40'/%3E%3C/g%3E%3C/svg%3E"),
    linear-gradient(135deg, #f5f2ff 0%, #ece6ff 100%);
  border: 1px solid #e0d8ff;
}
.rpd-box .rpd-title,
.rpd-hero-title { color: #1a1330; }
.rpd-box .rpd-text,
.rpd-hero-lead { color: #3f3858; }
.rpd-box .rpd-note { color: var(--rpd-accent); }

.rpd-box .rpd-chip span,
.rpd-box .rpd-other { border: 1px solid #ddd5fb; }
.rpd-box .rpd-chip:hover span { background: #faf8ff; border-color: #c9bdf8; }
.rpd-box .rpd-chip input:checked + span {
  background: var(--rpd-accent);
  border-color: var(--rpd-accent);
  color: #fff;
}
.rpd-box .rpd-chip input:checked + span::after { background-color: var(--rpd-accent); }
.rpd-box .rpd-other:focus-within { box-shadow: 0 0 0 2px rgba(91, 63, 224, 0.25); border-color: var(--rpd-accent); }
.rpd-box .rpd-chip input:focus-visible + span,
.rpd-btn:focus-visible { outline-color: var(--rpd-accent); }
.rpd-box .rpd-error { color: #c62828; }

.rpd-btn,
a.rpd-btn { background: var(--rpd-accent); }
.rpd-btn:hover,
a.rpd-btn:hover { background: #4a2fd2; }

.rpd-box .rpd-links { color: #6d6880; }
.rpd-box .rpd-links a:hover { color: var(--rpd-accent) !important; }

.rpd-hero .rpd-card { border: 1px solid #e6e0fb; box-shadow: 0 10px 30px -22px rgba(40, 20, 120, 0.45); }
.rpd-ghost,
.rpd-ghost:visited { border: 1px solid #ddd5fb; }
