/* LexForge Design System & Accessibility Stylesheet */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Lora:ital,wght@0,400;0,600;1,400&display=swap');

:root {
  --forge-orange: #FF6B00;
  --forge-orange-hover: #E05E00;
  --forge-orange-active: #C75300;
  --forge-orange-light: #FFF4ED;
  --forge-black: #111827;
  --forge-night: #0B0F17;
  --forge-white: #FFFFFF;
  --forge-gray-50: #F9FAFB;
  --forge-gray-100: #F3F4F6;
  --forge-gray-200: #E5E7EB;
  --forge-gray-300: #D1D5DB;
  --forge-gray-400: #9CA3AF;
  --forge-gray-600: #4B5563;
  --forge-gray-700: #374151;
  --forge-gray-900: #111827;

  --success: #16A34A;
  --warning: #D97706;
  --danger: #DC2626;

  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
}

/* Compensação do Header Sticky e Rolagem Suave com Safe Area */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 104px; /* Garante que a barra flutuante nunca cubra o início dos títulos */
}

/* Fim do Scroll Horizontal em Branco e Estabilidade Global */
html, body {
  max-width: 100vw;
  overflow-x: hidden !important;
  position: relative;
  min-height: 100dvh; /* Dynamic Viewport Height compatível com Safari iOS */
}

/* Padronização Tipográfica Estrita Global (Inter / Plus Jakarta Sans) */
body, button, input, select, textarea, table, th, td, h1, h2, h3, h4, h5, h6, span, p, a, label {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
  -webkit-font-smoothing: antialiased;
}

body {
  color: var(--forge-gray-900);
  background-color: var(--forge-gray-50);
  line-height: 1.5;
}

/* Única exceção em todo o sistema: folha A4 realista da petição */
.sheet-a4, .sheet-a4 p, .sheet-a4 span, .sheet-a4 div, .sheet-a4 strong, .sheet-a4 em {
  font-family: 'Lora', Georgia, serif !important;
}

/* Checkbox e Radio estilizados em Laranja Oficial LexElo (#FF6B00) */
input[type="checkbox"], input[type="radio"] {
  accent-color: #FF6B00 !important;
  cursor: pointer;
}
input[type="checkbox"]:focus, input[type="radio"]:focus {
  outline-color: #FF6B00 !important;
}

/* WCAG 2.1 AA — Indicador de foco de alto contraste para teclado */
*:focus-visible {
  outline: 2px solid var(--forge-orange) !important;
  outline-offset: 2px !important;
}

/* Botões Profissionais com Feedback Tátil e Transições Claras */
.btn-forge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  min-height: 44px; /* Touch target acessível */
  cursor: pointer;
  text-decoration: none;
  user-select: none;
}
.btn-forge:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}
.btn-forge:active {
  transform: translateY(0);
  box-shadow: none;
}

.btn-forge-primary {
  background-color: var(--forge-orange);
  color: #FFFFFF;
  border: 1px solid transparent;
}
.btn-forge-primary:hover {
  background-color: var(--forge-orange-hover);
}
.btn-forge-primary:active {
  background-color: var(--forge-orange-active);
}

.btn-forge-secondary {
  background-color: #FFFFFF;
  color: var(--forge-gray-900);
  border: 1px solid var(--forge-gray-300);
}
.btn-forge-secondary:hover {
  background-color: var(--forge-gray-100);
  border-color: var(--forge-gray-400);
}

.btn-forge-dark {
  background-color: var(--forge-black);
  color: #FFFFFF;
  border: 1px solid transparent;
}
.btn-forge-dark:hover {
  background-color: #1F2937;
}

/* Efeito de Seleção Visual para botões de opções/cards */
.selectable-card {
  transition: all 0.2s ease-in-out;
  cursor: pointer;
}
.selectable-card:hover {
  border-color: var(--forge-orange);
  background-color: var(--forge-orange-light);
}
.selectable-card.selected {
  border-color: var(--forge-orange) !important;
  background-color: var(--forge-orange-light) !important;
  box-shadow: 0 0 0 1px var(--forge-orange);
}

