/* ============================================================================
   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: transparent;
  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 {
  height: 50px;
  width: auto;
  max-width: none;
  flex-shrink: 0;
}

/* --- HEADER ACTIONS (grupo de logo + ícone à esquerda) --- */

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

/* Hero com background para step do CPF */
.hero--cpf {
  background: var(--primary);
  flex: 0 0 auto !important;
}

/* Hero content do CPF sem altura fixa */
.hero--cpf .hero-content {
  height: auto;
}

/* Parágrafo no step do CPF */
.container.tela .hero--cpf .hero-content p {
  color: #fff;
  margin-bottom: 50px;
}

/* 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: center;
  gap: 12px;
}

/* 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: rgba(255, 255, 255, 0.8);
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease;
}

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

/* Loader Sicredi (três círculos + texto) dentro da tela de carregamento */
.loader-sicredi .loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.loader-sicredi .circle-container {
  display: flex;
  gap: 10px;
}

.loader-sicredi .circle {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--secondary);
  animation: loader-sicredi-bounce 1s ease-in-out infinite;
}

.loader-sicredi .circle:nth-child(2) {
  animation-delay: 0.15s;
}

.loader-sicredi .circle:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes loader-sicredi-bounce {
  0%, 80%, 100% {
    transform: translateY(0);
    opacity: 0.5;
  }
  40% {
    transform: translateY(-12px);
    opacity: 1;
  }
}

.loader-sicredi .paragrafo-new {
  margin: 0;
  text-align: center;
  text-wrap: balance;
  color: var(--secondary);
  font-size: 16px;
  font-weight: 600;
}

/* --- FOOTER SECTION --- */
.footer-section {
  background: #3F475A;
  padding: 40px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  max-width: 600px;
  width: 100%;
}

.footer-logo {
  flex: 0 0 auto;
  width: 60px;
  height: auto;
  border-radius: 0;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-bottom: 8px;
}

.footer-logo img {
  width: 60px;
  height: 60px;
  display: block;
}

.footer-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  align-items: center;
}

.footer-info-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
  align-items: center;
}

.footer-info-row p {
  margin: 0;
  font-size: 15px;
  line-height: 1.4;
  color: #fff;
  font-family: 'ItauTextPro', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  font-weight: 400;
  text-align: center;
}

.footer-info-row--title p {
  font-weight: 600;
  color: #fff;
  font-size: 15px;
  text-align: center;
}

.footer-info-aviso {
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 15px;
  color: #fff !important;
  line-height: 1.5;
  text-align: center;
}

.footer-info-aviso p {
  color: #fff !important;
}
