/* ============================================================================
   LAYOUT.CSS - Estrutura principal de layout (container, header, hero, wrap, card)
   ============================================================================ */

/* --- CONTAINER RAIZ (flex column, 100% altura) --- */
.container {
  width: 100%;
  min-height: 100vh;
  position: relative;
  display: flex;
  flex-direction: column;
}

/* Limita largura em telas médias (mobile em dispositivo) */
@media (min-width: 480px) {
  .container {
    max-width: 440px;
    margin: 0 auto;
  }
}

/* --- HEADER (topo com logo, fundo escuro) --- */
.header {
  background: #fff;
  padding: 12px 20px;
  height: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Variante: header transparente para temas com fundo gradiente */
.header--transparent {
  background: transparent;
  border-bottom: none;
}

/* Logo no header */
.logo {
  max-width: 48px;
  height: auto;
  flex-shrink: 0;
}

/* --- HEADER ACTIONS (grupo de logo + ícone à esquerda) --- */
.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

/* --- HEADER ICON (ícone no canto direito) --- */
.header-icon {
  width: 40px;
  height: 40px;
  border-radius: 100%;
  background: var(--icon-bg);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: opacity 0.2s ease;
  padding: 0;
}

.header-icon:hover {
  opacity: 0.8;
}

.header-icon svg {
  width: 18px;
  height: 18px;
}

/* --- HERO SECTION (área acima do card, flexível) --- */
.hero {
  flex: 1;
  padding: 0;
  display: flex;
  flex-direction: column;
}

/* Em modo plain (simples), hero não cresce */
.wrap--plain .hero {
  flex: 0 0 auto;
}

/* Em modo full screen, hero é totalmente ocultado */
.wrap--full .hero {
  display: none !important;
  flex: 0 0 0 !important;
  height: 0 !important;
  width: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  border: none !important;
  overflow: hidden !important;
}

/* Hero vazio não ocupa espaço */
.hero:empty {
  display: none;
}

/* Conteúdo dentro do hero (centralizado) */
.hero-content {
  padding: 40px 20px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 16px;
  flex: 1;
  height: 100%;
}

/* --- WRAP (container entre hero e footer) --- */
.wrap {
  width: 100%;
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 8px 20px 32px;
}

/* --- CARD (caixa branca com formulário/conteúdo) --- */
.card {
  width: 100%;
  padding: 24px;
  overflow: visible;
  border-radius: 18px;
  background: #fff;
}

/* --- VARIANTES DE WRAP E CARD --- */

/* Wrap plain: espaço mínimo, sem hero */
.wrap--plain {
  padding-top: 16px;
}

.wrap--plain .hero {
  display: none !important;
}

.wrap--plain .hero-title {
  color: #000 !important;
}

/* Wrap full: tela inteira com fundo colorido, card oculto */
.wrap--full {
  padding: 0;
  align-items: stretch;
  justify-content: stretch;
  flex: 1;
}

.wrap--full .hero {
  display: none !important;
}

/* Card full: sem padding/border, preenche espaço */
.card--full {
  padding: 0;
  border-radius: 0;
  background: transparent;
  overflow: visible;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.card--full .step {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 40px 20px;
}

/* Card plain: sem estilo de card (transparente) */
.card--plain {
  padding: 0;
  border-radius: 0;
  background: transparent;
  overflow: visible;
}

.card--plain .step {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 40px 20px;
}

/* --- STEP CONTAINER (flex para formulário) --- */
.step {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* --- FOOTER (rodapé com logo e texto) --- */
.step-footer {
  width: 100%;
  background: #4C4C4C;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

/* Logo no footer */
.step-footer-logo {
  width: 46px;
  height: auto;
  display: block;
}

/* --- SPACER (elemento que cresce, empurra botões para baixo) --- */
.spacer {
  flex: 1;
}

/* --- HIDDEN (oculta elementos) --- */
.hidden {
  display: none !important;
}

/* --- IMAGENS NAS TELAS --- */

/* Imagem em telas full screen */
.wrap--full .step img {
  max-width: 150px;
  height: auto;
  margin: 0 auto 40px;
}

/* Imagem dentro de step (com border-radius) */
.step-image {
  max-width: 280px;
  width: 100%;
  display: block;
  border-radius: 10px;
  margin: 2rem auto;
}

/* --- LOADING SCREEN (overlay em tela cheia) --- */
.loading-screen {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000D3C;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease;
}

/* Quando visível, aparece */
.loading-screen.is-visible {
  opacity: 1;
  pointer-events: auto;
}

/* Spinner dentro da tela de carregamento */
.loading-spinner {
  width: 72px;
  height: 72px;
  border: 3px solid rgba(255, 255, 255, 0.25);
  border-top-color: #fff;
  border-radius: 50%;
  animation: btn-spin 0.8s linear infinite;
}