/* Inputs de formulário estruturados (Padrão 42px WCAG 2.1 AA) */
.input-forge {
  width: 100%;
  height: 42px;
  min-height: 42px;
  padding: 0 0.875rem;
  font-size: 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--forge-gray-300);
  background-color: #FFFFFF;
  color: var(--forge-gray-900);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
textarea.input-forge {
  height: auto;
  min-height: 88px;
  padding: 0.625rem 0.875rem;
}
.input-forge:focus {
  border-color: var(--forge-orange);
  box-shadow: 0 0 0 3px rgba(255, 107, 0, 0.12);
}

/* Alinhamento Vertical Estrito de Grupos de Campo (.form-field) */
.form-field {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-width: 0;
}

.form-label {
  min-height: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: #374151;
  margin-bottom: 6px;
  line-height: 1.25;
}

.form-label-text {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  word-break: normal;
  line-height: 1.35;
}

/* Grade de Checkboxes em Tiles Selecionáveis (Passo 3 - Sem Colisão) */
.checkbox-tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}

.selectable-tile {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #E5E7EB;
  background-color: #FFFFFF;
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  color: #374151;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  min-height: 42px;
  min-width: 0;
}

.selectable-tile:hover {
  border-color: #D1D5DB;
  background-color: #F9FAFB;
}

.selectable-tile:has(input:checked),
.selectable-tile.checked {
  border-color: #FF6B00 !important;
  background-color: #FFF4ED !important;
  color: #9A3412 !important;
  font-weight: 600;
  box-shadow: 0 0 0 1px rgba(255, 107, 0, 0.2);
}

.selectable-tile input[type="checkbox"] {
  accent-color: #FF6B00;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin: 0;
  cursor: pointer;
}

.selectable-tile span {
  white-space: normal;
  overflow: visible;
  line-height: 1.25;
}

/* Prevenção de Topo Cortado no Scroll do Wizard */
.wizard-step-card {
  padding-top: 24px !important;
  scroll-margin-top: 24px;
}

/* Stepper Semântico do Wizard (Concluído / Ativo / Pendente) */
.wizard-stepper-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.wizard-stepper-bar::-webkit-scrollbar {
  display: none;
}

.step-btn-completed {
  background-color: #FFF4ED !important;
  border: 1px solid #FF6B00 !important;
  color: #C75300 !important;
  scroll-snap-align: start;
  white-space: normal !important;
  word-break: normal !important;
  line-height: 1.25;
}

.step-btn-active {
  background-color: #0B0F17 !important;
  border: 1px solid #0B0F17 !important;
  color: #FFFFFF !important;
  box-shadow: 0 2px 6px rgba(11, 15, 23, 0.18);
  scroll-snap-align: start;
  white-space: normal !important;
  word-break: normal !important;
  line-height: 1.25;
}

.step-btn-pending {
  background-color: #F9FAFB !important;
  border: 1px solid #E5E7EB !important;
  color: #6B7280 !important;
  scroll-snap-align: start;
  white-space: normal !important;
  word-break: normal !important;
  line-height: 1.25;
}

/* Cards sem barras coloridas clichês */
.card-forge {
  background-color: #FFFFFF;
  border: 1px solid var(--forge-gray-200);
  border-radius: var(--radius-lg);
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
}

/* Área de Minuta com Tipografia Jurídica */
.doc-preview {
  font-family: 'Lora', Georgia, serif;
  background-color: #FFFFFF;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  padding: 3rem 2.5rem;
  border: 1px solid var(--forge-gray-200);
}

/* Drawer Mobile Sidebar (Gaveta Lateral Deslizante com Safe Area e Sombra Suave) */
@media (max-width: 1024px) {
  .sidebar-mobile {
    position: fixed !important;
    top: 0;
    bottom: 0;
    left: 0;
    width: 18rem !important; /* 72 = 288px */
    z-index: 50 !important;
    transform: translateX(-100%);
    transition: transform 300ms cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
    will-change: transform;
  }
  .sidebar-mobile.open {
    transform: translateX(0) !important;
  }
}

/* ==========================================================================
   SISTEMA DE SIDEBAR COLAPSÁVEL & TRANSIÇÕES A 60FPS
   ========================================================================== */
