/* donate-v2.css — proper donation engine UX */

/* T-52c — failed donation attempt notice */
.dv2-error {
  margin: 0 0 12px;
  padding: 12px 14px;
  border: 1px solid #b3261e;
  border-radius: 8px;
  background: #fdecea;
  color: #7f1d1b;
  font-weight: 600;
  line-height: 1.7;
  animation: dv2-err-in 320ms ease-out;
}
/* The notice arrives with one small shake instead of appearing (2026-09-13). */
@keyframes dv2-err-in {
  0% { opacity: 0; transform: translateX(0); }
  35% { opacity: 1; transform: translateX(3px); }
  70% { transform: translateX(-2px); }
  100% { transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .dv2-error { animation: none; }
  .dv2-amounts button:active { transform: none; }
}

.dv2-form {
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
  background: #ffffff;
  border: 1px solid rgba(18, 82, 92, 0.18);
  border-radius: 1.4rem;
  padding: clamp(1.4rem, 3vw, 2rem);
  box-shadow: 0 22px 60px -38px rgba(18, 82, 92, 0.4);
}

.dv2-segment {
  border: 0;
  margin: 0;
  padding: 0;
}
.dv2-segment legend {
  display: block;
  font-family: "Alexandria", sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--brand-navy, #0A2A3D);
  margin-bottom: 0.55rem;
}

.dv2-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  background: var(--cream-100);
  padding: 0.35rem;
  border-radius: 999px;
}
.dv2-pills button {
  flex: 1;
  min-width: 5.5rem;
  padding: 0.55rem 0.9rem;
  border: 0;
  background: transparent;
  border-radius: 999px;
  cursor: pointer;
  font-family: "Alexandria", sans-serif;
  font-size: 0.88rem;
  color: var(--ink-900);
  transition: background-color 180ms ease, color 180ms ease;
}
.dv2-pills button:hover { background: rgba(18, 82, 92, 0.08); }
.dv2-pills button.is-active {
  background: var(--green-700);
  color: #fff;
  box-shadow: 0 8px 20px -12px rgba(18, 82, 92, 0.6);
}

.dv2-label {
  display: block;
  font-family: "Alexandria", sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand-navy, #0A2A3D);
  margin-bottom: 0.55rem;
}
.dv2-select {
  width: 100%;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(10, 42, 61, 0.18);
  border-radius: 1rem;
  background: var(--cream-50);
  color: var(--ink-900);
  font-family: "Alexandria", "Noto Kufi Arabic", sans-serif;
  font-size: 0.95rem;
}

.dv2-amounts {
  display: grid;
  gap: 0.5rem;
  grid-template-columns: repeat(2, 1fr);
}
/* Four amounts and «مبلغ مخصص» (2026-09-11: 20 · 50 · 100 · 200). On a
   phone the four make two even rows and the custom choice takes its own. */
.dv2-amounts button[data-amount="custom"] { grid-column: 1 / -1; }
@media (min-width: 600px) {
  .dv2-amounts { grid-template-columns: repeat(5, 1fr); }
  .dv2-amounts button[data-amount="custom"] { grid-column: auto; }
}

/* The form alone in its section (2026-09-11): «خمس خطوات للتبرع» is gone,
   so the form takes one centred column instead of the right half. */
.donation-layout.donation-layout--solo {
  display: block;
  max-width: 44rem;
  margin-inline: auto;
}

