/* ==========================================================================
   LEGAL PAGES & SITEMAP PREMIUM STYLES
   ========================================================================== */

/* Variables matching the main theme */
:root {
  --navy: #0b2a5b;
  --navy-2: #163a70;
  --yellow: #f4d21f;
  --bg: #f8fafc;
  --border: #e2e8f0;
  --muted: #64748b;
  --shadow-sm: 0 4px 6px -1px rgba(11, 42, 91, 0.05), 0 2px 4px -2px rgba(11, 42, 91, 0.05);
  --shadow-md: 0 10px 20px -3px rgba(11, 42, 91, 0.08), 0 4px 6px -4px rgba(11, 42, 91, 0.04);
}

body.legal-page {
  background: linear-gradient(180deg, #ffffff 0%, var(--bg) 100%);
  font-family: 'Poppins', sans-serif;
  color: #334155;
  line-height: 1.6;
  scroll-behavior: smooth;
}

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

.fade-in-up {
  animation: fadeInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  opacity: 0;
}

.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }

/* Header Elements */
.legal-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.legal-home-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 999px;
  border: 2px solid var(--yellow);
  background: var(--navy);
  color: #fff;
  font-weight: 600;
  font-size: 0.88rem;
  padding: 0.52rem 1.1rem;
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.legal-home-btn:hover {
  color: #fff;
  background: var(--navy-2);
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(11, 42, 91, 0.22);
}

/* Main Container */
.legal-main {
  padding: 40px 0 60px;
}

.legal-container {
  max-width: 900px;
  margin: 0 auto;
}

/* Hero Section */
.legal-hero-card {
  background: linear-gradient(135deg, #ffffff 0%, #fffdf4 100%);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow-sm);
  padding: 40px 32px;
  margin-bottom: 30px;
  position: relative;
  overflow: hidden;
}

.legal-hero-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 6px;
  height: 100%;
  background: var(--yellow);
  border-radius: 24px 0 0 24px;
}

.legal-breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 500;
}

.legal-breadcrumb a {
  color: var(--navy);
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s ease;
}

.legal-breadcrumb a:hover {
  color: var(--navy-2);
  text-decoration: underline;
}

.legal-hero-card h1 {
  margin: 0 0 12px;
  color: var(--navy);
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.legal-hero-card p {
  margin: 0;
  color: #475569;
  font-size: 1.1rem;
  font-weight: 500;
}

/* Content Cards */
.legal-content {
  margin-top: 24px;
}

.legal-grid {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.legal-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow-sm);
  padding: 32px;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.legal-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: rgba(244, 210, 31, 0.4);
}

.legal-card-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid #f1f5f9;
}

.legal-card-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(11, 42, 91, 0.04);
  color: var(--navy);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.legal-card h2 {
  margin: 0;
  color: var(--navy);
  font-size: 1.35rem;
  font-weight: 700;
}

.legal-card p {
  margin: 0 0 16px;
  color: #334155;
  font-size: 1rem;
}

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

.legal-card ul {
  padding-left: 20px;
  margin-bottom: 16px;
  color: #334155;
}

.legal-card li {
  margin-bottom: 8px;
}

.legal-card a {
  color: var(--navy);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.2s ease;
}

.legal-card a:hover {
  color: var(--navy-2);
}

.legal-highlight-box {
  background: rgba(244, 210, 31, 0.1);
  border-left: 4px solid var(--yellow);
  padding: 16px 20px;
  border-radius: 0 8px 8px 0;
  margin-top: 16px;
}

.legal-highlight-box p {
  margin: 0;
  color: var(--navy);
  font-weight: 500;
}

/* Sitemap Specific */
.sitemap-intro {
  text-align: center;
  margin-bottom: 40px;
}

.sitemap-section-title {
  color: var(--navy);
  font-size: 1.5rem;
  font-weight: 700;
  margin: 32px 0 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid #f1f5f9;
  display: flex;
  align-items: center;
  gap: 10px;
}