#sidebar {
  transition: transform 220ms cubic-bezier(0.4, 0, 0.2, 1), width 220ms cubic-bezier(0.4, 0, 0.2, 1);
  will-change: width, transform;
}

.sidebar-collapsed {
  width: 84px !important;
}

.sidebar-collapsed .nav-label,
.sidebar-collapsed .nav-group-title,
.sidebar-collapsed .workspace-brand-text,
.sidebar-collapsed .nav-badge,
.sidebar-collapsed .user-profile-text {
  display: none !important;
}

.sidebar-collapsed #sidebar-chevron {
  transform: rotate(180deg);
}

.sidebar-collapsed .nav-item {
  justify-content: center !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  position: relative;
}

.sidebar-collapsed .nav-item[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 88px;
  top: 50%;
  transform: translateY(-50%);
  background-color: #111827;
  color: #FFFFFF;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 6px;
  white-space: nowrap;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  border: 1px solid #374151;
  pointer-events: none;
}

#btn-collapse-sidebar {
  width: 28px;
  height: 28px;
  background-color: #1F2937;
  border: 1px solid #374151;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
}
#btn-collapse-sidebar:hover {
  background-color: #374151;
  color: #FFFFFF;
}

.sidebar-collapsed .sidebar-top-bar {
  padding-left: 10px !important;
  padding-right: 10px !important;
  justify-content: space-between !important;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.875rem;
  border-radius: 6px;
  color: #9CA3AF;
  font-size: 0.875rem;
  font-weight: 500;
  transition: background-color 150ms ease, color 150ms ease, border-color 150ms ease;
  border-left: 3px solid transparent;
  cursor: pointer;
}

.nav-item:hover {
  background-color: #1F2937;
  color: #F3F4F6;
}

.nav-item.active {
  background-color: #1F2937;
  color: #FFFFFF;
  border-left-color: #FF6B00;
}

.nav-item.active svg {
  color: #FF6B00 !important;
  stroke: #FF6B00 !important;
}

/* Transições fluidas de abas (Fade-in 150ms) */
.tab-pane {
  animation: fadeIn 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(3px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Célula de Ações com alinhamento perfeito (sem quebra de linha torta) */
.table-actions-cell {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  white-space: nowrap;
}

/* ==========================================================================
   CARDS DE SELEÇÃO TÉCNICA (RADIO CARDS) & ÁRVORES FORENSES
   ========================================================================== */
.radio-card {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  border: 1.5px solid #E5E7EB;
  border-radius: 8px;
  background-color: #FFFFFF;
  cursor: pointer;
  transition: all 0.15s ease-in-out;
}

.radio-card:hover {
  border-color: #D1D5DB;
  background-color: #F9FAFB;
}

.radio-card.active,
.radio-card:has(input[type="radio"]:checked) {
  border-color: #FF6B00;
  background-color: #FFF8F3;
}

.radio-card input[type="radio"] {
  accent-color: #FF6B00;
  margin-top: 0.2rem;
  width: 1rem;
  height: 1rem;
}

.sub-branch-container {
  margin-left: 1rem;
  padding-left: 1rem;
  border-left: 2px solid #FF6B00;
}

/* ==========================================================================
   FOLHA A4 REALISTA & PREVIEW EM TEMPO REAL
   ========================================================================== */
.sheet-a4 {
  background: #FFFFFF;
  width: 100%;
  max-width: 210mm;
  min-height: 297mm;
  margin: 0 auto;
  padding: 25mm 20mm;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  border: 1px solid #E5E7EB;
  font-family: 'Lora', Georgia, serif;
  font-size: 11pt;
  line-height: 1.6;
  color: #111827;
  position: relative;
  box-sizing: border-box;
}

@media (max-width: 1280px) {
  .sheet-a4 {
    padding: 18mm 14mm;
    min-height: auto;
  }
}

@keyframes forge-pulse-highlight {
  0% { background-color: rgba(255, 107, 0, 0.25); }
  100% { background-color: transparent; }
}

.highlight-pulse {
  animation: forge-pulse-highlight 1.5s ease-out;
  border-radius: 4px;
}

/* ==========================================================================
   DRAWERS LATERAIS & MODAIS OPERACIONAIS
   ========================================================================== */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(17, 24, 39, 0.5);
  backdrop-filter: blur(2px);
  z-index: 50;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.drawer-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.drawer-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 680px;
  background: #FFFFFF;
  z-index: 51;
  transform: translateX(100%);
  transition: transform 220ms cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
  box-shadow: -4px 0 25px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
}

.drawer-panel.open {
  transform: translateX(0);
}

/* Popover do Sino de Notificações */
.popover-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.5rem;
  background-color: #FFFFFF;
  border: 1px solid #E5E7EB;
  border-radius: 8px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  z-index: 40;
  min-width: 360px;
}

