/* ==========================================================================
   Páginas públicas de documentos legais — colibex.com.br/crm/criarconta/
   Fonte: tabela termos_documento (mesma do painel)
   ========================================================================== */
:root {
  --td-navy: #083b48;
  --td-blue: #2196f3;
  --td-blue-dark: #1976d2;
  --td-text: #3d4552;
  --td-muted: #6b7684;
  --td-border: #e3e8ef;
  --td-bg: #f4f7fb;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body.tm-body-site {
  margin: 0; padding: 0; background: var(--td-bg); color: var(--td-text);
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, -apple-system, sans-serif;
  line-height: 1.65; font-size: 16px;
}

/* ---------- Cabeçalho ---------- */
.tm-site-head {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  background: #fff; border-bottom: 1px solid var(--td-border);
  padding: .85rem 1.5rem; position: sticky; top: 0; z-index: 10;
}
.tm-site-brand { display: inline-flex; align-items: center; gap: .55rem; text-decoration: none; }
.tm-site-brand__mark {
  width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--td-blue), #00bcd4);
  color: #fff; font-weight: 800; font-size: 1.05rem;
}
.tm-site-brand__name { color: var(--td-navy); font-weight: 700; font-size: 1.12rem; letter-spacing: -.01em; }
.tm-site-head__back {
  color: var(--td-blue-dark); text-decoration: none; font-size: .86rem; font-weight: 600;
  border: 1px solid var(--td-border); border-radius: 8px; padding: .42rem .85rem;
  transition: all .15s ease;
}
.tm-site-head__back:hover { background: var(--td-bg); border-color: var(--td-blue); }

/* ---------- Layout ---------- */
.tm-site-wrap {
  max-width: 1120px; margin: 0 auto; padding: 1.6rem 1.25rem 3rem;
  display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 1.5rem;
  align-items: start;
}
.tm-site-nav, .tm-site-doc { min-width: 0; }

/* ---------- Menu lateral ---------- */
.tm-site-nav {
  position: sticky; top: 5rem; background: #fff; border: 1px solid var(--td-border);
  border-radius: 12px; padding: 1rem .85rem; box-shadow: 0 1px 3px rgba(16,24,40,.04);
}
.tm-site-nav__title {
  margin: 0 0 .6rem; font-size: .68rem; font-weight: 700; letter-spacing: .09em;
  text-transform: uppercase; color: var(--td-muted);
}
.tm-site-nav ul { list-style: none; margin: 0; padding: 0; }
.tm-site-nav li + li { margin-top: .25rem; }
.tm-site-nav a {
  display: block; padding: .55rem .7rem; border-radius: 8px; text-decoration: none;
  color: var(--td-text); font-size: .88rem; font-weight: 500; border: 1px solid transparent;
  transition: all .15s ease;
}
.tm-site-nav a:hover { background: var(--td-bg); color: var(--td-blue-dark); }
.tm-site-nav a.is-active {
  background: #e8f4fe; border-color: #b9defb; color: var(--td-blue-dark); font-weight: 600;
}

/* ---------- Cartão do documento ---------- */
.tm-site-card {
  background: #fff; border: 1px solid var(--td-border); border-radius: 12px;
  box-shadow: 0 1px 3px rgba(16,24,40,.05);
}
.tm-site-doc { padding: 2rem 2.25rem; }
.tm-site-doc__head { padding-bottom: 1.15rem; border-bottom: 1px solid var(--td-border); margin-bottom: 1.5rem; }
.tm-site-doc__head h1 {
  margin: 0 0 .45rem; font-size: 1.72rem; line-height: 1.25; font-weight: 700;
  color: var(--td-navy); letter-spacing: -.02em;
}
.tm-site-doc__sub { margin: 0 0 .85rem; color: var(--td-muted); font-size: .94rem; }
.tm-site-doc__meta { display: flex; flex-wrap: wrap; gap: .45rem; margin: 0; }
.tm-site-badge {
  display: inline-flex; align-items: center; gap: .3rem; border-radius: 999px;
  padding: .28rem .72rem; font-size: .75rem; font-weight: 600;
  background: #e8f4fe; color: var(--td-blue-dark);
}
.tm-site-badge--soft { background: var(--td-bg); color: var(--td-muted); border: 1px solid var(--td-border); }

/* ---------- Conteúdo ---------- */
.tm-site-content { color: var(--td-text); font-size: .95rem; line-height: 1.75; overflow-wrap: break-word; }
.tm-site-content h2 {
  font-size: 1.18rem; font-weight: 700; color: var(--td-navy);
  margin: 2rem 0 .75rem; padding-bottom: .45rem; border-bottom: 2px solid #eef2f7;
}
.tm-site-content h3 { font-size: 1.02rem; font-weight: 700; color: var(--td-navy); margin: 1.5rem 0 .5rem; }
.tm-site-content p { margin: 0 0 .9rem; }
.tm-site-content ul, .tm-site-content ol { margin: 0 0 1rem; padding-left: 1.35rem; }
.tm-site-content li { margin-bottom: .4rem; }
.tm-site-content strong { color: var(--td-navy); font-weight: 600; }
.tm-site-content a { color: var(--td-blue-dark); }
.tm-site-content > *:first-child { margin-top: 0; }

