/* Payer page: the fixed dark theme (gradient ground, one dark card, Inter). The merchant's accent fills the primary
   button, the meter and the uploaded border only, always under white text; links and accent-coloured
   text stay on the fixed light blue, so any accent remains readable. Safari 15.0 is the floor (conventions, "Payer
   page"): anything newer here (dynamic viewport units, overflow-wrap: anywhere, :focus-visible, accent-color) only
   adds to a declaration that works without it. */

@font-face { font-family: 'Inter'; font-style: normal; font-display: swap; font-weight: 100 900; src: url(../fonts/inter-cyrillic-ext-wght-normal.woff2) format('woff2'); unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }
@font-face { font-family: 'Inter'; font-style: normal; font-display: swap; font-weight: 100 900; src: url(../fonts/inter-cyrillic-wght-normal.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Inter'; font-style: normal; font-display: swap; font-weight: 100 900; src: url(../fonts/inter-latin-ext-wght-normal.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Inter'; font-style: normal; font-display: swap; font-weight: 100 900; src: url(../fonts/inter-latin-wght-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root { color-scheme: dark; color: #ffffff; background: #232333; font-family: Inter, ui-sans-serif, system-ui, sans-serif; font-size: 15px;
    --ground: radial-gradient(circle at 60% 10%, #6d7cff 0%, #232333 100%); --card: #1e2133; --surface: #272a3d; --border: #2c3050;
    --text: #ffffff; --text-secondary: #a2a3b9; --link: #4d7bf3;
    --cta-gradient: linear-gradient(90deg, #00c3ff 0%, #0096ff 50%, #00a2ff 100%); --card-shadow: 0 8px 32px 0 rgba(31, 38, 135, .25);
    --card-width: 440px; --accent: #0096ff; }
* { box-sizing: border-box; }
body { margin: 0; background: #232333; }
a { color: var(--link); }
button { font: inherit; font-weight: 500; cursor: pointer; min-height: 44px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); padding: 6px 14px; }
button:hover { border-color: var(--link); }
button:disabled { cursor: default; opacity: .6; }
button:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }
label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 500; color: var(--text-secondary); }
/* Text entry stays at 16 px whatever the label's size: below it iOS Safari zooms the page on focus. */
input, select, textarea { font: inherit; font-size: 16px; min-height: 44px; padding: 0 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); }
textarea { padding: 8px 12px; }
input[type=radio], input[type=checkbox] { min-height: 0; padding: 0; border: 0; width: 16px; height: 16px; margin: 0; accent-color: var(--link); flex: none; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--link); }
input[type=radio]:focus, input[type=checkbox]:focus { outline: 2px solid var(--link); outline-offset: 2px; }
.payer-loading, .payer-app { min-height: 100vh; min-height: 100dvh; padding: 20px 12px; background: var(--ground); }
.payment-shell { max-width: var(--card-width); margin: 0 auto; padding: 24px; border-radius: 24px; background: var(--card); box-shadow: var(--card-shadow); }
.payment-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 24px; }
.payment-header nav { display: flex; gap: 4px; }
.payment-shell__eyebrow { margin: 0; color: var(--text); font-size: 1.15rem; font-weight: 700; }
.language { border: 0; padding: 6px 8px; min-width: 44px; min-height: 40px; background: transparent; color: var(--text-secondary); }
.language:hover { color: var(--text); }
.language[aria-pressed="true"] { background: var(--surface); color: var(--text); font-weight: 600; }
h1 { margin: 0 0 24px; font-size: 1.35rem; line-height: 1.3; font-weight: 600; color: var(--text); }
h2 { margin: 24px 0 16px; font-size: 1.05rem; font-weight: 600; color: var(--text); }
p { line-height: 1.55; }
dl { margin: 0; }
dt { color: var(--text-secondary); font-size: .87rem; }
dd { margin: 0; word-break: break-word; overflow-wrap: anywhere; color: var(--text); }
.amounts { padding-bottom: 20px; border-bottom: 1px solid var(--border); }
.amounts > div { display: flex; justify-content: space-between; gap: 12px; margin-top: 10px; }
.amounts .amount-main { display: block; margin: 0 0 20px; }
.amount-main dd { margin-top: 4px; font-size: 2rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.amount-main dd span { font-size: 1rem; font-weight: 500; color: var(--text-secondary); }
.amount-main dd .amount-price { display: block; margin-top: 4px; font-size: 1rem; font-weight: 500; color: var(--text-secondary); }
.countdown { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 20px; padding: 12px 14px; border-radius: 12px; background: var(--surface); color: var(--text-secondary); font-size: .9rem; }
.countdown strong { font-size: 1.15rem; font-variant-numeric: tabular-nums; color: var(--text); }
/* On the payout page the countdown stands above the amounts, not below them. */
.countdown + .amounts { margin-top: 20px; }
.requisites { padding: 2px 14px; border-radius: 12px; background: var(--surface); }
/* A row is its label over a value line of one height, with a copy button or without: payin and payout read alike.
   The button is taller than that line and reaches a little past it, so a row stays compact and a wrapped value keeps its distance from the label. */
.requisites > div { margin: 12px 0; }
.requisites > div + div { padding-top: 12px; border-top: 1px solid var(--border); }
.requisites dd { display: flex; gap: 8px; align-items: center; justify-content: space-between; min-height: 32px; padding: 3px 0; font-weight: 600; }
.requisite-value { min-width: 0; -webkit-user-select: text; user-select: text; word-break: break-word; overflow-wrap: anywhere; font-weight: 600; }
.copy { flex-shrink: 0; font-size: .8rem; min-width: 44px; min-height: 40px; margin: -7px 0; padding: 4px 10px; border-color: transparent; background: rgba(77, 123, 243, .16); }
.copy:hover { background: rgba(77, 123, 243, .28); }
/* Crypto: the network warning is a second description of the address, an amber tint directly under it. */
.requisites dd.network-warning { display: block; min-height: 0; margin-top: 10px; padding: 10px 12px; border: 1px solid rgba(255, 193, 7, .35); border-radius: 10px; background: rgba(255, 193, 7, .12); color: #ffd166; font-size: .87rem; font-weight: 500; }
.network-warning p { margin: 0; line-height: 1.45; }
.network-warning strong { color: #ffffff; }
.copy-amount { width: 100%; margin-top: 8px; }
/* The result keeps one reserved line, so nothing jumps on copy; the hint follows it closely, so the empty line reads as a paragraph gap. */
.copy-result { min-height: 18px; margin: 6px 0 0; color: var(--text-secondary); font-size: .85rem; line-height: 18px; }
.copy-result + .hint { margin-top: 2px; }
.hint { color: var(--text-secondary); font-size: .85rem; margin-bottom: 0; }
/* The project's hint under crypto details: the merchant's own text, its line breaks kept, a long address wrapped. */
.payer-hint { margin: 14px 0 0; color: var(--text-secondary); font-size: .85rem; white-space: pre-line; word-break: break-word; overflow-wrap: anywhere; }
/* Notices and warnings are tints of the card: a translucent fill, a border of the same hue, text light enough for 4.5:1. */
.notice { padding: 12px 14px; border: 1px solid rgba(77, 123, 243, .3); border-radius: 12px; background: rgba(77, 123, 243, .12); }
.expired { border-color: rgba(255, 193, 7, .35); background: rgba(255, 193, 7, .12); color: #ffd166; }
/* Before the first answer a connection notice has no card to sit in: it stands on the ground above the skeleton, where a phone shows it. */
.payer-app > .notice { max-width: var(--card-width); margin: 0 auto 16px; border-color: var(--border); background: var(--card); }
@media (min-width: 600px) { .payer-loading, .payer-app { padding-top: 7vh; } }
@media (max-width: 576px) { .payment-shell { border-radius: 16px; } }
@media (max-width: 350px) { .payment-shell { padding: 18px; } .amount-main dd { font-size: 1.75rem; } }

.brand-logo { max-width: 80px; max-height: 48px; object-fit: contain; }
/* The code is dark on a transparent ground: it keeps a white plate on the dark card. */
.payment-qr { display: block; width: 100%; max-width: 280px; margin: 20px auto; padding: 10px; border-radius: 18px; background: #ffffff; }
.unpaid-warning { background: rgba(255, 107, 107, .12); color: #ffb3b3; border: 1px solid rgba(255, 107, 107, .35); border-radius: 12px; padding: 12px 14px; margin-bottom: 20px; }
.unpaid-warning p { margin: 0; }
.unpaid-warning--strong { background: rgba(255, 82, 82, .28); color: #ffffff; border-color: #ff5252; }
.unpaid-warning--strong p + p { margin-top: 10px; }
.exact-warning { background: rgba(255, 193, 7, .12); color: #ffd166; border: 1px solid rgba(255, 193, 7, .35); padding: 12px 14px; border-radius: 12px; }
.exact-warning strong { color: #ffffff; }
/* The primary action: the cyan gradient while the project keeps the default accent, the merchant's own colour otherwise. */
.payment-shell--accent-gradient { --primary-fill: var(--cta-gradient); --primary-glow: 0 4px 16px 0 rgba(0, 195, 255, .3); }
.payment-shell--accent-solid { --primary-fill: var(--accent); --primary-glow: 0 4px 16px 0 rgba(0, 0, 0, .3); }
.confirm-payment { width: 100%; min-height: 52px; margin: 20px 0 12px; border: 0; border-radius: 12px; background: var(--primary-fill, var(--accent)); box-shadow: var(--primary-glow, none); color: #ffffff; font-size: 1.05rem; font-weight: 600; }
.confirm-payment:hover { filter: brightness(.92); }
/* On a redirect page "Continue to payment" is the primary action, so "I paid" steps back to an outlined button. */
.confirm-payment--secondary, .confirm-payment--secondary:hover { min-height: 44px; border: 1px solid var(--border); background: var(--surface); box-shadow: none; color: var(--text); font-size: 1rem; font-weight: 500; filter: none; }
.confirm-payment--secondary:hover { border-color: var(--link); }
.close-payment { width: 100%; margin-top: 12px; }
.return-merchant { display: block; margin-top: 20px; color: var(--link); min-height: 44px; }
/* The two primary links: "Continue to payment" on a redirect page, "Open in wallet" under crypto details on a phone. */
.redirect-payment, .open-wallet { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 52px; margin-top: 20px; padding: 12px 16px; border-radius: 12px; background: var(--primary-fill, var(--accent)); color: #ffffff; font-size: 1.1rem; font-weight: 700; text-align: center; text-decoration: none; box-shadow: var(--primary-glow, none); }
.redirect-payment:hover, .open-wallet:hover { filter: brightness(.92); }
.redirect-payment:focus-visible, .open-wallet:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }
.still-waiting, .searching { color: var(--text-secondary); }
.history-item { padding: 16px 0; border-bottom: 1px solid var(--border); }
.history-item time { color: var(--text-secondary); font-size: .87rem; }
.history-item + button { margin-top: 16px; }
/* The history page's own failure message carries no class: it takes the error tint here. */
.payment-shell > p[role=alert]:not([class]) { padding: 12px 14px; border: 1px solid rgba(255, 107, 107, .35); border-radius: 12px; background: rgba(255, 107, 107, .12); color: #ffb3b3; }

/* Proof upload wizard. The grids take one column that may shrink: a file input must not widen the card on a narrow phone. */
.proofs { margin-top: 24px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
/* Inside the two grids the gap spaces the parts: headings and paragraphs give up their own margins. */
.proofs > h2, .appeal > h2 { margin: 0 0 2px; }
.proofs > p, .appeal > p { margin: 0; }
.proof { padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; }
.proof--uploaded { border-color: var(--accent); }
.proof label { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: baseline; }
.proof__name { font-weight: 600; color: var(--text); }
.proof__requirement { color: var(--text-secondary); font-size: .85rem; }
.proof__done { color: var(--link); font-size: .85rem; font-weight: 600; }
.proof input[type=file] { flex-basis: 100%; width: 100%; max-width: 100%; padding: 0; border: 0; background: transparent; color: var(--text-secondary); font-size: .87rem; }
/* The native file button as a secondary button. Two rules: a browser drops a whole selector list over one pseudo-element it does not know. */
input[type=file]::file-selector-button { font: inherit; font-size: 1rem; font-weight: 500; cursor: pointer; min-height: 44px; margin-right: 12px; padding: 6px 14px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); }
input[type=file]::-webkit-file-upload-button { font: inherit; font-size: 1rem; font-weight: 500; cursor: pointer; min-height: 44px; margin-right: 12px; padding: 6px 14px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); }
.approval-meter p { margin: 0 0 6px; display: flex; justify-content: space-between; }
.approval-meter .hint { display: block; margin: 8px 0 0; }
.approval-meter__bar { height: 8px; background: var(--border); border-radius: 4px; overflow: hidden; }
.approval-meter__fill { height: 100%; background: var(--accent); transition: width .3s; }
.dont-wait { justify-self: start; }
.dont-wait + .hint { margin-top: -6px; }
.upload-error { border-color: rgba(255, 107, 107, .35); background: rgba(255, 107, 107, .12); color: #ffb3b3; }
.appeal { margin-top: 24px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.appeal-form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.appeal-form fieldset { min-width: 0; margin: 0; border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px; display: grid; gap: 6px; }
/* Overrides the stacked label: the radio sits left of its text, text left-aligned and wrapping beside it. */
.appeal-reason { display: flex; flex-direction: row; align-items: flex-start; gap: 10px; padding: 4px 0; font-size: 15px; font-weight: 400; color: var(--text); text-align: left; cursor: pointer; }
.appeal-reason input[type=radio] { margin-top: 2px; }
.appeal-field { display: grid; gap: 4px; }
.appeal-comment { padding: 10px 14px; border-left: 3px solid var(--link); border-radius: 0 8px 8px 0; background: var(--surface); }

/* Success check on a credited payment, on the fixed cyan gradient. */
.success-check { width: 80px; height: 80px; margin: 0 auto 20px; }
.success-check svg { display: block; width: 80px; height: 80px; border-radius: 50%; background: var(--cta-gradient); box-shadow: 0 8px 32px 0 rgba(0, 195, 255, .3); animation: payer-check-bounce .6s ease-in-out; }
.success-check path { stroke: #ffffff; stroke-width: 3; stroke-miterlimit: 10; stroke-dasharray: 48; stroke-dashoffset: 48; animation: payer-check-draw .5s cubic-bezier(.65, 0, .45, 1) .2s forwards; }
.success-check + h1 { text-align: center; }
@keyframes payer-check-draw { to { stroke-dashoffset: 0; } }
@keyframes payer-check-bounce { 0%, 20%, 53%, 80%, 100% { transform: scale(1); } 40%, 43% { transform: scale(1.1); } }

/* Three-ring loader: in the skeleton, and above the searching message. */
.ring-loader { position: relative; width: 60px; height: 60px; margin: 28px auto; }
.ring-loader span { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 3px solid transparent; border-radius: 50%; animation: payer-spin 2s linear infinite; }
.ring-loader span:nth-child(1) { border-top-color: #4d7bf3; }
.ring-loader span:nth-child(2) { top: 12.5%; left: 12.5%; width: 75%; height: 75%; border-right-color: #00c3ff; animation-delay: -.4s; }
.ring-loader span:nth-child(3) { top: 25%; left: 25%; width: 50%; height: 50%; border-bottom-color: #0096ff; animation-delay: -.8s; }
@keyframes payer-spin { to { transform: rotate(360deg); } }

/* Loading skeleton: index.html paints it before WebAssembly starts and the pages keep it until their first answer
   (PayerSkeleton.razor, the same markup). Each bar stands where a part of the payment view with card details will be,
   at that part's height and distance (brand, title, amount, fee rows, countdown, details, the three buttons), so the
   card keeps its height when the view arrives. The loader sits beside the amount, out of the flow. */
.payer-skeleton .payment-shell { position: relative; }
.payer-skeleton .ring-loader { position: absolute; top: 136px; right: 24px; margin: 0; }
@media (max-width: 350px) { .payer-skeleton .ring-loader { top: 130px; right: 18px; } }
.skeleton-bar { display: block; position: relative; overflow: hidden; border-radius: 8px; background: var(--surface); transform: translateZ(0); }
.skeleton-bar::after { content: ""; position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .1), transparent); transform: translateX(-100%); animation: payer-shimmer 1.5s infinite; }
.skeleton-bar--brand { width: 96px; height: 18px; margin-top: 11px; }
.skeleton-bar--title { width: 62%; height: 26px; margin-top: 35px; }
.skeleton-bar--label { width: 22%; height: 14px; margin-top: 25px; }
.skeleton-bar--amount { width: 44%; height: 34px; margin-top: 7px; }
.skeleton-bar--fee { height: 15px; margin-top: 22px; }
.skeleton-bar--fee + .skeleton-bar--fee { margin-top: 14px; }
.skeleton-bar--countdown { height: 45px; margin-top: 43px; border-radius: 12px; }
.skeleton-bar--heading { width: 40%; height: 18px; margin-top: 25px; }
.skeleton-bar--details { height: 222px; margin-top: 16px; border-radius: 12px; }
.skeleton-bar--copy { height: 44px; margin-top: 8px; }
.skeleton-bar--hint { width: 80%; height: 14px; margin-top: 31px; }
.skeleton-bar--primary { height: 52px; margin-top: 31px; border-radius: 12px; }
.skeleton-bar--secondary { height: 44px; margin-top: 24px; }
@keyframes payer-shimmer { to { transform: translateX(100%); } }

/* "Powered by Paylix" pill under the card; in the skeleton an empty pill of the same size. */
.powered-by { display: flex; align-items: center; justify-content: center; gap: 6px; width: -webkit-fit-content; width: fit-content; min-height: 38px; margin: 16px auto 0; padding: 8px 20px; border: 1px solid rgba(77, 123, 243, .25); border-radius: 50px; background: rgba(30, 33, 51, .6); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); color: var(--text-secondary); font-size: .75rem; line-height: 1.2; letter-spacing: .02em; }
.powered-by strong { color: #00c3ff; font-size: .875rem; font-weight: 600; background: var(--cta-gradient); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.powered-by--placeholder { width: 152px; }

/* The card fades in once, with the skeleton's first paint; the views that replace the skeleton fade their content into
   the standing card, so nothing blinks when WebAssembly takes over or the first answer arrives. */
.payer-loading .payer-skeleton { animation: payer-fade-in .5s ease-in; }
.payer-app > .payment-shell > * { animation: payer-content-in .4s ease-out; }
@keyframes payer-fade-in { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes payer-content-in { from { opacity: 0; } to { opacity: 1; } }

/* The message payer.js shows in place of the skeleton when the app cannot start: a plain card. Hidden means hidden,
   whatever display a rule here gives the element, and also where a browser has no rule of its own for the attribute.
   Without JavaScript nothing can swap the two, so the noscript copy of the message lies over the whole page, loader included. */
[hidden] { display: none !important; }
.payer-unsupported p:last-child { margin-bottom: 0; }
.payer-noscript { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 1; overflow: auto; }

/* The field paylix.copy selects where the asynchronous clipboard is missing: on screen for the copy command, yet unseen.
   Fixed, so focusing it scrolls nothing; 16 px, so iOS does not zoom. */
.copy-source { position: fixed; top: 0; left: 0; width: 1px; height: 1px; min-height: 0; padding: 0; border: 0; opacity: 0; font-size: 16px; }

/* Kept for screen readers while the skeleton shows. */
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (prefers-reduced-motion: reduce) {
    .payer-loading .payer-skeleton, .payer-app > .payment-shell > *, .ring-loader span, .skeleton-bar::after, .success-check svg, .success-check path { animation: none; }
    .success-check path { stroke-dashoffset: 0; }
    .approval-meter__fill { transition: none; }
}
