/* ═══════════════════════════════════════════════════════════
   RAVVO — Avaliação Física 2.0 · formulário profissional (A4) — 2026-10-12
   Mesmo visual do painel (v30): cartões, cantos de 14px, roxo do tema.
   PC: seções à esquerda + resumo fixo à direita · tablet: resumo some
   (o resultado fica na seção 5) · celular: tela cheia, rodapé fixo.
   Só variáveis do tema (escuro padrão; claro via html[data-theme=light]).
   ═══════════════════════════════════════════════════════════ */
body.avf-aberto { overflow: hidden; }
body.avf-aberto .toast-container { z-index: 10002; }   /* avisos continuam visíveis sobre o formulário */
/* v8-mobile-hotfix força `label { display:block !important }` no celular — aqui os rótulos são flex */
.avf .avf-campo:not([hidden]) { display: flex !important; flex-direction: column; width: auto !important; }
.avf label.avf-met:not([hidden]) { display: flex !important; flex-direction: column; width: auto !important; }
.avf label.avf-check:not([hidden]) { display: flex !important; flex-direction: row; width: auto !important; }
.avf-overlay { position: fixed; inset: 0; z-index: 10001;   /* acima do botão de menu do celular (9999, v8-mobile-hotfix) */ background: rgba(8, 8, 12, .62); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center; padding: 20px; }
.avf { width: min(1080px, 100%); height: min(92vh, 980px); display: flex; flex-direction: column; overflow: hidden;
  background: var(--bg-modal, var(--bg-card, #16161d)); border: 1px solid var(--border, #24242c); border-radius: 16px;
  box-shadow: var(--shadow-modal, 0 24px 60px rgba(0,0,0,.45)); color: var(--text-primary, #f4f4f7); }
.avf svg { width: 18px; height: 18px; flex-shrink: 0; }

.avf-cab { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 22px 12px; }
.avf-cab h2 { margin: 0; font-size: 1.25rem; font-weight: 800; text-transform: none; letter-spacing: -.01em; font-family: inherit; }
.avf-cab p { margin: 4px 0 0; font-size: .85rem; color: var(--text-muted, #8a8a96); }
.avf-x { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--border, #2a2a33); background: var(--bg-input, #14141a);
  color: var(--text-secondary, #b4b4bf); cursor: pointer; display: grid; place-items: center; flex-shrink: 0; }
.avf-x:hover { color: var(--text-primary, #f4f4f7); border-color: var(--accent, #8B3FE8); }

.avf-nav { display: flex; gap: 6px; padding: 0 22px 12px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--border, #24242c); }
.avf-nav::-webkit-scrollbar { display: none; }
.avf-nav button { flex-shrink: 0; display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--border, #2a2a33); background: var(--bg-input, #14141a);
  color: var(--text-secondary, #b4b4bf); border-radius: 999px; padding: 6px 12px 6px 6px; font-size: .8rem; font-weight: 600; cursor: pointer; }
.avf-nav button b { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: .7rem;
  background: var(--accent-dim, rgba(139,63,232,.16)); color: var(--accent, #8B3FE8); }
.avf-nav button.on { border-color: var(--accent, #8B3FE8); color: var(--text-primary, #f4f4f7); }
.avf-nav button.on b { background: var(--accent-grad, var(--accent, #8B3FE8)); color: #fff; }
.avf-nav button[hidden] { display: none; }

.avf-corpo { flex: 1; min-height: 0; overflow-y: auto; display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 18px; padding: 16px 22px 24px;
  align-items: start; overscroll-behavior: contain; }
.avf-secoes { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.avf-sec { background: var(--bg-card, #16161d); border: 1px solid var(--border, #24242c); border-radius: 14px; padding: 16px 18px; scroll-margin-top: 8px; min-width: 0; }
.avf-sec[hidden], .avf-bloco[hidden], .avf-campo[hidden] { display: none !important; }
.avf-sec h3 { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; font-size: 1rem; font-weight: 700; text-transform: none; letter-spacing: 0; font-family: inherit; }
.avf-sec h3 b { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; font-size: .78rem;
  background: var(--accent-grad, var(--accent, #8B3FE8)); color: #fff; flex-shrink: 0; }
.avf-sec h3 small, .avf-campo small { font-weight: 500; color: var(--text-muted, #8a8a96); font-size: .76rem; }
.avf-sec h4 { margin: 4px 0 8px; font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted, #8a8a96); }

.avf-grade { display: grid; gap: 12px; }
.avf-grade.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.avf-grade.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.avf-grade + .avf-grade, .avf-grade + h4 { margin-top: 12px; }
.avf-span2 { grid-column: span 2; }
.avf-campo { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.avf-campo > span { font-size: .8rem; font-weight: 600; color: var(--text-secondary, #b4b4bf); }
.avf-campo input, .avf-campo select, .avf-campo textarea {
  width: 100%; min-height: 42px; box-sizing: border-box; background: var(--bg-input, #14141a); color: var(--text-primary, #f4f4f7);
  border: 1px solid var(--border, #2a2a33); border-radius: 10px; padding: 9px 12px; font-size: .95rem; font-family: inherit; }
.avf-campo textarea { resize: vertical; min-height: 92px; }
.avf-campo input:focus, .avf-campo select:focus, .avf-campo textarea:focus { outline: none; border-color: var(--accent, #8B3FE8); box-shadow: 0 0 0 3px var(--accent-dim, rgba(139,63,232,.18)); }
.avf-campo output { min-height: 42px; display: flex; align-items: center; gap: 6px; padding: 0 12px; border-radius: 10px;
  background: var(--accent-dim, rgba(139,63,232,.1)); font-weight: 700; font-size: .95rem; }
.avf-calc output { color: var(--accent, #8B3FE8); }
.avf-check { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: .88rem; color: var(--text-secondary, #b4b4bf); align-self: end; min-height: 42px; }
.avf-check input { width: 18px; height: 18px; accent-color: var(--accent, #8B3FE8); }
.avf-dica, .avf-nota { margin: 10px 0 0; font-size: .78rem; color: var(--text-muted, #8a8a96); }
.avf-nota b { color: var(--text-secondary, #b4b4bf); }
.avf-aluno { display: flex; gap: 8px; align-items: flex-start; margin: 12px 0 0; font-size: .8rem; color: var(--text-muted, #8a8a96); }
.avf-aluno svg { color: var(--accent, #8B3FE8); width: 16px; height: 16px; margin-top: 1px; }
.avf-aluno b { color: var(--text-secondary, #b4b4bf); }

/* método */
.avf-metodos { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.avf-met { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 12px 12px 12px 38px; border-radius: 12px; cursor: pointer;
  border: 1px solid var(--border, #2a2a33); background: var(--bg-input, #14141a); min-width: 0; }
.avf-met input { position: absolute; left: 12px; top: 13px; width: 17px; height: 17px; accent-color: var(--accent, #8B3FE8); margin: 0; }
.avf-met b { font-size: .88rem; }
.avf-met small { font-size: .74rem; color: var(--text-muted, #8a8a96); line-height: 1.35; }
.avf-met:has(input:checked) { border-color: var(--accent, #8B3FE8); background: var(--accent-dim, rgba(139,63,232,.12)); }
.avf-met:has(input:focus-visible) { box-shadow: 0 0 0 3px var(--accent-dim, rgba(139,63,232,.25)); }
.avf-bloco { margin-top: 14px; }

.avf-ref { display: flex; gap: 8px; align-items: flex-start; margin: 12px 0 0; font-size: .8rem; color: var(--text-secondary, #b4b4bf); }
.avf-ref svg { color: var(--success, #22C55E); width: 16px; height: 16px; margin-top: 1px; }
.avf-prots { margin-top: 12px; font-size: .82rem; }
.avf-prots summary, .avf-outras summary { cursor: pointer; color: var(--accent, #8B3FE8); font-weight: 600; font-size: .82rem; }
.avf-prots ul { list-style: none; padding: 0; margin: 10px 0 0; display: flex; flex-direction: column; gap: 8px; }
.avf-prots li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; padding: 8px 10px; border-radius: 10px; background: var(--bg-input, #14141a); }
.avf-prots li small { flex-basis: 100%; color: var(--text-muted, #8a8a96); font-size: .76rem; }
.avf-chip { display: inline-block; font-size: .68rem; font-weight: 700; padding: 2px 8px; border-radius: 999px;
  background: var(--bg-input, #14141a); color: var(--text-muted, #8a8a96); border: 1px solid var(--border, #2a2a33); }
.avf-chip.ok { color: var(--success, #22C55E); border-color: transparent; background: rgba(34,197,94,.12); }
.avf-chip.alerta { color: var(--warning, #F5A524); border-color: transparent; background: rgba(245,165,36,.14); }

/* dobras */
.avf-dobra.obrig input { border-color: color-mix(in srgb, var(--accent, #8B3FE8) 55%, var(--border, #2a2a33)); }
.avf-dobra.falta input { border-color: var(--warning, #F5A524); }
.avf-req { font-style: normal; font-size: .66rem; font-weight: 700; color: var(--accent, #8B3FE8); background: var(--accent-dim, rgba(139,63,232,.14));
  padding: 1px 6px; border-radius: 6px; margin-left: 4px; }
.avf-ponto { font-size: .72rem !important; line-height: 1.35; color: var(--text-muted, #8a8a96); }
.avf-outras { margin-top: 14px; }
.avf-outras .avf-grade { margin-top: 12px; }

/* resultado */
.avf-res { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.avf-res-l { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border-radius: 12px; background: var(--bg-input, #14141a); border: 1px solid var(--border, #24242c); min-width: 0; }
.avf-res-l span { font-size: .78rem; font-weight: 600; color: var(--text-secondary, #b4b4bf); display: flex; flex-direction: column; gap: 2px; }
.avf-res-l span small { font-weight: 500; color: var(--text-muted, #8a8a96); font-size: .7rem; }
.avf-res-l b { font-size: 1.3rem; font-weight: 800; }
.avf-res-l b.sd { font-size: .95rem; color: var(--text-muted, #8a8a96); }
.avf-aviso { display: flex; gap: 10px; align-items: flex-start; padding: 11px 13px; border-radius: 12px; font-size: .82rem; margin: 0 0 12px;
  background: var(--accent-dim, rgba(139,63,232,.1)); color: var(--text-secondary, #b4b4bf); }
.avf-aviso p { margin: 0; }
.avf-aviso b { color: var(--text-primary, #f4f4f7); }
.avf-aviso svg { color: var(--accent, #8B3FE8); margin-top: 1px; }
.avf-aviso.erro { background: rgba(240,85,110,.1); }
.avf-aviso.erro svg { color: var(--danger, #F0556E); }

/* resumo lateral */
.avf-lado { position: sticky; top: 0; }
.avf-lado-card { background: var(--bg-card, #16161d); border: 1px solid var(--border, #24242c); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.avf-lado-card > small { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted, #8a8a96); }
.avf-lado-l { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding-bottom: 8px; border-bottom: 1px dashed var(--border, #2a2a33); }
.avf-lado-l span { font-size: .82rem; color: var(--text-secondary, #b4b4bf); }
.avf-lado-l b { font-size: 1.05rem; font-weight: 800; }
.avf-lado-met { margin: 0; font-size: .78rem; color: var(--text-muted, #8a8a96); }
.avf-lado-met b { color: var(--text-secondary, #b4b4bf); }
.avf-lado-met.alerta { color: var(--warning, #F5A524); }

.avf-erro { display: flex; gap: 8px; align-items: flex-start; margin: 0 22px 10px; padding: 10px 12px; border-radius: 10px; font-size: .84rem;
  background: rgba(240,85,110,.12); color: var(--danger, #F0556E); }
.avf-erro[hidden] { display: none; }
.avf-rodape { display: flex; align-items: center; gap: 10px; padding: 12px 22px; border-top: 1px solid var(--border, #24242c); background: var(--bg-modal, var(--bg-card, #16161d)); }
.avf-espaco { flex: 1; }
.avf-rodape .avp-btn { padding: 10px 18px; font-size: .88rem; }

/* tablet */
@media (max-width: 900px) {
  .avf-corpo { grid-template-columns: minmax(0, 1fr); }
  .avf-lado { display: none; }
  .avf-metodos { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* celular: tela cheia, rodapé fixo, 1–2 colunas */
@media (max-width: 600px) {
  .avf-overlay { padding: 0; align-items: stretch; }
  .avf { height: 100%; height: 100dvh; border-radius: 0; border: none; }
  .avf-cab { padding: 14px 16px 10px; }
  .avf-nav { padding: 0 16px 10px; }
  .avf-corpo { padding: 12px 12px 20px; gap: 12px; }
  .avf-sec { padding: 14px; }
  .avf-grade.g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .avf-grade.g2 { grid-template-columns: minmax(0, 1fr); }
  .avf-span2 { grid-column: 1 / -1; }
  .avf-metodos { grid-template-columns: minmax(0, 1fr); }
  .avf-res { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .avf-rodape { padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); flex-wrap: wrap; }
  .avf-rodape .avp-btn { flex: 1; justify-content: center; padding: 11px 10px; }
  .avf-rodape .avp-btn[data-acao="fechar"] { flex: 0 0 auto; }
  .avf-espaco { display: none; }
  .avf-erro { margin: 0 12px 8px; }
}
@media (max-width: 360px) { .avf-res { grid-template-columns: minmax(0, 1fr); } }

/* auditoria 12/10: evidência e avisos de aplicabilidade */
.avf-evid { margin: 6px 0 0 24px; font-size: .74rem; color: var(--text-muted, #8a8a96); line-height: 1.4; }
.avf-evid b { color: var(--text-secondary, #b4b4bf); }
.avf-aviso.alerta { background: rgba(245,165,36,.1); margin-top: 10px; }
.avf-aviso.alerta svg { color: var(--warning, #F5A524); }
.avf-prots li small + small { flex-basis: 100%; }

/* modo experimental (12/10): identificação forte + comparação com referências */
.avf-aviso.exp { background: rgba(245,165,36,.14); border: 1px solid rgba(245,165,36,.5); }
.avf-aviso.exp svg { color: var(--warning, #F5A524); }
.avf-exp-faixa { margin: 0 0 8px; padding: 6px 10px; border-radius: 8px; font-size: .74rem; font-weight: 800; letter-spacing: .06em; text-align: center;
  color: #1a1203; background: repeating-linear-gradient(45deg, #F5A524 0 12px, #f7b94a 12px 24px); }
.avf-chip.exp { color: #1a1203; background: #F5A524; border-color: transparent; }
.avf-comp { margin-top: 12px; font-size: .82rem; }
.avf-comp summary { cursor: pointer; color: var(--accent, #8B3FE8); font-weight: 700; }
.avf-comp summary small { color: var(--text-muted, #8a8a96); font-weight: 500; }
.avf-comp-t { width: 100%; border-collapse: collapse; margin-top: 8px; }
.avf-comp-t th, .avf-comp-t td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--border, #24242c); }
.avf-comp-t th { font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted, #8a8a96); }
.avf-comp-t tr.sel td { background: var(--accent-dim, rgba(139,63,232,.1)); font-weight: 700; }
.avf-check input:disabled + span { opacity: .5; text-decoration: line-through; }
.avf-lado-card.exp { border-color: #F5A524; }
.avf-exp-tag { font-style: normal; font-size: .64rem; font-weight: 800; padding: 1px 6px; border-radius: 6px; background: #F5A524; color: #1a1203; }
