/* =========================================
   Antria CRM — Legal Pages Design System
   Premium 2026 · Dark Theme · Glassmorphism
   ========================================= */

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

/* ---------- Design Tokens ---------- */
:root {
  --ac-bg: #060b18;
  --ac-bg-secondary: #0c1225;
  --ac-surface: rgba(15, 23, 50, 0.6);
  --ac-surface-solid: #0f1732;
  --ac-glass: rgba(255, 255, 255, 0.03);
  --ac-glass-border: rgba(255, 255, 255, 0.06);
  --ac-glass-border-hover: rgba(255, 255, 255, 0.12);
  --ac-primary: #00d4aa;
  --ac-primary-dark: #00b894;
  --ac-primary-glow: rgba(0, 212, 170, 0.15);
  --ac-primary-glow-strong: rgba(0, 212, 170, 0.3);
  --ac-accent: #6c5ce7;
  --ac-accent-glow: rgba(108, 92, 231, 0.15);
  --ac-cyan: #00cec9;
  --ac-text: #e2e8f0;
  --ac-text-muted: #8892a8;
  --ac-text-dim: #5a6478;
  --ac-white: #ffffff;
  --ac-danger: #ff6b6b;
  --ac-warning: #feca57;
  --ac-radius: 20px;
  --ac-radius-sm: 12px;
  --ac-radius-xs: 8px;
  --ac-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --ac-font-display: 'Outfit', var(--ac-font);
  --ac-transition: cubic-bezier(0.22, 0.61, 0.36, 1);
}

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

body {
  font-family: var(--ac-font);
  background: var(--ac-bg);
  color: var(--ac-text);
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: var(--ac-primary); text-decoration: none; transition: color 0.3s; }
a:hover { color: var(--ac-cyan); }

img { max-width: 100%; display: block; }

/* ---------- Animated Background ---------- */
.ac-bg-mesh {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.ac-bg-mesh .orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.4;
  animation: orbDrift 20s ease-in-out infinite alternate;
}

.ac-bg-mesh .orb-1 {
  width: 700px; height: 700px;
  background: var(--ac-primary-glow);
  top: -20%; left: -15%;
}

.ac-bg-mesh .orb-2 {
  width: 500px; height: 500px;
  background: var(--ac-accent-glow);
  top: 30%; right: -15%;
  animation-delay: -7s;
  animation-duration: 25s;
}

.ac-bg-mesh .orb-3 {
  width: 400px; height: 400px;
  background: rgba(0, 206, 201, 0.1);
  bottom: -10%; left: 40%;
  animation-delay: -12s;
  animation-duration: 28s;
}

@keyframes orbDrift {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(50px, -40px) scale(1.1); }
  100% { transform: translate(-30px, 30px) scale(0.95); }
}

/* ---------- Noise Overlay ---------- */
.ac-bg-mesh::after {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
  opacity: 0.5;
  pointer-events: none;
}

/* ---------- Container ---------- */
.ac-container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

/* ---------- Header ---------- */
.ac-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 16px 0;
  transition: background 0.4s, backdrop-filter 0.4s, box-shadow 0.4s;
}

.ac-header.scrolled {
  background: rgba(6, 11, 24, 0.85);
  backdrop-filter: blur(20px) saturate(1.5);
  box-shadow: 0 1px 0 var(--ac-glass-border), 0 8px 32px rgba(0,0,0,0.3);
}

.ac-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.ac-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ac-white);
  font-family: var(--ac-font-display);
  font-weight: 800;
  font-size: 1.4rem;
  letter-spacing: -0.5px;
}

.ac-logo-icon {
  width: 38px; height: 38px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--ac-primary), var(--ac-accent));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: var(--ac-white);
  box-shadow: 0 4px 16px var(--ac-primary-glow);
}

