/* ===================================================================
   CoreGuard Sign — complementos ao design system herdado do protótipo
   do BackOffice (style.css). Carregar DEPOIS do style.css.
   =================================================================== */

/* Acento do Sign: índigo (o mesmo do sistema real, web/app/sign.css). Símbolo da suíte por enquanto (D-6). */
:root {
  --cor-escudo: #4338CA; --cor-escudo-escura: #3730A3;
  --azul-coreguard: #4338CA; --azul-coreguard-escuro: #3730A3; --azul-coreguard-claro: #6366F1; --azul-coreguard-palido: rgba(67, 56, 202, 0.08);
}
body.tema-escuro { --azul-coreguard: #818CF8; --azul-coreguard-escuro: #6366F1; --azul-coreguard-claro: #A5B4FC; --azul-coreguard-palido: rgba(129, 140, 248, 0.14); }

/* Login no padrão da suíte */
.login-fundo { background: linear-gradient(160deg, #0B1B2E 0%, #101828 55%, #1E1B4B 100%); }
.login-fundo::before, .login-fundo::after { display: none; }
.login-card { background: #1D2939; backdrop-filter: none; border: 1px solid rgba(255,255,255,.08); box-shadow: 0 20px 60px rgba(0,0,0,.4); }
.login-marca img { border-radius: 0; }
.login-card .form-campo::placeholder { color: transparent; }
.login-card .form-campo:focus, .login-card .form-campo:focus-visible { background: rgba(255,255,255,.06); border-color: #818CF8; box-shadow: none; outline: none; }
.login-card .botao-primario { background: linear-gradient(135deg, var(--cor-escudo-escura) 0%, #6366F1 100%); box-shadow: none; }
.login-card .botao-primario:hover { background: linear-gradient(135deg, var(--cor-escudo-escura) 0%, #6366F1 100%); filter: brightness(1.08); }
.login-card a { color: #A5B4FC; }
.login-erro { display: none; text-align: center; font-size: 12px; font-weight: 600; color: #F87171; margin: -8px 0 14px; }
.otp-input { width: 44px; height: 52px; text-align: center; font-size: 20px; font-weight: 800; padding: 0; }
.login-links { text-align: center; font-size: 12px; margin-top: 14px; }

/* Tabelas */
.tabela.compacta td { padding: 8px 12px; font-size: 12.5px; }
.tabela.compacta th { padding: 8px 12px; }
.tabela tr.sem-clique { cursor: default; }
.tabela td.acoes { white-space: nowrap; text-align: right; }
.tabela td.acoes button { background: none; border: 0; cursor: pointer; font-size: 14px; padding: 3px 5px; border-radius: 6px; }
.tabela td.acoes button:hover { background: var(--fundo-input); }
.tabela td.acoes button:disabled { opacity: .3; cursor: default; }
.tabela tr.sit-final td { color: var(--texto-terciario); }
.hash { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 11px; color: var(--texto-secundario); word-break: break-all; }
.hash.curto { white-space: nowrap; }
.tag { display: inline-block; font-size: 10.5px; font-weight: 700; color: var(--texto-secundario); background: var(--fundo-input); border-radius: 6px; padding: 1px 6px; margin-right: 3px; letter-spacing: .2px; }
.nivel2 { color: var(--roxo-forte); background: var(--roxo-palido); }

/* Filtros e barras */
.filtros-linha { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; padding: 14px 18px; border-bottom: var(--borda-sutil); }
.filtros-linha .form-grupo { margin: 0; }
.filtros-linha .form-campo { min-height: 34px; padding: 6px 10px; font-size: 12px; border-radius: 8px; }
.barra-acoes { display: flex; gap: 8px; flex-wrap: wrap; padding: 12px 18px; border-top: var(--borda-sutil); align-items: center; }
.barra-acoes .direita { margin-left: auto; display: flex; gap: 8px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; padding: 12px 18px; border-bottom: var(--borda-sutil); }

/* Blocos */
.modal .lkv { grid-template-columns: 180px 1fr; }
.secao-modal { border: var(--borda-sutil); border-radius: 10px; padding: 12px 14px; margin-bottom: 12px; }
.secao-modal-titulo { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--texto-terciario); margin-bottom: 10px; }
.radio-linha { display: flex; gap: 18px; font-size: 13px; flex-wrap: wrap; }
.radio-linha label, .check-linha { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-size: 13px; }
.radio-linha input, .check-linha input { accent-color: var(--azul-coreguard); }
.detalhe-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 1100px) { .detalhe-grid { grid-template-columns: 1fr; } }
.integ-card { display: flex; gap: 14px; align-items: flex-start; }
.integ-icone { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 20px; background: var(--fundo-secao); flex-shrink: 0; }
.passos { display: flex; gap: 6px; flex-wrap: wrap; }
.passo { font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--fundo-input); color: var(--texto-terciario); }
.passo.feito { background: var(--verde-palido); color: var(--verde-forte); }
.passo.atual { background: var(--azul-coreguard-palido); color: var(--azul-coreguard); }
.passo.ruim { background: var(--vermelho-palido); color: var(--vermelho-forte); }
.funil-linha { display: grid; grid-template-columns: 170px 1fr 40px; gap: 10px; align-items: center; font-size: 12px; margin-bottom: 8px; }
.funil-barra { height: 10px; border-radius: 6px; background: var(--fundo-input); overflow: hidden; }
.funil-barra i { display: block; height: 100%; background: var(--azul-coreguard); border-radius: 6px; }

/* Folha do documento (pré-visualização e posição das assinaturas) */
.folha-area { background: var(--fundo-secao); border-radius: 12px; padding: 16px; display: flex; justify-content: center; }
.folha { position: relative; width: 100%; max-width: 520px; aspect-ratio: 595 / 842; background: #fff; color: #1A202C; box-shadow: 0 2px 14px rgba(0,0,0,.14); border-radius: 3px; overflow: hidden; }
.folha-texto { position: absolute; inset: 0; padding: 7% 8%; font-size: 9px; line-height: 1.5; overflow: hidden; white-space: pre-wrap; color: #2D3748; }
.folha-texto b { font-size: 11px; display: block; margin-bottom: 6px; }
.folha.marcando { cursor: crosshair; }
.campo-ass { position: absolute; width: 36%; height: 7.5%; border: 1.5px dashed #4338CA; background: rgba(67,56,202,.09); border-radius: 4px; font-size: 9px; font-weight: 700; color: #3730A3; display: flex; align-items: center; justify-content: center; text-align: center; padding: 2px; cursor: grab; user-select: none; }
.campo-ass.sel { border-style: solid; background: rgba(67,56,202,.2); }
.campo-ass.feito { border: 0; background: none; cursor: default; flex-direction: column; justify-content: flex-end; color: #1A202C; font-weight: 600; font-size: 7.5px; }
.campo-ass svg { width: 100%; height: 78%; }
.rubrica polyline { fill: none; stroke: #1E1B6B; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.folha-papel { white-space: pre-wrap; background: #fff; color: #1A202C; border: 1px solid #E5E8ED; border-radius: 6px; padding: 22px 26px; font-size: 13px; line-height: 1.65; max-height: 420px; overflow: auto; }
.linha-sig { display: grid; grid-template-columns: 26px 1.5fr 1fr 1fr 1.3fr 1fr 1fr 30px; gap: 8px; align-items: center; margin-bottom: 8px; }
.linha-sig .form-campo { min-height: 34px; padding: 6px 9px; font-size: 12px; border-radius: 8px; }
.linha-sig .ordem { font-weight: 800; color: var(--azul-coreguard); text-align: center; }
@media (max-width: 1100px) { .linha-sig { grid-template-columns: 26px 1fr 1fr; } }
.demo-faixa { background: #FEF3C7; color: #92400E; font-size: 12px; font-weight: 600; text-align: center; padding: 6px 12px; }
body.tema-escuro .demo-faixa { background: #3B2F0B; color: #FCD34D; }
body.tema-escuro .badge.cinza { background: #202A36; color: #B6C0CC; }
body.tema-escuro .chip:hover { background: #2A3441; }

/* ===== Páginas públicas (signatário e verificador): pensadas para o celular ===== */
.pub-fundo { min-height: 100vh; background: #F4F6F9; display: flex; flex-direction: column; align-items: center; }
.pub-topo { width: 100%; background: #101828; color: #fff; display: flex; align-items: center; gap: 10px; padding: 12px 18px; }
.pub-topo img { width: 30px; height: 30px; object-fit: contain; }
.pub-topo .marca { font-family: 'Krona One', sans-serif; font-size: 12px; letter-spacing: 1px; }
.pub-topo .marca small { display: block; font-family: inherit; font-size: 9px; color: #A5B4FC; letter-spacing: 2px; margin-top: 1px; }
.pub-topo .inst { margin-left: auto; font-size: 12px; color: #B8C2D0; text-align: right; }
.pub-corpo { width: 100%; max-width: 560px; padding: 18px 16px 40px; }
.pub-card { background: #fff; border: 1px solid #E5E8ED; border-radius: 16px; padding: 20px; margin-bottom: 14px; }
.pub-titulo { font-size: 18px; font-weight: 800; color: #1A202C; margin-bottom: 4px; }
.pub-sub { font-size: 13px; color: #5A6577; line-height: 1.55; margin-bottom: 16px; }
.pub-etapas { display: flex; gap: 4px; margin-bottom: 16px; }
.pub-etapas i { flex: 1; height: 4px; border-radius: 4px; background: #E5E8ED; }
.pub-etapas i.feita { background: #4338CA; }
.pub-card .botao { width: 100%; justify-content: center; min-height: 46px; font-size: 14px; }
.pub-card .botao + .botao { margin-top: 10px; }
.pub-card .form-campo { min-height: 46px; font-size: 16px; }
.pub-demo { background: #EEF2FF; border: 1px dashed #818CF8; color: #3730A3; border-radius: 10px; padding: 10px 12px; font-size: 12.5px; line-height: 1.5; margin-bottom: 14px; }
.pub-demo b { font-size: 15px; letter-spacing: 2px; }
.pub-erro { color: #B91C1C; font-size: 13px; font-weight: 600; margin: -6px 0 12px; }
.pub-doc { white-space: pre-wrap; background: #FAFBFC; border: 1px solid #E5E8ED; border-radius: 10px; padding: 16px; font-size: 13px; line-height: 1.6; max-height: 320px; overflow: auto; margin-bottom: 14px; color: #1A202C; }
.pub-quadro { width: 100%; height: 170px; border: 2px dashed #A5B4FC; border-radius: 12px; background: #fff; touch-action: none; display: block; }
.pub-rodape { font-size: 11px; color: #8896AA; text-align: center; line-height: 1.6; padding: 0 12px 30px; max-width: 560px; }
.pub-ok { width: 64px; height: 64px; border-radius: 50%; background: #DCFCE7; color: #15803D; font-size: 30px; display: flex; align-items: center; justify-content: center; margin: 4px auto 14px; }
.pub-ok.ruim { background: #FEE2E2; color: #B91C1C; }
.pub-ok.neutro { background: #EEF2FF; color: #3730A3; }
.pub-lkv { display: grid; grid-template-columns: 130px 1fr; gap: 6px 10px; font-size: 13px; margin: 0; }
.pub-lkv dt { color: #8896AA; } .pub-lkv dd { margin: 0; color: #1A202C; font-weight: 600; word-break: break-word; }
.pub-video { width: 100%; border-radius: 12px; background: #101828; aspect-ratio: 4 / 3; object-fit: cover; margin-bottom: 12px; display: block; }
.pub-solta { border: 2px dashed #A5B4FC; border-radius: 14px; padding: 30px 16px; text-align: center; color: #3730A3; font-weight: 600; cursor: pointer; background: #F8F9FF; margin-bottom: 12px; }
.pub-solta.sobre { background: #EEF2FF; }

@media print { .barra-acoes, .filtros-linha, .modal-fundo, #toast-container { display: none !important; } .conteudo { overflow: visible; } }
