:root {
    --bg: #c8dedd;
    --text: #181826;
    --muted: #5a5d65;
    --accent: #ff715e;
    --accent-deep: #ef5c49;
    --card: rgba(255, 255, 255, 0.24);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    width: 100%;
    min-height: 100%;
}

body {
    font-family: "Segoe UI", "Trebuchet MS", sans-serif;
    background:
        radial-gradient(circle at top, rgba(255, 255, 255, 0.24), transparent 34%),
        var(--bg);
    color: var(--text);
}

.page-terms {
    min-height: 100dvh;
}

.terms-page {
    min-height: 100dvh;
    width: min(100%, 980px);
    margin: 0 auto;
    padding: clamp(0.4rem, 1.6vh, 1rem) 1rem 2.2rem;
    display: grid;
    grid-template-rows: auto 1fr auto auto;
    gap: 0.9rem;
    justify-items: center;
    position: relative;
    isolation: isolate;
}

.terms-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(24px);
    pointer-events: none;
    z-index: 0;
}

.terms-glow-a {
    width: min(46vw, 280px);
    height: min(46vw, 280px);
    top: 8%;
    left: -8%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.18), transparent 72%);
}

.terms-glow-b {
    width: min(50vw, 320px);
    height: min(50vw, 320px);
    right: -10%;
    bottom: 10%;
    background: radial-gradient(circle, rgba(255, 113, 94, 0.16), transparent 72%);
}

.terms-card {
    width: 100%;
    padding: 1rem;
    background: var(--card);
    border-radius: 28px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    box-shadow: 0 20px 36px rgba(24, 24, 38, 0.08);
    backdrop-filter: blur(8px);
    position: relative;
    z-index: 1;
}

.terms-header {
    text-align: center;
    margin-bottom: 0.75rem;
    position: relative;
    padding-top: 0.25rem;
}

.terms-back {
    position: absolute;
    left: 0;
    top: 0;
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    color: #1b2028;
    text-decoration: none;
    font-size: 1.2rem;
    background: rgba(255, 255, 255, 0.52);
    border: 1px solid rgba(255, 255, 255, 0.46);
}

.terms-logo {
    width: min(50vw, 190px);
    height: auto;
    position: relative;
    z-index: 1;
    margin-bottom: 0.5rem;
}

.terms-kicker {
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(24, 24, 38, 0.62);
}

.terms-title {
    font-size: clamp(1.1rem, 4vw, 1.35rem);
    font-weight: 800;
    line-height: 1.15;
    margin-top: 0;
}

.terms-subtitle {
    margin-top: 0.4rem;
    font-size: clamp(0.88rem, 3.1vw, 1rem);
    color: var(--muted);
    line-height: 1.35;
    max-width: 56ch;
    margin-inline: auto;
}

.terms-summary {
    margin-top: 0.8rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.45rem;
}

.terms-pill {
    padding: 0.48rem 0.78rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.42);
    color: #252733;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.terms-updated {
    margin-top: 0.3rem;
    font-size: 0.73rem;
    color: rgba(24, 24, 38, 0.45);
    font-weight: 500;
}

.terms-updated a {
    color: inherit;
}

.terms-groups {
    display: grid;
    gap: 0.8rem;
}

.terms-section {
    background: rgba(255, 255, 255, 0.38);
    border: 1px solid rgba(255, 255, 255, 0.26);
    border-radius: 22px;
    padding: 0.9rem;
}

.terms-section-title {
    font-size: clamp(0.96rem, 2.8vw, 1.08rem);
    font-weight: 800;
    margin-bottom: 0.6rem;
    color: #252733;
}

.terms-list {
    list-style: none;
    display: grid;
    gap: 0.55rem;
    font-size: clamp(0.82rem, 2.7vw, 0.95rem);
    line-height: 1.42;
    color: #2c2f37;
    counter-reset: term;
}

.terms-list li {
    position: relative;
    padding-left: 1.55rem;
}

.terms-list li::before {
    counter-increment: term;
    content: counter(term);
    position: absolute;
    left: 0;
    top: 0.04rem;
    width: 1.05rem;
    height: 1.05rem;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 0.72rem;
    font-weight: 800;
    color: #171725;
    background: rgba(255, 113, 94, 0.2);
}

.terms-list strong {
    display: block;
    margin-bottom: 0.12rem;
    font-weight: 800;
}

.terms-actions {
    display: grid;
    justify-items: center;
    gap: 0.45rem;
    position: relative;
    z-index: 1;
}

