* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg: #070d19;
    --card: #09131f;
    --texto: #f5f7fb;
    --muted: #9aa3b4;
    --linha: rgba(168, 180, 204, 0.28);
    --erro: #ff8b9a;
    --link: #ff9a4a;
    --link-hover: #ffc07a;
    --focus: #ff8a3a;
    --focus-ring: rgba(255, 122, 26, 0.18);
    --grad-btn: linear-gradient(90deg, #ff8a1a 0%, #ff5c1c 52%, #ff3d2e 100%);
    --grad-text: linear-gradient(100deg, #ffb347 0%, #ff7a1d 50%, #ff4a22 100%);
    --sombra-btn: rgba(255, 90, 30, 0.28);
}

html,
body {
    min-height: 100%;
}

body {
    font-family: "Poppins", sans-serif;
    color: var(--texto);
    background:
        radial-gradient(ellipse at 50% 42%, #2a1810 0%, var(--bg) 58%, #05070d 100%);
    transition: background 0.75s cubic-bezier(0.65, 0, 0.35, 1);
}

body:has(.card.cadastro),
body.modo-cadastro {
    --link: #7d74ff;
    --link-hover: #a79dff;
    --focus: #4d8dff;
    --focus-ring: rgba(47, 107, 255, 0.16);
    --grad-btn: linear-gradient(90deg, #1a90fe 0%, #2d6cff 52%, #5f34fd 100%);
    --grad-text: linear-gradient(100deg, #4ea2ff 0%, #6a86ff 38%, #8b62ff 70%, #b44dff 100%);
    --sombra-btn: rgba(47, 90, 255, 0.28);
    background:
        radial-gradient(ellipse at 50% 42%, #121b2e 0%, var(--bg) 58%, #05070d 100%);
}

button,
input {
    font-family: inherit;
}

.defs {
    position: absolute;
    width: 0;
    height: 0;
}

.sr {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.palco {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 32px 20px;
}

.card {
    position: relative;
    width: min(1080px, 100%);
    height: 660px;
    background: var(--card);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 28px;
    box-shadow: 0 40px 120px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

.formularios,
.form,
.overlay {
    height: 100%;
}

.form {
    position: absolute;
    top: 0;
    width: 50%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 14px;
    transition: opacity 0.45s ease, transform 0.7s cubic-bezier(0.65, 0, 0.35, 1);
}

.form-login {
    left: 50%;
    z-index: 2;
    padding: 78px 52px 36px 84px;
}

.form-cadastro {
    left: 0;
    z-index: 1;
    padding: 78px 86px 36px 48px;
    opacity: 0;
    pointer-events: none;
    transform: translateX(28px);
}

.card.cadastro .form-login {
    opacity: 0;
    pointer-events: none;
    transform: translateX(28px);
}

.card.cadastro .form-cadastro {
    opacity: 1;
    pointer-events: auto;
    transform: none;
    z-index: 3;
}

.troca {
    position: absolute;
    top: 26px;
    right: 34px;
    color: var(--muted);
    font-size: 0.78rem;
}

.form-cadastro .troca {
    right: auto;
    left: 48px;
}

.link {
    border: 0;
    background: none;
    color: var(--link);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.link:hover {
    color: var(--link-hover);
}

.corpo,
.sucesso {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.form h2,
.sucesso h3 {
    font-size: 2.35rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.1;
}

.sub,
.sucesso p {
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.5;
    margin-top: -6px;
    margin-bottom: 6px;
}

.campo {
    position: relative;
}

.campo input {
    width: 100%;
    height: 54px;
    border-radius: 999px;
    border: 1px solid var(--linha);
    background: rgba(4, 10, 18, 0.35);
    color: white;
    padding: 0 48px;
    font-size: 0.92rem;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.campo input::placeholder {
    color: #8d96a8;
}

.campo input:hover {
    border-color: rgba(186, 198, 222, 0.45);
}

.campo input:focus {
    border-color: var(--focus);
    box-shadow: 0 0 0 4px var(--focus-ring);
}

.campo input.erro {
    border-color: var(--erro);
}

.icone,
.ver-senha {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: #a7b0c2;
    display: grid;
    place-items: center;
}

.icone {
    left: 18px;
    pointer-events: none;
}

.icone svg,
.ver-senha svg,
.social svg {
    width: 18px;
    height: 18px;
    display: block;
}

.icone svg {
    fill: currentColor;
}

.ver-senha {
    right: 10px;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
}

.ver-senha svg {
    fill: currentColor;
}

.ver-senha:hover,
.ver-senha[aria-pressed="true"] {
    color: white;
}

.esqueceu {
    align-self: flex-end;
    margin-top: -4px;
    border: 0;
    background: none;
    color: var(--link);
    font-size: 0.78rem;
    cursor: pointer;
}

.esqueceu:hover {
    color: var(--link-hover);
}

.feedback {
    min-height: 1.1em;
    color: var(--erro);
    font-size: 0.8rem;
    line-height: 1.4;
}

.feedback.aviso {
    color: #b7c0d4;
}

.enviar {
    height: 54px;
    border: 0;
    border-radius: 999px;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    background: var(--grad-btn);
    box-shadow: 0 10px 24px var(--sombra-btn);
    transition: transform 0.2s ease, filter 0.2s ease;
}

.enviar:hover {
    transform: translateY(-1px);
    filter: brightness(1.06);
}

.enviar:active {
    transform: translateY(0);
}

.enviar:focus-visible,
.fantasma:focus-visible,
.link:focus-visible,
.social:focus-visible,
.ver-senha:focus-visible,
.esqueceu:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 3px;
}

.divisor {
    display: flex;
    align-items: center;
    gap: 14px;
    color: #8b93a5;
    font-size: 0.82rem;
    margin-top: 2px;
}

.divisor::before,
.divisor::after {
    content: "";
    height: 1px;
    flex: 1;
    background: rgba(255, 255, 255, 0.12);
}

.sociais {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.social {
    height: 44px;
    padding: 0 16px;
    border-radius: 999px;
    border: 1px solid var(--linha);
    background: transparent;
    color: #eef2f8;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.88rem;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.social:hover {
    border-color: rgba(196, 206, 226, 0.5);
    background: rgba(255, 255, 255, 0.03);
}

.sucesso {
    text-align: center;
    gap: 16px;
}

.sucesso[hidden],
.corpo[hidden] {
    display: none;
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 52%;
    z-index: 5;
    transition: transform 0.7s cubic-bezier(0.65, 0, 0.35, 1);
}

.card.cadastro .overlay {
    transform: translateX(92.3%);
}

.overlay-arte {
    position: absolute;
    inset: 0;
    clip-path: url("#recorte-onda");
    transition: transform 0.7s cubic-bezier(0.65, 0, 0.35, 1);
}

.card.cadastro .overlay-arte {
    transform: scaleX(-1);
}

.overlay-arte svg,
.arte {
    width: 100%;
    height: 100%;
    display: block;
}

.arte {
    position: absolute;
    inset: 0;
    transition: opacity 0.7s cubic-bezier(0.65, 0, 0.35, 1);
}

.arte-azul {
    opacity: 0;
}

.arte-laranja {
    opacity: 1;
}

.card.cadastro .arte-azul {
    opacity: 1;
}

.card.cadastro .arte-laranja {
    opacity: 0;
}

.overlay-texto {
    position: relative;
    z-index: 1;
    height: 100%;
    display: grid;
    align-items: center;
    padding: 48px 22% 48px 52px;
}

.mensagem {
    grid-area: 1 / 1;
    max-width: 280px;
    transition: opacity 0.35s ease, transform 0.45s ease;
}

.mensagem h2 {
    display: flex;
    flex-direction: column;
    font-size: 2.75rem;
    line-height: 1.05;
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: 16px;
}

.grad {
    background: var(--grad-text);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.mensagem p {
    max-width: 230px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.98rem;
    line-height: 1.55;
    margin-bottom: 26px;
}

.fantasma {
    height: 48px;
    padding: 0 26px;
    border-radius: 999px;
    border: 1.5px solid rgba(255, 255, 255, 0.88);
    background: rgba(7, 18, 48, 0.28);
    color: white;
    font-size: 0.98rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.fantasma:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

.msg-volta {
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
}

.card.cadastro .msg-ola {
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
}

.card.cadastro .msg-volta {
    opacity: 1;
    pointer-events: auto;
    transform: none;
}

@media (max-width: 900px) {
    .card {
        height: auto;
        display: flex;
        flex-direction: column;
    }

    .overlay {
        position: relative;
        order: -1;
        width: 100%;
        height: 320px;
        transform: none !important;
    }

    .overlay-arte,
    .card.cadastro .overlay-arte {
        clip-path: url("#recorte-mobile");
        transform: none;
    }

    .overlay-texto {
        padding: 36px 28px 48px;
    }

    .formularios {
        position: relative;
    }

    .form,
    .form-login,
    .form-cadastro,
    .card.cadastro .form-login,
    .card.cadastro .form-cadastro {
        position: relative;
        left: 0;
        width: 100%;
        height: auto;
        padding: 28px 22px 32px;
        transform: none;
    }

    .form-cadastro {
        display: none;
    }

    .card.cadastro .form-login {
        display: none;
    }

    .card.cadastro .form-cadastro {
        display: flex;
        opacity: 1;
        pointer-events: auto;
    }

    .mensagem h2,
    .form h2,
    .sucesso h3 {
        font-size: 2.1rem;
    }

    .sociais {
        flex-wrap: nowrap;
    }

    .social {
        flex: 1;
        justify-content: center;
        padding: 0 8px;
        font-size: 0.78rem;
        gap: 6px;
    }
}

@media (max-width: 520px) {
    .palco {
        padding: 12px;
    }

    .card {
        border-radius: 20px;
    }

    .overlay {
        height: 280px;
    }

    .troca {
        position: static;
        margin-bottom: 8px;
    }

    .social {
        flex: 1;
        justify-content: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    .form,
    .overlay,
    .overlay-arte,
    .arte,
    .mensagem,
    .enviar,
    .fantasma {
        transition: none;
    }
}
