/* ═══════════════════════════════════════════════════
   Intranet Widgets — Frontend CSS
   Design: corporativo, limpo, sem necessidade de scroll
═══════════════════════════════════════════════════ */
:root {
  --iw-primary:    #1e3a5f;
  --iw-accent:     #2e86de;
  --iw-accent2:    #0abde3;
  --iw-text:       #2d3436;
  --iw-muted:      #636e72;
  --iw-bg:         #ffffff;
  --iw-border:     #dfe6e9;
  --iw-radius:     12px;
  --iw-radius-sm:  8px;
  --iw-shadow:     0 4px 24px rgba(30,58,95,.10);
  --iw-shadow-hov: 0 8px 32px rgba(30,58,95,.18);
  --iw-transition: .22s cubic-bezier(.4,0,.2,1);
}

/* ── Widget Outer (wrapper clicável do popup) ─── */
.iw-widget-outer {
  display: block;
  cursor: pointer;
  width: 100%;
}

/* ── Widget Box ─────────────────────────── */
.iw-widget-box {
  display: flex;
  flex-direction: column;  /* padrão: ícone acima do título */
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 18px 16px;
  background: var(--iw-bg);
  border-radius: var(--iw-radius);
  box-shadow: var(--iw-shadow);
  cursor: pointer;
  user-select: none;
  transition: box-shadow var(--iw-transition), transform var(--iw-transition);
  text-decoration: none;
  width: 100%;
  box-sizing: border-box;
}
/* Posições via classe — especificidade alta para vencer tema/Elementor */
.elementor .iw-widget-box.iw-pos-top,
.iw-widget-box.iw-pos-top    { flex-direction: column !important; align-items: center !important; justify-content: center !important; }

.elementor .iw-widget-box.iw-pos-bottom,
.iw-widget-box.iw-pos-bottom { flex-direction: column-reverse !important; align-items: center !important; justify-content: center !important; }

.elementor .iw-widget-box.iw-pos-left,
.iw-widget-box.iw-pos-left   { flex-direction: row !important; align-items: center !important; justify-content: flex-start !important; }

.elementor .iw-widget-box.iw-pos-right,
.iw-widget-box.iw-pos-right  { flex-direction: row-reverse !important; align-items: center !important; justify-content: flex-start !important; }

.iw-widget-box:hover {
  box-shadow: var(--iw-shadow-hov);
  transform: translateY(-3px);
}

/* ── Ícone ──────────────────────────────── */
.iw-widget-icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  /* Cor solida — sem gradiente para o controle do Elementor poder trocar */
  background-color: #2e86de;
  flex-shrink: 0;
  transition: background-color var(--iw-transition);
}
.iw-widget-box:hover .iw-widget-icon-wrap {
  background-color: #1e3a5f;
}
.iw-widget-icon {
  color: #fff;
  font-size: 22px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.iw-widget-icon svg { width: 22px; height: 22px; fill: #fff; }
.iw-widget-icon i   { color: #fff; }

/* ── Título ─────────────────────────────── */
.iw-widget-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--iw-primary);
  text-align: center;
  line-height: 1.3;
  letter-spacing: .2px;
  transition: color var(--iw-transition);
}
.iw-widget-box:hover .iw-widget-title { color: var(--iw-accent); }

/* ── Banner Carrossel ───────────────────── */
.iw-banner-carousel {
  position: relative;
  overflow: hidden;
  border-radius: var(--iw-radius);
  box-shadow: var(--iw-shadow);
}
.iw-banner-slide {
  width: 100%;
  height: 280px;
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  /* Slides inativos ficam absolutos (sem ocupar espaço) e transparentes */
  position: absolute;
  top: 0; left: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity .45s ease;
  z-index: 0;
}
.iw-banner-slide.active {
  opacity: 1;
  pointer-events: auto;
  /* Slide ativo ocupa o espaço e define a altura do carrossel */
  position: relative;
  z-index: 1;
}
/* Garante que o carrossel tenha ao menos a altura padrão */
.iw-banner-carousel { min-height: 280px; }

/* Camada de informações (título + categoria) */
.iw-banner-info {
  position: absolute;
  left: 0; right: 0;
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 1;
}
.iw-info-bottom { bottom: 0; background: linear-gradient(transparent, rgba(0,0,0,.62)); }
.iw-info-top    { top: 0;    background: linear-gradient(rgba(0,0,0,.55), transparent); }
.iw-info-center {
  top: 50%; transform: translateY(-50%);
  background: rgba(0,0,0,.45);
  text-align: center; align-items: center;
}
.iw-banner-titulo {
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  line-height: 1.3;
  margin: 0;
}
.iw-banner-categoria {
  color: rgba(255,255,255,.78);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .8px;
}
.iw-banner-link { position: absolute; inset: 0; z-index: 0; }
.iw-banner-prev, .iw-banner-next {
  position: absolute;
  top: 50%; transform: translateY(-50%);
  background: rgba(255,255,255,.88);
  border: none; border-radius: 50%;
  width: 36px; height: 36px;
  cursor: pointer; font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s, transform .2s;
  z-index: 3;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
.iw-banner-prev { left: 10px; }
.iw-banner-next { right: 10px; }
.iw-banner-prev:hover { background:#fff; transform: translateY(-50%) scale(1.08); }
.iw-banner-next:hover { background:#fff; transform: translateY(-50%) scale(1.08); }
.iw-banner-dots {
  position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 7px; z-index: 3;
}
.iw-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: rgba(255,255,255,.55); cursor: pointer;
  transition: background .2s, transform .2s;
}
.iw-dot.active { background: #fff; transform: scale(1.3); }
.iw-banner-empty {
  padding: 32px; text-align: center;
  background: var(--iw-border); border-radius: var(--iw-radius);
  color: var(--iw-muted);
}

/* ═══════════════════════════════════════════
   Modal Popup Global
═══════════════════════════════════════════ */
#iw-modal-overlay {
  display: none !important;
  position: fixed;
  inset: 0;
  background: rgba(15,25,50,.55);
  backdrop-filter: blur(3px);
  z-index: 999999;
  align-items: center;
  justify-content: center;
}
#iw-modal-overlay.iw-open {
  display: flex !important;
  animation: iw-overlay-in .2s ease;
}
@keyframes iw-overlay-in { from{opacity:0} to{opacity:1} }

#iw-modal-box {
  background: #fff;
  border-radius: var(--iw-radius);
  box-shadow: 0 16px 64px rgba(0,0,0,.22);
  width: 92vw;
  max-width: 860px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  position: relative;          /* necessario para o botao fechar absoluto */
  animation: iw-modal-in .25s cubic-bezier(.4,0,.2,1);
  overflow: hidden;
}
@keyframes iw-modal-in {
  from { transform: translateY(24px) scale(.97); opacity:0; }
  to   { transform: none; opacity:1; }
}

#iw-modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: rgba(0,0,0,.06);
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  color: var(--iw-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: background .15s, color .15s;
}
#iw-modal-close:hover {
  background: rgba(0,0,0,.12);
  color: var(--iw-primary);
}

