/* ============================================
   ALRA — Legal Pages (Privacy Policy, Terms)
   Consistent with brand design system
   ============================================ */

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

:root {
  /* Brand Primary */
  --forest-teal: #0D7C66;
  --forest-teal-dark: #096B57;
  --forest-teal-light: rgba(13, 124, 102, 0.07);
  --deep-night: #0B1723;
  --deep-night-soft: #122235;

  /* Brand Secondary */
  --soft-sage: #A8D5BA;
  --warm-amber: #F2A65A;
  --coral-rose: #E85D75;

  /* Brand Neutrals */
  --cloud-white: #F7F9FC;
  --light-gray: #E2E8F0;
  --slate-gray: #64748B;
  --charcoal: #334155;
  --muted: #9fb7cf;

  /* Extended teal scale */
  --teal-900: #063D33;
  --teal-800: #07594A;
  --teal-700: #096B57;
  --teal-600: #0D7C66;
  --teal-500: #10A37F;
  --teal-400: #3DBEA0;
  --teal-300: #7DD4BF;
  --teal-200: #B5E6D8;
  --teal-100: #E0F5EF;
  --teal-50: #F0FAF6;

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  --space-4xl: 6rem;
  --space-5xl: 8rem;

  /* Typography */
  --font-heading: 'Inter', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Transitions */
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);

  /* Misc */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 999px;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-weight: 400;
  color: var(--charcoal);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: var(--cloud-white);
  overflow-x: hidden;
}

/* ============================================
   Navigation
   ============================================ */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: var(--space-md) 0;
  background: rgba(247, 249, 252, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
  transition: padding 0.3s;
}

.topbar.scrolled {
  padding: 0.6rem 0;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-xl);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand img {
  height: 28px;
  width: auto;
  transition: opacity 0.2s;
}

.brand img:hover {
  opacity: 0.7;
}

.top-links {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

.top-links a {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--slate-gray);
  text-decoration: none;
  transition: color 0.2s;
}

.top-links a:hover {
  color: var(--forest-teal);
}

.lang-switcher {
  display: flex;
  gap: 2px;
  background: rgba(226, 232, 240, 0.8);
  border-radius: var(--radius-sm);
  padding: 2px;
}

.lang-btn {
  padding: 0.3rem 0.6rem;
  font-size: 0.7rem;
  font-weight: 600;
  font-family: var(--font-body);
  letter-spacing: 0.04em;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--slate-gray);
  cursor: pointer;
  transition: all 0.25s var(--ease-out-quart);
}

.lang-btn:hover {
  color: var(--forest-teal);
}

.lang-btn.active {
  color: var(--forest-teal-dark);
  background: var(--cloud-white);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* ============================================
   Legal Content
   ============================================ */
.legal-hero {
  position: relative;
  padding: calc(var(--space-5xl) + 60px) 0 var(--space-3xl);
  background: var(--deep-night);
  overflow: hidden;
}

.legal-hero-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.legal-hero-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
}

.legal-hero-orb--1 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(13, 124, 102, 0.25) 0%, transparent 70%);
  top: -20%;
  right: -10%;
}

.legal-hero-orb--2 {
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(168, 213, 186, 0.12) 0%, transparent 70%);
  bottom: -30%;
  left: -5%;
}

.legal-hero-grain {
  position: absolute;
  inset: 0;
  opacity: 0.35;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.5'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 128px;
  pointer-events: none;
}

.legal-hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
}

.legal-hero-content h1 {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  color: #fff;
  margin-bottom: var(--space-md);
  letter-spacing: -0.02em;
}

.legal-hero-content .legal-updated {
  font-size: 0.875rem;
  color: var(--muted);
}

/* ============================================
   Legal Body
   ============================================ */
.legal-body {
  padding: var(--space-4xl) 0 var(--space-5xl);
}

.legal-content {
  max-width: 760px;
  margin: 0 auto;
}

.legal-content h2 {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--deep-night);
  margin-top: var(--space-3xl);
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: 2px solid var(--teal-100);
}

.legal-content h2:first-child {
  margin-top: 0;
}

.legal-content h3 {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--charcoal);
  margin-top: var(--space-xl);
  margin-bottom: var(--space-sm);
}

