/* ====================================================================
   Nova payments — method list, pay button, dialogs, "We accept" strip
   Rules taken from the ABA PayWay brand guideline:
     description text #697386 · logo ≥ 20px high · 4px between logos
     10px between logo and label · 10px clear space · no effects on logos
   Set --np-accent to Nova's primary brand colour (PayWay p.6: the
   checkout colour scheme follows the merchant's primary colour).
   ==================================================================== */

.np, .np-modal {
    --np-accent: #1d5a8c;
    --np-accent-ink: #ffffff;
    --np-ink: #1b2030;
    --np-muted: #697386;       /* ABA guideline description grey */
    --np-line: #e1e5eb;
    --np-soft: #f5f7fa;
    --np-ok: #1e8a4c;
    --np-bad: #c62f3b;
    --np-radius: 10px;
}

/* ---------- method list ---------- */
.np { border: 0; margin: 0 0 8px; padding: 0; min-width: 0; }
.np__legend {
    border: 0; margin: 0 0 10px; padding: 0; width: auto;
    font-size: 15px; font-weight: 600; color: var(--np-ink);
}
.np__list {
    border: 1px solid var(--np-line);
    border-radius: var(--np-radius);
    overflow: hidden;
    background: #fff;
}
.np-row {
    position: relative;
    display: flex; align-items: center; gap: 10px;   /* logo ↔ label: 10px */
    min-height: 64px; margin: 0; padding: 12px 14px 12px 16px;
    font-weight: 400; cursor: pointer;
    border-top: 1px solid var(--np-line);
    transition: background-color .15s ease;
}
.np-row:first-child { border-top: 0; }
.np-row:hover { background: var(--np-soft); }

.np-row__radio { position: absolute; opacity: 0; pointer-events: none; }

