/* ============================================================
   SOPRO — layout.css
   Estrutura do app shell: contentor, header, main, nav, splash
   ============================================================ */

/* ── App — contentor central ────────────────────────────── */
.app {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  max-width: var(--largura-maxima);
  margin: 0 auto;
  position: relative;
}

/* ── Header fixo ────────────────────────────────────────── */
.header {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--largura-maxima);
  height: var(--altura-header);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--esp-lg);
  background-color: rgba(15, 17, 22, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--cor-borda-sutil);
  z-index: var(--z-dropdown);
}

/* ── Main ───────────────────────────────────────────────── */
.main {
  flex: 1;
  overflow-x: hidden;
  /* sem padding por padrão — splash usa full viewport */
}

/* ativado por App.mostrarShell() quando o header está visível */
.main.com-header {
  padding-top: var(--altura-header);
}

/* ativado quando a nav inferior está presente */
.main.com-nav {
  padding-bottom: calc(var(--altura-nav) + var(--esp-4));
}

/* ── Nav inferior (mobile) ──────────────────────────────── */
.nav-bottom {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--largura-maxima);
  height: var(--altura-nav);
  display: flex;
  align-items: center;
  justify-content: space-around;
  background-color: rgba(15, 17, 22, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--cor-borda-sutil);
  z-index: var(--z-dropdown);
  padding: 0 var(--esp-sm);
  /* safe area para iPhones com notch */
  padding-bottom: env(safe-area-inset-bottom, 0);
}

/* ── Página — área de conteúdo ──────────────────────────── */
.pagina {
  padding: var(--esp-8) var(--esp-6) var(--esp-10);
}

/* ── Seção genérica ─────────────────────────────────────── */
.secao {
  margin-bottom: var(--esp-10);
}

/* ── Divisor ────────────────────────────────────────────── */
.divisor {
  height: 1px;
  background-color: var(--cor-borda-sutil);
  margin: var(--esp-6) 0;
}

/* ── Splash — tela de entrada ───────────────────────────── */
.splash {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  padding: var(--esp-10) var(--esp-8);
  text-align: center;
  position: relative;
}

/* ── Grade 2 colunas ────────────────────────────────────── */
.grade-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--esp-md);
}

/* ── Tela de carregamento ───────────────────────────────── */
.tela-carregando {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
}

/* ── Desktop — moldura lateral sutil ───────────────────── */
@media (min-width: 640px) {
  .app {
    border-left:  1px solid var(--cor-borda-sutil);
    border-right: 1px solid var(--cor-borda-sutil);
    box-shadow: var(--sombra-lg);
  }

  /* mais respiro nas páginas em desktop */
  .pagina {
    padding: var(--esp-10) var(--esp-8) var(--esp-12);
  }
}