@media (max-width: 767px) {
  .popover-dropdown {
    min-width: min(340px, calc(100vw - 24px));
    right: -8px;
  }
}

/* ==========================================================================
   RESPONSIVIDADE MOBILE-FIRST REAL (< 768px): CONVERSÃO TABELA -> CARDS
   ========================================================================== */
.mobile-cards-view {
  display: none;
}

@media (max-width: 767px) {
  .desktop-table-view {
    display: none !important;
  }
  .mobile-cards-view {
    display: flex !important;
    flex-direction: column;
    gap: 12px;
    padding: 12px;
  }
}

.mobile-data-card {
  background-color: #FFFFFF;
  border: 1px solid #E5E7EB;
  border-radius: 10px;
  padding: 14px 16px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mobile-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.mobile-card-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
  padding: 8px 10px;
  background-color: #F9FAFB;
  border: 1px solid #F3F4F6;
  border-radius: 6px;
  font-size: 12px;
}

.mobile-card-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 6px;
}

.mobile-card-actions button,
.mobile-card-actions a {
  width: 100% !important;
  min-height: 44px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  border-radius: 8px !important;
}

/* ==========================================================================
   COMPARADOR VISUAL DE VERSÕES (DIFF v1 <-> v2) & EDIÇÃO DIRETA (A4)
   ========================================================================== */
.diff-del {
  background-color: #FEE2E2;
  color: #991B1B;
  text-decoration: line-through;
  padding: 1px 4px;
  border-radius: 3px;
  font-weight: 500;
}

.diff-ins {
  background-color: #DCFCE7;
  color: #166534;
  padding: 1px 4px;
  border-radius: 3px;
  font-weight: 700;
  border-bottom: 1.5px solid #86EFAC;
}

.clean-sheet-mode .diff-ins,
.sheet-a4:not(.diff-mode-active) .diff-ins {
  background-color: transparent !important;
  color: #0B0F17 !important;
  padding: 0 !important;
  border-radius: 0 !important;
  font-weight: normal !important;
  border-bottom: none !important;
  text-decoration: none !important;
}

.clean-sheet-mode .diff-del,
.sheet-a4:not(.diff-mode-active) .diff-del {
  display: none !important;
}

.editable-minuta-active {
  outline: 2px dashed #FF6B00 !important;
  outline-offset: -8px !important;
  background-color: #FFFDFB !important;
  cursor: text !important;
}

/* Timeline Forense Vertical */
.forensic-timeline {
  position: relative;
  padding-left: 24px;
}
.forensic-timeline::before {
  content: '';
  position: absolute;
  left: 9px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background-color: #E5E7EB;
}
.forensic-timeline-item {
  position: relative;
  padding-bottom: 18px;
}
.forensic-timeline-item:last-child {
  padding-bottom: 0;
}
.forensic-timeline-dot {
  position: absolute;
  left: -24px;
  top: 2px;
  width: 20px;
  height: 20px;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #FFFFFF;
  border: 2px solid #D1D5DB;
  z-index: 2;
}

/* ==========================================================================
   BOTÃO DE ORIENTAÇÃO JURÍDICA FIXO NO CANTO SUPERIOR DIREITO (ⓘ)
   ========================================================================== */
