/* EJA Services · online payment (I76): the pay page and a payment's page (pay.js), "Pay online" on the home page and
   the account page (pay-links.js), and Admin › Payments (admin-payments.js). Colours, radii and shadows come from
   eja/eja-tokens.css. Every text wraps onto another line when it must: nothing is ever cut or hidden. */

.pay { padding-top: 24px; max-width: 900px; }
.pay-stack { display: grid; gap: 16px; min-width: 0; }
.pay-wrap-any, .pay .eja-num, .pay-item .eja-num, .pay-row .eja-num { overflow-wrap: anywhere; word-break: normal; }
.pay-badge { white-space: normal; text-align: center; }

/* ------------------------------------------------------------ the top of the pay page */
.pay-hero { display: grid; gap: 10px; }
.pay-hero h1 { font-size: clamp(24px, 5vw, 32px); font-weight: 800; line-height: 1.25; overflow-wrap: break-word; }
.pay-hero .lead { color: var(--muted); max-width: 62ch; font-size: 15.5px; }
.pay-how { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(min(190px, 100%), 1fr)); counter-reset: payhow; margin-top: 6px; }
.pay-how li { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--muted); min-width: 0; }
.pay-how li::before { counter-increment: payhow; content: counter(payhow); flex: none; display: grid; place-items: center; width: 28px; height: 28px;
  border-radius: 50%; background: var(--brand-soft); color: var(--brand); font-weight: 800; font-size: 13.5px; }
.pay-how li span { min-width: 0; padding-top: 3px; }
.pay-note { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border-radius: var(--radius-12); background: var(--brand-soft);
  color: var(--text); font-size: 14px; }
.pay-note .eja-ic { width: 18px; height: 18px; flex: none; color: var(--brand); margin-top: 2px; }
.pay-note span { min-width: 0; overflow-wrap: break-word; }
.pay-note.bad { background: var(--bad-soft); }
.pay-note.bad .eja-ic { color: var(--bad); }

/* ------------------------------------------------------------ the three steps */
.pay-step { display: grid; gap: 14px; min-width: 0; }
.pay-step-t { display: flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 800; line-height: 1.35; }
.pay-step-t > span:last-child { min-width: 0; overflow-wrap: break-word; }
.pay-n { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--brand-fill); color: var(--on-brand);
  font-size: 15px; font-weight: 800; }
.pay-sub-t { font-size: 14.5px; font-weight: 700; margin: 4px 0 -4px; }
.pay-detail { display: grid; gap: 14px; min-width: 0; }
.pay-choices { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(min(230px, 100%), 1fr)); min-width: 0; }
.pay-choice { position: relative; display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; min-width: 0;
  border: 1px solid var(--line); border-radius: var(--radius-14); background: var(--card); cursor: pointer; }
