/* ================================================
   LEGAL PAGES — Política de Privacidade & Termos
   Nyzia Design System
   ================================================ */

/* ------ BREADCRUMB ------ */
.legal-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-soft);
  font-size: 0.88rem;
}

.legal-breadcrumb a {
  color: var(--text-soft);
  transition: color 0.2s var(--ease);
}

.legal-breadcrumb a:hover {
  color: var(--brand-strong);
}

.legal-breadcrumb span[aria-hidden] {
  opacity: 0.4;
}

.legal-breadcrumb > span:last-child {
  color: var(--text);
  font-weight: 500;
}

/* ------ MAIN LAYOUT ------ */
.legal-main {
  padding: 56px 0 80px;
}

.legal-container {
  display: grid;
  grid-template-columns: 280px 1fr;
  grid-template-rows: auto auto 1fr auto;
  gap: 0 56px;
  align-items: start;
}

.legal-header {
  grid-column: 1 / -1;
  padding-bottom: 48px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 48px;
}

.legal-toc {
  grid-column: 1;
  grid-row: 2;
  position: sticky;
  top: 104px;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
  max-height: calc(100vh - 130px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}

.toc-title {
  margin: 0 0 16px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.legal-toc ol {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 2px;
}

.legal-toc a {
  display: block;
  padding: 7px 10px;
  border-radius: 10px;
  font-size: 0.88rem;
  color: var(--text-soft);
  line-height: 1.4;
  transition: background 0.2s, color 0.2s;
}

.legal-toc a:hover {
  background: var(--surface-blue);
  color: var(--brand-strong);
}

.legal-body {
  grid-column: 2;
  grid-row: 2;
  min-width: 0;
}

.legal-footer-nav {
  grid-column: 1 / -1;
  grid-row: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding-top: 40px;
  margin-top: 40px;
  border-top: 1px solid var(--line);
}

/* ------ HEADER ------ */
.legal-header h1 {
  font-family: var(--title-font);
  font-size: clamp(2.4rem, 4vw, 4rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--text);
  margin: 12px 0 20px;
}

.legal-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.legal-badge {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--brand-soft);
  border: 1px solid rgba(23, 181, 215, 0.25);
  color: var(--brand-strong);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.legal-date {
  color: var(--text-muted);
  font-size: 0.88rem;
}

.legal-intro {
  margin: 0;
  color: var(--text-soft);
  font-size: 1.05rem;
  line-height: 1.8;
  max-width: 82ch;
}

/* ------ BODY SECTIONS ------ */
.legal-body section {
  padding-bottom: 48px;
  margin-bottom: 48px;
  border-bottom: 1px solid var(--line);
}

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

.legal-body h2 {
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-family: var(--title-font);
  font-size: clamp(1.4rem, 2.5vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
  margin: 0 0 22px;
  line-height: 1.1;
}

.section-num {
  color: var(--brand);
  font-size: 0.9em;
  font-weight: 500;
  flex-shrink: 0;
}

.legal-body h3 {
  font-family: var(--title-font);
  font-size: 1.12rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  margin: 28px 0 12px;
}

.legal-body p {
  color: var(--text-soft);
  line-height: 1.85;
  font-size: 0.97rem;
  margin: 0 0 16px;
}

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

.legal-body ul,
.legal-body ol {
  padding-left: 0;
  margin: 0 0 16px;
  list-style: none;
  display: grid;
  gap: 8px;
}

.legal-body ul li {
  position: relative;
  padding-left: 22px;
  color: var(--text-soft);
  font-size: 0.97rem;
  line-height: 1.75;
}

.legal-body ul li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.68em;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--brand);
  flex-shrink: 0;
}

.legal-body a {
  color: var(--brand-strong);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: color 0.2s;
}

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

/* ------ TABLE ------ */
.legal-table-wrap {
  overflow-x: auto;
  margin: 20px 0;
  border-radius: 18px;
  border: 1px solid var(--line);
}

.legal-table-wrap table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.93rem;
}

.legal-table-wrap thead {
  background: var(--surface-3);
}

