/* Páginas legais: privacidade, cookies, termos de uso e exclusão de dados. */

html:has(.legal-page) {
  scroll-padding-top: calc(var(--header-h) + 20px);
}

/* ---------- Topo ---------- */
.legal-hero {
  position: relative;
  padding: calc(var(--header-h) + 44px) 0 104px;
  background:
    radial-gradient(55% 70% at 88% 0%, rgba(63, 112, 215, 0.34), transparent 70%),
    radial-gradient(40% 60% at 0% 100%, rgba(33, 107, 115, 0.32), transparent 70%), #0a1631;
  color: #fff;
  isolation: isolate;
}
.legal-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: radial-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: linear-gradient(180deg, #000 0%, transparent 85%);
}
.legal-crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: #93a4c4;
  font-size: 0.8125rem;
}
.legal-crumbs a {
  color: #c9d5ec;
  text-decoration: none;
}
.legal-crumbs a:hover {
  color: #fff;
  text-decoration: underline;
}
.legal-crumbs [aria-current] {
  color: #d1ff52;
  font-weight: 600;
}
.legal-hero h1 {
  margin: 18px 0 12px;
  font-size: clamp(2rem, 1.4rem + 2.6vw, 3.25rem);
  line-height: 1.08;
  letter-spacing: -0.025em;
}
.legal-lead {
  max-width: 720px;
  margin: 0;
  color: #c9d5ec;
  font-size: clamp(1rem, 0.95rem + 0.3vw, 1.1875rem);
  line-height: 1.6;
}
.legal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
}
.legal-meta li {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: #dbe4f5;
  font-size: 0.8125rem;
}
.legal-meta .icon {
  color: #d1ff52;
}
.legal-tabs {
  position: relative;
  display: flex;
  gap: 8px;
  margin-top: 30px;
  padding: 6px;
  width: fit-content;
  max-width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  background: rgba(5, 12, 30, 0.45);
  overflow-x: auto;
  scrollbar-width: none;
}
.legal-tabs::-webkit-scrollbar {
  display: none;
}
.legal-tabs a {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 11px;
  color: #c9d5ec;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  transition:
    background-color 0.2s ease,
    color 0.2s ease;
}
.legal-tabs a:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}
.legal-tabs a[aria-current='page'] {
  background: #fff;
  color: var(--brand);
  box-shadow: 0 8px 20px -8px rgba(0, 0, 0, 0.5);
}

