/* ==========================================================================
   Recurring donations — "Akshay Dan" (/recurring-donation)
   Scoped under .sg-rd. Loads after page.css, which owns .sg-page, the tokens,
   .sg-phero, .sg-section, .sg-head and .sg-btn.

   Note on specificity: page.css sets .sg-page p / li / h2 / a, which are
   (0,1,1) and beat any single class on those elements. Every rule here that
   targets one of them is prefixed .sg-page for that reason.
   ========================================================================== */

/* ---------- the form shell ---------- */
.sg-rd-form {
  background: var(--sg-white);
  border: 1px solid var(--sg-cream-2);
  border-radius: var(--sg-radius-lg);
  box-shadow: var(--sg-shadow);
  padding: clamp(20px, 3.4vw, 40px);
  max-width: 860px;
  margin-inline: auto;
}

.sg-rd-step { border-top: 1px solid var(--sg-cream-2); padding-top: 28px; margin-top: 28px; }
.sg-rd-step:first-child { border-top: 0; padding-top: 0; margin-top: 0; }

.sg-page .sg-rd-step > h2 {
  font-size: clamp(1.1rem, 1.9vw, 1.32rem);
  display: flex; align-items: center; gap: .6rem;
  margin: 0 0 1rem;
}
.sg-rd-step__n {
  flex: none;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--sg-green); color: #fff;
  font-size: .86rem; font-weight: 700;
  display: grid; place-items: center;
}
.sg-page .sg-rd-step__hint { font-size: .9rem; color: var(--sg-muted-2); margin: -.4rem 0 1rem; }

/* ---------- step 1: the monthly amount ---------- */
.sg-rd-tiers {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(196px, 1fr));
  gap: 12px;
}
.sg-rd-tier { position: relative; display: block; }
.sg-rd-tier input {
  position: absolute; opacity: 0; width: 100%; height: 100%;
  margin: 0; cursor: pointer;
}
.sg-rd-tier__box {
  display: block;
  height: 100%;
  border: 1.5px solid var(--sg-cream-2);
  border-radius: var(--sg-radius);
  background: var(--sg-paper);
  padding: 16px 16px 18px;
  transition: border-color .16s ease, background .16s ease, transform .16s ease;
}
.sg-rd-tier input:hover + .sg-rd-tier__box { transform: translateY(-2px); }
.sg-rd-tier input:checked + .sg-rd-tier__box {
  border-color: var(--sg-green);
  background: var(--sg-green-tint);
  box-shadow: inset 0 0 0 1px var(--sg-green);
}
.sg-rd-tier input:focus-visible + .sg-rd-tier__box {
  outline: 3px solid var(--sg-orange); outline-offset: 2px;
}
.sg-rd-tier__amt {
  display: block;
  font-family: var(--sg-font-head);
  font-size: 1.55rem; font-weight: 700; line-height: 1.1;
  color: var(--sg-ink);
}
.sg-rd-tier__per { display: block; font-size: .72rem; letter-spacing: .09em; text-transform: uppercase; color: var(--sg-muted-2); margin-top: 2px; }
.sg-rd-tier__label { display: block; font-weight: 600; color: var(--sg-green); margin-top: .6rem; font-size: .95rem; }
.sg-rd-tier__blurb { display: block; font-size: .85rem; color: var(--sg-muted); margin-top: .3rem; line-height: 1.5; }

.sg-rd-tier__flag {
  position: absolute; top: -10px; right: 12px; z-index: 1;
  background: var(--sg-orange); color: #fff;
  font-size: .66rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
  padding: 4px 9px; border-radius: 999px;
  box-shadow: 0 4px 12px rgba(232,106,36,.3);
}

/* Custom amount. Sits under the tiers, and says plainly what it costs you:
   the card and UPI plans are fixed, so a custom figure is mandate-only. */
