/* ====================================================================
   VARIÁVEIS GLOBAIS
   Mesma lógica da página anterior, com a paleta deslocada para
   azul/ciano — a "porta holográfica" desta página, em vez do verde
   terminal da entrada.
   ==================================================================== */
:root {
  --cor-fundo: #01050a;
  --cor-fundo-caixa: #030a12;
  --cor-azul: #38e6ff;
  --cor-azul-fraca: rgba(56, 230, 255, 0.4);
  --cor-dourada: #ffe6b0;
  --cor-alerta: #ff9166;
  --fonte-mono: 'Courier New', Courier, 'Lucida Console', Consolas, monospace;
}

/* ====================================================================
   RESET BÁSICO
   ==================================================================== */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow-x: hidden;
  background: var(--cor-fundo);
}

body {
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--fonte-mono);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  padding: 2.5rem 0;
}

/* ====================================================================
   TEXTURA DE FUNDO — mesmas scanlines/vinheta da página anterior,
   agora em tom azulado, pra manter a família visual.
   ==================================================================== */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(56, 230, 255, 0.03),
    rgba(56, 230, 255, 0.03) 1px,
    transparent 1px,
    transparent 3px
  );
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 40%, transparent 30%, rgba(0, 2, 5, 0.9) 145%);
}

/* ====================================================================
   TREMOR DE TELA (reaproveitado da página anterior)
   ==================================================================== */
@keyframes tremor {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-6px); }
  20%, 40%, 60%, 80% { transform: translateX(6px); }
}

body.tremendo {
  animation: tremor 0.45s ease;
}

/* ====================================================================
   CHUVA DE CÓDIGO — a mesma da página anterior, agora bem mais
   discreta e em tom azul, só como eco/continuidade da primeira tela.
   O túnel da porta é o elemento principal desta página.
   ==================================================================== */
#chuva-codigo {
  position: fixed;
  inset: 0;
  z-index: 0;
  display: block;
}

/* ====================================================================
   TÚNEL DA PORTA HOLOGRÁFICA — elemento novo e central desta página.
   ==================================================================== */
#tunel-porta {
  position: fixed;
  inset: 0;
  z-index: 1;
  display: block;
}

/* ====================================================================
   DICA QUE SEGUE O CURSOR (reaproveitada, texto ajustado ao contexto)
   ==================================================================== */
