/* ==========================================================================
   AVYRRO — Legal & Compliance Pages Design System
   A Product by ByteStream
   Styles for: Privacy Policy, Terms & Conditions, and Data Deletion
   ========================================================================== */

/* Subpage Hero Section */
.legal-hero {
  position: relative;
  background: linear-gradient(180deg, #070B14 0%, #0B0F19 60%, #111827 100%);
  color: #FFFFFF;
  padding: 80px 0 60px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.legal-hero::before {
  content: '';
  position: absolute;
  top: -120px;
  right: 15%;
  width: 480px;
  height: 480px;
  background: radial-gradient(circle, rgba(84, 82, 246, 0.22) 0%, rgba(84, 82, 246, 0) 70%);
  filter: blur(60px);
  pointer-events: none;
  z-index: 1;
}

.legal-hero::after {
  content: '';
  position: absolute;
  bottom: -60px;
  left: 10%;
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, rgba(37, 211, 102, 0.12) 0%, rgba(37, 211, 102, 0) 70%);
  filter: blur(50px);
  pointer-events: none;
  z-index: 1;
}

.legal-hero-inner {
  position: relative;
  z-index: 2;
  max-width: 980px;
}

/* Breadcrumbs */
.legal-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8125rem;
  color: var(--slate-400);
  margin-bottom: 20px;
}

.legal-breadcrumb a {
  color: var(--slate-300);
  transition: color var(--transition-fast);
  text-decoration: none;
}

.legal-breadcrumb a:hover {
  color: #FFFFFF;
  text-decoration: underline;
}

.legal-breadcrumb-separator {
  color: var(--slate-600);
}

.legal-breadcrumb-current {
  color: #818CF8;
  font-weight: 600;
}

/* Hero Badge */
.legal-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(84, 82, 246, 0.15);
  border: 1px solid rgba(84, 82, 246, 0.35);
  color: #A5B4FC;
  padding: 4px 14px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 20px;
}

.legal-hero-badge svg {
  color: #818CF8;
}

.legal-hero-title,
.legal-title {
  font-size: clamp(2.25rem, 4vw, 3.25rem);
  font-weight: 800;
  line-height: 1.15;
  color: #FFFFFF !important;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
}

.legal-hero-subtitle,
.legal-subtitle {
  font-size: 1.125rem;
  line-height: 1.6;
  color: var(--slate-300) !important;
  max-width: 780px;
  margin-bottom: 28px;
}

/* Meta Pills Bar */
.legal-meta-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.8125rem;
  color: var(--slate-400);
}

.legal-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legal-meta-item strong {
  color: #FFFFFF;
  font-weight: 600;
}

.legal-meta-tag {
  background: rgba(37, 211, 102, 0.15);
  color: #4ADE80;
  border: 1px solid rgba(37, 211, 102, 0.3);
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

/* Main Layout Grid */
.legal-main-section {
  background-color: #FFFFFF;
  padding: 60px 0 100px 0;
}

.legal-grid,
.legal-layout {
  display: grid;
  grid-template-columns: 290px 1fr;
  gap: 48px;
  align-items: start;
}

.legal-layout {
  padding-top: 56px;
  padding-bottom: 96px;
}

/* Sticky Sidebar */
.legal-sidebar {
  position: sticky;
  top: 96px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  padding-right: 8px;
}

/* Custom Scrollbar for Sidebar */
.legal-sidebar::-webkit-scrollbar {
  width: 4px;
}
.legal-sidebar::-webkit-scrollbar-track {
  background: var(--slate-100);
  border-radius: 4px;
}
.legal-sidebar::-webkit-scrollbar-thumb {
  background: var(--slate-300);
  border-radius: 4px;
}

.legal-card,
.legal-toc {
  background: #FFFFFF;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.legal-card-title,
.legal-toc-title {
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--slate-500);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Table of Contents List */
.legal-toc-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.legal-toc-link {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.84375rem;
  line-height: 1.45;
  color: var(--slate-600);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: all var(--transition-fast);
  border-left: 2px solid transparent;
}

.legal-toc-num {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--slate-400);
  min-width: 18px;
  margin-top: 1px;
}

.legal-toc-link:hover {
  background-color: var(--brand-50);
  color: var(--brand-600);
  border-left-color: var(--brand-400);
}

.legal-toc-link.active {
  background-color: var(--brand-50);
  color: var(--brand-700);
  font-weight: 600;
  border-left-color: var(--brand-600);
}

.legal-toc-link.active .legal-toc-num {
  color: var(--brand-600);
}

/* Sidebar Quick Help Card */
.legal-sidebar-help {
  background: linear-gradient(135deg, #F8FAFC 0%, #EEF2FF 100%);
  border: 1px solid #E0E7FF;
}

.legal-sidebar-help h4 {
  font-size: 0.9375rem;
  color: var(--slate-900);
  margin-bottom: 8px;
}

.legal-sidebar-help p {
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--slate-600);
  margin-bottom: 14px;
}

.legal-sidebar-contact-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 10px 14px;
  background: var(--brand-600);
  color: #FFFFFF;
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  font-weight: 600;
  text-decoration: none;
  transition: background var(--transition-fast);
}

