/* Sentinela — tela de login */
.tela-entrar { overflow: hidden; min-height: 100vh; }

/* Camadas do fundo: aurora (manchas de cor), grade e constelação (canvas) */
.aurora { position: fixed; inset: 0; overflow: hidden; pointer-events: none; }
.aurora span {
  position: absolute; width: 62vmax; height: 62vmax; border-radius: 50%;
  filter: blur(90px); opacity: 0.32; animation: flutuar 24s ease-in-out infinite alternate;
}
.aurora span:nth-child(1) { background: #0e7490; top: -24vmax; left: -18vmax; }
.aurora span:nth-child(2) { background: #6d28d9; bottom: -28vmax; right: -18vmax; animation-duration: 30s; animation-delay: -8s; }
.aurora span:nth-child(3) { background: #1d4ed8; top: 35%; left: 38%; width: 38vmax; height: 38vmax; opacity: 0.18; animation-duration: 36s; }
@keyframes flutuar { to { transform: translate(9vmax, 6vmax) scale(1.18); } }

.grade-fundo {
  position: fixed; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.05) 1px, transparent 1px);
  background-size: 52px 52px;
  -webkit-mask-image: radial-gradient(ellipse at center, #000 20%, transparent 72%);
  mask-image: radial-gradient(ellipse at center, #000 20%, transparent 72%);
}

#fundo { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }

/* Palco e cartão */
.palco {
  position: relative; z-index: 2; min-height: 100vh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 24px 16px; perspective: 1200px; pointer-events: none;
}
.palco > * { pointer-events: auto; }

.cartao {
  position: relative; width: min(420px, 100%);
  padding: 36px 32px 22px; border-radius: 24px;
  background: linear-gradient(180deg, rgba(17, 24, 39, 0.74), rgba(9, 14, 27, 0.78));
  border: 1px solid var(--borda);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  backdrop-filter: blur(18px) saturate(140%);
  box-shadow: 0 40px 90px -30px rgba(0, 0, 0, 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform 0.25s ease-out, opacity 0.35s ease;
  animation: surgir 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
/* Borda que acende onde o mouse está */
.cartao::before {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; pointer-events: none;
  background: radial-gradient(320px circle at var(--mx, 50%) var(--my, 0%),
    rgba(34, 211, 238, 0.85), rgba(139, 92, 246, 0.5) 40%, transparent 72%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}
.brilho {
  position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 0%), rgba(34, 211, 238, 0.07), transparent 60%);
}
.cartao.saindo { opacity: 0; transform: translateY(-10px) scale(0.96); }
@keyframes surgir { from { opacity: 0; transform: translateY(18px) scale(0.98); } }

.marca { display: flex; align-items: center; gap: 14px; margin-bottom: 26px; }
.marca img { filter: drop-shadow(0 6px 18px rgba(34, 211, 238, 0.35)); }
.marca h1 {
  margin: 0; font-size: 28px; line-height: 1.1; letter-spacing: -0.02em; font-weight: 750;
  background: linear-gradient(90deg, #f1f5f9, #a5f3fc 60%, #c4b5fd);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.marca p { margin: 4px 0 0; color: var(--texto-2); font-size: 14px; }

/* Campos com rótulo flutuante */
.campo { position: relative; margin-top: 14px; }
.campo input {
  width: 100%; height: 56px; padding: 22px 46px 6px 46px;
  background: rgba(2, 6, 23, 0.55); border: 1px solid var(--borda); border-radius: 12px;
  outline: none; transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.campo input:hover { border-color: var(--borda-forte); }
.campo input:focus {
  border-color: rgba(34, 211, 238, 0.65); background: rgba(2, 6, 23, 0.78);
  box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.12);
}
.campo label {
  position: absolute; left: 46px; top: 50%; transform: translateY(-50%);
  color: var(--texto-3); pointer-events: none; transition: all 0.18s ease;
}
.campo input:focus + label,
.campo input:not(:placeholder-shown) + label {
  top: 16px; font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ciano);
}
.campo input:not(:focus):not(:placeholder-shown) + label { color: var(--texto-3); }
.campo .icone {
  position: absolute; left: 15px; top: 50%; transform: translateY(-50%);
  width: 19px; height: 19px; fill: none; stroke: var(--texto-3); stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round; transition: stroke 0.2s; pointer-events: none;
}
.campo input:focus ~ .icone { stroke: var(--ciano); }
.campo input:-webkit-autofill {
  -webkit-text-fill-color: var(--texto);
  -webkit-box-shadow: 0 0 0 100px #0a1120 inset;
  caret-color: var(--texto);
}

.olho {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  width: 38px; height: 38px; display: grid; place-items: center;
  border: 0; border-radius: 9px; background: transparent; color: var(--texto-3); cursor: pointer;
}
.olho:hover { color: var(--texto); background: rgba(148, 163, 184, 0.1); }
.olho svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.olho .fechado, .olho.mostrando .aberto { display: none; }
.olho.mostrando .fechado { display: block; }

.aviso-caps {
  display: flex; align-items: center; gap: 6px; margin: 10px 2px 0;
  font-size: 13px; color: #fcd34d;
}
.aviso-caps svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
.erro { min-height: 20px; margin: 10px 2px 0; font-size: 13.5px; color: #fda4af; }

form.tremer { animation: tremer 0.42s cubic-bezier(0.36, 0.07, 0.19, 0.97); }
@keyframes tremer {
  20%, 60% { transform: translateX(-7px); }
  40%, 80% { transform: translateX(7px); }
}

/* Botão */
.entrar {
  position: relative; overflow: hidden; width: 100%; height: 54px; margin-top: 12px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 12px; cursor: pointer;
  background: var(--gradiente); background-size: 140% 100%; color: #03121f;
  font-size: 16px; font-weight: 700; letter-spacing: 0.01em;
  box-shadow: 0 12px 32px -12px rgba(34, 211, 238, 0.7);
  transition: transform 0.15s, box-shadow 0.25s, background-position 0.4s, opacity 0.2s;
}
.entrar::after {
  content: ""; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.5) 50%, transparent 70%);
}
.entrar:hover { transform: translateY(-1px); background-position: 100% 0; box-shadow: 0 18px 40px -14px rgba(139, 92, 246, 0.8); }
.entrar:hover::after { animation: brilhar 0.9s ease; }
.entrar:active { transform: translateY(0) scale(0.99); }
.entrar:disabled { cursor: not-allowed; opacity: 0.55; transform: none; }
.entrar .seta { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.2s; }
.entrar:hover .seta { transform: translateX(3px); }
.giro {
  position: absolute; inset: 0; margin: auto; width: 22px; height: 22px; border-radius: 50%;
  border: 2.5px solid rgba(3, 18, 31, 0.25); border-top-color: #03121f;
  opacity: 0; animation: girar 0.7s linear infinite;
}
.entrar[aria-busy="true"] > span, .entrar[aria-busy="true"] .seta { opacity: 0; }
.entrar[aria-busy="true"] .giro { opacity: 1; }

/* Rodapé */
.rodape {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--borda);
  font-size: 12.5px; color: var(--texto-3);
}
.selo { display: inline-flex; align-items: center; gap: 6px; color: #86efac; }
.selo svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.selo.inseguro { color: #fcd34d; }
.versao { font-family: var(--mono); }

.legal { margin: 18px 0 0; font-size: 12px; color: var(--texto-3); text-align: center; }

@media (max-width: 480px) {
  .cartao { padding: 28px 20px 18px; border-radius: 20px; }
  .marca h1 { font-size: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  .aurora span { animation: none; }
}
