:root {
    --fundo: #05070d;
    --painel: rgba(16, 20, 30, 0.62);
    --texto: #eef3ff;
    --texto-fraco: #8f9cb5;
    --acento: #35e0ff;
    --acento-2: #7b5cff;
    --acento-3: #ff4fd8;
    --alerta: #ffb454;
}

* {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
    margin: 0;
}

body {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: var(--fundo);
    color: var(--texto);
    font-family: "Segoe UI", Roboto, Arial, sans-serif;
    overflow: hidden;
}

/* ---------------------------------------------------------------
   Fundo animado
   --------------------------------------------------------------- */

.fundo {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

/* Nevoa de cor que respira e gira lentamente. */
.fundo__aurora {
    position: absolute;
    inset: -30%;
    background:
        radial-gradient(38% 44% at 22% 28%, rgba(53, 224, 255, 0.30), transparent 60%),
        radial-gradient(42% 46% at 78% 24%, rgba(123, 92, 255, 0.30), transparent 62%),
        radial-gradient(46% 50% at 50% 84%, rgba(255, 79, 216, 0.22), transparent 64%);
    filter: blur(24px);
    animation: girarAurora 34s linear infinite;
}

/* Grade em perspectiva correndo para o horizonte.
   A perspectiva vai no elemento-pai para a grade nao "dobrar" alem do
   ponto de fuga (o artefato de losango que aparece com perspective curta). */
.fundo__grade {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 55%;
    perspective: 260px;
    perspective-origin: 50% 0%;
    mask-image: linear-gradient(to top, #000 5%, rgba(0, 0, 0, 0.35) 45%, transparent 78%);
    -webkit-mask-image: linear-gradient(to top, #000 5%, rgba(0, 0, 0, 0.35) 45%, transparent 78%);
    opacity: 0.5;
}

.fundo__grade::before {
    content: "";
    position: absolute;
    left: -25%;
    right: -25%;
    top: 0;
    height: 300%;
    background-image:
        linear-gradient(rgba(53, 224, 255, 0.22) 1px, transparent 1px),
        linear-gradient(90deg, rgba(53, 224, 255, 0.16) 1px, transparent 1px);
    background-size: 60px 60px;
    transform: rotateX(78deg);
    transform-origin: 50% 0%;
    animation: correrGrade 3.4s linear infinite;
}

.fundo__particulas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0.9;
}

/* Duas esferas de luz flutuando fora de fase. */
.fundo__brilho {
    position: absolute;
    width: 460px;
    height: 460px;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.45;
    mix-blend-mode: screen;
}

.fundo__brilho--um {
    top: -140px;
    left: -120px;
    background: radial-gradient(circle, var(--acento) 0%, transparent 68%);
    animation: flutuarUm 18s ease-in-out infinite;
}

.fundo__brilho--dois {
    right: -160px;
    bottom: -160px;
    background: radial-gradient(circle, var(--acento-2) 0%, transparent 68%);
    animation: flutuarDois 22s ease-in-out infinite;
}

/* Linha de varredura descendo pela tela. */
.fundo__varredura {
    position: absolute;
    left: 0;
    right: 0;
    height: 180px;
    background: linear-gradient(to bottom, transparent, rgba(53, 224, 255, 0.07), transparent);
    animation: varrer 9s linear infinite;
}

@keyframes girarAurora {
    from { transform: rotate(0deg) scale(1.05); }
    50%  { transform: rotate(180deg) scale(1.18); }
    to   { transform: rotate(360deg) scale(1.05); }
}

@keyframes correrGrade {
    from { background-position: 0 0, 0 0; }
    to   { background-position: 0 60px, 0 0; }
}

@keyframes flutuarUm {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50%      { transform: translate(90px, 70px) scale(1.15); }
}

@keyframes flutuarDois {
    0%, 100% { transform: translate(0, 0) scale(1.1); }
    50%      { transform: translate(-110px, -60px) scale(0.95); }
}

@keyframes varrer {
    from { transform: translateY(-200px); }
    to   { transform: translateY(100vh); }
}

/* ---------------------------------------------------------------
   Painel central
   --------------------------------------------------------------- */

.painel {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 460px;
    padding: 46px 36px 40px;
    text-align: center;
    background: var(--painel);
    backdrop-filter: blur(18px) saturate(140%);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
    border: 1px solid rgba(53, 224, 255, 0.20);
    border-radius: 20px;
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.03),
        0 24px 70px rgba(0, 0, 0, 0.55),
        0 0 90px rgba(53, 224, 255, 0.12);
    animation: entrarPainel 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

/* Angulo animavel do contorno. Sem suporte a @property o contorno
   simplesmente fica parado, sem quebrar o layout. */
@property --angulo {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}

/* Contorno luminoso girando na borda do painel.
   Gira o ANGULO do gradiente, nunca o elemento: rotacionar o ::before
   arrastaria o retangulo inteiro para fora do painel. */
.painel::before {
    content: "";
    position: absolute;
    inset: -1px;
    border-radius: 20px;
    padding: 1px;
    background: conic-gradient(
        from var(--angulo),
        transparent 0deg,
        rgba(53, 224, 255, 0.85) 40deg,
        rgba(123, 92, 255, 0.85) 90deg,
        transparent 150deg,
        transparent 360deg
    );
    -webkit-mask:
        linear-gradient(#000 0 0) content-box,
        linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask:
        linear-gradient(#000 0 0) content-box,
        linear-gradient(#000 0 0);
    mask-composite: exclude;
    animation: girarBorda 6s linear infinite;
    pointer-events: none;
}

.painel__selo {
    display: inline-block;
    margin-bottom: 18px;
    padding: 5px 14px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 2.4px;
    text-transform: uppercase;
    color: var(--acento);
    background: rgba(53, 224, 255, 0.08);
    border: 1px solid rgba(53, 224, 255, 0.28);
    border-radius: 999px;
}

.titulo {
    margin: 0 0 10px;
    font-size: 52px;
    font-weight: 700;
    letter-spacing: 8px;
    background: linear-gradient(100deg, var(--acento), #ffffff 45%, var(--acento-3));
    background-size: 220% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: deslizarBrilhoTitulo 7s ease-in-out infinite;
}

.subtitulo {
    margin: 0 0 32px;
    color: var(--texto-fraco);
    font-size: 15px;
    line-height: 1.5;
}

.botao {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-width: 220px;
    padding: 15px 30px;
    overflow: hidden;
    color: #04121a;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.6px;
    text-decoration: none;
    background: linear-gradient(120deg, var(--acento), var(--acento-2));
    border: 0;
    border-radius: 12px;
    box-shadow: 0 0 24px rgba(53, 224, 255, 0.40);
    animation: pulsar 2.8s ease-in-out infinite;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

/* Reflexo que cruza o botao. */
.botao::after {
    content: "";
    position: absolute;
    top: 0;
    left: -120%;
    width: 60%;
    height: 100%;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.55), transparent);
    transform: skewX(-20deg);
    animation: reflexo 3.6s ease-in-out infinite;
}

.botao:hover {
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 0 42px rgba(53, 224, 255, 0.70);
}

.botao:active {
    transform: translateY(-1px) scale(0.99);
}

.botao__icone {
    display: inline-flex;
    animation: descerIcone 2.2s ease-in-out infinite;
}

.botao--inativo {
    color: var(--texto-fraco);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.10);
    box-shadow: none;
    cursor: not-allowed;
    animation: none;
}

.botao--inativo::after,
.botao--inativo:hover {
    animation: none;
    transform: none;
    box-shadow: none;
}

.detalhe {
    margin: 20px 0 0;
    color: var(--texto-fraco);
    font-size: 13px;
    letter-spacing: 0.4px;
}

.detalhe--alerta {
    color: var(--alerta);
}

@keyframes entrarPainel {
    from { opacity: 0; transform: translateY(26px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes girarBorda {
    to { --angulo: 360deg; }
}

@keyframes deslizarBrilhoTitulo {
    0%, 100% { background-position: 0% 50%; }
    50%      { background-position: 100% 50%; }
}

@keyframes pulsar {
    0%, 100% { box-shadow: 0 0 24px rgba(53, 224, 255, 0.40); }
    50%      { box-shadow: 0 0 40px rgba(123, 92, 255, 0.65); }
}

@keyframes reflexo {
    0%       { left: -120%; }
    55%, 100% { left: 130%; }
}

@keyframes descerIcone {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(3px); }
}

/* Responsivo */
@media (max-width: 480px) {
    .titulo { font-size: 40px; letter-spacing: 5px; }
    .painel { padding: 36px 24px 30px; }
}

/* Respeita quem pediu menos movimento no sistema. */
@media (prefers-reduced-motion: reduce) {
    .fundo__aurora,
    .fundo__grade::before,
    .fundo__brilho,
    .fundo__varredura,
    .painel,
    .painel::before,
    .titulo,
    .botao,
    .botao::after,
    .botao__icone {
        animation: none !important;
    }

    .fundo__varredura { display: none; }
}
