/* ==========================================================
   ByteBooks - Public Pages (Privacy / Legal / Support)
   Cool animated scrollable design
   ========================================================== */

:root {
    --p-brand: #2563eb;
    --p-brand-2: #7c3aed;
    --p-ink: #0f172a;
    --p-muted: #64748b;
    --p-bg: #f8fafc;
    --p-line: #e2e8f0;
    --p-card: #ffffff;
    --p-grad: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
    --p-radius: 18px;
    --p-shadow: 0 20px 50px -20px rgba(37, 99, 235, .35);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body.p-page:not(.app-body) {
    margin: 0;
    font-family: "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
    color: var(--p-ink);
    background: var(--p-bg);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

body.p-page:not(.app-body) a { color: var(--p-brand); text-decoration: none; }
body.p-page:not(.app-body) a:hover { text-decoration: underline; }
body.p-page:not(.app-body) img { max-width: 100%; }

/* ---------------- Top Nav ---------------- */

.p-top {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, .82);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--p-line);
}

.p-top-inner {
    max-width: 1120px;
    margin: 0 auto;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.p-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    color: var(--p-ink);
    letter-spacing: .2px;
}
.p-brand:hover { text-decoration: none; }

.p-brand-badge {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: var(--p-grad);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    font-weight: 900;
    box-shadow: 0 6px 16px -6px rgba(124, 58, 237, .6);
}

.p-brand-badge.p-brand-logo {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 4px 14px -4px rgba(15, 23, 42, .18);
    object-fit: contain;
    padding: 3px;
}

.p-nav-links {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.p-nav-links a {
    color: var(--p-muted);
    font-weight: 600;
    font-size: 14px;
    padding: 7px 13px;
    border-radius: 999px;
    transition: color .2s, background .2s;
}
.p-nav-links a:hover { color: var(--p-brand); background: #eff6ff; text-decoration: none; }
.p-nav-links a.active { color: var(--p-brand); background: #eff6ff; }

/* ---------------- Hero ---------------- */

.p-hero {
    position: relative;
    overflow: hidden;
    background: var(--p-grad);
    color: #fff;
    padding: 72px 20px 110px;
    text-align: center;
}

.p-hero::before,
.p-hero::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    filter: blur(10px);
    opacity: .25;
    background: #fff;
    animation: float 9s ease-in-out infinite;
}

.p-hero::before { width: 420px; height: 420px; top: -180px; left: -120px; }
.p-hero::after  { width: 360px; height: 360px; bottom: -170px; right: -90px; animation-delay: -4.5s; }

@keyframes float {
    0%, 100% { transform: translateY(0) translateX(0); }
    50%      { transform: translateY(-24px) translateX(14px); }
}

.p-hero-inner { position: relative; z-index: 1; max-width: 760px; margin: 0 auto; }

.p-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, .16);
    border: 1px solid rgba(255, 255, 255, .3);
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .4px;
    margin-bottom: 18px;
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}

.p-hero h1 {
    margin: 0 0 14px;
    font-size: clamp(30px, 5vw, 48px);
    line-height: 1.15;
    font-weight: 900;
    letter-spacing: -.5px;
}

.p-hero p {
    margin: 0 auto;
    font-size: 17px;
    max-width: 620px;
    color: rgba(255, 255, 255, .92);
}

.p-hero-meta {
    margin-top: 22px;
    font-size: 13px;
    color: rgba(255, 255, 255, .85);
}
.p-hero-meta strong { color: #fff; }

/* ---------------- Layout ---------------- */

.p-wrap {
    max-width: 1120px;
    margin: -58px auto 60px;
    padding: 0 20px;
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 34px;
    align-items: start;
}

.p-toc {
    position: sticky;
    top: 86px;
    background: var(--p-card);
    border: 1px solid var(--p-line);
    border-radius: var(--p-radius);
    padding: 18px 16px;
    box-shadow: 0 10px 30px -18px rgba(15, 23, 42, .18);
}

.p-toc h4 {
    margin: 0 0 10px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1.4px;
    color: var(--p-muted);
}

.p-toc a {
    display: block;
    padding: 6px 10px;
    border-radius: 9px;
    color: var(--p-muted);
    font-size: 13.5px;
    font-weight: 600;
    border-left: 2px solid transparent;
    transition: .18s;
}
.p-toc a:hover {
    color: var(--p-brand);
    background: #f1f5f9;
    text-decoration: none;
    border-left-color: var(--p-brand);
}

.p-content { min-width: 0; }

/* ---------------- Cards / sections ---------------- */

.p-card {
    background: var(--p-card);
    border: 1px solid var(--p-line);
    border-radius: var(--p-radius);
    padding: 34px 32px;
    margin-bottom: 26px;
    box-shadow: 0 14px 38px -22px rgba(15, 23, 42, .22);
    transition: transform .3s ease, box-shadow .3s ease;
}
.p-card:hover { transform: translateY(-4px); box-shadow: var(--p-shadow); }

.p-section {
    margin: 0 0 40px;
    scroll-margin-top: 90px;
}

.p-section-head {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 14px;
}

.p-section-num {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--p-grad);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 16px;
    box-shadow: 0 8px 18px -8px rgba(124, 58, 237, .7);
}

