/* ================================
   Purchase Terms Content Section
================================ */

.terms-content-section {
    position: relative;
    padding: 95px 20px 110px;
    background:
        radial-gradient(circle at top left, rgba(62, 99, 215, 0.08), transparent 32%),
        linear-gradient(180deg, #ffffff 0%, #f7faff 100%);
    overflow: hidden;
}

.terms-content-container {
    position: relative;
    z-index: 2;
    max-width: 1040px;
    margin: 0 auto;
}

.terms-content-header {
    max-width: 780px;
    margin: 0 auto 46px;
    text-align: center;
}

.terms-content-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 17px;
    margin-bottom: 18px;
    border-radius: 999px;
    background: rgba(62, 99, 215, 0.1);
    color: var(--blue);
    font-size: 14px;
    font-weight: 800;
    line-height: 1.8;
}

.terms-content-title {
    margin: 0;
    color: var(--text-color);
    font-size: 38px;
    font-weight: 900;
    line-height: 1.45;
}

.terms-content-description {
    max-width: 720px;
    margin: 18px auto 0;
    color: var(--muted-text);
    font-size: 17px;
    font-weight: 400;
    line-height: 2.05;
}

/* Terms Blocks */

.terms-block {
    position: relative;
    padding: 30px 34px 32px;
    margin-bottom: 18px;
    border: 1px solid rgba(62, 99, 215, 0.11);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.88);
    box-shadow: 0 16px 42px rgba(15, 23, 42, 0.055);
    transition: transform 0.28s ease, box-shadow 0.28s ease, border-color 0.28s ease;
}

.terms-block::before {
    content: "";
    position: absolute;
    top: 28px;
    right: 0;
    width: 4px;
    height: 38px;
    border-radius: 999px 0 0 999px;
    background: var(--primary-gradient);
}

.terms-block:hover {
    transform: translateY(-3px);
    border-color: rgba(62, 99, 215, 0.22);
    box-shadow: 0 22px 54px rgba(15, 23, 42, 0.085);
}

.terms-block h3 {
    margin: 0 0 16px;
    padding-right: 14px;
    color: var(--text-color);
    font-size: 21px;
    font-weight: 900;
    line-height: 1.7;
}

.terms-block p {
    margin: 0;
    color: var(--muted-text);
    font-size: 15.8px;
    font-weight: 400;
    line-height: 2.15;
    text-align: justify;
    text-align-last: right;
}

.terms-block p + p {
    margin-top: 12px;
}

/* Important Final Block */

.terms-block-important {
    border-color: rgba(34, 197, 94, 0.22);
    background:
        linear-gradient(135deg, rgba(34, 197, 94, 0.07), rgba(255, 255, 255, 0.94));
}

