/* ============================================================
   medtrab.css - CSS compartilhado dos scores de Medicina do Trabalho
   drpetrus.top · carregar após base.css e quests.css
   ============================================================ */

/* ── Questões genéricas ─────────────────────────────────────── */
.mt-section { margin-bottom: 28px; }
.mt-section-title {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .12em; color: var(--ci2); margin-bottom: 12px;
  padding: 6px 10px; background: var(--bg); border-left: 3px solid var(--ci);
  border-radius: 0 4px 4px 0;
}
.mt-section-desc {
  font-size: 11px; color: var(--ci2); margin-bottom: 14px;
  line-height: 1.6; font-style: italic;
}
/* .q-block/.q-item/.q-text/.q-num/.likert/.lbox removidos: agora em score-common.css (AUD-30.4.1) */

.mt-scale-info {
  background: #e4f5fb; border-left: 3px solid var(--ci); border-radius: 6px;
  padding: 11px 15px; margin-bottom: 18px; font-size: 12px;
  color: var(--az); font-weight: 500; line-height: 1.6;
}
.mt-q-item {
  background: #fff; border: 1px solid var(--bd); border-radius: 8px;
  padding: 15px 17px; margin-bottom: 9px; transition: border-color .2s;
}
.mt-q-item:hover { border-color: var(--ci); }
.mt-q-text {
  font-size: 13px; font-weight: 500; color: var(--az);
  margin-bottom: 11px; line-height: 1.5;
}
.mt-q-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 21px; height: 21px; background: var(--az); color: #fff;
  border-radius: 50%; font-size: 9px; font-weight: 700;
  margin-right: 7px; flex-shrink: 0; vertical-align: middle;
}

