:root {
  --komgroup: #003d70;
  --komgroup-strong: #002a4f;
  --komgroup-soft: #e7f0f8;
  --accent: #148995;
  --bg: #f3f6fa;
  --surface: #ffffff;
  --surface-soft: #eef4f8;
  --text: #17202a;
  --muted: #647284;
  --border: #dbe3ec;
  --border-soft: #e8edf3;
  --shadow-soft: 0 10px 28px rgb(31 41 51 / 7%);
  --shadow-hover: 0 14px 34px rgb(0 61 112 / 13%);
  --radius: 12px;
  --radius-small: 8px;
  --sidebar-w: 264px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

/* ============ Sidebar ============ */
.sidebar {
  background: linear-gradient(180deg, var(--komgroup) 0%, var(--komgroup-strong) 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  padding: 22px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 40;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 8px 20px;
  border-bottom: 1px solid rgb(255 255 255 / 14%);
  margin-bottom: 18px;
}
.brand-logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
  background: #fff;
  border-radius: 9px;
  padding: 5px;
}
.brand-label {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: .4px;
}

.sidebar-nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 11px 12px;
  border: none;
  background: transparent;
  color: rgb(255 255 255 / 82%);
  font: inherit;
  font-size: .95rem;
  border-radius: var(--radius-small);
  cursor: pointer;
  text-align: left;
  transition: background .15s, color .15s;
}
.nav-item:hover { background: rgb(255 255 255 / 10%); color: #fff; }
.nav-item.is-active { background: rgb(255 255 255 / 16%); color: #fff; font-weight: 600; }
.nav-item svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }

.nav-toggle .chevron { margin-left: auto; width: 18px; height: 18px; transition: transform .2s; flex-shrink: 0; }
.nav-group.is-open .chevron { transform: rotate(180deg); } /* vira ao abrir, desça ou suba a lista */

/* Botão de grupo com duas linhas: título + seção atual. Como a lista fica
   fechada, essa segunda linha é o que diz onde a pessoa está sem abrir nada. */
.nav-toggle-txt { display: flex; flex-direction: column; gap: 1px; flex: 1; min-width: 0; }
.nav-toggle-txt b { font-weight: inherit; } /* quebra em duas linhas, como os demais itens */
.nav-toggle-txt em {
  font-style: normal; font-size: .74rem; font-weight: 400;
  color: rgb(255 255 255 / 58%);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.nav-toggle-txt em:empty { display: none; }
.nav-toggle.has-active { color: #fff; background: rgb(255 255 255 / 8%); }
.nav-toggle.has-active .nav-toggle-txt em { color: rgb(255 255 255 / 80%); }
.nav-group.is-open > .nav-toggle { background: rgb(255 255 255 / 16%); color: #fff; }

/* ---- Submenu = lista suspensa FLUTUANTE ----
   O painel é posicionado sobre o sidebar em vez de empurrar os itens: abrir um
   grupo não pode reorganizar a coluna (o menu do painel tem 10 seções, e com
   `max-height` tudo abaixo dele descia meia tela). `position: relative` no grupo
   ancora o painel no próprio botão; `sidebar-nav.js` decide se ele desce ou sobe. */
.nav-group { position: relative; }

.submenu {
  position: absolute;
  z-index: 60;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  padding: 6px;
  border-radius: 10px;
  background: #05233f;
  border: 1px solid rgb(255 255 255 / 14%);
  box-shadow: 0 18px 38px rgb(0 0 0 / 42%);
  max-height: min(60vh, 460px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgb(255 255 255 / 24%) transparent;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-6px);
  transition: opacity .16s ease, transform .16s ease, visibility .16s;
}
.nav-group.drop-up .submenu { top: auto; bottom: calc(100% + 6px); transform: translateY(6px); }
.nav-group.is-open .submenu { opacity: 1; visibility: visible; pointer-events: auto; transform: none; }
.submenu::-webkit-scrollbar { width: 8px; }
.submenu::-webkit-scrollbar-thumb { background: rgb(255 255 255 / 24%); border-radius: 999px; }

.nav-subitem {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  margin: 1px 0;
  color: rgb(255 255 255 / 78%);
  font-size: .88rem;
  border-radius: var(--radius-small);
  transition: background .15s, color .15s;
}
.nav-subitem:hover { background: rgb(255 255 255 / 10%); color: #fff; }
.nav-subitem.is-active { background: rgb(255 255 255 / 16%); color: #fff; font-weight: 600; }
.nav-subitem svg { width: 17px; height: 17px; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }

/* Dentro da lista suspensa o painel é estreito: rótulo longo ("Super
   administrador") corta com reticências em vez de virar duas linhas.
   Nos itens de primeiro nível o texto continua quebrando, como sempre foi. */
.nav-subitem > span:not(.adm-badge) {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.sidebar-foot {
  padding-top: 14px;
  margin-top: 14px;
  border-top: 1px solid rgb(255 255 255 / 14%);
  font-size: .75rem;
  color: rgb(255 255 255 / 55%);
  text-align: center;
}

/* ============ Main ============ */
.main { display: flex; flex-direction: column; min-width: 0; }

.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 26px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}
.menu-btn {
  display: none;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-small);
  padding: 7px;
  cursor: pointer;
}
.menu-btn svg { width: 22px; height: 22px; stroke: var(--text); fill: none; stroke-width: 2; stroke-linecap: round; }

.crumbs { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: .9rem; color: var(--muted); }
.crumbs a { color: var(--komgroup); font-weight: 600; }
.crumbs a:hover { text-decoration: underline; }
.crumbs .sep { color: var(--border); }
.crumbs .current { color: var(--text); font-weight: 600; }

.content { padding: 28px 26px 60px; max-width: 1180px; width: 100%; margin: 0 auto; outline: none; }

/* ============ Home ============ */
.hero {
  background: linear-gradient(120deg, var(--komgroup) 0%, var(--komgroup-strong) 100%);
  color: #fff;
  border-radius: var(--radius);
  padding: 40px 36px;
  box-shadow: var(--shadow-soft);
}
.hero h1 { margin: 0 0 10px; font-size: 1.9rem; }
.hero p { margin: 0; max-width: 640px; color: rgb(255 255 255 / 88%); line-height: 1.55; }
.hero .hero-cta {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 22px; padding: 11px 20px;
  background: #fff; color: var(--komgroup);
  border-radius: var(--radius-small); font-weight: 600;
  transition: transform .15s, box-shadow .15s;
}
.hero .hero-cta:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.hero .hero-cta svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.home-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; margin-top: 26px; }
.home-tile {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow-soft);
}
.home-tile h3 { margin: 0 0 6px; font-size: 1.05rem; }
.home-tile p { margin: 0; color: var(--muted); font-size: .9rem; line-height: 1.5; }

/* ============ Section header ============ */
.section-head { margin-bottom: 22px; }
.section-head h1 { margin: 0 0 6px; font-size: 1.55rem; }
.section-head p { margin: 0; color: var(--muted); }

/* ============ Cards de lançamento ============ */
.launch-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 22px; }
.launch-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow-soft); cursor: pointer;
  display: flex; flex-direction: column;
  transition: transform .16s, box-shadow .16s, border-color .16s;
}
.launch-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); border-color: var(--komgroup-soft); }
/* tag de marca (logo da marca do lançamento) */
.brand-tag {
  display: inline-flex; align-items: center; justify-content: center;
  background: rgb(255 255 255 / 90%); border-radius: 999px; height: 24px; padding: 0 9px;
  box-shadow: 0 1px 4px rgb(0 0 0 / 18%); backdrop-filter: blur(2px);
}
.brand-tag img { height: 11px; width: auto; display: block; }