.p-section h2 {
    margin: 0;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -.2px;
}

.p-section .p-sub {
    margin: 6px 0 0;
    color: var(--p-muted);
    font-size: 14.5px;
}

.p-card p { margin: 0 0 12px; }
.p-card p:last-child { margin-bottom: 0; }
.p-card strong { color: var(--p-ink); }

/* ---------------- Lists / tags ---------------- */

.p-ul {
    margin: 10px 0 14px;
    padding-left: 0;
    list-style: none;
}
.p-ul li {
    position: relative;
    padding-left: 28px;
    margin-bottom: 10px;
}
.p-ul li::before {
    content: "✓";
    position: absolute;
    left: 0;
    top: 0;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ecfdf5;
    color: #059669;
    font-size: 12px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #a7f3d0;
}

.p-tag {
    display: inline-block;
    background: #eff6ff;
    color: var(--p-brand);
    border: 1px solid #bfdbfe;
    font-size: 12.5px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 999px;
    margin: 4px 6px 4px 0;
}

.p-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
.p-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

.p-mini {
    background: #f8fafc;
    border: 1px solid var(--p-line);
    border-radius: 14px;
    padding: 18px;
}
.p-mini h3 {
    margin: 0 0 6px;
    font-size: 15px;
    font-weight: 800;
}
.p-mini p { margin: 0; font-size: 13.5px; color: var(--p-muted); }

/* ---------------- Callout ---------------- */

.p-callout {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 14px;
    padding: 16px 18px;
    margin: 18px 0;
    font-size: 14px;
}
.p-callout .ico { font-size: 20px; line-height: 1.3; }

.p-note {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 14px;
    padding: 16px 18px;
    margin: 18px 0;
    font-size: 14px;
}

/* ---------------- Support page extras ---------------- */

.p-contact-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin: 22px 0;
}

