/* CaptaWeb — termos institucionais. Tokens compartilhados em styles.css. */
:root {
  --legal-scroll-offset: 104px;
}

.legal-page .topbar__brand {
  text-decoration: none;
}

.legal-main {
  width: min(100%, 1180px);
  margin: 0 auto;
  padding: 32px 0 40px;
}

.legal-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
  color: var(--text-soft);
  font-size: 0.9rem;
  line-height: 1.5;
}

.legal-breadcrumb a,
.legal-home,
.legal-back-top {
  color: var(--brand-blue);
  text-decoration: none;
}

.legal-breadcrumb a:hover,
.legal-home:hover,
.legal-back-top:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.legal-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 80px;
  align-items: center;
  gap: 36px;
  padding: clamp(28px, 4vw, 44px);
  border-radius: var(--radius-lg);
  scroll-margin-top: var(--legal-scroll-offset);
  --glass-bg: linear-gradient(110deg, #fff 35%, #edf6ff);
}

.legal-hero h1 {
  max-width: 22ch;
  margin: 0;
  color: var(--brand-navy);
  font-size: clamp(2rem, 4vw, 3.5rem);
  font-weight: 700;
  line-height: 1.15;
  text-wrap: balance;
}

.legal-hero__intro {
  max-width: 65ch;
  margin: 20px 0 0;
  color: var(--text-soft);
  font-size: 1.05rem;
  line-height: 1.75;
}

.legal-hero__icon {
  display: grid;
  place-items: center;
  width: 80px;
  height: 80px;
  border: 1px solid var(--border);
  border-radius: 22px;
  color: var(--brand-blue);
  background: #fff;
}

.legal-hero__icon .icon {
  width: 36px;
  height: 36px;
  stroke-width: 1.6;
}

.legal-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 20px 0 30px;
}

.legal-home,
.legal-download,
.legal-back-top {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.4;
}

.legal-home .icon {
  width: 18px;
  height: 18px;
  transform: rotate(180deg);
}

.legal-tools__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  max-width: 100%;
}

.legal-download {
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--brand-blue);
  background: #fff;
  cursor: pointer;
  text-decoration: none;
}

.legal-download:hover {
  border-color: var(--border-strong);
  background: var(--brand-ice);
}

.legal-download .icon,
.legal-back-top .icon {
  width: 18px;
  height: 18px;
}

.legal-layout {
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
  align-items: start;
  gap: 28px;
}

.legal-sidebar {
  position: sticky;
  top: var(--legal-scroll-offset);
  min-width: 0;
}

.legal-toc {
  max-height: calc(100svh - var(--legal-scroll-offset) - 20px);
  overflow-y: auto;
  border-radius: var(--radius);
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}

.legal-toc summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 72px;
  padding: 18px;
  list-style: none;
  cursor: pointer;
}

.legal-toc summary::-webkit-details-marker {
  display: none;
}

.legal-toc summary strong,
.legal-toc summary small {
  display: block;
}

.legal-toc summary strong {
  color: var(--brand-navy);
  font-size: 0.97rem;
  font-weight: 600;
}

.legal-toc summary small {
  margin-top: 3px;
  color: var(--text-soft);
  font-size: 0.8rem;
}

.legal-toc summary .icon {
  width: 18px;
  height: 18px;
  color: var(--brand-blue);
}

.js .legal-toc summary {
  pointer-events: none;
  cursor: default;
}

.js .legal-toc summary .icon {
  display: none;
}

.legal-toc[open] summary {
  border-bottom: 1px solid var(--border);
}

.legal-toc nav {
  padding: 10px;
}

.legal-toc nav a {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: start;
  gap: 9px;
  min-height: 44px;
  padding: 10px 9px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--text-soft);
  font-size: 0.88rem;
  line-height: 1.45;
  text-decoration: none;
  transition: background var(--motion-duration), color var(--motion-duration);
}

.legal-toc nav a:hover,
.legal-toc nav a[aria-current="location"] {
  color: var(--brand-blue);
  border-color: var(--border);
  background: var(--brand-sky);
}

.legal-toc nav a[aria-current="location"] {
  font-weight: 600;
}

.legal-toc__number {
  color: var(--brand-blue);
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.65;
  font-variant-numeric: tabular-nums;
}

.legal-content {
  display: grid;
  min-width: 0;
  gap: 24px;
}

.legal-document-intro {
  padding: 2px 0 8px;
}

.legal-document-intro__title {
  margin: 0 0 12px;
  color: var(--text-soft);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  line-height: 1.5;
}