.pay-choice:hover { border-color: var(--brand); }
.pay-choice.on, .pay-choice:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); box-shadow: inset 0 0 0 1px var(--brand); }
.pay-choice:focus-within { outline: 2px solid var(--gold); outline-offset: 2px; }
.pay-choice input { flex: none; width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--brand-fill); }
.pay-choice .ic-plate { width: 36px; height: 36px; }
.pay-choice .ic-plate .eja-ic { width: 19px; height: 19px; }
.pay-choice-text { display: grid; gap: 2px; min-width: 0; flex: 1 1 auto; }
.pay-choice-text b { overflow-wrap: break-word; line-height: 1.4; }
.pay-choice-text small { color: var(--muted); font-size: 13px; line-height: 1.45; overflow-wrap: break-word; }
.pay-choice-text .badge { justify-self: start; margin-top: 2px; }
.pay-plan .pay-plan-name { font-size: 15.5px; }
.pay-price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; }
.pay-price .pay-money { font-size: 22px; font-weight: 800; color: var(--brand); line-height: 1.2; }
.pay-price small { color: var(--muted); font-size: 13px; }
.pay-lbp { color: var(--muted); font-size: 13px; }
.pay-plan-desc { margin-top: 2px; }
.pay-amount .pay-money { font-size: 19px; font-weight: 800; color: var(--brand); }
.pay-amount .pay-choice-text { gap: 0; }
.pay-inline { flex-wrap: wrap; }
.pay-inline .eja-input { flex: 1 1 180px; }
.pay-code-line { display: flex; align-items: flex-start; gap: 6px; margin-top: 6px; font-size: 13.5px; color: var(--muted2); }
.pay-code-line:empty { display: none; }
.pay-code-line .eja-ic { width: 16px; height: 16px; flex: none; margin-top: 2px; }
.pay-code-line.ok { color: var(--brand); font-weight: 700; }
.pay-code-line.bad { color: var(--bad); font-weight: 600; }
.pay-account { display: grid; gap: 14px; min-width: 0; }
.pay-signed { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; padding: 10px 12px; border-radius: var(--radius-12); background: var(--bg2); }
.pay-signed > div { display: grid; flex: 1 1 200px; min-width: 0; }
.pay-signed > div span { font-size: 13px; color: var(--muted2); }

/* ------------------------------------------------------------ the total and the button */
.pay-sum { border-color: var(--brand); }
.pay-total { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.pay-total-l { font-weight: 700; color: var(--muted); }
.pay-total-n { font-size: 28px; font-weight: 800; color: var(--brand); line-height: 1.2; }
.pay-total-n s { font-size: 17px; color: var(--muted2); font-weight: 600; }
.pay-total-lbp { flex-basis: 100%; color: var(--muted); font-size: 14px; }
.pay-total-lbp .pay-lbp { font-size: 14px; }
.pay-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.pay-go { min-height: 52px; padding: 0 26px; font-size: 16px; }
.pay-closed .contact-grid { margin-top: 4px; }

/* ------------------------------------------------------------ a payment's page */
.pay-back { display: flex; flex-wrap: wrap; gap: 6px 10px; justify-content: space-between; }
.pay-code-card { display: grid; gap: 12px; border-color: var(--brand); }
.pay-code-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; }
.pay-label { font-weight: 700; color: var(--muted); }
.pay-code { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.pay-ref { font-family: var(--font-mono); font-size: clamp(26px, 8vw, 38px); font-weight: 800; letter-spacing: .06em; color: var(--brand); line-height: 1.15; }
.pay-ref-small { font-family: var(--font-mono); font-weight: 800; letter-spacing: .04em; }
.pay-track { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 4px; }
.pay-track-i { display: flex; align-items: flex-start; gap: 8px; padding: 8px 10px; border-radius: var(--radius-12); background: var(--bg2);
  font-size: 13.5px; color: var(--muted); min-width: 0; }
.pay-track-i > span:last-child { min-width: 0; overflow-wrap: break-word; padding-top: 2px; }
.pay-track-dot { flex: none; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line);
  font-size: 12px; font-weight: 800; background: var(--card); }