/* ---------- Corpo ---------- */
.legal-body {
  padding: 56px 0 96px;
  background: #fff;
}
.legal-layout {
  display: grid;
  gap: 40px;
}
@media (min-width: 1024px) {
  .legal-layout {
    grid-template-columns: 270px minmax(0, 1fr);
    gap: 64px;
    align-items: start;
  }
  .legal-aside {
    position: sticky;
    top: calc(var(--header-h) + 24px);
    max-height: calc(100vh - var(--header-h) - 48px);
    overflow-y: auto;
    scrollbar-width: thin;
  }
}
.legal-aside {
  display: grid;
  gap: 18px;
  align-content: start;
}
.legal-toc {
  padding: 18px 14px 14px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface-subtle);
}
.legal-toc-title {
  margin: 0 0 10px 8px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.legal-toc ol {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.legal-toc a {
  display: block;
  padding: 7px 10px;
  border-left: 2px solid transparent;
  border-radius: 0 8px 8px 0;
  color: var(--text-2);
  font-size: 0.8125rem;
  line-height: 1.4;
  text-decoration: none;
  transition:
    background-color 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease;
}
.legal-toc a:hover {
  background: var(--brand-100);
  color: var(--ink);
}
.legal-toc a[aria-current] {
  border-left-color: var(--brand);
  background: var(--brand-100);
  color: var(--brand);
  font-weight: 600;
}
@media (max-width: 1023px) {
  .legal-toc ol {
    max-height: 240px;
    overflow-y: auto;
  }
}
.legal-help {
  display: grid;
  gap: 8px;
  padding: 18px;
  border-radius: 16px;
  background: #0d1a35;
  color: #c9d5ec;
  font-size: 0.8125rem;
  line-height: 1.5;
}
.legal-help > .icon {
  color: #d1ff52;
}
.legal-help p {
  margin: 0;
}
.legal-help strong {
  color: #fff;
}
.legal-help a {
  color: #fff;
  font-weight: 600;
  word-break: break-all;
}
.legal-copy {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: transparent;
  color: #dbe4f5;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.legal-copy:hover,
.legal-copy.is-done {
  border-color: #d1ff52;
  color: #d1ff52;
}

/* ---------- Texto ---------- */
.legal-doc {
  min-width: 0;
  max-width: 820px;
  color: var(--text-2);
  font-size: 1rem;
  line-height: 1.75;
}
.legal-doc h2 {
  margin: 56px 0 14px;
  color: var(--ink);
  font-size: clamp(1.3rem, 1.15rem + 0.6vw, 1.625rem);
  line-height: 1.25;
  letter-spacing: -0.015em;
}
.legal-doc h3 {
  margin: 28px 0 8px;
  color: var(--ink);
  font-size: 1.0625rem;
}
.legal-doc p,
.legal-doc ul,
.legal-doc ol,
.legal-doc dl {
  margin: 0 0 16px;
}
.legal-doc ul,
.legal-doc ol {
  padding-left: 22px;
}
.legal-doc li + li {
  margin-top: 6px;
}
.legal-doc strong {
  color: var(--ink);
}
.legal-doc a {
  color: var(--brand);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: var(--brand-300);
  text-underline-offset: 3px;
}
.legal-doc a:hover {
  text-decoration-color: currentColor;
}
.legal-doc code {
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--brand-100);
  color: var(--brand);
  font-size: 0.8125em;
  word-break: break-word;
}
.legal-doc h2:target {
  animation: legal-target 1.6s ease;
}
@keyframes legal-target {
  0%,
  40% {
    color: var(--brand);
  }
}

.legal-summary {
  padding: 24px 24px 20px;
  border: 1px solid var(--brand-200);
  border-radius: 20px;
  background: linear-gradient(135deg, var(--brand-50), #fff 70%);
}
.legal-doc .legal-summary-title {
  margin: 0 0 14px;
  font-size: 1.0625rem;
}
.legal-summary ul {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.legal-summary li {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 12px;
  align-items: start;
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.55;
}
.legal-summary li > .icon {
  width: 34px;
  height: 34px;
  padding: 8px;
  border-radius: 10px;
  background: #fff;
  color: var(--brand);
  box-shadow: 0 0 0 1px var(--brand-200);
}

.legal-callout {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  padding: 14px 16px;
  border-left: 3px solid var(--brand);
  border-radius: 0 12px 12px 0;
  background: var(--brand-50);
  font-size: 0.9375rem;
}
.legal-callout > .icon {
  margin-top: 3px;
  color: var(--brand);
}

.legal-table-wrap {
  margin: 0 0 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow-x: auto;
}
.legal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  line-height: 1.55;
}
.legal-table th,
.legal-table td {
  padding: 12px 14px;
  text-align: left;
  vertical-align: top;
}
.legal-table th {
  background: var(--surface-subtle);
  color: var(--ink);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}
.legal-table tbody tr {
  border-top: 1px solid var(--border);
  transition: background-color 0.2s ease;
}
.legal-table tbody tr:hover {
  background: var(--brand-50);
}
.legal-table td:first-child {
  color: var(--ink);
  font-weight: 500;
}
@media (max-width: 640px) {
  .legal-table {
    min-width: 520px;
  }
}

.legal-doc .legal-list-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  padding: 0;
  list-style: none;
}
.legal-list-cards li {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  font-size: 0.875rem;
  line-height: 1.55;
  transition:
    border-color 0.2s ease,
    transform 0.2s ease;
}
.legal-list-cards li:hover {
  border-color: var(--brand-300);
  transform: translateY(-2px);
}

.legal-doc .legal-rights,
.legal-doc .legal-donts {
  display: grid;
  gap: 8px;
  padding: 0;
  list-style: none;
}
.legal-rights li,
.legal-donts li {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 10px;
  margin: 0;
}
.legal-rights .icon {
  margin-top: 5px;
  color: #16a34a;
}
.legal-donts .icon {
  margin-top: 5px;
  color: #dc2626;
}

.legal-definitions {
  display: grid;
  gap: 10px;
}
.legal-definitions > div {
  display: grid;
  gap: 2px;
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--surface-subtle);
}
@media (min-width: 640px) {
  .legal-definitions > div {
    grid-template-columns: 170px 1fr;
    gap: 16px;
  }
}
.legal-definitions dt {
  color: var(--ink);
  font-weight: 600;
}
.legal-definitions dd {
  margin: 0;
}

.legal-contact {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 14px;
}
.legal-contact > div {
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface-subtle);
}
.legal-doc .legal-contact h3 {
  margin: 0 0 8px;
  font-size: 0.9375rem;
}
.legal-contact p {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.7;
}

