/* ===================================================
   TR REFRIGERAR - GERADOR DE LAUDOS TÉCNICOS
   ESTILOS GERAIS E LAYOUT IMPRESSO A4
   =================================================== */

:root {
  --primary-color: #0b72b9;
  --primary-hover: #095992;
  --primary-light: #e8f4fc;
  --accent-color: #78a22f; /* Verde característico TR */
  --accent-hover: #638626;
  --dark-color: #1a2228;
  --text-main: #2d3748;
  --text-muted: #718096;
  --bg-page: #f4f7f9;
  --card-bg: #ffffff;
  --border-color: #e2e8f0;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 10px 25px rgba(0,0,0,0.12);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* -----------------------------------------------
   TOP NAVIGATION
   ----------------------------------------------- */
.top-nav {
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.nav-container {
  max-width: 1300px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-logo {
  height: 48px;
  width: auto;
  object-fit: contain;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-family: 'Montserrat', sans-serif;
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--dark-color);
  letter-spacing: -0.5px;
}

.brand-slogan {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--accent-color);
  letter-spacing: 0.2px;
}

.nav-actions {
  display: flex;
  gap: 10px;
}

.nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.nav-btn:hover {
  background: var(--primary-light);
  color: var(--primary-color);
}

.nav-btn.active {
  background: var(--primary-light);
  color: var(--primary-color);
  border-color: #bfdbfe;
}

/* -----------------------------------------------
   MAIN CONTAINER
   ----------------------------------------------- */
.main-content {
  max-width: 1300px;
  margin: 24px auto 60px auto;
  padding: 0 20px;
}

.view-header {
  margin-bottom: 24px;
}

.badge-tech {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: #eef2ff;
  color: #4f46e5;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}

.view-header h1 {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--dark-color);
  margin-bottom: 6px;
}

.view-header .subtitle {
  font-size: 0.98rem;
  color: var(--text-muted);
  max-width: 820px;
}

/* -----------------------------------------------
   GENERATOR GRID
   ----------------------------------------------- */
.generator-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 28px;
  align-items: start;
}

.form-card {
  background: #ffffff;
  border-radius: var(--radius-md);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
}

.form-section {
  padding-bottom: 26px;
  margin-bottom: 26px;
  border-bottom: 1px dashed var(--border-color);
}

.form-section:last-of-type {
  border-bottom: none;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary-color);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 800;
}

.section-title h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--dark-color);
}

.section-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.input-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group.full-width {
  grid-column: span 2;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #374151;
  display: flex;
  align-items: center;
  gap: 6px;
}

.form-group label i {
  width: 16px;
  height: 16px;
  color: var(--primary-color);
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  color: var(--dark-color);
  background: #fafafa;
  transition: all 0.2s ease;
  font-family: inherit;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-color);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(11, 114, 185, 0.15);
}

.textarea-relato {
  resize: vertical;
  min-height: 120px;
  line-height: 1.6;
}

/* -----------------------------------------------
   VOICE RECORDER CONTROLS
   ----------------------------------------------- */
.voice-controls {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.btn-voice {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #ecfdf5;
  color: #047857;
  border: 1.5px solid #a7f3d0;
  padding: 10px 18px;
  border-radius: 30px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-voice:hover {
  background: #d1fae5;
  border-color: #6ee7b7;
}

.btn-voice.recording {
  background: #fee2e2;
  color: #b91c1c;
  border-color: #fca5a5;
  animation: pulse-red 1.5s infinite;
}

@keyframes pulse-red {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.4); }
  50% { transform: scale(1.02); box-shadow: 0 0 0 8px rgba(220, 38, 38, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(220, 38, 38, 0); }
}

.voice-tip {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* -----------------------------------------------
   UPLOAD DROPZONE & PHOTO GRID
   ----------------------------------------------- */
.upload-dropzone {
  border: 2px dashed #93c5fd;
  background: #f8fafc;
  border-radius: var(--radius-md);
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.upload-dropzone:hover {
  border-color: var(--primary-color);
  background: var(--primary-light);
}

.dropzone-content .camera-icon {
  width: 44px;
  height: 44px;
  color: var(--primary-color);
  margin-bottom: 8px;
}

.dropzone-content h4 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--dark-color);
  margin-bottom: 4px;
}

.dropzone-content p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.btn-subir-fotos {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--primary-color);
  color: #fff;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 700;
}

