/* ==========================================================================
   PIVIRO LEGAL SYSTEM — STYLESHEET (Privacy Policy, Terms, Cookie Policy)
   Seamlessly integrates with the PIVIRO design system:
   - Same continuous watercolor sky atmosphere and cloud drifts
   - Plus Jakarta Sans geometric editorial typography
   - Restrained glassmorphic reading container with optimal reading width
   - Accessible heading hierarchy, comfortable line-height, and high contrast
   - Responsive layouts across 320px, 375px, 390px, 414px, and desktop
   ========================================================================== */

/* --------------------------------------------------------------------------
   01. GLOBAL LEGAL PAGE LAYOUT & CONTINUOUS SKY
   -------------------------------------------------------------------------- */
.legal-page-body {
  font-family: var(--font-main, 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif);
  background-color: var(--sky-base, #86BDF8);
  color: var(--piviro-navy-text, #0B132B);
  margin: 0;
  padding: 0;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Continuous Desktop Sky Atmosphere */
.legal-sky-background {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  background-image: 
    linear-gradient(180deg, rgba(116, 178, 247, 0.35) 0%, rgba(220, 240, 255, 0.6) 40%, rgba(245, 250, 255, 0.88) 100%),
    url('/assets/sky_hero.jpg');
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
}

/* Drifting Cloud Animations across Legal Pages */
.legal-cloud-drift {
  position: absolute;
  top: 0;
  left: 0;
  width: 200%;
  height: 100%;
  pointer-events: none;
  opacity: 0.32;
  will-change: transform;
}

.legal-cloud-back {
  background: radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.8) 0%, transparent 40%),
              radial-gradient(circle at 80% 60%, rgba(255, 255, 255, 0.7) 0%, transparent 45%);
  animation: cloudDriftSlow 75s linear infinite alternate;
}

.legal-cloud-front {
  background: radial-gradient(circle at 60% 40%, rgba(255, 255, 255, 0.6) 0%, transparent 35%);
  animation: cloudDriftFast 50s linear infinite alternate;
  opacity: 0.22;
}

/* Mobile Ambient Sky Wrapper (Matching Mobile Homepage) */
.legal-m-sky-env {
  display: none;
}

@media (max-width: 768px) {
  .legal-sky-background {
    display: none;
  }
  
  .legal-m-sky-env {
    display: block;
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
  }

  .legal-m-sky-layer {
    position: absolute;
    inset: 0;
    background: url('/assets/sky_hero.jpg') center top / cover no-repeat;
    opacity: 0.95;
    filter: saturate(1.22) contrast(1.04);
  }

  .legal-m-sky-wash {
    position: absolute;
    inset: 0;
    background: linear-gradient(
      180deg,
      rgba(147, 197, 253, 0.14) 0%,
      rgba(191, 219, 254, 0.22) 28%,
      rgba(224, 238, 255, 0.38) 65%,
      rgba(235, 245, 255, 0.55) 100%
    );
  }
}

/* --------------------------------------------------------------------------
   02. LEGAL NAVIGATION & HEADER
   -------------------------------------------------------------------------- */
.legal-header-nav {
  position: relative;
  z-index: 10;
  padding-top: 24px;
}

.legal-nav-bar {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.legal-logo-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.legal-logo-link:hover {
  transform: translateY(-2px);
}

.legal-squircle {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--piviro-blue-primary, #2352F5);
  box-shadow: 0 6px 16px rgba(35, 82, 245, 0.32);
  display: flex;
  align-items: center;
  justify-content: center;
}

.legal-squircle img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.legal-nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.legal-back-home-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: var(--radius-pill, 9999px);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.95);
  color: var(--piviro-navy-text, #0B132B);
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 4px 16px rgba(16, 36, 92, 0.06);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.legal-back-text-mob {
  display: none;
}

.legal-back-home-pill:hover {
  background: #FFFFFF;
  color: var(--piviro-blue-primary, #2352F5);
  border-color: rgba(35, 82, 245, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(35, 82, 245, 0.16);
}

@media (max-width: 768px) {
  .legal-back-text {
    display: none;
  }
  .legal-back-text-mob {
    display: inline;
  }
}

/* --------------------------------------------------------------------------
   03. MAIN LEGAL CONTENT WRAPPER & SWITCHER TABS
   -------------------------------------------------------------------------- */
.legal-main-content {
  position: relative;
  z-index: 2;
  padding: 32px 20px 90px;
}

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

/* Document Switcher Tabs (Seamless navigation between all 3 documents) */
.legal-switcher-dock {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

@media (max-width: 768px) {
  .legal-switcher-dock {
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    padding: 4px 4px 10px 4px;
    scrollbar-width: none;
    margin: 0 0 20px 0;
  }

  .legal-switcher-dock::-webkit-scrollbar {
    display: none;
  }

  .legal-switcher-tab {
    flex-shrink: 0;
    font-size: 0.82rem;
    padding: 7px 14px;
  }
}

.legal-switcher-tab {
  display: inline-flex;
  align-items: center;
  padding: 8px 18px;
  border-radius: var(--radius-pill, 9999px);
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.9);
  color: var(--piviro-slate, #4A5B80);
  font-size: 0.86rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 8px rgba(16, 36, 92, 0.04);
}

.legal-switcher-tab:hover {
  background: rgba(255, 255, 255, 0.95);
  color: var(--piviro-blue-primary, #2352F5);
  transform: translateY(-1px);
}

.legal-switcher-tab.active {
  background: var(--piviro-blue-primary, #2352F5);
  color: #FFFFFF;
  border-color: var(--piviro-blue-primary, #2352F5);
  box-shadow: 0 4px 16px rgba(35, 82, 245, 0.32);
}

/* --------------------------------------------------------------------------
   04. LEGAL READING CARD (Frosted Glass, Maximum Readability)
   -------------------------------------------------------------------------- */
.legal-card {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1.5px solid rgba(255, 255, 255, 0.96);
  border-radius: 28px;
  padding: 56px 52px;
  box-shadow: 
    0 24px 60px rgba(16, 36, 92, 0.09),
    0 4px 16px rgba(16, 36, 92, 0.03),
    0 0 0 1px rgba(35, 82, 245, 0.05);
  box-sizing: border-box;
}

/* Top Header Area inside the Card */
.legal-card-header {
  border-bottom: 1px solid rgba(226, 232, 240, 0.9);
  padding-bottom: 32px;
  margin-bottom: 40px;
}

.legal-eyebrow-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.legal-page-title {
  font-family: var(--font-main, 'Plus Jakarta Sans', sans-serif);
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.18;
  color: var(--piviro-navy-dark, #0B132B);
  margin: 0 0 16px 0;
}

.legal-meta-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.legal-meta-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--piviro-slate, #4A5B80);
  background: rgba(241, 245, 249, 0.95);
  padding: 5px 12px;
  border-radius: var(--radius-pill, 9999px);
  border: 1px solid rgba(226, 232, 240, 0.8);
}

.legal-meta-badge.highlight {
  color: var(--piviro-blue-primary, #2352F5);
  background: rgba(35, 82, 245, 0.06);
  border-color: rgba(35, 82, 245, 0.16);
}

/* Table of Contents / Jump Bar */
.legal-toc-box {
  background: rgba(248, 250, 252, 0.85);
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 18px;
  padding: 22px 24px;
  margin-bottom: 44px;
}

.legal-toc-title {
  font-size: 0.86rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--piviro-slate, #4A5B80);
  margin: 0 0 14px 0;
}

.legal-toc-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.legal-toc-link {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--piviro-blue-primary, #2352F5);
  text-decoration: none;
  padding: 3px 8px;
  border-radius: 6px;
  transition: all 0.15s ease;
  background: rgba(35, 82, 245, 0.04);
}

.legal-toc-link:hover {
  background: rgba(35, 82, 245, 0.12);
  color: #1636B5;
}

/* --------------------------------------------------------------------------
   05. LEGAL BODY CONTENT & SECTIONS
   -------------------------------------------------------------------------- */
.legal-section {
  margin-bottom: 44px;
  scroll-margin-top: 32px;
}

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

.legal-section-heading {
  font-family: var(--font-main, 'Plus Jakarta Sans', sans-serif);
  font-size: 1.38rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.3;
  color: var(--piviro-navy-dark, #0B132B);
  margin: 0 0 14px 0;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.legal-section-heading .section-num {
  font-size: 1rem;
  font-weight: 700;
  color: var(--piviro-blue-primary, #2352F5);
}

.legal-subheading {
  font-family: var(--font-main, 'Plus Jakarta Sans', sans-serif);
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--piviro-navy-dark, #0B132B);
  margin: 22px 0 10px 0;
}

.legal-body-text {
  font-size: 1.01rem;
  font-weight: 450;
  line-height: 1.72;
  color: #1E293B;
  margin: 0 0 16px 0;
}

.legal-body-text:last-child {
  margin-bottom: 0;
}

.legal-body-text a {
  color: var(--piviro-blue-primary, #2352F5);
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 500;
  transition: color 0.15s ease;
}

.legal-body-text a:hover {
  color: #1636B5;
}

/* Styled Bullet Lists */
.legal-bullet-list {
  margin: 0 0 20px 0;
  padding-left: 24px;
}

.legal-bullet-list li {
  font-size: 1rem;
  font-weight: 450;
  line-height: 1.68;
  color: #1E293B;
  margin-bottom: 10px;
}

.legal-bullet-list li:last-child {
  margin-bottom: 0;
}

.legal-bullet-list li strong {
  font-weight: 700;
  color: var(--piviro-navy-dark, #0B132B);
}

/* Notice / Callout Highlights */
.legal-notice-box {
  background: linear-gradient(135deg, rgba(239, 246, 255, 0.88) 0%, rgba(245, 249, 255, 0.95) 100%);
  border: 1px solid rgba(191, 219, 254, 0.9);
  border-left: 4px solid var(--piviro-blue-primary, #2352F5);
  border-radius: 16px;
  padding: 20px 22px;
  margin: 22px 0;
}

.legal-notice-box p {
  font-size: 0.96rem;
  line-height: 1.64;
  color: #1E3A8A;
  margin: 0;
}

.legal-notice-box p + p {
  margin-top: 10px;
}

.legal-notice-box strong {
  color: #1E3A8A;
  font-weight: 700;
}

/* Operator & Contact Info Card */
.legal-contact-card {
  background: #F8FAFC;
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 18px;
  padding: 24px 26px;
  margin-top: 20px;
}

.legal-contact-name {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--piviro-navy-dark, #0B132B);
  margin-bottom: 6px;
}

.legal-contact-sub {
  font-size: 0.92rem;
  color: var(--piviro-slate, #4A5B80);
  margin-bottom: 16px;
}

.legal-contact-emails {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.legal-contact-email-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--piviro-blue-primary, #2352F5);
  text-decoration: none;
}

.legal-contact-email-item:hover {
  text-decoration: underline;
  color: #1636B5;
}

/* --------------------------------------------------------------------------
   06. SHARED FOOTER LEGAL NAV ADDITIONS
   -------------------------------------------------------------------------- */
.footer-legal-nav {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-legal-nav a {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--piviro-slate, #4A5B80);
  text-decoration: none;
  transition: color var(--transition-fast, 0.15s ease);
}

.footer-legal-nav a:hover,
.footer-legal-nav a.active {
  color: var(--piviro-blue-primary, #2352F5);
}

.m-final-legal-links {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 6px 0 10px 0;
}

.m-final-legal-links a {
  font-size: 0.78rem;
  font-weight: 500;
  color: #475569;
  text-decoration: none;
  transition: color 0.15s ease;
}

.m-final-legal-links a:hover,
.m-final-legal-links a.active {
  color: #2563EB;
}

.m-legal-dot {
  font-size: 0.7rem;
  color: #94A3B8;
}

/* --------------------------------------------------------------------------
   07. RESPONSIVE BREAKPOINTS (Mobile Polish down to 320px)
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  .legal-header-nav {
    padding-top: 16px;
  }

  .legal-nav-bar {
    padding: 0 16px;
  }

  .legal-back-home-pill {
    padding: 7px 13px;
    font-size: 0.8rem;
    gap: 6px;
  }

  .legal-main-content {
    padding: 20px 12px 60px;
  }

  .legal-card {
    padding: 30px 18px;
    border-radius: 22px;
  }

  .legal-page-title {
    font-size: 1.85rem;
    line-height: 1.22;
  }

  .legal-meta-row {
    gap: 8px;
  }

  .legal-meta-badge {
    font-size: 0.78rem;
    padding: 4px 10px;
  }

  .legal-section-heading {
    font-size: 1.2rem;
  }

  .legal-body-text {
    font-size: 0.95rem;
    line-height: 1.66;
  }

  .legal-bullet-list li {
    font-size: 0.95rem;
    line-height: 1.62;
  }

  .legal-notice-box {
    padding: 16px 18px;
    border-radius: 14px;
  }

  .legal-notice-box p {
    font-size: 0.92rem;
  }

  .legal-contact-card {
    padding: 18px 20px;
  }

  .legal-toc-box {
    padding: 18px;
  }
}

@media (max-width: 375px) {
  .legal-card {
    padding: 26px 16px;
    border-radius: 18px;
  }

  .legal-page-title {
    font-size: 1.65rem;
  }

  .legal-meta-row {
    gap: 8px;
  }

  .legal-meta-badge {
    font-size: 0.78rem;
    padding: 4px 10px;
  }
}