.btn-info-corner {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #FFF4ED;
  color: #FF6B00;
  border: 1px solid #FFEDD5;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}
.btn-info-corner:hover {
  background: #FFE8D6;
  border-color: #FED7AA;
  transform: scale(1.08);
}
.btn-info-corner:focus-visible {
  outline: 2px solid #FF6B00 !important;
  outline-offset: 2px !important;
}

/* Animações suaves para LexForgeDialog e Toasts */
@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}
@keyframes fadeScaleIn {
  from {
    transform: scale(0.95);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}
.animate-dialog-fade {
  animation: fadeScaleIn 0.18s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
.animate-toast-slide {
  animation: slideInRight 0.22s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* ==========================================================================
   BARRA DE ROLAGEM OFICIAL LARANJA LEXELO (#FF6B00) - FUNDO 100% BRANCO (#FFFFFF)
   ========================================================================== */
* {
  scrollbar-width: thin;
  scrollbar-color: #FF6B00 #FFFFFF !important;
}
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
  background: #FFFFFF !important;
}
::-webkit-scrollbar-track {
  background: #FFFFFF !important;
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb {
  background: #FF6B00 !important;
  border-radius: 9999px;
  border: 2px solid #FFFFFF;
}
::-webkit-scrollbar-thumb:hover {
  background: #E05E00 !important;
}
::-webkit-scrollbar-button {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

/* ==========================================================================
   SUÍTE DE ACESSIBILIDADE FORENSE (ALTO CONTRASTE, GUIA DE LEITURA & FOCO)
   ========================================================================== */
html.high-contrast {
  filter: contrast(135%) brightness(105%);
}
html.high-contrast body {
  background-color: #000000 !important;
  color: #FFFFFF !important;
}
html.high-contrast .bg-white,
html.high-contrast .bg-gray-50,
html.high-contrast .bg-[#F4F5F7] {
  background-color: #121824 !important;
  color: #FFFFFF !important;
  border-color: #334155 !important;
}
html.high-contrast p,
html.high-contrast span,
html.high-contrast li,
html.high-contrast a {
  color: #F8FAFC !important;
}
html.high-contrast h1,
html.high-contrast h2,
html.high-contrast h3,
html.high-contrast h4 {
  color: #FFFFFF !important;
}

/* Guia de Leitura Horizontal */
#reading-guide-line {
  position: fixed;
  left: 0;
  right: 0;
  height: 3px;
  background-color: #FF6B00;
  box-shadow: 0 0 10px rgba(255, 107, 0, 0.8), 0 0 20px rgba(255, 107, 0, 0.4);
  pointer-events: none;
  z-index: 99999;
  display: none;
}

/* Foco Laranja Visível em Navegação por Teclado */
body.keyboard-nav *:focus-visible {
  outline: 2px solid #FF6B00 !important;
  outline-offset: 3px !important;
  box-shadow: 0 0 0 4px rgba(255, 107, 0, 0.25) !important;
}

/* ==========================================================================
   ARQUITETURA MULTI-TELA RESPONSIVA & SAFE-AREA (SAFARI iOS, TABLET & SMART TV)
   ========================================================================== */

/* 1. Safe Area Inset Bottom para Mobile Safari iOS */
.pb-safe,
.app-safe-bottom,
form.safe-bottom,
.main-scroll-area {
  padding-bottom: calc(96px + env(safe-area-inset-bottom, 24px)) !important;
}

/* 2. Textos 100% Justificados Forenses */
.text-justify,
.p-justified,
.card-text-justify,
.faq-sub-content {
  text-align: justify !important;
  text-justify: inter-word !important;
  hyphens: auto !important;
  -webkit-hyphens: auto !important;
}

/* 3. Dispositivos Móveis (< 640px) */
@media (max-width: 639px) {
  /* Impede zoom automático do Mobile Safari ao focar inputs */
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="tel"],
  input[type="number"],
  select,
  textarea {
    font-size: 16px !important;
  }
}

/* 4. Tablets Intermediários (640px a 1023px — iPad / Galaxy Tab) */
@media (min-width: 640px) and (max-width: 1023px) {
  .tablet-2cols {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 1rem !important;
  }
}

/* 5. Smart TV / Telas Grandes / Apresentações 4K (>= 1920px e >= 2560px) */
@media (min-width: 1920px) {
  html {
    font-size: clamp(17px, 0.95vw, 22px);
  }
  .max-w-tv {
    max-width: 1720px !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }
}

@media (min-width: 2560px) {
  html {
    font-size: clamp(18px, 1.1vw, 26px);
  }
  .max-w-tv {
    max-width: 2100px !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }
}



