/* ═══════════════════════════════════════════════════════════════
   Legal Landing Pages — Terms & Conditions / Privacy Policy
   Premium standalone page styles
   ═══════════════════════════════════════════════════════════════ */

/* ───── Base Reset for Legal Pages ───── */
.legal-landing {
  background: var(--paper);
  overflow-x: hidden;
}

/* ───── Animated Gradient Top Bar ───── */
.legal-gradient-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--gradient-premium);
  background-size: 300% 100%;
  animation: gradientFlow 6s ease infinite;
  z-index: 100;
}

@keyframes gradientFlow {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ───── Navigation Header ───── */
.legal-nav-header {
  position: sticky;
  top: 4px;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px clamp(18px, 5vw, 76px);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(24px) saturate(1.6);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  transition: box-shadow 300ms ease;
}

.legal-nav-header:hover {
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
}

.legal-nav-header .brand {
  color: var(--ink);
}

.legal-nav-links {
  display: flex;
  align-items: center;
  gap: clamp(14px, 3vw, 28px);
  font-size: 0.88rem;
  font-weight: 600;
}

.legal-nav-links a {
  position: relative;
  color: var(--slate);
  transition: color 200ms ease;
}

.legal-nav-links a:hover {
  color: var(--copper);
}

.legal-nav-links a::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--copper);
  border-radius: 1px;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 260ms cubic-bezier(0.22, 1, 0.36, 1);
}

.legal-nav-links a:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

.legal-nav-cta {
  padding: 10px 22px !important;
  border-radius: 10px !important;
  color: #fff !important;
  background: linear-gradient(135deg, var(--copper), #0891b2);
  box-shadow: 0 4px 16px rgba(13, 148, 136, 0.25);
  transition: box-shadow 220ms ease, transform 220ms ease !important;
}

.legal-nav-cta::after {
  display: none !important;
}

.legal-nav-cta:hover {
  color: #fff !important;
  box-shadow: 0 8px 32px rgba(13, 148, 136, 0.35);
  transform: translateY(-1px);
}

/* ───── Hero Section ───── */
.legal-hero {
  position: relative;
  overflow: hidden;
  padding: clamp(80px, 12vw, 140px) clamp(18px, 5vw, 76px) clamp(60px, 8vw, 100px);
  background:
    radial-gradient(ellipse 80% 60% at 20% 30%, rgba(13, 148, 136, 0.1), transparent),
    radial-gradient(ellipse 50% 50% at 80% 50%, rgba(244, 63, 94, 0.06), transparent),
    linear-gradient(180deg, #f1f5f9 0%, var(--paper) 100%);
}

.legal-hero--privacy {
  background:
    radial-gradient(ellipse 80% 60% at 20% 30%, rgba(13, 148, 136, 0.08), transparent),
    radial-gradient(ellipse 60% 50% at 80% 40%, rgba(8, 145, 178, 0.08), transparent),
    linear-gradient(180deg, #f1f5f9 0%, var(--paper) 100%);
}

/* Floating Orbs */
.legal-hero-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.legal-hero-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.5;
  animation: orbFloat 20s ease-in-out infinite;
}

.legal-hero-orb-1 {
  width: 400px;
  height: 400px;
  top: -100px;
  right: -50px;
  background: rgba(13, 148, 136, 0.15);
  animation-duration: 18s;
}

.legal-hero-orb-2 {
  width: 300px;
  height: 300px;
  bottom: -80px;
  left: 10%;
  background: rgba(244, 63, 94, 0.1);
  animation-duration: 22s;
  animation-delay: -5s;
}

.legal-hero-orb-3 {
  width: 250px;
  height: 250px;
  top: 20%;
  left: 50%;
  background: rgba(245, 158, 11, 0.08);
  animation-duration: 25s;
  animation-delay: -10s;
}

@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(30px, -20px) scale(1.05); }
  50% { transform: translate(-20px, 30px) scale(0.95); }
  75% { transform: translate(20px, 20px) scale(1.03); }
}

.legal-hero-content {
  position: relative;
  z-index: 2;
  max-width: 720px;
  animation: heroFadeIn 0.8s ease-out both;
}