.legal-inline-button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--brand);
  font: inherit;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--brand-300);
  text-underline-offset: 3px;
  cursor: pointer;
}
.legal-inline-button:hover {
  text-decoration-color: currentColor;
}

/* ---------- Cookies ---------- */
.legal-categories {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
}
.legal-category {
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-subtle);
}
.legal-category.is-off {
  border-style: dashed;
  background: #fff;
}
.legal-category-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.legal-doc .legal-category h3 {
  margin: 0;
  font-size: 1rem;
}
.legal-category p {
  margin: 6px 0 0;
  font-size: 0.875rem;
  line-height: 1.6;
}
.legal-pill {
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--brand-100);
  color: var(--brand);
  font-size: 0.75rem;
  font-weight: 700;
}
.legal-pill.is-off {
  background: var(--surface-soft);
  color: var(--muted);
}

/* ---------- Exclusão de dados ---------- */
.deletion-cases {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
  margin-bottom: 8px;
}
.legal-doc .deletion-case {
  display: grid;
  gap: 4px;
  align-content: start;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 16px;
  color: var(--text-2);
  font-size: 0.8125rem;
  line-height: 1.5;
  text-decoration: none;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease;
}
.deletion-case > .icon {
  width: 40px;
  height: 40px;
  margin-bottom: 8px;
  padding: 9px;
  border-radius: 12px;
  background: var(--brand-100);
  color: var(--brand);
  transition:
    background-color 0.2s ease,
    color 0.2s ease;
}
.deletion-case strong {
  font-size: 0.9375rem;
}
.legal-doc .deletion-case:hover,
.legal-doc .deletion-case:focus-visible {
  border-color: var(--brand-300);
  box-shadow: 0 14px 30px -18px rgba(35, 64, 133, 0.5);
  transform: translateY(-3px);
}
.deletion-case:hover > .icon {
  background: var(--brand);
  color: #fff;
}

.legal-doc .legal-steps {
  counter-reset: step;
  display: grid;
  gap: 10px;
  padding: 0;
  list-style: none;
}
.legal-steps li {
  position: relative;
  margin: 0;
  padding: 2px 0 0 46px;
  counter-increment: step;
}
.legal-steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-size: 0.8125rem;
  font-weight: 700;
}
.legal-steps li + li::after {
  content: '';
  position: absolute;
  left: 14px;
  top: -12px;
  width: 2px;
  height: 12px;
  background: var(--brand-200);
}