.launch-cover { aspect-ratio: 1920 / 700; background: var(--surface-soft); position: relative; overflow: hidden; }
.detail-hero-text .brand-tag { margin-bottom: 14px; }
.launch-cover img { width: 100%; height: 100%; object-fit: contain; object-position: center; }
.launch-cover .cover-fallback {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(120deg, var(--komgroup) 0%, var(--komgroup-strong) 100%);
}
.launch-cover .cover-fallback svg { width: 54px; height: 54px; stroke: #fff; opacity: .85; fill: none; stroke-width: 1.5; }
.launch-body { padding: 18px 20px 20px; }
/* tag de marca no corpo do card (mesmo padrão dos cards de blog/redes sociais) */
.launch-body .pc-tags { margin-bottom: 8px; }
.launch-body h3 { margin: 0 0 8px; font-size: 1.15rem; }
.launch-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.chip {
  font-size: .74rem; font-weight: 600; color: var(--komgroup);
  background: var(--komgroup-soft); padding: 4px 10px; border-radius: 999px;
}
.launch-open { margin-top: 16px; display: inline-flex; align-items: center; gap: 6px; color: var(--komgroup); font-weight: 600; font-size: .9rem; }
.launch-open svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ============ Detalhe do lançamento ============ */
.back-bar { margin-bottom: 16px; }
.back-link {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px; border-radius: var(--radius-small);
  border: 1px solid var(--border); background: var(--surface);
  color: var(--komgroup); font-weight: 600; font-size: .9rem;
  box-shadow: var(--shadow-soft); transition: background .15s, transform .15s;
}
.back-link:hover { background: var(--komgroup-soft); transform: translateX(-2px); }
.back-link svg { width: 17px; height: 17px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.detail-hero {
  position: relative; border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow-soft); margin-bottom: 26px;
  min-height: 220px; display: flex; align-items: flex-end;
  background: var(--komgroup-strong) center / cover no-repeat;
}
.detail-hero::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgb(0 42 79 / 20%) 0%, rgb(0 30 58 / 82%) 100%);
}
.detail-hero .detail-hero-text { position: relative; z-index: 1; padding: 26px 30px; color: #fff; }
.detail-hero h1 { margin: 0 0 6px; font-size: 1.7rem; text-shadow: 0 2px 12px rgb(0 0 0 / 45%); }
.detail-hero p { margin: 0; font-size: .95rem; color: rgb(255 255 255 / 90%); text-shadow: 0 1px 8px rgb(0 0 0 / 45%); }

.category { margin-bottom: 30px; }
.category-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.category-head .cat-icon {
  width: 38px; height: 38px; border-radius: 10px; flex-shrink: 0;
  background: var(--komgroup-soft); display: flex; align-items: center; justify-content: center;
}
.category-head .cat-icon svg { width: 20px; height: 20px; stroke: var(--komgroup); fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.category-head h2 { margin: 0; font-size: 1.15rem; }
.category-head .count { margin-left: auto; color: var(--muted); font-size: .82rem; }

/* grid de arquivos */
.files-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }

/* card de arquivo genérico (pdf/pptx/doc) */
.file-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px; display: flex; gap: 14px;
  box-shadow: var(--shadow-soft); transition: transform .15s, box-shadow .15s;
}
.file-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.file-icon {
  width: 44px; height: 44px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: .7rem; font-weight: 700; color: #fff; letter-spacing: .3px;
}
.file-icon.pdf { background: #c0392b; }
.file-icon.apresentacao { background: #d35400; }
.file-icon.documento { background: #2c5aa0; }
.file-icon.arquivo { background: #607080; }
.file-info { min-width: 0; flex: 1; }
.file-info .name { font-weight: 600; font-size: .92rem; word-break: break-word; line-height: 1.35; }
.file-info .size { color: var(--muted); font-size: .78rem; margin-top: 3px; }
.file-actions { display: flex; gap: 8px; margin-top: 10px; }
.file-actions a {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: .8rem; font-weight: 600; padding: 6px 12px; border-radius: 7px;
  border: 1px solid var(--border); color: var(--komgroup); background: var(--surface);
  transition: background .15s;
}
.file-actions a:hover { background: var(--komgroup-soft); }
.file-actions a.primary { background: var(--komgroup); color: #fff; border-color: var(--komgroup); }
.file-actions a.primary:hover { background: var(--komgroup-strong); }
.file-actions svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* vídeos */
.video-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 18px; }
/* seção de destaque "Comece por aqui": vídeo grande e centralizado */
.video-grid.is-featured { grid-template-columns: 1fr; justify-items: center; }
.video-grid.is-featured .video-card { max-width: 860px; width: 100%; }
.video-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-soft); }
.video-card video { width: 100%; display: block; background: #000; aspect-ratio: 16 / 9; }
.video-card .video-cap { padding: 11px 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.video-card .video-cap .name { font-weight: 600; font-size: .9rem; line-height: 1.3; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.video-card .video-cap .cap-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.video-card .video-cap .size { color: var(--muted); font-size: .78rem; }
.video-card .video-cap a {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .8rem; font-weight: 600; padding: 6px 12px; border-radius: 7px;
  background: var(--komgroup); color: #fff; transition: background .15s;
}
.video-card .video-cap a:hover { background: var(--komgroup-strong); }
.video-card .video-cap a svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* imagens — mesma grade dos vídeos, para ficarem do mesmo tamanho */
.image-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 18px; }
.image-thumb {
  position: relative;
  margin: 0;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-small);
  overflow: hidden; box-shadow: var(--shadow-soft);
  transition: transform .15s, box-shadow .15s;
}
.image-thumb:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.image-thumb .thumb-open { display: block; width: 100%; border: none; padding: 0; cursor: zoom-in; background: var(--surface-soft); }
.image-thumb .thumb-open img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; }
.image-thumb .thumb-baixar {
  position: absolute; top: 8px; right: 8px; z-index: 2;
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 10px; font-size: .74rem; font-weight: 600;
  color: #fff; background: var(--komgroup); border-radius: 7px;
  box-shadow: 0 1px 5px rgb(0 0 0 / 28%);
  transition: background .15s;
}
.image-thumb .thumb-baixar:hover { background: var(--komgroup-strong); }
.image-thumb .thumb-baixar svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* lightbox */
.lightbox {
  position: fixed; inset: 0; background: rgb(6 14 24 / 90%);
  display: flex; align-items: center; justify-content: center; z-index: 100; padding: 30px;
}
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 94vw; max-height: 90vh; object-fit: contain; border-radius: 8px; }
.lightbox-close {
  position: absolute; top: 18px; right: 24px; background: none; border: none;
  color: #fff; font-size: 2.4rem; line-height: 1; cursor: pointer;
}

.empty { color: var(--muted); font-size: .9rem; padding: 30px; text-align: center; background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius); }