@keyframes heroFadeIn {
  from {
    opacity: 0;
    transform: translateY(24px);
    filter: blur(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

.legal-eyebrow {
  display: inline-block;
  margin: 0 0 16px;
  padding: 6px 16px;
  border-radius: 999px;
  background: rgba(13, 148, 136, 0.1);
  color: var(--copper-dark);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.legal-hero h1 {
  margin: 0 0 20px;
  font-size: clamp(2.4rem, 5vw, 4.2rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--navy); /* Guarantee visibility with solid color */
  animation: none;
  position: relative;
  z-index: 5;
}

.legal-hero-subtitle {
  max-width: 540px;
  margin: 0 0 28px;
  color: var(--slate);
  font-size: clamp(1rem, 1.4vw, 1.15rem);
  font-weight: 400;
  line-height: 1.7;
}

.legal-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.legal-meta-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(12px);
  color: var(--slate);
  font-size: 0.82rem;
  font-weight: 600;
}

.legal-meta-badge svg {
  color: var(--copper);
  flex-shrink: 0;
}

/* ───── Main Layout ───── */
.legal-main {
  padding: clamp(40px, 6vw, 80px) clamp(18px, 5vw, 76px);
}

.legal-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: clamp(32px, 5vw, 64px);
  max-width: 1200px;
  margin: 0 auto;
}

/* ───── Table of Contents Sidebar ───── */
.legal-toc {
  position: sticky;
  top: 100px;
  align-self: start;
  animation: tocSlideIn 0.6s ease-out 0.2s both;
}

@keyframes tocSlideIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.legal-toc-title {
  margin: 0 0 16px;
  color: var(--navy);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.legal-toc nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.legal-toc-link {
  display: block;
  padding: 8px 14px;
  border-radius: 8px;
  border-left: 2px solid transparent;
  color: var(--slate);
  font-size: 0.84rem;
  font-weight: 500;
  line-height: 1.4;
  transition: all 200ms ease;
}

.legal-toc-link:hover {
  color: var(--copper);
  background: rgba(13, 148, 136, 0.06);
  border-left-color: var(--copper);
  transform: translateX(4px);
}

/* ───── Content Body ───── */
.legal-body {
  min-width: 0;
}

/* Intro Card */
.legal-intro-card {
  position: relative;
  padding: 28px 32px;
  margin-bottom: 48px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(13, 148, 136, 0.06) 0%, rgba(8, 145, 178, 0.04) 100%);
  border: 1px solid rgba(13, 148, 136, 0.12);
  animation: cardFadeUp 0.6s ease-out 0.3s both;
}

.legal-intro-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 28px;
  width: 48px;
  height: 3px;
  border-radius: 0 0 2px 2px;
  background: var(--gradient-premium);
}

.legal-intro-card p {
  margin: 0;
  color: var(--navy-soft);
  font-size: 1.02rem;
  font-weight: 500;
  line-height: 1.7;
}

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

/* ───── Section Blocks ───── */
.legal-section {
  position: relative;
  padding: 36px 0;
  border-bottom: 1px solid var(--line);
  animation: sectionFadeIn 0.5s ease-out both;
}

.legal-section:last-of-type {
  border-bottom: none;
}

.legal-section-number {
  position: absolute;
  top: 38px;
  right: 0;
  font-size: 3.5rem;
  font-weight: 900;
  line-height: 1;
  color: rgba(13, 148, 136, 0.06);
  letter-spacing: -0.04em;
  pointer-events: none;
  user-select: none;
}

.legal-section h2 {
  margin: 0 0 20px;
  padding-bottom: 12px;
  color: var(--navy);
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.legal-section h3 {
  margin: 20px 0 8px;
  color: var(--navy-soft);
  font-size: 1rem;
  font-weight: 700;
}

.legal-section-content p {
  margin: 0 0 14px;
  color: var(--slate);
  font-size: 0.95rem;
  font-weight: 450;
  line-height: 1.75;
}

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

/* ───── Info Cards (Privacy Page) ───── */
.legal-info-card {
  display: flex;
  gap: 18px;
  padding: 22px 24px;
  margin-bottom: 16px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
  transition: transform 300ms ease, box-shadow 300ms ease, border-color 300ms ease;
}

.legal-info-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-sm);
  border-color: rgba(13, 148, 136, 0.2);
}

.legal-info-card:last-child {
  margin-bottom: 0;
}