.legal-content p {
  font-size: 0.95rem;
  color: var(--charcoal);
  line-height: 1.8;
  margin-bottom: var(--space-md);
}

.legal-content ul,
.legal-content ol {
  margin: var(--space-sm) 0 var(--space-lg) var(--space-xl);
}

.legal-content li {
  font-size: 0.95rem;
  color: var(--charcoal);
  line-height: 1.8;
  margin-bottom: var(--space-sm);
}

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

.legal-content a {
  color: var(--forest-teal);
  text-decoration: underline;
  text-decoration-color: var(--teal-200);
  text-underline-offset: 2px;
  transition: color 0.2s, text-decoration-color 0.2s;
}

.legal-content a:hover {
  color: var(--forest-teal-dark);
  text-decoration-color: var(--forest-teal);
}

.legal-content .highlight-box {
  background: var(--teal-50);
  border: 1px solid var(--teal-200);
  border-left: 4px solid var(--forest-teal);
  border-radius: var(--radius-md);
  padding: var(--space-lg) var(--space-xl);
  margin: var(--space-xl) 0;
}

.legal-content .highlight-box p {
  margin-bottom: 0;
  color: var(--teal-800);
  font-size: 0.9rem;
}

/* Table of Contents */
.legal-toc {
  background: var(--cloud-white);
  border: 1px solid var(--light-gray);
  border-radius: var(--radius-lg);
  padding: var(--space-xl) var(--space-2xl);
  margin-bottom: var(--space-3xl);
}

.legal-toc p {
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--forest-teal);
  margin-bottom: var(--space-md);
}

.legal-toc ol {
  margin: 0;
  padding-left: var(--space-lg);
}

.legal-toc li {
  font-size: 0.9rem;
  margin-bottom: var(--space-xs);
}

.legal-toc a {
  color: var(--charcoal);
  text-decoration: none;
  transition: color 0.2s;
}

.legal-toc a:hover {
  color: var(--forest-teal);
}

/* Cross links */
.legal-cross-links {
  margin-top: var(--space-3xl);
  padding-top: var(--space-2xl);
  border-top: 1px solid var(--light-gray);
  display: flex;
  gap: var(--space-lg);
  flex-wrap: wrap;
}

.legal-cross-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 0.7rem 1.2rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--forest-teal);
  background: var(--teal-50);
  border: 1px solid var(--teal-200);
  border-radius: var(--radius-full);
  text-decoration: none;
  transition: all 0.25s var(--ease-out-quart);
}

.legal-cross-link:hover {
  background: var(--teal-100);
  border-color: var(--forest-teal);
  transform: translateY(-1px);
}

.legal-cross-link svg {
  width: 16px;
  height: 16px;
}

/* ============================================
   Footer
   ============================================ */
.legal-footer {
  padding: var(--space-3xl) 0;
  background: var(--deep-night);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.legal-footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-lg);
}

.legal-footer-logo {
  height: 24px;
  width: auto;
  opacity: 0.4;
  filter: brightness(0) invert(1);
}

.legal-footer p {
  font-size: 0.78rem;
  color: var(--slate-gray);
  text-align: center;
}

.legal-footer a {
  color: var(--slate-gray);
  text-decoration: none;
  transition: color 0.2s;
}

.legal-footer a:hover {
  color: var(--teal-300);
}

.footer-links {
  display: flex;
  gap: var(--space-lg);
  flex-wrap: wrap;
  justify-content: center;
}

.footer-links a {
  font-size: 0.82rem;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--teal-300);
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 640px) {
  .legal-hero {
    padding: calc(var(--space-4xl) + 60px) 0 var(--space-2xl);
  }

  .legal-body {
    padding: var(--space-2xl) 0 var(--space-4xl);
  }

  .legal-content h2 {
    font-size: 1.2rem;
  }

  .legal-toc {
    padding: var(--space-lg);
  }

  .legal-cross-links {
    flex-direction: column;
  }
}

/* ============================================
   Selection & Scrollbar
   ============================================ */
::selection {
  background: var(--teal-200);
  color: var(--deep-night);
}

::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--cloud-white);
}

::-webkit-scrollbar-thumb {
  background: var(--light-gray);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--slate-gray);
}
