* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --neon: #1ee8f5;
  --neon-soft: rgba(30, 232, 245, 0.35);
  --neon-glow: 0 0 18px rgba(30, 232, 245, 0.55);
  --navy: #020c16;
  --navy-glass: rgba(2, 16, 28, 0.55);
  --text: #ffffff;
  --text-muted: rgba(255, 255, 255, 0.7);
  --red: #ff2443;
  --red-dark: #d90f2f;
}

body {
  font-family: "Montserrat", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  height: 100vh;
  background-color: var(--navy);
  color: var(--text);
  overflow: hidden;
}

.container {
  width: 100%;
  height: 100vh;
  position: relative;
  overflow: hidden;
}

/* Fundo compartilhado entre as telas */
.banner,
.numeros-section,
.error-section {
  background-color: var(--navy);
  background-image: url("../assets/bg.png");
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
}

.banner {
  height: 100vh;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
  position: relative;
  overflow: hidden;
}

/* Chamada à esquerda, formulário à direita */
.banner-content {
  flex: 1;
  width: 100%;
  max-width: 1300px;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 60px;
}

.chamada {
  display: block;
  width: 100%;
  max-width: 560px;
  max-height: calc(100vh - 140px);
  height: auto;
  object-fit: contain;
  justify-self: center;
  /* Suaviza as bordas do fundo escuro embutido na arte */
  -webkit-mask-image: linear-gradient(
      to right,
      transparent,
      #000 9%,
      #000 91%,
      transparent
    ),
    linear-gradient(to bottom, transparent, #000 8%);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(
      to right,
      transparent,
      #000 9%,
      #000 91%,
      transparent
    ),
    linear-gradient(to bottom, transparent, #000 8%);
  mask-composite: intersect;
}

/* Seção do CPF */
.cpf-section {
  width: 100%;
  max-width: 480px;
  justify-self: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 44px 40px;
  background: var(--navy-glass);
  border: 1.5px solid var(--neon-soft);
  border-radius: 20px;
  box-shadow: 0 0 40px rgba(30, 232, 245, 0.15),
    inset 0 0 30px rgba(30, 232, 245, 0.06);
  backdrop-filter: blur(12px);
}

.cpf-tag {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--neon);
  letter-spacing: 4px;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.cpf-title {
  font-size: 1.9rem;
  font-weight: 800;
  line-height: 1.15;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.cpf-title strong,
.numeros-title strong {
  display: block;
  font-weight: 900;
  color: var(--neon);
  text-shadow: var(--neon-glow);
}

.cpf-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 28px;
}

.input-wrapper {
  width: 100%;
  margin-bottom: 20px;
}

.cpf-input {
  width: 100%;
  padding: 17px 22px;
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  border-radius: 10px;
  outline: none;
  transition: all 0.3s ease;
  text-align: center;
  letter-spacing: 2px;
}

.cpf-input::placeholder {
  color: rgba(255, 255, 255, 0.5);
  font-weight: 500;
}

.cpf-input:focus {
  border-color: var(--neon);
  box-shadow: var(--neon-glow);
}

/* Botões principais — vermelho do "Aproveite agora" */
.btn-proximo,
.btn-voltar {
  font-family: inherit;
  font-weight: 700;
  color: #ffffff;
  background: var(--red);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  letter-spacing: 4px;
  text-transform: uppercase;
  box-shadow: 0 6px 20px rgba(255, 36, 67, 0.35);
}

.btn-proximo {
  width: 100%;
  padding: 16px 30px;
  font-size: 0.95rem;
}

.btn-proximo:hover,
.btn-voltar:hover {
  background: var(--red-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 26px rgba(255, 36, 67, 0.5);
}

.btn-proximo:active,
.btn-voltar:active {
  transform: translateY(0);
}

/* Rodapé do banner */
.banner-footer {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.mand {
  display: block;
  text-align: center;
  padding: 4px 8px;
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.5);
  text-decoration: none;
  transition: color 0.3s ease;
}

.mand:hover {
  color: var(--neon);
}

/* Loading */
#loading {
  position: fixed;
  inset: 0;
  background: rgba(2, 12, 22, 0.85);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.spinning {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(255, 255, 255, 0.15);
  border-top-color: var(--neon);
  border-radius: 50%;
  box-shadow: var(--neon-glow);
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Seção de Números da Sorte */
.numeros-section {
  position: fixed;
  inset: 0;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 100;
  overflow-y: auto;
  overflow-x: hidden;
}

.numeros-title {
  width: 100%;
  position: sticky;
  top: 0;
  z-index: 10;
  padding: 40px 20px 24px;
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: 3px;
  text-transform: uppercase;
  background: linear-gradient(
    to bottom,
    rgba(2, 12, 22, 0.9) 60%,
    rgba(2, 12, 22, 0)
  );
}

.numeros-title strong {
  font-size: 2rem;
  letter-spacing: 1px;
  margin-top: 4px;
}

.numeros-atualizado {
  width: 100%;
  max-width: 1100px;
  padding: 0 20px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  text-align: right;
}

.numeros-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
  padding: 20px;
  width: 100%;
  max-width: 1100px;
}

.numeros-vazio {
  grid-column: 1 / -1;
  font-size: 1.1rem;
  color: var(--text-muted);
}

.numero-card {
  background: var(--navy-glass);
  border: 1.5px solid var(--neon-soft);
  border-radius: 14px;
  padding: 28px 18px;
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  animation: fadeIn 0.4s ease both;
}

.numero-card:hover {
  border-color: var(--neon);
  box-shadow: 0 0 24px rgba(30, 232, 245, 0.35);
  transform: translateY(-4px);
}

.numero-valor {
  font-size: 2rem;
  font-weight: 900;
  color: var(--neon);
  text-shadow: var(--neon-glow);
  letter-spacing: 3px;
  word-break: break-all;
}

.numero-data {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.btn-voltar {
  padding: 16px 60px;
  font-size: 0.95rem;
  flex-shrink: 0;
  margin: 30px auto 50px;
  display: block;
  position: sticky;
  bottom: 30px;
  z-index: 10;
}

/* Seção de Erro */
.error-section {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 40px 20px;
  z-index: 100;
}

.error-message {
  font-size: 1.1rem;
  font-weight: 600;
  text-align: center;
  color: #ffffff;
  background: rgba(255, 36, 67, 0.12);
  border: 1.5px solid rgba(255, 36, 67, 0.5);
  border-radius: 14px;
  padding: 28px 32px;
  margin-bottom: 10px;
  backdrop-filter: blur(10px);
  max-width: 560px;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsivo para Tablet */
@media (max-width: 1024px) {
  .banner-content {
    gap: 30px;
  }

  .cpf-section {
    padding: 36px 28px;
  }

  .cpf-title {
    font-size: 1.6rem;
  }
}

/* Responsivo para Mobile - COM ROLAGEM */
@media (max-width: 768px) {
  body {
    overflow-y: auto;
    height: auto;
  }

  .container {
    height: auto;
    overflow: visible;
  }

  .banner {
    height: auto;
    min-height: 100vh;
    padding: 20px 16px;
    overflow: visible;
    background-attachment: fixed;
    gap: 24px;
  }

  .banner-content {
    grid-template-columns: minmax(0, 1fr);
    align-content: start;
    gap: 10px;
  }

  .chamada {
    max-width: 380px;
    max-height: none;
  }

  .cpf-section {
    padding: 30px 22px;
  }

  .cpf-title {
    font-size: 1.4rem;
  }

  .cpf-subtitle {
    font-size: 0.85rem;
    margin-bottom: 22px;
  }

  .cpf-input {
    padding: 15px 18px;
    font-size: 1rem;
  }

  .btn-proximo {
    padding: 15px 24px;
    font-size: 0.9rem;
  }

  .mand {
    padding-bottom: 16px;
  }

  .numeros-title {
    padding: 28px 15px 18px;
    font-size: 0.95rem;
  }

  .numeros-title strong {
    font-size: 1.5rem;
  }

  .numeros-list {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 15px;
  }

  .numero-card {
    padding: 22px 12px;
  }

  .numero-valor {
    font-size: 1.4rem;
    letter-spacing: 2px;
  }

  .numero-data {
    font-size: 0.75rem;
  }

  .btn-voltar {
    padding: 15px 44px;
    font-size: 0.9rem;
    margin: 20px auto 40px;
    bottom: 20px;
  }

  .error-message {
    font-size: 1rem;
    padding: 24px;
  }
}

/* Responsivo para Mobile Pequeno */
@media (max-width: 480px) {
  .banner {
    padding: 16px 12px;
  }

  .cpf-title {
    font-size: 1.25rem;
  }

  .cpf-tag {
    letter-spacing: 3px;
  }

  .numeros-list {
    grid-template-columns: 1fr;
  }

  .numero-valor {
    font-size: 1.5rem;
  }

  .btn-voltar {
    padding: 14px 36px;
    letter-spacing: 3px;
  }

  .error-message {
    font-size: 0.9rem;
    padding: 20px;
  }
}