.legal-sidebar-contact-btn:hover {
  background: var(--brand-700);
  color: #FFFFFF;
}

/* Store Badge Card */
.legal-store-badge {
  border-color: #E2E8F0;
  background: #FFFFFF;
  padding: 18px 20px;
}

.legal-store-tag {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78125rem;
  font-weight: 600;
  color: var(--slate-700);
  margin-bottom: 6px;
}

.legal-store-tag svg {
  color: var(--brand-600);
  flex-shrink: 0;
}

.legal-store-desc {
  font-size: 0.75rem;
  color: var(--slate-500);
  line-height: 1.4;
  margin: 0;
}

/* Main Article Content */
.legal-article,
.legal-content {
  min-width: 0;
  max-width: 860px;
}

.legal-summary-card {
  background: #F8FAFC;
  border: 1px solid var(--border-light);
  border-left: 4px solid var(--brand-600);
  border-radius: var(--radius-md);
  padding: 24px 28px;
  margin-bottom: 48px;
}

.legal-summary-card h3 {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--slate-900);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.legal-summary-card p {
  font-size: 0.9375rem;
  line-height: 1.65;
  color: var(--slate-700);
  margin-bottom: 12px;
}

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

/* Callout Boxes */
.legal-callout {
  background: #F8FAFC;
  border: 1px solid var(--border-light);
  border-left: 4px solid var(--brand-600);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  margin: 24px 0;
}

.legal-callout-title {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--slate-900);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.legal-callout p {
  font-size: 0.90625rem;
  line-height: 1.65;
  color: var(--slate-700);
  margin-bottom: 8px;
}

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

/* Legal Sections */
.legal-section-block,
.legal-section {
  scroll-margin-top: 100px;
  margin-bottom: 56px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--border-light);
}

.legal-section-block:last-child,
.legal-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.legal-section h2 {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--slate-900);
  letter-spacing: -0.02em;
  margin-top: 0;
  margin-bottom: 16px;
}

.legal-section p {
  font-size: 0.96875rem;
  line-height: 1.75;
  color: var(--slate-700);
  margin-bottom: 16px;
}

.legal-section ul,
.legal-section ol {
  margin: 14px 0 20px 24px;
  padding: 0;
}

.legal-section ul {
  list-style-type: disc;
}

.legal-section ol {
  list-style-type: decimal;
}

.legal-section li {
  font-size: 0.9375rem;
  line-height: 1.7;
  color: var(--slate-700);
  margin-bottom: 10px;
}

.legal-section li strong {
  color: var(--slate-900);
  font-weight: 600;
}

.legal-section-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}

.legal-section-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  background: var(--brand-50);
  color: var(--brand-600);
  border: 1px solid var(--brand-200);
  border-radius: var(--radius-md);
  font-size: 0.9375rem;
  font-weight: 700;
  flex-shrink: 0;
}

.legal-section-title {
  font-size: 1.625rem;
  font-weight: 800;
  color: var(--slate-900);
  letter-spacing: -0.02em;
  margin: 0;
}

.legal-body {
  font-size: 0.96875rem;
  line-height: 1.75;
  color: var(--slate-700);
}

.legal-body p {
  margin-bottom: 16px;
  color: var(--slate-700);
}

.legal-body h3 {
  font-size: 1.1875rem;
  font-weight: 700;
  color: var(--slate-900);
  margin-top: 28px;
  margin-bottom: 12px;
}

.legal-body h4 {
  font-size: 1.03125rem;
  font-weight: 600;
  color: var(--slate-850);
  margin-top: 20px;
  margin-bottom: 10px;
}

.legal-body ul,
.legal-body ol {
  margin: 14px 0 20px 24px;
  padding: 0;
}

.legal-body ul {
  list-style-type: disc;
}

.legal-body ol {
  list-style-type: decimal;
}

.legal-body li {
  margin-bottom: 10px;
  line-height: 1.65;
  color: var(--slate-700);
}

.legal-body li strong {
  color: var(--slate-900);
}

.legal-body a {
  color: var(--brand-600);
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 500;
  transition: color var(--transition-fast);
}

.legal-body a:hover {
  color: var(--brand-800);
}

/* Callout Alert Boxes */
.legal-alert {
  display: flex;
  gap: 16px;
  border-radius: var(--radius-md);
  padding: 18px 20px;
  margin: 24px 0;
  font-size: 0.90625rem;
  line-height: 1.6;
}

.legal-alert-icon {
  flex-shrink: 0;
  margin-top: 2px;
}

.legal-alert-content {
  flex: 1;
}

.legal-alert-content strong {
  display: block;
  font-size: 0.9375rem;
  margin-bottom: 4px;
}

.legal-alert-info {
  background-color: #EEF2FF;
  border: 1px solid #C7D2FE;
  color: #312E81;
}
.legal-alert-info strong {
  color: #1E1B4B;
}
.legal-alert-info .legal-alert-icon {
  color: var(--brand-600);
}