.pay-track-i.done { color: var(--text); }
.pay-track-i.done .pay-track-dot { background: var(--brand-fill); border-color: var(--brand-fill); color: var(--on-brand); }
.pay-track-i.now { color: var(--text); font-weight: 700; background: var(--brand-soft); }
.pay-track-i.now .pay-track-dot { border-color: var(--brand); color: var(--brand); }
.pay-track-i.now.done .pay-track-dot, .pay-track-i:last-child.now:not(.bad) .pay-track-dot { background: var(--brand-fill); color: var(--on-brand); }
.pay-track-i.bad { background: var(--bad-soft); color: var(--bad); }
.pay-track-i.bad .pay-track-dot { border-color: var(--bad); color: var(--bad); }
@media (max-width: 520px) { .pay-track { grid-template-columns: minmax(0, 1fr); } }
.pay-card-t { margin-bottom: 10px; }
.pay-kv dd { overflow-wrap: break-word; }
.pay-ways { margin-bottom: 4px; }
.pay-ways .eja-chip { gap: 6px; }
.pay-ways .eja-ic { width: 16px; height: 16px; }
.pay-steps { list-style: none; counter-reset: paystep; display: grid; gap: 14px; margin: 4px 0 0; padding: 0; }
.pay-steps > li { counter-increment: paystep; display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 4px 10px; align-items: start; }
.pay-steps > li::before { content: counter(paystep); grid-row: 1 / span 4; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  background: var(--brand-soft); color: var(--brand); font-weight: 800; font-size: 13.5px; }
.pay-steps > li > * { grid-column: 2; min-width: 0; }
.pay-steps > li > span { padding-top: 3px; overflow-wrap: break-word; }
.pay-copyrow { display: grid; gap: 4px; padding: 8px 10px; border-radius: var(--radius-12); background: var(--bg2); min-width: 0; }
.pay-copyrow > small { color: var(--muted2); font-size: 12.5px; }
.pay-copyrow-in { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; min-width: 0; }
.pay-value { font-family: var(--font-mono); font-size: 18px; font-weight: 800; letter-spacing: .02em; min-width: 0; }
.pay-value.pay-name { font-family: inherit; letter-spacing: 0; overflow-wrap: break-word; }  /* a person's name: not a code */
.pay-key-end { font-family: var(--font-mono); font-size: 13.5px; font-weight: 700; color: var(--muted); }
.pay-or { color: var(--muted); font-size: 13.5px; }
.pay-copy { flex: none; }
.pay-to-name { color: var(--muted); font-size: 13.5px; }
.pay-receipt .form { margin-top: 4px; }
.pay-preview { display: grid; justify-items: start; }
.pay-preview img { max-width: min(320px, 100%); max-height: 320px; height: auto; border-radius: var(--radius-12); border: 1px solid var(--line); object-fit: contain; }
.pay-file { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.pay-sent { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: flex-start; padding: 12px; border-radius: var(--radius-12); background: var(--brand-soft); }
.pay-sent-text { display: grid; gap: 4px; flex: 1 1 220px; min-width: 0; }
.pay-sent-text span { color: var(--muted); font-size: 14px; }
.pay-thumb { display: grid; place-items: center; flex: none; width: 128px; max-width: 100%; min-height: 96px; border: 1px solid var(--line); border-radius: var(--radius-12);
  overflow: hidden; background: var(--card); color: var(--muted); text-decoration: none; }
.pay-thumb img { display: block; width: 100%; height: 128px; object-fit: cover; object-position: top; }
.pay-thumb-pdf, .pay-thumb-gone { gap: 6px; padding: 10px; text-align: center; font-size: 13px; }
.pay-thumb-pdf .eja-ic, .pay-thumb-gone .eja-ic { width: 26px; height: 26px; }
.pay-thumb span { overflow-wrap: anywhere; }
.pay-cancel { display: flex; justify-content: flex-end; }
.pay-done { display: flex; gap: 14px; align-items: flex-start; border-color: var(--brand); }
.pay-done-ic { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--brand-fill); color: var(--on-brand); }
.pay-done-ic .eja-ic { width: 24px; height: 24px; }
.pay-done-ic .eja-ic .m, .pay-done-ic .eja-ic .g { stroke: var(--on-brand); }
.pay-done-in { display: grid; gap: 10px; min-width: 0; flex: 1 1 auto; }
.pay-done-t { font-size: 20px; font-weight: 800; line-height: 1.3; }
.pay-key { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 10px 12px; border-radius: var(--radius-12); background: var(--brand-soft); }
.pay-key bdi { font-family: var(--font-mono); font-size: 17px; font-weight: 800; letter-spacing: .02em; min-width: 0; }
.pay-refused { border-color: var(--bad); }
.pay-reason { padding: 10px 12px; border-radius: var(--radius-12); background: var(--bad-soft); white-space: pre-line; overflow-wrap: break-word; margin-bottom: 10px; }
@media (max-width: 560px) {
  .pay-done { flex-direction: column; }
  .pay-cancel { justify-content: flex-start; }
}