.legal-section {
  min-width: 0;
  padding: var(--panel-padding);
  border-radius: var(--radius-lg);
  scroll-margin-top: var(--legal-scroll-offset);
}

.legal-section:focus-visible,
.legal-hero:focus-visible {
  outline: 3px solid var(--brand-blue);
  outline-offset: 4px;
}

.legal-section__header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.legal-section h2 {
  min-width: 0;
  margin: 0;
  color: var(--brand-navy);
  font-size: clamp(1.2rem, 1.8vw, 1.4rem);
  font-weight: 600;
  line-height: 1.45;
  text-wrap: balance;
}

.legal-section__number {
  color: var(--brand-blue);
  font-variant-numeric: tabular-nums;
}

.legal-clause,
.legal-list {
  color: var(--text-soft);
  font-size: 1rem;
  line-height: 1.8;
  text-wrap: pretty;
}

.legal-clause {
  margin: 0;
}

.legal-clause + .legal-clause,
.legal-list + .legal-clause {
  margin-top: 16px;
}

.legal-clause strong,
.legal-list strong {
  color: var(--brand-navy);
  font-weight: 600;
}

.legal-section a:not(.button) {
  color: var(--brand-blue);
  font-weight: 500;
  text-underline-offset: 4px;
  overflow-wrap: anywhere;
}

.legal-list {
  display: grid;
  gap: 10px;
  margin: 14px 0 20px;
  padding: 0;
  list-style: none;
}

.legal-list > li {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 8px;
}

.legal-letter {
  color: var(--brand-blue);
  font-weight: 600;
}

#termo-1 .legal-list {
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--brand-ice);
}

.legal-illustration,
.legal-pricing {
  margin: 24px 0;
}

.legal-illustration {
  padding: 22px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--brand-ice);
}

.legal-illustration figcaption,
.legal-pricing figcaption {
  margin-bottom: 20px;
  color: var(--brand-navy);
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.5;
}

.legal-flow {
  --step-size: 34px;
  --track-gap: 12px;
  --track-surface: var(--brand-ice);
}

.legal-flow--three {
  --step-count: 3;
}

.legal-flow .step-track__item {
  gap: 12px;
}

.legal-flow .icon {
  width: 18px;
  height: 18px;
}

.legal-flow .step-track__marker {
  box-shadow: 0 0 0 3px var(--track-surface);
}

.legal-flow__label {
  color: var(--text-soft);
  font-size: 0.85rem;
  line-height: 1.45;
  text-align: center;
}

.legal-access-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.legal-access-panel {
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--brand-ice);
}

.legal-access-panel .legal-clause:first-child br {
  display: block;
  content: "";
  margin-bottom: 8px;
}

.legal-note {
  margin-top: 20px;
  padding: 20px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--brand-blue);
  border-radius: var(--radius-sm);
  background: var(--brand-ice);
}

.legal-note .legal-list {
  margin-bottom: 16px;
}

.legal-pricing {
  margin-top: 0;
}

.legal-pricing__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.legal-price {
  display: grid;
  align-content: start;
  gap: 8px;
  min-width: 0;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--brand-ice);
}

.legal-price--featured {
  border-color: var(--border-strong);
  background: var(--brand-sky);
}

.legal-price > span {
  color: var(--text-soft);
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.5;
}

.legal-price > strong {
  color: var(--brand-navy);
  font-size: clamp(1.8rem, 2.4vw, 2.3rem);
  font-weight: 600;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.legal-price > small {
  color: var(--text-soft);
  font-size: 0.875rem;
}

.legal-start {
  margin-top: 24px;
}

.legal-back-top {
  justify-self: start;
  margin: 0;
}

.legal-page .site-footer__legal-links a[aria-current="page"] {
  color: var(--brand-blue);
}

@media (max-width: 1000px) {
  .legal-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
  }

  .legal-sidebar {
    position: static;
  }

  .legal-toc {
    max-height: none;
  }

  .js .legal-toc summary {
    pointer-events: auto;
    cursor: pointer;
  }

  .js .legal-toc summary .icon {
    display: block;
  }

  .legal-toc[open] summary .icon {
    transform: rotate(180deg);
  }

  .legal-toc nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
  }
}

