:root {
    --terms-primary: #1158c7;
    --terms-primary-dark: #0b3f98;
    --terms-ink: #13203a;
    --terms-muted: #60708b;
    --terms-line: #dce6f4;
    --terms-soft: #f4f8ff;
}

.login-body {
    min-height: 100vh;
    background:
        radial-gradient(circle at 8% 2%, rgba(34, 107, 220, .09), transparent 30rem),
        radial-gradient(circle at 94% 90%, rgba(27, 181, 159, .07), transparent 28rem),
        #f5f8fc;
}

.terms-page {
    min-height: 100vh;
    padding: clamp(16px, 3vw, 38px);
    color: var(--terms-ink);
    font-family: "Noto Kufi Arabic", sans-serif;
}

.terms-shell {
    width: min(1080px, 100%);
    margin: 0 auto;
}

.terms-header {
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 22px 32px;
    padding: clamp(24px, 5vw, 46px);
    border: 1px solid rgba(255, 255, 255, .78);
    border-radius: 28px;
    color: #fff;
    background: linear-gradient(135deg, #0b3d91 0%, #1264d5 58%, #1877e8 100%);
    box-shadow: 0 20px 48px rgba(21, 71, 148, .15);
}

.terms-header::after {
    content: "";
    position: absolute;
    inset: auto auto -105px -76px;
    width: 280px;
    height: 280px;
    border: 52px solid rgba(255, 255, 255, .08);
    border-radius: 50%;
    pointer-events: none;
}

.terms-brand {
    position: absolute;
    top: 24px;
    left: 28px;
    z-index: 1;
    padding: 7px 14px;
    border: 1px solid rgba(255, 255, 255, .28);
    border-radius: 999px;
    color: #fff;
    background: rgba(255, 255, 255, .12);
    font-size: .9rem;
    font-weight: 800;
    letter-spacing: .02em;
}

.terms-heading {
    position: relative;
    z-index: 1;
    max-width: 760px;
}

.terms-eyebrow {
    margin: 0 0 8px;
    color: #cfe1ff;
    font-size: .82rem;
    font-weight: 700;
}

.terms-heading h1 {
    margin: 0 0 16px;
    color: #fff;
    font-size: clamp(1.55rem, 4vw, 2.55rem);
    font-weight: 800;
    line-height: 1.55;
}

.terms-intro {
    max-width: 800px;
    margin: 0 0 8px;
    color: rgba(255, 255, 255, .91);
    font-size: clamp(.92rem, 2vw, 1.03rem);
    line-height: 2;
}

.terms-intro:last-child {
    margin-bottom: 0;
}

.terms-meta {
    position: relative;
    z-index: 1;
    align-self: end;
    display: grid;
    gap: 9px;
    min-width: 176px;
    margin: 0;
}

.terms-meta > div {
    padding: 11px 14px;
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: 14px;
    background: rgba(6, 39, 97, .22);
    backdrop-filter: blur(8px);
}

.terms-meta dt {
    margin-bottom: 3px;
    color: #cfe1ff;
    font-size: .71rem;
    font-weight: 600;
}

.terms-meta dd {
    margin: 0;
    color: #fff;
    font-size: .84rem;
    font-weight: 700;
}

.terms-content {
    display: grid;
    gap: 14px;
    margin-top: 18px;
}

.terms-section {
    padding: clamp(20px, 3vw, 30px);
    border: 1px solid var(--terms-line);
    border-radius: 20px;
    background: rgba(255, 255, 255, .94);
    box-shadow: 0 8px 25px rgba(40, 67, 106, .045);
}

.terms-section h2 {
    display: flex;
    align-items: center;
    gap: 11px;
    margin: 0 0 14px;
    color: var(--terms-primary-dark);
    font-size: clamp(1rem, 2.3vw, 1.2rem);
    font-weight: 800;
    line-height: 1.7;
}

.terms-section h2 span {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 11px;
    color: var(--terms-primary);
    background: #eaf2ff;
    font-size: .82rem;
}

.terms-section p,
.terms-section li {
    color: #33425c;
    font-size: clamp(.89rem, 1.75vw, .98rem);
    font-weight: 500;
    line-height: 2.05;
}

.terms-section p {
    margin: 0 0 10px;
}

.terms-section p:last-child {
    margin-bottom: 0;
}

.terms-section ul {
    display: grid;
    gap: 6px;
    margin: 8px 0 16px;
    padding-right: 24px;
}

.terms-section li::marker {
    color: var(--terms-primary);
}

.terms-acknowledgement {
    margin: 2px 0 0;
    padding: clamp(22px, 4vw, 32px);
    border: 1px solid #bcd3f8;
    border-radius: 20px;
    color: #0b3f98;
    background: linear-gradient(135deg, #edf5ff, #f7fbff);
    text-align: center;
    font-size: clamp(.95rem, 2.2vw, 1.08rem);
    line-height: 2;
}

.terms-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 18px;
    padding: 20px;
    border: 1px solid var(--terms-line);
    border-radius: 20px;
    background: #fff;
}

.terms-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 190px;
    min-height: 50px;
    padding: 11px 22px;
    border: 1px solid transparent;
    border-radius: 14px;
    text-decoration: none;
    font-size: .93rem;
    font-weight: 800;
    transition: transform .18s ease, background-color .18s ease, border-color .18s ease;
}