.ac-logo span {
  background: linear-gradient(135deg, var(--ac-primary), var(--ac-cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.ac-header-nav {
  display: flex;
  align-items: center;
  gap: 32px;
  list-style: none;
}

.ac-header-nav a {
  color: var(--ac-text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.3s;
  position: relative;
}

.ac-header-nav a:hover,
.ac-header-nav a.active {
  color: var(--ac-white);
}

.ac-header-nav a.active::after {
  content: '';
  position: absolute;
  bottom: -6px; left: 0; right: 0;
  height: 2px;
  background: var(--ac-primary);
  border-radius: 2px;
}

.ac-btn-header {
  padding: 10px 24px;
  border-radius: 50px;
  background: linear-gradient(135deg, var(--ac-primary), var(--ac-primary-dark));
  color: var(--ac-bg) !important;
  font-weight: 700;
  font-size: 0.85rem;
  border: none;
  cursor: pointer;
  transition: transform 0.3s var(--ac-transition), box-shadow 0.3s;
  box-shadow: 0 4px 20px var(--ac-primary-glow);
}

.ac-btn-header:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px var(--ac-primary-glow-strong);
  color: var(--ac-bg) !important;
}

/* Mobile menu toggle */
.ac-menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--ac-white);
  font-size: 1.6rem;
  cursor: pointer;
  padding: 4px;
}

/* ---------- Page Hero ---------- */
.ac-page-hero {
  padding: 160px 0 60px;
  position: relative;
  overflow: hidden;
}

.ac-page-hero::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 120px;
  background: linear-gradient(to top, var(--ac-bg), transparent);
  pointer-events: none;
}

.ac-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
  font-size: 0.85rem;
}

.ac-breadcrumb a { color: var(--ac-text-muted); }
.ac-breadcrumb a:hover { color: var(--ac-primary); }
.ac-breadcrumb .sep { color: var(--ac-text-dim); font-size: 0.7rem; }
.ac-breadcrumb .current { color: var(--ac-text); font-weight: 500; }

.ac-page-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: 50px;
  background: var(--ac-primary-glow);
  color: var(--ac-primary);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 20px;
  border: 1px solid rgba(0, 212, 170, 0.15);
}

.ac-page-title {
  font-family: var(--ac-font-display);
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 800;
  line-height: 1.15;
  color: var(--ac-white);
  margin-bottom: 16px;
  letter-spacing: -1px;
}

.ac-page-subtitle {
  font-size: 1.1rem;
  color: var(--ac-text-muted);
  max-width: 640px;
  line-height: 1.7;
}

.ac-page-meta {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-top: 24px;
  font-size: 0.85rem;
  color: var(--ac-text-dim);
}

.ac-page-meta span {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ---------- Legal Content Layout ---------- */
.ac-legal-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 48px;
  padding-bottom: 100px;
}

/* Sidebar TOC */
.ac-toc {
  position: sticky;
  top: 100px;
  align-self: start;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  padding-right: 12px;
}

.ac-toc::-webkit-scrollbar { width: 3px; }
.ac-toc::-webkit-scrollbar-track { background: transparent; }
.ac-toc::-webkit-scrollbar-thumb { background: var(--ac-glass-border); border-radius: 10px; }

.ac-toc-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ac-text-dim);
  margin-bottom: 16px;
}

.ac-toc-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ac-toc-list a {
  display: block;
  padding: 8px 14px;
  border-radius: var(--ac-radius-xs);
  color: var(--ac-text-muted);
  font-size: 0.82rem;
  font-weight: 500;
  transition: all 0.3s;
  border-left: 2px solid transparent;
}

.ac-toc-list a:hover {
  color: var(--ac-text);
  background: var(--ac-glass);
}

.ac-toc-list a.active {
  color: var(--ac-primary);
  background: var(--ac-primary-glow);
  border-left-color: var(--ac-primary);
}

/* ---------- Legal Content ---------- */
.ac-legal-content {
  min-width: 0;
}

.ac-legal-section {
  padding: 40px;
  border-radius: var(--ac-radius);
  background: var(--ac-surface);
  border: 1px solid var(--ac-glass-border);
  backdrop-filter: blur(12px);
  margin-bottom: 24px;
  transition: border-color 0.4s;
  animation: fadeInUp 0.6s var(--ac-transition) both;
}

