/* ===================================================================
   PACKTRACK ONE — Legal Pages Stylesheet
   Dark theme: Deep Navy #1E2A3A background, light text
   =================================================================== */

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

html {
  -moz-text-size-adjust: none;
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}

:root {
  --font-body: 'General Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --color-primary: #1a8bc5;
  --color-primary-hover: #1578ab;
  --color-bg: #1E2A3A;
  --color-bg-elevated: #253446;
  --color-text: #e2e8f0;
  --color-text-secondary: #94a3b8;
  --color-text-muted: #64748b;
  --color-border: rgba(255, 255, 255, 0.1);
  --content-narrow: 780px;
}

body {
  min-height: 100dvh;
  line-height: 1.6;
  font-family: var(--font-body);
  font-size: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  color: var(--color-text);
  background-color: var(--color-bg);
  display: flex;
  flex-direction: column;
}

a {
  color: var(--color-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.15s ease;
}
a:hover {
  color: var(--color-primary-hover);
}

::selection {
  background: rgba(26, 139, 197, 0.3);
  color: #ffffff;
}

:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
  border-radius: 4px;
}

img, svg { display: block; max-width: 100%; height: auto; }

/* ---------- NAVIGATION ---------- */
.legal-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(30, 42, 58, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
}

.legal-nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--content-narrow);
  margin: 0 auto;
  padding: 1rem 1.5rem;
}

.legal-nav__logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--color-text);
  transition: opacity 0.15s ease;
}
.legal-nav__logo:hover { opacity: 0.8; }

.legal-nav__logo-text {
  font-weight: 600;
  font-size: 1.125rem;
  color: var(--color-text);
  letter-spacing: -0.02em;
}

.legal-nav__logo-accent {
  color: var(--color-primary);
}

.legal-nav__back {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  text-decoration: none;
  transition: color 0.15s ease;
}
.legal-nav__back:hover {
  color: var(--color-primary);
}

/* ---------- MAIN CONTENT ---------- */
.legal-main {
  flex: 1;
  padding: clamp(2rem, 5vw, 4rem) 1.5rem;
}

.legal-content {
  max-width: var(--content-narrow);
  margin: 0 auto;
}

/* Header */
.legal-header {
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--color-border);
}

.legal-header h1 {
  font-size: clamp(2rem, 1.5rem + 2vw, 3rem);
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: 1rem;
}

.legal-meta {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.legal-effective,
.legal-updated {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-primary);
  background: rgba(26, 139, 197, 0.1);
  padding: 0.375rem 0.875rem;
  border-radius: 9999px;
}

/* Headings */
.legal-content h2 {
  font-size: clamp(1.375rem, 1.2rem + 0.75vw, 1.75rem);
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.01em;
  margin-top: 3rem;
  margin-bottom: 1rem;
  padding-top: 2rem;
  border-top: 1px solid var(--color-border);
}

.legal-content h2:first-of-type {
  border-top: none;
  padding-top: 0;
}

.legal-content h3 {
  font-size: clamp(1.05rem, 1rem + 0.25vw, 1.25rem);
  font-weight: 600;
  color: #e2e8f0;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.legal-content h4 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-primary);
  margin-top: 1.75rem;
  margin-bottom: 0.5rem;
}

/* Paragraphs */
.legal-content p {
  color: var(--color-text-secondary);
  line-height: 1.75;
  margin-bottom: 1rem;
}

.legal-content strong {
  color: var(--color-text);
  font-weight: 600;
}

/* Lists */
.legal-content ul,
.legal-content ol {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

.legal-content ul { list-style: disc; }
.legal-content ol { list-style: decimal; }

.legal-content li {
  color: var(--color-text-secondary);
  line-height: 1.75;
  margin-bottom: 0.375rem;
}

.legal-content li::marker {
  color: var(--color-primary);
}

/* Tables */
.legal-table-wrap {
  overflow-x: auto;
  margin: 1.5rem 0;
  border-radius: 0.75rem;
  border: 1px solid var(--color-border);
}

.legal-content table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.legal-content th,
.legal-content td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}

.legal-content th {
  font-weight: 600;
  color: var(--color-text);
  background: var(--color-bg-elevated);
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.legal-content td {
  color: var(--color-text-secondary);
}

.legal-content tbody tr:last-child td {
  border-bottom: none;
}

.legal-content tbody tr:hover {
  background: rgba(26, 139, 197, 0.05);
}

/* Last updated note */
.legal-last-updated {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--color-border);
  color: var(--color-text-muted);
  font-size: 0.875rem;
}

/* ---------- FOOTER ---------- */
.legal-footer {
  border-top: 1px solid var(--color-border);
  padding: 2rem 1.5rem;
  background: rgba(30, 42, 58, 0.5);
}

.legal-footer__inner {
  max-width: var(--content-narrow);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}

.legal-footer__links {
  display: flex;
  gap: 1.5rem;
}

.legal-footer__links a {
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color 0.15s ease;
}
.legal-footer__links a:hover {
  color: var(--color-primary);
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 600px) {
  .legal-nav__inner {
    padding: 0.75rem 1rem;
  }

  .legal-main {
    padding: 1.5rem 1rem;
  }

  .legal-meta {
    flex-direction: column;
    gap: 0.5rem;
  }

  .legal-effective,
  .legal-updated {
    display: inline-block;
    width: fit-content;
  }

  .legal-footer__inner {
    flex-direction: column;
    text-align: center;
  }

  .legal-footer__links {
    justify-content: center;
  }

  .legal-content th,
  .legal-content td {
    padding: 0.5rem 0.75rem;
    font-size: 0.8125rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
