/* Cartorária — cartoraria.com.br
   Identidade herdada do Design System v1.0 do sistema.
   Temas: claro (padrão) e escuro, com os mesmos tokens do produto.
   O tema segue o sistema operacional e pode ser trocado no botão do
   header (persistido em localStorage, atributo data-theme no <html>). */

:root {
  --bg: #FAF7F0;
  --surface: #FFFFFF;
  --surface-2: #F0E9D6;
  --text: #0A0A0A;
  --muted: #6B5B3D;
  --subtle: #9A8A6A;
  --border: #E8DCBA;
  --border-soft: #F0E7D0;

  --gold: #B4964B;
  --gold-deep: #8E7232;
  --gold-light: #D4B36A;
  --gold-pale: #E8D58E;
  --gold-edge: #6E5220;
  --gold-center: #F8E9B0;
  --on-gold: #0A0A0A;

  --link: #8E7232;
  --accent-strong: #8E7232;
  --bubble-ai: #F6ECCF;
  --top-bg: rgba(250, 247, 240, 0.85);

  --gold-metal: linear-gradient(180deg, #6E5220 0%, #B4964B 25%, #F8E9B0 50%, #B4964B 75%, #6E5220 100%);
  --glass-bg: rgba(255, 255, 255, 0.55);
  --glass-border: rgba(180, 150, 75, 0.32);
  --glass-border-hover: rgba(180, 150, 75, 0.65);
  --glass-inset: rgba(255, 255, 255, 0.7);
  --s-soft: 0 1px 2px rgba(10, 10, 10, 0.04), 0 6px 18px rgba(142, 114, 50, 0.07);
  --s-float: 0 2px 6px rgba(10, 10, 10, 0.05), 0 8px 24px rgba(142, 114, 50, 0.08);

  --aura-min: rgba(142, 114, 50, 0.28);
  --aura-max: rgba(180, 150, 75, 0.55);

  --bg-decor:
    radial-gradient(1200px 600px at 50% -10%, rgba(180, 150, 75, 0.14), transparent 60%),
    radial-gradient(700px 500px at 90% 100%, rgba(212, 179, 106, 0.10), transparent 55%);

  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
}

/* Tema escuro — mesmos valores do tokens.css do sistema */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0A0A0A;
    --surface: #1A1A1A;
    --surface-2: #241F17;
    --text: #FAF7F0;
    --muted: #D4B36A;
    --subtle: #8A7E63;
    --border: rgba(212, 179, 106, 0.18);
    --border-soft: rgba(212, 179, 106, 0.10);

    --link: #D4B36A;
    --accent-strong: #E8D58E;
    --bubble-ai: rgba(180, 150, 75, 0.15);
    --top-bg: rgba(10, 10, 10, 0.85);

    --glass-bg: rgba(36, 31, 23, 0.55);
    --glass-border: rgba(212, 179, 106, 0.28);
    --glass-border-hover: rgba(232, 213, 142, 0.55);
    --glass-inset: rgba(255, 244, 200, 0.08);
    --s-soft: 0 1px 2px rgba(0, 0, 0, 0.4), 0 6px 18px rgba(0, 0, 0, 0.3);
    --s-float: 0 2px 6px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.35);

    --aura-min: rgba(212, 179, 106, 0.35);
    --aura-max: rgba(232, 213, 142, 0.6);

    --bg-decor:
      radial-gradient(1200px 600px at 50% -10%, rgba(212, 179, 106, 0.18), transparent 60%),
      radial-gradient(700px 500px at 90% 100%, rgba(180, 150, 75, 0.10), transparent 55%);
  }
}
:root[data-theme="dark"] {
  --bg: #0A0A0A;
  --surface: #1A1A1A;
  --surface-2: #241F17;
  --text: #FAF7F0;
  --muted: #D4B36A;
  --subtle: #8A7E63;
  --border: rgba(212, 179, 106, 0.18);
  --border-soft: rgba(212, 179, 106, 0.10);

  --link: #D4B36A;
  --accent-strong: #E8D58E;
  --bubble-ai: rgba(180, 150, 75, 0.15);
  --top-bg: rgba(10, 10, 10, 0.85);

  --glass-bg: rgba(36, 31, 23, 0.55);
  --glass-border: rgba(212, 179, 106, 0.28);
  --glass-border-hover: rgba(232, 213, 142, 0.55);
  --glass-inset: rgba(255, 244, 200, 0.08);
  --s-soft: 0 1px 2px rgba(0, 0, 0, 0.4), 0 6px 18px rgba(0, 0, 0, 0.3);
  --s-float: 0 2px 6px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.35);

  --aura-min: rgba(212, 179, 106, 0.35);
  --aura-max: rgba(232, 213, 142, 0.6);

  --bg-decor:
    radial-gradient(1200px 600px at 50% -10%, rgba(212, 179, 106, 0.18), transparent 60%),
    radial-gradient(700px 500px at 90% 100%, rgba(180, 150, 75, 0.10), transparent 55%);
}

