/* Malaika Africa – Stripe donation UI (scoped, mirrors the site's look) */

/* Brand palette – Malaika Africa Farben (Agentur, 2026-11-24).
   Rules (WCAG AA):
   - Text only in Blau, Braun or Schwarz; Weiß only on Blau/Braun/Schwarz.
   - Hellblau / Hellbraun are surfaces only (patches, decoration); text on
     them is always Schwarz (Blau/Braun on them is only ~2.7–2.9:1).
   - Blau #4672DC is 4.47:1 on white – fine for large text (>=24px, or
     >=19px bold), just short of 4.5 for small text. Small text and buttons
     with small white labels use --ma-blau-text (#4470D9, 4.6:1), which is
     visually indistinguishable. */
:root {
  --ma-blau:        #4672DC;
  --ma-blau-text:   #4470D9;
  --ma-braun:       #966C63;   /* 4.54:1 on white */
  --ma-schwarz:     #3C3C3C;   /* 11:1 on white */
  --ma-weiss:       #FFFFFF;
  --ma-hellblau:    #B4CAF6;   /* surfaces only */
  --ma-hellbraun:   #E1CABC;   /* surfaces only */

  /* Semantic roles used below */
  --ma-primary:       var(--ma-blau-text);
  --ma-primary-hover: #3A60BD;  /* 5.9:1 with white */
  --ma-accent:        var(--ma-braun);
  --ma-text:          var(--ma-schwarz);
}

.stripe-donate { font-family: inherit; color: var(--ma-text); }

/* The staging embed's banner (backend/build-embed.js): nobody should take
   the test page for the real one. */
.sd-testmode {
  margin: 0 0 16px; padding: 12px 16px; border: 2px dashed #1a1a1a; border-radius: 8px;
  background: #ffd23f; color: #1a1a1a; font: 700 16px/1.4 Montserrat, system-ui, sans-serif;
  text-align: center; letter-spacing: .02em;
}

/* ============================================================= *
 *  Post-donation popup: thank you + Spendenbescheinigung note +
 *  newsletter opt-in. A true overlay on top of the current page –
 *  used after the main widget confirms, and when returning from a
 *  redirect-based payment or a Payment Link (?session_id=…).
 *  Not scoped to .stripe-donate: it can sit anywhere in the body.
 * ============================================================= */