.sg-rd-other { margin-top: 18px; }
.sg-page .sg-rd-other__label { display: block; font-size: .9rem; font-weight: 600; color: var(--sg-ink-2); margin-bottom: .4rem; }
.sg-rd-other__wrap { position: relative; max-width: 260px; }
.sg-rd-other__rs {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--sg-muted-2); font-size: 1rem;
}
.sg-rd-other input {
  width: 100%;
  padding: 12px 14px 12px 32px;
  border: 1.5px solid var(--sg-cream-2);
  border-radius: 12px;
  background: var(--sg-paper);
  font: inherit; color: var(--sg-ink);
}
.sg-rd-other input:focus { outline: none; border-color: var(--sg-green); background: #fff; }

/* ---------- step 2: how it is paid ---------- */
.sg-rd-routes { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.sg-rd-route { position: relative; display: block; }
.sg-rd-route input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.sg-rd-route__box {
  display: block; height: 100%;
  border: 1.5px solid var(--sg-cream-2);
  border-radius: var(--sg-radius);
  background: var(--sg-paper);
  padding: 18px;
  transition: border-color .16s ease, background .16s ease, transform .16s ease;
}
.sg-rd-route input:hover:not(:disabled) + .sg-rd-route__box { transform: translateY(-2px); }
.sg-rd-route input:checked + .sg-rd-route__box {
  border-color: var(--sg-green); background: var(--sg-green-tint);
  box-shadow: inset 0 0 0 1px var(--sg-green);
}
.sg-rd-route input:focus-visible + .sg-rd-route__box { outline: 3px solid var(--sg-orange); outline-offset: 2px; }
/* Unavailable, not broken: the reason is printed inside the card. */
.sg-rd-route input:disabled + .sg-rd-route__box { opacity: .5; }
.sg-rd-route input:disabled { cursor: not-allowed; }

.sg-rd-route__name { display: flex; align-items: center; gap: .5rem; font-family: var(--sg-font-head); font-weight: 700; font-size: 1.05rem; color: var(--sg-ink); }
.sg-page .sg-rd-route__desc { font-size: .87rem; color: var(--sg-muted); margin: .5rem 0 0; line-height: 1.55; }
.sg-rd-route__why { display: block; font-size: .82rem; color: var(--sg-orange-dark); margin-top: .5rem; font-weight: 600; }

/* ---------- step 3: the donor ---------- */
.sg-rd-rows { display: grid; grid-template-columns: repeat(auto-fit, minmax(272px, 1fr)); gap: 14px 18px; }
.sg-rd-field--wide { grid-column: 1 / -1; }
.sg-page .sg-rd-field label { display: block; font-size: .88rem; font-weight: 600; color: var(--sg-ink-2); margin-bottom: .35rem; }
.sg-rd-field input {
  width: 100%; padding: 12px 14px;
  border: 1.5px solid var(--sg-cream-2); border-radius: 12px;
  background: var(--sg-paper); font: inherit; color: var(--sg-ink);
}
.sg-rd-field input:focus { outline: none; border-color: var(--sg-green); background: #fff; }
.sg-rd-field input[aria-invalid="true"] { border-color: #B4402A; }
.sg-rd-field__err { display: block; min-height: 1.1em; font-size: .8rem; color: #B4402A; margin-top: .25rem; }
.sg-page .sg-rd-field__note { font-size: .8rem; color: var(--sg-muted-2); margin: .25rem 0 0; }

/* ---------- the total and the button ---------- */
.sg-rd-total {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between;
  gap: .5rem;
  background: var(--sg-green-tint);
  border-radius: var(--sg-radius);
  padding: 16px 20px;
  margin-top: 24px;
}
.sg-page .sg-rd-total__k { font-size: .92rem; color: var(--sg-ink-2); margin: 0; font-weight: 600; }
.sg-rd-total__v { font-family: var(--sg-font-head); font-size: 1.7rem; font-weight: 700; color: var(--sg-green); }
.sg-rd-total__v small { font-size: .82rem; font-weight: 600; color: var(--sg-muted); }

.sg-rd-submit { margin-top: 18px; text-align: center; }
.sg-rd-submit .sg-btn { width: 100%; justify-content: center; font-size: 1.05rem; padding: 15px 24px; }

/* Disabled here means "there is nothing to set up yet", not "working" — the
   label says so itself once a payment is actually in flight. */
.sg-rd-submit .sg-btn[disabled] { opacity: .55; cursor: not-allowed; box-shadow: none; }
.sg-rd-submit .sg-btn[disabled]:hover { transform: none; background: var(--sg-orange); }
.sg-page .sg-rd-gate { font-size: .84rem; color: var(--sg-muted-2); margin: .6rem 0 0; text-align: center; }

.sg-page .sg-rd-msg { margin: 1rem 0 0; padding: 12px 16px; border-radius: 12px; font-size: .92rem; }
.sg-page .sg-rd-msg--err { background: #FDECE7; color: #8E2F1B; border: 1px solid #F0C4B7; }
.sg-page .sg-rd-msg--ok  { background: var(--sg-green-tint); color: var(--sg-green-dark); border: 1px solid var(--sg-green-soft); }

.sg-page .sg-rd-legal { font-size: .82rem; color: var(--sg-muted-2); text-align: center; margin: 1rem 0 0; }
.sg-page .sg-rd-legal a { color: var(--sg-green); text-decoration: underline; }

/* Test-mode notice. Loud on purpose: nobody should mistake a sandbox form for
   the live one. */
.sg-page .sg-rd-testbadge {
  background: #FFF4D6; border: 1.5px dashed #C08A1E; color: #6B4A05;
  border-radius: 12px; padding: 12px 16px; margin: 0 0 20px; font-size: .9rem;
}

/* ---------- how it works ---------- */
.sg-rd-how { display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(24px, 4vw, 56px); align-items: center; }
/* height:auto matters: the tag carries width/height attributes, and without
   it the 675 in the markup becomes the CSS height and stretches the photo. */
.sg-rd-how__media img { width: 100%; height: auto; border-radius: var(--sg-radius-lg); box-shadow: var(--sg-shadow-lg); display: block; }
.sg-page .sg-rd-steps { display: grid; gap: 18px; }
.sg-page .sg-rd-steps li {
  display: grid; grid-template-columns: 40px 1fr; gap: 16px; align-items: start;
}
.sg-rd-steps__n {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--sg-green); color: #fff;
  display: grid; place-items: center;
  font-family: var(--sg-font-head); font-weight: 700;
}
.sg-page .sg-rd-steps h3 { font-size: 1.06rem; margin: .2rem 0 .3rem; }
.sg-page .sg-rd-steps p { font-size: .95rem; margin: 0; }

/* ---------- what is Akshay Dan ---------- */
.sg-rd-what { max-width: 820px; margin-inline: auto; text-align: center; }
.sg-page .sg-rd-what p { font-size: clamp(1rem, 1.5vw, 1.14rem); color: var(--sg-ink-2); }
.sg-page .sg-rd-what .sg-rd-hindi {
  font-family: var(--sg-font-quote);
  font-size: clamp(1.15rem, 2.1vw, 1.5rem);
  color: var(--sg-green-dark);
  line-height: 1.6;
}

/* ---------- FAQs ---------- */
.sg-rd-faqs { max-width: 860px; margin-inline: auto; display: grid; gap: 12px; }
.sg-rd-faq {
  background: var(--sg-white);
  border: 1px solid var(--sg-cream-2);
  border-radius: var(--sg-radius);
  overflow: hidden;
}
.sg-rd-faq summary {
  cursor: pointer; list-style: none;
  padding: 18px 52px 18px 20px;
  position: relative;
  font-family: var(--sg-font-head); font-weight: 600; color: var(--sg-ink);
  font-size: 1.02rem;
}
.sg-rd-faq summary::-webkit-details-marker { display: none; }
.sg-rd-faq summary::after {
  content: ""; position: absolute; right: 22px; top: 50%;
  width: 10px; height: 10px; margin-top: -6px;
  border-right: 2px solid var(--sg-green); border-bottom: 2px solid var(--sg-green);
  transform: rotate(45deg); transition: transform .18s ease;
}
.sg-rd-faq[open] summary::after { transform: rotate(-135deg); margin-top: -2px; }
.sg-rd-faq summary:focus-visible { outline: 3px solid var(--sg-orange); outline-offset: -3px; }
.sg-page .sg-rd-faq p { margin: 0; padding: 0 20px 20px; font-size: .95rem; }

/* ---------- cancel / change ---------- */
.sg-rd-cancel {
  max-width: 860px; margin: clamp(28px, 4vw, 44px) auto 0;
  background: var(--sg-white); border: 1px solid var(--sg-cream-2);
  border-radius: var(--sg-radius); padding: 22px 24px;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px;
}
.sg-page .sg-rd-cancel h3 { font-size: 1.05rem; margin: 0 0 .25rem; }
.sg-page .sg-rd-cancel p { margin: 0; font-size: .92rem; max-width: 52ch; }

/* ---------- the working overlay ---------- */
.sg-rd-loader {
  position: fixed; inset: 0; z-index: 2000;
  display: none; place-items: center;
  background: rgba(21,33,29,.66);
  backdrop-filter: blur(2px);
  text-align: center; color: #fff;
  padding: 24px;
}
.sg-rd-loader[data-on="1"] { display: grid; }
.sg-rd-loader__ring {
  width: 46px; height: 46px; margin: 0 auto 16px;
  border: 4px solid rgba(255,255,255,.28);
  border-top-color: #fff; border-radius: 50%;
  animation: sgRdSpin .9s linear infinite;
}
@keyframes sgRdSpin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .sg-rd-loader__ring { animation-duration: 3s; }
}

/* ---------- thank you ---------- */
.sg-rd-thanks { max-width: 640px; margin-inline: auto; text-align: center; }
.sg-rd-thanks__tick {
  width: 74px; height: 74px; margin: 0 auto 22px;
  border-radius: 50%; background: var(--sg-green-tint);
  display: grid; place-items: center;
  color: var(--sg-green); font-size: 2rem;
}
.sg-rd-thanks__sum {
  background: var(--sg-white); border: 1px solid var(--sg-cream-2);
  border-radius: var(--sg-radius); padding: 20px 24px; margin: 26px 0;
  text-align: left;
}
.sg-page .sg-rd-thanks__sum dl { display: grid; grid-template-columns: auto 1fr; gap: .5rem 1.2rem; margin: 0; }
.sg-page .sg-rd-thanks__sum dt { font-size: .85rem; color: var(--sg-muted-2); }
.sg-page .sg-rd-thanks__sum dd { margin: 0; font-weight: 600; color: var(--sg-ink); }

/* ---------- narrow screens ---------- */
@media (max-width: 900px) {
  .sg-rd-how { grid-template-columns: 1fr; }
  .sg-rd-how__media { order: -1; }
}
@media (max-width: 560px) {
  .sg-rd-tiers { grid-template-columns: 1fr 1fr; }
  .sg-rd-tier__blurb { display: none; }
  .sg-rd-tier__box { padding: 14px 12px 16px; }
  .sg-rd-tier__amt { font-size: 1.3rem; }
  /* Tucked inside the card here. Hanging it over the top edge works on a
     three-across row; on two narrow columns it reads as floating between
     two cards, attached to neither. */
  .sg-rd-tier__flag { top: 8px; right: 8px; font-size: .58rem; padding: 3px 7px; }
  .sg-rd-form { padding: 18px 16px 24px; }
}

/* ---------- cancel / change form ---------- */
.sg-rd-cancelform { max-width: 640px; margin-inline: auto; }
.sg-rd-radiorow { display: flex; flex-wrap: wrap; gap: 10px; margin: .4rem 0 0; }
.sg-rd-radiorow label {
  display: inline-flex; align-items: center; gap: .5rem;
  border: 1.5px solid var(--sg-cream-2); border-radius: 999px;
  padding: 8px 16px; cursor: pointer; font-size: .92rem;
  transition: border-color .16s ease, background .16s ease;
}
.sg-rd-radiorow input { accent-color: var(--sg-green); margin: 0; }
.sg-rd-radiorow label:has(input:checked) { border-color: var(--sg-green); background: var(--sg-green-tint); }
.sg-rd-radiorow label:focus-within { outline: 3px solid var(--sg-orange); outline-offset: 2px; }
.sg-page .sg-rd-fieldset { border: 0; padding: 0; margin: 0 0 4px; }
.sg-page .sg-rd-fieldset > legend { font-size: .88rem; font-weight: 600; color: var(--sg-ink-2); padding: 0; margin-bottom: .1rem; }