/* ------------------------------------------------------------ the home page and the account page */
.pay-cta { display: flex; justify-content: center; }
.pay-cta-in { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; max-width: 760px; width: 100%; }
.pay-cta-text { display: grid; gap: 2px; flex: 1 1 260px; min-width: 0; }
.pay-cta-text span { color: var(--muted); font-size: 14px; }
.pay-row { color: inherit; text-decoration: none; }
.pay-row:hover { text-decoration: none; outline: 1px solid var(--brand); }
.pay-row .badge { flex: none; }
#payments .pay-actions { margin-bottom: 4px; }
.pay-renew { justify-self: start; margin-top: 12px; }

/* ------------------------------------------------------------ Admin › Payments */
.nav-count { margin-inline-start: auto; min-width: 22px; padding: 0 7px; border-radius: var(--radius-pill); background: var(--bad-fill); color: #fff;
  font-size: 12px; font-weight: 800; line-height: 22px; text-align: center; }
.phone-nav .nav-count { margin-inline-start: 6px; }
.pay-admin-top { display: grid; gap: 10px; }
.pay-admin-top .eja-chip { gap: 6px; }
.pay-chip-n { opacity: .8; font-weight: 700; }
.pay-off { display: flex; gap: 10px; align-items: flex-start; border-color: var(--gold); }
.pay-off .eja-ic { width: 20px; height: 20px; flex: none; color: var(--wait); margin-top: 2px; }
.pay-item-warn { border-color: var(--gold); }
.pay-item .item-top > .pay-thumb { order: 2; }
.pay-amount-t { font-weight: 800; color: var(--brand); }
.pay-way { min-height: 26px; padding: 0 10px; font-size: 12.5px; font-weight: 700; background: var(--bg2); border-color: var(--line); }
.pay-who { display: flex; flex-wrap: wrap; gap: 2px 12px; }
.pay-cnote { margin-top: 4px; padding: 6px 10px; border-radius: var(--radius-10); background: var(--bg2); font-size: 13.5px; white-space: pre-line; overflow-wrap: break-word; }
.pay-warns { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; }
.pay-warn { display: flex; gap: 8px; align-items: flex-start; padding: 6px 10px; border-radius: var(--radius-10); background: rgba(224, 161, 30, .16);
  color: var(--text); font-size: 13.5px; }
.pay-warn .eja-ic { width: 16px; height: 16px; flex: none; color: var(--wait); margin-top: 2px; }
.pay-warn > span { min-width: 0; overflow-wrap: break-word; }
.pay-warn.soft { background: var(--bg2); color: var(--muted); }
.pay-warn-ref { display: inline; margin-inline-end: 8px; }
.pay-outcome { display: flex; gap: 8px; align-items: flex-start; margin-top: 8px; font-size: 13.5px; }
.pay-outcome .eja-ic { width: 16px; height: 16px; flex: none; margin-top: 2px; }
.pay-outcome > span { min-width: 0; }
.pay-fieldset { display: grid; gap: 10px; margin: 0; padding: 12px 14px 14px; border: 1px solid var(--line); border-radius: var(--radius-12); min-width: 0; }
.pay-fieldset legend { padding: 0 6px; font-weight: 800; }
.pay-setup { display: flex; gap: 8px; align-items: flex-start; padding: 8px 12px; border-radius: var(--radius-12); font-weight: 600; font-size: 14px; }
.pay-setup .eja-ic { width: 18px; height: 18px; flex: none; margin-top: 2px; }
.pay-setup > span { min-width: 0; }
.pay-setup.ok { background: var(--brand-soft); color: var(--brand); }
.pay-setup.wait { background: rgba(224, 161, 30, .16); color: var(--wait); }
