/* Reset e Estilos Globais */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary-color: #10b981; /* Verde Trading */
  --primary-hover: #059669;
  --secondary-color: #06b6d4; /* Ciano/Azul Neon */
  --background-dark: #04060a; /* Fundo Cósmico Escuro */
  --card-bg: rgba(13, 20, 35, 0.45); /* Vidro super translúcido */
  --card-border: rgba(6, 182, 212, 0.15); /* Borda com brilho ciano */
  --text-primary: #ffffff;
  --text-secondary: #94a3b8; /* Slate 400 */
  --error-color: #f43f5e; /* Rose 500 */
  --success-color: #10b981;
  --glow-1: rgba(16, 185, 129, 0.08);
  --glow-2: rgba(6, 182, 212, 0.08);
  --font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
body {
  font-family: var(--font-family);
  background-color: #020306; /* Base ultra escura */
  color: var(--text-primary);
  height: 100vh;
  max-height: 100vh;
  width: 100vw;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  overflow: hidden; /* Elimina qualquer rolagem */
  position: relative;
}

/* Pseudo-elemento do fundo com desfoque e escurecimento para destacar o card */
body::before {
  content: "";
  position: absolute;
  top: -20px;
  left: -20px;
  right: -20px;
  bottom: -20px;
  z-index: -2;
  background-image: url('background.jpg');
  background-repeat: no-repeat;
  background-size: cover;
  background-position: calc(50% + var(--bg-x, 0px)) calc(50% + var(--bg-y, 0px));
  filter: blur(10px) brightness(0.28); /* Blur e escurecimento aplicados apenas ao fundo */
  transition: background-position 0.25s cubic-bezier(0.25, 1, 0.5, 1);
}

/* Esferas de Brilho no Fundo */
.bg-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  z-index: -1;
  pointer-events: none;
  animation: float-glow 8s ease-in-out infinite alternate;
  transition: transform 0.25s cubic-bezier(0.25, 1, 0.5, 1);
}

.bg-glow-1 {
  width: 45vw;
  height: 45vw;
  background-color: var(--glow-1);
  top: -10%;
  left: -15%;
  transition: transform 0.25s cubic-bezier(0.25, 1, 0.5, 1);
}

.bg-glow-2 {
  width: 45vw;
  height: 45vw;
  background-color: var(--glow-2);
  bottom: 5%;
  right: -15%;
  animation-delay: -4s;
  transition: transform 0.25s cubic-bezier(0.25, 1, 0.5, 1);
}

@keyframes float-glow {
  0% {
    transform: translate(0, 0) scale(1);
  }
  100% {
    transform: translate(30px, 15px) scale(1.05);
  }
}

/* Container Principal */
.container {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100%;
  padding: 20px;
  z-index: 2;
}

.glass-card {
  width: 100%;
  max-width: 440px;
  background: var(--card-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 44px 36px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.55),
              inset 0 1px 0 rgba(255, 255, 255, 0.05);
  animation: card-appear 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes card-appear {
  0% {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Elementos de Marca (Trading Floor) */
.brand-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 24px;
}

.brand-logo {
  max-width: 200px;
  height: auto;
  margin-bottom: 12px;
}
.brand-subtitle {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 4.8px;
  text-indent: 4.8px;
  color: #ffffff;
  margin-top: 10px;
  border-bottom: 1.5px solid rgba(255, 255, 255, 0.25);
  padding-bottom: 6px;
  width: 172px;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

/* Cabeçalho do Card */
.card-header {
  margin-bottom: 28px;
}

.live-badge-wrapper {
  margin-bottom: 16px;
}

.live-badge {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  padding: 5px 14px;
  border-radius: 100px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.3s ease;
}

/* Estado Ativo: Ao vivo */
.live-badge.active {
  color: #10b981;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  animation: pulse-badge-active 2s infinite;
}

/* Ponto verde piscante para o Ao Vivo */
.live-dot {
  width: 6px;
  height: 6px;
  background-color: #10b981;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 6px #10b981;
  animation: blink-dot 1.2s infinite;
}

@keyframes blink-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.8); }
}

