/* ============================================================
   Lopaostab Trust Center — shared styles
   Brand tokens mirrored from the Lopaostab app (dark, warm, amber/gold).
   ============================================================ */

:root {
  --bg:        #14110D;
  --bg-2:      #1A1611;
  --panel:     #201B14;
  --panel-2:   #262019;
  --line:      #3A3226;
  --line-2:    #4A4030;
  --text:      #F5F5F4;
  --muted:     #B4A99A;
  --muted-2:   #8A7F70;
  --accent-a:  #D97706;
  --accent-b:  #FBBF24;
  --ok:        #34B27A;
  --danger:    #E5484D;
  --grad:      linear-gradient(135deg, #D97706 0%, #E8890F 45%, #FBBF24 100%);
  --aurora:    radial-gradient(ellipse at 20% -10%, rgba(217,119,6,.16), transparent 55%),
               radial-gradient(ellipse at 100% 0%, rgba(251,191,36,.09), transparent 50%);
  --radius:    16px;
  --radius-lg: 22px;
  --shadow:    0 14px 40px rgba(0,0,0,.45);
  --font-display: "Manrope", "Inter", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --maxw: 1180px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: var(--aurora), var(--bg);
  z-index: -1;
}

a { color: var(--accent-b); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent-b); outline-offset: 2px; border-radius: 4px; }

h1, h2, h3, h4 { font-family: var(--font-display); letter-spacing: -.02em; color: var(--text); }

img { max-width: 100%; display: block; }

/* ── Z-index scale ──────────────────────────────────────────
   Kept explicit and centralized so stacking order is predictable:
   footer/back-top < doc-sidebar < topbar < mobile nav/TOC drawers
   ────────────────────────────────────────────────────────── */

/* ── Top bar ────────────────────────────────────────────── */
/* IMPORTANT: backdrop-filter lives on ::before, NOT on .topbar itself.
   backdrop-filter/filter/transform on an element force it to become the
   "containing block" for any position:fixed descendants — which was
   trapping the mobile .top-nav dropdown inside the header's own tiny
   height and clipping it almost immediately after opening. Moving the
   blur to a pseudo-element keeps the glass effect without that side
   effect, so .top-nav's fixed positioning resolves against the real
   viewport again. */
.topbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(20, 17, 13, .82);
  border-bottom: 1px solid var(--line);
}
.topbar::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.topbar-inner {
  max-width: var(--maxw); margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px;
}
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 800; font-size: 1.15rem; color: var(--text); }
.brand-mark {
  width: 34px; height: 34px; border-radius: 9px;
  object-fit: cover;
  box-shadow: 0 4px 14px rgba(0,0,0,.4);
}
.brand small { display: block; font-family: var(--font-body); font-weight: 500; font-size: .68rem; color: var(--muted-2); letter-spacing: .02em; }

.top-nav { display: flex; gap: 22px; align-items: center; }
.top-nav a { color: var(--muted); font-size: .92rem; font-weight: 600; }
.top-nav a:hover, .top-nav a.active { color: var(--accent-b); text-decoration: none; }
.top-nav .cta {
  background: var(--grad); color: #1A1611; padding: 8px 16px; border-radius: 999px;
  font-weight: 700; font-size: .85rem;
}
.top-nav .cta:hover { text-decoration: none; filter: brightness(1.06); }

.menu-toggle { display: none; background: none; border: 1px solid var(--line-2); border-radius: 8px; padding: 8px 10px; color: var(--text); }

@media (max-width: 820px) {
  .top-nav { position: fixed; inset: 62px 0 0 0; z-index: 90; background: var(--bg-2); flex-direction: column; align-items: flex-start;
    padding: 20px 24px; gap: 4px; border-top: 1px solid var(--line); transform: translateY(-8px); opacity: 0; pointer-events: none; transition: .18s;
    overflow-y: auto; }
  .top-nav.open { transform: translateY(0); opacity: 1; pointer-events: auto; }
  .top-nav a { padding: 12px 0; width: 100%; border-bottom: 1px solid var(--line); }
  .top-nav .cta { margin-top: 10px; text-align: center; }
  .menu-toggle { display: block; }
}