.deletion-form {
  display: grid;
  gap: 16px;
  margin: 8px 0 24px;
  padding: 24px;
  border: 1px solid var(--brand-200);
  border-radius: 20px;
  background: linear-gradient(180deg, var(--brand-50), #fff 60%);
  box-shadow: 0 30px 60px -45px rgba(35, 64, 133, 0.6);
}
.deletion-who {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
}
.deletion-who legend {
  margin-bottom: 10px;
  padding: 0;
  color: var(--ink);
  font-size: 0.875rem;
  font-weight: 600;
}
.deletion-who label {
  position: relative;
  cursor: pointer;
}
.deletion-who input {
  position: absolute;
  opacity: 0;
}
.deletion-who span {
  display: inline-flex;
  padding: 8px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: #fff;
  color: var(--text-2);
  font-size: 0.8125rem;
  font-weight: 600;
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease;
}
.deletion-who label:hover span {
  border-color: var(--brand-300);
}
.deletion-who input:checked + span {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}
.deletion-who input:focus-visible + span {
  outline: 2px solid var(--brand-light);
  outline-offset: 2px;
}
.deletion-grid {
  display: grid;
  gap: 14px;
}
@media (min-width: 640px) {
  .deletion-grid {
    grid-template-columns: 1fr 1fr;
  }
}
.deletion-form .textarea {
  min-height: 84px;
  resize: vertical;
}
.deletion-confirm {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 10px;
  align-items: start;
  font-size: 0.875rem;
  line-height: 1.5;
  cursor: pointer;
}
.deletion-confirm input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--brand);
}
.deletion-preview-wrap {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #0d1a35;
  overflow: hidden;
}
.legal-doc .deletion-preview-title {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: #93a4c4;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.deletion-preview {
  max-height: 260px;
  margin: 0;
  padding: 14px;
  overflow: auto;
  color: #dbe4f5;
  font:
    0.8125rem/1.6 ui-monospace,
    SFMono-Regular,
    Consolas,
    monospace;
  white-space: pre-wrap;
  word-break: break-word;
}
.deletion-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.deletion-actions .btn {
  gap: 8px;
}
.deletion-actions .btn.is-done {
  color: #16a34a;
}
@media (max-width: 560px) {
  .deletion-form {
    padding: 18px;
  }
  .deletion-actions .btn {
    flex: 1 1 100%;
  }
}
.legal-doc .deletion-status {
  margin: 0;
  color: var(--brand);
  font-size: 0.875rem;
  font-weight: 500;
}
.legal-doc .deletion-status:empty {
  display: none;
}

.legal-doc .deletion-timeline {
  display: grid;
  gap: 12px;
  padding: 0;
  list-style: none;
}
@media (min-width: 720px) {
  .legal-doc .deletion-timeline {
    grid-template-columns: repeat(3, 1fr);
  }
}
.deletion-timeline li {
  position: relative;
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 16px;
  font-size: 0.875rem;
  line-height: 1.55;
}
.deletion-timeline strong {
  font-size: 1.0625rem;
}
.deletion-timeline-dot {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  margin-bottom: 6px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  box-shadow: 0 0 0 6px var(--brand-100);
}
.motion-enabled .deletion-timeline-dot {
  animation: legal-dot 3.6s ease-in-out infinite;
}
.motion-enabled .deletion-timeline li:nth-child(2) .deletion-timeline-dot {
  animation-delay: 1.2s;
}
.motion-enabled .deletion-timeline li:nth-child(3) .deletion-timeline-dot {
  animation-delay: 2.4s;
}
.motion-paused .deletion-timeline-dot {
  animation-play-state: paused;
}
@keyframes legal-dot {
  0%,
  70%,
  100% {
    box-shadow: 0 0 0 6px var(--brand-100);
  }
  20% {
    box-shadow: 0 0 0 10px var(--brand-200);
  }
}

@media (prefers-reduced-motion: reduce) {
  .legal-list-cards li,
  .deletion-case,
  .legal-tabs a {
    transition: none;
  }
  .legal-doc h2:target {
    animation: none;
  }
}

@media print {
  .site-header,
  .legal-tabs,
  .legal-aside,
  .site-footer,
  .fab-stack,
  .cookie-banner,
  .wave,
  .deletion-form {
    display: none !important;
  }
  .legal-hero {
    padding: 0 0 16px;
    background: none;
    color: #000;
  }
  .legal-lead,
  .legal-meta li,
  .legal-crumbs {
    color: #333;
  }
  .legal-body {
    padding: 0;
  }
}