@media (max-width: 820px) {
  .legal-main {
    padding-top: 24px;
  }

  .legal-hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
  }

  .legal-hero__icon {
    display: none;
  }

  .legal-access-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 600px) {
  .legal-breadcrumb {
    font-size: 0.85rem;
  }

  .legal-hero {
    padding: 26px 22px;
  }

  .legal-hero__intro {
    font-size: 1rem;
  }

  .legal-tools {
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 22px;
  }

  .legal-tools__actions {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .legal-download {
    justify-content: center;
    width: 100%;
    min-height: 48px;
  }

  .legal-toc nav {
    grid-template-columns: minmax(0, 1fr);
  }

  .legal-section {
    padding: 24px 20px;
  }

  .legal-section__header {
    display: block;
  }

  .legal-section__header .card-icon {
    width: 40px;
    height: 40px;
    margin-bottom: 14px;
    border-radius: 10px;
  }

  .legal-section h2 {
    font-size: 1.18rem;
  }

  .legal-access-panel,
  .legal-note {
    padding: 18px;
  }

  .legal-illustration {
    padding: 20px 16px;
  }

  .legal-flow {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }

  .legal-flow::before {
    display: none;
  }

  .legal-flow > .step-track__item {
    grid-template-columns: var(--step-size) minmax(0, 1fr);
    grid-template-rows: auto;
    align-items: center;
    gap: 12px;
  }

  .legal-flow > .step-track__item::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: -16px;
    left: calc(var(--step-size) / 2 - 1px);
    width: 2px;
    background: var(--border-strong);
  }

  .legal-flow > .step-track__item:first-child::before {
    top: 50%;
  }

  .legal-flow > .step-track__item:last-child::before {
    bottom: 50%;
  }

  .legal-flow__label {
    font-size: 0.9rem;
    text-align: left;
  }

  .legal-pricing__grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .legal-price {
    padding: 22px;
  }

  #termo-1 .legal-list {
    padding: 16px;
  }

  .legal-page .button {
    white-space: normal;
  }
}

/* A impressão contém todas as cláusulas, alíneas e URLs originais. */
@page {
  size: A4;
  margin: 16mm 17mm;
}

@media print {
  html,
  .legal-page {
    background: #fff !important;
    color: #111;
    font-size: 11pt;
  }

  .legal-page .app,
  .legal-main,
  .legal-layout,
  .legal-content {
    display: block;
    width: auto;
    max-width: none;
    padding: 0;
    margin: 0;
  }

  .topbar,
  .skip-link,
  .icon-sprite,
  .legal-breadcrumb,
  .legal-sidebar,
  .legal-tools,
  .legal-back-top,
  .site-footer,
  .legal-hero__icon,
  .legal-section__header .card-icon,
  .legal-illustration,
  .legal-pricing,
  .legal-start {
    display: none !important;
  }

  .legal-hero,
  .legal-section,
  .legal-note,
  .legal-access-panel {
    overflow: visible;
    padding: 0;
    margin: 0 0 14pt;
    border: 0;
    border-radius: 0;
    background: transparent !important;
    box-shadow: none;
  }

  .legal-hero {
    display: block;
    margin-bottom: 18pt;
  }

  .legal-hero .eyebrow {
    padding: 0;
    border: 0;
    background: transparent;
    color: #111;
  }

  .legal-hero h1 {
    max-width: none;
    font-size: 22pt;
  }

  .legal-hero__intro {
    margin-top: 10pt;
    font-size: 11pt;
  }

  .legal-document-intro {
    margin-bottom: 16pt;
  }

  .legal-section__header {
    display: block;
    margin-bottom: 10pt;
    break-after: avoid;
  }

  .legal-section h2 {
    font-size: 13pt;
    color: #111;
    break-after: avoid;
  }

  .legal-clause,
  .legal-list,
  .legal-hero__intro {
    color: #111;
    font-size: 11pt;
    line-height: 1.5;
    orphans: 3;
    widows: 3;
  }

  .legal-clause strong,
  .legal-list strong,
  .legal-section__number,
  .legal-letter,
  .legal-section a:not(.button) {
    color: #111;
  }

  .legal-clause + .legal-clause,
  .legal-list + .legal-clause {
    margin-top: 9pt;
  }

  .legal-list,
  #termo-1 .legal-list {
    display: block;
    padding: 0;
    margin: 8pt 0 12pt;
    border: 0;
    background: transparent;
  }

  .legal-list > li {
    display: grid;
    grid-template-columns: 18pt minmax(0, 1fr);
    margin-bottom: 4pt;
    break-inside: avoid;
  }

  .legal-access-grid {
    display: block;
    margin: 12pt 0 0;
  }

  .legal-note {
    margin-top: 12pt;
  }

  a {
    text-decoration: none;
  }
}