.terms-block-important::before {
    background: linear-gradient(180deg, #16a34a, #22c55e);
}

.terms-block-important h3 {
    color: #15803d;
}

/* Optional: Better Reading Width For Long Text */

.terms-block > * {
    position: relative;
    z-index: 2;
}

/* ================================
   Purchase Terms Dark Mode
================================ */

body.dark .terms-content-section {
    background:
        radial-gradient(circle at top left, rgba(107, 140, 255, 0.12), transparent 32%),
        linear-gradient(180deg, #0f172a 0%, #111827 100%);
}

body.dark .terms-content-badge {
    background: rgba(107, 140, 255, 0.14);
    color: #9db2ff;
}

body.dark .terms-content-title {
    color: #f8fafc;
}

body.dark .terms-content-description {
    color: #cbd5e1;
}

body.dark .terms-block {
    border-color: rgba(148, 163, 184, 0.14);
    background: rgba(15, 23, 42, 0.72);
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.18);
}

body.dark .terms-block:hover {
    border-color: rgba(157, 178, 255, 0.28);
    box-shadow: 0 24px 58px rgba(0, 0, 0, 0.24);
}

body.dark .terms-block h3 {
    color: #f8fafc;
}

body.dark .terms-block p {
    color: #cbd5e1;
}

body.dark .terms-block-important {
    border-color: rgba(34, 197, 94, 0.28);
    background:
        linear-gradient(135deg, rgba(34, 197, 94, 0.12), rgba(15, 23, 42, 0.82));
}

body.dark .terms-block-important h3 {
    color: #86efac;
}

/* ================================
   Purchase Terms Responsive
================================ */

@media (max-width: 992px) {
    .terms-content-section {
        padding: 80px 18px 95px;
    }

    .terms-content-title {
        font-size: 34px;
    }

    .terms-block {
        padding: 28px 28px 30px;
    }
}

@media (max-width: 768px) {
    .terms-content-section {
        padding: 70px 16px 85px;
    }

    .terms-content-header {
        margin-bottom: 36px;
    }

    .terms-content-title {
        font-size: 28px;
        line-height: 1.6;
    }

    .terms-content-description {
        font-size: 15.5px;
        line-height: 2;
    }

    .terms-block {
        padding: 25px 22px 27px;
        border-radius: 14px;
    }

    .terms-block::before {
        top: 26px;
        height: 34px;
    }

    .terms-block h3 {
        padding-right: 12px;
        font-size: 18px;
        line-height: 1.8;
    }

    .terms-block p {
        font-size: 14.8px;
        line-height: 2.05;
        text-align: right;
    }
}

@media (max-width: 480px) {
    .terms-content-section {
        padding: 60px 14px 75px;
    }

    .terms-content-badge {
        padding: 7px 14px;
        font-size: 13px;
    }

    .terms-content-title {
        font-size: 24px;
    }

    .terms-content-description {
        font-size: 14.5px;
    }

    .terms-block {
        padding: 23px 18px 25px;
        margin-bottom: 15px;
        border-radius: 12px;
    }

    .terms-block::before {
        width: 3px;
        height: 30px;
    }

    .terms-block h3 {
        font-size: 16.5px;
        padding-right: 10px;
    }

    .terms-block p {
        font-size: 14px;
        line-height: 2;
    }
}
.terms-accept-checkbox-label {
    display: flex;
    flex-direction: row-reverse;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    width: 100%;
    cursor: pointer;
    user-select: none;
    direction: rtl;
}

.terms-accept-checkbox-content {
    display: block;
    min-width: 0;
    flex: 1;
    text-align: right;
}

.terms-accept-custom-checkbox {
    position: relative;
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    margin-top: 4px;
    border: 2px solid rgba(62, 99, 215, 0.35);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: inset 0 0 0 4px rgba(255, 255, 255, 1);
    transition: background 0.25s ease, border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}
/* ================================
   Terms Accept Checkbox
================================ */

.terms-accept-checkbox-box {
    margin-top: 34px;
    padding: 28px 32px;
    border: 1px solid rgba(62, 99, 215, 0.16);
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(62, 99, 215, 0.08), rgba(255, 255, 255, 0.96));
    box-shadow: 0 18px 48px rgba(15, 23, 42, 0.07);
    transition: 0.25s ease;
    direction: rtl;
}

.terms-accept-checkbox-label {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    width: 100%;
    cursor: pointer;
    user-select: none;
}

.terms-accept-checkbox-content {
    flex: 1;
    min-width: 0;
    text-align: right;
}