.p-contact-card {
    text-align: center;
    background: linear-gradient(180deg, #ffffff, #f8fafc);
    border: 1px solid var(--p-line);
    border-radius: var(--p-radius);
    padding: 30px 18px;
    transition: transform .25s ease, box-shadow .25s ease;
}
.p-contact-card:hover { transform: translateY(-6px); box-shadow: var(--p-shadow); }

.p-contact-icon {
    width: 62px;
    height: 62px;
    margin: 0 auto 14px;
    border-radius: 50%;
    background: var(--p-grad);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 22px -10px rgba(124, 58, 237, .8);
}
.p-contact-card h3 { margin: 0 0 4px; font-size: 15px; color: var(--p-muted); text-transform: uppercase; letter-spacing: .8px; }
.p-contact-card .big { font-size: 19px; font-weight: 800; color: var(--p-ink); }
.p-contact-card .small { font-size: 13px; color: var(--p-muted); margin-top: 6px; }

/* ---------------- FAQ accordion ---------------- */

.p-faq-item {
    border: 1px solid var(--p-line);
    border-radius: 14px;
    margin-bottom: 12px;
    overflow: hidden;
    background: var(--p-card);
    transition: border-color .2s;
}
.p-faq-item.open { border-color: var(--p-brand); }

.p-faq-q {
    width: 100%;
    text-align: left;
    background: none;
    border: 0;
    padding: 16px 18px;
    font-size: 15px;
    font-weight: 700;
    color: var(--p-ink);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    font-family: inherit;
}
.p-faq-q .arrow { transition: transform .25s; color: var(--p-brand); }
.p-faq-item.open .p-faq-q .arrow { transform: rotate(180deg); }

.p-faq-a {
    display: none;
    padding: 0 18px 16px;
    color: var(--p-muted);
    font-size: 14px;
}
.p-faq-item.open .p-faq-a { display: block; }

/* ---------------- Footer ---------------- */

.p-footer {
    background: #0f172a;
    color: #94a3b8;
    padding: 44px 20px 34px;
    margin-top: 20px;
}

.p-footer-inner {
    max-width: 1120px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    gap: 22px;
    justify-content: space-between;
    align-items: center;
}

.p-footer-brand { display: flex; align-items: center; gap: 10px; font-weight: 800; color: #fff; }

.p-footer-links { display: flex; gap: 6px; flex-wrap: wrap; }
.p-footer-links a {
    color: #cbd5e1;
    font-size: 14px;
    font-weight: 600;
    padding: 7px 13px;
    border-radius: 999px;
    transition: .2s;
}
.p-footer-links a:hover { background: rgba(255, 255, 255, .08); color: #fff; text-decoration: none; }

.p-footer-copy {
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, .1);
    margin-top: 28px;
    padding-top: 20px;
    font-size: 13px;
    max-width: 1120px;
    margin-left: auto;
    margin-right: auto;
}
.p-footer-copy a { color: #93c5fd; }

/* ---------------- Scroll reveal ---------------- */

.reveal {
    opacity: 0;
    transform: translateY(26px);
    transition: opacity .65s cubic-bezier(.22, .61, .36, 1),
                transform .65s cubic-bezier(.22, .61, .36, 1);
}
.reveal.visible { opacity: 1; transform: translateY(0); }
.reveal[data-d="1"] { transition-delay: .05s; }
.reveal[data-d="2"] { transition-delay: .1s; }
.reveal[data-d="3"] { transition-delay: .15s; }
.reveal[data-d="4"] { transition-delay: .2s; }

/* ---------------- Mobile nav toggle (hidden on desktop) ---------------- */

.p-nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 42px;
    height: 42px;
    border: 1px solid var(--p-line);
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
    padding: 0;
}
.p-nav-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    border-radius: 2px;
    background: var(--p-ink);
    transition: transform .25s ease, opacity .25s ease;
}
.p-nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.p-nav-toggle.open span:nth-child(2) { opacity: 0; }
.p-nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------------- Responsive ---------------- */

@media (max-width: 880px) {
    .p-wrap { grid-template-columns: 1fr; gap: 20px; }

    /* Dedicated mobile nav: hamburger + dropdown panel */
    .p-nav-toggle { display: flex; }
    .p-top-inner { position: relative; }
    .p-nav-links {
        position: absolute;
        top: calc(100% + 8px);
        left: 0;
        right: 0;
        display: none;
        flex-direction: column;
        align-items: stretch;
        gap: 2px;
        background: rgba(255, 255, 255, .98);
        border: 1px solid var(--p-line);
        border-radius: 16px;
        padding: 8px;
        box-shadow: 0 24px 50px -20px rgba(15, 23, 42, .35);
        z-index: 60;
    }
    .p-nav-links.open { display: flex; }
    .p-nav-links a {
        padding: 13px 14px;
        font-size: 15px;
        border-radius: 12px;
        color: var(--p-ink);
        text-align: left;
    }
    .p-nav-links a:hover,
    .p-nav-links a.active {
        background: #eff6ff;
        color: var(--p-brand);
    }

    /* Mobile TOC becomes horizontal swipe chips */
    .p-toc {
        position: static;
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        gap: 8px;
        padding: 12px;
        border-radius: 14px;
    }
    .p-toc::-webkit-scrollbar { display: none; }
    .p-toc h4 { display: none; }
    .p-toc a {
        flex: 0 0 auto;
        white-space: nowrap;
        font-size: 13px;
        padding: 8px 14px;
        border: 1px solid var(--p-line);
        border-left-width: 1px;
        border-radius: 999px;
        background: #fff;
    }
    .p-toc a:hover,
    .p-toc a.active {
        border-color: var(--p-brand);
        background: #eff6ff;
    }

    .p-grid-2, .p-grid-3, .p-contact-grid { grid-template-columns: 1fr; }
    .p-card { padding: 22px 18px; }

    .p-hero { padding: 56px 18px 100px; }
    .p-hero h1 { font-size: clamp(26px, 7vw, 36px); }
    .p-hero p { font-size: 15.5px; }

    .p-footer-inner { flex-direction: column; align-items: center; text-align: center; gap: 14px; }
    .p-footer-links { justify-content: center; }
}

@media (max-width: 520px) {
    .p-top-inner { padding: 10px 14px; }
    .p-wrap { padding: 0 14px; margin-top: -52px; }
    .p-hero { padding: 48px 16px 92px; }
    .p-hero-badge { font-size: 12px; padding: 5px 11px; }
    .p-section { margin-bottom: 30px; scroll-margin-top: 80px; }
    .p-section-head { gap: 10px; }
    .p-section-num { width: 34px; height: 34px; font-size: 14px; border-radius: 10px; }
    .p-section h2 { font-size: 18px; }
    .p-card { padding: 20px 16px; margin-bottom: 20px; }
    .p-card p { font-size: 14px; }
    .p-ul li { font-size: 14px; }
    .p-contact-card { padding: 26px 14px; }
    .p-contact-card .big { font-size: 16px; word-break: break-word; }
    .p-callout, .p-note { font-size: 13px; padding: 14px; }
    .p-footer { padding: 34px 16px 26px; }
}