@keyframes pulse-badge-active {
  0%, 100% { 
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.15);
  }
  50% { 
    box-shadow: 0 0 8px 2px rgba(16, 185, 129, 0.08);
  }
}

/* Estado Offline: Programado */
.live-badge.offline {
  color: #94a3b8;
  background: rgba(148, 163, 184, 0.05);
  border: 1px solid rgba(148, 163, 184, 0.15);
  animation: none;
}

.calendar-icon {
  font-size: 0.72rem;
}

.subtitle {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.input-group {
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
}

label {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #e2e8f0;
}

input {
  width: 100%;
  background: rgba(4, 6, 10, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 8px;
  padding: 13px 16px;
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 0.9rem;
  transition: all 0.2s ease;
  outline: none;
}

input:focus {
  border-color: var(--secondary-color);
  box-shadow: 0 0 0 2px rgba(6, 182, 212, 0.15);
  background: rgba(4, 6, 10, 0.75);
}

input::placeholder {
  color: #475569; /* Slate 600 */
}

/* Erros de Validação */
.error-msg {
  font-size: 0.75rem;
  color: var(--error-color);
  display: none;
  margin-top: 3px;
  font-weight: 500;
}

/* Botão de Envio */
.btn-submit {
  width: 100%;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  padding: 15px;
  margin-top: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.15);
}

.btn-submit:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.3);
  background: linear-gradient(135deg, var(--primary-hover) 0%, #047857 100%);
}

.btn-submit:active:not(:disabled) {
  transform: translateY(0);
}

.btn-submit:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* Spinner de Carregamento */
.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #ffffff;
  animation: spin 0.8s linear infinite;
  display: none;
}

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

/* Mensagem de Alerta (Erro do Servidor) */
.alert-box {
  margin-top: 14px;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 500;
  text-align: center;
  animation: shake 0.4s ease;
}

.alert-box.error {
  background: rgba(244, 63, 94, 0.08);
  border: 1px solid rgba(244, 63, 94, 0.2);
  color: var(--error-color);
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

/* Card de Sucesso / Transição */
.success-card {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.success-icon-wrapper {
  width: 50px;
  height: 50px;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  color: var(--success-color);
}

.check-icon {
  width: 24px;
  height: 24px;
}

.success-subtitle {
  color: var(--text-secondary);
  margin-top: 6px;
  margin-bottom: 18px;
  font-size: 0.85rem;
}

/* Barra de Progresso */
.loading-bar {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 24px;
}

.loading-progress {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
  border-radius: 10px;
  transition: width 0.1s linear;
}

.redirect-info {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

/* Botões do Zoom */
.button-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.btn-zoom-direct {
  background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
  color: #ffffff;
  text-decoration: none;
  padding: 11px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.85rem;
  box-shadow: 0 4px 12px rgba(6, 182, 212, 0.15);
  transition: all 0.2s ease;
  display: block;
}

.btn-zoom-direct:hover {
  transform: translateY(-1px);
  box-shadow: 0 5px 14px rgba(6, 182, 212, 0.25);
}

.btn-zoom-web {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid rgba(255, 255, 255, 0.08);
  text-decoration: none;
  padding: 11px;
  border-radius: 8px;
  font-weight: 500;
  font-size: 0.85rem;
  transition: all 0.2s ease;
  display: block;
}

.btn-zoom-web:hover {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.15);
}

/* Rodapé Posicionado Absoluto (sobreposto à Lua no rodapé) */
.footer {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  text-align: center;
  font-size: 0.72rem;
  color: #475569; /* Slate 600 */
  z-index: 5;
  pointer-events: none;
}

/* Responsividade */
@media (max-width: 480px) {
  .glass-card {
    padding: 24px 20px;
  }
  
  .brand-title {
    font-size: 1.6rem;
  }
  
  .bg-moon {
    width: 140vw;
    height: 35vh;
    bottom: -15vh;
  }
}
