.purchase-modal .modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.78);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 16px;
    box-sizing: border-box;
}

.purchase-modal .hidden {
    display: none !important;
}

.purchase-popap {
    position: relative;
    width: 100%;
    max-width: 433px;
    box-shadow: 0 28px 80px rgba(5, 8, 30, 0.72), 0 0 36px rgba(191, 21, 160, 0.16);
    border-radius: 20px;
    background:
        radial-gradient(circle at 50% -20%, rgba(191, 21, 160, 0.28), transparent 42%),
        linear-gradient(145deg, rgba(19, 28, 55, 0.98), rgba(8, 12, 29, 0.98));
    border: 1px solid rgba(191, 21, 160, 0.45);
    box-sizing: border-box;
    overflow: visible;
    font-family: Arial, sans-serif;
    color: #fff;
    backdrop-filter: blur(18px);
}

.purchase-popap__inner {
    padding: 28px;
    display: flex;
    flex-direction: column;
    gap: 21px;
    box-sizing: border-box;
}

.purchase-modal .button-close {
    height: 35px;
    width: 35px;
    margin: 0;
    position: absolute;
    top: 14px;
    right: 14px;
    left: auto;
    border-radius: 12.75px;
    background-color: rgba(30, 41, 57, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    border: none;
    padding: 0;
    cursor: pointer;
    color: #99a1af;
    transition:
        background-color 0.2s ease,
        color 0.2s ease,
        box-shadow 0.2s ease;
}

.purchase-modal .button-close:hover {
    color: #f87171;
    background-color: rgba(220, 38, 38, 0.28);
    box-shadow: 0 0 0 1px rgba(248, 113, 113, 0.45);
}

.purchase-modal .button-close:active {
    color: #ef4444;
    background-color: rgba(185, 28, 28, 0.4);
}

.purchase-modal .button-close:focus-visible {
    outline: 2px solid #f87171;
    outline-offset: 2px;
}

.purchase-modal .iconbase {
    display: block;
    flex-shrink: 0;
    width: 18px;
    height: 18px;
}

.purchase-btn img {
    flex-shrink: 0;
}

/* Progress */
.purchase-progress {
    display: flex;
    gap: 7px;
    justify-content: center;
    align-items: flex-start;
    width: 100%;
}

.purchase-progress__seg {
    height: 5.25px;
    border-radius: 999px;
    background: #364153;
    width: 28px;
    flex-shrink: 0;
    transition:
        width 0.25s ease,
        background 0.25s ease,
        box-shadow 0.25s ease;
}

.purchase-progress[data-purchase-progress="1"] [data-purchase-seg="1"] {
    width: 56px;
    background: linear-gradient(180deg, #bf15a0, #5c0087);
    box-shadow:
        0px 10px 15px 0px rgba(191, 21, 160, 0.5),
        0px 4px 6px 0px rgba(191, 21, 160, 0.5);
}

.purchase-progress[data-purchase-progress="2"] [data-purchase-seg="1"],
.purchase-progress[data-purchase-progress="2"] [data-purchase-seg="2"] {
    background: linear-gradient(180deg, #bf15a0, #5c0087);
}

.purchase-progress[data-purchase-progress="2"] [data-purchase-seg="2"] {
    width: 56px;
    box-shadow:
        0px 10px 15px 0px rgba(191, 21, 160, 0.5),
        0px 4px 6px 0px rgba(191, 21, 160, 0.5);
}

.purchase-progress[data-purchase-progress="3"] [data-purchase-seg="1"],
.purchase-progress[data-purchase-progress="3"] [data-purchase-seg="2"] {
    background: linear-gradient(180deg, #bf15a0, #5c0087);
}

.purchase-progress[data-purchase-progress="3"] [data-purchase-seg="3"] {
    width: 56px;
    background: linear-gradient(180deg, #bf15a0, #5c0087);
    box-shadow:
        0px 10px 15px 0px rgba(191, 21, 160, 0.5),
        0px 4px 6px 0px rgba(191, 21, 160, 0.5);
}

.purchase-progress[data-purchase-progress="4"] [data-purchase-seg="1"],
.purchase-progress[data-purchase-progress="4"] [data-purchase-seg="2"],
.purchase-progress[data-purchase-progress="4"] [data-purchase-seg="3"] {
    background: linear-gradient(180deg, #bf15a0, #5c0087);
}

.purchase-progress[data-purchase-progress="4"] [data-purchase-seg="4"] {
    width: 56px;
    background: linear-gradient(180deg, #bf15a0, #5c0087);
    box-shadow:
        0px 10px 15px 0px rgba(191, 21, 160, 0.5),
        0px 4px 6px 0px rgba(191, 21, 160, 0.5);
}

/* Typography */
.purchase-title {
    margin: 0;
    font-size: 21px;
    line-height: 28px;
    font-weight: 700;
    text-align: center;
    background: linear-gradient(90deg, #fff, #e9d4ff 50%, #fff);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.purchase-subtitle {
    margin: 0;
    font-size: 14px;
    line-height: 21px;
    color: #99a1af;
    text-align: center;
    max-width: 375px;
    align-self: center;
}

.purchase-subtitle--tight {
    padding: 0 16px;
}

/* Product card */
.purchase-card {
    position: relative;
    width: 100%;
    max-width: 375px;
    align-self: center;
}

.purchase-card--product {
    margin-top: 7px;
}

.purchase-card__glow {
    position: absolute;
    left: 0;
    top: 0;
    width: 374px;
    max-width: 100%;
    height: 296px;
    border-radius: 14px;
    background: linear-gradient(180deg, #bf15a0, #5c0087);
    opacity: 0.3;
    filter: blur(24px);
    pointer-events: none;
}

.purchase-card__border {
    position: relative;
    border-radius: 14px;
    border: 1px solid rgba(191, 21, 160, 0.3);
    background: linear-gradient(145deg, rgba(22, 35, 69, 0.95), rgba(10, 15, 34, 0.95));
    overflow: hidden;
}

.purchase-product-visual {
    position: relative;
    height: 168px;
    width: 100%;
    background: linear-gradient(145deg, #182a57, #0b1024);
}

.purchase-product-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.purchase-product-fallback {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #1e293b, #0f172a);
}

.purchase-product-fallback img {
    opacity: 0.45;
}

.purchase-product-visual__shade {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, #000 0%, rgba(0, 0, 0, 0.5) 45%, transparent 100%);
    pointer-events: none;
}

.purchase-product-meta {
    padding: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 9px;
}

.purchase-product-name {
    font-size: 17.5px;
    line-height: 24.5px;
    color: #fff;
    text-align: center;
    width: 100%;
}

.purchase-product-sub {
    font-size: 14px;
    line-height: 21px;
    color: #99a1af;
    text-align: center;
}

.purchase-product-badge {
    border-radius: 6.75px;
    padding: 2px 8px;
    font-size: 10.5px;
    line-height: 14px;
    color: #fff;
    background:
        linear-gradient(90deg, #9810fa, #155dfc) padding-box,
        linear-gradient(90deg, #030213, #030213);
    background-clip: padding-box, border-box;
    border: 1px solid transparent;
}

/* Summary */
.purchase-card--summary {
    margin-top: 7px;
}

.purchase-card__glow--soft {
    height: 215px;
    width: 375px;
    max-width: 100%;
    top: 0;
    opacity: 0.5;
    background: linear-gradient(90deg, rgba(191, 21, 160, 0.2), rgba(92, 0, 135, 0.2));
    filter: none;
}

.purchase-summary {
    position: relative;
    border-radius: 14px;
    border: 1px solid #364153;
    padding: 22px;
    background: linear-gradient(145deg, rgba(22, 35, 69, 0.92), rgba(8, 12, 29, 0.94));
    box-sizing: border-box;
}

.purchase-summary__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 21px;
    font-size: 14px;
    line-height: 21px;
}

.purchase-summary__row + .purchase-summary__row {
    margin-top: 14px;
}

.purchase-summary__row--strong .purchase-summary__label {
    font-weight: 700;
    color: #fff;
}

.purchase-summary__label {
    color: #99a1af;
    flex-shrink: 0;
}

.purchase-summary__val {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 7px;
    color: #fff;
    font-weight: 700;
    text-align: right;
}

.purchase-summary__val--deduct {
    color: #ffa2a2;
}

.purchase-summary__rule {
    height: 1px;
    background: #364153;
    margin: 14px 0;
}

.purchase-summary__reward {
    margin-top: 14px;
    padding: 15px;
    border-radius: 12.75px;
    border: 1px solid rgba(0, 201, 80, 0.3);
    background: linear-gradient(171deg, rgba(13, 84, 43, 0.3) 0%, rgba(0, 79, 59, 0.3) 100%);
    box-sizing: border-box;
}

.purchase-summary__label--reward,
.purchase-summary__val--reward {
    color: #7bf1a8;
}

.purchase-coin {
    width: 21px;
    height: 21px;
    border-radius: 8.75px;
    flex-shrink: 0;
    background-size: 14px 14px;
    background-position: center;
    background-repeat: no-repeat;
}

.purchase-coin--ap {
    background-image: linear-gradient(180deg, #bf15a0, #5c0087);
    background-color: transparent;
    position: relative;
}

.purchase-coin--ap::after {
    content: "";
    position: absolute;
    inset: 0;
    background: url("/assets/icons/coin.svg") center / 14px 14px no-repeat;
    opacity: 0.95;
}

.purchase-coin--deduct {
    background: linear-gradient(135deg, #fb2c36, #f6339a);
    position: relative;
}

.purchase-coin--deduct::after {
    content: "";
    position: absolute;
    inset: 0;
    background: url("/assets/icons/coin.svg") center / 14px 14px no-repeat;
    opacity: 0.95;
}

.purchase-coin--rp {
    background: linear-gradient(135deg, #00c950, #00bc7d);
    position: relative;
}

.purchase-coin--rp::after {
    content: "";
    position: absolute;
    inset: 0;
    background: url("/assets/icons/lightning.svg") center / 14px 14px no-repeat;
    filter: brightness(0) invert(1);
    opacity: 0.95;
}

/* Form — размеры как у login (47px поля) */
.purchase-form {
    width: 100%;
    max-width: 334px;
    align-self: center;
    display: flex;
    flex-direction: column;
    gap: 17px;
}

.purchase-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.purchase-label {
    font-size: 12.25px;
    line-height: 17.5px;
    color: #d1d5dc;
    align-self: flex-start;
}

.purchase-step2-head {
    display: flex;
    flex-direction: column;
    gap: 7px;
    align-items: stretch;
    width: 100%;
}

.purchase-subtitle--step2 {
    padding: 0 24px;
    max-width: 100%;
}

/* Подсказка под формой (Figma spmf-info) */
.purchase-info-block {
    position: relative;
    width: 100%;
    max-width: 375px;
    align-self: center;
    margin-top: 3px;
}

.purchase-info-block__glow {
    position: absolute;
    inset: -3px;
    border-radius: 12.75px;
    background: linear-gradient(90deg, rgba(43, 127, 255, 0.2), rgba(0, 184, 219, 0.2));
    filter: blur(8px);
    opacity: 0.9;
    pointer-events: none;
    z-index: 0;
}

.purchase-info-block__text {
    position: relative;
    z-index: 1;
    margin: 0;
    padding: 15px;
    border-radius: 12.75px;
    border: 1px solid rgba(43, 127, 255, 0.3);
    background: linear-gradient(170deg, rgba(28, 57, 142, 0.3) 0%, rgba(16, 78, 100, 0.3) 100%);
    font-size: 12.25px;
    line-height: 17.5px;
    color: #8ec5ff;
    text-align: center;
    box-sizing: border-box;
}

/* Кастомные выпадающие списки */
.purchase-dd {
    position: relative;
    width: 100%;
    z-index: 1;
}

.purchase-dd.open {
    z-index: 40;
}

.purchase-dd__trigger {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    height: 47px;
    padding: 10px 40px 10px 16px;
    margin: 0;
    border-radius: 12px;
    border: 1px solid #364153;
    background-color: rgba(30, 41, 57, 0.5);
    box-sizing: border-box;
    cursor: pointer;
    font-family: Arial, sans-serif;
    font-size: 14px;
    line-height: 21px;
    text-align: left;
    color: #d1d5dc;
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.purchase-dd__trigger:hover {
    border-color: #4a5568;
}

.purchase-dd__trigger:focus-visible {
    outline: none;
    border-color: rgba(191, 21, 160, 0.55);
    box-shadow: 0 0 0 1px rgba(191, 21, 160, 0.28);
}

.purchase-dd.open .purchase-dd__trigger {
    border-color: rgba(191, 21, 160, 0.55);
    box-shadow: 0 0 0 1px rgba(191, 21, 160, 0.28);
}

.purchase-dd--error .purchase-dd__trigger {
    border-color: rgba(248, 113, 113, 0.75);
    box-shadow: 0 0 0 1px rgba(248, 113, 113, 0.35);
}

.purchase-dd__lead-icon {
    flex-shrink: 0;
    color: #6a7282;
}

.purchase-dd__lead-icon--img {
    display: block;
    opacity: 0.75;
    filter: brightness(0) saturate(100%) invert(48%) sepia(8%) saturate(800%) hue-rotate(182deg);
}

.purchase-dd__value {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.purchase-dd__value--placeholder {
    color: #6a7282;
    font-size: 14px;
}

.purchase-dd__chevron {
    position: absolute;
    right: 14px;
    top: 50%;
    width: 12px;
    height: 12px;
    margin-top: -6px;
    background: url("/assets/icons/arrow-down.svg") center / contain no-repeat;
    opacity: 0.55;
    pointer-events: none;
    transition: transform 0.2s ease;
}

.purchase-dd.open .purchase-dd__chevron {
    transform: rotate(180deg);
}

.purchase-dd__list {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 6px);
    margin: 0;
    padding: 6px;
    list-style: none;
    border-radius: 12px;
    border: 1px solid #364153;
    background: linear-gradient(180deg, rgba(24, 33, 48, 0.98) 0%, rgba(15, 23, 42, 0.99) 100%);
    box-shadow:
        0 18px 40px rgba(0, 0, 0, 0.45),
        0 0 0 1px rgba(191, 21, 160, 0.12);
    max-height: 220px;
    overflow-y: auto;
    box-sizing: border-box;
}

.purchase-dd__option {
    padding: 11px 14px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 20px;
    color: #d1d5dc;
    cursor: pointer;
    transition:
        background 0.15s ease,
        color 0.15s ease;
}

.purchase-dd__option:hover,
.purchase-dd__option:focus {
    outline: none;
    background: rgba(191, 21, 160, 0.18);
    color: #fff;
}

.purchase-dd__option.is-active {
    background: rgba(191, 21, 160, 0.28);
    color: #fff;
}

.purchase-input-shell:hover {
    border-color: #4a5568;
}

.purchase-input-shell:focus-within {
    border-color: rgba(191, 21, 160, 0.55);
    box-shadow: 0 0 0 1px rgba(191, 21, 160, 0.28);
}

.purchase-input-shell {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    height: 47px;
    border-radius: 12px;
    background-color: rgba(30, 41, 57, 0.5);
    border: 1px solid #364153;
    box-sizing: border-box;
    padding: 10px 16px;
}

.purchase-input-icon {
    flex-shrink: 0;
    opacity: 0.85;
}

.purchase-input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: none;
    background: transparent;
    color: #d1d5dc;
    font-size: 14px;
    font-family: Arial, sans-serif;
}

.purchase-input::placeholder {
    color: #6a7282;
}

/* Buttons */
.purchase-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    max-width: 375px;
    align-self: center;
    margin-top: 7px;
}

.purchase-actions--step2 {
    margin-top: 10px;
}

.purchase-error {
    margin: 0 0 10px;
    padding: 9px 12px;
    border-radius: 10px;
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #fca5a5;
    font-size: 13px;
    font-family: Arial, sans-serif;
    line-height: 1.4;
}

.purchase-error.hidden {
    display: none;
}

.purchase-actions--single {
    justify-content: center;
    margin-top: 21px;
}

.purchase-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    height: 42px;
    padding: 10px 20px;
    border-radius: 12.75px;
    font-size: 14px;
    font-weight: 700;
    font-family: Arial, sans-serif;
    line-height: 21px;
    cursor: pointer;
    border: none;
    box-sizing: border-box;
    transition:
        filter 0.2s ease,
        box-shadow 0.2s ease,
        background-color 0.2s ease,
        transform 0.15s ease;
}

.purchase-btn--primary {
    flex: 1;
    min-width: 0;
    max-width: 267px;
    color: #fff;
    background: linear-gradient(180deg, #bf15a0, #a70088 50%, #5c0087);
    box-shadow:
        0px 10px 15px 0px rgba(173, 70, 255, 0.3),
        0px 4px 6px 0px rgba(173, 70, 255, 0.3);
}

.purchase-btn--primary:hover {
    filter: brightness(1.08);
    box-shadow:
        0px 12px 20px 0px rgba(173, 70, 255, 0.42),
        0px 4px 8px 0px rgba(173, 70, 255, 0.35);
}

.purchase-btn--primary:active {
    transform: translateY(1px);
    filter: brightness(0.96);
}

.purchase-btn--ghost {
    width: 98px;
    flex: 0 0 auto;
    background: #fff;
    color: #000;
}

.purchase-btn--ghost:hover {
    background: #f3f4f6;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.purchase-btn--ghost:active {
    background: #e5e7eb;
}

.purchase-btn--full {
    max-width: 334px;
    width: 100%;
    flex: none;
}

.purchase-btn:focus-visible {
    outline: 2px solid #e9d4ff;
    outline-offset: 2px;
}

/* Loader (шаг 3) */
.purchase-panel--center {
    align-items: center;
    text-align: center;
    padding: 28px 0 14px;
}

.purchase-loader {
    position: relative;
    width: 81px;
    height: 81px;
    margin-bottom: 21px;
}

.purchase-loader__ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 3px solid rgba(191, 21, 160, 0.25);
    border-top-color: #bf15a0;
    box-shadow:
        0 0 32px rgba(191, 21, 160, 0.35),
        inset 0 0 24px rgba(191, 21, 160, 0.15);
    animation: purchase-spin 0.95s linear infinite;
}

@keyframes purchase-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Завершение (шаг 4, Figma pc-main) */
.purchase-panel--complete {
    align-items: center;
    text-align: center;
    padding-bottom: 8px;
    gap: 14px;
}

.purchase-complete__hero {
    position: relative;
    width: 84px;
    height: 84px;
    margin: 0 auto 7px;
}

.purchase-complete__glow {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: #00c950;
    opacity: 0.5;
    filter: blur(40px);
    pointer-events: none;
}

.purchase-complete__badge {
    position: relative;
    width: 84px;
    height: 84px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00c950 0%, #009966 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: 0 0 28px rgba(0, 201, 80, 0.35);
    animation: purchase-pop 0.45s ease-out;
}

.purchase-complete__check {
    width: 40px;
    height: 40px;
}

.purchase-complete__titles {
    display: flex;
    flex-direction: column;
    gap: 7px;
    width: 100%;
    max-width: 375px;
}

.purchase-title--complete {
    background: linear-gradient(90deg, #fff, #b9f8cf 50%, #fff);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.purchase-subtitle--complete {
    padding: 0 16px;
}

.purchase-complete-card {
    position: relative;
    width: 100%;
    max-width: 375px;
    margin-top: 7px;
}

.purchase-complete-card__glow {
    position: absolute;
    inset: -4px -3px;
    border-radius: 12.75px;
    background: linear-gradient(90deg, rgba(0, 201, 80, 0.2), rgba(0, 188, 125, 0.2));
    filter: blur(8px);
    pointer-events: none;
    z-index: 0;
}

.purchase-complete-card__inner {
    position: relative;
    z-index: 1;
    border-radius: 12.75px;
    border: 1px solid rgba(0, 201, 80, 0.3);
    background: linear-gradient(154deg, rgba(13, 84, 43, 0.3) 0%, rgba(0, 79, 59, 0.3) 100%);
    padding: 15px 15px 14px;
    box-sizing: border-box;
}

.purchase-complete-card__head {
    text-align: center;
    font-size: 14px;
    font-weight: 700;
    line-height: 21px;
    color: #7bf1a8;
    margin-bottom: 10px;
}

.purchase-complete-rows {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.purchase-complete-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    font-size: 12.25px;
    line-height: 17.5px;
}

.purchase-complete-row__k {
    color: #99a1af;
    flex-shrink: 0;
}

.purchase-complete-row__v {
    font-weight: 700;
    color: #fff;
    text-align: right;
    word-break: break-word;
}

.purchase-complete-row__v--clip {
    max-width: 58%;
}

.purchase-complete-row__v--green {
    color: #7bf1a8;
}

.purchase-complete-row--credit {
    margin-top: 2px;
    padding-top: 8px;
    border-top: 1px solid rgba(0, 201, 80, 0.3);
}

.purchase-complete-note {
    width: 100%;
    max-width: 375px;
    margin-top: 4px;
    padding: 11px 12px;
    border-radius: 12.75px;
    border: 1px solid rgba(43, 127, 255, 0.3);
    background: rgba(43, 127, 255, 0.1);
    font-size: 10.5px;
    line-height: 14px;
    color: #8ec5ff;
    text-align: center;
    box-sizing: border-box;
}

@keyframes purchase-pop {
    0% {
        transform: scale(0.85);
        opacity: 0.5;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.purchase-panel {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