.terms-button:hover {
    transform: translateY(-1px);
}

.terms-button-primary,
.terms-button-primary:hover {
    color: #fff;
    background: var(--terms-primary);
}

.terms-button-secondary {
    border-color: #c9d8ed;
    color: #20436f;
    background: #f7faff;
}

.terms-button-secondary:hover {
    border-color: #aac3e7;
    color: #15365f;
    background: #eef5ff;
}

.terms-button:focus-visible {
    outline: 3px solid rgba(17, 88, 199, .25);
    outline-offset: 3px;
}

@media (max-width: 720px) {
    .terms-page {
        padding: 10px;
    }

    .terms-header {
        grid-template-columns: 1fr;
        gap: 18px;
        padding: 24px 18px 20px;
        border-radius: 21px;
    }

    .terms-brand {
        position: static;
        justify-self: start;
        padding: 6px 12px;
    }

    .terms-heading h1 {
        margin-bottom: 12px;
        font-size: 1.4rem;
        line-height: 1.65;
    }

    .terms-meta {
        grid-template-columns: 1fr 1fr;
        width: 100%;
        min-width: 0;
    }

    .terms-meta > div {
        padding: 10px 11px;
    }

    .terms-content {
        gap: 10px;
        margin-top: 10px;
    }

    .terms-section {
        padding: 18px 15px;
        border-radius: 16px;
    }

    .terms-section h2 {
        align-items: flex-start;
        gap: 9px;
        margin-bottom: 11px;
        font-size: .98rem;
    }

    .terms-section h2 span {
        width: 31px;
        height: 31px;
        border-radius: 9px;
    }

    .terms-section p,
    .terms-section li {
        font-size: .86rem;
        line-height: 2;
    }

    .terms-actions {
        flex-direction: column;
        gap: 9px;
        margin-top: 10px;
        padding: 13px;
        border-radius: 16px;
    }

    .terms-button {
        width: 100%;
        min-width: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .terms-button {
        transition: none;
    }
}

@media print {
    .login-body,
    .terms-page {
        background: #fff !important;
    }

    .terms-page {
        padding: 0;
    }

    .terms-header,
    .terms-section,
    .terms-acknowledgement {
        break-inside: avoid;
        box-shadow: none;
    }

    .terms-header {
        color: #111;
        background: #fff;
        border-color: #aaa;
    }

    .terms-header :is(h1, p, dt, dd),
    .terms-brand {
        color: #111;
    }

    .terms-actions {
        display: none;
    }
}