/* Logos por tema: .só-claro aparece no claro, .só-escuro no escuro */
.so-escuro { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .so-claro { display: none; }
  :root:not([data-theme="light"]) .so-escuro { display: block; }
}
:root[data-theme="dark"] .so-claro { display: none; }
:root[data-theme="dark"] .so-escuro { display: block; }
:root[data-theme="light"] .so-claro { display: block; }
:root[data-theme="light"] .so-escuro { display: none; }

/* Ícones do botão de tema (lua no claro, sol no escuro) */
.theme-toggle .ico-sun { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .ico-moon { display: none; }
  :root:not([data-theme="light"]) .theme-toggle .ico-sun { display: block; }
}
:root[data-theme="dark"] .theme-toggle .ico-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .ico-sun { display: block; }
:root[data-theme="light"] .theme-toggle .ico-moon { display: block; }
:root[data-theme="light"] .theme-toggle .ico-sun { display: none; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg-decor), var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.25s ease, color 0.25s ease;
}
img { max-width: 100%; display: block; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 3px solid rgba(180, 150, 75, 0.5); outline-offset: 2px; }

.wrap { max-width: 960px; margin: 0 auto; padding: 0 24px; }

h1, h2, h3 {
  font-family: var(--sans);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--text);
  margin: 0;
  text-wrap: balance;
}

/* ---------- Header ---------- */
.top { border-bottom: 1px solid var(--border-soft); background: var(--top-bg); }
.top .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-top: 16px;
  padding-bottom: 16px;
}
.top .logo img { height: 44px; width: auto; }
.top nav { display: flex; gap: 22px; align-items: center; }
.top nav a { color: var(--muted); font-size: 0.92rem; font-weight: 500; }
.top nav a:hover { color: var(--accent-strong); text-decoration: none; }

.theme-toggle {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  color: var(--accent-strong);
  cursor: pointer;
  padding: 0;
}
.theme-toggle:hover { border-color: var(--glass-border-hover); }
.theme-toggle svg { width: 18px; height: 18px; }

/* ---------- Botões ---------- */
.btn {
  display: inline-block;
  padding: 12px 24px;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: var(--sans);
  cursor: pointer;
  border: 1px solid transparent;
}
.btn-solid {
  background: var(--gold-metal);
  color: var(--on-gold);
  box-shadow: var(--s-soft);
  border-color: rgba(110, 82, 32, 0.4);
}
.btn-solid:hover { box-shadow: var(--s-float); text-decoration: none; filter: brightness(1.05); }
.btn-line {
  border-color: var(--glass-border);
  color: var(--accent-strong);
  background: var(--glass-bg);
}
.btn-line:hover { border-color: var(--glass-border-hover); text-decoration: none; }

