/*
 * Bank card face for the seller wallet's saved cards (.bank-card list).
 * Colours, logo and name come from the card number's first six digits
 * (bank-card.js). Sizes are in cqw so the card scales with its grid cell.
 */
.bcard {
    --c1: var(--dark-primary);
    --c2: var(--dark-secondary);
    --acc: var(--dark-soft);
    container-type: inline-size;
    position: relative;
    box-sizing: border-box;
    width: 100%;
    aspect-ratio: 85.6 / 54;                 /* ISO/IEC 7810 ID-1, a real card */
    /* ISO's 3.18 mm corner, as % of 85.6 × 54 mm. Not cqw: on the card's own
       box cqw resolves against the window, which rounded it like a pill on
       wide screens. */
    border-radius: 3.72% / 5.89%;
    overflow: hidden;
    isolation: isolate;
    color: var(--white);
    direction: rtl;
    font-family: IRANYekanX, Tahoma, sans-serif;
    cursor: pointer;
    background:
        radial-gradient(120% 90% at 100% 0%, color-mix(in srgb, var(--acc) 38%, transparent), transparent 55%),
        radial-gradient(90% 80% at 0% 110%, rgba(0, 0, 0, .35), transparent 60%),
        linear-gradient(135deg, var(--c2) 0%, var(--c1) 78%);
    box-shadow:
        0 10px 24px -8px color-mix(in srgb, var(--c1) 70%, transparent),
        0 2px 6px rgba(17, 24, 39, .12),
        inset 0 1px 0 rgba(255, 255, 255, .22);
    transition: transform .25s cubic-bezier(.34, 1.4, .64, 1), box-shadow .25s ease;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}
.bcard:hover { transform: translateY(-3px) rotate(-.4deg); }
.bcard:active { transform: translateY(-1px) scale(.99); }

/* guilloche: the fine security lines printed on real cards */
.bcard::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    opacity: .16;
    background:
        repeating-radial-gradient(circle at 18% 120%, transparent 0 3.2cqw, rgba(255, 255, 255, .55) 3.2cqw 3.45cqw),
        repeating-radial-gradient(circle at 96% -20%, transparent 0 4.4cqw, rgba(255, 255, 255, .4) 4.4cqw 4.6cqw);
    -webkit-mask: linear-gradient(115deg, #000 0%, transparent 70%);
    mask: linear-gradient(115deg, #000 0%, transparent 70%);
}
/* sheen across the top, like a laminated card */
.bcard::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    border-radius: inherit;
    background: linear-gradient(160deg, rgba(255, 255, 255, .18) 0%, rgba(255, 255, 255, 0) 38%);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1);
}

