/* ==========================================================================
   SUNRICH360® - LEGAL & COMPLIANCE PAGES STYLESHEET (Privacy & Terms)
   ========================================================================== */

/* --- Hero Banner Styling --- */
.legal-page-banner {
  position: relative;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.98) 0%, rgba(17, 30, 59, 0.95) 50%, rgba(201, 31, 38, 0.22) 100%), url('../assets/images/hero-bg.png') center/cover;
  padding: 130px 0 70px 0;
  overflow: hidden;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.legal-banner-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(circle at 20% 30%, rgba(37, 99, 235, 0.15) 0%, transparent 40%),
                    radial-gradient(circle at 80% 70%, rgba(201, 31, 38, 0.12) 0%, transparent 45%);
}

.legal-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(37, 99, 235, 0.4);
  padding: 8px 20px;
  border-radius: 30px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #60A5FA;
  margin-bottom: 20px;
  backdrop-filter: blur(10px);
}

.legal-badge-pill .pill-dot {
  width: 8px;
  height: 8px;
  background-color: #C91F26;
  border-radius: 50%;
  box-shadow: 0 0 10px #C91F26;
  display: inline-block;
}

.legal-hero-title {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 900;
  letter-spacing: -1.5px;
  line-height: 1.15;
  color: #ffffff;
  margin-bottom: 18px;
}

.legal-hero-desc {
  font-size: 1.15rem;
  line-height: 1.7;
  color: #94A3B8;
  max-width: 760px;
  margin: 0 auto 30px auto;
}

/* Glass Switcher & Meta Bar */
.legal-meta-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  background: rgba(30, 41, 59, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 12px 24px;
  border-radius: 50px;
  backdrop-filter: blur(12px);
  max-width: 860px;
  margin: 0 auto;
}

.legal-tab-switch {
  display: inline-flex;
  background: rgba(15, 23, 42, 0.8);
  padding: 4px;
  border-radius: 30px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.legal-tab-btn {
  padding: 8px 20px;
  border-radius: 24px;
  font-size: 13px;
  font-weight: 600;
  color: #94A3B8;
  text-decoration: none;
  transition: all 0.25s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.legal-tab-btn:hover {
  color: #ffffff;
}

.legal-tab-btn.active {
  background: linear-gradient(135deg, #2563EB 0%, #1D4ED8 100%);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.4);
}

.legal-tab-btn.active.terms-active {
  background: linear-gradient(135deg, #C91F26 0%, #991B1E 100%);
  box-shadow: 0 4px 14px rgba(201, 31, 38, 0.4);
}

.legal-meta-info {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 13px;
  color: #94A3B8;
}

.legal-meta-info i {
  color: #60A5FA;
}

.legal-print-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #CBD5E1;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.25s ease;
}

.legal-print-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.3);
}

/* --- Main Layout Section --- */
.legal-main-section {
  padding: 80px 0 100px 0;
  position: relative;
}

/* --- Sticky Sidebar Table of Contents --- */
.legal-sidebar-sticky {
  position: sticky;
  top: 110px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(12px);
  margin-bottom: 40px;
}

.legal-sidebar-title {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #60A5FA;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 10px;
}

.legal-toc-list {
  list-style: none;
  padding: 0;
  margin: 0 0 24px 0;
}

.legal-toc-item {
  margin-bottom: 6px;
}

.legal-toc-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  color: #94A3B8;
  text-decoration: none;
  transition: all 0.2s ease;
  line-height: 1.4;
}

.legal-toc-link .toc-num {
  font-size: 11px;
  font-weight: 700;
  color: #64748B;
  background: rgba(255, 255, 255, 0.04);
  padding: 3px 8px;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.legal-toc-link:hover {
  color: #ffffff;
  background: rgba(37, 99, 235, 0.1);
}

.legal-toc-link:hover .toc-num {
  color: #60A5FA;
  background: rgba(37, 99, 235, 0.2);
}

.legal-toc-link.active {
  color: #ffffff;
  background: rgba(37, 99, 235, 0.15);
  font-weight: 600;
  border-left: 3px solid #2563EB;
}

.legal-toc-link.active .toc-num {
  color: #ffffff;
  background: #2563EB;
}

/* Sidebar Fast Help Widget */
.legal-sidebar-help {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 14px;
  padding: 18px;
  text-align: center;
}

.legal-sidebar-help h6 {
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 6px;
}

.legal-sidebar-help p {
  font-size: 12px;
  color: #94A3B8;
  margin-bottom: 14px;
  line-height: 1.5;
}

.legal-help-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(201, 31, 38, 0.15);
  color: #F87171;
  border: 1px solid rgba(201, 31, 38, 0.3);
  text-decoration: none;
  transition: all 0.25s ease;
}

.legal-help-btn:hover {
  background: #C91F26;
  color: #ffffff;
  border-color: #C91F26;
}

/* --- Legal Section Cards --- */
.legal-section-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 44px 48px;
  margin-bottom: 36px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  scroll-margin-top: 110px; /* Offset for anchor scrolling */
}

.legal-section-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-color-hover);
}

