/* Triagem WhatsApp – Diogo Alencar Advocacia */
:root { --tw-cor: #1f2a44; --tw-wa: #1fa855; --tw-texto: #1d1d1f; --tw-suave: #5f6368; --tw-borda: #d9dce1; --tw-fundo: #fff; --tw-dourado: #b8962e; }

html.tw-travado { overflow: hidden; }

/* Fundo escurecido; no computador a janela fica centralizada */
.tw-overlay { position: fixed; inset: 0; z-index: 999999; background: rgba(15, 20, 30, .62); display: flex; align-items: center; justify-content: center; padding: 24px; -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
.tw-overlay[hidden] { display: none; }

/* Janela: topo fixo, conteúdo que rola por dentro e rodapé fixo com os botões */
.tw-caixa { position: relative; width: 100%; max-width: 580px; height: auto; max-height: min(780px, calc(100vh - 48px)); max-height: min(780px, calc(100dvh - 48px)); display: flex; flex-direction: column; overflow: hidden; background: var(--tw-fundo); color: var(--tw-texto); border-radius: 16px; box-shadow: 0 24px 70px rgba(0,0,0,.32); font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; text-align: left; animation: tw-entrar .2s ease-out; }
@keyframes tw-entrar { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }

.tw-topo { position: relative; flex: none; display: flex; align-items: center; gap: 10px; padding: 12px 12px 12px 24px; border-bottom: 1px solid #eef0f2; min-height: 56px; box-sizing: border-box; }
.tw-marca { font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--tw-dourado); }
.tw-fechar { margin-left: auto; width: 36px; height: 36px; border: 0; border-radius: 50%; background: none; font-size: 26px; line-height: 1; color: var(--tw-suave); cursor: pointer; }
.tw-progresso { position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; background: transparent; overflow: hidden; }
.tw-progresso span { display: block; height: 100%; width: 0; background: var(--tw-cor); transition: width .3s ease; }

.tw-corpo { flex: 1 1 auto; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding: 22px 24px 0; display: flex; flex-direction: column; }
.tw-form { display: flex; flex-direction: column; flex: 1 0 auto; }
.tw-caixa h2 { margin: 0 0 6px; font-size: 22px; line-height: 1.25; color: var(--tw-cor); letter-spacing: -.01em; }
.tw-caixa p { margin: 0 0 14px; }
.tw-dica { color: var(--tw-suave); font-size: 14px; margin-top: -2px !important; }

/* Rodapé fixo: sempre visível, com sombra quando há conteúdo por baixo */
.tw-rodape { position: sticky; bottom: 0; margin: auto -24px 0; padding: 12px 24px 16px; padding-bottom: max(16px, env(safe-area-inset-bottom)); background: var(--tw-fundo); border-top: 1px solid #eef0f2; box-shadow: 0 -8px 16px -12px rgba(15, 20, 30, .18); z-index: 1; }
.tw-corpo > :not(.tw-rodape):nth-last-child(2), .tw-form > :not(.tw-rodape):nth-last-child(2) { margin-bottom: 18px; }

/* Abertura: janela estreita, aviso em dois itens curtos */
.tw-caixa.tw-compacta { max-width: 440px; }
.tw-compacta .tw-corpo > p { color: var(--tw-suave); }
.tw-aviso { list-style: none; margin: 0 0 16px; background: #f7f3e8; border-radius: 10px; padding: 12px 14px; font-size: 14.5px; line-height: 1.4; display: grid; gap: 8px; }
.tw-aviso li { position: relative; margin: 0; padding-left: 16px; }
.tw-aviso li::before { content: ""; position: absolute; left: 0; top: .55em; width: 6px; height: 6px; border-radius: 50%; background: var(--tw-dourado); }
.tw-ciente { display: flex; gap: 10px; align-items: center; font-weight: 600; cursor: pointer; margin-bottom: 18px; }
.tw-ciente input { width: 20px; height: 20px; accent-color: var(--tw-cor); flex: none; }

/* Campos: no computador, WhatsApp e profissão ficam lado a lado */
.tw-campos { display: grid; grid-template-columns: 1fr; column-gap: 12px; margin-top: 10px; }
.tw-campo { margin: 0 0 16px; border: 0; padding: 0; min-width: 0; grid-column: 1 / -1; border-radius: 10px; transition: box-shadow .2s; }
.tw-campo > label:not(.tw-opcao), .tw-campo legend { display: block; font-weight: 600; font-size: 15px; margin-bottom: 7px; padding: 0; color: var(--tw-texto); }
.tw-input { width: 100%; box-sizing: border-box; padding: 11px 12px; border: 1px solid var(--tw-borda); border-radius: 10px; font: inherit; font-size: 16px; background: #fff; color: inherit; transition: border-color .15s, box-shadow .15s; }
.tw-input:focus { outline: none; border-color: var(--tw-cor); box-shadow: 0 0 0 3px rgba(31, 42, 68, .12); }
.tw-valor { display: flex; align-items: center; gap: 10px; }
.tw-moeda { font-weight: 600; color: var(--tw-suave); }
.tw-valor .tw-input { flex: 1; min-width: 0; font-variant-numeric: tabular-nums; }
textarea.tw-input { min-height: 110px; resize: vertical; }
.tw-pendente { outline: 2px solid rgba(179, 38, 30, .55); outline-offset: 6px; }
.tw-pendente legend { color: #b3261e !important; }

/* Opções: curtas lado a lado, longas uma por linha */
.tw-grade { display: grid; gap: 8px; grid-template-columns: 1fr; }
.tw-grade.tw-curtas { grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr)); }
.tw-grade.tw-mini { grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); }
.tw-grade.tw-lista { gap: 6px; }
.tw-grade.tw-lista .tw-opcao { min-height: 42px; padding: 8px 12px; }
.tw-op-texto { display: flex; flex-direction: column; }
.tw-op-texto small { font-size: 12.5px; font-weight: 400; color: var(--tw-suave); line-height: 1.25; margin-top: 1px; }
.tw-opcao { display: flex; gap: 10px; align-items: center; padding: 10px 12px; min-height: 44px; box-sizing: border-box; border: 1px solid var(--tw-borda); border-radius: 10px; cursor: pointer; font-size: 15px; line-height: 1.3; background: #fff; transition: border-color .15s, background .15s, box-shadow .15s; -webkit-tap-highlight-color: transparent; }
.tw-opcao:hover { border-color: var(--tw-cor); }
.tw-opcao input { margin: 0; flex: none; width: 18px; height: 18px; accent-color: var(--tw-cor); }
.tw-opcao:has(input:checked) { border-color: var(--tw-cor); background: rgba(31, 42, 68, .06); box-shadow: inset 0 0 0 1px var(--tw-cor); font-weight: 600; }
.tw-opcao:has(input:focus-visible) { box-shadow: 0 0 0 3px rgba(31, 42, 68, .18); }

.tw-erro { color: #b3261e; font-size: 14px; margin: 0 0 8px; }
.tw-erro:empty { display: none; }
.tw-acoes { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.tw-acoes > :only-child { margin-left: auto; }

.tw-botao { display: inline-block; padding: 12px 22px; border: 0; border-radius: 999px; background: var(--tw-cor); color: #fff !important; font-family: inherit; font-size: 15px; font-weight: 600; line-height: 1.2; text-decoration: none !important; cursor: pointer; }
.tw-botao:disabled { opacity: .4; cursor: not-allowed; }
.tw-botao.tw-wa { background: var(--tw-wa); }
.tw-link { background: none; border: 0; padding: 8px 0; color: var(--tw-suave); font: inherit; font-size: 15px; cursor: pointer; }

/* Revisão: pergunta e resposta lado a lado no computador */
.tw-resumo { margin: 4px 0 14px; font-size: 15px; border: 1px solid var(--tw-borda); border-radius: 10px; padding: 4px 14px; display: grid; grid-template-columns: 1fr; }
.tw-resumo dt { font-weight: 600; color: var(--tw-cor); padding-top: 9px; font-size: 13.5px; }
.tw-resumo dd { margin: 0; padding: 2px 0 9px; border-bottom: 1px solid #eef0f2; overflow-wrap: anywhere; }
.tw-resumo dd:last-child { border-bottom: 0; }

@media (min-width: 640px) {
	.tw-campos { grid-template-columns: 1fr 1fr; }
	.tw-meia { grid-column: auto; }
	.tw-grade.tw-lista { grid-template-columns: 1fr 1fr; gap: 8px; }
	.tw-grade.tw-lista .tw-opcao { min-height: 56px; }
	.tw-resumo { grid-template-columns: minmax(150px, 38%) 1fr; column-gap: 16px; }
	.tw-resumo dt { padding: 9px 0; border-bottom: 1px solid #eef0f2; font-size: 14px; }
	.tw-resumo dd { padding: 9px 0; }
	.tw-resumo dt:nth-last-child(2) { border-bottom: 0; }
}

/* Celular: janela flutuante do tamanho do conteúdo (não ocupa a tela toda) */
@media (max-width: 639px) {
	.tw-overlay { padding: 12px; padding-top: max(12px, env(safe-area-inset-top)); padding-bottom: max(12px, env(safe-area-inset-bottom)); }
	.tw-caixa { max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); border-radius: 18px; }
	.tw-topo { padding: 6px 6px 6px 18px; min-height: 48px; }
	.tw-corpo { padding: 16px 18px 0; }
	.tw-rodape { margin: auto -18px 0; padding: 10px 18px 14px; }
	.tw-caixa h2 { font-size: 20px; }
	.tw-campos { margin-top: 6px; }
	.tw-acoes .tw-botao { flex: 1; text-align: center; }
	.tw-acoes .tw-link { flex: none; }
}

/* Instagram */
.tw-ig { background: linear-gradient(135deg, #fdf1f6, #f3effd); border-radius: 10px; padding: 16px; margin: 6px 0 4px; }
.tw-ig-botao, .tw-ig-card .tw-botao { background: linear-gradient(45deg, #f09433, #dc2743 50%, #bc1888); }

.tw-ig-card { display: flex; gap: 16px; align-items: flex-start; padding: 20px; border-radius: 12px; background: linear-gradient(135deg, #fdf1f6, #f3effd); margin: 20px 0; }
.tw-ig-card > svg { flex: none; width: 40px; height: 40px; color: #c13584; }
.tw-ig-card strong { display: block; font-size: 18px; margin-bottom: 4px; }
.tw-ig-card p { margin: 0 0 12px; }

/* Blindagem contra o tema do site: os botões da triagem têm cores próprias,
   independentes da paleta do tema (que costuma estilizar button, a e :hover). */
.tw-overlay .tw-botao,
.tw-overlay .tw-botao:hover,
.tw-overlay .tw-botao:focus,
.tw-overlay .tw-botao:active,
.tw-overlay .tw-botao:visited {
	background: #222b3a !important; color: #fff !important; border: 0 !important; box-shadow: none !important;
	text-shadow: none !important; text-transform: none !important; letter-spacing: normal !important;
	font: 600 15px/1.2 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
	padding: 12px 22px !important; border-radius: 999px !important; opacity: 1; text-decoration: none !important;
	min-height: 0 !important; width: auto !important; height: auto !important;
}
.tw-overlay .tw-botao:hover { filter: brightness(1.15); }
.tw-overlay .tw-botao:disabled { opacity: .4 !important; filter: none; }
.tw-overlay .tw-botao.tw-wa, .tw-overlay .tw-botao.tw-wa:hover, .tw-overlay .tw-botao.tw-wa:focus { background: #1fa855 !important; }
.tw-overlay .tw-botao.tw-ig-botao, .tw-overlay .tw-botao.tw-ig-botao:hover, .tw-overlay .tw-botao.tw-ig-botao:focus { background: linear-gradient(45deg, #f09433, #dc2743 50%, #bc1888) !important; }
.tw-overlay .tw-link, .tw-overlay .tw-link:hover, .tw-overlay .tw-link:focus,
.tw-overlay .tw-fechar, .tw-overlay .tw-fechar:hover, .tw-overlay .tw-fechar:focus {
	background: transparent !important; color: #5f6368 !important; border: 0 !important; box-shadow: none !important;
	text-transform: none !important; letter-spacing: normal !important; min-height: 0 !important; width: auto;
}
.tw-overlay .tw-link { font: 15px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important; padding: 8px 0 !important; }
.tw-overlay .tw-link:hover { color: #1d1d1f !important; text-decoration: underline !important; }
.tw-overlay .tw-fechar { width: 36px !important; height: 36px !important; padding: 0 !important; font-size: 26px !important; line-height: 1 !important; border-radius: 50% !important; }
.tw-overlay .tw-fechar:hover { background: #f1f3f4 !important; color: #1d1d1f !important; }
.tw-overlay .tw-botao:focus-visible, .tw-overlay .tw-link:focus-visible, .tw-overlay .tw-fechar:focus-visible { outline: 2px solid #222b3a !important; outline-offset: 2px; }

/* Celulares baixos (iPhone SE e afins): tudo um pouco mais justo para a lista de assuntos caber sem rolar */
@media (max-width: 639px) and (max-height: 720px) {
	.tw-overlay { padding: 8px; padding-top: max(8px, env(safe-area-inset-top)); padding-bottom: max(8px, env(safe-area-inset-bottom)); }
	.tw-caixa { max-height: calc(100vh - 16px); max-height: calc(100dvh - 16px); }
	.tw-topo { min-height: 44px; padding-top: 4px; padding-bottom: 4px; }
	.tw-corpo { padding-top: 12px; }
	.tw-caixa h2 { font-size: 18px; margin-bottom: 4px; }
	.tw-grade.tw-lista { gap: 4px; }
	.tw-grade.tw-lista .tw-opcao { min-height: 36px; padding: 5px 12px; font-size: 14.5px; }
	.tw-op-texto small { font-size: 12px; }
	.tw-rodape { padding-top: 8px; padding-bottom: 10px; }
	.tw-overlay .tw-botao { padding: 11px 20px !important; }
}