.dica-cursor {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 60;
  pointer-events: none;
  color: rgba(255, 255, 255, 0.78);
  font-family: var(--fonte-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-shadow: 0 0 6px rgba(255, 255, 255, 0.4), 0 0 14px rgba(255, 255, 255, 0.15);
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.4s ease;
  transform: translate(-9999px, -9999px);
  will-change: transform;
}

.dica-cursor.visivel {
  opacity: 1;
}

@media (hover: none), (pointer: coarse) {
  .dica-cursor {
    display: none;
  }
}

/* ====================================================================
   CONTAINER PRINCIPAL
   ==================================================================== */
.portal {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(1.75rem, 4vh, 2.5rem);
  padding: 2rem 1.5rem;
  width: 100%;
  max-width: 30rem;
  text-align: center;
  opacity: 0;
  transition: opacity 1s ease;
}

.portal.visivel {
  opacity: 1;
}

.portal::before {
  content: '';
  position: absolute;
  inset: -2.25rem -1.75rem;
  z-index: -1;
  pointer-events: none;
  border-radius: 1.25rem;
  background: rgba(1, 6, 10, 0.18);
  backdrop-filter: blur(3px) saturate(1.2);
  -webkit-backdrop-filter: blur(3px) saturate(1.2);
  border: 1px solid rgba(56, 230, 255, 0.12);
}

/* ====================================================================
   LINHA DIGITADA + CURSOR
   ==================================================================== */
.linha-digitada {
  display: block;
  text-align: center;
  color: #eafcff;
  font-size: clamp(1.05rem, 4.2vw, 1.7rem);
  letter-spacing: 0.03em;
  max-width: 26ch;
  margin: 0 auto;
  text-shadow:
    0 0 6px rgba(56, 230, 255, 0.95),
    0 0 18px rgba(56, 230, 255, 0.55),
    0 0 34px rgba(56, 230, 255, 0.28);
}

.cursor {
  display: inline;
  margin-left: 0.12em;
  vertical-align: -0.1em;
  animation: piscar 0.9s step-end infinite;
}

@keyframes piscar {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ====================================================================
   FORMULÁRIO
   ==================================================================== */
.formulario {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 1.15rem;
  width: 100%;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 1s ease, transform 1s ease;
  pointer-events: none;
}

.formulario.visivel {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.campo {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.4rem;
  text-align: left;
}

.campo label {
  color: rgba(56, 230, 255, 0.75);
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.campo input {
  width: 100%;
  background: rgba(2, 10, 15, 0.75);
  border: 1px solid rgba(56, 230, 255, 0.4);
  border-radius: 4px;
  padding: 0.75em 0.9em;
  color: #eafcff;
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease;
  /* Estiliza o quanto o navegador permite; o seletor de data nativo
     (calendário) continua com a aparência do sistema operacional. */
  color-scheme: dark;
}

.campo input::placeholder {
  color: rgba(234, 252, 255, 0.28);
}

.campo input:hover {
  border-color: rgba(56, 230, 255, 0.55);
}

.campo input:focus-visible {
  border-color: var(--cor-azul);
  background: rgba(56, 230, 255, 0.07);
  box-shadow: 0 0 16px rgba(56, 230, 255, 0.35);
}

.campo input:invalid {
  box-shadow: none;
}

.campo.invalido input {
  border-color: rgba(255, 145, 102, 0.75);
  box-shadow: 0 0 12px rgba(255, 145, 102, 0.3);
}

.campo.invalido label {
  color: rgba(255, 145, 102, 0.9);
}

.botao-comprometer {
  margin-top: 0.35rem;
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  font-family: inherit;
  font-size: clamp(0.85rem, 2vw, 0.95rem);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 0.95em 1.5em;
  border-radius: 999px;
  background: transparent;
  color: var(--cor-dourada);
  border: 1px solid rgba(255, 230, 176, 0.65);
  box-shadow: 0 0 10px rgba(255, 230, 176, 0.3), inset 0 0 8px rgba(255, 230, 176, 0.05);
  cursor: pointer;
  outline: none;
  touch-action: manipulation;
  transition: box-shadow 0.35s ease, background-color 0.35s ease, transform 0.2s ease;
}

.botao-comprometer svg { flex-shrink: 0; }

.botao-comprometer:hover,
.botao-comprometer:focus-visible {
  background: rgba(255, 230, 176, 0.08);
  box-shadow: 0 0 24px rgba(255, 230, 176, 0.75), inset 0 0 14px rgba(255, 230, 176, 0.15);
}

.botao-comprometer:active {
  transform: scale(0.97);
}

/* ====================================================================
   POP-UP DE ERRO (reaproveitado da página anterior, tons ajustados)
   ==================================================================== */
.erro-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(0, 2, 5, 0.8);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.erro-overlay.ativo {
  opacity: 1;
  visibility: visible;
}

.erro-caixa {
  position: relative;
  width: 100%;
  max-width: 420px;
  background: var(--cor-fundo-caixa);
  border: 1px solid rgba(255, 145, 102, 0.5);
  border-radius: 4px;
  padding: 2.1rem 1.75rem 1.85rem;
  box-shadow: 0 0 30px rgba(255, 145, 102, 0.18), 0 10px 40px rgba(0, 0, 0, 0.7);
  transform: scale(0.94);
  transition: transform 0.3s ease;
}

.erro-overlay.ativo .erro-caixa {
  transform: scale(1);
}

.erro-rotulo {
  display: block;
  color: rgba(255, 145, 102, 0.9);
  font-size: 0.7rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  margin-bottom: 0.9rem;
}

.erro-mensagem {
  color: var(--cor-azul);
  font-size: clamp(0.82rem, 2.2vw, 0.95rem);
  line-height: 1.65;
  letter-spacing: 0.01em;
  text-shadow: 0 0 6px rgba(56, 230, 255, 0.4);
}

.erro-fechar {
  position: absolute;
  top: 0.4rem;
  right: 0.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  background: none;
  border: none;
  outline: none;
  font-family: inherit;
  font-size: 1.15rem;
  line-height: 1;
  color: rgba(56, 230, 255, 0.55);
  cursor: pointer;
  touch-action: manipulation;
  transition: color 0.2s ease;
}

.erro-fechar:hover,
.erro-fechar:focus-visible {
  color: var(--cor-azul);
}

/* ====================================================================
   CONTROLE DE ÁUDIO (reaproveitado)
   ==================================================================== */
.controle-audio {
  position: fixed;
  right: clamp(1rem, 3vw, 1.75rem);
  bottom: clamp(1rem, 3vw, 1.75rem);
  z-index: 60;
  background: transparent;
  border: 1px solid rgba(56, 230, 255, 0.35);
  color: rgba(56, 230, 255, 0.75);
  font-family: var(--fonte-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  padding: 0.5em 0.9em;
  border-radius: 999px;
  cursor: pointer;
  outline: none;
  touch-action: manipulation;
  opacity: 0;
  transition: opacity 1s ease, color 0.2s ease, border-color 0.2s ease;
}

.controle-audio.visivel {
  opacity: 0.7;
}

.controle-audio:hover,
.controle-audio:focus-visible {
  opacity: 1;
  color: var(--cor-azul);
  border-color: rgba(56, 230, 255, 0.75);
}

/* ====================================================================
   AJUSTES RESPONSIVOS
   ==================================================================== */
@media (max-height: 560px) {
  .portal {
    gap: 1.1rem;
  }
}

@media (max-width: 340px) {
  .botao-comprometer {
    padding: 0.85em 1.2em;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
