/* =========================================================
   BillBuddy Resources (Help Center + Guides)
   Static pages that share the landing page look.
   ========================================================= */

:root {
  --bg: #f5f7fb;
  --card: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --border: #e5e7eb;
  --brand: #38006e;
  --accent: #7c3aed;
  --accent-2: #5b50e8;
  --accent-text: #38006e;
  --soft: #f3edff;
  --nav-bg: rgba(245, 247, 251, 0.82);
  --glow: rgba(124, 58, 237, 0.16);
  --shadow: 0 1px 2px rgba(17, 24, 39, 0.04), 0 12px 32px rgba(17, 24, 39, 0.07);
  --final-bg: linear-gradient(135deg, #38006e 0%, #5b21b6 55%, #6d28d9 100%);
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0b0d17;
  --card: #141725;
  --text: #f5f6ff;
  --muted: #a1a5bd;
  --border: #292d43;
  --brand: #8177ff;
  --accent: #a78bfa;
  --accent-2: #8177ff;
  --accent-text: #d8bfff;
  --soft: #241638;
  --nav-bg: rgba(11, 13, 23, 0.8);
  --glow: rgba(129, 119, 255, 0.2);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 32px rgba(0, 0, 0, 0.3);
  --final-bg: linear-gradient(135deg, #2a0a55 0%, #3b1d7a 55%, #4c2a99 100%);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
[hidden] { display: none !important; }

.container {
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding-inline: 24px;
}

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

.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--nav-bg);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 68px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.brand img { width: 34px; height: 34px; }
.brand .buddy { color: var(--accent-text); }

.nav-links {
  display: flex;
  gap: 4px;
  margin-left: 12px;
}

.nav-links a {
  padding: 8px 12px;
  border-radius: 10px;
  color: var(--muted);
  font-weight: 600;
  font-size: 15px;
}

.nav-links a:hover { color: var(--text); background: var(--soft); }
.nav-links a[aria-current="page"] { color: var(--accent-text); background: var(--soft); }

.nav-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.theme-toggle {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  cursor: pointer;
}

.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .moon { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .moon { display: block; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 20px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 15px;
  border: 1px solid transparent;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn:hover { transform: translateY(-1px); }

.btn-primary {
  background: linear-gradient(135deg, #38006e, #6d28d9);
  color: #fff;
  box-shadow: 0 8px 22px rgba(91, 33, 182, 0.28);
}

:root[data-theme="dark"] .btn-primary { background: linear-gradient(135deg, #6d5df6, #5b21b6); }

.btn-light { background: #fff; color: #38006e; }

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

.hero {
  position: relative;
  padding: 64px 0 40px;
  text-align: center;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: -40% 10% auto;
  height: 520px;
  background: radial-gradient(closest-side, var(--glow), transparent);
  pointer-events: none;
}

.hero > * { position: relative; }

.eyebrow {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--accent-text);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 16px auto 12px;
  max-width: 760px;
  font-size: clamp(32px, 5vw, 52px);
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.hero p {
  margin: 0 auto;
  max-width: 620px;
  color: var(--muted);
  font-size: 18px;
}

.search {
  position: relative;
  max-width: 560px;
  margin: 28px auto 0;
}

.search svg {
  position: absolute;
  left: 18px;
  top: 50%;
  width: 20px;
  height: 20px;
  transform: translateY(-50%);
  color: var(--muted);
}

.search input {
  width: 100%;
  height: 56px;
  padding: 0 20px 0 50px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  font: inherit;
  font-size: 16px;
  box-shadow: var(--shadow);
  outline: none;
}

.search input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--glow); }

/* ---------- Card grid ---------- */

.section { padding: 24px 0 72px; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 24px;
  border-radius: 22px;
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.card:hover { transform: translateY(-3px); border-color: var(--accent); }

.card-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--soft);
  color: var(--accent-text);
}

.card-icon svg { width: 22px; height: 22px; }

.card h2, .card h3 {
  margin: 4px 0 0;
  font-size: 19px;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.card p { margin: 0; color: var(--muted); font-size: 15px; }

.card .more {
  margin-top: auto;
  padding-top: 6px;
  color: var(--accent-text);
  font-weight: 700;
  font-size: 14px;
}

.card .tag {
  align-self: flex-start;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--accent-text);
  font-size: 12px;
  font-weight: 700;
}

.empty {
  padding: 32px;
  text-align: center;
  color: var(--muted);
}

/* ---------- Article ---------- */

.article-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 40px;
  padding: 40px 0 72px;
  align-items: start;
}

.crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 18px;
}

.crumbs a:hover { color: var(--accent-text); }

article.doc {
  padding: 40px;
  border-radius: 22px;
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

article.doc h1 {
  margin: 12px 0 8px;
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.15;
  letter-spacing: -0.025em;
}

.meta {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 24px;
}

.lead {
  font-size: 19px;
  color: var(--muted);
  margin: 0 0 8px;
}

article.doc h2 {
  margin: 36px 0 10px;
  font-size: 24px;
  letter-spacing: -0.015em;
}

article.doc h3 { margin: 24px 0 8px; font-size: 19px; }

article.doc p, article.doc li { color: var(--text); }

article.doc ol, article.doc ul { padding-left: 22px; }
article.doc li { margin: 6px 0; }
article.doc li::marker { color: var(--accent); font-weight: 700; }

article.doc a { color: var(--accent-text); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

.tip {
  margin: 20px 0;
  padding: 16px 18px;
  border-radius: 16px;
  background: var(--soft);
  border-left: 4px solid var(--accent);
}

.tip p { margin: 0; }

.table-wrap { overflow-x: auto; margin: 16px 0; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

th, td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

th { color: var(--muted); font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: 0.04em; }
tfoot td { font-weight: 800; border-bottom: 0; }
td.num, th.num { text-align: right; white-space: nowrap; }

/* ---------- Legal pages ---------- */

.legal-wrap {
  max-width: 850px;
  margin: 0 auto;
  padding: 40px 0 72px;
}

.legal-wrap article.doc a { overflow-wrap: anywhere; }

article.doc .updated {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 14px;
}

article.doc .notice {
  margin: 20px 0;
  padding: 16px 18px;
  border-radius: 16px;
  background: var(--soft);
  border-left: 4px solid var(--accent);
}

/* ---------- Sidebar ---------- */

.side {
  position: sticky;
  top: 92px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.side-box {
  padding: 22px;
  border-radius: 22px;
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.side-box h2 {
  margin: 0 0 10px;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.side-box ul { list-style: none; margin: 0; padding: 0; }
.side-box li + li { border-top: 1px solid var(--border); }
.side-box li a { display: block; padding: 10px 0; font-weight: 600; font-size: 15px; }
.side-box li a:hover { color: var(--accent-text); }

.cta-box {
  padding: 24px;
  border-radius: 22px;
  background: var(--final-bg);
  color: #fff;
}

.cta-box h2 { margin: 0 0 6px; font-size: 20px; color: #fff; text-transform: none; letter-spacing: -0.01em; }
.cta-box p { margin: 0 0 16px; color: rgba(255, 255, 255, 0.82); font-size: 15px; }
.cta-box .btn { width: 100%; }

.play-badge { display: inline-block; margin-top: 12px; }
.play-badge img { height: 48px; width: auto; display: block; }
.play-badge.is-soon { position: relative; cursor: default; }
.play-badge.is-soon img { opacity: .55; filter: grayscale(.3); }
.play-badge.is-soon::after { content: attr(data-soon); position: absolute; top: -9px; right: -10px; padding: 3px 10px; border-radius: 999px; background: #FFD43B; color: #1A0640; font-size: 12px; font-weight: 800; letter-spacing: .3px; white-space: nowrap; box-shadow: 0 4px 10px rgba(0,0,0,.18); }

/* ---------- Final CTA band ---------- */

.final {
  margin: 0 auto 72px;
  padding: 48px 32px;
  border-radius: 28px;
  background: var(--final-bg);
  color: #fff;
  text-align: center;
}

.final h2 { margin: 0 0 10px; font-size: clamp(26px, 3.6vw, 36px); letter-spacing: -0.02em; }
.final p { margin: 0 auto 22px; max-width: 520px; color: rgba(255, 255, 255, 0.82); }
.final-actions { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 14px; }
.final .play-badge { margin-top: 0; }
.final .play-badge img { height: 52px; }

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

.footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
  color: var(--muted);
  font-size: 14px;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
}

.footer nav { display: flex; flex-wrap: wrap; gap: 18px; }
.footer nav a:hover { color: var(--accent-text); }

.mobile-links {
  display: none;
  gap: 8px;
  padding: 10px 0 12px;
  overflow-x: auto;
}

.mobile-links a {
  flex: none;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
}

.mobile-links a[aria-current="page"] { color: var(--accent-text); border-color: var(--accent); }

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

@media (max-width: 960px) {
  .article-wrap { grid-template-columns: 1fr; }
  .side { position: static; }
}

@media (max-width: 960px) {
  .nav-links { display: none; }
  .mobile-links { display: flex; }
}

@media (max-width: 760px) {
  .nav-actions .btn { padding: 0 14px; min-height: 40px; font-size: 14px; }
  .hero { padding: 44px 0 28px; }
  .hero p { font-size: 16px; }
  article.doc { padding: 24px 20px; }
  .lead { font-size: 17px; }
  .container { padding-inline: 16px; }
  .final { padding: 36px 20px; border-radius: 22px; }
}

