:root{
  --mm-blue: #2B6299;
  --mm-yellow: #F9C038;
  --mm-ink: #12324A;
  --mm-bg: #F5F7FA;
  --mm-border: #E3E7EE;

  --mm-danger: #C0392B;
  --mm-danger-bg: #FFF2F0;
  --mm-focus: rgba(43, 98, 153, .18);
}

* { box-sizing: border-box; }

body {
  font-family: Arial, Helvetica, sans-serif;
  margin: 0;
  background: var(--mm-bg);
  color: var(--mm-ink);
}

.container {
  max-width: 980px;
  margin: 18px auto;
  padding: 12px;
}

/* ===== ÁREA VISUAL (TELA) ===== */
.printArea{
  background: transparent;
  padding: 0;
  border-radius: 12px;
}

/* ===== Cabeçalho estilo documento ===== */
.docHeader{
  display: grid;
  grid-template-columns: 240px 1fr;
  border: 1px solid var(--mm-border);
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 12px;
}

.docLogo{
  display:flex;
  align-items:center;
  justify-content:center;
  padding: 14px;
  border-right: 1px solid var(--mm-border);
}

.docLogo img{
  max-width: 200px;
  height: auto;
}

.docTitle{
  display:flex;
  align-items:center;
  justify-content:center;
  text-align:center;
  padding: 14px;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: .2px;
}

/* ===== Cards ===== */
.card {
  background: white;
  border-radius: 12px;
  padding: 0;
  margin-bottom: 12px;
  border: 1px solid var(--mm-border);
  overflow: hidden;
}

.sectionBar{
  background: var(--mm-blue);
  color: #fff;
  font-weight: 700;
  text-align: center;
  padding: 10px 12px;
  letter-spacing: .3px;
}

/* conteúdo interno do card */
.card > :not(.sectionBar){
  padding: 14px;
}

/* ===== Form grid ===== */
.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.grid.oneCol{ grid-template-columns: 1fr; }

label { display: block; font-size: 13px; position: relative; }

input[type="text"], input[type="date"] {
  width: 100%;
  padding: 10px 12px;
  margin-top: 6px;
  border: 1px solid #D7DCE5;
  border-radius: 10px;
  font-size: 14px;
  outline: none;
}

input[type="text"]:focus, input[type="date"]:focus, textarea:focus {
  box-shadow: 0 0 0 4px var(--mm-focus);
  border-color: rgba(43,98,153,.55);
}

/* ===== Obrigatórios: marca visual ===== */
.reqMark{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 6px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: var(--mm-blue);
  border-radius: 999px;
  padding: 2px 7px;
  vertical-align: middle;
}

.reqHint{
  display: inline-block;
  margin-top: 6px;
  font-size: 11px;
  color: #6B7785;
}

/* borda suave nos campos required (ajuda o técnico “bater o olho”) */
.is-required{
  border-color: rgba(43,98,153,.35) !important;
}

/* ===== Erro (quando faltou preencher) ===== */
.fieldError{
  border-color: var(--mm-danger) !important;
  background: var(--mm-danger-bg) !important;
  box-shadow: 0 0 0 4px rgba(192,57,43,.14) !important;
}

.labelError{
  color: var(--mm-danger);
}