/* «احسب زكاتك», shown on the zakat path only. */
.dv2-zakat-hint {
  margin: 0.5rem 0 0;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--brand-tint, #F4F6F7);
  color: var(--brand-grey, #5A6B74);
  font-size: 0.875rem;
}
.dv2-zakat-hint a { color: var(--brand-teal, #12525C); font-weight: 700; text-underline-offset: 3px; }

/* Under the pay button: the receipt and the licence, at the moment of decision. */
.dv2-assure {
  margin: 8px 0 0;
  text-align: center;
  color: var(--brand-grey, #5A6B74);
  font-size: 0.8125rem;
  line-height: 1.7;
}

/* Account numbers with «نسخ». */
.dv2-acct { display: grid; gap: 8px; margin: 12px 0 0; }
.dv2-acct > div { display: grid; gap: 2px; }
.dv2-acct dt { color: var(--brand-grey, #5A6B74); font-weight: 700; }
.dv2-acct dd {
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 12px;
  color: var(--brand-navy, #0A2A3D);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.dv2-copy {
  min-height: 36px;
  min-width: 4.5rem;
  padding-inline: 14px;
  border: 1px solid var(--brand-teal, #12525C);
  border-radius: 8px;
  background: #fff;
  color: var(--brand-teal, #12525C);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 160ms ease, color 160ms ease;
}
.dv2-copy:hover { background: var(--brand-tint, #F4F6F7); }
/* A number never breaks across lines. On a phone the 29-character IBAN broke
   as «AE94 0500 0000 0001 9556 / 586» and the licence as «NPO-A- / M-104»
   (measured on the live site, 375px). The IBAN keeps one line and scales down
   with the screen, never under the 13px floor; «نسخ» wraps beneath it. */
.dv2-acct dd > span[dir="ltr"] { white-space: nowrap; }
.dv2-acct > div:nth-child(2) dd > span[dir="ltr"] { font-size: clamp(0.8125rem, 3.9vw, 1rem); }
.dv2-assure span[dir="ltr"] { white-space: nowrap; }
.dv2-copy.is-done { background: var(--brand-teal, #12525C); color: #fff; }

/* The phone bar (donate-v2.js): total, path, and «متابعة», while the form is
   on screen and its own button is not. */
.dv2-bar {
  position: fixed;
  inset-inline: 12px;
  inset-block-end: calc(12px + env(safe-area-inset-bottom));
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-block: 10px;
  padding-inline: 18px 10px;
  background: var(--brand-navy, #0A2A3D);
  color: #fff;
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(10, 42, 61, 0.32);
  transform: translateY(calc(100% + 28px));
  visibility: hidden;
  transition: transform 240ms cubic-bezier(.22, .61, .36, 1), visibility 0s linear 240ms;
}
.dv2-bar.is-shown {
  transform: none;
  visibility: visible;
  transition: transform 240ms cubic-bezier(.22, .61, .36, 1), visibility 0s;
}
.dv2-bar__sum { margin: 0; display: grid; gap: 2px; min-width: 0; line-height: 1.35; }
.dv2-bar__sum b { font-size: 1.0625rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.dv2-bar__sum span {
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.78);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dv2-bar__go {
  flex: none;
  min-height: 44px;
  padding-inline: 22px;
  border: 0;
  border-radius: 10px;
  background: var(--brand-gold, #C9A227);
  color: var(--brand-navy, #0A2A3D);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.dv2-bar__go:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
@media (min-width: 641px) { .dv2-bar { display: none; } }
@media (prefers-reduced-motion: reduce) { .dv2-bar, .dv2-bar.is-shown { transition: none; } }
/* The WhatsApp disc sits where the bar sits; it steps aside while the bar is up. */
body:has(.dv2-bar.is-shown) .whatsapp-floating {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.dv2-amounts button {
  border: 1px solid rgba(10, 42, 61, 0.18);
  background: var(--cream-50);
  color: var(--ink-900);
  border-radius: 0.9rem;
  padding: 0.7rem 0.4rem;
  font-family: "Alexandria", sans-serif;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 180ms, border-color 180ms, color 180ms, transform 120ms ease;
}
.dv2-amounts button:hover { border-color: var(--brand-teal, #12525C); }
.dv2-amounts button:active { transform: scale(0.97); }
.dv2-amounts button.is-active {
  background: var(--brand-teal, #12525C);
  color: #fff;
  border-color: var(--brand-teal, #12525C);
}

.dv2-custom {
  margin-top: 0.7rem;
}
.dv2-custom label {
  display: block;
  font-size: 0.78rem;
  margin-bottom: 0.35rem;
  color: rgba(31, 31, 35, 0.65);
}
.dv2-input-wrap {
  position: relative;
  display: block;
}
.dv2-input-wrap input {
  width: 100%;
  padding: 0.7rem 1rem 0.7rem 2.6rem;
  border: 1px solid rgba(10, 42, 61, 0.18);
  border-radius: 0.9rem;
  font-family: "Alexandria", sans-serif;
  font-size: 1rem;
  color: var(--ink-900);
  /* `outline: 0` was here. It beat the global :focus-visible ring, and the
     substitutes measured 1.22:1 for the glow and 2.30:1 for the border
     shift. 2.4.7 asks for a visible indicator, and the border change is
     kept as reinforcement rather than as the whole cue. */
  outline: 0;
  outline-offset: 2px;
}
/* The ring is drawn on focus-visible only. It sat in the base rule, so every
   field wore a 3px teal outline at rest and the one being typed in looked
   like all the others. */
.dv2-input-wrap input:focus-visible { outline: 3px solid #12525C; }
.dv2-input-wrap input:focus { border-color: var(--brand-teal, #12525C); }
.dv2-suffix {
  position: absolute;
  inset-inline-start: 0.85rem;
  inset-block-start: 50%;
  transform: translateY(-50%);
  font-size: 0.75rem;
  color: rgba(31, 31, 35, 0.65);
}

.dv2-grid-2 {
  display: grid;
  gap: 0.85rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (max-width: 600px) { .dv2-grid-2 { grid-template-columns: 1fr; } }
.dv2-grid-2 label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.84rem;
  color: rgba(31, 31, 35, 0.7);
}
.dv2-grid-2 input {
  padding: 0.7rem 1rem;
  border: 1px solid rgba(10, 42, 61, 0.18);
  border-radius: 0.9rem;
  background: var(--cream-50);
  font-family: "Alexandria", "Noto Kufi Arabic", sans-serif;
  font-size: 0.95rem;
  color: var(--ink-900);
  /* `outline: 0` was here. It beat the global :focus-visible ring, and the
     substitutes measured 1.22:1 for the glow and 2.30:1 for the border
     shift. 2.4.7 asks for a visible indicator, and the border change is
     kept as reinforcement rather than as the whole cue. */
  outline: 0;
  outline-offset: 2px;
}
.dv2-grid-2 input:focus-visible { outline: 3px solid #12525C; }
.dv2-grid-2 input:focus { border-color: var(--brand-teal, #12525C); }
.dv2-grid-2 input[aria-invalid="true"] { border-color: #c14a3a; background: #fef4f2; }

.dv2-checkbox {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.88rem;
  color: rgba(31, 31, 35, 0.78);
  cursor: pointer;
}
.dv2-checkbox input { transform: scale(1.1); accent-color: var(--green-700); }

.dv2-summary {
  background: #edf7f2;
  border: 1px solid rgba(18, 82, 92, 0.2);
  border-radius: 1rem;
  padding: 1rem 1.2rem;
}
.dv2-summary p { margin: 0; line-height: 1.7; }
.dv2-summary strong {
  font-family: "Alexandria", sans-serif;
  color: var(--green-700);
  font-size: 1.05rem;
}
.dv2-summary-hint {
  margin-top: 0.4rem !important;
  font-size: 0.78rem;
  color: rgba(31, 31, 35, 0.6);
}

.dv2-submit {
  border: 0;
  background: var(--green-700);
  color: #fff;
  font-family: "Alexandria", sans-serif;
  font-weight: 700;
  font-size: 1rem;
  padding: 1rem 1.5rem;
  border-radius: 1rem;
  cursor: pointer;
  transition: transform 180ms ease, background-color 180ms ease;
}
.dv2-submit:hover { transform: translateY(-1px); background: var(--green-600); }
.dv2-submit:disabled { opacity: 0.65; cursor: not-allowed; }

.dv2-fineprint {
  margin: -0.6rem 0 0;
  font-size: 0.74rem;
  line-height: 1.65;
  color: rgba(31, 31, 35, 0.55);
}

.dv2-success {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: #edf7f2;
  border: 1px solid rgba(10, 42, 61, 0.18);
  border-radius: 1.4rem;
  padding: 2rem;
  margin-top: 1.5rem;
}
.dv2-success h2 {
  font-family: "Alexandria", sans-serif;
  font-size: 2rem;
  color: var(--green-700);
  margin: 0;
}
.dv2-success p { margin: 0; line-height: 1.75; }
.dv2-back {
  align-self: flex-start;
  margin-top: 0.6rem;
  display: inline-block;
  padding: 0.65rem 1.2rem;
  background: #fff;
  color: var(--ink-900);
  border: 1px solid rgba(10, 42, 61, 0.18);
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
}
.dv2-back:hover { border-color: var(--green-700); }
/* ---------------------------------------------------------------- T-85 --
   The basket: the note under a path, the questions a path asks, the
   add button, and the lines already added. */

.dv2-target-note {
  margin: 0.5rem 0 0.9rem;
  padding: 0.6rem 0.85rem;
  border-radius: 0.75rem;
  background: rgba(18, 82, 92, 0.07);
  border: 1px solid rgba(18, 82, 92, 0.18);
  color: var(--green-700);
  font-size: 0.85rem;
  line-height: 1.7;
}

.dv2-fields { display: grid; gap: 0.75rem; margin-bottom: 1rem; }
.dv2-field { display: block; }
.dv2-field > span {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-900);
  margin-bottom: 0.35rem;
}
.dv2-field > span em { color: #b3261e; font-style: normal; }
.dv2-field input,
.dv2-field select,
.dv2-field textarea {
  width: 100%;
  padding: 0.75rem 0.9rem;
  border: 1px solid rgba(10, 42, 61, 0.18);
  border-radius: 0.9rem;
  background: var(--cream-50);
  color: var(--ink-900);
  font-family: "Alexandria", "Noto Kufi Arabic", sans-serif;
  font-size: 0.9rem;
}
.dv2-field small {
  display: block;
  margin-top: 0.3rem;
  color: var(--green-700);
  font-size: 0.78rem;
}

.dv2-add {
  width: 100%;
  margin: 0 0 1rem;
  padding: 0.8rem 1rem;
  border: 1px dashed rgba(18, 82, 92, 0.5);
  border-radius: 1rem;
  background: transparent;
  color: var(--green-700);
  font-family: "Alexandria", "Noto Kufi Arabic", sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.dv2-add:hover { background: rgba(18, 82, 92, 0.08); border-color: var(--green-600); }

.dv2-basket {
  margin: 0 0 1.25rem;
  border: 1px solid rgba(10, 42, 61, 0.18);
  border-radius: 1rem;
  overflow: hidden;
  background: #fff;
}
.dv2-basket h3 {
  margin: 0;
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--green-700);
  background: rgba(18, 82, 92, 0.07);
  border-bottom: 1px solid rgba(18, 82, 92, 0.18);
}
.dv2-basket ul { margin: 0; padding: 0; list-style: none; }
.dv2-basket li {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid rgba(18, 82, 92, 0.12);
}
.dv2-basket li:last-child { border-bottom: 0; }
.dv2-basket li .nm { flex: 1; font-size: 0.9rem; font-weight: 600; color: var(--ink-900); }
.dv2-basket li .nm em {
  font-style: normal;
  font-weight: 400;
  font-size: 0.78rem;
  color: var(--green-700);
}
/* The figure keeps its own direction so a Latin amount never reorders
   against the Arabic name beside it. */
.dv2-basket li .am { direction: ltr; white-space: nowrap; font-weight: 700; font-size: 0.9rem; }
.dv2-basket li .rm {
  width: 1.75rem;
  height: 1.75rem;
  flex: none;
  border: 1px solid rgba(179, 38, 30, 0.3);
  border-radius: 50%;
  background: transparent;
  color: #b3261e;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}
.dv2-basket li .rm:hover { background: rgba(179, 38, 30, 0.08); }
.dv2-basket-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.8rem 1rem;
  background: rgba(18, 82, 92, 0.07);
  border-top: 1px solid rgba(18, 82, 92, 0.18);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--ink-900);
}
.dv2-basket-total strong { direction: ltr; }
/* The line still being edited, shown in the basket so the total there is the
   whole charge rather than only the lines already added. */
.dv2-basket li.pending { background: rgba(18, 82, 92, 0.04); }
.dv2-basket li.pending .nm { font-weight: 500; }
.dv2-basket li .nm em.tag {
  font-size: 0.72rem;
  padding: 0.1rem 0.4rem;
  border-radius: 0.4rem;
  background: rgba(18, 82, 92, 0.12);
  color: var(--green-700);
}
.dv2-basket li .rm-spacer { width: 1.75rem; flex: none; }

/* ---------------------------------------------------- the progress bar --- */
/* Sits under the path note, so a donor sees where a path stands at the moment
   they are choosing it. Hidden entirely unless the server reported a real
   total — see renderProgress() in donate-v2.js. */

.dv2-progress {
  /* No margin of its own: .dv2-form is a column flexbox with gap 1.4rem, which
     already spaces this block from the note above and the fieldset below. */
  margin: 0;
  padding: 0.7rem 0.85rem;
  border-radius: 0.75rem;
  background: rgba(201, 162, 39, 0.07);
  border: 1px solid rgba(201, 162, 39, 0.25);
}

.dv2-progress-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.6rem;
  font-size: 0.85rem;
  color: var(--green-700);
  margin-bottom: 0.45rem;
}

.dv2-progress-head strong {
  font-size: 0.95rem;
  /* Brand teal, not gold: gold on this pale ground measures 4.65:1, which
     passes AA for text by a hair, and teal measures 8.3:1. */
  color: #12525C;
  /* The percentage is a number in a right-to-left line; without this the sign
     lands on the wrong side of it. */
  direction: ltr;
  unicode-bidi: isolate;
}

.dv2-progress-track {
  height: 0.55rem;
  border-radius: 999px;
  background: rgba(18, 82, 92, 0.12);
  overflow: hidden;
}

.dv2-progress-fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  /* Teal, not the brand gold. The filled portion against the unfilled track
     IS the information this control carries, so WCAG 2.1 AA 1.4.11 asks for
     3:1 between them. Gold #C9A227 on this track measures 1.99:1 and fails;
     this measures 7.2:1. Gold stays as the frame around the box.

     Solid, not a gradient: a gradient needs a direction, every CSS gradient
     direction is physical, and this page flips to LTR when the English toggle
     lands (T-37) — which would move the deep end from the start of the bar to
     its far end. A solid fill has no near and no far. */
  background: #12525C;
  transition: width 0.4s ease;
}

/* A donor who asked for less motion gets the bar, not the animation. */
@media (prefers-reduced-motion: reduce) {
  .dv2-progress-fill { transition: none; }
}

/* ---------- Required and optional field markers ----------
 *
 * The form asked for four things and told the donor which two mattered only by
 * putting «(اختياري)» in two of the labels. Parentheses inside a label read as
 * part of the label, not as a status, and the two mandatory fields carried no
 * mark at all — so the donor learned which fields were required by being
 * refused at submit. On a donation form that refusal is where people leave.
 *
 * Both states are now marked, and the key that explains the asterisk is
 * rendered ABOVE the fields. A legend placed under a form explains a symbol to
 * someone who has already guessed at it.
 *
 * Colour: --green-700 is the sheet's own accent and is already used for the
 * legend. Red would have been the reflex and would have been wrong — nothing
 * here is an error, and spending the error colour on a resting state leaves
 * the real validation message nothing louder to say.
 */
.dv2-req-key {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin: 0 0 0.85rem;
  font-size: 0.8rem;
  line-height: 1.7;
  color: rgba(31, 31, 35, 0.66);
}

.dv2-req {
  color: var(--green-700);
  font-weight: 700;
  /* The glyph sits high and small in Alexandria; nudged onto the label's own
     baseline so the row does not look like it has a typo in it. */
  font-size: 1.05em;
  line-height: 1;
  margin-inline-start: 3px;
  transform: translateY(2px);
  display: inline-block;
}

/* A quiet pill, deliberately quieter than the field label above it: this is
   permission to skip, not an instruction to read. */
.dv2-opt {
  display: inline-block;
  margin-inline-start: 8px;
  padding: 1px 8px;
  border-radius: 999px;
  background: rgba(18, 82, 92, 0.09);
  color: rgba(31, 31, 35, 0.62);
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1.7;
  vertical-align: middle;
}

/* The label was a column flex box, so its text and marker would have stacked
   one above the other. The first line becomes its own row and the input stays
   underneath. */
.dv2-grid-2 label {
  flex-flow: row wrap;
  align-items: baseline;
}
.dv2-grid-2 label > input { flex: 1 0 100%; }
.dv2-label-text { flex: 0 0 auto; }

/* The summary line lost its «·» along with the recurring label it separated,
   which left the amount and the chosen path touching with one space between
   them — «100 د.إ الصدقات» read as one phrase. The gap replaces the character
   rather than restoring it: the separation is spacing, not punctuation. */
.dv2-summary p {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 14px;
  margin: 0;
}
