/* ==========================================================================
   legal.css — the Privacy Policy, Terms of Use and Help Center pages.
   Loads after app.css and auth.css and borrows their tokens, so these pages
   look like the rest of SalesPath in both light and dark mode.
   ========================================================================== */

/* app.css locks the page to the window for the app itself. A document needs to
   scroll like any other web page. */
html.doc-html, body.doc-body { height: auto; min-height: 100%; }
body.doc-body { overflow: visible; }

/* ---------- Top bar ---------------------------------------------------------- */
.doc-top {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 22px; flex-wrap: wrap;
  padding: 12px max(20px, 4vw);
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(var(--blur)); backdrop-filter: blur(var(--blur));
  border-bottom: 1px solid var(--hairline);
}
.doc-top .mast { margin: 0; }
.doc-brand { display: flex; align-items: center; color: inherit; }
.doc-nav { display: flex; gap: 4px; margin-left: auto; align-items: center; flex-wrap: wrap; }
.doc-nav a {
  padding: 7px 12px; border-radius: 9px; font-size: 13px; font-weight: 600; color: var(--ink-2);
}
.doc-nav a:hover { background: var(--glass); color: var(--ink); }
.doc-nav a[aria-current="page"] { background: var(--glass); color: var(--ink); }
.doc-nav a.btn { height: 34px; padding: 0 14px; font-size: 12.5px; margin-left: 6px; display: inline-flex; align-items: center; }
.doc-nav a.btn-primary, .doc-nav a.btn-primary:hover { color: #fff; }

/* ---------- Page frame ------------------------------------------------------- */
.doc-wrap {
  position: relative; z-index: 1;
  max-width: 1120px; margin: 0 auto; padding: 34px 20px 70px;
  display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: 34px;
}
.doc-wrap.no-toc { grid-template-columns: minmax(0, 1fr); max-width: 980px; }

.doc-toc { position: sticky; top: 86px; align-self: start; max-height: calc(100vh - 110px); overflow: auto; }
.doc-toc h2 {
  font-size: 11px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase;
  color: var(--ink-3); margin: 0 0 10px 12px;
}
.doc-toc a {
  display: block; padding: 6px 12px; margin-bottom: 1px; border-radius: 8px;
  font-size: 12.5px; line-height: 1.4; color: var(--ink-3);
}
.doc-toc a:hover { background: var(--glass); color: var(--ink); }
.doc-toc a.on { background: var(--glass-strong); color: var(--ink); font-weight: 600; }

/* ---------- The document card ------------------------------------------------ */
.doc-card {
  background: var(--glass-strong); border: 1px solid var(--stroke); border-radius: var(--r-xl);
  box-shadow: var(--shadow-1); padding: clamp(22px, 4.2vw, 46px);
  -webkit-backdrop-filter: blur(var(--blur)); backdrop-filter: blur(var(--blur));
  min-width: 0;
}
.doc-card h1 {
  font-family: var(--font-display); font-size: clamp(26px, 4vw, 34px); font-weight: 700;
  letter-spacing: -.035em; line-height: 1.15; color: var(--ink);
}
.doc-meta { margin-top: 10px; font-size: 12.5px; color: var(--ink-3); }
.doc-lede { margin-top: 16px; font-size: 15.5px; line-height: 1.7; color: var(--ink-2); max-width: 66ch; }

.doc-card h2 {
  font-family: var(--font-display); font-size: 20px; font-weight: 600; letter-spacing: -.025em;
  margin-top: 38px; padding-top: 6px; color: var(--ink); scroll-margin-top: 90px;
}
.doc-card h3 { font-size: 14.5px; font-weight: 700; margin-top: 22px; color: var(--ink); }
.doc-card p, .doc-card li { font-size: 14.5px; line-height: 1.75; color: var(--ink-2); }
.doc-card p { margin-top: 12px; max-width: 72ch; }
.doc-card ul, .doc-card ol { margin: 10px 0 0; padding-left: 22px; list-style: revert; max-width: 72ch; }
.doc-card li { margin-top: 6px; }
.doc-card a { color: var(--brand-600); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
[data-theme="dark"] .doc-card a { color: var(--brand-400); }
.doc-card strong { color: var(--ink); font-weight: 700; }
.doc-card code {
  font-family: var(--font-num); font-size: 12.5px; background: var(--glass); border: 1px solid var(--hairline);
  padding: 1px 6px; border-radius: 6px;
}

/* The short version: a panel that says what matters before the detail */
.doc-summary {
  margin-top: 26px; padding: 18px 20px; border-radius: var(--r-lg);
  background: color-mix(in srgb, var(--brand-500) 9%, transparent);
  border: 1px solid color-mix(in srgb, var(--brand-500) 24%, transparent);
}
.doc-summary h2 { margin: 0 0 4px; font-size: 14px; padding: 0; }
.doc-summary ul { margin-top: 6px; }

/* Tables (what we collect, cookies) */
.doc-table-wrap { margin-top: 14px; overflow-x: auto; border: 1px solid var(--hairline); border-radius: var(--r-md); }
.doc-card table { width: 100%; border-collapse: collapse; min-width: 560px; }
.doc-card th, .doc-card td { text-align: left; vertical-align: top; padding: 11px 14px; font-size: 13.5px; line-height: 1.6; }
.doc-card th {
  background: var(--glass); color: var(--ink-3); font-size: 11px; letter-spacing: .07em;
  text-transform: uppercase; font-weight: 700;
}
.doc-card td { color: var(--ink-2); border-top: 1px solid var(--hairline); }
.doc-card td:first-child { color: var(--ink); font-weight: 600; width: 26%; }

/* Something the owner must fill in before publishing */
.fill-in { background: #fde68a; color: #6b4a00; padding: 0 5px; border-radius: 5px; font-weight: 700; font-style: normal; }
[data-theme="dark"] .fill-in { background: #78561a; color: #ffe9b0; }
.draft-banner {
  position: relative; z-index: 31; text-align: center; padding: 9px 16px;
  background: #b45309; color: #fff; font-size: 12.5px; font-weight: 600;
}

/* ---------- Help center ------------------------------------------------------ */
.help-hero { text-align: center; padding: 8px 0 4px; }
.help-hero h1 { margin: 0; }
.help-search {
  display: flex; align-items: center; gap: 10px; max-width: 560px; margin: 22px auto 0;
  height: 50px; padding: 0 16px; border-radius: 14px;
  background: var(--glass-strong); border: 1px solid var(--stroke); box-shadow: var(--shadow-1);
}
.help-search svg { width: 18px; height: 18px; color: var(--ink-3); flex: none; }
.help-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font-size: 15px; }
.help-search:focus-within { outline: 2px solid var(--brand-500); outline-offset: 2px; }

.help-topics { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-top: 26px; }
.help-topic {
  display: block; padding: 16px 16px 14px; border-radius: var(--r-md);
  background: var(--glass); border: 1px solid var(--hairline); text-decoration: none !important;
  transition: transform .16s var(--ease), box-shadow .16s var(--ease), background .16s;
}
.help-topic:hover { transform: translateY(-2px); background: var(--glass-strong); box-shadow: var(--shadow-1); }
.help-topic b { display: block; font-size: 14px; color: var(--ink); }
.help-topic span { display: block; margin-top: 3px; font-size: 12.5px; line-height: 1.5; color: var(--ink-3); font-weight: 500; }

.help-section { margin-top: 12px; }
.help-section > h2 { margin-top: 34px; }
.faq { margin-top: 12px; border: 1px solid var(--hairline); border-radius: var(--r-md); overflow: hidden; background: var(--glass-quiet); }
.faq details { border-top: 1px solid var(--hairline); }
.faq details:first-child { border-top: 0; }
.faq summary {
  list-style: none; cursor: pointer; padding: 14px 44px 14px 18px; position: relative;
  font-size: 14.5px; font-weight: 600; color: var(--ink);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; position: absolute; right: 18px; top: 50%; width: 8px; height: 8px;
  border-right: 2px solid var(--ink-3); border-bottom: 2px solid var(--ink-3);
  transform: translateY(-70%) rotate(45deg); transition: transform .18s var(--ease);
}
.faq details[open] > summary::after { transform: translateY(-30%) rotate(-135deg); }
.faq summary:hover { background: var(--glass); }
.faq .answer { padding: 0 18px 16px; }
.faq .answer p:first-child { margin-top: 0; }
.faq-empty { display: none; margin-top: 24px; text-align: center; color: var(--ink-3); font-size: 14px; }
.faq-empty.show { display: block; }

.kbd-row { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 10px; }
.kbd-row span { font-size: 14px; color: var(--ink-2); }
.kbd-row kbd {
  display: inline-block; min-width: 24px; text-align: center; margin-right: 6px; padding: 2px 8px;
  font-family: var(--font-num); font-size: 12px; border: 1px solid var(--hairline); border-bottom-width: 2px;
  border-radius: 7px; background: var(--glass-strong); color: var(--ink);
}

.contact-box {
  margin-top: 30px; padding: 20px 22px; border-radius: var(--r-lg);
  background: var(--glass); border: 1px solid var(--hairline);
}
.contact-box h2 { margin: 0; padding: 0; font-size: 17px; }
.contact-box p { margin-top: 6px; }

/* ---------- Footer ----------------------------------------------------------- */
.doc-foot {
  position: relative; z-index: 1; text-align: center; padding: 8px 20px 44px;
  font-size: 12.5px; color: var(--ink-3);
}
.doc-foot a { color: var(--ink-3); font-weight: 600; margin: 0 8px; }
.doc-foot a:hover { color: var(--brand-600); }

/* ---------- Small screens ---------------------------------------------------- */
@media (max-width: 900px) {
  .doc-wrap { grid-template-columns: minmax(0, 1fr); gap: 18px; padding-top: 22px; }
  .doc-toc { position: static; max-height: none; }
  .doc-toc nav { display: flex; flex-wrap: wrap; gap: 4px; }
  .doc-toc a { background: var(--glass); border: 1px solid var(--hairline); }
  .doc-nav { margin-left: 0; width: 100%; }
}

/* ---------- Printing a policy ------------------------------------------------ */
@media print {
  .field, .doc-top, .doc-toc, .doc-foot, .help-search, .draft-banner { display: none !important; }
  body.doc-body { background: #fff; }
  .doc-wrap { display: block; padding: 0; }
  .doc-card { box-shadow: none; border: 0; background: none; padding: 0; backdrop-filter: none; }
  .doc-card, .doc-card p, .doc-card li, .doc-card td { color: #111; }
  .doc-card a { color: #111; text-decoration: none; }
  .faq details { display: block; }
}