.ac-legal-section:hover {
  border-color: var(--ac-glass-border-hover);
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.ac-legal-section:nth-child(2) { animation-delay: 0.1s; }
.ac-legal-section:nth-child(3) { animation-delay: 0.15s; }
.ac-legal-section:nth-child(4) { animation-delay: 0.2s; }
.ac-legal-section:nth-child(5) { animation-delay: 0.25s; }
.ac-legal-section:nth-child(6) { animation-delay: 0.3s; }
.ac-legal-section:nth-child(7) { animation-delay: 0.35s; }
.ac-legal-section:nth-child(8) { animation-delay: 0.4s; }

.ac-legal-section h2 {
  font-family: var(--ac-font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--ac-white);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.ac-legal-section h2 .sec-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--ac-primary), var(--ac-accent));
  color: var(--ac-white);
  font-size: 0.85rem;
  font-weight: 800;
  flex-shrink: 0;
  box-shadow: 0 4px 16px var(--ac-primary-glow);
}

.ac-legal-section h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--ac-text);
  margin: 24px 0 12px;
}

.ac-legal-section p {
  color: var(--ac-text-muted);
  font-size: 0.95rem;
  line-height: 1.8;
  margin-bottom: 14px;
}

.ac-legal-section p:last-child { margin-bottom: 0; }

.ac-legal-section ul,
.ac-legal-section ol {
  padding-left: 20px;
  margin: 12px 0;
  color: var(--ac-text-muted);
  font-size: 0.95rem;
  line-height: 1.8;
}

.ac-legal-section li {
  margin-bottom: 8px;
  padding-left: 4px;
}

.ac-legal-section ul li::marker {
  color: var(--ac-primary);
}

.ac-legal-section ol li::marker {
  color: var(--ac-primary);
  font-weight: 700;
}

/* Highlight / Info Boxes */
.ac-info-box {
  display: flex;
  gap: 16px;
  padding: 20px 24px;
  border-radius: var(--ac-radius-sm);
  background: var(--ac-primary-glow);
  border: 1px solid rgba(0, 212, 170, 0.12);
  margin: 20px 0;
}

.ac-info-box.warning {
  background: rgba(254, 202, 87, 0.08);
  border-color: rgba(254, 202, 87, 0.15);
}

.ac-info-box.danger {
  background: rgba(255, 107, 107, 0.08);
  border-color: rgba(255, 107, 107, 0.15);
}

.ac-info-box-icon {
  font-size: 1.3rem;
  color: var(--ac-primary);
  flex-shrink: 0;
  margin-top: 2px;
}

.ac-info-box.warning .ac-info-box-icon { color: var(--ac-warning); }
.ac-info-box.danger .ac-info-box-icon { color: var(--ac-danger); }

.ac-info-box-content h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ac-white);
  margin-bottom: 6px;
}

.ac-info-box-content p {
  font-size: 0.88rem;
  color: var(--ac-text-muted);
  margin: 0;
  line-height: 1.6;
}

/* Data Table */
.ac-table-wrap {
  overflow-x: auto;
  margin: 20px 0;
  border-radius: var(--ac-radius-sm);
  border: 1px solid var(--ac-glass-border);
}

.ac-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.ac-table th {
  background: rgba(0, 212, 170, 0.08);
  color: var(--ac-primary);
  font-weight: 700;
  text-align: left;
  padding: 14px 18px;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--ac-glass-border);
}

.ac-table td {
  padding: 12px 18px;
  color: var(--ac-text-muted);
  border-bottom: 1px solid var(--ac-glass-border);
}

.ac-table tr:last-child td { border-bottom: none; }
.ac-table tr:hover td { background: var(--ac-glass); }

/* Security Grid */
.ac-security-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin: 20px 0;
}

.ac-security-item {
  padding: 24px;
  border-radius: var(--ac-radius-sm);
  background: var(--ac-glass);
  border: 1px solid var(--ac-glass-border);
  transition: border-color 0.3s, transform 0.3s var(--ac-transition);
}

.ac-security-item:hover {
  border-color: var(--ac-glass-border-hover);
  transform: translateY(-3px);
}

.ac-security-item i {
  font-size: 1.5rem;
  color: var(--ac-primary);
  margin-bottom: 12px;
  display: block;
}