.terms-cta {
    width: min(90vw, 320px);
    border: none;
    border-radius: 18px;
    background: linear-gradient(135deg, var(--accent), var(--accent-deep));
    color: #1a1b23;
    font-size: clamp(1rem, 4vw, 1.18rem);
    font-weight: 800;
    padding: 0.92rem 1rem;
    line-height: 1.1;
    cursor: pointer;
    box-shadow: 0 14px 24px rgba(255, 113, 94, 0.18);
}

.terms-note {
    font-size: clamp(0.76rem, 2.5vw, 0.88rem);
    text-align: center;
    color: rgba(24, 24, 38, 0.7);
    max-width: 42ch;
}

.terms-credit {
    color: rgba(255, 113, 94, 0.9);
    font-size: clamp(0.75rem, 2.6vw, 0.85rem);
    position: relative;
    z-index: 1;
}

body.theme-super-admin {
    background:
        radial-gradient(circle at top, rgba(255, 122, 96, 0.08), transparent 30%),
        linear-gradient(180deg, #091117 0%, #0d1620 100%) !important;
    color: var(--text) !important;
}

body.theme-super-admin .terms-card {
    background: linear-gradient(160deg, rgba(12, 18, 25, 0.96), rgba(18, 26, 34, 0.92)) !important;
    border-color: rgba(160, 200, 190, 0.16) !important;
    box-shadow: 0 22px 42px rgba(2, 8, 12, 0.28) !important;
}

body.theme-super-admin .terms-kicker,
body.theme-super-admin .terms-updated,
body.theme-super-admin .terms-note {
    color: rgba(223, 236, 242, 0.68) !important;
}

body.theme-super-admin .terms-back {
    background: rgba(15, 26, 35, 0.92) !important;
    border-color: rgba(160, 200, 190, 0.14) !important;
    color: #edf4f7 !important;
}

body.theme-super-admin .terms-title,
body.theme-super-admin .terms-section-title,
body.theme-super-admin .terms-list,
body.theme-super-admin .terms-list strong {
    color: var(--text) !important;
}

body.theme-super-admin .terms-subtitle {
    color: var(--text-soft) !important;
}

body.theme-super-admin .terms-section {
    background: rgba(18, 26, 34, 0.96) !important;
    border-color: rgba(160, 200, 190, 0.16) !important;
    box-shadow: 0 16px 30px rgba(2, 8, 12, 0.2) !important;
}

body.theme-super-admin .terms-pill {
    background: rgba(255, 255, 255, 0.06) !important;
    border-color: rgba(160, 200, 190, 0.14) !important;
    color: #edf4f7 !important;
}

body.theme-super-admin .terms-list li::before {
    background: rgba(255, 122, 96, 0.18) !important;
    color: #ffd1c7 !important;
}

body.theme-super-admin .terms-cta {
    background: linear-gradient(135deg, #ff7a60, #ff5f47) !important;
    color: #fff7f3 !important;
    box-shadow:
        0 0 0 1px rgba(255, 122, 96, 0.14),
        0 16px 30px rgba(255, 122, 96, 0.24) !important;
}

@media (min-width: 1024px) {
    .terms-page {
        padding: 1.8rem 2rem 2.2rem;
    }

    .terms-logo {
        width: min(18vw, 220px);
    }

    .terms-card {
        padding: 1.2rem;
    }

    .terms-groups {
        grid-template-columns: 1fr 1fr;
        align-items: start;
    }

    .terms-title {
        font-size: clamp(2rem, 2.2vw, 2.6rem);
    }

    .terms-subtitle {
        font-size: clamp(0.95rem, 1.2vw, 1.05rem);
    }

    .terms-list {
        font-size: clamp(0.9rem, 1vw, 0.98rem);
    }

    .terms-cta {
        width: min(22vw, 320px);
        font-size: clamp(1rem, 1.4vw, 1.14rem);
    }
}

@media (max-height: 700px) {
    .terms-page {
        padding-bottom: 1.6rem;
    }

    .terms-card {
        padding: 0.9rem;
    }

    .terms-groups {
        gap: 0.65rem;
    }

    .terms-section {
        padding: 0.8rem;
    }
}

@media (max-width: 640px) {
    .terms-card {
        padding: 0.9rem;
        border-radius: 24px;
    }

    .terms-header {
        padding-top: 2rem;
    }

    .terms-back {
        width: 38px;
        height: 38px;
        border-radius: 12px;
    }

    .terms-summary {
        justify-content: flex-start;
    }

    .terms-pill {
        font-size: 0.68rem;
    }
}

/* ── Touch optimizations ── */
.terms-cta { touch-action: manipulation; }