/* ── Hero ───────────────────────────────────────────────── */
.hero { max-width: var(--maxw); margin: 0 auto; padding: 64px 24px 40px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--panel); border: 1px solid var(--line);
  padding: 6px 13px; border-radius: 999px; font-size: .78rem; font-weight: 700;
  color: var(--accent-b); letter-spacing: .02em; margin-bottom: 18px;
}
.eyebrow .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px rgba(52,178,122,.2); }
.hero h1 { font-size: clamp(2rem, 4.4vw, 3.1rem); font-weight: 800; margin: 0 0 16px; max-width: 16ch; }
.hero p.lead { color: var(--muted); font-size: 1.08rem; max-width: 56ch; margin: 0 0 8px; }

/* ── Trust cards grid ───────────────────────────────────── */
.card-grid { max-width: var(--maxw); margin: 0 auto; padding: 8px 24px 56px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
@media (max-width: 900px) { .card-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .card-grid { grid-template-columns: 1fr; } }

.doc-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 24px; display: flex; flex-direction: column; gap: 12px; transition: .18s;
}
.doc-card:hover { border-color: var(--line-2); transform: translateY(-2px); box-shadow: var(--shadow); }
.doc-card .icon {
  width: 42px; height: 42px; border-radius: 12px; background: var(--accent-a-soft, rgba(217,119,6,.14));
  display: flex; align-items: center; justify-content: center; color: var(--accent-b); font-size: 1.2rem;
}
.doc-card h3 { font-size: 1.08rem; margin: 0; }
.doc-card p { color: var(--muted); font-size: .9rem; margin: 0; flex: 1; }
.doc-card .go { color: var(--accent-b); font-weight: 700; font-size: .85rem; display: inline-flex; align-items: center; gap: 5px; }
.doc-card:hover .go { text-decoration: underline; }

/* ── Trust strip (badges) ──────────────────────────────── */
.trust-strip {
  max-width: var(--maxw); margin: 0 auto 56px; padding: 0 24px;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px;
}
@media (max-width: 820px) { .trust-strip { grid-template-columns: repeat(2, 1fr); } }
.trust-item {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; display: flex; gap: 12px; align-items: flex-start;
}
.trust-item .ico { color: var(--ok); flex-shrink: 0; margin-top: 2px; }
.trust-item h4 { font-size: .88rem; margin: 0 0 3px; }
.trust-item p { margin: 0; font-size: .8rem; color: var(--muted-2); }

/* ── Document layout ────────────────────────────────────── */
.doc-shell { max-width: var(--maxw); margin: 0 auto; padding: 36px 24px 90px; display: grid; grid-template-columns: 260px 1fr; gap: 40px; align-items: flex-start; }
@media (max-width: 900px) { .doc-shell { grid-template-columns: 1fr; } }

/* Sidebar is sticky ONLY on desktop, where it lives in its own column and
   can never overlap the single-column content below it. On mobile it must
   NOT be sticky, or it pins itself over the article text while scrolling. */
.doc-sidebar { position: sticky; top: 84px; z-index: 10; }
@media (max-width: 900px) {
  .doc-sidebar { position: static; top: auto; z-index: auto; }
}

.doc-meta {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 18px; margin-bottom: 18px;
}
.doc-meta .badge-row { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.verified-badge {
  width: 26px; height: 26px; border-radius: 50%; background: var(--grad);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(217,119,6,.4);
}
.verified-badge svg { width: 14px; height: 14px; }
.doc-meta .badge-label { font-weight: 700; font-size: .84rem; }
.doc-meta dl { margin: 0; font-size: .8rem; }
.doc-meta dt { color: var(--muted-2); margin-top: 10px; }
.doc-meta dt:first-child { margin-top: 0; }
.doc-meta dd { margin: 2px 0 0; color: var(--text); font-weight: 600; }

.toc { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 16px 18px; }
.toc h4,
.toc summary {
  font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted-2);
  margin: 0 0 10px; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  list-style: none; cursor: default;
}
.toc summary::-webkit-details-marker { display: none; }
.toc summary .chev { font-size: .8rem; transition: transform .18s; color: var(--muted-2); }
.toc[open] summary .chev { transform: rotate(180deg); }
.toc-list { max-height: 60vh; overflow-y: auto; }
.toc a { display: block; font-size: .82rem; color: var(--muted); padding: 5px 0; border-left: 2px solid transparent; padding-left: 10px; margin-left: -1px; }
.toc a:hover { color: var(--text); text-decoration: none; }
.toc a.active { color: var(--accent-b); border-left-color: var(--accent-a); font-weight: 600; }

