/* ==========================================================================
   LicitaciónYa — Legal Pages Component (Privacy, Security, Terms)
   Clean, Authoritative, Typography-Optimized B2B Legal Layout
   ========================================================================== */

.legal-page {
  background-color: var(--bg-surface);
  color: var(--text-primary);
  font-family: var(--font-sans);
  line-height: 1.7;
}

/* Legal Header Banner */
.legal-header {
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border-bottom: 1px solid var(--border-subtle);
  padding: 3rem 0 2.5rem;
}

.legal-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.legal-breadcrumb a {
  color: var(--brand-blue);
  text-decoration: none;
  font-weight: 600;
  transition: color var(--transition-fast);
}

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

.legal-breadcrumb span {
  color: #94a3b8;
}

.legal-title {
  font-size: clamp(2rem, 3.5vw, 2.75rem);
  font-weight: 800;
  color: var(--brand-navy);
  letter-spacing: -0.025em;
  line-height: 1.2;
  margin-bottom: 0.75rem;
}

.legal-meta {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  flex-wrap: wrap;
}

.legal-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.65rem;
  background: rgba(37, 99, 235, 0.08);
  border: 1px solid rgba(37, 99, 235, 0.25);
  border-radius: var(--radius-full);
  color: var(--brand-blue);
  font-size: 0.76rem;
  font-weight: 700;
}

/* Legal Content Grid */
.legal-container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 3rem 1.5rem 5rem;
}

.legal-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 3.5rem;
  align-items: start;
}

/* Sticky Sidebar Table of Contents */
.legal-sidebar {
  position: sticky;
  top: 5.5rem;
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.sidebar-heading {
  font-size: 0.85rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--brand-navy);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.sidebar-link {
  font-size: 0.84rem;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 0.45rem 0.65rem;
  border-radius: 6px;
  transition: all var(--transition-fast);
  line-height: 1.4;
}

.sidebar-link:hover,
.sidebar-link.active {
  color: var(--brand-blue);
  background: rgba(37, 99, 235, 0.06);
  font-weight: 600;
}

/* Main Legal Body */
.legal-body {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 2.75rem;
  box-shadow: var(--shadow-sm);
}

.legal-section {
  margin-bottom: 3rem;
  scroll-margin-top: 6rem;
}

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

.legal-section-title {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--brand-navy);
  letter-spacing: -0.015em;
  margin-bottom: 1.15rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #e2e8f0;
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.legal-section-title .section-number {
  color: var(--brand-blue);
  font-size: 1.15rem;
  font-family: var(--font-mono);
}

.legal-body p {
  margin-bottom: 1.15rem;
  color: #334155;
  font-size: 0.96rem;
}

.legal-body ul,
.legal-body ol {
  margin-bottom: 1.25rem;
  padding-left: 1.5rem;
  color: #334155;
}

.legal-body li {
  margin-bottom: 0.55rem;
  font-size: 0.95rem;
}

.legal-body strong {
  color: #0f1f3d;
}

/* Callout Box (Legal Highlights / Notices) */
.legal-callout {
  background: #f8fafc;
  border-left: 4px solid var(--brand-blue);
  border-radius: 0 8px 8px 0;
  padding: 1.15rem 1.35rem;
  margin: 1.5rem 0;
}

.legal-callout-warning {
  border-left-color: #d97706;
  background: #fffbeb;
}

.legal-callout-success {
  border-left-color: #16a34a;
  background: #f0fdf4;
}

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

/* Rights Card Grid (LOPDP Specific) */
.rights-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.15rem;
  margin: 1.5rem 0;
}

.right-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 1.15rem;
  transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.right-card:hover {
  transform: translateY(-2px);
  border-color: #cbd5e1;
}

.right-badge {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--brand-blue);
  background: rgba(37, 99, 235, 0.1);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  display: inline-block;
  margin-bottom: 0.5rem;
}

.right-card h4 {
  font-size: 0.98rem;
  font-weight: 800;
  color: var(--brand-navy);
  margin-bottom: 0.35rem;
}

.right-card p {
  font-size: 0.85rem;
  color: #475569;
  margin-bottom: 0;
  line-height: 1.5;
}

/* Checklist Visual Cards (Security Specific) */
.security-checklist {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin: 1.5rem 0;
}

.security-item {
  display: flex;
  gap: 1rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 1.25rem;
}

.security-item-icon {
  width: 38px;
  height: 38px;
  background: #ecfdf5;
  border: 1px solid rgba(22, 163, 74, 0.3);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #16a34a;
  flex-shrink: 0;
}

.security-item-content h4 {
  font-size: 1rem;
  font-weight: 800;
  color: #0f1f3d;
  margin-bottom: 0.35rem;
}

.security-item-content p {
  font-size: 0.88rem;
  color: #475569;
  margin-bottom: 0;
  line-height: 1.55;
}

/* Legal Footer Contact Strip */
.legal-contact-strip {
  background: #f0fdf4;
  border: 1px solid rgba(22, 163, 74, 0.3);
  border-radius: 12px;
  padding: 1.5rem;
  margin-top: 3rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.legal-contact-text h4 {
  font-size: 1.05rem;
  font-weight: 800;
  color: #14532d;
  margin-bottom: 0.25rem;
}

.legal-contact-text p {
  font-size: 0.88rem;
  color: #166534;
  margin-bottom: 0;
}

/* Responsive Rules */
@media (max-width: 992px) {
  .legal-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .legal-sidebar {
    position: static;
    margin-bottom: 1.5rem;
  }

  .legal-body {
    padding: 1.75rem;
  }
}

@media (max-width: 640px) {
  .legal-header {
    padding: 2rem 0 1.75rem;
  }

  .legal-title {
    font-size: 1.85rem;
  }

  .legal-body {
    padding: 1.25rem;
  }

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

  .security-item {
    flex-direction: column;
    gap: 0.75rem;
  }

  .legal-contact-strip {
    flex-direction: column;
    align-items: flex-start;
  }
}