#iw-modal-content {
  overflow-y: auto;
  flex: 1;
  padding: 20px 28px 24px;   /* top menor pois o close fica sobre o header */
}

/* ── Cabeçalho modal ──── */
.iw-modal-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  padding-right: 40px;   /* espaço para o botão fechar */
  border-bottom: 2px solid var(--iw-border);
}
.iw-modal-header h2 {
  margin: 0;
  font-size: 18px;
  color: var(--iw-primary);
  font-weight: 700;
}

/* ── Barra de busca modal ─── */
.iw-modal-search-wrap {
  margin-bottom: 14px;
}
.iw-modal-search {
  width: 100%;
  padding: 9px 14px;
  border: 1.5px solid var(--iw-border);
  border-radius: var(--iw-radius-sm);
  font-size: 13px;
  outline: none;
  transition: border-color .2s;
  box-sizing: border-box;
}
.iw-modal-search:focus { border-color: var(--iw-accent); }

/* ── Tabela modal ───────── */
.iw-modal-table-wrap {
  overflow-x: auto;
  border-radius: var(--iw-radius-sm);
  border: 1px solid var(--iw-border);
}
.iw-modal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.iw-modal-table thead tr {
  background: var(--iw-primary);
  color: #fff;
}
.iw-modal-table thead th {
  padding: 11px 14px;
  text-align: left;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: .5px;
  text-transform: uppercase;
}
.iw-modal-table tbody tr {
  border-bottom: 1px solid var(--iw-border);
  transition: background .15s;
}
.iw-modal-table tbody tr:last-child { border-bottom: none; }
.iw-modal-table tbody tr:hover { background: #f0f7ff; }
.iw-modal-table td {
  padding: 10px 14px;
  color: var(--iw-text);
  vertical-align: middle;
}
.iw-modal-table td a {
  color: var(--iw-accent);
  text-decoration: none;
  font-weight: 600;
}
.iw-modal-table td a:hover { text-decoration: underline; }
.iw-table-link {
  color: var(--iw-accent);
  text-decoration: none;
  font-weight: 600;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-size: inherit;
  font-family: inherit;
}
.iw-table-link:hover { text-decoration: underline; color: var(--iw-primary); }
.iw-modal-empty {
  text-align: center;
  padding: 28px;
  color: var(--iw-muted);
  font-size: 14px;
}

/* ── MVP popup ──────────── */
.iw-mvp-popup { padding: 8px 0; }
.iw-mvp-logo  { max-width: 160px; margin-bottom: 20px; }
.iw-mvp-block { margin-bottom: 20px; }
.iw-mvp-block h3 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--iw-accent);
  margin: 0 0 6px;
}
.iw-mvp-block p { margin: 0; color: var(--iw-text); line-height: 1.7; font-size: 14px; }

/* ── Vídeo popup ─────────── */
.iw-video-back {
  background: none; border: none;
  color: var(--iw-accent); cursor: pointer;
  font-size: 13px; margin-bottom: 14px;
  display: flex; align-items: center; gap: 4px;
}
.iw-video-frame { width: 100%; aspect-ratio: 16/9; border: none; border-radius: var(--iw-radius-sm); }
.iw-video-desc  { margin-top: 12px; color: var(--iw-text); font-size: 14px; line-height: 1.7; }

/* ── Responsividade ────── */
@media (max-width: 600px) {
  #iw-modal-box { width: 98vw; max-height: 92vh; }
  #iw-modal-content { padding: 18px 14px; }
  .iw-modal-table thead th, .iw-modal-table td { padding: 8px 10px; font-size: 12px; }
}