/* ============ Responsivo ============ */
.backdrop { display: none; }
.backdrop[hidden] { display: none; }

@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; left: 0; top: 0; width: 82%; max-width: 300px;
    height: 100dvh; overflow-y: auto; -webkit-overflow-scrolling: touch;
    /* respeita a barra de navegação do sistema (Android/iOS): o perfil nunca fica atrás dela */
    padding-bottom: calc(22px + env(safe-area-inset-bottom, 0px));
    transform: translateX(-100%); transition: transform .25s ease;
    box-shadow: 0 0 40px rgb(0 0 0 / 30%);
  }
  .sidebar.is-open { transform: translateX(0); }
  .menu-btn { display: inline-flex; }
  .backdrop { display: block; position: fixed; inset: 0; background: rgb(6 14 24 / 45%); z-index: 30; }
  .content { padding: 22px 16px 50px; }
  .hero { padding: 30px 22px; }
  .hero h1 { font-size: 1.5rem; }
}

@media (max-width: 640px) {
  .crumbs { display: none; }
  .image-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
}

/* ============ Botão "Ir para o site" (seção Materiais do site) ============ */
.site-cta-wrap { margin-top: 16px; }
.site-cta {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 20px; border-radius: var(--radius-small);
  background: var(--komgroup); color: #fff; font-weight: 600; font-size: .92rem;
  box-shadow: var(--shadow-soft); transition: background .15s, transform .15s;
}
.site-cta:hover { background: var(--komgroup-strong); transform: translateY(-2px); }
.site-cta svg { width: 17px; height: 17px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ============ Estado de carregamento ============ */
.loading { color: var(--muted); padding: 40px; text-align: center; font-size: .95rem; }

/* ============ Rodapé da sidebar: acesso admin ============ */
.admin-trigger {
  width: 100%; border: none; background: transparent; cursor: pointer;
  color: rgb(255 255 255 / 55%); font: inherit; font-size: .75rem; text-align: center;
  padding: 4px; border-radius: 6px; transition: color .15s, background .15s;
}
.admin-trigger:hover { color: #fff; background: rgb(255 255 255 / 10%); }

/* ============ Modal (popup de acesso administrativo) ============ */
.modal {
  position: fixed; inset: 0; z-index: 120; padding: 20px;
  display: flex; align-items: center; justify-content: center;
  background: rgb(6 14 24 / 55%); backdrop-filter: blur(2px);
}
.modal[hidden] { display: none; }
.modal-card {
  position: relative; background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow-hover); padding: 30px 28px; width: 100%; max-width: 360px;
}
.modal-close {
  position: absolute; top: 12px; right: 16px; border: none; background: none;
  font-size: 1.7rem; line-height: 1; color: var(--muted); cursor: pointer;
}
.modal-card h2 { margin: 0 0 6px; font-size: 1.25rem; color: var(--text); }
.modal-sub { margin: 0 0 18px; color: var(--muted); font-size: .9rem; }
.modal-input {
  width: 100%; padding: 12px 14px; font: inherit; font-size: 1rem;
  border: 1px solid var(--border); border-radius: var(--radius-small); background: var(--surface-soft);
}
.modal-input:focus { outline: none; border-color: var(--komgroup); background: #fff; }
.modal-erro { color: #c0392b; font-size: .85rem; margin: 10px 0 0; }
.modal-btn {
  width: 100%; margin-top: 16px; padding: 12px; border: none; border-radius: var(--radius-small);
  background: var(--komgroup); color: #fff; font: inherit; font-weight: 600; font-size: 1rem; cursor: pointer;
  transition: background .15s;
}
.modal-btn:hover { background: var(--komgroup-strong); }
.modal-btn:disabled { opacity: .7; cursor: default; }

/* ============ Avaliação (seção + prova) ============ */
.aval-card {
  background: linear-gradient(120deg, var(--komgroup-soft), #f3f8fc);
  border: 1px solid var(--komgroup-soft); border-radius: var(--radius);
  padding: 22px 24px; display: flex; flex-direction: column; align-items: flex-start; gap: 14px;
}
.aval-card p { margin: 0; color: var(--text); font-size: .95rem; }
.aval-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 22px; border: none; border-radius: var(--radius-small);
  background: var(--komgroup); color: #fff; font: inherit; font-weight: 600; font-size: .95rem; cursor: pointer;
  transition: background .15s, transform .15s;
}
.aval-btn:hover { background: var(--komgroup-strong); transform: translateY(-2px); }
.aval-btn svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.aval-btn.is-disabled { background: #c7d0da; color: #f4f7fa; cursor: not-allowed; transform: none; }
.aval-btn.is-disabled:hover { background: #c7d0da; transform: none; }

/* Grupos clicáveis do produto (Materiais de estudo / Materiais de apoio / Avaliação (Prova)) */
.prod-group { border: 1px solid var(--border); border-radius: var(--radius); margin: 16px 0; overflow: hidden; background: var(--surface); }
.prod-group-h { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 20px; background: var(--surface); border: none; cursor: pointer; font: inherit; font-size: 1.1rem; font-weight: 700; color: var(--text); }
.prod-group-h .chevron { width: 20px; height: 20px; stroke: var(--muted); fill: none; stroke-width: 2; transition: transform .2s; flex: 0 0 auto; }
.prod-group.is-open .prod-group-h .chevron { transform: rotate(180deg); }
/* respiro entre o título do grupo e a 1ª seção (.category não tem margem superior) */
.prod-group-body { display: none; padding: 22px 20px 18px; border-top: 1px solid var(--border-soft); }
.prod-group.is-open .prod-group-body { display: block; }
/* a última seção não soma sua margem ao padding de baixo, senão o grupo fica torto */
.prod-group-body .category:last-child { margin-bottom: 0; }
/* realce quando a aba abre e a tela ancora nela (só uma aba aberta por vez) */
@keyframes prod-anchor {
  0%   { box-shadow: 0 0 0 0 rgba(0, 61, 112, 0); }
  25%  { box-shadow: 0 0 0 4px rgba(0, 61, 112, .32); }
  100% { box-shadow: 0 0 0 0 rgba(0, 61, 112, 0); }
}
.prod-group.is-anchor { animation: prod-anchor 1.2s ease-out; }

/* ---- Avaliação bloqueada: painel de expectativa (contagem regressiva) ----
   Painel escuro e centralizado para o momento parecer um evento, não um aviso. */
.aval-locked {
  position: relative; overflow: hidden; isolation: isolate;
  align-items: center; text-align: center; gap: 10px;
  padding: 30px 24px 26px;
  background: radial-gradient(120% 140% at 50% -20%, #0a5a95 0%, var(--komgroup) 45%, var(--komgroup-strong) 100%);
  border-color: var(--komgroup-strong);
  box-shadow: var(--shadow-hover);
}
/* brilho que atravessa o painel devagar (dá vida sem distrair) */
.aval-brilho {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(105deg, transparent 35%, rgb(255 255 255 / 13%) 50%, transparent 65%);
  background-size: 300% 100%;
  animation: avalBrilho 6s ease-in-out infinite;
}
@keyframes avalBrilho { 0% { background-position: 140% 0; } 100% { background-position: -40% 0; } }

.aval-selo {
  display: inline-flex; align-items: center; justify-content: center;
  width: 54px; height: 54px; border-radius: 50%;
  background: rgb(255 255 255 / 12%); border: 1px solid rgb(255 255 255 / 22%);
  box-shadow: 0 0 0 8px rgb(255 255 255 / 5%);
}
.aval-selo svg { width: 26px; height: 26px; stroke: #ffd479; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.aval-kicker {
  font-size: .74rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase;
  color: #7fd4e0;
}
.aval-titulo { margin: 0; color: #fff; font-size: clamp(1.15rem, 3.6vw, 1.5rem); line-height: 1.25; }
.aval-locked .aval-frase { color: rgb(255 255 255 / 82%); font-size: .95rem; line-height: 1.6; max-width: 46ch; }
.aval-locked .aval-frase strong { color: #fff; }
.aval-locked .aval-frase-sub { margin: 2px 0 0; color: rgb(255 255 255 / 58%); font-size: .82rem; }

.aval-cron { display: flex; align-items: flex-start; justify-content: center; gap: 6px; flex-wrap: wrap; margin: 8px 0 6px; }
.cron-box {
  display: flex; flex-direction: column; align-items: center; min-width: 74px;
  padding: 12px 10px 10px;
  background: rgb(255 255 255 / 10%); border: 1px solid rgb(255 255 255 / 16%);
  border-radius: 10px; color: #fff;
  backdrop-filter: blur(2px);
}
.cron-box b { font-size: clamp(1.7rem, 6vw, 2.3rem); font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.cron-box i { font-style: normal; font-size: .66rem; text-transform: uppercase; letter-spacing: .1em; opacity: .72; margin-top: 6px; }
.cron-sep { color: rgb(255 255 255 / 30%); font-size: 1.6rem; font-weight: 700; line-height: 1; padding-top: 12px; }
/* só os segundos pulsam — marca a passagem do tempo sem poluir */
.cron-box.is-seg b { animation: cronPulso 1s ease-in-out infinite; }
@keyframes cronPulso { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }

/* Cronômetro de encerramento: mesma estrutura do de liberação, mas vive dentro do
   .aval-card claro (não do painel escuro .aval-locked), então precisa de contraste próprio. */
.aval-cron-fecha .cron-box {
  background: #fff; border: 1px solid var(--border); color: var(--komgroup-strong);
  box-shadow: var(--shadow-soft); backdrop-filter: none;
}
.aval-cron-fecha .cron-box i { color: var(--muted); opacity: 1; }
.aval-cron-fecha .cron-sep { color: var(--muted); opacity: .5; }

.aval-locked .aval-btn.is-disabled { background: rgb(255 255 255 / 14%); color: rgb(255 255 255 / 70%); border: 1px solid rgb(255 255 255 / 18%); }
.aval-locked .aval-btn.is-disabled:hover { background: rgb(255 255 255 / 14%); }

@media (prefers-reduced-motion: reduce) {
  .aval-brilho, .cron-box.is-seg b { animation: none; }
  .submenu { transition: none; }
  .nav-toggle .chevron { transition: none; }
}
@media (max-width: 420px) {
  .cron-sep { display: none; }
  .cron-box { min-width: 66px; }
}

/* ============ Prova / avaliação em tela cheia (mobile-first) ============ */
/* Faixa fixa do modo pré-visualização (admin) */
.pv-preview-faixa {
  display: flex; align-items: center; gap: 8px; margin: -4px 0 18px;
  background: #fff7e6; border: 1px solid #f2c877; color: #8a5a00;
  border-radius: var(--radius-small); padding: 10px 14px; font-size: .85rem; font-weight: 600;
}
.pv-preview-faixa svg { width: 18px; height: 18px; flex: 0 0 auto; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Cartões de tela (capa, questão, transição, resultado, mensagem) */
.pv-cover, .pv-run, .pv-transicao, .pv-result, .pv-msg {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-soft); padding: 24px 20px; max-width: 680px; margin: 0 auto;
}
.pv-cover .brand-tag { margin: 0 0 12px; }
.pv-cover h1, .pv-transicao h1, .pv-result h1, .pv-msg h1 { margin: 0 0 10px; font-size: clamp(1.4rem, 5vw, 2rem); color: var(--text); line-height: 1.2; }
.pv-kicker { display: inline-block; font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); margin-bottom: 6px; }
.pv-lead { margin: 0 0 16px; color: var(--muted); font-size: 1rem; line-height: 1.6; }
.pv-lead strong { color: var(--text); }
.pv-mini { margin: 8px 0 16px; color: var(--muted); font-size: .88rem; }

/* Estatísticas de tentativas na capa */
.pv-stats { display: grid; grid-template-columns: 1fr; gap: 12px; margin: 4px 0 18px; }
.pv-stat { background: var(--surface-soft); border: 1px solid var(--border-soft); border-radius: var(--radius-small); padding: 14px 16px; }
.pv-stat-n { display: block; font-size: 1.7rem; font-weight: 800; color: var(--komgroup); line-height: 1; }
.pv-stat-l { display: block; margin-top: 4px; font-size: .82rem; color: var(--muted); }
.pv-chip { display: inline-block; background: var(--komgroup-soft); color: var(--komgroup-strong); font-weight: 600; font-size: .82rem; padding: 8px 14px; border-radius: 999px; margin: 2px 0 16px; }

/* Aviso de prova atualizada: as respostas anteriores ficaram salvas e a pessoa retoma
   de onde parou (aparece na capa, no lugar de um "refazer do zero"). */
.pv-retomar {
  background: var(--komgroup-soft); border: 1px solid var(--border-soft);
  border-left: 3px solid var(--komgroup); border-radius: var(--radius-small);
  padding: 14px 16px; margin: 4px 0 18px; text-align: left;
  color: var(--muted); font-size: .92rem; line-height: 1.6;
}
.pv-retomar strong { color: var(--text); }

.pv-regras { margin: 0 0 20px; padding-left: 18px; color: var(--muted); font-size: .9rem; line-height: 1.6; }
.pv-regras li { margin: 4px 0; }
.pv-regras strong { color: var(--text); }

/* Campo de CPF na capa */
.pv-af { margin: 0 0 12px; }
.pv-af label { display: block; font-weight: 600; font-size: .85rem; margin-bottom: 6px; color: var(--text); }
.pv-af input { width: 100%; padding: 13px 14px; font: inherit; font-size: 1rem; box-sizing: border-box; border: 1px solid var(--border); border-radius: var(--radius-small); background: var(--surface-soft); }
.pv-af input:focus { outline: none; border-color: var(--komgroup); background: #fff; }

/* Cabeçalho da questão: etapa + contador */
.pv-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.pv-etapa { font-size: .78rem; font-weight: 700; padding: 6px 12px; border-radius: 999px; }
.pv-etapa-tecnica { background: var(--komgroup-soft); color: var(--komgroup-strong); }
.pv-etapa-comercial { background: #e6f7f4; color: #06705f; }
.pv-cont { font-size: .84rem; color: var(--muted); font-weight: 600; }

/* Barra de progresso da prova inteira */
.pv-bar { height: 10px; background: var(--surface-soft); border-radius: 999px; overflow: hidden; margin-bottom: 20px; border: 1px solid var(--border-soft); }
.pv-bar-fill { height: 100%; background: linear-gradient(90deg, var(--komgroup), var(--accent)); border-radius: 999px; width: 0; transition: width .35s ease; }

.pv-perg { margin: 0 0 16px; font-weight: 700; font-size: 1.1rem; line-height: 1.4; color: var(--text); }
.pv-alts { display: flex; flex-direction: column; gap: 10px; }
.pv-alt {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px;
  padding: 12px 14px; text-align: left; cursor: pointer; font: inherit; font-size: 1rem; color: var(--text);
  background: var(--surface); border: 2px solid var(--border); border-radius: var(--radius); box-sizing: border-box;
  transition: border-color .12s, background .12s, transform .08s;
}
.pv-alt:hover { border-color: var(--komgroup); background: var(--surface-soft); }
.pv-alt:active { transform: scale(.99); }
.pv-letra {
  flex: 0 0 auto; width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .9rem; background: var(--surface-soft); color: var(--muted); border: 1px solid var(--border);
}
.pv-alt-txt { flex: 1; line-height: 1.4; overflow-wrap: anywhere; }
.pv-alt.is-sel { border-color: var(--komgroup); background: var(--komgroup-soft); }
.pv-alt.is-sel .pv-letra { background: var(--komgroup); color: #fff; border-color: var(--komgroup); }

.pv-erro { color: #c0392b; font-size: .88rem; margin: 12px 0 0; }

/* Navegação (voltar / próxima) */
.pv-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 20px; }
.pv-nav-center { justify-content: center; flex-wrap: wrap; }
.pv-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px;
  padding: 13px 26px; border: none; border-radius: var(--radius-small); cursor: pointer;
  background: var(--komgroup); color: #fff; font: inherit; font-weight: 700; font-size: 1rem; text-decoration: none;
  transition: background .15s, transform .12s;
}
.pv-btn:hover { background: var(--komgroup-strong); transform: translateY(-1px); }
.pv-btn-ghost { background: transparent; color: var(--komgroup); border: 1px solid var(--border); }
.pv-btn-ghost:hover { background: var(--surface-soft); color: var(--komgroup-strong); }
/* CTA de destaque (ex.: receber certificado): sem ícone, um pouco maior e com sombra p/ chamar atenção */
.pv-btn-cta { font-size: 1.05rem; padding: 15px 30px; box-shadow: 0 8px 22px rgba(0, 61, 112, .28); }
.pv-btn-cta:hover { box-shadow: 0 10px 26px rgba(0, 61, 112, .34); }

/* Transição de etapa */
.pv-transicao { text-align: center; }
.pv-transicao .pv-lead, .pv-result .pv-lead, .pv-msg .pv-lead { max-width: 46ch; margin-left: auto; margin-right: auto; }
.pv-emoji { font-size: 3rem; line-height: 1; margin-bottom: 6px; }
.pv-transicao .pv-btn { margin-top: 8px; }

/* Resultado */
.pv-result { text-align: center; }
.pv-res-badge {
  width: 108px; height: 108px; margin: 4px auto 16px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 1.9rem; font-weight: 800; color: #fff;
}
.pv-res-badge.is-ok { background: linear-gradient(135deg, #00b06b, #06705f); }
.pv-res-badge.is-no { background: linear-gradient(135deg, #e67e22, #c0392b); }
.pv-scores { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 18px 0 4px; }
.pv-score { background: var(--surface-soft); border: 1px solid var(--border-soft); border-radius: var(--radius-small); padding: 12px 8px; }
.pv-score-l { display: block; font-size: .76rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.pv-score-v { display: block; margin-top: 4px; font-size: 1.2rem; font-weight: 800; color: var(--text); }
.pv-score.is-total .pv-score-v { color: var(--komgroup); }

.pv-msg { text-align: center; }
.pv-msg .pv-btn { margin-top: 6px; }

/* Confete (canvas por cima de tudo) */
.pv-confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 200; }

/* Aviso "prova atualizada" (só recarregar) */
.pv-reload-ov { position: fixed; inset: 0; z-index: 300; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgb(6 14 24 / 65%); }
.pv-reload-card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-hover); padding: 30px 28px; max-width: 420px; text-align: center; }
.pv-reload-card h2 { margin: 0 0 10px; color: var(--text); }
.pv-reload-card p { margin: 0 0 20px; color: var(--muted); line-height: 1.6; }

@media (min-width: 768px) {
  .pv-cover, .pv-run, .pv-transicao, .pv-result, .pv-msg { padding: 34px 36px; }
  .pv-stats { grid-template-columns: 1fr 1fr; }
  .pv-alt { padding: 14px 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .pv-bar-fill, .pv-btn, .pv-alt { transition: none; }
  .prod-group.is-anchor { animation: none; }
}

/* ============ Identidade do representante (topbar) ============ */
.rep-id { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.rep-id .rep-nome { font-size: .88rem; font-weight: 600; color: var(--text); max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rep-id .rep-sair { border: 1px solid var(--border); background: var(--surface); color: var(--komgroup); font: inherit; font-size: .82rem; font-weight: 600; padding: 6px 12px; border-radius: var(--radius-small); cursor: pointer; }
.rep-id .rep-sair:hover { background: var(--komgroup-soft); }

/* ============ Gate de login (Área do Representante) ============ */
.gate { display: flex; justify-content: center; padding: 30px 0; }
.gate-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-soft); padding: 32px 30px; width: 100%; max-width: 420px; }
.gate-card h1 { margin: 0 0 8px; font-size: 1.5rem; }
.gate-sub { margin: 0 0 18px; color: var(--muted); font-size: .92rem; line-height: 1.5; }
.gate-card .af { margin-bottom: 14px; }
.gate-card .af label { display: block; font-weight: 600; font-size: .85rem; margin-bottom: 5px; }
.gate-card .af input { width: 100%; padding: 12px 14px; font: inherit; font-size: 1rem; border: 1px solid var(--border); border-radius: var(--radius-small); background: var(--surface-soft); }
.gate-card .af input:focus { outline: none; border-color: var(--komgroup); background: #fff; }
.gate-card #gCod { letter-spacing: .5em; text-align: center; font-size: 1.4rem; font-weight: 700; }
.gate-link { display: block; width: 100%; margin-top: 12px; background: none; border: none; color: var(--muted); font: inherit; font-size: .84rem; cursor: pointer; text-decoration: underline; }

/* ============ Login / Solicitação de acesso ============ */
body.is-login { background: linear-gradient(135deg, var(--komgroup) 0%, var(--komgroup-strong) 100%); }
.login-view {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}
.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border-radius: 16px;
  box-shadow: 0 24px 60px rgb(0 0 0 / 28%);
  padding: 32px 28px;
}
.login-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
}
.login-brand img { width: 34px; height: auto; }
.login-brand span { font-weight: 700; color: var(--komgroup); letter-spacing: .01em; }
.login-card h1 { font-size: 1.35rem; margin: 0 0 6px; color: var(--text); }
.login-sub { margin: 0 0 18px; color: var(--muted); font-size: .95rem; line-height: 1.5; }
.login-info {
  margin: 0 0 16px; padding: 10px 12px; border-radius: var(--radius-small);
  background: var(--komgroup-soft); color: var(--komgroup-strong); font-size: .9rem;
}
.login-card .af { margin-bottom: 14px; }
.login-card .af label { display: block; font-size: .82rem; color: var(--muted); margin-bottom: 6px; }
.login-input {
  width: 100%; padding: 12px 14px; font-size: 1rem;
  border: 1px solid var(--border); border-radius: var(--radius-small);
  background: var(--surface); color: var(--text); font-family: inherit;
}
.login-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgb(20 137 149 / 16%); }
.input-senha { -webkit-text-security: disc; text-security: disc; letter-spacing: .08em; }
.login-erro { color: #c0392b; font-size: .88rem; margin: 0 0 14px; }
.login-btn {
  width: 100%; padding: 13px 16px; font-size: 1rem; font-weight: 600; cursor: pointer;
  border: 0; border-radius: var(--radius-small); color: #fff;
  background: linear-gradient(180deg, var(--komgroup) 0%, var(--komgroup-strong) 100%);
  transition: filter .15s ease;
}
.login-btn:hover { filter: brightness(1.08); }
.login-btn:disabled { opacity: .7; cursor: default; }
.login-links {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-top: 16px;
}
.login-link {
  background: none; border: 0; padding: 0; cursor: pointer;
  color: var(--accent); font-size: .88rem; font-family: inherit;
}
.login-link:hover { text-decoration: underline; }
.login-card select.login-input { appearance: none; background-image: none; }

/* O atributo hidden deve SEMPRE esconder. Sem isto, .app-shell{display:grid} e
   .login-view{display:flex} ignoram o hidden e deixam os dois visiveis ao mesmo
   tempo (app logado fica coberto por um overlay vazio -> tela em branco). */
[hidden] { display: none !important; }

/* ============ Sem cabeçalho: botão flutuante do menu (mobile) ============ */
.menu-fab {
  display: none;
  position: fixed; top: 12px; left: 12px; z-index: 25;
  width: 42px; height: 42px; align-items: center; justify-content: center;
  border: 1px solid var(--border); background: var(--surface);
  border-radius: 10px; box-shadow: var(--shadow-soft); cursor: pointer;
}
.menu-fab svg { width: 22px; height: 22px; stroke: var(--text); fill: none; stroke-width: 2; stroke-linecap: round; }

/* ============ Conta (sidebar) ============ */
.sidebar-foot { text-align: left; }
.conta-ava {
  width: 30px; height: 30px; border-radius: 50%; flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgb(255 255 255 / 16%); color: #fff; font-size: .78rem; font-weight: 700; overflow: hidden;
}
.conta-ava img { width: 100%; height: 100%; object-fit: cover; }
.conta-nome { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; }

/* ============ Configurações da conta ============ */
.conf-wrap { max-width: 760px; }
.conf-wrap h1 { font-size: 1.4rem; margin: 0 0 18px; color: var(--text); }
.conf-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 24px; box-shadow: var(--shadow-soft); }
.conf-foto { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.conf-ava { width: 76px; height: 76px; border-radius: 50%; background: var(--komgroup-soft); color: var(--komgroup); display: flex; align-items: center; justify-content: center; font-size: 1.5rem; font-weight: 700; overflow: hidden; flex: 0 0 auto; }
.conf-ava img { width: 100%; height: 100%; object-fit: cover; }
.conf-file { display: inline-block; cursor: pointer; padding: 8px 14px; border: 1px solid var(--border); border-radius: 8px; font-size: .9rem; font-weight: 600; color: var(--komgroup); background: var(--surface); }
.conf-file:hover { background: var(--komgroup-soft); }
.conf-hint { margin: 6px 0 0; font-size: .8rem; color: var(--muted); }
.conf-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.conf-card .af { margin-bottom: 12px; }
.conf-card .af label { display: block; font-size: .82rem; color: var(--muted); margin-bottom: 6px; }
.conf-sobre { resize: vertical; font-family: inherit; }
.conf-count { font-weight: 400; color: var(--muted); font-size: .8rem; }
.conf-ok { color: #1a7f4b; font-size: .9rem; margin: 0 0 12px; }
.conf-btn { max-width: 260px; }

@media (max-width: 900px) {
  /* Sem cabecalho: o botao flutuante e o topo do conteudo respeitam a barra do
     navegador / notch (safe-area) para nao ficarem cobertos no mobile. */
  .menu-fab { display: inline-flex; top: calc(12px + env(safe-area-inset-top, 0px)); }
  .content { padding-top: calc(74px + env(safe-area-inset-top, 0px)); }
  .sidebar { padding-top: calc(22px + env(safe-area-inset-top, 0px)); }
}
@media (max-width: 640px) {
  .conf-grid { grid-template-columns: 1fr; }
}

/* Itens do sidebar que sao <button> (Configuracoes, Sair) herdam o visual dos <a>. */
button.nav-subitem { border: none; background: transparent; font: inherit; font-size: .88rem; width: 100%; cursor: pointer; }

/* ============ Home portal (novidades estilo revista) ============ */
.portal { max-width: 1180px; }
.portal-top { margin-bottom: 18px; }
.portal-title { font-size: 1.7rem; margin: 0 0 4px; color: var(--text); }
.portal-sub { margin: 0; color: var(--muted); }

.ph-hero {
  display: block; position: relative; min-height: 340px; border-radius: 16px; overflow: hidden;
  background: var(--komgroup-strong) center/cover no-repeat; margin-bottom: 28px; box-shadow: var(--shadow-soft);
}
.ph-hero-ov {
  position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end; padding: 28px; color: #fff;
  background: linear-gradient(to top, rgb(6 14 24 / 84%) 0%, rgb(6 14 24 / 30%) 55%, rgb(6 14 24 / 4%) 100%);
}

/* Carrossel de banners por marca (Home) */
.hero-carousel { position: relative; margin-bottom: 28px; border-radius: 16px; overflow: hidden; box-shadow: var(--shadow-soft); }
.hero-slide { display: none; position: relative; min-height: 340px; background: var(--komgroup-strong) center/cover no-repeat; text-decoration: none; }
.hero-slide.is-active { display: block; }
.hero-logo { align-items: center; justify-content: center; }
.hero-logo.is-active { display: flex; }
.hero-logo img { max-width: 62%; max-height: 55%; object-fit: contain; }
.hero-bg-komeco { background: linear-gradient(135deg, #fff 0%, #ffe4e2 100%); }
.hero-bg-uzoo { background: linear-gradient(135deg, #fff 0%, #e2f5f6 100%); }
.hero-bg-finottato { background: linear-gradient(135deg, #fafafa 0%, #e9ebed 100%); }
.hero-logo .ph-hero-ov { display: none; }
.hero-arrow { position: absolute; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border-radius: 50%; border: none; background: rgb(255 255 255 / 88%); color: #17202a; font-size: 1.6rem; line-height: 1; cursor: pointer; z-index: 3; display: flex; align-items: center; justify-content: center; }
.hero-prev { left: 12px; } .hero-next { right: 12px; }
.hero-dots { position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); display: flex; gap: 8px; z-index: 3; }
.hero-dot { width: 10px; height: 10px; border-radius: 50%; border: none; background: rgb(255 255 255 / 55%); cursor: pointer; padding: 0; }
.hero-dot.is-active { background: #fff; }
@media (max-width: 640px) { .hero-slide { min-height: 240px; } }
.ph-badge {
  align-self: flex-start; background: var(--accent); color: #fff; font-size: .72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em; padding: 4px 10px; border-radius: 20px; margin-bottom: 12px;
}
.ph-hero-ov h2 { font-size: 1.7rem; line-height: 1.2; margin: 0 0 10px; max-width: 720px; }
.ph-fonte { font-size: .85rem; opacity: .92; display: inline-flex; align-items: center; gap: 6px; }
.ph-fonte svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 2; }
.ph-hero:hover .ph-hero-ov h2 { text-decoration: underline; }

.portal-sec { margin-bottom: 30px; }
.portal-sec-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; border-left: 4px solid var(--accent); padding-left: 12px; }
.portal-sec-h h2 { font-size: 1.15rem; margin: 0; color: var(--text); }
.portal-more { font-size: .85rem; color: var(--komgroup); font-weight: 600; display: inline-flex; align-items: center; gap: 5px; }
.portal-more svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 2; }

.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px; }
.pcard {
  display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; overflow: hidden; box-shadow: var(--shadow-soft);
  transition: transform .16s, box-shadow .16s, border-color .16s;
}
.pcard:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); border-color: var(--komgroup-soft); }
/* Imagem inteira (sem cortar foto nem thumb de vídeo); cards do mesmo tamanho por proporção fixa. */
.pc-img { aspect-ratio: 4 / 3; background: #eef2f6 center/contain no-repeat; }
.pc-noimg { aspect-ratio: 4 / 3; display: flex; align-items: center; justify-content: center; color: var(--muted); }
.pc-noimg svg { width: 34px; height: 34px; stroke: currentColor; fill: none; stroke-width: 1.6; }
.pc-body { padding: 14px 15px 16px; display: flex; flex-direction: column; gap: 8px; }
.pc-tags { display: flex; gap: 8px; align-items: center; }
.pc-marca, .pc-fonte { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: 3px 8px; border-radius: 12px; }
.pc-marca { background: var(--komgroup-soft); color: var(--komgroup); }
.pc-fonte { background: var(--surface-soft); color: var(--muted); }
.pc-body h3 { font-size: .98rem; line-height: 1.35; margin: 0; color: var(--text); }
.pc-data { font-size: .78rem; color: var(--muted); }

@media (max-width: 640px) {
  .ph-hero { min-height: 260px; }
  .ph-hero-ov { padding: 20px; }
  .ph-hero-ov h2 { font-size: 1.3rem; }
  .pgrid { grid-template-columns: 1fr 1fr; gap: 12px; }
}

/* Tags de marca com a cor da marca (só a tag, não o card) — vêm depois para vencer por ordem. */
.pc-marca.mtag-komeco, .ph-badge.mtag-komeco { background: #e52320; color: #fff; }
.pc-marca.mtag-uzoo, .ph-badge.mtag-uzoo { background: #2f9ba3; color: #fff; }
.pc-marca.mtag-finottato, .ph-badge.mtag-finottato { background: #111111; color: #fff; }
.pc-marca.mtag-komgroup, .ph-badge.mtag-komgroup { background: var(--komgroup); color: #fff; }

/* Loader animado da Home (logos das marcas alternando) */
.home-loader { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px; min-height: 46vh; padding: 60px 20px; }
.hl-logos { position: relative; width: 190px; height: 64px; }
.hl-logo { position: absolute; inset: 0; margin: auto; max-width: 170px; max-height: 56px; object-fit: contain; opacity: 0; animation: hl-cycle 1.6s infinite; }
@keyframes hl-cycle { 0% { opacity: 0; transform: scale(.9); } 6% { opacity: 1; transform: scale(1); } 22% { opacity: 1; transform: scale(1); } 28%, 100% { opacity: 0; transform: scale(.9); } }
.hl-bar { width: 190px; height: 5px; border-radius: 999px; background: var(--surface-soft); overflow: hidden; }
.hl-bar span { display: block; height: 100%; width: 40%; border-radius: 999px; background: linear-gradient(90deg, var(--komgroup), var(--accent)); animation: hl-slide 1.1s ease-in-out infinite; }
@keyframes hl-slide { 0% { margin-left: -40%; } 100% { margin-left: 100%; } }
.hl-text { color: var(--muted); font-size: .9rem; }
@media (prefers-reduced-motion: reduce) { .hl-logo { animation: none; opacity: 1; } .hl-logo:not(:first-child) { display: none; } .hl-bar span { animation: none; width: 100%; } }