/* ── Opções binárias (Sim/Não) ─────────────────────────────── */
.mt-binary { display: flex; gap: 8px; }
.mt-binary label { flex: 0 0 72px; cursor: pointer; }
.mt-binary input[type=radio] { display: none; }
.mt-bin-box {
  display: block; padding: 9px 6px; border: 1.5px solid var(--bd);
  border-radius: 6px; text-align: center; font-size: 12px; font-weight: 600;
  color: var(--ci2); background: var(--bg); transition: all .15s;
}
.mt-binary input:checked + .mt-bin-box { background: var(--az); border-color: var(--az); color: #fff; }
.mt-binary label:hover .mt-bin-box { border-color: var(--ci); }

/* ── Opções em escala horizontal ──────────────────────────── */
.mt-opts { display: flex; gap: 5px; }
.mt-opt { flex: 1; min-width: 0; cursor: pointer; }
.mt-opt input[type=radio] { display: none; }
.mt-opt-box {
  display: block; padding: 7px 3px; border: 1.5px solid var(--bd);
  border-radius: 6px; text-align: center; background: var(--bg);
  transition: all .15s; display: flex; flex-direction: column;
  align-items: center; gap: 1px;
}
.mt-opt-num { font-size: 11px; font-weight: 700; color: var(--ci2); }
.mt-opt-word { font-size: 7px; font-weight: 400; color: var(--ci2); line-height: 1.2; }
.mt-opt input:checked + .mt-opt-box { background: var(--az); border-color: var(--az); }
.mt-opt input:checked + .mt-opt-box .mt-opt-num,
.mt-opt input:checked + .mt-opt-box .mt-opt-word { color: #fff; }
.mt-opt label:hover .mt-opt-box { border-color: var(--ci); }

/* ── Opções como lista vertical (ODI) ─────────────────────── */
.mt-opts-list { display: flex; flex-direction: column; gap: 5px; }
.mt-opt-row { cursor: pointer; }
.mt-opt-row input[type=radio] { display: none; }
.mt-opt-row-box {
  display: flex; align-items: flex-start; gap: 10px; padding: 9px 12px;
  border: 1.5px solid var(--bd); border-radius: 6px; background: var(--bg);
  transition: all .15s; font-size: 12px; color: var(--az); line-height: 1.4;
}
.mt-opt-row-score {
  flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%;
  background: var(--bd); color: var(--ci2); font-size: 9px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; margin-top: 1px;
}
.mt-opt-row input:checked + .mt-opt-row-box { background: #e4f5fb; border-color: var(--ci); }
.mt-opt-row input:checked + .mt-opt-row-box .mt-opt-row-score { background: var(--ci); color: #fff; }

/* ── Slider (ICT D1) ──────────────────────────────────────── */
.mt-slider-wrap { padding: 6px 0 4px; }
.mt-slider { width: 100%; accent-color: var(--az); height: 6px; }
.mt-slider-labels { display: flex; justify-content: space-between; font-size: 10px; color: var(--ci2); margin-top: 4px; }
.mt-slider-val { text-align: center; font-size: 22px; font-weight: 900; color: var(--az); margin: 8px 0 4px; }

/* ── Checkboxes (ICT D3) ──────────────────────────────────── */
.mt-checks { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.mt-check-item { cursor: pointer; }
.mt-check-item input[type=checkbox] { display: none; }
.mt-check-box {
  display: flex; align-items: center; gap: 8px; padding: 8px 11px;
  border: 1.5px solid var(--bd); border-radius: 6px; background: var(--bg);
  font-size: 12px; color: var(--az); transition: all .15s;
}
.mt-check-icon {
  width: 16px; height: 16px; border: 2px solid var(--bd); border-radius: 3px;
  flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  transition: all .15s;
}
.mt-check-item input:checked + .mt-check-box { background: #e4f5fb; border-color: var(--ci); }
.mt-check-item input:checked + .mt-check-box .mt-check-icon { background: var(--ci); border-color: var(--ci); color: #fff; }
.mt-check-item input:checked + .mt-check-box .mt-check-icon::after { content: '✓'; font-size: 10px; font-weight: 700; }

/* ── Resultado ────────────────────────────────────────────── */
#result-wrap { display: none; margin-top: 6px; }
.res-head { background: var(--az); color: #fff; border-radius: var(--r) var(--r) 0 0; padding: 18px 22px; }
.res-head h2 { font-size: 15px; font-weight: 900; }
.res-head p { font-size: 11px; opacity: .65; margin-top: 3px; }
.res-body { background: #fff; border: 1px solid var(--bd); border-top: none; border-radius: 0 0 var(--r) var(--r); padding: 22px; }
.mt-score-big { text-align: center; padding: 20px 0 16px; }
.mt-score-num { font-size: 54px; font-weight: 900; color: var(--az); line-height: 1; }
.mt-score-max { font-size: 16px; color: var(--ci2); }
.mt-class-badge {
  display: inline-block; padding: 5px 16px; border-radius: 20px;
  font-size: 11px; font-weight: 700; margin-top: 8px;
}
.sev-l { background: #d4edda; color: #155724; }
.sev-m { background: #fff3cd; color: #856404; }
.sev-h { background: #f8d7da; color: #721c24; }
.sev-x { background: #f5c6cb; color: #491217; }
.mt-bar-wrap { height: 10px; background: var(--bd); border-radius: 5px; margin: 16px 0 6px; }
.mt-bar-fill { height: 100%; border-radius: 5px; background: var(--ci); transition: width .6s ease; }
.mt-class-desc { font-size: 12px; color: var(--ci2); line-height: 1.6; margin-top: 14px; padding: 12px 15px; background: var(--bg); border-radius: 6px; }

/* Domínios (ICT, FIM) */
.mt-domains { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-bottom: 18px; }
.mt-domain { border-radius: 8px; padding: 13px 15px; background: var(--az); color: #fff; }
.mt-domain .dl { font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; opacity: .8; }
.mt-domain .dv { font-size: 24px; font-weight: 900; margin: 3px 0 1px; }
.mt-domain .dm { font-size: 9px; opacity: .6; }
.mt-domain .dbw { height: 4px; background: rgba(0,0,0,.15); border-radius: 2px; margin-top: 7px; }
.mt-domain .dbf { height: 4px; border-radius: 2px; background: rgba(255,255,255,.8); }
.mt-domain-ci { background: var(--ci); }
.mt-domain-ve { background: #27ae60; }

/* ── Histórico ────────────────────────────────────────────── */
.htable { width: 100%; border-collapse: collapse; }
.htable th { background: var(--az); color: #fff; font-size: 9px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; padding: 9px 12px; text-align: left; }
.htable td { padding: 10px 12px; border-bottom: 1px solid var(--bd); font-size: 12px; vertical-align: middle; }
.htable tr:hover td { background: #f0f7fa; }
.htable tr:last-child td { border-bottom: none; }
.hempty { text-align: center; padding: 38px; color: var(--ci2); font-size: 13px; }
@media(max-width:600px) { .htable th, .htable td { padding: 7px 8px; font-size: 11px; } }

/* ── Responsivo ───────────────────────────────────────────── */
@media(max-width:600px) {
  .mt-opts { flex-wrap: wrap; }
  .mt-opt { flex: 0 0 calc(20% - 4px); }
  .mt-checks { grid-template-columns: 1fr; }
  .mt-binary label { flex: 1; }
  .mt-domains { grid-template-columns: 1fr 1fr; }
}

/* ── Inputs numéricos CM ──────────────────────────────────── */
.cm-input {
  width: 100%; padding: 10px 13px; border: 1.5px solid var(--bd);
  border-radius: 6px; font-family: Montserrat, 'Montserrat-fallback', sans-serif;
  font-size: 16px; font-weight: 700; color: var(--az);
  background: var(--bg); outline: none; transition: border-color .2s;
  max-width: 200px;
}
.cm-input:focus { border-color: var(--ci); background: #fff; }
.cm-input-wide { max-width: 100%; }
.cm-field-row {
  display: flex; align-items: center; gap: 10px; padding: 12px 15px;
  flex-wrap: wrap; border-bottom: 1px solid var(--bd);
}
.cm-field-row:last-child { border-bottom: none; }
.cm-field-label { font-size: 12px; font-weight: 600; color: var(--az); flex: 1; min-width: 150px; }
.cm-field-unit { font-size: 11px; color: var(--ci2); white-space: nowrap; }
.cm-check-row {
  display: flex; align-items: center; gap: 10px; padding: 10px 15px;
  cursor: pointer; border-bottom: 1px solid var(--bd);
}
.cm-check-row:last-child { border-bottom: none; }
.cm-check-row input[type=checkbox] { accent-color: var(--az); width: 16px; height: 16px; cursor: pointer; flex-shrink: 0; }
.cm-check-row label { font-size: 12px; color: var(--az); font-weight: 500; cursor: pointer; flex: 1; }
.cm-check-row .cm-check-score { font-size: 10px; color: var(--ci2); font-weight: 700; white-space: nowrap; }
.cm-section-title {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em;
  color: var(--ci); padding: 8px 15px; background: var(--bg); border-bottom: 1px solid var(--bd);
}