.ac-security-item h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ac-white);
  margin-bottom: 8px;
}

.ac-security-item p {
  font-size: 0.85rem;
  color: var(--ac-text-muted);
  margin: 0;
  line-height: 1.6;
}

/* Rights Cards */
.ac-rights-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 20px 0;
}

.ac-right-item {
  display: flex;
  gap: 16px;
  padding: 20px;
  border-radius: var(--ac-radius-sm);
  background: var(--ac-glass);
  border: 1px solid var(--ac-glass-border);
  transition: border-color 0.3s, transform 0.3s var(--ac-transition);
}

.ac-right-item:hover {
  border-color: rgba(0, 212, 170, 0.2);
  transform: translateX(4px);
}

.ac-right-item i {
  font-size: 1.3rem;
  color: var(--ac-primary);
  flex-shrink: 0;
  margin-top: 2px;
}

.ac-right-item h5 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ac-white);
  margin-bottom: 4px;
}

.ac-right-item p {
  font-size: 0.85rem;
  color: var(--ac-text-muted);
  margin: 0;
}

/* Contact Section */
.ac-contact-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 20px 0;
}

.ac-contact-card {
  padding: 24px;
  border-radius: var(--ac-radius-sm);
  background: var(--ac-glass);
  border: 1px solid var(--ac-glass-border);
  text-align: center;
  transition: border-color 0.3s, transform 0.3s var(--ac-transition);
}

.ac-contact-card:hover {
  border-color: var(--ac-primary);
  transform: translateY(-4px);
}

.ac-contact-card i {
  font-size: 1.5rem;
  color: var(--ac-primary);
  margin-bottom: 12px;
  display: block;
}

.ac-contact-card h5 {
  font-size: 0.85rem;
  color: var(--ac-text-dim);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.ac-contact-card p {
  font-size: 0.92rem;
  color: var(--ac-text);
  font-weight: 500;
  margin: 0;
}

/* ---------- Footer ---------- */
.ac-footer {
  padding: 48px 0 32px;
  border-top: 1px solid var(--ac-glass-border);
  position: relative;
  z-index: 1;
}

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

.ac-footer-copy {
  font-size: 0.85rem;
  color: var(--ac-text-dim);
}

.ac-footer-copy strong {
  color: var(--ac-text-muted);
  font-weight: 600;
}

.ac-footer-links {
  display: flex;
  gap: 24px;
  list-style: none;
}

.ac-footer-links a {
  font-size: 0.85rem;
  color: var(--ac-text-muted);
  transition: color 0.3s;
}

.ac-footer-links a:hover { color: var(--ac-primary); }

/* ---------- Scroll to Top ---------- */
.ac-scroll-top {
  position: fixed;
  bottom: 30px; right: 30px;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--ac-primary), var(--ac-primary-dark));
  color: var(--ac-bg);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  z-index: 50;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all 0.4s var(--ac-transition);
  box-shadow: 0 4px 20px var(--ac-primary-glow);
}

.ac-scroll-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.ac-scroll-top:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px var(--ac-primary-glow-strong);
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .ac-legal-layout {
    grid-template-columns: 220px 1fr;
    gap: 32px;
  }
}

@media (max-width: 768px) {
  .ac-legal-layout {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .ac-toc {
    position: relative;
    top: 0;
    max-height: none;
    margin-bottom: 32px;
    padding: 20px;
    border-radius: var(--ac-radius);
    background: var(--ac-surface);
    border: 1px solid var(--ac-glass-border);
  }

  .ac-legal-section { padding: 28px 24px; }

  .ac-header-nav { display: none; }
  .ac-menu-toggle { display: block; }

  .ac-security-grid { grid-template-columns: 1fr; }
  .ac-contact-grid { grid-template-columns: 1fr; }

  .ac-page-hero { padding: 130px 0 40px; }
  .ac-page-title { font-size: 1.8rem; }
}

@media (max-width: 480px) {
  .ac-legal-section { padding: 20px 18px; }
  .ac-page-meta { flex-direction: column; align-items: flex-start; gap: 8px; }
}
