/**
 * Terms of Service page — aligns with attorney auth pages (gradient hero, readable card).
 * Keeps existing .trm-section-class markup; styles are scoped under .bk-tos-page.
 */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&display=swap');

.bk-tos-page {
    --bk-tos-bg: #f4f6f9;
    --bk-tos-panel: #012cae;
    --bk-tos-panel-2: #0d47e8;
    --bk-tos-accent: #012cae;
    --bk-tos-text: #1e293b;
    --bk-tos-muted: #64748b;
    --bk-tos-border: #e2e8f0;
    --bk-tos-card: #ffffff;
    --bk-tos-radius: 14px;
    --bk-tos-shadow: 0 22px 55px rgba(15, 39, 68, 0.1);
    font-family: 'DM Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bk-tos-bg);
    padding-bottom: 3rem;
    min-height: 50vh;
}

.bk-tos-hero {
    background: linear-gradient(155deg, var(--bk-tos-panel) 0%, var(--bk-tos-panel-2) 52%, #021f8f 100%);
    color: #fff;
    padding: 2.75rem 1.25rem 3.25rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.bk-tos-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 70% 55% at 15% 0%, rgba(1, 44, 174, 0.35), transparent 50%),
        radial-gradient(ellipse 50% 45% at 100% 100%, rgba(255, 255, 255, 0.06), transparent 50%);
    pointer-events: none;
}

.bk-tos-hero .container {
    position: relative;
    z-index: 1;
    max-width: 880px;
}

.bk-tos-hero-badge {
    display: inline-block;
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.35);
    padding: 0.4rem 0.85rem;
    border-radius: 999px;
    margin: 0 0 0.85rem;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.15);
}

/* Sticky .bk-pub-header (terms, benefits, about): extra top space so eyebrow/title clear the bar.
   Values aligned with taller bar in bk-public-auth-header.css (inner padding + ~52px logo). */
body.terms_of_services .bk-tos-hero,
body.resources .bk-tos-hero,
body.about .bk-tos-hero {
    scroll-margin-top: 6.5rem;
    padding-top: 4.25rem;
}

.bk-tos-hero-title {
    font-size: clamp(1.65rem, 4vw, 2.15rem);
    font-weight: 700;
    margin: 0 0 0.5rem;
    line-height: 1.2;
    color: #fff;
}

.bk-tos-hero-title::after {
    content: '';
    display: block;
    width: 48px;
    height: 4px;
    margin: 1rem auto 0;
    background: linear-gradient(90deg, var(--bk-tos-accent), #3b82f6);
    border-radius: 2px;
}

.bk-tos-hero-lead {
    font-size: 1rem;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.85);
    margin: 0;
    max-width: 36rem;
    margin-left: auto;
    margin-right: auto;
}

.bk-tos-main {
    max-width: 920px;
    margin: -2.25rem auto 0;
    padding: 0 1rem;
    position: relative;
    z-index: 2;
}

.bk-tos-card {
    background: var(--bk-tos-card);
    border-radius: var(--bk-tos-radius);
    box-shadow: var(--bk-tos-shadow);
    border: 1px solid var(--bk-tos-border);
    padding: 2rem 2rem 2.5rem;
    color: var(--bk-tos-text);
}

/* Sections — keep .trm-section-class for compatibility */
.bk-tos-page .trm-section-class {
    margin-bottom: 0;
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--bk-tos-border);
}

.bk-tos-page .trm-section-class:first-of-type {
    padding-top: 0.25rem;
}

.bk-tos-page .trm-section-class:last-of-type {
    border-bottom: none;
    padding-bottom: 0.25rem;
}

.bk-tos-page .trm-section-class h1 {
    font-size: 1.2rem !important;
    font-weight: 700 !important;
    color: var(--bk-tos-text) !important;
    margin: 1rem 0 1rem !important;
    line-height: 1.35 !important;
    text-decoration: underline !important;
    text-decoration-color: rgba(1, 44, 174, 0.35) !important;
    text-underline-offset: 0.2em;
}

.bk-tos-page .trm-section-class h3 {
    font-size: 1.05rem !important;
    font-weight: 700 !important;
    color: var(--bk-tos-text) !important;
    margin: 0 0 0.85rem !important;
    text-decoration: none !important;
    line-height: 1.35 !important;
    letter-spacing: 0.02em;
}

.bk-tos-page .trm-section-class h3[style*='text-align:center'] {
    text-align: center !important;
}

.bk-tos-page .trm-section-class p {
    font-size: 0.9375rem !important;
    line-height: 1.65 !important;
    color: var(--bk-tos-text) !important;
    margin-bottom: 1rem !important;
}

.bk-tos-page .trm-section-class p:last-child {
    margin-bottom: 0 !important;
}

.bk-tos-page .trm-section-class ol,
.bk-tos-page .trm-section-class ul {
    font-size: 0.9375rem !important;
    line-height: 1.65 !important;
    padding-left: 1.35rem !important;
    margin: 0.5rem 0 1rem !important;
    color: var(--bk-tos-text) !important;
}

.bk-tos-page .trm-section-class li {
    font-size: inherit !important;
    margin-bottom: 0.35rem !important;
}

.bk-tos-page .trm-section-class i {
    color: var(--bk-tos-muted);
}

.bk-tos-back {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--bk-tos-border);
}

.bk-tos-back a {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--bk-tos-accent) !important;
    text-decoration: none !important;
}

.bk-tos-back a:hover {
    text-decoration: underline !important;
}

@media screen and (max-width: 767px) {
    .bk-tos-hero {
        padding: 2rem 1rem 2.75rem;
    }

    body.terms_of_services .bk-tos-hero,
    body.resources .bk-tos-hero,
    body.about .bk-tos-hero {
        padding-top: 2.75rem;
    }

    .bk-tos-main {
        margin-top: -1.5rem;
    }

    .bk-tos-card {
        padding: 1.35rem 1.15rem 1.75rem;
    }

    .bk-tos-page .trm-section-class {
        padding: 1.15rem 0;
    }
}
