:root {
    --fvcw-ap-purple: #5d1a88;
    --fvcw-ap-border: #d9d9df;
    --fvcw-ap-text: #1d1d24;
    --fvcw-ap-muted: #666672;
    --fvcw-ap-bg: #ffffff;
}

.fvcw-ap-modal[aria-hidden="true"] {
    display: none;
}

.fvcw-ap-modal {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: grid;
    place-items: center;
    padding: 20px;
}

.fvcw-ap-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(20, 16, 25, 0.62);
}

.fvcw-ap-modal__dialog {
    position: relative;
    z-index: 1;
    width: min(520px, 100%);
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    box-sizing: border-box;
    background: var(--fvcw-ap-bg);
    color: var(--fvcw-ap-text);
    border-radius: 16px;
    padding: 34px 30px 28px;
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.28);
    text-align: center;
}

.fvcw-ap-modal__dialog h2 {
    margin: 0 40px 8px;
    font-size: clamp(28px, 5vw, 38px);
    line-height: 1.15;
    color: var(--fvcw-ap-purple);
}

.fvcw-ap-modal__intro {
    margin: 0 auto 24px;
    max-width: 390px;
    font-size: 17px;
}

.fvcw-ap-modal__close {
    position: absolute;
    top: 10px;
    right: 14px;
    width: 40px;
    height: 40px;
    border: 0;
    background: transparent;
    color: #555;
    font-size: 34px;
    line-height: 1;
    cursor: pointer;
}

.fvcw-ap-amounts {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin: 0 0 22px;
}

.fvcw-ap-amount,
.fvcw-ap-custom-amount {
    font: inherit;
}

.fvcw-ap-amount {
    appearance: none;
    border: 2px solid var(--fvcw-ap-purple);
    border-radius: 8px;
    padding: 12px 6px;
    background: #fff;
    color: var(--fvcw-ap-purple);
    font-weight: 700;
    font-size: 18px;
    cursor: pointer;
}

.fvcw-ap-amount:hover,
.fvcw-ap-amount:focus-visible,
.fvcw-ap-amount.is-selected {
    background: var(--fvcw-ap-purple);
    color: #fff;
}

.fvcw-ap-custom-label {
    display: block;
    margin-bottom: 7px;
    text-align: left;
    font-weight: 700;
}

.fvcw-ap-custom-wrap {
    position: relative;
    margin-bottom: 14px;
}

.fvcw-ap-currency {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    color: #444;
}

.fvcw-ap-custom-amount {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid var(--fvcw-ap-border);
    border-radius: 8px;
    padding: 12px 14px 12px 32px;
    font-size: 18px;
}

.fvcw-ap-custom-amount:focus {
    outline: 3px solid rgba(93, 26, 136, 0.18);
    border-color: var(--fvcw-ap-purple);
}

.fvcw-ap-selected {
    margin: 16px 0;
    color: var(--fvcw-ap-muted);
}

.fvcw-ap-selected strong {
    color: var(--fvcw-ap-text);
}

.fvcw-ap-error {
    margin: 10px 0;
    color: #a00000;
    text-align: left;
}

.fvcw-ap-button-wrap {
    width: min(100%, 420px);
    margin: 8px auto 0;
}

#fvcw-ap-amazon-pay-button {
    width: 100%;
    min-height: 48px;
}

.fvcw-ap-loading {
    margin: 10px 0 0;
    font-size: 14px;
    color: var(--fvcw-ap-muted);
}

.fvcw-ap-sandbox-note {
    margin: 14px 0 0;
    padding: 8px 10px;
    border-radius: 7px;
    background: #f3eef8;
    font-size: 13px;
    color: #4a2861;
}

.fvcw-ap-security-note {
    margin: 12px 0 0;
    font-size: 14px;
    color: var(--fvcw-ap-muted);
}

body.fvcw-ap-modal-open {
    overflow: hidden;
}

.fvcw-ap-result {
    padding: 24px;
    border: 1px solid var(--fvcw-ap-border);
    border-radius: 12px;
    background: #fff;
}

.fvcw-ap-result h2 {
    margin-top: 0;
}

.fvcw-ap-reference {
    overflow-wrap: anywhere;
    font-size: 14px;
}

@media (max-width: 560px) {
    .fvcw-ap-modal {
        padding: 12px;
    }

    .fvcw-ap-modal__dialog {
        padding: 30px 18px 24px;
        border-radius: 12px;
    }

    .fvcw-ap-amounts {
        grid-template-columns: repeat(2, 1fr);
    }
}
