/* Pledges: the pledge option on the donation card, the donor's private pledge
   page and the console Pledges tab. Builds on giving.css tokens. */

/* Donation card: while "Pledge" is chosen, the one-time form keeps only its
   gift-type switch and the pledge form takes over below it. */
.giving-donate-form.is-pledging > :not(.giving-fieldset){display:none!important}
.giving-pledge-panel{margin-top:4px;animation:giving-pledge-in .18s ease-out}
@keyframes giving-pledge-in{from{opacity:0;transform:translateY(4px)}to{opacity:1;transform:none}}
@media(prefers-reduced-motion:reduce){.giving-pledge-panel{animation:none}}
.giving-pledge-kinds{display:grid;gap:8px;margin-bottom:6px}
.giving-pledge-kind{position:relative;display:block;cursor:pointer}
.giving-pledge-kind input{position:absolute;opacity:0;width:1px;height:1px}
.giving-pledge-kind span{display:flex;flex-direction:column;gap:2px;padding:11px 13px;border:1px solid var(--g-line);border-radius:9px;background:#fff;transition:border-color .15s ease,background-color .15s ease}
.giving-pledge-kind strong{font-size:14px;font-weight:650}
.giving-pledge-kind small{font-size:12px;line-height:1.45;color:var(--g-muted)}
.giving-pledge-kind input:checked+span{border-color:var(--g-blue);background:#f3f7ff;box-shadow:inset 0 0 0 1px var(--g-blue)}
.giving-pledge-kind input:focus-visible+span{outline:3px solid #93b4ff;outline-offset:2px}
.giving-pledge-summary{margin:10px 0 4px;padding:10px 12px;border-radius:8px;background:var(--g-soft);font-size:14px;line-height:1.5}
.giving-pledge-form [data-pledge-section]{margin-top:2px}

/* Private pledge page */
.giving-pledge-page .giving-public-intro{margin-bottom:24px}
/* "Back to alnoor.org": a pledge made in a school's embedded form. */
.giving-pledge-back{display:inline-flex;align-items:center;gap:8px;margin:0 0 6px;padding:4px 0;font-size:14px;font-weight:600;color:var(--g-blue)!important;overflow-wrap:anywhere}
.giving-pledge-back svg{flex:none;transform:scaleX(-1)}
.giving-pledge-back:hover span{text-decoration:underline}
.giving-pledge-back:focus-visible{outline:3px solid #93b4ff;outline-offset:2px;border-radius:4px}
.giving-pledge-layout{display:grid;grid-template-columns:minmax(0,1.25fr) minmax(0,1fr);gap:22px;align-items:start;margin-bottom:22px}
.giving-pledge-summary-card,.giving-pledge-pay-card{padding:26px;border-radius:14px}
.giving-pledge-total{margin:0 0 10px;color:var(--g-muted)}
.giving-pledge-total strong{display:block;color:var(--g-ink);font-size:clamp(30px,4vw,40px);line-height:1.15;letter-spacing:-1.2px;font-weight:750}
.giving-pledge-page progress,.giving-pledge-progress-card progress{width:100%;height:10px;appearance:none;border:0;border-radius:99px;background:#e8eef8;overflow:hidden}
.giving-pledge-page progress::-webkit-progress-bar,.giving-pledge-progress-card progress::-webkit-progress-bar{background:#e8eef8;border-radius:99px}
.giving-pledge-page progress::-webkit-progress-value,.giving-pledge-progress-card progress::-webkit-progress-value{background:var(--g-blue);border-radius:99px}
.giving-pledge-page progress::-moz-progress-bar,.giving-pledge-progress-card progress::-moz-progress-bar{background:var(--g-blue);border-radius:99px}
.giving-pledge-figures{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin:18px 0}
.giving-pledge-figures div{min-width:0}
.giving-pledge-figures dt{font-size:12px;color:var(--g-muted)}
.giving-pledge-figures dd{margin:0;font-size:18px;font-weight:650;overflow-wrap:anywhere}
.giving-pledge-history{border-radius:14px}
.giving-pledge-reminders{max-width:620px;margin:0 auto}

/* Pledge payment tables are short: no forced width, numbers kept on one line. */
.giving-table.giving-pledge-table{min-width:0}
.giving-pledge-table td,.giving-pledge-table th{white-space:nowrap}
.giving-pledge-table td:nth-child(2){white-space:normal}

/* Console */
.giving-pledge-count{display:inline-block;min-width:18px;margin-left:3px;padding:0 5px;border-radius:9px;background:#eef2f8;font-size:10px;line-height:16px;text-align:center}
.giving-pledge-kind-filter{display:flex;flex-wrap:wrap;gap:6px;margin:-8px 0 18px}
.giving-pledge-kind-filter .is-active{background:#eaf1ff;border-color:#bcd0f7;color:var(--g-blue)!important}
.giving-pledge-progress-card{margin-bottom:22px}
.giving-pledge-progress-card progress{margin-bottom:8px}
.giving-pledge-reminder-list{margin:0;padding-left:18px;font-size:13px;line-height:1.7}
.giving-card-pledged{margin:4px 0 0}
.giving-status--fulfilled{background:#f0f9ef;color:#397135;border-color:#c8e5c3}
.giving-status--canceled,.giving-status--written_off,.giving-status--expired{background:#f4f6f9;color:#516076}

@media(max-width:900px){
  .giving-pledge-layout{grid-template-columns:1fr}
}
@media(max-width:600px){
  /* Short tables wrap rather than scroll, so the amount is always in view;
     secondary columns (tip, who recorded it) give way on phones. */
  .giving .giving-table.giving-pledge-table th,.giving .giving-table.giving-pledge-table td{padding-left:5px;padding-right:5px;white-space:normal;max-width:none}
  .giving .giving-table.giving-pledge-table th:first-child,.giving .giving-table.giving-pledge-table td:first-child{padding-left:0}
  .giving .giving-table.giving-pledge-table .giving-numeric{white-space:nowrap}
  .giving-pledge-table .giving-status{font-size:10px;padding:0 4px;margin:0}
  .giving-pledge-table .giving-pledge-optional{display:none}
}
@media(max-width:500px){
  .giving-pledge-summary-card,.giving-pledge-pay-card{padding:20px}
  .giving-pledge-figures{grid-template-columns:1fr 1fr}
  .giving-pledge-figures div:last-child{grid-column:1/-1}
  .giving-pledge-figures dd{font-size:16px}
}