/* ---------- Hero ---------- */
.hero .wrap {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 44px;
  align-items: center;
  padding-top: 72px;
  padding-bottom: 72px;
}
.hero h1 { font-size: clamp(2.2rem, 4.6vw, 3.3rem); margin-bottom: 20px; }
.hero .lead {
  color: var(--muted);
  font-size: 1.1rem;
  max-width: 48ch;
  margin: 0 0 32px;
}
.hero .ctas { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.hero .ctas .aside { width: 100%; font-size: 0.85rem; color: var(--subtle); margin-top: 4px; }

/* Símbolo — metal rico, brilho que percorre a figura */
.figure {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  max-width: 470px;
  margin-left: auto;
}
.figure img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  animation: aura 4.5s ease-in-out infinite;
}
.figure .shine {
  position: absolute;
  inset: 0;
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  background: linear-gradient(115deg, transparent 34%, rgba(255, 250, 215, 0.55) 44%, rgba(255, 252, 235, 1) 50%, rgba(255, 250, 215, 0.55) 56%, transparent 66%);
  background-size: 300% 100%;
  background-repeat: no-repeat;
  animation: sheen 4.5s ease-in-out infinite;
  pointer-events: none;
}
@keyframes sheen {
  0%   { background-position: 150% 0; }
  50%  { background-position: -50% 0; }
  100% { background-position: -50% 0; }
}
@keyframes aura {
  0%, 100% { filter: drop-shadow(0 12px 34px var(--aura-min)); }
  50%      { filter: drop-shadow(0 14px 52px var(--aura-max)) drop-shadow(0 0 24px var(--aura-min)); }
}

/* ---------- Seções ---------- */
section.block { border-top: 1px solid var(--border-soft); }
section.block .wrap { padding-top: 68px; padding-bottom: 68px; }
section.block h2 { font-size: clamp(1.6rem, 3.2vw, 2.1rem); margin-bottom: 18px; }
section.block p { color: var(--muted); max-width: 64ch; }
.status-note { font-size: 0.9rem; color: var(--subtle); margin-top: 26px; }

/* Grid de módulos — eco do launcher do sistema (cards de vidro) */
.tiles {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-top: 30px;
}
@media (min-width: 700px) { .tiles { grid-template-columns: repeat(3, 1fr); } }
.tile {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  padding: 20px;
  box-shadow: inset 0 1px 0 var(--glass-inset), var(--s-soft);
  transition: border-color 0.2s cubic-bezier(0.2, 0.7, 0.2, 1), box-shadow 0.2s;
}
.tile:hover { border-color: var(--glass-border-hover); box-shadow: inset 0 1px 0 var(--glass-inset), var(--s-float); }
.tile h3 { font-size: 1rem; font-weight: 600; margin-bottom: 6px; }
.tile p { font-size: 0.88rem; color: var(--muted); margin: 0; max-width: none; }

/* ---------- Contato ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 52px;
  align-items: start;
  margin-top: 28px;
}
.contact-direct p { margin: 0 0 12px; color: var(--muted); }
.contact-direct strong { color: var(--text); font-weight: 600; }

.social { display: flex; gap: 10px; margin-top: 18px; }
.social a {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  color: var(--accent-strong);
}
.social a:hover { border-color: var(--glass-border-hover); text-decoration: none; }
.social svg { width: 20px; height: 20px; }

form.pedido { display: flex; flex-direction: column; gap: 15px; }
.pedido label {
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  color: var(--accent-strong);
  display: block;
  margin-bottom: 6px;
}
.pedido input,
.pedido select,
.pedido textarea {
  width: 100%;
  padding: 11px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-family: var(--sans);
  font-size: 0.95rem;
}
.pedido input:focus,
.pedido select:focus,
.pedido textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(180, 150, 75, 0.3);
}
.pedido textarea { resize: vertical; min-height: 110px; }
.pedido .hint { font-size: 0.8rem; color: var(--subtle); margin: 0; }

/* ---------- Rodapé ---------- */
.foot { border-top: 1px solid var(--border); margin-top: 36px; background: var(--surface-2); }
.foot .wrap { padding-top: 36px; padding-bottom: 48px; font-size: 0.86rem; color: var(--muted); }
.foot p { margin: 0 0 6px; }
.foot a { color: var(--link); }
.foot .social { margin-top: 16px; }

/* =========================================================
   Páginas de documento (privacidade, termos, casos de uso, demo)
   ========================================================= */