.legal-section-header {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border-color);
}

.legal-section-num {
  font-size: 16px;
  font-weight: 800;
  color: #ffffff;
  background: linear-gradient(135deg, #2563EB 0%, #1D4ED8 100%);
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.legal-section-num.terms-num {
  background: linear-gradient(135deg, #C91F26 0%, #991B1E 100%);
  box-shadow: 0 4px 12px rgba(201, 31, 38, 0.3);
}

.legal-section-title {
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.3;
}

.legal-section-lead {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--text-secondary);
  margin-bottom: 22px;
}

.legal-section-text {
  font-size: 0.98rem;
  line-height: 1.8;
  color: var(--text-secondary);
  margin-bottom: 18px;
}

/* Highlight / Takeaway Callout Box */
.legal-callout-box {
  background: rgba(37, 99, 235, 0.08);
  border: 1px solid rgba(37, 99, 235, 0.25);
  border-left: 4px solid #2563EB;
  border-radius: 14px;
  padding: 22px 24px;
  margin: 24px 0;
}

.legal-callout-box.terms-callout {
  background: rgba(201, 31, 38, 0.08);
  border-color: rgba(201, 31, 38, 0.25);
  border-left-color: #C91F26;
}

.legal-callout-header {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #60A5FA;
  margin-bottom: 8px;
}

.legal-callout-box.terms-callout .legal-callout-header {
  color: #F87171;
}

.legal-callout-text {
  font-size: 0.95rem;
  line-height: 1.65;
  color: #CBD5E1;
  margin: 0;
}

/* Feature Micro Cards Grid */
.legal-feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin: 24px 0;
}

.legal-micro-card {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  padding: 20px;
  transition: all 0.25s ease;
}

.legal-micro-card:hover {
  border-color: rgba(37, 99, 235, 0.3);
  transform: translateY(-2px);
}

.legal-micro-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(37, 99, 235, 0.15);
  color: #60A5FA;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  margin-bottom: 12px;
}

.legal-micro-card h5 {
  font-size: 1rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 8px;
}

.legal-micro-card p {
  font-size: 0.88rem;
  color: #94A3B8;
  line-height: 1.6;
  margin: 0;
}

/* Styled Unordered Lists */
.legal-bullet-list {
  list-style: none;
  padding: 0;
  margin: 18px 0;
}

.legal-bullet-list li {
  position: relative;
  padding-left: 28px;
  margin-bottom: 12px;
  font-size: 0.98rem;
  line-height: 1.7;
  color: var(--text-secondary);
}

.legal-bullet-list li::before {
  content: "\f058";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  position: absolute;
  left: 0;
  top: 2px;
  color: #2563EB;
  font-size: 14px;
}

.legal-bullet-list.terms-bullets li::before {
  content: "\f0a9";
  color: #C91F26;
}

/* Styled Legal Table */
.legal-table-responsive {
  overflow-x: auto;
  margin: 24px 0;
  border-radius: 12px;
  border: 1px solid var(--border-color);
}

.legal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  text-align: left;
}

.legal-table th {
  background: rgba(15, 23, 42, 0.9);
  color: #ffffff;
  font-weight: 700;
  padding: 14px 18px;
  border-bottom: 2px solid var(--border-color);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.legal-table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.01);
}

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

.legal-table tr:hover td {
  background: rgba(255, 255, 255, 0.03);
}

/* Contact / DPO Banner at bottom */
.legal-contact-card {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.9) 0%, rgba(20, 30, 55, 0.95) 100%);
  border: 1px solid rgba(37, 99, 235, 0.3);
  border-radius: var(--radius-lg);
  padding: 40px;
  position: relative;
  overflow: hidden;
  margin-top: 50px;
}

.legal-contact-card::after {
  content: "";
  position: absolute;
  right: -50px;
  bottom: -50px;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.25) 0%, transparent 70%);
  pointer-events: none;
}

.legal-contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
  margin-top: 24px;
}

.legal-contact-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.legal-contact-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(37, 99, 235, 0.15);
  color: #60A5FA;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.legal-contact-item.terms-contact .legal-contact-icon {
  background: rgba(201, 31, 38, 0.15);
  color: #F87171;
}

.legal-contact-item .lbl {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #94A3B8;
  margin-bottom: 4px;
  font-weight: 600;
}

.legal-contact-item a, .legal-contact-item span {
  font-size: 14px;
  color: #ffffff;
  font-weight: 600;
  text-decoration: none;
}

.legal-contact-item a:hover {
  color: #60A5FA;
}

/* Responsive Breakpoints */
@media (max-width: 991px) {
  .legal-sidebar-sticky {
    position: relative;
    top: 0;
    margin-bottom: 40px;
  }
  .legal-section-card {
    padding: 30px 24px;
  }
  .legal-hero-title {
    font-size: 2.5rem;
  }
}

@media print {
  .legal-page-banner, .legal-sidebar-sticky, .footer, header {
    display: none !important;
  }
  .legal-section-card {
    border: none !important;
    box-shadow: none !important;
    page-break-inside: avoid;
  }
}
