/* ============================================================
   PPLX Software — Shared Stylesheet
   Source of truth: /faq/index.html (canonical dark-theme page)
   ============================================================ */

/* --- Reset & Root Variables --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --navy: #0f172a;
  --navy-light: #1e293b;
  --navy-mid: #162036;
  --slate: #334155;
  --slate-light: #475569;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --white: #ffffff;
  --blue: #60a5fa;
  --blue-dim: #3b82f6;
  --blue-glow: rgba(96, 165, 250, 0.15);
  --green: #34d399;
  --radius: 12px;
  --radius-sm: 8px;
  --max-width: 1120px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Base --- */
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--navy);
  color: var(--white);
  line-height: 1.6;
  overflow-x: hidden;
}

/* Dot grid overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: radial-gradient(circle, rgba(96, 165, 250, 0.06) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
  z-index: 0;
}

/* Gradient overlay */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(96, 165, 250, 0.04) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

/* --- Navigation --- */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 16px 0;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05);
}

.nav-inner { max-width: var(--max-width); margin: 0 auto; padding: 0 24px; display: flex; align-items: center; justify-content: space-between; }
.nav-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--white); font-weight: 700; font-size: 1.05rem; }
.nav-logo { width: 32px; height: 32px; background: linear-gradient(135deg, var(--blue), #818cf8); border-radius: 8px; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 0.85rem; color: var(--white); }
.nav-links { display: flex; align-items: center; gap: 32px; list-style: none; }
.nav-links a { color: var(--gray-400); text-decoration: none; font-size: 0.9rem; font-weight: 500; transition: color var(--transition); }
.nav-links a:hover { color: var(--white); }
.nav-cta { background: var(--blue); color: var(--navy) !important; padding: 8px 18px; border-radius: var(--radius-sm); font-weight: 600 !important; transition: background var(--transition), transform var(--transition) !important; }
.nav-cta:hover { background: #93c5fd !important; transform: translateY(-1px); }
.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: 4px; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--gray-400); margin: 5px 0; transition: var(--transition); border-radius: 1px; }

@media (max-width: 768px) {
  .nav-toggle { display: block; }
  .nav-links { display: none; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; gap: 0; background: rgba(15, 23, 42, 0.97); backdrop-filter: blur(16px); padding: 8px 24px 16px; border-bottom: 1px solid rgba(255, 255, 255, 0.05); }
  .nav-links.open { display: flex; }
  .nav-links li { width: 100%; }
  .nav-links a { display: block; padding: 12px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.04); }
  .nav-cta { display: inline-block; margin-top: 8px; text-align: center; }
}

/* --- Doc Layout --- */
.doc-wrapper { position: relative; z-index: 1; padding-top: 100px; padding-bottom: 80px; }
.doc-content { max-width: 800px; margin: 0 auto; padding: 0 24px; }
.doc-content h1 { font-size: clamp(1.75rem, 3.5vw, 2.5rem); font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; margin-bottom: 8px; }
.doc-subtitle { color: var(--gray-400); font-size: 1.05rem; margin-bottom: 40px; line-height: 1.6; }

/* --- Section Titles --- */
.section-heading {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
  color: var(--white);
  padding-top: 32px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  margin-top: 48px;
}

/* --- FAQ Accordion --- */
.faq-category { margin-top: 48px; padding-top: 32px; border-top: 1px solid rgba(255, 255, 255, 0.06); }
.faq-category:first-of-type { border-top: none; padding-top: 0; margin-top: 0; }
.faq-category h2 { font-size: 1.35rem; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 20px; color: var(--blue); }

.faq-item { border: 1px solid rgba(255, 255, 255, 0.06); border-radius: var(--radius-sm); margin-bottom: 8px; overflow: hidden; background: var(--navy-light); transition: border-color var(--transition); }
.faq-item:hover { border-color: rgba(96, 165, 250, 0.2); }

.faq-question {
  width: 100%;
  background: none;
  border: none;
  color: var(--white);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  text-align: left;
  padding: 18px 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  transition: color var(--transition);
}

.faq-question:hover { color: var(--blue); }

.faq-question::after {
  content: '+';
  font-size: 1.3rem;
  font-weight: 400;
  color: var(--gray-400);
  flex-shrink: 0;
  transition: transform var(--transition);
}

