/**
 * Estilos compartilhados — Portal de Atendimento (DTI / PROAD)
 * Cores de unidade vêm das classes Bootstrap (primary / danger) ou utilitários .unit-*
 */

html, body {
  min-height: 100%;
  background-color: #f8f9fa;
}

/* Evita que o rodapé fixo cubra o conteúdo */
main.portal-main,
body > main.container-xxl {
  padding-bottom: 80px;
}

/* Login: card centralizado */
.login-shell {
  max-width: 450px;
  width: 100%;
  padding: 15px;
}

/* Overlays (loader / sucesso / erro) */
.display {
  position: fixed;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  z-index: 1050;
}

.hide {
  display: none !important;
}

/* Identidade de unidade (complementa Bootstrap) */
.text-proad {
  color: #dc3545 !important;
}

.bg-proad-light {
  background-color: rgba(220, 53, 69, 0.1) !important;
}

.bg-dti-light {
  background-color: rgba(13, 110, 253, 0.1) !important;
}

/* Logo Google no botão de login (círculo branco para contraste) */
.btn-google-login .google-logo-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
  flex-shrink: 0;
}

.btn-google-login .google-logo-badge svg {
  display: block;
  width: 1.15rem;
  height: 1.15rem;
}

/* Foco de formulário alinhado à unidade (opcional) */
.unit-proad .form-control:focus,
.unit-proad .form-select:focus {
  border-color: #dc3545;
  box-shadow: 0 0 0 0.25rem rgba(220, 53, 69, 0.15);
}