.nl-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.5);
  display: flex; align-items: center; justify-content: center;
  /* above Duda's cookie bar (#d-notification-bar, z-index 1000000100) –
     the popup is modal, nothing of the page may sit on its buttons */
  padding: 20px; z-index: 1000000200; opacity: 0; transition: opacity .2s ease;
  font-family: inherit;
}
.nl-overlay[hidden] { display: none; }
.nl-overlay.is-visible { opacity: 1; }
.nl-modal {
  background: #fff; border-radius: 14px; padding: 32px 32px 26px;
  max-width: 560px; width: 100%; max-height: calc(100vh - 40px); overflow-y: auto;
  text-align: center; position: relative;
  box-shadow: 0 16px 48px rgba(0,0,0,.25);
  transform: translateY(8px); transition: transform .2s ease;
  color: var(--ma-text); font-family: inherit;
}
.nl-overlay.is-visible .nl-modal { transform: translateY(0); }
.nl-close {
  position: absolute; top: 4px; right: 4px; border: 0; background: none;
  width: 44px; height: 44px; display: flex; align-items: center; justify-content: center;
  font-size: 22px; line-height: 1; color: #999; cursor: pointer; padding: 0;
  z-index: 1;
}
.nl-close:hover { color: #333; }
/* This page's own CSS carries a very large/coloured default for bare <h2>
   elements (they're normally always wrapped in a Duda per-instance class
   that overrides it) – our injected headings aren't, so pin every property
   explicitly with !important rather than chase which upstream rule wins. */
.nl-modal h2 {
  all: unset !important;
  display: block !important;
  margin: 0 0 8px !important;
  font-size: 19px !important;
  line-height: 1.3 !important;
  font-weight: 700 !important;
  color: var(--ma-text) !important;
  font-family: inherit !important;
  text-align: center;
}

/* Steps inside the popup: the Payment-Link preview form, then the thank you */
.nl-step { display: none; }
.nl-step.is-active { display: block; }
#nl-step-details { text-align: left; }
.nl-preview-badge {
  display: inline-block; margin: 0 0 10px; padding: 4px 10px;
  border-radius: 999px; background: var(--ma-hellblau); color: var(--ma-text);
  font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em;
}
#nl-step-details .nl-lede { text-align: center; margin-bottom: 20px; font-weight: 600; }
#nl-step-details .sd-field { margin-bottom: 12px; }
#nl-step-details .sd-field label {
  display: block; font-size: 13px; font-weight: 600; color: #444; margin-bottom: 4px;
}
#nl-step-details .sd-field .sd-optional { font-weight: 400; color: #666; }
#nl-step-details .sd-field input {
  width: 100%; min-height: 44px; box-sizing: border-box; padding: 11px 12px; border: 1px solid #d0d0d0;
  border-radius: 8px; font-size: 15px; font-family: inherit;
}
#nl-step-details .sd-field input.sd-invalid { border-color: #b3261e; }
#nl-step-details .sd-field-row { display: flex; gap: 10px; }
#nl-step-details .sd-field-row .sd-field { flex: 1; }
#nl-step-details .sd-field-row .sd-field--small { flex: 0 0 90px; }
.nl-modal .nl-lede { margin: 0 0 4px; font-size: 15px; color: #444; }
.nl-modal .nl-reason { margin: 8px 0 0; font-size: 13.5px; color: #666; font-style: italic; }
.nl-hr { border: 0; border-top: 1px solid #eee; margin: 18px 0; }
.nl-receipt {
  display: flex; gap: 10px; align-items: flex-start; text-align: left;
  background: var(--ma-hellbraun); border: 0; border-radius: 10px;
  padding: 12px 14px; margin: 0 0 4px;
}
.nl-receipt .nl-icon { font-size: 18px; line-height: 1.4; }
.nl-receipt p {
  margin: 0; font-size: 13px; color: var(--ma-text); line-height: 1.5;
  min-width: 0; overflow-wrap: anywhere; /* a long e-mail address must wrap, not widen the modal */
}
.nl-newsletter-title { margin: 18px 0 6px; font-size: 15px; font-weight: 700; color: var(--ma-text); }
.nl-newsletter-copy { margin: 0 0 14px; font-size: 13.5px; color: #555; }
.nl-consent { margin: 10px 0 0; font-size: 12px; line-height: 1.5; color: #666; }
.nl-consent a { color: inherit; text-decoration: underline; }
.nl-modal #nl-form { display: flex; flex-direction: column; gap: 10px; }
/* The signup's Turnstile widget (#179). Not rendered yet, it takes no
   room – but keeps its width, which picks the widget's size. */
.nl-modal #nl-form .sd-turnstile { max-width: 100%; }
.nl-modal #nl-form .sd-turnstile:empty { margin-bottom: -10px; }
.nl-modal #nl-email {
  padding: 12px 14px; border: 1px solid #d0d0d0; border-radius: 8px; font-size: 15px;
  box-sizing: border-box; font-family: inherit; min-height: 44px;
}
.nl-submit-btn {
  appearance: none; border: 0; border-radius: 8px; padding: 13px 16px;
  width: 100%; min-height: 44px; box-sizing: border-box; margin-top: 4px;
  font-size: 15px; font-weight: 700; color: #fff; background: var(--ma-primary);
  cursor: pointer; transition: background .12s;
}
.nl-submit-btn:hover { background: var(--ma-primary-hover); }
.nl-submit-btn[disabled] { opacity: .6; cursor: default; }
.nl-skip {
  display: block; margin: 4px auto 0; background: none; border: 0;
  min-height: 44px; padding: 0 12px;
  color: #666; font-size: 13px; cursor: pointer; text-decoration: underline;
}
.nl-skip:hover { color: #555; }
.nl-message { margin: 12px 0 0; font-size: 13px; min-height: 16px; color: #b3261e; }
/* The Kampagnen-Seite's "Urkunde herunterladen" (#121): under the thanks,
   outlined, so the newsletter's button stays the one filled. */
.nl-urkunde { margin: 14px 0 0; }
.nl-urkunde-btn {
  appearance: none; border: 2px solid var(--ma-primary); border-radius: 8px; padding: 11px 16px;
  width: 100%; min-height: 44px; box-sizing: border-box;
  font-size: 15px; font-weight: 700; color: var(--ma-primary); background: #fff;
  cursor: pointer; font-family: inherit;
}
.nl-urkunde-btn:hover { background: #EEF3FC; }
.nl-urkunde-btn[disabled] { opacity: .6; cursor: default; }
.nl-urkunde .nl-message:empty { display: none; }
.nl-message.is-ok { color: #1c7c34; }

/* ============================================================= *
 *  Main donation widget
 * ============================================================= */
.stripe-donate {
  max-width: 460px;
  margin: 12px 0 4px;
  padding: 22px;
  border: 1px solid #e4e4e4;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.06), 0 6px 20px rgba(0,0,0,.04);
}
.stripe-donate .sd-step { display: none; }
.stripe-donate .sd-step.is-active { display: block; }

.stripe-donate .sd-legend { font-weight: 700; font-size: 15px; margin: 0 0 12px; }

.stripe-donate .sd-amounts {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}
/* four buttons don't fit 44px wide in the narrowest phones: two rows */
@media (max-width: 374px) {
  .stripe-donate .sd-amounts { grid-template-columns: repeat(2, 1fr); }
}
.stripe-donate .sd-amt {
  appearance: none;
  border: 1px solid #d0d0d0;
  background: #f7f7f7;
  border-radius: 8px;
  /* 44px whatever the page's own line-height (#21: a bare page gives 43) */
  min-height: 44px;
  padding: 12px 4px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .12s, background .12s, box-shadow .12s;
}
.stripe-donate .sd-amt:hover { background: #f0f0f0; }
.stripe-donate .sd-amt.is-selected {
  border-color: var(--ma-primary);
  background: #fff;
  box-shadow: 0 0 0 2px rgba(68,112,217,.22);
}
.stripe-donate .sd-custom { position: relative; margin-bottom: 16px; }
.stripe-donate .sd-custom input {
  width: 100%;
  box-sizing: border-box;
  min-height: 44px;
  padding: 12px 14px 12px 30px;
  border: 1px solid #d0d0d0;
  border-radius: 8px;
  font-size: 15px;
}
.stripe-donate .sd-custom::before {
  content: "€";
  position: absolute;
  left: 12px; top: 50%;
  transform: translateY(-50%);
  color: #777;
  font-size: 15px;
}
/* Duda's mobile and tablet CSS styles every `div.dmInner input[type=…]`:
   translucent grey, a white border, white text on some – unreadable on
   the white card. The widget's fields keep their own look. */
#stripe-donate-widget input:not([type="checkbox"]):not([type="radio"]),
#stripe-donate-widget textarea {
  background: #fff; color: #1a1a1a; border: 1px solid #d0d0d0; margin: 0; height: auto;
}
/* …and its `padding: 0 10px` (every variant, desktop too) – the custom
   amount's text ran under its "€" (#22). */
#stripe-donate-widget .sd-field input,
#stripe-donate-widget .sd-field textarea { padding: 11px 12px; }
#stripe-donate-widget .sd-custom input { padding: 12px 14px 12px 30px; }
#stripe-donate-widget .sd-field input.sd-invalid,
#stripe-donate-widget .sd-field textarea.sd-invalid { border-color: #b3261e; }
.stripe-donate .sd-field { margin-bottom: 12px; }
.stripe-donate .sd-field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #444;
  margin-bottom: 4px;
}
.stripe-donate .sd-field .sd-optional { font-weight: 400; color: #666; }
.stripe-donate .sd-field input,
.stripe-donate .sd-field textarea {
  width: 100%;
  min-height: 44px;
  box-sizing: border-box;
  padding: 11px 12px;
  border: 1px solid #d0d0d0;
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
}
.stripe-donate .sd-field textarea { resize: vertical; }
.stripe-donate .sd-counter {
  margin-top: 4px;
  text-align: right;
  font-size: 12px;
  color: #666;
}
.stripe-donate .sd-counter.is-full { color: #b3261e; }
/* A line of help under a field – the Land-Urkunde's gift name (#121). */
.stripe-donate .sd-hint { margin: 4px 0 0; font-size: 12px; color: #666; }
/* Turnstile (#128), above "Weiter zur Zahlung": empty until it renders. */
.stripe-donate .sd-turnstile { margin: 12px 0 10px; max-width: 100%; }
.stripe-donate .sd-turnstile:empty { margin: 0; }
.stripe-donate .sd-field input.sd-invalid,
.stripe-donate .sd-field textarea.sd-invalid { border-color: #b3261e; }
.stripe-donate .sd-field-row { display: flex; gap: 10px; }
.stripe-donate .sd-field-row .sd-field { flex: 1; }
.stripe-donate .sd-field-row .sd-field--small { flex: 0 0 90px; }
.stripe-donate .sd-btn {
  appearance: none;
  width: 100%;
  border: 0;
  border-radius: 8px;
  padding: 14px 16px;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  background: var(--ma-primary);
  cursor: pointer;
  transition: background .12s, transform .04s;
}
.stripe-donate .sd-btn:hover { background: var(--ma-primary-hover); }
.stripe-donate .sd-btn:active { transform: translateY(1px); }
.stripe-donate .sd-btn[disabled] { opacity: .55; cursor: default; }
.stripe-donate .sd-btn.sd-secondary {
  background: transparent;
  color: #555;
  font-weight: 600;
  min-height: 44px;
  padding: 8px;
  margin-top: 4px;
}
.stripe-donate .sd-btn.sd-secondary:hover { background: #f2f2f2; color: #333; }
.stripe-donate #payment-element { margin: 6px 0 16px; min-height: 40px; }
.stripe-donate .sd-summary { font-size: 14px; color: #555; margin: 0 0 14px; }
.stripe-donate .sd-summary strong { color: var(--ma-text); }
.stripe-donate .sd-message { margin-top: 12px; font-size: 14px; min-height: 18px; color: #b3261e; }
.stripe-donate .sd-message.is-ok { color: #1c7c34; }
.stripe-donate .sd-message.is-info { color: #555; }
.stripe-donate .sd-notice {
  font-size: 13px;
  line-height: 1.5;
  color: #8a6d00;
  background: #fff8e1;
  border: 1px solid #ffe2a8;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 14px;
}
.stripe-donate .sd-spinner {
  display: inline-block;
  width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,.5);
  border-top-color: #fff;
  border-radius: 50%;
  animation: sd-spin .7s linear infinite;
  vertical-align: -2px;
  margin-right: 8px;
}
@keyframes sd-spin { to { transform: rotate(360deg); } }

/* ============================================================= *
 *  Donation row: keep the photo beside the widget at its own
 *  height. The widget's flex column grows across its amount /
 *  details / payment steps; Duda's row (.dmRespColsWrapper is
 *  display:flex with the default align-items:stretch) was
 *  stretching the photo column's cover background to match,
 *  cropping it into an ever-taller sliver as steps were added.
 * ============================================================= */
/* Note: plain #1692966931 would be invalid CSS (an ID selector can't start
   with a digit unless escaped) and is silently dropped by the browser –
   use attribute selectors instead, which have no such restriction. */
[id="1692966931"] { align-items: flex-start; }
[id="1940629823"] { align-self: flex-start; height: 440px; max-height: 440px; }

/* ============================================================= *
 *  Example items – clean aligned grid (replaces the Duda rows)
 * ============================================================= */
.sx-examples {
  background: var(--ma-primary);
  padding: 52px 0;
  font-family: inherit;
  width: 100%;
}
.sx-carousel { position: relative; }

.sx-track {
  display: flex;
  gap: 24px;
  overflow-x: auto;
  scroll-padding-left: clamp(16px, 6vw, 96px);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 6px clamp(16px, 6vw, 96px) 18px;
}
.sx-track::-webkit-scrollbar { display: none; }
/* snap only when the user is driving; JS removes it during auto-scroll */
.sx-carousel.is-snapping .sx-track {
  scroll-snap-type: x proximity;
  scroll-behavior: smooth;
}
.sx-carousel.is-snapping .sx-card { scroll-snap-align: start; }

.sx-card {
  flex: 0 0 clamp(260px, 78vw, 340px);
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0,0,0,.18);
}

/* nav arrows */
.sx-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 0;
  background: #fff;
  color: var(--ma-primary);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 3px 12px rgba(0,0,0,.28);
  transition: opacity .15s, transform .05s;
}
.sx-nav:active { transform: translateY(-50%) scale(.94); }
.sx-nav--prev { left: clamp(6px, 2.5vw, 40px); }
.sx-nav--next { right: clamp(6px, 2.5vw, 40px); }
.sx-nav[disabled] { opacity: 0; pointer-events: none; }

/* dots */
/* dots: an 8px dot in a 44×44 tap target */
.sx-dots {
  display: flex;
  justify-content: center;
  margin-top: 0;
}
.sx-dots button {
  width: 44px; height: 44px;
  padding: 0; border: 0;
  background: none;
  cursor: pointer;
}
.sx-dots button::before {
  content: "";
  display: block;
  width: 8px; height: 8px;
  margin: auto;
  border-radius: 50%;
  background: rgba(255,255,255,.45);
  transition: background .15s, transform .15s;
}
.sx-dots button.is-active::before { background: #fff; transform: scale(1.35); }

@media (hover: none) {
  .sx-nav { display: none; }
}
.sx-card__img {
  width: 100%;
  aspect-ratio: 3 / 2;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-color: var(--ma-hellbraun);
}
.sx-card__body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 18px 20px 20px;
  flex: 1;
}
.sx-examples .sx-card .sx-card__title {
  margin: 0;
  font-size: 20px;
  line-height: 1.25;
  font-weight: 700;
  color: var(--ma-text);
  min-height: 2.5em;            /* keep 1- and 2-line titles aligned */
}
.sx-examples .sx-card .sx-card__price {
  margin: 0 0 4px;
  font-size: 22px;
  font-weight: 700;
  color: var(--ma-accent);
}
.sx-card .stripe-pl-button {
  margin-top: auto;
  align-self: stretch;         /* full-width call to action */
}

@media (max-width: 560px) {
  .sx-examples { padding: 38px 0; }
}

/* ---------- Payment Link buttons ---------- */
a.stripe-pl-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  box-sizing: border-box;
  padding: 11px 18px;
  border-radius: 8px;
  background: var(--ma-primary);
  color: #fff !important;
  font-weight: 700;
  font-size: 14px;
  text-decoration: none !important;
  border: 0;
  cursor: pointer;
  transition: background .12s, opacity .12s;
}
a.stripe-pl-button:hover { background: var(--ma-primary-hover); }
a.stripe-pl-button.is-disabled {
  background: var(--ma-hellblau);
  color: var(--ma-text) !important;
  cursor: not-allowed;
}
.stripe-pl-hint {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: #fff;
}
.sx-card .stripe-pl-hint { color: var(--ma-accent); }