.faq-item.open .faq-question::after {
  content: '-';
  transform: rotate(0deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, padding 0.3s ease;
}

.faq-item.open .faq-answer {
  max-height: 800px;
}

.faq-answer-inner {
  padding: 0 20px 20px;
  color: var(--gray-300);
  line-height: 1.7;
}

.faq-answer-inner p { margin-bottom: 12px; color: var(--gray-300); }
.faq-answer-inner ul, .faq-answer-inner ol { margin-bottom: 12px; padding-left: 24px; }
.faq-answer-inner li { margin-bottom: 6px; }
.faq-answer-inner strong { color: var(--white); }
.faq-answer-inner a { color: var(--blue); text-decoration: none; }
.faq-answer-inner a:hover { text-decoration: underline; }
.faq-answer-inner code { background: var(--navy); padding: 2px 6px; border-radius: 4px; font-size: 0.88em; color: var(--blue); }

.faq-answer-inner table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 0.9rem; }
.faq-answer-inner th { text-align: left; padding: 10px 14px; background: var(--navy); color: var(--white); font-weight: 600; border-bottom: 2px solid rgba(96, 165, 250, 0.2); }
.faq-answer-inner td { padding: 8px 14px; border-bottom: 1px solid rgba(255, 255, 255, 0.04); color: var(--gray-300); }

/* --- CTA Button --- */
.btn-cta {
  display: inline-block;
  background: var(--blue);
  color: var(--navy) !important;
  padding: 12px 28px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none !important;
  transition: background var(--transition), transform var(--transition);
}
.btn-cta:hover {
  background: #93c5fd;
  transform: translateY(-1px);
  text-decoration: none !important;
}

/* --- Doc Content Typography --- */
.doc-content h2 { font-size: 1.4rem; font-weight: 700; margin-top: 48px; margin-bottom: 16px; letter-spacing: -0.02em; padding-bottom: 8px; border-bottom: 1px solid rgba(255,255,255,0.06); }
.doc-content h3 { font-size: 1.15rem; font-weight: 600; margin-top: 32px; margin-bottom: 12px; color: var(--blue); }
.doc-content p { margin-bottom: 16px; color: var(--gray-300); line-height: 1.7; }
.doc-content ul, .doc-content ol { margin-bottom: 16px; padding-left: 24px; }
.doc-content li { margin-bottom: 8px; color: var(--gray-300); line-height: 1.6; }
.doc-content strong { color: var(--white); }
.doc-content a { color: var(--blue); text-decoration: none; }
.doc-content a:hover { text-decoration: underline; }
.doc-content table { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: 0.9rem; }
.doc-content th { text-align: left; padding: 10px 14px; background: var(--navy); color: var(--white); font-weight: 600; border-bottom: 2px solid rgba(96,165,250,0.2); }
.doc-content td { padding: 8px 14px; border-bottom: 1px solid rgba(255,255,255,0.04); color: var(--gray-300); }

/* --- Doc Meta --- */
.doc-meta { color: var(--gray-400); font-size: 0.9rem; margin-bottom: 40px; padding-bottom: 32px; border-bottom: 1px solid rgba(255,255,255,0.06); }

/* --- Doc Table of Contents --- */
.doc-toc { background: var(--navy-light); border: 1px solid rgba(255, 255, 255, 0.06); border-radius: var(--radius); padding: 24px 28px; margin-bottom: 48px; }
.doc-toc h4 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--gray-400); margin-bottom: 12px; }
.doc-toc ol { padding-left: 20px; color: var(--gray-300); }
.doc-toc li { margin-bottom: 6px; }
.doc-toc a { color: var(--blue); text-decoration: none; font-size: 0.95rem; }
.doc-toc a:hover { text-decoration: underline; }

/* --- Highlight Box (security page) --- */
.highlight-box { background: var(--navy-light); border: 1px solid rgba(96, 165, 250, 0.15); border-radius: var(--radius); padding: 24px; margin: 24px 0; }
.highlight-box p { margin-bottom: 8px; }
.highlight-box p:last-child { margin-bottom: 0; }

/* --- Doc Code --- */
.doc-content code { background: var(--navy-light); padding: 2px 6px; border-radius: 4px; font-size: 0.88em; color: var(--blue); }

/* --- Footer --- */
footer { border-top: 1px solid rgba(255, 255, 255, 0.05); padding: 40px 0; position: relative; z-index: 1; }
.footer-inner { max-width: var(--max-width); margin: 0 auto; padding: 0 24px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 20px; }
.footer-brand { display: flex; align-items: center; gap: 8px; font-size: 0.9rem; font-weight: 600; color: var(--gray-400); }
.footer-brand .nav-logo { width: 24px; height: 24px; font-size: 0.65rem; border-radius: 6px; }
.footer-links { display: flex; gap: 24px; list-style: none; }
.footer-links a { color: var(--gray-500); text-decoration: none; font-size: 0.85rem; transition: color var(--transition); }
.footer-links a:hover { color: var(--gray-300); }
.footer-copy { width: 100%; text-align: center; padding-top: 24px; margin-top: 8px; border-top: 1px solid rgba(255, 255, 255, 0.04); font-size: 0.8rem; color: var(--gray-500); }

@media (max-width: 768px) {
  .footer-inner { flex-direction: column; align-items: flex-start; }
  .footer-links { flex-wrap: wrap; gap: 16px; }
}