.legal-info-icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(13, 148, 136, 0.08);
  color: var(--copper);
}

.legal-info-card h3 {
  margin: 0 0 6px;
  font-size: 0.96rem;
}

.legal-info-card p {
  margin: 0;
}

/* ───── Usage Grid (Privacy) ───── */
.legal-use-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.legal-use-item {
  padding: 22px 24px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: #fff;
  transition: transform 300ms ease, box-shadow 300ms ease, border-color 300ms ease;
}

.legal-use-item:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-sm);
  border-color: rgba(13, 148, 136, 0.2);
}

.legal-use-item h3 {
  margin: 0 0 8px;
  font-size: 0.96rem;
  color: var(--navy);
}

.legal-use-item p {
  margin: 0;
}

/* ───── Highlight Box (Data Security) ───── */
.legal-highlight-box {
  display: flex;
  gap: 18px;
  padding: 28px 32px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.06), rgba(13, 148, 136, 0.08));
  border: 1px solid rgba(16, 185, 129, 0.15);
}

.legal-highlight-box svg {
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--sage);
}

.legal-highlight-box p {
  margin: 0;
}

/* ───── Bottom CTA ───── */
.legal-bottom-cta {
  margin-top: 64px;
  padding: 48px 40px;
  border-radius: var(--radius-lg);
  background: var(--navy);
  color: #fff;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.legal-bottom-cta::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 80% at 20% 80%, rgba(13, 148, 136, 0.25), transparent),
    radial-gradient(ellipse 50% 60% at 80% 20%, rgba(244, 63, 94, 0.15), transparent);
  pointer-events: none;
}

.legal-bottom-cta h3 {
  position: relative;
  margin: 0 0 8px;
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
}

.legal-bottom-cta p {
  position: relative;
  margin: 0 0 28px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 1rem;
}

.legal-bottom-actions {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}

.legal-bottom-actions .button.primary {
  background: linear-gradient(135deg, var(--copper), #0891b2);
}

.legal-bottom-actions .button.secondary.light {
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.legal-bottom-actions .button.secondary.light:hover {
  border-color: rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.14);
}

/* ───── Footer ───── */
.legal-footer-full {
  background: var(--navy);
  color: #fff;
  padding: 48px clamp(18px, 5vw, 76px) 32px;
  margin-top: 0;
}

.legal-footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  text-align: center;
}

.legal-footer-brand strong {
  display: block;
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.legal-footer-brand span {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.88rem;
}

.legal-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  justify-content: center;
}

.legal-footer-links a {
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.88rem;
  font-weight: 500;
  transition: color 200ms ease;
}

.legal-footer-links a:hover {
  color: #fff;
}

.legal-footer-copy {
  margin: 8px 0 0;
  color: rgba(255, 255, 255, 0.35);
  font-size: 0.82rem;
}

/* ───── Responsive ───── */
@media (max-width: 900px) {
  .legal-layout {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .legal-toc {
    position: relative;
    top: 0;
    padding: 24px;
    margin-bottom: 32px;
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid var(--line);
  }

  .legal-toc nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 4px;
  }

  .legal-toc-link {
    border-left: 0;
    padding: 6px 12px;
    font-size: 0.78rem;
    border-radius: 999px;
    border: 1px solid var(--line);
  }

  .legal-toc-link:hover {
    border-left-color: transparent;
    border-color: var(--copper);
    transform: none;
  }

  .legal-use-grid {
    grid-template-columns: 1fr;
  }

  .legal-section-number {
    display: none;
  }

  .legal-bottom-cta {
    padding: 36px 24px;
  }

  .legal-nav-links a:not(.legal-nav-cta) {
    display: none;
  }
}

@media (max-width: 600px) {
  .legal-hero {
    padding: 80px 20px 50px;
  }

  .legal-hero h1 {
    font-size: 2rem;
  }

  .legal-info-card {
    flex-direction: column;
    gap: 12px;
  }

  .legal-intro-card {
    padding: 20px 22px;
  }

  .legal-bottom-actions {
    flex-direction: column;
  }

  .legal-bottom-actions .button {
    width: 100%;
  }
}

/* ───── Scroll-based section reveals ───── */
@keyframes sectionFadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

/* ───── Smooth Scroll ───── */
.legal-landing {
  scroll-behavior: smooth;
}