.sitemap-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.sitemap-item {
  display: flex;
  align-items: center;
  gap: 16px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #ffffff;
  color: var(--navy);
  padding: 16px 20px;
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.sitemap-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: transparent;
  transition: background 0.3s ease;
}

.sitemap-item:hover {
  transform: translateY(-4px);
  border-color: var(--yellow);
  box-shadow: var(--shadow-md);
  color: var(--navy);
}

.sitemap-item:hover::before {
  background: var(--yellow);
}

.sitemap-item.is-highlight {
  background: linear-gradient(135deg, #ffffff 0%, #fffdf4 100%);
  border-color: rgba(244, 210, 31, 0.4);
}

.sitemap-item.is-highlight::before {
  background: var(--yellow);
}

.sitemap-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(11, 42, 91, 0.05);
  color: var(--navy);
  font-size: 1.1rem;
  flex-shrink: 0;
  transition: background 0.3s ease;
}

.sitemap-item:hover .sitemap-icon {
  background: var(--navy);
  color: #fff;
}

.sitemap-item.is-highlight .sitemap-icon {
  background: rgba(244, 210, 31, 0.2);
  color: var(--navy);
}

.sitemap-item.is-highlight:hover .sitemap-icon {
  background: var(--yellow);
  color: var(--navy);
}

.sitemap-content {
  flex-grow: 1;
}

.sitemap-text {
  display: block;
  font-weight: 700;
  font-size: 1.05rem;
  line-height: 1.2;
  margin-bottom: 4px;
}

.sitemap-desc {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.4;
}

.sitemap-arrow {
  color: var(--muted);
  font-size: 0.9rem;
  transition: transform 0.3s ease, color 0.3s ease;
}

.sitemap-item:hover .sitemap-arrow {
  transform: translateX(4px);
  color: var(--navy);
}

/* Footer */
.legal-footer {
  position: relative;
  margin-top: 40px;
  background: var(--navy-2);
  color: #dbe6ff;
  border-top: 4px solid var(--yellow);
  padding: 30px 0 calc(96px + env(safe-area-inset-bottom));
}

.legal-footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 20px;
}

.legal-footer-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.legal-footer-logo {
  width: 40px;
  height: 40px;
  border-radius: 8px;
}

.legal-footer-brand-text {
  font-weight: 700;
  font-size: 1.1rem;
  color: #ffffff;
}

.legal-footer p {
  margin: 0;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.7);
}

.legal-footer-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.legal-footer-links a {
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
}

.legal-footer-links a:hover,
.legal-footer-links a[aria-current="page"] {
  background: rgba(244, 210, 31, 0.15);
  border-color: var(--yellow);
  color: var(--yellow);
}

/* Sticky Back to Top (from main styles, adapted for legal if needed) */
.legal-back-to-top {
  position: fixed;
  bottom: calc(40px + env(safe-area-inset-bottom));
  right: 18px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--navy);
  color: white;
  border: none;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 99;
}

.legal-back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.legal-back-to-top:hover {
  background: var(--navy-2);
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(11, 42, 91, 0.2);
}

/* Responsive */
@media (max-width: 991px) {
  .legal-main {
    padding-top: 30px;
  }
}

@media (max-width: 768px) {
  .legal-hero-card {
    padding: 30px 24px;
    border-radius: 20px;
  }

  .legal-card {
    padding: 24px;
  }
  
  .legal-header-row {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  
  .legal-home-btn {
    width: 100%;
  }

  .sitemap-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 576px) {
  .legal-main {
    padding-top: 20px;
    padding-bottom: 40px;
  }

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

  .legal-card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  
  .legal-card h2 {
    font-size: 1.2rem;
  }

  .legal-back-to-top {
    bottom: calc(44px + env(safe-area-inset-bottom));
    right: 16px;
    width: 44px;
    height: 44px;
  }
}
