/* estrutura.css — a camada GLOBAL de estrutura da organizARCH (15/10/2026).
   Vale para TODA tela, sem mexer na marcação de cada módulo: tabelas, campos, foco, caixa alta, cartões.
   Cada regra tem origem no manual: docs/Manual_completo_do_Sistema_de_Design_organizARCH.md (letras A, D, F, G, L).
   Só na tela (@media screen): impressão e PDF têm escala própria e ficam de fora. */
@media screen {

  /* ---- D. Tipografia: caixa alta só em rótulo curto de grupo (marcado com .oa-rotulo); nunca em tabela nem em lista ---- */
  html body .uppercase:not(.oa-rotulo),
  html body table th,
  html body [class*="tracking-wider"]:not(.oa-rotulo) {
    text-transform: none !important;
    letter-spacing: 0 !important;
  }
  html body .oa-rotulo { text-transform: uppercase; letter-spacing: .06em; font-size: 14px; font-weight: 600; }

  /* ---- A e G. Tabela: cabeçalho legível, números à direita e em algarismos tabulares, linha de 48 px ---- */
  html body table { font-variant-numeric: tabular-nums; }
  html body table th {
    font-size: 14px; font-weight: 600; line-height: 1.25;
    color: var(--texto-suave, #55645e);
    vertical-align: bottom;
  }
  html body table td { vertical-align: middle; }
  html body table td.oa-num, html body table th.oa-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

  /* ---- G. Campo: altura 44, canto 12, borda forte o bastante, texto 15 (só fora de tabela, para não engordar linhas) ---- */
  html body :is(input:not([type]), input[type="text"], input[type="search"], input[type="email"], input[type="tel"], input[type="number"], input[type="date"], input[type="time"], input[type="password"], input[type="url"], select, textarea):not(table input):not(table select):not(.tf-fino) {
    border-radius: var(--raio-item);
    border-color: var(--areia-forte, #c9d2da);
    font-size: 15px;
  }
  html body :is(input:not([type]), input[type="text"], input[type="search"], input[type="email"], input[type="tel"], input[type="number"], input[type="date"], input[type="time"], input[type="password"], input[type="url"], select):not(table input):not(table select):not(.tf-fino):not([data-no-altura]) {
    min-height: 44px;
  }

  /* ---- L. Foco visível em todo controle (WCAG 2.4.7) ---- */
  html body :is(a, button, input, select, textarea, summary, [tabindex]:not([tabindex="-1"])):focus-visible {
    outline: 2px solid var(--acao, #243f50);
    outline-offset: 2px;
  }

  /* ---- F. Cartões antigos: canto 16, sombra quase invisível (a sombra pesada fica só para janelas) ---- */
  html body .bg-white.rounded-2xl.border { border-radius: var(--raio-cartao); border-color: var(--areia, #dfe5e3); }
  html body .shadow-sm { box-shadow: 0 1px 0 rgba(16, 36, 45, .04); }

  /* ---- G. Título de seção dentro de cartão antigo: tipografia produtiva (a fonte de título fica para a página e o bloco de ênfase) ---- */
  html body h3.font-bold { font-family: var(--fonte-texto, inherit); font-size: 18px; font-weight: 600; letter-spacing: 0; }

  /* ---- E. Nada rola na horizontal por culpa de uma tabela larga: ela rola dentro do próprio contêiner ---- */
  html body .overflow-x-auto { -webkit-overflow-scrolling: touch; }

  /* ---- H. Campos: estados em palavras e forma, não só em cor (Manual, letra G; WCAG 1.4.1 e 3.3.1) ---- */
  html body :is(input, select, textarea)::placeholder { color: var(--texto-mudo, #646f69); opacity: 1; }
  html body :is(input, select, textarea):disabled,
  html body :is(input, select, textarea)[readonly]:not([type="checkbox"]):not([type="radio"]) {
    background: var(--areia-clara, #eef0f1); color: var(--texto-mudo, #646f69); cursor: not-allowed;
  }
  /* erro: borda reforçada + a mensagem (classe .oa-erro-campo) em palavras, logo abaixo do campo */
  html body :is(input, select, textarea)[aria-invalid="true"],
  html body :is(input, select, textarea):user-invalid {
    border-color: var(--sit-problema, #c0453a) !important; box-shadow: 0 0 0 1px var(--sit-problema, #c0453a);
  }
  html body .oa-erro-campo { margin: 4px 0 0; font-size: 14px; font-weight: 600; color: var(--sit-problema-texto, #9b1c14); }
  html body .oa-ajuda-campo { margin: 4px 0 0; font-size: 14px; color: var(--texto-suave, #4f5d57); }
  /* rótulo sempre acima do campo, 14 px / 600; opcional vira palavra, não asterisco */
  html body label.oa-rotulo-campo { display: block; margin: 0 0 4px; font-size: 14px; font-weight: 600; color: var(--tinta, #1f303a); }
  html body label.oa-rotulo-campo .oa-opcional { font-weight: 400; color: var(--texto-mudo, #646f69); }
  /* marcar/escolher: alvo de toque 44 px sem engordar a caixa */
  html body :is(input[type="checkbox"], input[type="radio"]) { accent-color: var(--acao, #243f50); width: 20px; height: 20px; }
}

/* Cronograma em tabela (15/10/2026): as colunas Período, Responsável e Situação ficam NO TOPO da linha, ao lado do título da etapa.
   Centralizar na vertical empurrava esses dados para o meio de uma linha muito alta (ficavam fora da tela). */
@media screen {
  html body #cronograma-tbody > tr > td { vertical-align: top; }
}