.legal-alert-warning {
  background-color: #FFFBEB;
  border: 1px solid #FDE68A;
  color: #92400E;
}
.legal-alert-warning strong {
  color: #78350F;
}
.legal-alert-warning .legal-alert-icon {
  color: #D97706;
}

.legal-alert-success {
  background-color: #ECFDF5;
  border: 1px solid #A7F3D0;
  color: #065F46;
}
.legal-alert-success strong {
  color: #064E3B;
}
.legal-alert-success .legal-alert-icon {
  color: #059669;
}

/* Tables */
.legal-table-wrapper {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 24px 0 32px 0;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-xs);
}

.legal-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.875rem;
  line-height: 1.55;
  background: #FFFFFF;
}

.legal-table th {
  background-color: var(--slate-900);
  color: #FFFFFF;
  font-weight: 600;
  padding: 12px 18px;
  font-size: 0.8125rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  border-bottom: 2px solid var(--slate-800);
  white-space: nowrap;
}

.legal-table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-light);
  color: var(--slate-700);
  vertical-align: top;
}

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

.legal-table tr:nth-child(even) td {
  background-color: #F8FAFC;
}

.legal-table td strong {
  color: var(--slate-900);
  font-weight: 600;
}

.legal-table-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-xs);
  font-size: 0.71875rem;
  font-weight: 600;
  background: var(--brand-50);
  color: var(--brand-700);
  border: 1px solid var(--brand-200);
}

/* Steps Process Block (Numbered) */
.legal-steps-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 24px 0 32px 0;
}

.legal-step-card {
  display: flex;
  gap: 20px;
  padding: 20px 24px;
  border-radius: var(--radius-md);
  background: #FFFFFF;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-xs);
  transition: all var(--transition-fast);
}

.legal-step-card:hover {
  border-color: var(--brand-300);
  box-shadow: var(--shadow-sm);
}

.legal-step-number {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--brand-500);
  line-height: 1;
  min-width: 36px;
  padding-top: 4px;
}

.legal-step-content {
  flex: 1;
}

.legal-step-title {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--slate-900);
  margin-bottom: 6px;
}

.legal-step-desc {
  font-size: 0.90625rem;
  line-height: 1.6;
  color: var(--slate-600);
  margin: 0;
}

/* Contact Governance Card */
.legal-contact-card {
  background: linear-gradient(135deg, #0B0F19 0%, #111827 100%);
  border-radius: var(--radius-lg);
  color: #FFFFFF;
  padding: 36px 36px;
  margin-top: 48px;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
  overflow: hidden;
}

.legal-contact-card::before {
  content: '';
  position: absolute;
  top: -60px;
  right: -60px;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(84, 82, 246, 0.3) 0%, rgba(84, 82, 246, 0) 70%);
  filter: blur(40px);
  pointer-events: none;
}

.legal-contact-card h3 {
  font-size: 1.375rem;
  font-weight: 800;
  color: #FFFFFF;
  margin-bottom: 12px;
}

.legal-contact-card p {
  color: var(--slate-300);
  font-size: 0.9375rem;
  line-height: 1.6;
  margin-bottom: 24px;
}

.legal-contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-top: 24px;
}

.legal-contact-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.legal-contact-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--slate-400);
  font-weight: 600;
}

.legal-contact-value {
  font-size: 0.9375rem;
  color: #FFFFFF;
  font-weight: 600;
}

.legal-contact-value a {
  color: #A5B4FC;
  text-decoration: none;
  transition: color var(--transition-fast);
}

.legal-contact-value a:hover {
  color: #FFFFFF;
  text-decoration: underline;
}

/* Mobile Responsive Adjustments */
@media (max-width: 1024px) {
  .legal-grid,
  .legal-layout {
    grid-template-columns: 260px 1fr;
    gap: 36px;
  }
}

@media (max-width: 900px) {
  .legal-hero {
    padding: 60px 0 40px 0;
  }

  .legal-grid,
  .legal-layout {
    grid-template-columns: 1fr;
    gap: 32px;
    padding-top: 36px;
  }

  .legal-sidebar {
    position: relative;
    top: 0;
    max-height: none;
    overflow-y: visible;
  }

  /* Make TOC collapsible or compact card on tablet/mobile */
  .legal-toc-accordion details {
    background: #FFFFFF;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 16px;
  }

  .legal-toc-accordion summary {
    font-weight: 700;
    font-size: 0.9375rem;
    color: var(--slate-900);
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .legal-toc-accordion summary::after {
    content: '↓';
    font-weight: 700;
    color: var(--brand-600);
  }

  .legal-toc-accordion details[open] summary::after {
    content: '↑';
  }

  .legal-section-title {
    font-size: 1.375rem;
  }

  .legal-contact-card {
    padding: 28px 24px;
  }
}

@media (max-width: 600px) {
  .legal-hero-title {
    font-size: 1.875rem;
  }

  .legal-meta-bar {
    gap: 10px;
    font-size: 0.75rem;
  }

  .legal-step-card {
    flex-direction: column;
    gap: 10px;
  }

  .legal-step-number {
    font-size: 1.25rem;
  }

  .legal-table th,
  .legal-table td {
    padding: 10px 12px;
    font-size: 0.8125rem;
  }
}
