.site-header,
body.modal-open .site-header {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    z-index: 999 !important;
}

.modal-backdrop {
    z-index: 1050 !important;
}

.rsa-cpa-buy-modal,
.rsa-buy-modal,
.modal {
    z-index: 1070 !important;
}

.rsa-cpa-buy-modal .modal-dialog,
.rsa-buy-modal .modal-dialog {
    max-width: 400px;
    margin: 1.25rem auto;
}

.rsa-cpa-buy-content,
.rsa-buy-content {
    border: none;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--white);
    box-shadow: var(--shadow-md);
}

.rsa-cpa-buy-header,
.rsa-buy-header {
    background: var(--teal);
    color: var(--white);
    padding: 12px 16px 16px;
}

.rsa-cpa-buy-header-top,
.rsa-buy-header-top {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    margin-bottom: 12px;
    width: 100%;
}

.rsa-buy-step-label {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.2px;
}

.rsa-buy-progress {
    width: 42px;
    height: 8px;
    border-radius: 8px;
    background: color-mix(in srgb, var(--white) 45%, transparent);
    overflow: hidden;
    display: block;
    margin-left: auto;
}

.rsa-buy-progress span {
    display: block;
    width: 55%;
    height: 100%;
    background: var(--gold);
    border-radius: 8px;
}

.rsa-cpa-buy-header-brand,
.rsa-buy-header-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.rsa-cpa-buy-back,
.rsa-buy-back {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--white);
    font-size: 20px;
    line-height: 1;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.rsa-cpa-buy-back:hover,
.rsa-buy-back:hover {
    opacity: 0.85;
}

.rsa-buy-logo {
    width: 38px;
    height: 38px;
    object-fit: contain;
    background: var(--white);
    border-radius: 50%;
    padding: 3px;
}

.rsa-buy-brand-title {
    font-family: 'Effra Trial', 'Effra', 'Poppins', sans-serif;
    font-size: 22px;
    font-weight: 800;
    color: var(--white);
    margin: 0;
    letter-spacing: 0.4px;
}

.rsa-cpa-buy-form,
.rsa-buy-form {
    display: flex;
    flex-direction: column;
    background: var(--white);
}

.rsa-cpa-buy-body,
.rsa-buy-body {
    padding: 18px 18px 8px;
    max-height: 58vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.rsa-cpa-buy-plan-chip,
.rsa-buy-plan-chip {
    margin: 0 0 4px;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--teal);
}

.rsa-buy-field {
    position: relative;
}

.rsa-buy-field-row {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.rsa-buy-field-regn {
    flex: 1 1 auto;
    min-width: 0;
}

.rsa-buy-field-year {
    flex: 0 0 108px;
}

.rsa-buy-ph {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    margin: 0;
    font-size: 14px;
    font-weight: 400;
    color: var(--text-muted);
    pointer-events: none;
    white-space: nowrap;
}

.rsa-buy-req {
    color: var(--coral);
    font-weight: 700;
}

.rsa-cpa-buy-input:focus+.rsa-buy-ph,
.rsa-cpa-buy-input:not(:placeholder-shown)+.rsa-buy-ph,
.rsa-buy-input:focus+.rsa-buy-ph,
.rsa-buy-input:not(:placeholder-shown)+.rsa-buy-ph,
.rsa-buy-select.is-filled+.rsa-buy-ph,
.rsa-buy-select:valid+.rsa-buy-ph {
    display: none;
}

.rsa-cpa-buy-input,
.rsa-buy-input {
    width: 100%;
    height: 46px;
    border: 1.5px solid var(--border-light);
    border-radius: 10px;
    padding: 0 14px;
    font-size: 14px;
    color: var(--text);
    background: var(--white);
    outline: none;
    font-family: 'Poppins', sans-serif;
}

.rsa-buy-select {
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    padding-right: 28px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23666' d='M1.4.6 6 5.2 10.6.6 12 2 6 8 0 2z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

.rsa-cpa-buy-input::placeholder,
.rsa-buy-input::placeholder {
    color: transparent;
}

.rsa-cpa-buy-input:focus,
.rsa-buy-input:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 22%, transparent);
}

.rsa-cpa-buy-input.is-invalid,
.rsa-buy-input.is-invalid {
    border-color: var(--coral);
}

.rsa-cpa-buy-footer,
.rsa-buy-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 18px 8px;
}

.rsa-cpa-buy-amount,
.rsa-buy-amount {
    font-size: 16px;
    font-weight: 800;
    color: var(--text-dark);
    white-space: nowrap;
}

.rsa-cpa-buy-pay-btn,
.rsa-buy-pay-btn {
    background: var(--teal);
    color: var(--white);
    border: none;
    border-radius: 50px;
    padding: 10px 22px;
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
    transition: transform var(--transition), background var(--transition);
}

.rsa-cpa-buy-pay-btn:hover,
.rsa-buy-pay-btn:hover {
    background: var(--coral);
    transform: translateY(-1px);
}

.rsa-cpa-buy-pay-btn:disabled,
.rsa-buy-pay-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.rsa-cpa-buy-error,
.rsa-buy-error {
    color: var(--coral);
    font-size: 12px;
    font-weight: 600;
    margin: 0 18px 8px;
    text-align: left;
}

.rsa-buy-secured {
    text-align: center;
    font-size: 11px;
    color: var(--text-muted);
    margin: 0;
    padding: 0 16px 14px;
}

@media (max-width: 575.98px) {
    .rsa-cpa-buy-modal .modal-dialog,
    .rsa-buy-modal .modal-dialog {
        max-width: 92%;
        margin: 0.75rem auto;
    }

    .rsa-cpa-buy-body,
    .rsa-buy-body {
        max-height: 46vh;
        padding: 16px 14px 8px;
    }

    .rsa-cpa-buy-footer,
    .rsa-buy-footer {
        flex-wrap: wrap;
        justify-content: center;
        padding: 10px 14px 8px;
    }

    .rsa-cpa-buy-pay-btn,
    .rsa-buy-pay-btn {
        width: 100%;
    }

    .rsa-buy-brand-title {
        font-size: 18px;
    }
}

.rsa-buy-success {
    display: none;
    padding: 28px 20px 12px;
    text-align: center;
    color: var(--teal);
    font-weight: 700;
}

.rsa-buy-success.is-visible {
    display: block;
}

.modal-backdrop.show {
    opacity: 0.55;
}

.rsa-cpa-note {
    margin: 0;
    font-size: 12px;
    color: #666;
}

.rsa-cpa-buy-modal .rsa-buy-input[type="date"]:not(.is-filled):not(:focus) {
    color: transparent;
}

.rsa-cpa-buy-modal .rsa-buy-input.is-filled + .rsa-buy-ph,
.rsa-cpa-buy-modal .rsa-buy-input[type="date"]:focus + .rsa-buy-ph,
.rsa-cpa-buy-modal .rsa-buy-input[type="date"]:valid + .rsa-buy-ph,
.rsa-cpa-buy-modal .rsa-buy-select.is-filled + .rsa-buy-ph {
    display: none;
}
