/* =========================================================
   Meu Vista — página jurídica (Termos de Uso)
   Texto longo: largura de leitura limitada, sumário fixo no desktop.
   Mobile-first: estilos base = celular, @media min-width = telas maiores.
   ========================================================= */

html { scroll-behavior: smooth; scroll-padding-top: 96px; }
body {
  margin: 0;
  background: var(--bg-deep);
  color: var(--fg-muted);
  font-family: var(--font-texto);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
h1, h2 { font-family: var(--font-titulo); color: var(--fg); margin: 0; }
p { margin: 0; }
a { color: var(--teal); text-underline-offset: 2px; }
a:hover { color: var(--teal-hover); }

.termos__container { max-width: 1160px; margin: 0 auto; padding: 0 20px; }

/* Topo */
.termos__topo {
  padding: 48px 0 36px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: radial-gradient(ellipse 70% 120% at 0% 0%, rgba(79, 111, 216, 0.16), transparent 60%);
}
.termos__rotulo { font-size: 12px; font-weight: 700; letter-spacing: 1.2px; color: var(--teal); margin-bottom: 12px; }
.termos__topo h1 { font-size: clamp(28px, 6vw, 44px); line-height: 1.15; letter-spacing: -0.8px; text-wrap: balance; }
.termos__versao { margin-top: 12px; font-size: 14px; color: var(--fg-dim); }
.termos__outro { margin-top: 16px; font-size: 15px; }

/* Grade: sumário + texto */
.termos__grade { display: grid; gap: 28px; padding-top: 28px; padding-bottom: 72px; }

.termos__sumario details {
  background: var(--bg-alt);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 4px 18px;
}
.termos__sumario summary {
  display: flex;
  align-items: center;
  min-height: 48px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--fg);
  cursor: pointer;
}
.termos__sumario ol { list-style: none; margin: 0 0 12px; padding: 0; font-size: 14px; line-height: 1.4; }
.termos__sumario a { display: block; padding: 8px 0; color: var(--fg-muted); text-decoration: none; }
.termos__sumario a:hover { color: var(--fg); }

/* Texto */
.termos__texto { min-width: 0; max-width: 760px; }
.termos__secao { padding-top: 28px; }
.termos__secao:first-child { padding-top: 0; }
.termos__secao h2 { font-size: 20px; line-height: 1.3; letter-spacing: -0.2px; margin-bottom: 14px; }
.termos__secao p + p,
.termos__secao p + .termos__itens,
.termos__secao .termos__itens + p,
.termos__secao p + .termos__defs { margin-top: 14px; }
.termos__clausula strong { color: var(--fg); font-weight: 700; }
.termos__texto a { overflow-wrap: anywhere; }

.termos__itens { margin: 0; padding-left: 28px; list-style: lower-roman; }
.termos__itens li { padding-left: 6px; }
.termos__itens li + li { margin-top: 8px; }
.termos__itens li::marker { color: var(--fg-dim); }

.termos__defs { margin: 14px 0 0; display: grid; gap: 12px; }
.termos__def { padding: 14px 16px; background: var(--bg-alt); border-radius: 12px; }
.termos__def dt { font-weight: 700; color: var(--fg); }
.termos__def dd { margin: 4px 0 0; }

.termos__revisao { margin-top: 40px; padding-top: 20px; border-top: 1px solid rgba(255, 255, 255, 0.08); font-size: 14px; color: var(--fg-dim); }

@media (min-width: 768px) {
  .termos__container { padding: 0 32px; }
  .termos__topo { padding: 72px 0 48px; }
  .termos__secao { padding-top: 40px; }
  .termos__secao h2 { font-size: 22px; }
  .termos__texto { font-size: 17px; }
}

@media (min-width: 1024px) {
  .termos__grade { grid-template-columns: 280px minmax(0, 1fr); gap: 56px; padding-top: 48px; }
  .termos__sumario { position: sticky; top: 104px; align-self: start; max-height: calc(100vh - 128px); overflow-y: auto; }
  .termos__sumario summary { pointer-events: none; list-style: none; }
  .termos__sumario summary::-webkit-details-marker { display: none; }
}

/* Setinha do sumário no celular/tablet (no desktop ele fica sempre aberto) */
@media (max-width: 1023px) {
  .termos__sumario summary { justify-content: space-between; list-style: none; }
  .termos__sumario summary::-webkit-details-marker { display: none; }
  .termos__sumario summary::after {
    content: "";
    width: 8px;
    height: 8px;
    border-right: 2px solid var(--fg-dim);
    border-bottom: 2px solid var(--fg-dim);
    transform: translateY(-2px) rotate(45deg);
    transition: transform 0.2s ease;
  }
  .termos__sumario details[open] summary::after { transform: translateY(2px) rotate(-135deg); }
}