/* ===== Progresso ===== */
.progresso {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.barra {
  width: 100%;
  height: 10px;
  background: #E9EDF2;
  border-radius: 999px;
  overflow: hidden;
}

.fill {
  height: 100%;
  width: 0%;
  background: var(--mm-yellow);
}

/* ===== Checklist ===== */
.item {
  border: 1px solid #ECEEF1;
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 10px;
}

.item-linha {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: start;
}

.item-texto {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.badge {
  min-width: 34px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: #F0F3F7;
  font-weight: 700;
  font-size: 12px;
  flex: 0 0 auto;
}

.item-texto p {
  margin: 0;
  font-size: 14px;
  line-height: 1.35;
}

.opcoes {
  display: flex;
  gap: 10px;
  flex-wrap: nowrap;
  justify-content: flex-end;
}

.opcoes label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border: 1px solid #E3E5E8;
  border-radius: 999px;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  background: #fff;
}

/* Observação quando Falhou */
.obs {
  margin-top: 10px;
  display: none;
}
.obs textarea {
  width: 100%;
  min-height: 70px;
  resize: vertical;
  padding: 10px;
  border: 1px solid #D7DCE5;
  border-radius: 12px;
  font-size: 14px;
  margin-top: 6px;
  outline: none;
}

/* ===== Assinaturas ===== */
.assinaturas {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.assinaturaBox h3{ margin:0 0 8px 0; font-size:14px; }

.canvas {
  width: 100%;
  height: 180px;
  border: 2px dashed #CFD3D8;
  border-radius: 12px;
  background: #fff;
  touch-action: none;
}

.botoes {
  margin-top: 8px;
  display: flex;
  gap: 8px;
}

button {
  padding: 10px 12px;
  border: 0;
  border-radius: 12px;
  cursor: pointer;
}

.btnPrincipal {
  width: 100%;
  padding: 14px;
  font-size: 15px;
  background: var(--mm-blue);
  color: #fff;
}

.nota {
  font-size: 12px;
  color: #555;
  margin: 8px 0 0 0;
}

.mt8{ margin-top: 8px; }

/* ===== Responsivo (TELA) ===== */
@media (max-width: 780px) {
  .docHeader{ grid-template-columns: 1fr; }
  .docLogo{ border-right: 0; border-bottom: 1px solid var(--mm-border); }

  .grid { grid-template-columns: 1fr; }
  .assinaturas { grid-template-columns: 1fr; }

  .item-linha { grid-template-columns: 1fr; }
  .opcoes { justify-content: flex-start; flex-wrap: wrap; }
}

/* ===== MODO PDF (FORÇAR DESKTOP MESMO NO CELULAR) ===== */
.pdf-desktop-forced{
  width: 980px !important;
  max-width: 980px !important;

  /* ✅ evita “mini overflow” que vira corte no canvas */
  overflow: visible !important;
}

.pdf-desktop-forced .docHeader{
  grid-template-columns: 240px 1fr !important;
}
.pdf-desktop-forced .docLogo{
  border-right: 1px solid var(--mm-border) !important;
  border-bottom: 0 !important;
}

.pdf-desktop-forced .grid{
  grid-template-columns: 1fr 1fr !important;
}
.pdf-desktop-forced .grid.oneCol{
  grid-template-columns: 1fr !important;
}

.pdf-desktop-forced .assinaturas{
  grid-template-columns: 1fr 1fr !important;
}

.pdf-desktop-forced .item-linha{
  grid-template-columns: 1fr auto !important;
}
.pdf-desktop-forced .opcoes{
  justify-content: flex-end !important;
  flex-wrap: nowrap !important;
}

/* ✅ garante que cards não “clipem” nada no clone do PDF */
.pdf-desktop-forced .card,
.pdf-desktop-forced .docHeader{
  overflow: visible !important;
}

/* ===== Observações em largura total ===== */
.obsFull {
  width: 100%;
}

.obsFull textarea {
  width: 100%;
  min-height: 200px; /* ~10 linhas */
  resize: vertical;
  padding: 14px;
  border: 1px solid #D7DCE5;
  border-radius: 12px;
  font-size: 14px;
  outline: none;
}

/* Label invisível (acessibilidade) */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ===== OBSERVAÇÕES: forçar ocupar 100% horizontal ===== */
#secObservacoes .obsFull {
  display: block;
  width: 100%;
}

#secObservacoes textarea#observacoes {
  display: block !important;
  width: 100% !important;
  min-width: 100% !important;
  max-width: 100% !important;

  box-sizing: border-box !important;
  margin: 0 !important;

  min-height: 220px; /* ~10 linhas confortáveis */
  resize: vertical;
  padding: 14px;

  border: 1px solid #D7DCE5;
  border-radius: 12px;
  font-size: 14px;
  outline: none;
}
