/* مودال پرداخت نهایی آزمون — Bootstrap، فونت‌های yekan-bakh از typography */

/* کاهش پرش ناشی از ناپدید شدن اسکرول‌بار هنگام باز شدن مودال */
@supports (scrollbar-gutter: stable) {
    html:has(#testPayModal) {
        scrollbar-gutter: stable;
    }
}

/* انیمیشن نرم‌تر مودال (هماهنگ با بک‌دراپ) */
#testPayModal.modal.fade {
    transition: opacity 0.38s ease-out;
}

#testPayModal.modal.fade .modal-dialog {
    transition: transform 0.42s cubic-bezier(0.22, 1, 0.36, 1);
    transform: translateY(14px) scale(0.985);
}

#testPayModal.modal.show .modal-dialog {
    transform: translateY(0) scale(1);
}

#testPayModal .modal-dialog {
    max-width: min(28rem, calc(100vw - 1.5rem));
    margin: 0.75rem auto;
}

#testPayModal.test-pay-modal-root .modal-content {
    overflow: hidden;
}

.test-pay-modal {
    font-family: var(--fanum-bold);
    border-radius: 1.125rem;
    box-shadow: 0 1.5rem 3rem rgba(0, 0, 0, 0.18);
    border: 1px solid rgba(0, 168, 142, 0.12);
    max-width: 100%;
}

.test-pay-modal__header {
    padding: 1.5rem 1.5rem 0;
    border-bottom: none;
}

.test-pay-modal__header-inner {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    width: 100%;
    min-width: 0;
}

.test-pay-modal__heading {
    min-width: 0;
    flex: 1;
    text-align: right;
}

.test-pay-modal__badge {
    display: inline-block;
    padding: 0.35rem 0.85rem;
    font-family: var(--fanum-extrabold);
    font-size: 0.75rem;
    color: #00a88e;
    background: rgba(0, 168, 142, 0.1);
    border-radius: 999px;
    margin-bottom: 0.75rem;
}

.test-pay-modal__title {
    font-family: var(--fanum-extrabold) !important;
    font-size: clamp(1.15rem, 4vw, 1.5rem);
    color: #191c1d;
    line-height: 1.45;
    margin: 0;
}

.test-pay-modal__close {
    flex-shrink: 0;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: transparent;
    opacity: 0.65;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, opacity 0.2s;
}

.test-pay-modal__close:hover {
    background: rgba(0, 0, 0, 0.05);
    opacity: 1;
}

.test-pay-modal__body {
    padding: 1.5rem;
}

.test-pay-modal__price-box {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.15rem 1.25rem;
    background: #f2f4f4;
    border-radius: 0.875rem;
    border: 1px solid rgba(0, 168, 142, 0.08);
    min-width: 0;
}

.test-pay-modal__price-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.test-pay-modal__price-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: #00a88e;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.test-pay-modal__price-label {
    font-family: var(--fanum-bold);
    font-size: 0.9rem;
    color: #3f4947;
    margin: 0;
}

.test-pay-modal__price-value {
    text-align: left;
    flex-shrink: 0;
}

.test-pay-modal__price-num {
    font-family: var(--fanum-extrabold);
    font-size: clamp(1.35rem, 4.5vw, 1.65rem);
    color: #006b5a;
    letter-spacing: -0.02em;
}

.test-pay-modal__price-currency {
    font-family: var(--fanum-regular);
    font-size: 0.8rem;
    color: #3f4947;
    margin-right: 0.25rem;
}

.test-pay-modal__features {
    list-style: none;
    padding: 0;
    margin: 1.5rem 0 0;
}

.test-pay-modal__features li {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #3f4947;
    line-height: 1.7;
    font-family: var(--fanum-bold);
}

.test-pay-modal__features li + li {
    margin-top: 0.75rem;
}

.test-pay-modal__features svg {
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.test-pay-modal__agree {
    margin-top: 1.5rem;
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 0.75rem;
    cursor: pointer;
    user-select: none;
}

.test-pay-modal__checkbox-input {
    width: 1.25rem;
    height: 1.25rem;
    margin-top: 0.15rem;
    flex-shrink: 0;
    border: 1px solid rgba(0, 107, 90, 0.35);
    border-radius: 0.35rem;
    cursor: pointer;
    accent-color: #00a88e;
}

.test-pay-modal__checkbox-input:focus {
    outline: 2px solid rgba(0, 168, 142, 0.35);
    outline-offset: 2px;
}

.test-pay-modal__checkbox-input:checked {
    background-color: #00a88e;
    border-color: #00a88e;
}

.test-pay-modal__checkbox-label {
    font-size: 0.875rem;
    color: #3f4947;
    line-height: 1.75;
    font-family: var(--fanum-bold);
    cursor: pointer;
    flex: 1;
    min-width: 0;
}

.test-pay-modal__footer {
    padding: 0 1.5rem 1.5rem;
    border-top: none;
}

.test-pay-modal__submit {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 1.25rem;
    font-family: var(--fanum-extrabold) !important;
    font-size: 1rem;
    color: #fff !important;
    background: linear-gradient(135deg, #006b5a 0%, #00a88e 100%);
    border: none;
    border-radius: 0.875rem;
    box-shadow: 0 0.5rem 1.25rem rgba(0, 168, 142, 0.28);
    transition: opacity 0.2s, transform 0.15s;
}

.test-pay-modal__submit:not(:disabled):hover {
    opacity: 0.92;
}

.test-pay-modal__submit:not(:disabled):active {
    transform: scale(0.99);
}

.test-pay-modal__submit:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.test-pay-modal__footnote {
    text-align: center;
    font-family: var(--fanum-regular);
    font-size: 0.6875rem;
    color: #6c7a75;
    margin: 1rem 0 0;
    line-height: 1.6;
}

/*
 * هالهٔ طوسی ملایم — بدون backdrop-filter (در WebKit اغلب یک فلش مشکی می‌دهد).
 * این فقط در صفحه‌ای لود می‌شود که test-pay-modal.css را دارد؛ متغیرهای BS از اول فریم اعمال می‌شوند.
 */
.modal-backdrop {
    --bs-backdrop-bg: rgba(118, 120, 128, 0.36);
    --bs-backdrop-opacity: 1;
}

.modal-backdrop.fade {
    transition: opacity 0.38s ease-out;
}

@media (max-width: 575.98px) {
    .test-pay-modal__header {
        padding-top: 1.25rem;
    }
    .test-pay-modal__body,
    .test-pay-modal__footer {
        padding-left: 1.1rem;
        padding-right: 1.1rem;
    }
    .test-pay-modal__price-box {
        flex-wrap: wrap;
    }
    .test-pay-modal__price-value {
        width: 100%;
        text-align: right;
    }
}
