/* Teixeira Ribeiro Advogados: formulário em conversa (mesmo formato do Caio
   Bastos). Identidade do cartão do escritório: azul-marinho e o dourado da
   marca (#938C6B), Cormorant nos títulos e Inter no texto. */
:root {
  --navy-950: #060d19;
  --navy-900: #0b1628;
  --navy-800: #152342;
  --navy-line: #22345a;
  --fog: #f5f6f9;
  --mist: #e8eaef;
  --branco: #ffffff;
  --ink: #0d1117;
  --slate: #4c5568;
  --slate-soft: #7a8296;
  --gold: #938c6b;
  --gold-light: #c9c3ac;
  --gold-dim: #6f6950;
  --gold-soft: #f3f1ea;
  --erro: #c2362b;
  --zap: #1fa855;
  --f-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --f-display: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--fog); }
body { margin: 0; min-height: 100dvh; background: var(--fog); color: var(--slate); font: 400 16px/1.5 var(--f-sans); -webkit-font-smoothing: antialiased; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
svg { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
a { color: inherit; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.sr { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sem-js { padding: 24px; text-align: center; }

/* ---------- topo */
.app { min-height: 100dvh; display: flex; flex-direction: column; }
.topo { position: sticky; top: 0; z-index: 5; display: grid; gap: 12px; padding: calc(14px + env(safe-area-inset-top)) 18px 14px; background: linear-gradient(180deg, var(--navy-950), var(--navy-900)); color: var(--mist); box-shadow: 0 10px 30px -20px rgba(5, 10, 20, 0.8); }
.logo { display: flex; align-items: center; }
.logo img { display: block; width: auto; height: 38px; }
.prog { display: flex; align-items: center; gap: 10px; }
.prog[hidden] { display: none; }
.barra { flex: 1; height: 4px; border-radius: 999px; background: var(--navy-line); overflow: hidden; }
.barra i { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--gold-dim), var(--gold), var(--gold-light)); transition: width 0.45s ease; }
.pct { min-width: 3ch; font-size: 0.78rem; font-weight: 600; color: var(--gold-light); font-variant-numeric: tabular-nums; text-align: right; }

/* ---------- conversa */
.folha { flex: 1; }
.conversa { width: 100%; max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; padding: 24px 16px calc(36px + env(safe-area-inset-bottom)); }
.atual { display: flex; flex-direction: column; gap: 14px; }
.grupo { display: flex; align-items: flex-end; gap: 10px; }
.grupo.voce { justify-content: flex-end; }
.avatar { flex: none; width: 36px; height: 36px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 2px var(--fog), 0 0 0 3px var(--gold); }
.baloes { min-width: 0; flex: 1; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.balao { margin: 0; max-width: 100%; padding: 12px 16px; border-radius: 18px; font-size: 1rem; line-height: 1.5; color: var(--ink); overflow-wrap: anywhere; }
.escritorio .balao { background: var(--branco); border: 1px solid var(--mist); border-bottom-left-radius: 6px; box-shadow: 0 1px 2px rgba(13, 17, 23, 0.04); }
.voce .balao { max-width: 85%; background: var(--navy-800); color: var(--branco); font-weight: 600; border-bottom-right-radius: 6px; animation: entrar 0.25s ease both; }
.balao[data-revelar], .cartao-final[data-revelar] { display: none; }
.resposta[data-revelar] { opacity: 0; pointer-events: none; }
.grupo.nova:not(:has(.balao:not([data-revelar]))) .avatar { visibility: hidden; }
.nova .balao:not([data-revelar]), .resposta:not([data-revelar]), .cartao-final:not([data-revelar]) { animation: entrar 0.3s ease both; }
.digitando { display: inline-flex; gap: 5px; padding: 15px 16px; }
.digitando i { width: 7px; height: 7px; border-radius: 50%; background: var(--slate-soft); animation: pulo 1s ease-in-out infinite; }
.digitando i:nth-child(2) { animation-delay: 0.15s; }
.digitando i:nth-child(3) { animation-delay: 0.3s; }
@keyframes pulo { 0%, 60%, 100% { opacity: 0.35; transform: none; } 30% { opacity: 1; transform: translateY(-3px); } }
@keyframes entrar { from { opacity: 0.001; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.resposta { padding-left: 46px; }

/* ---------- opções */
.opcoes { display: grid; gap: 8px; }
.opcao { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 54px; padding: 13px 16px; text-align: left; border-radius: 14px; border: 1px solid var(--mist); background: var(--branco); font-size: 0.97rem; font-weight: 600; line-height: 1.3; color: var(--ink); box-shadow: 0 1px 2px rgba(13, 17, 23, 0.04); transition: border-color 0.15s ease, background 0.15s ease; }
.opcao svg { width: 18px; height: 18px; color: var(--slate-soft); transition: color 0.15s ease, transform 0.15s ease; }
@media (hover: hover) {
  .opcao:hover { border-color: var(--gold); }
  .opcao:hover svg { color: var(--gold-dim); transform: translateX(2px); }
}
.opcao[aria-checked="true"] { border-color: var(--gold); background: var(--gold-soft); }
.opcao[aria-checked="true"] svg { color: var(--gold-dim); }

/* ---------- caixa "Escolha uma das opções" + janela com a lista */
.selecionar { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 60px; padding: 0 16px; border-radius: 14px; border: 1px solid #d5d8e0; background: var(--branco); color: var(--slate-soft); font-size: 1.02rem; font-weight: 500; text-align: left; box-shadow: 0 1px 2px rgba(13, 17, 23, 0.04); transition: border-color 0.15s ease, box-shadow 0.15s ease; }
.selecionar svg { color: var(--gold-dim); }
.tentar { justify-content: center; color: var(--ink); font-weight: 600; }
.selecionar:hover, .selecionar:focus-visible { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(147, 140, 107, 0.25); outline: none; }
.janela { width: min(100% - 24px, 520px); max-height: min(85dvh, 640px); margin: auto auto 12px; padding: 0; border: 0; border-radius: 22px; background: var(--fog); color: var(--ink); box-shadow: 0 30px 80px -20px rgba(5, 10, 20, 0.55); overflow: auto; }
.janela[open] { animation: subir 0.28s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.janela::backdrop { background: rgba(5, 10, 20, 0.55); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
@keyframes subir { from { opacity: 0; transform: translateY(40px); } to { opacity: 1; transform: none; } }
.janela-topo { position: sticky; top: 0; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 18px 12px; background: var(--fog); }
.janela-topo p { margin: 0; font: 700 1.05rem/1.35 var(--f-display); color: var(--navy-800); }
.fechar { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border: 1px solid var(--mist); border-radius: 50%; background: var(--branco); color: var(--slate); }
.janela .opcoes { padding: 0 14px 16px; grid-template-columns: 1fr !important; }
.janela .opcao { justify-content: flex-start; }
.janela .marca { flex: none; width: 22px; height: 22px; border-radius: 50%; border: 2px solid #c9ccd4; transition: border-color 0.15s ease, box-shadow 0.15s ease; }
.janela .opcao[aria-checked="true"] .marca { border-color: var(--gold); box-shadow: inset 0 0 0 5px var(--gold); }
@media (min-width: 900px) { .janela { margin: auto; } }

/* ---------- campos */
form { margin: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.rotulo { margin: 0; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--slate-soft); }
.campo { display: grid; gap: 8px; }
.caixa { display: flex; align-items: center; gap: 10px; min-height: 60px; padding: 0 8px 0 16px; border-radius: 14px; border: 1px solid #d5d8e0; background: var(--branco); cursor: text; transition: border-color 0.15s ease, box-shadow 0.15s ease; }
.caixa:focus-within { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(147, 140, 107, 0.25); }
.caixa .ddi { padding-right: 10px; border-right: 1px solid var(--mist); font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.caixa input { flex: 1; width: 100%; min-width: 0; height: 56px; padding: 0; border: 0; background: transparent; outline: none; font-size: 1.05rem; font-weight: 600; color: var(--ink); -webkit-appearance: none; appearance: none; }
.caixa input::placeholder { color: #a3a9b6; font-weight: 500; }
.enviar { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 12px; background: linear-gradient(180deg, var(--gold), var(--gold-dim)); color: var(--branco); transition: transform 0.1s ease, filter 0.15s ease; }
.enviar:hover { filter: brightness(1.06); }
.enviar:active { transform: scale(0.94); }
.enviar svg { stroke-width: 2.4; }
.com-erro .caixa { border-color: var(--erro); box-shadow: 0 0 0 3px rgba(194, 54, 43, 0.12); }
.msg { margin: 0; padding-left: 4px; font-size: 0.84rem; color: var(--erro); font-weight: 600; }
.msg:empty { display: none; }
.nota { margin: 0; display: flex; align-items: flex-start; gap: 6px; font-size: 0.78rem; line-height: 1.45; color: var(--slate-soft); }
.nota svg { width: 14px; height: 14px; margin-top: 2px; }

/* ---------- final */
.cartao-final { width: 100%; display: grid; gap: 8px; margin-top: 4px; }
.primario { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 56px; padding: 14px 22px; border-radius: 14px; background: linear-gradient(180deg, var(--gold), var(--gold-dim)); color: var(--branco); font-weight: 700; font-size: 1rem; text-decoration: none; box-shadow: 0 14px 30px -16px rgba(111, 105, 80, 0.9); }
.primario:hover { filter: brightness(1.06); }
.contagem { margin: 0; text-align: center; font-size: 0.82rem; color: var(--slate-soft); }
.contagem:empty { display: none; }

/* ---------- desktop: a conversa em tela cheia */
@media (min-width: 900px) {
  .topo { grid-template-columns: 1fr minmax(0, 520px) 1fr; align-items: center; gap: 24px; padding: 16px clamp(24px, 4vw, 56px); }
  .prog { grid-column: 2; }
  .conversa { max-width: 820px; gap: 16px; padding: 48px 32px 72px; }
  .avatar { width: 40px; height: 40px; }
  .resposta { padding-left: 50px; }
  .balao { font-size: 1.05rem; padding: 14px 18px; }
  .voce .balao { max-width: 70%; }
  .opcoes { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .opcao { min-height: 60px; }
  .cartao-final { max-width: 460px; }
}
@media (max-width: 374px) {
  .conversa { padding-inline: 12px; }
  .resposta { padding-left: 0; }
}

/* ---------- política de privacidade */
.doc { max-width: 720px; margin: 0 auto; padding: 32px 20px 64px; color: var(--slate); }
.doc h1 { font: 700 1.8rem/1.2 var(--f-display); color: var(--ink); }
.doc h2 { font: 700 1.1rem/1.3 var(--f-sans); color: var(--ink); margin-top: 28px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