.terms-accept-checkbox-content strong {
    display: block;
    margin-bottom: 8px;
    color: var(--text-color, #0f172a);
    font-size: 20px;
    font-weight: 900;
    line-height: 1.7;
}

.terms-accept-checkbox-content small {
    display: block;
    color: var(--muted-text, #475569);
    font-size: 15.5px;
    font-weight: 400;
    line-height: 2;
}

/* input مخفی است، اما عملکرد اصلی checkbox را انجام می‌دهد */
.terms-accept-checkbox {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

/* این همان چک‌باکس نمایشی سمت چپ است */
.terms-accept-custom-checkbox {
    position: relative;
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    margin-top: 5px;
    border: 2px solid rgba(62, 99, 215, 0.35);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: inset 0 0 0 4px #ffffff;
    transition: 0.25s ease;
}

/* تیک داخل چک‌باکس */
.terms-accept-custom-checkbox::after {
    content: "";
    position: absolute;
    top: 4px;
    left: 8px;
    width: 7px;
    height: 13px;
    border: solid #ffffff;
    border-width: 0 3px 3px 0;
    transform: rotate(45deg) scale(0);
    transform-origin: center;
    opacity: 0;
    transition: 0.22s ease;
}

.terms-accept-checkbox-label:hover .terms-accept-custom-checkbox {
    border-color: var(--blue, #3e63d7);
    transform: translateY(-1px);
    box-shadow:
        inset 0 0 0 4px #ffffff,
        0 8px 20px rgba(62, 99, 215, 0.14);
}

/* وقتی کاربر کلیک کند، چک‌باکس سبز می‌شود */
.terms-accept-checkbox:checked + .terms-accept-custom-checkbox {
    border-color: #22c55e;
    background: linear-gradient(135deg, #16a34a, #22c55e);
    box-shadow: 0 10px 24px rgba(34, 197, 94, 0.28);
}

/* وقتی تیک خورد، علامت تیک نمایش داده می‌شود */
.terms-accept-checkbox:checked + .terms-accept-custom-checkbox::after {
    opacity: 1;
    transform: rotate(45deg) scale(1);
}

/* وقتی کل باکس تیک خورد */
.terms-accept-checkbox-box:has(.terms-accept-checkbox:checked) {
    border-color: rgba(34, 197, 94, 0.35);
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.1), rgba(255, 255, 255, 0.98));
    box-shadow: 0 20px 52px rgba(34, 197, 94, 0.12);
}

.terms-accept-checkbox:focus-visible + .terms-accept-custom-checkbox {
    outline: 3px solid rgba(62, 99, 215, 0.22);
    outline-offset: 3px;
}

/* ================================
   Dark Mode
================================ */

body.dark .terms-accept-checkbox-box {
    border-color: rgba(157, 178, 255, 0.18);
    background: linear-gradient(135deg, rgba(107, 140, 255, 0.12), rgba(15, 23, 42, 0.82));
    box-shadow: 0 20px 52px rgba(0, 0, 0, 0.2);
}

body.dark .terms-accept-checkbox-box:has(.terms-accept-checkbox:checked) {
    border-color: rgba(34, 197, 94, 0.36);
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.12), rgba(15, 23, 42, 0.86));
    box-shadow: 0 20px 52px rgba(34, 197, 94, 0.08);
}

body.dark .terms-accept-checkbox-content strong {
    color: #f8fafc;
}

body.dark .terms-accept-checkbox-content small {
    color: #cbd5e1;
}

body.dark .terms-accept-custom-checkbox {
    border-color: rgba(157, 178, 255, 0.35);
    background: #111827;
    box-shadow: inset 0 0 0 4px #111827;
}

body.dark .terms-accept-checkbox-label:hover .terms-accept-custom-checkbox {
    border-color: #9db2ff;
    box-shadow:
        inset 0 0 0 4px #111827,
        0 8px 20px rgba(157, 178, 255, 0.13);
}

body.dark .terms-accept-checkbox:checked + .terms-accept-custom-checkbox {
    border-color: #22c55e;
    background: linear-gradient(135deg, #16a34a, #22c55e);
    box-shadow: 0 10px 24px rgba(34, 197, 94, 0.28);
}

/* ================================
   Responsive
================================ */

@media (max-width: 768px) {
    .terms-accept-checkbox-box {
        padding: 24px;
        border-radius: 16px;
    }

    .terms-accept-checkbox-content strong {
        font-size: 18px;
    }

    .terms-accept-checkbox-content small {
        font-size: 14.5px;
    }
}

@media (max-width: 480px) {
    .terms-accept-checkbox-box {
        padding: 20px 18px;
        border-radius: 14px;
    }

    .terms-accept-checkbox-label {
        gap: 14px;
    }

    .terms-accept-custom-checkbox {
        width: 24px;
        height: 24px;
        margin-top: 4px;
        border-radius: 7px;
    }

    .terms-accept-custom-checkbox::after {
        top: 3px;
        left: 7px;
        width: 6px;
        height: 11px;
    }

    .terms-accept-checkbox-content strong {
        font-size: 16.5px;
    }

    .terms-accept-checkbox-content small {
        font-size: 13.8px;
        line-height: 1.9;
    }
}