.page-hero .wrap { padding-top: 56px; padding-bottom: 36px; }
.page-title { font-size: clamp(1.9rem, 3.8vw, 2.7rem); margin-bottom: 14px; }
.page-lead { color: var(--muted); font-size: 1.05rem; max-width: 68ch; margin: 0; }
.doc-meta { display: flex; gap: 20px; flex-wrap: wrap; margin-top: 16px; font-size: 0.83rem; color: var(--subtle); }
.doc-meta strong { color: var(--accent-strong); font-weight: 600; }
.eyebrow {
  display: inline-block;
  font-size: 0.74rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--accent-strong);
  margin-bottom: 12px;
}

.article-layout {
  display: grid;
  grid-template-columns: 230px 1fr;
  gap: 44px;
  align-items: start;
  padding: 20px 0 88px;
}
.article-toc {
  position: sticky;
  top: 20px;
  border-top: 2px solid var(--gold);
  padding-top: 14px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
}
.article-toc h4 {
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-strong);
  margin: 0 0 10px;
}
.article-toc ol { list-style: none; margin: 0; padding: 0; counter-reset: toc; }
.article-toc li { counter-increment: toc; }
.article-toc a { display: flex; gap: 8px; padding: 4px 0; font-size: 0.86rem; color: var(--muted); }
.article-toc a::before {
  content: counter(toc, decimal-leading-zero);
  color: var(--gold);
  font-family: var(--mono);
  font-size: 0.74rem;
}
.article-toc a:hover { color: var(--accent-strong); text-decoration: none; }

.article { max-width: 70ch; line-height: 1.75; }
.article > * + * { margin-top: 15px; }
.article h2 {
  font-size: 1.45rem;
  margin-top: 44px;
  padding-top: 18px;
  border-top: 1px solid var(--border-soft);
  scroll-margin-top: 20px;
}
.article h2:first-child { margin-top: 0; border-top: 0; padding-top: 0; }
.article h3 { font-size: 1rem; font-weight: 600; color: var(--accent-strong); margin-top: 26px; }
.article p, .article li { color: var(--muted); font-size: 0.97rem; }
.article strong { color: var(--text); }
.article ul, .article ol { padding-left: 22px; }
.article li { margin: 5px 0; }
.article li::marker { color: var(--gold); }
.article code {
  font-family: var(--mono);
  font-size: 0.85em;
  background: var(--surface-2);
  padding: 1px 6px;
  border-radius: 4px;
  color: var(--accent-strong);
}
.article blockquote {
  margin: 18px 0;
  padding: 12px 20px;
  border-left: 3px solid var(--gold);
  background: var(--surface);
  border-radius: 0 10px 10px 0;
}
.article dl dt { color: var(--accent-strong); font-weight: 600; margin-top: 12px; }
.article dl dd { margin: 0; color: var(--muted); }
.article table { width: 100%; border-collapse: collapse; font-size: 0.9rem; margin: 16px 0; }
.article th, .article td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-soft);
  vertical-align: top;
}
.article th { color: var(--accent-strong); font-weight: 600; background: var(--surface-2); }
.article .callout {
  display: flex;
  gap: 12px;
  padding: 16px 20px;
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  background: var(--glass-bg);
  box-shadow: var(--s-soft);
  margin: 20px 0;
}
.article .callout svg { width: 20px; height: 20px; flex-shrink: 0; color: var(--accent-strong); margin-top: 2px; }
.article .callout strong { display: block; color: var(--accent-strong); margin-bottom: 4px; }