/* ── Mobile TOC: collapsible drawer, never covers the article ─ */
@media (max-width: 900px) {
  .toc summary {
    cursor: pointer; padding: 2px 0 10px; border-bottom: 1px solid var(--line); margin-bottom: 12px;
  }
  .toc:not([open]) summary { border-bottom: none; margin-bottom: 0; padding-bottom: 2px; }
  .toc summary .chev { display: inline-block; }
}
@media (min-width: 901px) {
  /* Desktop keeps the original always-visible sidebar TOC */
  .toc summary { pointer-events: none; }
  .toc summary .chev { display: none; }
}

.doc-content h1 { font-size: clamp(1.7rem, 3vw, 2.3rem); margin: 0 0 8px; }
.doc-content > .subtitle { color: var(--muted); margin: 0 0 32px; font-size: 1rem; }
.doc-content section { margin-bottom: 36px; scroll-margin-top: 90px; }
.doc-content h2 {
  font-size: 1.2rem; display: flex; align-items: baseline; gap: 10px; margin: 0 0 12px;
  padding-bottom: 10px; border-bottom: 1px solid var(--line);
}
.doc-content h2 .num { color: var(--accent-b); font-variant-numeric: tabular-nums; font-size: .95rem; }
.doc-content h3 { font-size: 1rem; margin: 18px 0 8px; color: var(--text); }
.doc-content p { color: #DCD6CC; margin: 0 0 12px; }
.doc-content ul, .doc-content ol { color: #DCD6CC; padding-left: 22px; margin: 0 0 12px; }
.doc-content li { margin-bottom: 6px; }
.doc-content strong { color: var(--text); }
.doc-content a { text-decoration: underline; text-underline-offset: 2px; }
.callout {
  background: var(--panel-2); border: 1px solid var(--line-2); border-left: 3px solid var(--accent-a);
  border-radius: 10px; padding: 14px 16px; margin: 14px 0; font-size: .92rem; color: var(--muted);
}
.callout strong { color: var(--accent-b); }
.table-wrap { overflow-x: auto; margin: 14px 0; }
table { width: 100%; border-collapse: collapse; font-size: .88rem; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); color: var(--muted); }
th { color: var(--text); font-family: var(--font-display); font-weight: 700; }

.back-top {
  position: fixed; bottom: 24px; right: 24px; width: 44px; height: 44px; border-radius: 50%;
  background: var(--panel); border: 1px solid var(--line-2); color: var(--text);
  display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow);
  opacity: 0; pointer-events: none; transition: .18s; z-index: 50;
}
.back-top.show { opacity: 1; pointer-events: auto; }

/* ── Footer ─────────────────────────────────────────────── */
/* position + z-index moved footer into the "positioned" paint layer so it
   always renders above the sticky doc-sidebar instead of behind it. */
footer { position: relative; z-index: 20; border-top: 1px solid var(--line); margin-top: 40px; background: var(--bg); }
.footer-inner { max-width: var(--maxw); margin: 0 auto; padding: 40px 24px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 24px; }
.footer-col h5 { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted-2); margin: 0 0 12px; }
.footer-col a { display: block; color: var(--muted); font-size: .88rem; padding: 4px 0; }
.footer-col a:hover { color: var(--accent-b); text-decoration: none; }
.footer-bottom { max-width: var(--maxw); margin: 0 auto; padding: 0 24px 32px; color: var(--muted-2); font-size: .8rem; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }

/* ── Simple content page (contact/guidelines intro) ─────── */
.simple-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 22px; }
.contact-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 20px 0; }
@media (max-width: 760px) { .contact-grid { grid-template-columns: 1fr; } }
.contact-card { background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.contact-card h4 { margin: 0 0 6px; font-size: .95rem; }
.contact-card a { font-size: .92rem; font-weight: 600; }
.contact-card p { color: var(--muted-2); font-size: .82rem; margin: 6px 0 0; }