.legal-table-wrap th {
  padding: 14px 18px;
  text-align: left;
  font-family: var(--title-font);
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text-soft);
  border-bottom: 1px solid var(--line);
}

.legal-table-wrap td {
  padding: 14px 18px;
  color: var(--text-soft);
  line-height: 1.6;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}

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

.legal-table-wrap tr:nth-child(even) td {
  background: rgba(240, 247, 251, 0.4);
}

/* ------ CALLOUTS ------ */
.legal-callout {
  border-radius: 16px;
  padding: 18px 22px;
  margin: 20px 0;
}

.legal-callout p {
  margin: 0;
  font-size: 0.95rem;
}

.callout-info {
  background: var(--surface-blue);
  border: 1px solid rgba(23, 181, 215, 0.2);
}

.callout-info p {
  color: #1a5f73;
}

.callout-warning {
  background: var(--surface-sand);
  border: 1px solid rgba(200, 160, 60, 0.25);
}

.callout-warning p {
  color: #7a5a1a;
}

/* ------ RIGHTS GRID ------ */
.rights-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
  margin: 24px 0;
}

.right-card {
  border-radius: 20px;
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 20px;
  transition: transform 0.25s var(--ease), border-color 0.25s var(--ease);
}

.right-card:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
}

.right-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--brand-soft);
  display: grid;
  place-items: center;
  color: var(--brand-strong);
  margin-bottom: 14px;
}

.right-icon svg {
  width: 20px;
  height: 20px;
}

.right-card h4 {
  margin: 0 0 6px;
  font-family: var(--title-font);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.right-card p {
  margin: 0;
  font-size: 0.87rem;
  line-height: 1.6;
  color: var(--text-soft);
}

/* ------ CONTACT BLOCK ------ */
.contact-block {
  display: grid;
  gap: 1px;
  border: 1px solid var(--line);
  border-radius: 20px;
  overflow: hidden;
  margin-top: 20px;
}

.contact-item {
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding: 16px 22px;
  background: var(--surface);
  flex-wrap: wrap;
}

.contact-item:nth-child(even) {
  background: var(--surface-3);
}

.contact-label {
  min-width: 160px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text-muted);
  flex-shrink: 0;
}

.contact-item span:not(.contact-label),
.contact-item a {
  color: var(--text-soft);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* ------ FOOTER NAV ------ */
.legal-back-link,
.legal-sibling-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 48px;
  padding: 0 20px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
  transition: transform 0.25s var(--ease), border-color 0.25s var(--ease), background 0.25s;
  text-decoration: none;
}

.legal-back-link:hover,
.legal-sibling-link:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  background: var(--surface-2);
  color: var(--text);
}

.legal-back-link svg,
.legal-sibling-link svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.legal-sibling-link {
  background: var(--brand-soft);
  border-color: rgba(23, 181, 215, 0.25);
  color: var(--brand-strong);
}

.legal-sibling-link:hover {
  background: var(--accent);
  border-color: var(--brand);
  color: var(--brand-strong);
}

/* ------ RESPONSIVE ------ */
@media (max-width: 960px) {
  .legal-container {
    grid-template-columns: 1fr;
  }

  .legal-toc {
    grid-column: 1;
    grid-row: auto;
    position: static;
    max-height: none;
    overflow: visible;
  }

  .legal-body {
    grid-column: 1;
    grid-row: auto;
  }

  .legal-footer-nav {
    grid-column: 1;
    grid-row: auto;
  }
}

@media (max-width: 640px) {
  .legal-main {
    padding: 32px 0 60px;
  }

  .legal-header h1 {
    font-size: clamp(1.8rem, 8vw, 2.8rem);
  }

  .legal-body h2 {
    font-size: 1.3rem;
  }

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

  .contact-label {
    min-width: 120px;
  }

  .legal-toc ol {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 420px) {
  .legal-footer-nav {
    flex-direction: column;
    align-items: stretch;
  }

  .legal-back-link,
  .legal-sibling-link {
    justify-content: center;
  }

  .legal-toc ol {
    grid-template-columns: 1fr;
  }
}