/* Fluxos (casos de uso) */
.flow-section .wrap { padding-top: 36px; padding-bottom: 36px; }
.flow-header { max-width: 70ch; margin-bottom: 24px; }
.flow-header h2 { font-size: clamp(1.5rem, 3vw, 1.9rem); margin-bottom: 10px; }
.flow-header p { color: var(--muted); }
.flow-diagram {
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  padding: 30px;
  background: var(--glass-bg);
  box-shadow: var(--s-soft);
}
.flow-steps { display: flex; flex-direction: column; }
.flow-step { display: grid; grid-template-columns: 38px 1fr; gap: 16px; position: relative; padding-bottom: 22px; }
.flow-step:last-child { padding-bottom: 0; }
.flow-step:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 18px;
  top: 42px;
  bottom: 4px;
  width: 1px;
  background: var(--border);
}
.step-num {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--gold-metal);
  color: var(--on-gold);
  display: grid;
  place-items: center;
  font-weight: 600;
  font-size: 0.95rem;
}
.step-body h3 { font-size: 0.98rem; font-weight: 600; color: var(--text); margin: 8px 0 6px; }
.step-body p { color: var(--muted); font-size: 0.93rem; margin: 0; }
.step-tag {
  display: inline-block;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--accent-strong);
  border: 1px solid var(--glass-border);
  border-radius: 4px;
  padding: 2px 8px;
  margin-top: 8px;
  background: var(--surface);
}
.step-msg {
  margin-top: 10px;
  padding: 12px 16px;
  border-radius: 10px;
  border: 1px solid var(--border-soft);
  background: var(--surface);
  font-size: 0.91rem;
  color: var(--text);
}
.step-msg.from-cartorio { background: var(--bubble-ai); }
.step-msg .msg-meta { display: block; font-size: 0.71rem; color: var(--subtle); margin-bottom: 4px; }
.flow-legend { margin-top: 26px; padding: 18px 22px; border: 1px solid var(--glass-border); border-radius: 10px; background: var(--surface); }
.flow-legend h3 { font-size: 0.93rem; color: var(--accent-strong); margin: 0 0 8px; }
.flow-legend p { font-size: 0.91rem; color: var(--muted); margin: 6px 0; }

.category-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin: 26px 0; }
.category { border: 1px solid var(--border-soft); border-radius: 10px; padding: 18px; background: var(--surface); }
.category.used { border-color: var(--glass-border-hover); background: var(--glass-bg); box-shadow: var(--s-soft); }
.category h4 {
  margin: 0 0 6px;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-strong);
}
.category strong { display: block; font-size: 1.05rem; margin-bottom: 6px; }
.category p { font-size: 0.88rem; color: var(--muted); margin: 0; }

/* Demo */
.video-placeholder {
  aspect-ratio: 16 / 9;
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  background: var(--glass-bg);
  box-shadow: var(--s-soft);
  display: grid;
  place-items: center;
  position: relative;
  margin: 26px 0;
}
.play-btn {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 0;
  background: var(--gold-metal);
  color: var(--on-gold);
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: var(--s-float);
}
.play-btn svg { width: 28px; height: 28px; margin-left: 4px; }
.vp-caption {
  position: absolute;
  bottom: 16px;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--subtle);
}
.script-grid { display: grid; grid-template-columns: 92px 1fr 1fr; gap: 12px 20px; margin-top: 22px; }
.script-grid .col-head {
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--accent-strong);
  border-bottom: 2px solid var(--gold);
  padding-bottom: 8px;
}
.script-scene { display: contents; }
.script-scene .time {
  font-family: var(--mono);
  font-size: 0.84rem;
  color: var(--accent-strong);
  padding: 10px 0;
  border-top: 1px solid var(--border-soft);
}
.script-scene .screen,
.script-scene .narration {
  padding: 10px 0;
  border-top: 1px solid var(--border-soft);
  font-size: 0.91rem;
  color: var(--muted);
}
.script-scene strong { color: var(--text); }

/* ---------- Responsivo ---------- */
@media (max-width: 860px) {
  .hero .wrap { grid-template-columns: 1fr; padding-top: 44px; padding-bottom: 48px; }
  .figure { max-width: 300px; margin: 0 auto; }
  .contact-grid { grid-template-columns: 1fr; gap: 32px; }
  .article-layout { grid-template-columns: 1fr; }
  .article-toc { position: static; max-height: none; }
  .category-grid { grid-template-columns: 1fr; }
  .script-grid { grid-template-columns: 80px 1fr; }
  .script-grid .col-head:nth-child(3) { display: none; }
  .script-scene .narration { grid-column: 2; border-top: 0; padding-top: 0; }
  .top nav a:not(.btn) { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .figure img { animation: none; filter: drop-shadow(0 12px 34px var(--aura-min)); }
  .figure .shine { animation: none; background: none; }
}