.upload-status {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  color: #3730a3;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-top: 14px;
  font-size: 0.88rem;
  font-weight: 600;
}

.photos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.photo-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  position: relative;
}

.photo-thumb-wrap {
  width: 100%;
  height: 140px;
  background: #1e293b;
  overflow: hidden;
  position: relative;
}

.photo-thumb-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-actions {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  gap: 6px;
}

.photo-btn {
  background: rgba(0,0,0,0.65);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.photo-btn:hover {
  background: rgba(0,0,0,0.9);
}

.photo-btn.delete:hover {
  background: #dc2626;
}

.photo-info-wrap {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.photo-title-text {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--dark-color);
  line-height: 1.3;
}

.photo-legend-text {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.photo-card-footer {
  padding: 6px 12px 10px 12px;
}

.btn-edit-legend {
  background: var(--primary-light);
  color: var(--primary-color);
  border: none;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  width: 100%;
}

/* -----------------------------------------------
   MAIN GENERATE BUTTON
   ----------------------------------------------- */
.action-footer {
  margin-top: 10px;
}

.btn-primary-generate {
  width: 100%;
  background: linear-gradient(135deg, var(--primary-color) 0%, #034b7f 100%);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  padding: 16px 24px;
  font-size: 1.1rem;
  font-weight: 800;
  font-family: 'Montserrat', sans-serif;
  letter-spacing: 0.3px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  box-shadow: 0 4px 14px rgba(11, 114, 185, 0.35);
  transition: all 0.25s ease;
}

.btn-primary-generate:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(11, 114, 185, 0.45);
}

/* -----------------------------------------------
   SIDE INFO
   ----------------------------------------------- */
.side-info {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.info-card {
  background: #ffffff;
  border-radius: var(--radius-md);
  padding: 20px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.info-card h4 {
  font-size: 0.96rem;
  font-weight: 700;
  color: var(--dark-color);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.info-card h4 i {
  color: var(--accent-color);
  width: 18px;
  height: 18px;
}

.info-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.check-list {
  list-style: none;
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.check-list li {
  font-size: 0.82rem;
  color: #374151;
  display: flex;
  align-items: center;
  gap: 8px;
}

.check-list li i {
  color: var(--accent-color);
  width: 14px;
  height: 14px;
}

.clients-tag {
  font-size: 0.8rem;
  color: #1e3a8a;
  background: #eff6ff;
  padding: 8px;
  border-radius: var(--radius-sm);
  line-height: 1.6;
}

/* -----------------------------------------------
   PREVIEW TOOLBAR
   ----------------------------------------------- */
.preview-toolbar {
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 73px;
  z-index: 90;
  box-shadow: var(--shadow-sm);
}

.toolbar-left, .toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.doc-badge {
  background: #f1f5f9;
  color: #0f172a;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 700;
}

.tool-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

.tool-btn.primary {
  background: var(--primary-color);
  color: #fff;
}
.tool-btn.primary:hover {
  background: var(--primary-hover);
}

.tool-btn.secondary {
  background: #ffffff;
  color: var(--text-main);
  border-color: var(--border-color);
}
.tool-btn.secondary:hover {
  background: #f8fafc;
}

.tool-btn.whatsapp {
  background: #25d366;
  color: #ffffff;
}
.tool-btn.whatsapp:hover {
  background: #1eb956;
}

/* -----------------------------------------------
   A4 PRINTABLE PAPER DOCUMENT STYLING
   (EXACT CLONE OF OFFICIAL TR REFRIGERAR LAUDOS)
   ----------------------------------------------- */
.document-viewport {
  padding: 30px 10px 80px 10px;
  display: flex;
  justify-content: center;
  background: #64748b;
  min-height: 100vh;
}

.printable-document {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

/* Folha A4 na tela */
.a4-page {
  width: 210mm;
  min-height: 297mm;
  padding: 18mm 20mm 22mm 20mm;
  background: #ffffff;
  box-shadow: 0 8px 30px rgba(0,0,0,0.3);
  position: relative;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  font-family: Arial, Helvetica, sans-serif;
  color: #111827;
  font-size: 10pt;
  line-height: 1.45;
}

/* CABEÇALHO DA PÁGINA (PADRÃO OFICIAL TR REFRIGERAR) */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12mm;
  position: relative;
  min-height: 60px;
}

.header-ref-box {
  width: 140px;
  font-size: 9pt;
  font-weight: bold;
  color: #111;
  padding-top: 25px;
}

.header-center-box {
  text-align: center;
  flex: 1;
}

.header-company-title {
  font-size: 13pt;
  font-weight: bold;
  color: #000;
  margin-bottom: 4px;
}

.header-company-slogan {
  font-size: 9pt;
  color: #333;
}

.header-logo-box {
  width: 160px;
  text-align: right;
}

.header-logo-box img {
  max-width: 155px;
  max-height: 65px;
  object-fit: contain;
}

/* CORPO DO DOCUMENTO */
.page-body {
  flex: 1;
}

.doc-main-title {
  text-align: center;
  font-size: 12pt;
  font-weight: bold;
  letter-spacing: 0.3px;
  margin-bottom: 4px;
  color: #000;
  text-transform: uppercase;
}

.doc-sub-title {
  text-align: center;
  font-size: 10pt;
  font-weight: bold;
  margin-bottom: 16px;
  color: #222;
  text-transform: uppercase;
}

.meta-info-box {
  margin-bottom: 18px;
  font-size: 9.5pt;
  line-height: 1.5;
}

.meta-row {
  margin-bottom: 3px;
}

.meta-label {
  font-weight: bold;
  color: #000;
}

/* SEÇÕES NUMERADAS */
.laudo-section {
  margin-bottom: 16px;
}

.laudo-section-title {
  font-size: 10.5pt;
  font-weight: bold;
  color: #000;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.laudo-section-content {
  font-size: 9.5pt;
  line-height: 1.5;
  text-align: justify;
  color: #1f2937;
  margin-bottom: 6px;
}

.laudo-items-list {
  list-style: none;
  margin: 6px 0 10px 14px;
}

.laudo-items-list li {
  font-size: 9.5pt;
  line-height: 1.5;
  margin-bottom: 4px;
  position: relative;
  padding-left: 14px;
}

.laudo-items-list li::before {
  content: "●";
  position: absolute;
  left: 0;
  font-size: 8pt;
  color: #111;
}

/* FECHAMENTO E ASSINATURA */
.closing-block {
  margin-top: 24px;
  font-size: 9.5pt;
}

.closing-text {
  margin-bottom: 16px;
}

.closing-signature-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin-top: 10px;
}

.signature-stamp-img {
  max-width: 250px;
  height: auto;
  margin-bottom: 4px;
}

.closing-date-line {
  margin-top: 14px;
  font-size: 9.5pt;
}

/* PÁGINAS DO ANEXO FOTOGRÁFICO */
.photo-page-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  text-align: center;
}

.photo-annex-title {
  font-size: 11pt;
  font-weight: bold;
  text-align: center;
  margin-bottom: 8px;
  color: #000;
}

.photo-annex-caption {
  font-size: 10pt;
  color: #333;
  margin-bottom: 16px;
  max-width: 90%;
  line-height: 1.4;
}

.photo-annex-image-container {
  width: 100%;
  max-height: 170mm;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.photo-annex-image-container img {
  max-width: 100%;
  max-height: 165mm;
  object-fit: contain;
  border: 1px solid #e5e7eb;
}

/* RODAPÉ DA PÁGINA (PADRÃO OFICIAL TR REFRIGERAR) */
.page-footer {
  margin-top: auto;
  padding-top: 8mm;
  text-align: center;
  font-size: 8.5pt;
  line-height: 1.4;
  color: #000;
}

.page-footer .footer-line-strong {
  font-weight: bold;
}

.page-footer a {
  color: #000;
  text-decoration: none;
}

/* -----------------------------------------------
   HISTÓRICO VIEW
   ----------------------------------------------- */
.historico-search-bar {
  margin-bottom: 24px;
}

.search-input-wrap {
  position: relative;
  max-width: 500px;
}

.search-input-wrap i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.search-input-wrap input {
  width: 100%;
  padding: 12px 14px 12px 42px;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  background: #ffffff;
}

.historico-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 18px;
}

.historico-card {
  background: #ffffff;
  border-radius: var(--radius-md);
  padding: 20px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.hist-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.hist-ref {
  font-size: 0.82rem;
  font-weight: 800;
  background: #e0f2fe;
  color: #0369a1;
  padding: 4px 8px;
  border-radius: 4px;
}

.hist-date {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.hist-client {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--dark-color);
  margin-bottom: 4px;
}

.hist-type {
  font-size: 0.85rem;
  color: var(--primary-color);
  font-weight: 600;
  margin-bottom: 8px;
}

.hist-equip {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 16px;
}

.hist-actions {
  display: flex;
  gap: 8px;
  border-top: 1px solid var(--border-color);
  padding-top: 12px;
}

.hist-btn {
  flex: 1;
  padding: 8px 10px;
  font-size: 0.82rem;
  font-weight: 700;
  border-radius: 6px;
  cursor: pointer;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.hist-btn.view {
  background: var(--primary-light);
  color: var(--primary-color);
}
.hist-btn.view:hover {
  background: #bae6fd;
}

.hist-btn.delete {
  background: #fee2e2;
  color: #b91c1c;
}
.hist-btn.delete:hover {
  background: #fecaca;
}

/* -----------------------------------------------
   MODAL & OVERLAY
   ----------------------------------------------- */
.modal-overlay, .loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-box {
  background: #ffffff;
  border-radius: var(--radius-md);
  width: 100%;
  max-width: 520px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  font-size: 1.05rem;
  font-weight: 700;
}

.modal-close {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-muted);
}

.modal-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-photo-preview {
  width: 100%;
  height: 200px;
  background: #0f172a;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.modal-photo-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.modal-footer {
  padding: 14px 20px;
  background: #f8fafc;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.btn-cancel {
  padding: 8px 16px;
  border: 1px solid var(--border-color);
  background: #fff;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
}

.btn-save {
  padding: 8px 18px;
  background: var(--primary-color);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-weight: 700;
  cursor: pointer;
}

.loading-box {
  background: #ffffff;
  border-radius: var(--radius-lg);
  padding: 36px 30px;
  text-align: center;
  max-width: 440px;
  box-shadow: var(--shadow-lg);
}

.spinner, .spinner-large {
  border: 3px solid rgba(11, 114, 185, 0.2);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.spinner {
  width: 18px;
  height: 18px;
}

.spinner-large {
  width: 50px;
  height: 50px;
  margin: 0 auto 18px auto;
  border-width: 4px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-box h3 {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--dark-color);
  margin-bottom: 8px;
}

.loading-box p {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* -----------------------------------------------
   FOOTER OBRIGATÓRIO
   ----------------------------------------------- */
.app-footer {
  background: #ffffff;
  border-top: 1px solid var(--border-color);
  padding: 20px 24px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer-container {
  max-width: 1300px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-signature a {
  color: var(--primary-color);
  font-weight: 700;
  text-decoration: underline;
}

/* -----------------------------------------------
   MEDIA QUERIES (MOBILE / TABLET)
   ----------------------------------------------- */
@media (max-width: 992px) {
  .generator-grid {
    grid-template-columns: 1fr;
  }
  .input-grid {
    grid-template-columns: 1fr;
  }
  .form-group.full-width {
    grid-column: span 1;
  }
  .preview-toolbar {
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
    top: 65px;
  }
  .toolbar-left, .toolbar-right {
    justify-content: space-between;
  }
  .document-viewport {
    padding: 10px 4px;
  }
  .a4-page {
    width: 100%;
    min-height: auto;
    padding: 14mm 12mm 18mm 12mm;
    box-shadow: none;
  }
}

/* -----------------------------------------------
   CSS PRINTING MEDIA RULES (EXACT A4 PERFECTION)
   ----------------------------------------------- */
@media print {
  @page {
    size: A4 portrait;
    margin: 0;
  }

  body {
    background: #ffffff !important;
    color: #000000 !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .no-print, .no-print-wrapper > .preview-toolbar, .top-nav, .app-footer, .modal-overlay, .loading-overlay {
    display: none !important;
  }

  .main-content {
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .document-viewport {
    padding: 0 !important;
    background: #ffffff !important;
    display: block !important;
  }

  .printable-document {
    gap: 0 !important;
  }

  .a4-page {
    width: 210mm !important;
    height: 297mm !important;
    min-height: 297mm !important;
    max-height: 297mm !important;
    padding: 16mm 20mm 20mm 20mm !important;
    margin: 0 auto !important;
    box-shadow: none !important;
    page-break-after: always !important;
    break-after: page !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
    overflow: hidden !important;
  }

  .a4-page:last-child {
    page-break-after: auto !important;
    break-after: auto !important;
  }
}
