/* ============================================================
   Document / User Guide page (/document)
   Static stylesheet (hand-written, NOT Tailwind-processed) — edit directly, no rebuild.
   Linked from views/index.php with ?v=time() cache-busting.
   ============================================================ */

:root {
    --doc-accent: #E8541C;
    --doc-accent-soft: #FFF1EA;
    --doc-ink: #1f2937;
    --doc-muted: #6b7280;
    --doc-line: #e5e7eb;
    --doc-bg: #f6f8fb;
    --doc-card: #ffffff;
}

.doc-page {
    background: var(--doc-bg);
    min-height: 100vh;
    color: var(--doc-ink);
    padding-bottom: 64px;
}

/* ---------- Hero ---------- */
.doc-hero {
    background: linear-gradient(135deg, #0f2a4a 0%, #14365e 55%, #1d4e7e 100%);
    color: #fff;
    padding: 40px 22px 46px;
    position: relative;
    overflow: hidden;
}
.doc-hero::after {
    content: "";
    position: absolute;
    right: -60px; top: -60px;
    width: 220px; height: 220px;
    background: radial-gradient(circle, rgba(232,84,28,0.35), transparent 70%);
    pointer-events: none;
}
.doc-hero-inner { max-width: 1080px; margin: 0 auto; position: relative; z-index: 1; }
.doc-hero-eyebrow {
    display: inline-flex; align-items: center; gap: 8px;
    font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
    background: rgba(255,255,255,0.12); padding: 6px 14px; border-radius: 999px; margin-bottom: 16px;
}
.doc-back {
    display: inline-flex; align-items: center; gap: 8px; text-decoration: none;
    color: rgba(255,255,255,0.9); font-size: 13px; font-weight: 600;
    padding: 7px 14px 7px 11px; border-radius: 999px;
    background: rgba(255,255,255,0.10); border: 1px solid rgba(255,255,255,0.22);
    transition: background .15s, transform .15s;
}
.doc-back:hover { background: rgba(255,255,255,0.20); transform: translateX(-2px); }
.doc-back i { font-size: 12px; }
.doc-hero h1 { font-size: 30px; font-weight: 800; line-height: 1.2; margin: 0 0 10px; }
.doc-hero p { font-size: 15px; opacity: .9; max-width: 640px; line-height: 1.65; margin: 0; }
.doc-hero-meta {
    display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px;
}
.doc-hero-meta span {
    display: inline-flex; align-items: center; gap: 7px;
    font-size: 12.5px; background: rgba(255,255,255,0.10); border: 1px solid rgba(255,255,255,0.16);
    padding: 7px 13px; border-radius: 10px;
}

/* ---------- Layout: sticky TOC + content ---------- */
.doc-layout {
    max-width: 1080px; margin: 0 auto; padding: 0 18px;
    display: grid; grid-template-columns: 248px 1fr; gap: 30px;
    margin-top: -22px; position: relative; z-index: 2;
}
.doc-toc-wrap { position: relative; min-width: 0; }
.doc-toc {
    position: sticky; top: 18px;
    background: var(--doc-card); border: 1px solid var(--doc-line); border-radius: 16px;
    padding: 14px; box-shadow: 0 8px 24px rgba(15,23,42,0.06);
}
.doc-toc-title {
    font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
    color: var(--doc-muted); padding: 6px 10px 10px;
}
.doc-toc a {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 11px; border-radius: 10px; text-decoration: none;
    color: #374151; font-size: 13.5px; font-weight: 500; cursor: pointer;
    transition: background .15s, color .15s; border-left: 3px solid transparent;
}
.doc-toc a i { width: 16px; text-align: center; color: var(--doc-muted); font-size: 13px; }
.doc-toc a:hover { background: #f3f4f6; color: var(--doc-ink); }
.doc-toc a.is-active {
    background: var(--doc-accent-soft); color: var(--doc-accent);
    border-left-color: var(--doc-accent); font-weight: 700;
}
.doc-toc a.is-active i { color: var(--doc-accent); }

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

/* ---------- Sections ---------- */
.doc-section {
    background: var(--doc-card); border: 1px solid var(--doc-line); border-radius: 18px;
    padding: 26px 26px 28px; margin-bottom: 22px; scroll-margin-top: 18px;
    box-shadow: 0 4px 14px rgba(15,23,42,0.04);
}
.doc-h2 {
    display: flex; align-items: center; gap: 13px;
    font-size: 20px; font-weight: 800; margin: 0 0 6px;
}
.doc-h2 .doc-h2-ic {
    width: 40px; height: 40px; border-radius: 12px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center; font-size: 17px;
    background: var(--doc-accent-soft); color: var(--doc-accent);
}
.doc-h2-sub { color: var(--doc-muted); font-size: 14px; margin: 0 0 18px; line-height: 1.6; padding-left: 53px; }

.doc-section h3 {
    font-size: 16px; font-weight: 700; margin: 22px 0 8px; color: var(--doc-ink);
    display: flex; align-items: center; gap: 9px;
}
.doc-section p { font-size: 14.5px; line-height: 1.75; color: #374151; margin: 0 0 12px; }
.doc-section ul { margin: 0 0 14px; padding-left: 4px; list-style: none; }
.doc-section ul li {
    position: relative; padding-left: 24px; margin-bottom: 9px; font-size: 14.5px; line-height: 1.65; color: #374151;
}
.doc-section ul li::before {
    content: "\f00c"; font-family: "Font Awesome 6 Free"; font-weight: 900;
    position: absolute; left: 0; top: 1px; color: var(--doc-accent); font-size: 12px;
}

/* ---------- Feature cards ---------- */
.doc-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin: 6px 0 8px; }
.doc-card {
    border: 1px solid var(--doc-line); border-radius: 14px; padding: 16px 16px 18px; background: #fff;
    transition: transform .16s, box-shadow .16s;
}
.doc-card:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(15,23,42,0.08); }
.doc-card-ic {
    width: 42px; height: 42px; border-radius: 11px; display: flex; align-items: center; justify-content: center;
    font-size: 17px; margin-bottom: 11px; color: #fff;
}
.doc-card h4 { font-size: 15px; font-weight: 700; margin: 0 0 5px; }
.doc-card p { font-size: 13px; color: var(--doc-muted); line-height: 1.55; margin: 0; }

/* ---------- Numbered steps ---------- */
.doc-steps { counter-reset: step; margin: 4px 0 8px; padding: 0; list-style: none; }
.doc-steps li {
    position: relative; padding: 0 0 16px 44px; margin: 0;
}
.doc-steps li::before {
    counter-increment: step; content: counter(step);
    position: absolute; left: 0; top: -2px;
    width: 30px; height: 30px; border-radius: 50%;
    background: var(--doc-accent); color: #fff; font-weight: 700; font-size: 14px;
    display: flex; align-items: center; justify-content: center;
}
.doc-steps li::after {
    content: ""; position: absolute; left: 14px; top: 30px; bottom: 4px; width: 2px; background: var(--doc-line);
}
.doc-steps li:last-child::after { display: none; }
.doc-steps li strong { display: block; font-size: 14.5px; margin-bottom: 2px; }
.doc-steps li span { font-size: 13.5px; color: var(--doc-muted); line-height: 1.6; }

/* ---------- Level badges ---------- */
.doc-levels { display: flex; flex-wrap: wrap; gap: 10px; margin: 8px 0; }
.doc-pill {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 8px 14px; border-radius: 10px; font-size: 13.5px; font-weight: 600;
}
.doc-pill .dot { width: 10px; height: 10px; border-radius: 50%; }
.doc-pill.crit { background: #fee2e2; color: #b91c1c; }
.doc-pill.crit .dot { background: #ef4444; }
.doc-pill.warn { background: #ffedd5; color: #c2410c; }
.doc-pill.warn .dot { background: #f97316; }
.doc-pill.info { background: #dbeafe; color: #1d4ed8; }
.doc-pill.info .dot { background: #3b82f6; }

/* ---------- Callout ---------- */
.doc-callout {
    border-left: 4px solid var(--doc-accent); background: var(--doc-accent-soft);
    border-radius: 0 12px 12px 0; padding: 14px 16px; margin: 14px 0; font-size: 14px; line-height: 1.65; color: #7c2d12;
}
.doc-callout i { color: var(--doc-accent); margin-right: 7px; }

/* ---------- FAQ ---------- */
.doc-faq-item { border: 1px solid var(--doc-line); border-radius: 12px; margin-bottom: 10px; overflow: hidden; }
.doc-faq-q {
    width: 100%; text-align: left; background: #fff; border: 0; cursor: pointer;
    padding: 15px 16px; font-size: 14.5px; font-weight: 600; color: var(--doc-ink);
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.doc-faq-q:hover { background: #fafafa; }
.doc-faq-q .chev { color: var(--doc-muted); transition: transform .2s; flex-shrink: 0; }
.doc-faq-item.open .doc-faq-q .chev { transform: rotate(180deg); }
.doc-faq-a { padding: 0 16px; max-height: 0; overflow: hidden; transition: max-height .25s ease, padding .25s ease; }
.doc-faq-item.open .doc-faq-a { padding: 0 16px 16px; max-height: 400px; }
.doc-faq-a p { font-size: 14px; color: #374151; line-height: 1.7; margin: 0; }

/* ---------- Hotlines ---------- */
.doc-hotlines { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.doc-hotline {
    display: flex; align-items: center; gap: 13px; text-decoration: none;
    border: 1px solid var(--doc-line); border-radius: 14px; padding: 14px 15px; background: #fff;
    transition: border-color .15s, box-shadow .15s;
}
.doc-hotline:hover { border-color: var(--doc-accent); box-shadow: 0 6px 16px rgba(232,84,28,0.12); }
.doc-hotline .ic {
    width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center; font-size: 18px;
    background: var(--doc-accent-soft); color: var(--doc-accent);
}
.doc-hotline .t { font-size: 12.5px; color: var(--doc-muted); }
.doc-hotline .n { font-size: 18px; font-weight: 800; color: var(--doc-ink); letter-spacing: .02em; }

.doc-foot { text-align: center; color: var(--doc-muted); font-size: 12.5px; margin-top: 8px; }

/* ---------- CTA button ---------- */
.doc-cta {
    display: inline-flex; align-items: center; gap: 9px;
    margin-top: 18px; padding: 12px 22px; border-radius: 12px; text-decoration: none;
    background: linear-gradient(135deg, #E8541C, #F26E3D); color: #fff;
    font-weight: 700; font-size: 14.5px;
    box-shadow: 0 8px 20px rgba(232,84,28,0.28); transition: transform .15s, box-shadow .15s;
}
.doc-cta:hover { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(232,84,28,0.38); }

/* ---------- Mobile ---------- */
@media (max-width: 860px) {
    .doc-layout { grid-template-columns: 1fr; gap: 16px; }
    .doc-toc-wrap { order: -1; }
    .doc-toc { position: static; box-shadow: none; }
    .doc-toc-list { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
    .doc-toc-list::-webkit-scrollbar { display: none; }
    .doc-toc-title { display: none; }
    .doc-toc a { flex-shrink: 0; border-left: 0; border-bottom: 3px solid transparent; padding: 8px 12px; white-space: nowrap; }
    .doc-toc a.is-active { border-left: 0; border-bottom-color: var(--doc-accent); }
    .doc-hero { padding: 30px 18px 40px; }
    .doc-hero h1 { font-size: 24px; }
    .doc-section { padding: 20px 18px 22px; }
    .doc-h2-sub { padding-left: 0; }
}

/* ---------- Dark content theme ---------- */
.content-dark .doc-page { background: #0f1622; color: #e5e7eb; }
.content-dark .doc-toc,
.content-dark .doc-section,
.content-dark .doc-card,
.content-dark .doc-hotline,
.content-dark .doc-faq-item,
.content-dark .doc-faq-q { background: #1b2330; border-color: #2d3748; color: #e5e7eb; }
.content-dark .doc-section p,
.content-dark .doc-section ul li,
.content-dark .doc-card p,
.content-dark .doc-faq-a p { color: #cbd5e1; }
.content-dark .doc-h2,
.content-dark .doc-section h3,
.content-dark .doc-card h4,
.content-dark .doc-faq-q,
.content-dark .doc-hotline .n { color: #f3f4f6; }
.content-dark .doc-toc a { color: #cbd5e1; }
.content-dark .doc-toc a:hover { background: #243044; }