/* selected state: accent bar on the left + tinted row */
.np-row::before {
    content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
    background: transparent; transition: background-color .15s ease;
}
.np-row:has(.np-row__radio:checked) { background: color-mix(in srgb, var(--np-accent) 6%, #fff); }
.np-row:has(.np-row__radio:checked)::before { background: var(--np-accent); }
.np-row.is-selected { background: #f1f6fb; }            /* fallback for browsers without :has */
.np-row.is-selected::before { background: var(--np-accent); }
.np-row:has(.np-row__radio:focus-visible) { outline: 2px solid var(--np-accent); outline-offset: -2px; }

.np-row__tile {
    flex: 0 0 auto;
    display: flex; align-items: center; justify-content: center;
    width: 56px; height: 44px;
    border-radius: 8px; background: var(--np-soft); color: var(--np-ink);
}
.np-row__text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.np-row__title { font-size: 15px; font-weight: 600; color: var(--np-ink); line-height: 1.25; }
.np-row__desc  { font-size: 13px; color: var(--np-muted); line-height: 1.35; }
.np-row__logos { display: flex; flex-wrap: wrap; gap: 4px; }   /* 4px between logos */
.np-row__chev  { flex: 0 0 auto; color: #9aa3b2; }
.np-row:has(.np-row__radio:checked) .np-row__chev { color: var(--np-accent); }

/* ---------- logos: official artwork, untouched ---------- */
.np-logo { display: inline-flex; align-items: center; justify-content: center; }
.np-logo img {
    display: block; height: 100%; width: auto; max-width: none;
    filter: none; box-shadow: none; transform: none;   /* guideline: no effects, no rotation */
    object-fit: contain;                                /* guideline: never stretch */
}
.np-logo--tile  { height: 40px; max-width: 52px; }
.np-logo--tile img { max-width: 52px; }
.np-logo--mini  { height: 20px; }                       /* guideline minimum height */
.np-logo--strip { height: 24px; }
.np-logo__text  { display: none; }
/* shown only if the image file is missing — neutral chip, not a brand imitation */
.np-logo--missing img { display: none; }
.np-logo--missing .np-logo__text {
    display: inline-block; padding: 2px 6px; border: 1px solid var(--np-line, #e1e5eb);
    border-radius: 4px; font-size: 11px; line-height: 14px; color: #697386; background: #fff;
}
.np-logo--tile.np-logo--missing { height: auto; }
.np-logo--tile.np-logo--missing .np-logo__text { max-width: 52px; padding: 2px 3px; font-size: 10px; line-height: 12px; text-align: center; }

/* ---------- pay button ---------- */
.np__action { margin-top: 16px; text-align: center; }
.np-pay {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    width: 100%; max-width: 360px; min-height: 52px; padding: 0 20px;
    border: 0; border-radius: var(--np-radius);
    background: var(--np-accent); color: var(--np-accent-ink);
    font: inherit; font-size: 16px; font-weight: 600; letter-spacing: .01em; cursor: pointer;
    transition: filter .15s ease;
}
.np-pay:hover { filter: brightness(1.08); }
.np-pay:focus-visible { outline: 3px solid color-mix(in srgb, var(--np-accent) 40%, #fff); outline-offset: 2px; }
.np-pay[disabled] { opacity: .55; cursor: not-allowed; filter: none; }
.np-pay.is-done, .np-pay.is-done[disabled] { background: var(--np-ok); opacity: 1; cursor: default; }
.np__note { margin: 10px auto 0; max-width: 360px; font-size: 12px; color: var(--np-muted); }

/* ---------- dialog ---------- */
.np-modal {
    position: fixed; inset: 0; z-index: 100000;
    display: flex; align-items: center; justify-content: center; padding: 16px;
    background: rgba(20, 26, 38, .55);
}
.np-modal[hidden] { display: none; }
.np-modal__box {
    width: 100%; max-width: 420px; padding: 24px;
    background: #fff; border-radius: 14px; color: var(--np-ink);
    box-shadow: 0 18px 50px rgba(15, 23, 42, .25);
    animation: np-in .18s ease-out;
}
.np-modal__icon { width: 44px; height: 44px; margin-bottom: 12px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: var(--np-soft); color: var(--np-accent); }
.np-modal__icon--ok  { background: #e6f4ec; color: var(--np-ok); }
.np-modal__icon--bad { background: #fbe9eb; color: var(--np-bad); }
.np-modal__title { margin: 0 0 6px; font-size: 18px; font-weight: 600; line-height: 1.3; }
.np-modal__body  { font-size: 14px; line-height: 1.5; color: #3d4556; }
.np-modal__body p { margin: 0 0 10px; }
.np-summary { margin: 12px 0 4px; padding: 0; list-style: none; border-top: 1px solid var(--np-line); }
.np-summary li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--np-line); font-size: 14px; }
.np-summary span:first-child { color: var(--np-muted); }
.np-summary strong { font-weight: 600; text-align: right; word-break: break-all; }
.np-summary .np-summary__total strong { font-size: 18px; }
.np-modal__actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }
.np-btn {
    min-height: 42px; padding: 0 16px; border-radius: 8px; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
    border: 1px solid var(--np-line); background: #fff; color: var(--np-ink);
}
.np-btn--primary { border-color: var(--np-accent); background: var(--np-accent); color: var(--np-accent-ink); }
.np-btn:focus-visible { outline: 2px solid var(--np-accent); outline-offset: 2px; }
.np-spinner { width: 22px; height: 22px; border-radius: 50%;
    border: 2.5px solid color-mix(in srgb, var(--np-accent) 25%, #fff); border-top-color: var(--np-accent);
    animation: np-spin .8s linear infinite; }

@keyframes np-spin { to { transform: rotate(360deg); } }
@keyframes np-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- ABA KHQR card in our own dialog (KHQR card style: red header, merchant, amount, QR) ---------- */
.np-khqr {
    width: 240px; max-width: 100%; margin: 6px auto 0;
    border-radius: 14px; background: #fff; overflow: hidden;
    box-shadow: 0 6px 24px rgba(15, 23, 42, .12);
}
.np-khqr__head {
    position: relative; height: 40px; line-height: 40px; text-align: center;
    background: #e21a1a; color: #fff; font-weight: 700; letter-spacing: .12em; font-size: 16px;
}
.np-khqr__head::after {   /* the folded corner of the KHQR card */
    content: ""; position: absolute; right: 0; bottom: -14px;
    border-top: 14px solid #e21a1a; border-left: 14px solid transparent;
}
.np-khqr__who { padding: 14px 20px 12px; border-bottom: 1px dashed #cfd5dd; text-align: left; }
.np-khqr__who span { display: block; font-size: 12px; color: var(--np-ink); }
.np-khqr__who strong { font-size: 22px; font-weight: 700; color: var(--np-ink); }
.np-khqr__who small { font-size: 11px; font-weight: 400; color: var(--np-muted); }
.np-khqr__qr { display: flex; align-items: center; justify-content: center; min-height: 196px; padding: 16px 20px 20px; }
.np-khqr__qr img, .np-khqr__qr canvas { display: block; width: 196px !important; height: 196px !important; image-rendering: pixelated; }
.np-khqr__expires { margin: 10px 0 0; text-align: center; font-size: 13px; color: var(--np-muted); font-variant-numeric: tabular-nums; }
.np-khqr__app { display: flex; align-items: center; justify-content: center; margin: 12px auto 0; max-width: 240px; text-decoration: none; }
.np-khqr__hint { margin: 12px 0 0; text-align: center; font-size: 12px; color: var(--np-muted); }

/* ---------- "We accept" strip ---------- */
.np-accept { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.np-accept__label { font-size: 13px; color: #697386; }
.np-accept__logos { display: flex; flex-wrap: wrap; gap: 4px; margin: 0; padding: 0; list-style: none; }

@media (max-width: 480px) {
    .np-row { padding: 12px; min-height: 60px; }
    .np-row__tile { width: 52px; height: 40px; }
    .np-modal { align-items: flex-end; padding: 0; }
    .np-modal__box { max-width: none; border-radius: 16px 16px 0 0; }
    .np-modal__actions .np-btn { flex: 1 1 auto; }
}
@media (prefers-reduced-motion: reduce) {
    .np-row, .np-row::before, .np-pay { transition: none; }
    .np-modal__box { animation: none; }
    .np-spinner { animation-duration: 2s; }
}