/* the bank's mark, large and faint, bleeding off the card's lower edge */
.bcard-mark {
    position: absolute;
    z-index: -1;
    left: -6cqw;
    bottom: -14cqw;
    width: 46cqw;
    height: 46cqw;
    opacity: .1;
    filter: brightness(0) invert(1);
    /* fade out at the edges, so square badge logos do not print as a box */
    -webkit-mask: radial-gradient(closest-side, #000 45%, transparent 100%);
    mask: radial-gradient(closest-side, #000 45%, transparent 100%);
}
.bcard-mark svg, .bcard-mark img { width: 100%; height: 100%; display: block; object-fit: contain; }

.bcard-top {
    position: absolute;
    top: 6cqw;
    right: 6cqw;
    left: 6cqw;
    display: flex;
    align-items: center;
    gap: 2.6cqw;
}
.bcard-logo {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 11cqw;
    height: 11cqw;
    padding: 1.4cqw;
    box-sizing: border-box;
    border-radius: 2.8cqw;
    background: var(--white);
    box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
}
.bcard-logo svg, .bcard-logo img { width: 100%; height: 100%; display: block; object-fit: contain; }
.bcard-bank {
    font-size: 5cqw;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: 0 1px 2px rgba(0, 0, 0, .25);
}
.bcard-bank small {
    display: block;
    font-size: 3.2cqw;
    font-weight: 500;
    opacity: .75;
}
.bcard-nfc {
    margin-inline-start: auto;
    width: 6cqw;
    height: 6cqw;
    opacity: .8;
    flex-shrink: 0;
}

/* EMV chip */
.bcard-chip {
    position: absolute;
    top: 21cqw;
    left: 7cqw;
    width: 12.5cqw;
    height: 9.4cqw;
    border-radius: 1.8cqw;
    background:
        linear-gradient(90deg, transparent 32%, rgba(92, 64, 6, .45) 32% 34%, transparent 34% 66%, rgba(92, 64, 6, .45) 66% 68%, transparent 68%),
        linear-gradient(0deg, transparent 30%, rgba(92, 64, 6, .45) 30% 33%, transparent 33% 67%, rgba(92, 64, 6, .45) 67% 70%, transparent 70%),
        linear-gradient(135deg, #f7e19a 0%, #d6ac45 45%, #f3d77f 70%, #b88a26 100%);
    box-shadow: inset 0 0 0 .4cqw rgba(92, 64, 6, .35), 0 1px 2px rgba(0, 0, 0, .3);
}

.bcard-num {
    position: absolute;
    left: 6cqw;
    right: 6cqw;
    top: 35cqw;
    direction: ltr;
    text-align: left;
    white-space: nowrap;
    /* real cards print Latin digits; IRANYekanX would draw Persian ones */
    font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Roboto Mono", "Liberation Mono", monospace;
    font-size: 6.6cqw;
    font-weight: 700;
    letter-spacing: .04em;
    word-spacing: .1em;
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum";
    color: #fdfdfd;
    text-shadow: 0 1px 0 rgba(0, 0, 0, .35), 0 -1px 0 rgba(255, 255, 255, .12);   /* embossed */
}

.bcard-foot {
    position: absolute;
    left: 6cqw;
    right: 6cqw;
    bottom: 5.4cqw;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 3cqw;
}
.bcard-lbl {
    display: block;
    font-size: 2.8cqw;
    font-weight: 500;
    opacity: .7;
    margin-bottom: .6cqw;
}
.bcard-iban {
    direction: ltr;
    font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Roboto Mono", "Liberation Mono", monospace;
    font-size: 3.4cqw;
    font-weight: 600;
    letter-spacing: .03em;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    opacity: .92;
}
.bcard-iban-missing {
    font-size: 3.2cqw;
    font-weight: 800;
    padding: 1cqw 2.6cqw;
    border-radius: var(--r-pill);
    color: #78350f;
    background: #fde68a;
}
.bcard-shetab {
    font-size: 3cqw;
    font-weight: 800;
    letter-spacing: .02em;
    opacity: .85;
    white-space: nowrap;
}

/* chosen for this withdrawal: gold ring and tick, as the site's gold CTA */
.bcard.selected {
    box-shadow:
        0 0 0 3px var(--white),
        0 0 0 6px var(--gold-primary, var(--gold-primary)),
        0 12px 26px -8px color-mix(in srgb, var(--c1) 70%, transparent);
}
.bcard-tick {
    position: absolute;
    z-index: 3;
    top: 5cqw;
    left: 5cqw;
    width: 8cqw;
    height: 8cqw;
    border-radius: 50%;
    display: none;
    place-items: center;
    background: var(--gold-primary, var(--gold-primary));
    box-shadow: 0 2px 6px rgba(0, 0, 0, .3);
}
.bcard-tick svg { width: 60%; height: 60%; stroke: var(--white); stroke-width: 3.2; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.bcard.selected .bcard-tick { display: grid; }
.bcard.selected .bcard-nfc { visibility: hidden; }

@media (prefers-reduced-motion: reduce) {
    .bcard { transition: none; }
    .bcard:hover, .bcard:active { transform: none; }
}