.unit-dti .form-control:focus,
.unit-dti .form-select:focus {
  border-color: #86b7fe;
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* ------------------------------------------------------------------
   Formulário (inspirado em formulario_modelo.html)
   Largura do card continua definida pelo layout Bootstrap da página.
   ------------------------------------------------------------------ */

:root {
  --portal-accent: #0d6efd;
  --portal-accent-soft: #3b82f6;
  --portal-accent-rgb: 13, 110, 253;
}

.unit-dti {
  --portal-accent: #0d6efd;
  --portal-accent-soft: #3b82f6;
  --portal-accent-rgb: 13, 110, 253;
}

.unit-proad {
  --portal-accent: #dc3545;
  --portal-accent-soft: #e35d6a;
  --portal-accent-rgb: 220, 53, 69;
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* Card principal do formulário */
.form-card {
  border: none;
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  border-radius: 12px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  overflow: hidden;
  background: #fff;
}

.form-card:hover {
  box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

/* Cabeçalhos de seção (textos vêm do HTML existente) */
.section-header {
  background: linear-gradient(90deg, var(--portal-accent), var(--portal-accent-soft));
  color: #fff;
  border-radius: 12px 12px 0 0;
  padding: 14px 20px;
  font-weight: 600;
  font-size: 1.05rem;
  margin: 0;
  border-bottom: none;
}

.section-header i {
  opacity: 0.95;
}

/* Labels e inputs no estilo do modelo (label logo acima do campo) */
.form-card .form-label,
.form-card .col-form-label {
  font-weight: 600;
  color: #374151;
  margin-bottom: 0.4rem;
  display: block;
}

.form-card-body > .mb-3,
.form-card-body > .mb-4,
.form-card-body > .mb-0 {
  max-width: 100%;
}

.form-card-body .form-control,
.form-card-body .form-select,
.form-card-body .dropzone,
.form-card-body .setor-cards,
.form-card-body .setor-cards-dti {
  width: 100%;
}

.modern-input,
.form-card .form-control,
.form-card .form-select {
  border-radius: 8px;
  border: 1px solid #d1d5db;
  padding: 10px 14px;
}

.form-card .form-control:focus,
.form-card .form-select:focus,
.modern-input:focus {
  border-color: var(--portal-accent);
  box-shadow: 0 0 0 3px rgba(var(--portal-accent-rgb), 0.12);
}

/* Cards clicáveis de setor de destino */
.setor-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

/* DTI: layout em colunas Bootstrap (como o modelo), não grid genérico */
.setor-cards-dti {
  display: flex;
  flex-wrap: wrap;
  margin-bottom: 0.35rem;
}

.setor-cards.is-invalid,
.setor-cards-dti.is-invalid {
  border-radius: 12px;
  box-shadow: 0 0 0 2px #dc3545;
  padding: 0.35rem;
}

#setorDestinoFeedback {
  display: none;
}

#setorDestinoFeedback[style*="block"] {
  display: block !important;
}

.setor-card {
  cursor: pointer;
  transition: all 0.2s ease;
  border: 2px solid #dee2e6;
  border-radius: 12px;
  background: #fff;
  padding: 1rem 0.75rem;
  text-align: center;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  user-select: none;
}

/* PROAD (grid de ícones compactos): pequeno espaçamento entre ícone e título */
.setor-cards .setor-card {
  gap: 0.35rem;
}

.setor-card:hover {
  border-color: var(--portal-accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(var(--portal-accent-rgb), 0.15);
}

.setor-card.active {
  border-color: var(--portal-accent);
  background-color: rgba(var(--portal-accent-rgb), 0.08);
  box-shadow: 0 0 0 3px rgba(var(--portal-accent-rgb), 0.2);
}

.setor-card .setor-card-icon {
  font-size: 1.75rem;
  line-height: 1;
  margin-bottom: 0.15rem;
}

.setor-card .setor-card-title {
  font-weight: 600;
  font-size: 0.8rem;
  color: #374151;
  line-height: 1.25;
  word-break: break-word;
}

/* --- DTI: tipografia e espaçamento iguais ao formulario_modelo.html --- */
.setor-card-modelo {
  /* sem gap extra: o modelo usa só mb-2 no ícone (0.5rem) */
  gap: 0;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* Título: igual a .fw-semibold do Bootstrap no modelo (herda ~1rem do body) */
.setor-card-modelo > .fw-semibold {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.5;
  color: #212529;
  margin: 0;
}

/* Subtítulo: igual a <small class="text-muted"> do Bootstrap */
.setor-card-modelo > small.text-muted {
  font-size: 0.875em;
  font-weight: 400;
  line-height: 1.5;
  margin: 0;
}

/* Ícone fa-2x + mb-2 como no modelo */
.setor-card-modelo > i.fa-2x {
  font-size: 2em;
  line-height: 1;
  margin-bottom: 0.5rem !important; /* Bootstrap mb-2 */
}

.setor-card-modelo:hover {
  border-color: #0d6efd;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(13, 110, 253, 0.15);
}

.setor-card-modelo.active {
  border-color: #0d6efd;
  background-color: #e7f1ff;
  box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.2);
}

.setor-card-modelo.infra.active {
  background-color: #e8f5e9;
  border-color: #2e7d32;
  box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.2);
}

.setor-card-modelo.sistemas.active {
  background-color: #e3f2fd;
  border-color: #1565c0;
  box-shadow: 0 0 0 3px rgba(21, 101, 192, 0.2);
}

.setor-card-modelo.governanca.active {
  background-color: #f3e5f5;
  border-color: #7b1fa2;
  box-shadow: 0 0 0 3px rgba(123, 31, 162, 0.2);
}

/* Variantes de cor por tipo (PROAD e genérico) */
.setor-card.tipo-infra .setor-card-icon { color: #2e7d32; }
.setor-card.tipo-infra.active {
  background-color: #e8f5e9;
  border-color: #2e7d32;
  box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.2);
}

.setor-card.tipo-sistemas .setor-card-icon { color: #1565c0; }
.setor-card.tipo-sistemas.active {
  background-color: #e3f2fd;
  border-color: #1565c0;
  box-shadow: 0 0 0 3px rgba(21, 101, 192, 0.2);
}

.setor-card.tipo-governanca .setor-card-icon { color: #7b1fa2; }
.setor-card.tipo-governanca.active {
  background-color: #f3e5f5;
  border-color: #7b1fa2;
  box-shadow: 0 0 0 3px rgba(123, 31, 162, 0.2);
}

.setor-card.tipo-eletrica .setor-card-icon { color: #f9a825; }
.setor-card.tipo-eletrica.active {
  background-color: #fff8e1;
  border-color: #f9a825;
}

.setor-card.tipo-clima .setor-card-icon { color: #0288d1; }
.setor-card.tipo-clima.active {
  background-color: #e1f5fe;
  border-color: #0288d1;
}

.setor-card.tipo-civil .setor-card-icon { color: #5d4037; }
.setor-card.tipo-civil.active {
  background-color: #efebe9;
  border-color: #5d4037;
}

.setor-card.tipo-abastecimento .setor-card-icon { color: #ef6c00; }
.setor-card.tipo-abastecimento.active {
  background-color: #fff3e0;
  border-color: #ef6c00;
}

.setor-card.tipo-transporte .setor-card-icon { color: #455a64; }
.setor-card.tipo-transporte.active {
  background-color: #eceff1;
  border-color: #455a64;
}

.setor-card.tipo-patrimonio .setor-card-icon { color: #6a1b9a; }
.setor-card.tipo-patrimonio.active {
  background-color: #f3e5f5;
  border-color: #6a1b9a;
}

.setor-card.tipo-elevadores .setor-card-icon { color: #00838f; }
.setor-card.tipo-elevadores.active {
  background-color: #e0f7fa;
  border-color: #00838f;
}

/* Área de anexos — alinhada ao formulario_modelo.html */
.dropzone {
  border: 2px dashed #adb5bd;
  border-radius: 12px;
  transition: all 0.2s ease;
  background-color: #fff;
  padding: 2.5rem 1.25rem;
  text-align: center;
  cursor: pointer;
}

.dropzone:hover {
  border-color: var(--portal-accent);
  background-color: rgba(var(--portal-accent-rgb), 0.04);
}

.dropzone.dragover {
  border-color: var(--portal-accent);
  background-color: rgba(var(--portal-accent-rgb), 0.08);
}

.dropzone:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(var(--portal-accent-rgb), 0.15);
}

.file-item {
  background: white;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 8px;
  transition: all 0.2s ease;
}

.file-item:hover {
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.preview-img {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid #dee2e6;
}

/* Contador de descrição */
.desc-counter {
  font-size: 0.875rem;
  color: #6c757d;
}

.desc-counter .desc-status {
  font-weight: 600;
}

.desc-counter.is-muito-curta .desc-status { color: #dc3545; }
.desc-counter.is-curta .desc-status { color: #fd7e14; }
.desc-counter.is-adequada .desc-status { color: #0d6efd; }
.desc-counter.is-boa .desc-status { color: #198754; }

.success-check {
  width: 80px;
  height: 80px;
  background: #d1fae5;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  color: #059669;
  font-size: 2.25rem;
}

.text-purple {
  color: #7b1fa2 !important;
}