/* Callouts */
.tm-site-content .tm-callout {
  border-radius: 8px; padding: .85rem 1.05rem; margin: 0 0 1rem;
  font-size: .9rem; border-left: 4px solid transparent;
}
.tm-site-content .tm-callout > *:last-child { margin-bottom: 0; }
.tm-site-content .tm-callout--info { background: #f0f6ff; border-left-color: var(--td-blue); color: #1a3a5c; }
.tm-site-content .tm-callout--highlight { background: #e3f2fd; border-left-color: var(--td-blue); color: #143f63; }
.tm-site-content .tm-callout--warning { background: #fff8e1; border-left-color: #ffb300; color: #5c4a1a; }
.tm-site-content .tm-callout--danger { background: #fdecee; border-left-color: #e53935; color: #6b2226; }
.tm-site-content .tm-callout strong { color: inherit; }
.tm-site-content .tm-plan-details { margin-bottom: .5rem; }

/* Tabelas */
.tm-site-content table { width: 100%; border-collapse: collapse; margin: 0 0 1rem; font-size: .88rem; }
.tm-site-content th, .tm-site-content td { border: 1px solid var(--td-border); padding: .55rem .7rem; text-align: left; }
.tm-site-content th { background: var(--td-bg); color: var(--td-navy); font-weight: 600; }

/* ---------- Rodapé do documento ---------- */
.tm-site-doc__foot {
  display: flex; flex-wrap: wrap; gap: .65rem; justify-content: flex-end;
  margin-top: 2rem; padding-top: 1.25rem; border-top: 1px solid var(--td-border);
}
.tm-site-btn {
  display: inline-flex; align-items: center; gap: .4rem; cursor: pointer;
  border: 1px solid var(--td-border); background: #fff; color: var(--td-text);
  border-radius: 8px; padding: .55rem 1.05rem; font-size: .86rem; font-weight: 600;
  text-decoration: none; font-family: inherit; transition: all .15s ease;
}
.tm-site-btn:hover { background: var(--td-bg); color: var(--td-navy); }
.tm-site-btn--primary {
  background: var(--td-blue); border-color: var(--td-blue); color: #fff;
  box-shadow: 0 2px 8px rgba(33,150,243,.28);
}
.tm-site-btn--primary:hover { background: var(--td-blue-dark); color: #fff; }

/* ---------- Rodapé da página ---------- */
.tm-site-foot {
  border-top: 1px solid var(--td-border); background: #fff; color: var(--td-muted);
  text-align: center; padding: 1.6rem 1.25rem; font-size: .81rem;
}
.tm-site-foot p { margin: .25rem 0; }
.tm-site-foot a { color: var(--td-blue-dark); text-decoration: none; font-weight: 600; }
.tm-site-foot a:hover { text-decoration: underline; }
.tm-site-foot span { margin: 0 .35rem; opacity: .5; }

/* ---------- Erro / vazio ---------- */
.tm-site-empty { padding: 3rem 2rem; text-align: center; }
.tm-site-empty h1 { font-size: 1.4rem; color: var(--td-navy); margin: 0 0 .5rem; }
.tm-site-empty p { color: var(--td-muted); margin: 0 0 .75rem; }

/* ---------- Responsivo ---------- */
@media (max-width: 860px) {
  .tm-site-wrap { grid-template-columns: minmax(0, 1fr); gap: 1rem; padding: 1rem .9rem 2rem; }
  .tm-site-nav { position: static; }
  .tm-site-nav ul { display: flex; gap: .4rem; overflow-x: auto; }
  .tm-site-nav li { flex: 0 0 auto; }
  .tm-site-nav li + li { margin-top: 0; }
  .tm-site-nav a { white-space: nowrap; }
  .tm-site-nav__title { display: none; }
  .tm-site-doc { padding: 1.35rem 1.2rem; }
  .tm-site-doc__head h1 { font-size: 1.4rem; }
  .tm-site-head { padding: .7rem 1rem; }
  .tm-site-doc__foot { justify-content: stretch; }
  .tm-site-doc__foot .tm-site-btn { flex: 1 1 auto; justify-content: center; }
}

/* ---------- Impressão ---------- */
@media print {
  body.tm-body-site { background: #fff !important; font-size: 11.5pt; }
  .tm-site-head, .tm-site-nav, .tm-site-doc__foot, .tm-site-foot { display: none !important; }
  .tm-site-wrap { display: block; max-width: none; padding: 0; }
  .tm-site-card { border: 0 !important; box-shadow: none !important; border-radius: 0 !important; }
  .tm-site-doc { padding: 0 !important; }
  .tm-site-content { color: #000 !important; }
  .tm-site-content h2, .tm-site-content h3, .tm-site-content strong { color: #000 !important; }
  .tm-site-content h2 { border-bottom: 1px solid #999 !important; page-break-after: avoid; }
  .tm-site-content .tm-callout { border: 1px solid #999 !important; background: none !important; color: #000 !important; }
  .tm-site-doc__head { page-break-after: avoid; }
  @page { margin: 1.6cm; }
}
