/* /buy and /buy/return in the look of the Nhmsv Pay receipt (pay-gateway 9f5677f, receipt_email_html()):
   Arabic first, English under it in grey; indigo header and footer (Pay's colour since 2026-10-21); light panels; round line icons. */
@font-face { font-family: "Plex Arabic"; font-weight: 400; font-display: swap; src: url(fonts/plex-arabic-400-arabic.woff2) format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FEFC; }
@font-face { font-family: "Plex Arabic"; font-weight: 400; font-display: swap; src: url(fonts/plex-arabic-400-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Plex Arabic"; font-weight: 700; font-display: swap; src: url(fonts/plex-arabic-700-arabic.woff2) format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FEFC; }
@font-face { font-family: "Plex Arabic"; font-weight: 700; font-display: swap; src: url(fonts/plex-arabic-700-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Plex Mono"; font-weight: 500; font-display: swap; src: url(fonts/plex-mono-500-latin.woff2) format("woff2"); }

:root {
  /* LAYOUT_WIDTH.md (nhmsv, Nasser 2026-10-26): the account's lists grow to this; forms stay at 600px */
  --content-max: 1920px;
  --g: #4338CA; --gd: #3730A3; --gdd: #312E81; --gl: #EEF2FF; --gline: #E0E7FF; --gpill: #E0E7FF; --gbtn: #C7D2FE;
  --ink: #111827; --muted: #6B7280; --line: #E5E7EB; --bg: #F3F4F6; --danger: #B91C1C;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body.pay { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.6 "Plex Arabic", Tahoma, "Segoe UI", Arial, sans-serif; padding: 24px 12px 32px; }
a { color: var(--g); }
img { max-width: 100%; }
.num { font-variant-numeric: tabular-nums; unicode-bidi: isolate; }
.code { font-family: "Plex Mono", Consolas, monospace; font-weight: 500; letter-spacing: .02em; unicode-bidi: isolate; }

/* Arabic, then English under it in grey */
.bi { display: block; }
.bi > .ar, .bi > .en { display: block; }
.bi > .en { color: var(--muted); font-family: "Segoe UI", Helvetica, Arial, sans-serif; font-size: .86em; font-weight: 400; margin-top: 2px; text-align: right; }
.bi.small { font-size: 13px; color: var(--muted); }
.bi.small > .ar { color: var(--muted); }

.sheet { max-width: 600px; margin: 0 auto; background: #fff; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }

/* the account's list pages (purchases, codes, devices, downloads, cloud copy): the cards side by side; auto-fit, so a few cards share the width */
body.pay.wide .sheet { max-width: var(--content-max); }
body.pay.wide .pbody { grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr)); align-items: start; }
body.pay.wide .pbody > :not(article) { grid-column: 1 / -1; }
body.pay.wide .plegal, body.pay.wide .plegal-org { max-width: var(--content-max); }
.phead { display: flex; align-items: center; gap: 12px; padding: 22px 28px; color: #fff; background: var(--g); background-image: linear-gradient(120deg, var(--gd) 0%, var(--g) 55%, #4F46E5 100%); }
.phead img { width: 44px; height: 44px; border: 2px solid #818CF8; border-radius: 11px; background: #fff; }
.phead b { font-size: 20px; }
.phead span { margin-inline-start: auto; color: #E0E7FF; font: 15px "Segoe UI", Helvetica, Arial, sans-serif; }

.pbody { padding: 24px 28px 8px; display: grid; gap: 16px; }

.phero { text-align: center; display: grid; justify-items: center; gap: 6px; }
.phero h1 { margin: 4px 0 0; font-size: 24px; line-height: 1.35; }
.phero h1 .ar { color: var(--gd); font-weight: 700; }
.phero h1 .en { color: var(--g); font-weight: 700; font-size: 20px; text-align: center; }
.phero p { margin: 4px 0 0; max-width: 32em; }
.phero p .en { text-align: center; }
.pbadge { width: 110px; height: 110px; }
/* payment not completed: red; still being checked or reviewed: amber */
.pstate { display: grid; place-items: center; width: 88px; height: 88px; border-radius: 50%; font: 700 42px/1 "Segoe UI", Helvetica, Arial, sans-serif; }
.phero.bad, .phero.warn { border-radius: 14px; padding: 20px 16px; }
.phero.bad { background: #FEF2F2; border: 1px solid #FECACA; }
.phero.bad .pstate { background: #FEE2E2; color: #B91C1C; box-shadow: 0 0 0 6px #FECACA; }
.phero.bad h1 .ar { color: #B91C1C; }
.phero.bad h1 .en { color: #DC2626; }
.phero.warn { background: #FFFBEB; border: 1px solid #FDE68A; }
.phero.warn .pstate { background: #FEF3C7; color: #B45309; box-shadow: 0 0 0 6px #FDE68A; }
.phero.warn h1 .ar { color: #92400E; }
.phero.warn h1 .en { color: #B45309; }

.pico { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--gl); }
.pico.white { background: #fff; }
.pico.big { width: 72px; height: 72px; border: 1px solid var(--gline); }
.pico.big img { width: 34px; height: 34px; }

.pamount { background: var(--gl); border: 1px solid var(--gline); border-radius: 14px; padding: 20px 16px; text-align: center; display: grid; justify-items: center; gap: 10px; }
.pbig { font: 700 40px/1.1 "Segoe UI", Helvetica, Arial, sans-serif; color: var(--ink); }
.pbig span { font-size: 20px; color: var(--gd); }
.ppill { display: inline-block; background: var(--gpill); border-radius: 20px; padding: 5px 16px; font-size: 13px; font-weight: 700; color: var(--gd); }

.pcard { border: 1px solid var(--line); border-radius: 14px; }
.prow { display: flex; align-items: flex-start; gap: 12px; padding: 14px 12px; }
.prow + .prow { border-top: 1px solid var(--line); }
.prow .plabel { flex: 1; font-weight: 700; font-size: 14px; }
.prow .plabel .en { font-size: 12px; white-space: nowrap; }
.prow .pval { text-align: left; font-size: 14px; max-width: 60%; }
.prow .pval .bi .ar, .prow .pval .bi .en { text-align: left; }
.prow.total .pval { font-size: 16px; }
.ptag { display: inline-block; margin-top: 4px; background: var(--gpill); color: var(--gd); border-radius: 999px; padding: 0 10px; font-size: 12px; }
.ptag .bi > span { display: inline; margin: 0; }
.ptag .bi > .en::before { content: " · "; }

/* the apps run on Android only (Nasser 2026-10-25): stated before anything is bought */
.pandroid { display: flex; align-items: center; gap: 12px; background: #ECFDF3; border: 2px solid #3DDC84; border-radius: 12px; padding: 12px 16px; }
.pandroid img { flex: none; }
.pandroid p { margin: 0; flex: 1; font-size: 14px; color: #14532D; }
.pandroid .pios { display: inline-block; margin-top: 6px; padding: 2px 10px; border-radius: 999px; background: #fff; border: 1px solid #D1D5DB; color: var(--muted); font-size: 12px; font-weight: 700; }
.ppanel { display: flex; align-items: center; gap: 12px; background: var(--gl); border: 1px solid var(--gline); border-radius: 12px; padding: 12px 16px; }
.ppanel p { margin: 0; flex: 1; font-size: 13px; color: var(--gd); font-weight: 700; }
.ppanel p .en { font-weight: 400; }

.pnote { font-size: 13px; color: var(--muted); }
.pnote .ar { color: var(--ink); }
.pnote.warn { background: #FFFBEB; border: 1px solid #FDE68A; border-radius: 12px; padding: 10px 14px; }
.pnote.warn .ar { color: #78350F; }
.pnote.ok .ar { color: var(--g); font-weight: 700; }
.perror { background: #FEF2F2; border: 1px solid #FECACA; border-radius: 12px; padding: 12px 16px; color: var(--danger); font-weight: 700; }
.perror .en { color: #B45353; font-weight: 400; }

/* the form */
.pform { display: grid; gap: 16px; }
.pplans { border: 0; margin: 0; padding: 0; display: grid; gap: 10px; }
.pplans legend { padding: 0; margin-bottom: 8px; font-weight: 700; }
.pplan { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 4px 12px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; cursor: pointer; background: #fff; }
.pplan:has(input:checked) { background: var(--gl); border-color: var(--g); box-shadow: 0 0 0 1px var(--g); }
.pplan input { width: 18px; height: 18px; accent-color: var(--g); margin: 0; }
.pplan-name b { color: var(--ink); }
.pplan-price { text-align: left; font: 700 18px "Segoe UI", Helvetica, Arial, sans-serif; white-space: nowrap; }
.pplan-price s { display: block; font-size: 13px; color: var(--muted); font-weight: 400; }
.pplan-offer { grid-column: 2 / -1; font-size: 13px; color: var(--g); }
.pplan-offer .ar { color: var(--g); font-weight: 700; }

.pfield { display: grid; gap: 6px; font-weight: 700; font-size: 14px; }
.pfield .en { font-weight: 400; font-size: 12px; }
.popt { font-weight: 400; color: var(--muted); font-size: 12px; }
/* 16px at least: a smaller field makes the iPhone zoom in on focus. :where() keeps it weak, so .otp and .codeinput apply */
input:where(:not([type="radio"]):not([type="checkbox"])) { width: 100%; font: inherit; font-size: 16px; font-weight: 400; color: var(--ink); background: #fff; border: 1px solid #D1D5DB; border-radius: 12px; padding: 11px 14px; }
input:focus-visible, button:focus-visible, a:focus-visible { outline: 2px solid var(--g); outline-offset: 2px; }
input[readonly] { background: var(--bg); }
.codeinput { font-family: "Plex Mono", Consolas, monospace; letter-spacing: .04em; }
.pcoupon { display: flex; gap: 8px; align-items: stretch; }
.pcoupon input { flex: 1; min-width: 0; }
.plink { margin: 0; font-size: 14px; }
.plink a { text-decoration: none; font-weight: 700; }
.pagree { margin: 0; font-size: 13px; }
.pdetails summary { cursor: pointer; list-style: none; font-weight: 700; color: var(--gd); border: 1px solid var(--gbtn); border-radius: 12px; padding: 10px 14px; }
.pdetails summary::-webkit-details-marker { display: none; }
.pdetails summary .en { font-weight: 400; }
.pdetails[open] { display: grid; gap: 12px; }

.pbtn { display: block; width: 100%; text-align: center; text-decoration: none; cursor: pointer; border-radius: 12px; padding: 12px 16px; font: inherit; font-weight: 700; font-size: 15px; border: 1px solid transparent; }
.pbtn .en { text-align: center; font-size: 12px; }
.pbtn.primary { background: var(--g); color: #fff; }
.pbtn.primary .en { color: #E0E7FF; }
.pbtn.primary:hover { background: var(--gd); }
.pbtn.secondary { background: #fff; border-color: var(--gbtn); color: var(--gd); }
.pbtn.small { width: auto; display: inline-block; padding: 8px 14px; font-size: 13px; }
.pbtn.small .en { font-size: 11px; }
.pbtn.copied { background: var(--gpill); }

/* after the payment */
.pcodes { border: 1px dashed var(--g); border-radius: 14px; padding: 16px; text-align: center; display: grid; gap: 8px; background: #fff; }
.pcodes-title { margin: 0; font-weight: 700; }
.pcodes-title .en { text-align: center; }
.pcode { margin: 0; }
.pcode .big { font-size: 24px; color: var(--gd); }
.pcode-actions { margin: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.pcodes .pnote .en { text-align: center; }
.pgetapp { display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: start; border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.pgetapp .qr svg { width: 140px; height: 140px; display: block; }
.pgetapp ol { margin: 0; padding-inline-start: 20px; display: grid; gap: 10px; font-size: 14px; }
.pgetapp li::marker { color: var(--g); font-weight: 700; }

.pfoot { display: flex; align-items: center; gap: 12px; margin-top: 16px; padding: 20px 28px; color: #fff; background: var(--gd); background-image: linear-gradient(120deg, var(--gdd) 0%, var(--gd) 60%, var(--g) 100%); }
.pfoot img { width: 40px; height: 40px; border-radius: 10px; }
.pfoot div { display: grid; }
.pfoot b { font: 700 14px "Segoe UI", Helvetica, Arial, sans-serif; }
.pfoot span { font-size: 13px; color: #E0E7FF; }
.pfoot a { margin-inline-start: auto; color: #fff; text-decoration: none; font: 700 13px "Segoe UI", Helvetica, Arial, sans-serif; }

.plegal { max-width: 600px; margin: 14px auto 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 16px; font-size: 12px; }
.plegal a { color: var(--muted); text-decoration: none; text-align: center; }
.plegal .en, .plegal-org .en { text-align: center; font-size: 11px; }
.plegal-org { max-width: 600px; margin: 8px auto 0; text-align: center; font-size: 11px; color: #9CA3AF; }
.plegal-org a { color: inherit; }

@media (max-width: 480px) {
  body.pay { padding: 0 0 24px; }
  .sheet { border-radius: 0; border-inline: 0; border-top: 0; }
  .phead, .pfoot { padding: 18px 16px; }
  .pbody { padding: 20px 16px 4px; }
  .pbig { font-size: 34px; }
  .pgetapp { grid-template-columns: 1fr; justify-items: center; }
  .prow .pval { max-width: 55%; }
}

/* an offer's image (its brochure), above the plans */
/* most are portrait: a moderate height, centred; tapping opens the whole image */
/* an offer's brochure: a thumbnail beside its plan, opened large in a dialog (app.js [data-zoom]) */
.pplan.has-thumb { grid-template-columns: auto 64px 1fr auto; }
.pplan.has-thumb .pplan-offer { grid-column: 3 / -1; }
.pthumb { display: block; width: 64px; height: 84px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: #f3f4f6; cursor: zoom-in; }
.pthumb img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top; }
.pthumb:focus-visible { outline: 2px solid var(--g); outline-offset: 2px; }
dialog.pzoom { padding: 0; border: 0; background: transparent; max-width: calc(100vw - 32px); max-height: calc(100vh - 32px); overflow: visible; }
dialog.pzoom::backdrop { background: rgb(15 23 42 / .75); }
dialog.pzoom img { display: block; max-width: calc(100vw - 32px); max-height: calc(100vh - 32px); width: auto; height: auto; border-radius: 14px; cursor: zoom-out; }
dialog.pzoom button { position: absolute; top: -14px; inset-inline-end: -14px; width: 36px; height: 36px; border-radius: 50%; border: 0; background: #fff; color: var(--ink); font-size: 20px; line-height: 1; cursor: pointer; box-shadow: 0 2px 8px rgb(0 0 0 / .3); }

/* customer accounts (docs/CUSTOMER_ACCOUNTS.md in nhmsv/nhmsv): the e-mail code on /buy, and /account */
.pemail { display: grid; gap: 8px; }
.pemail-row { display: flex; gap: 8px; align-items: center; }
.pemail-row input { flex: 1; min-width: 0; }
.pemail-row .pbtn.small { flex: none; }
.pemail-links { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; }
button.link { border: 0; background: none; padding: 0; font: inherit; color: var(--g); font-weight: 700; cursor: pointer; text-align: start; }
button.link .en { font-weight: 400; }
.otp { font-family: "Plex Mono", Consolas, monospace; font-size: 22px; letter-spacing: .3em; text-align: center; }
.pcenter { text-align: center; }
.pw { position: relative; display: block; }
/* the password is typed left to right, so its Show button sits at the right end, away from where the text starts */
.pw input { padding-right: 84px; }
.pw-t { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: var(--gl); color: var(--gd); border-radius: 8px; padding: 6px 10px; font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
.pacct { display: flex; align-items: center; gap: 6px 14px; flex-wrap: wrap; border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; font-size: 14px; }
.pacct a { color: var(--gd); text-decoration: none; font-weight: 700; padding: 4px 8px; border-radius: 8px; }
.pacct a[aria-current="page"] { background: var(--gl); }
.pacct a .en, .pacct button .en { font-weight: 400; font-size: 11px; }
.pacct-who { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; margin-inline-end: auto; min-width: 0; }
.pacct-who bdi { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 14em; }
.pacct-av { width: 26px; height: 26px; border-radius: 50%; background: var(--g); color: #fff; display: inline-grid; place-items: center; font-size: 13px; flex: none; }
.pacct-out { margin: 0; }
.pacct-out .link { color: var(--muted); }
.pstatus { display: inline-block; border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 700; margin-bottom: 4px; }
.pstatus .en { font-weight: 400; font-size: 11px; }
.pstatus.ok { background: #DCFCE7; color: #166534; }
.pstatus.warn { background: #FEF3C7; color: #92400E; }
.pstatus.muted { background: var(--bg); color: var(--muted); }
.porder .pval { display: grid; justify-items: end; gap: 4px; }
.pbox { padding: 14px 16px; }

/* part 2 of the customer accounts: the header link, the account's tabs, the steps, printing */
.phead .phead-acct { flex: none; color: #fff; text-decoration: none; font-size: 14px; font-weight: 700; border: 1px solid rgba(255,255,255,.45); border-radius: 999px; padding: 4px 12px; }
.phead .phead-acct span { margin: 0; color: inherit; font: inherit; }
.phead .phead-acct .en { font-weight: 400; font-size: 11px; }
.phead .phead-acct:hover { background: rgba(255,255,255,.14); }
.pacct-tabs { display: flex; flex-wrap: wrap; gap: 4px; flex-basis: 100%; border-top: 1px solid var(--line); padding-top: 8px; }
.psteps { margin: 8px 0; padding-inline-start: 22px; display: grid; gap: 6px; }
.pcard details summary { cursor: pointer; color: var(--gd); font-weight: 700; padding: 6px 0; }
.pcard details summary .en { font-weight: 400; font-size: 11px; }
/* a phone: the account's pages in a bar at the bottom, like the other platforms (four pages, then More) */
.pbottom { display: none; }
.pmore a.prow { text-decoration: none; color: inherit; }
.pmore .pchev { color: var(--muted); font-size: 22px; line-height: 1; }
[dir="ltr"] .pmore .pchev { transform: scaleX(-1); }
.pmore-mail { font-size: 13px; color: var(--muted); font-weight: 400; }
.pbtn.pout { color: #B91C1C; }
@media (max-width: 599px) {
  .pacct-bar { display: none; }
  body.pay:has(.pbottom) { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
  .pbottom { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); position: fixed; inset-inline: 0; bottom: 0; z-index: 20; min-height: 64px; padding-bottom: env(safe-area-inset-bottom); background: #fff; border-top: 1px solid var(--line); }
  .pbottom a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 44px; color: var(--muted); font-size: 11px; font-weight: 600; text-decoration: none; }
  .pbottom a[aria-current="page"] { color: var(--g); font-weight: 700; }
  .pbottom svg { width: 22px; height: 22px; }
}
@media print {
  body.pay { background: #fff; }
  .sheet { border: 0; border-radius: 0; max-width: none; }
  .noprint, .plegal, .phead-acct, .pbottom { display: none !important; }
  .phead { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
}

/* a form already sent: its buttons wait, and the pressed one shows a spinner */
form.busy button, form.busy .pbtn { cursor: progress; opacity: .65; }
button.working { position: relative; }
button.working::after { content: ""; display: inline-block; width: 14px; height: 14px; margin-inline-start: 8px; vertical-align: -2px; border: 2px solid currentColor; border-inline-end-color: transparent; border-radius: 50%; animation: pspin .7s linear infinite; }
@keyframes pspin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { button.working::after { animation: none; } }
/* /buy signed in: the account the purchase goes to */
.pbuyer .pval { text-align: end; }
.pbuyer-mail { font-size: 13px; color: var(--muted); }
.pbuyer a { color: var(--gd); font-weight: 700; font-size: 13px; text-decoration: none; }
/* the license term: lifetime, until a date (days left), ended; and Renew */
.pstatus.bad { background: #FEE2E2; color: #991B1B; }
.pterm .pval { display: grid; justify-items: end; gap: 6px; }
.pterm-left { font-size: 13px; color: var(--muted); }
.pterm-left.soon { color: #92400E; font-weight: 700; }

/* «حذف حسابي»: a red frame, and the final button in red */
.pdanger { border-color: #FECACA; }
.pbtn.danger { background: #B91C1C; border-color: #B91C1C; color: #fff; }
.pbtn.danger .en { color: #FEE2E2; }
