* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg: #0b0b0d;
    --card: #121317;
    --card-2: #17181c;
    --texto: #f3f0ea;
    --muted: #8f8b84;
    --linha: rgba(243, 240, 234, 0.12);
    --linha-forte: rgba(243, 240, 234, 0.28);
    --erro: #ff7a70;
    --acento: #b8322a;
    --acento-2: #d4493f;
    --acento-brilho: rgba(184, 50, 42, 0.35);
    --focus-ring: rgba(184, 50, 42, 0.22);
    --ease: cubic-bezier(0.65, 0, 0.35, 1);
}

html,
body {
    min-height: 100%;
}

body {
    font-family: "Poppins", sans-serif;
    color: var(--texto);
    background:
        radial-gradient(ellipse at 50% 40%, #1a1b20 0%, var(--bg) 60%, #050506 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;
}

/* ===== CARTAO ===== */

.card {
    position: relative;
    width: min(1080px, 100%);
    height: 660px;
    background: var(--card);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 24px;
    box-shadow: 0 40px 120px rgba(0, 0, 0, 0.55);
    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 1.6s var(--ease), transform 1.6s var(--ease);
}

.form-login {
    left: 50%;
    z-index: 2;
    padding: 78px 56px 36px 84px;
}

.form-cadastro {
    left: 0;
    z-index: 1;
    padding: 78px 86px 36px 56px;
    opacity: 0;
    pointer-events: none;
    transform: translateX(-80px);
}

html.abre-cadastro .form-login,
.card.cadastro .form-login {
    opacity: 0;
    pointer-events: none;
    transform: translateX(80px);
}

html.abre-cadastro .form-cadastro,
.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: 56px;
}

.link {
    position: relative;
    border: 0;
    background: none;
    color: var(--acento-2);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    padding-bottom: 2px;
}

.link::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 1px;
    background: currentColor;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s var(--ease);
}

.link:hover {
    color: #ff6a5e;
}

.link:hover::after {
    transform: scaleX(1);
}

.corpo,
.sucesso {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.form h2,
.sucesso h3 {
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.sub,
.sucesso p {
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.5;
    margin-top: -6px;
    margin-bottom: 6px;
}

/* ===== CAMPOS ===== */

.campo {
    position: relative;
}

.campo input {
    width: 100%;
    height: 54px;
    border-radius: 14px;
    border: 1px solid var(--linha);
    background: var(--card-2);
    color: var(--texto);
    padding: 0 50px;
    font-size: 0.92rem;
    outline: none;
    transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease, transform 0.25s ease;
}

.campo input::placeholder {
    color: #6f6b65;
}

.campo input:hover {
    border-color: var(--linha-forte);
    background: #1b1c21;
}

.campo input:focus {
    border-color: var(--acento);
    background: #1b1c21;
    box-shadow: 0 0 0 4px var(--focus-ring);
}

.campo input.erro {
    border-color: var(--erro);
    box-shadow: 0 0 0 4px rgba(255, 122, 112, 0.12);
}

.campo input.sacudir {
    animation: sacudir 0.45s var(--ease);
}

@keyframes sacudir {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-7px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(2px); }
}

.icone,
.ver-senha {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: #6f6b65;
    display: grid;
    place-items: center;
    transition: color 0.25s ease;
}

.campo:focus-within .icone {
    color: var(--acento-2);
}

.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:hover {
    background: rgba(255, 255, 255, 0.05);
}

.ver-senha svg {
    fill: currentColor;
}

.ver-senha:hover,
.ver-senha[aria-pressed="true"] {
    color: var(--texto);
}

.esqueceu {
    align-self: flex-end;
    margin-top: -4px;
    border: 0;
    background: none;
    color: var(--muted);
    font-size: 0.78rem;
    cursor: pointer;
    transition: color 0.2s ease;
}

.esqueceu:hover {
    color: var(--texto);
}

.feedback {
    min-height: 1.1em;
    color: var(--erro);
    font-size: 0.8rem;
    line-height: 1.4;
}

.feedback.aviso {
    color: #b9b4ab;
}

/* ===== BOTAO PRINCIPAL ===== */

.enviar {
    position: relative;
    overflow: hidden;
    height: 54px;
    border: 0;
    border-radius: 14px;
    color: #fff;
    font-size: 0.98rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    cursor: pointer;
    background: linear-gradient(180deg, var(--acento-2) 0%, var(--acento) 100%);
    box-shadow: 0 10px 26px var(--acento-brilho), inset 0 1px 0 rgba(255, 255, 255, 0.18);
    transition: transform 0.2s ease, box-shadow 0.25s ease, filter 0.25s ease;
}

/* brilho que atravessa o botao no hover */
.enviar::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: -60%;
    width: 50%;
    background: linear-gradient(105deg, transparent, rgba(255, 255, 255, 0.28), transparent);
    transform: skewX(-20deg);
    transition: left 0.7s var(--ease);
    pointer-events: none;
}

.enviar:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 34px rgba(184, 50, 42, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.enviar:hover::before {
    left: 130%;
}

.enviar:active {
    transform: translateY(0) scale(0.985);
}

.texto-btn {
    display: inline-block;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.spinner,
.check {
    position: absolute;
    left: 50%;
    top: 50%;
    opacity: 0;
    pointer-events: none;
}

.spinner {
    width: 22px;
    height: 22px;
    margin: -11px 0 0 -11px;
    border-radius: 50%;
    border: 2.5px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
}

.check {
    width: 26px;
    height: 26px;
    margin: -13px 0 0 -13px;
    fill: none;
    stroke: #fff;
    stroke-width: 2.6;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 30;
    stroke-dashoffset: 30;
}

/* estado de carregamento */
.enviar.carregando {
    pointer-events: none;
    transform: none;
}

.enviar.carregando .texto-btn {
    opacity: 0;
    transform: translateY(-6px);
}

.enviar.carregando .spinner {
    opacity: 1;
    animation: girar 0.8s linear infinite;
}

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

/* estado de sucesso */
.enviar.ok {
    background: linear-gradient(180deg, #2f8f5b 0%, #227047 100%);
    box-shadow: 0 10px 26px rgba(34, 112, 71, 0.35);
    pointer-events: none;
}

.enviar.ok .texto-btn,
.enviar.ok .spinner {
    opacity: 0;
}

.enviar.ok .check {
    opacity: 1;
    animation: desenhar 0.5s var(--ease) forwards;
}

@keyframes desenhar {
    to { stroke-dashoffset: 0; }
}

/* ripple ao clicar */
.ripple {
    position: absolute;
    width: 12px;
    height: 12px;
    margin: -6px 0 0 -6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.45);
    transform: scale(0);
    animation: onda 0.6s ease-out forwards;
    pointer-events: none;
}

@keyframes onda {
    to {
        transform: scale(28);
        opacity: 0;
    }
}

.enviar:focus-visible,
.fantasma:focus-visible,
.link:focus-visible,
.social:focus-visible,
.ver-senha:focus-visible,
.esqueceu:focus-visible {
    outline: 2px solid var(--acento-2);
    outline-offset: 3px;
}

/* ===== DIVISOR E SOCIAIS ===== */

.divisor {
    display: flex;
    align-items: center;
    gap: 14px;
    color: #6f6b65;
    font-size: 0.8rem;
    margin-top: 2px;
}

.divisor::before,
.divisor::after {
    content: "";
    height: 1px;
    flex: 1;
    background: var(--linha);
}

.sociais {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.social {
    position: relative;
    overflow: hidden;
    height: 44px;
    padding: 0 16px;
    border-radius: 14px;
    border: 1px solid var(--linha);
    background: var(--card-2);
    color: var(--texto);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.86rem;
    transition: transform 0.2s ease, border-color 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
}

.social:hover {
    transform: translateY(-2px);
    border-color: var(--acento);
    background: #1d1e23;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.35);
}

.social:active {
    transform: translateY(0);
}

.sucesso {
    text-align: center;
    gap: 16px;
    animation: entrada-esquerda 1.8s var(--ease) 0.25s both;
}

/* o formulario some devagar, indo para o canto inferior esquerdo, sem o botao (que mostra o progresso) */
.card .form.form .corpo.saindo > * {
    animation: saida-lenta 2.6s var(--ease) forwards;
    pointer-events: none;
}

/* indicador de carregamento no centro do formulario (aparece depois que os campos somem) */
.carregador {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 56px;
    height: 56px;
    margin: -28px 0 0 -28px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.6s ease;
}

.carregador.ativo,
.carregador.ok {
    opacity: 1;
}

.carregador.ativo .spinner {
    opacity: 1;
    animation: girar 0.8s linear infinite;
}

.carregador.ok .spinner {
    opacity: 0;
}

.carregador.ok .check {
    opacity: 1;
    animation: desenhar 0.5s var(--ease) forwards;
}

.carregador .spinner {
    left: 50%;
    top: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border-width: 3px;
    border-color: rgba(255, 255, 255, 0.25);
    border-top-color: var(--acento-2);
}

.carregador .check {
    left: 50%;
    top: 50%;
    width: 44px;
    height: 44px;
    margin: -22px 0 0 -22px;
    stroke: var(--acento-2);
}

/* os campos e os botoes sociais somem devagar, deslizando para a direita */
@keyframes saida-lenta {
    to {
        opacity: 0;
        transform: translateX(42px);
        filter: blur(6px);
    }
}

/* a confirmacao aparece devagar, do lado esquerdo */
@keyframes entrada-esquerda {
    from {
        opacity: 0;
        transform: translateX(70px);
        filter: blur(6px);
    }
    to {
        opacity: 1;
        transform: none;
        filter: none;
    }
}



.sucesso[hidden],
.corpo[hidden] {
    display: none;
}

/* ===== PAINEL DE DESTAQUE ===== */

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 52%;
    z-index: 5;
    transform: translateX(0);
    will-change: transform;
}

html.abre-cadastro .overlay,
.card.cadastro .overlay {
    transform: translateX(92.3%);
}

/* animacao de entrada escalonada dos campos ao abrir cada formulario */
.card.cadastro .form-cadastro .campo,
.card:not(.cadastro) .form-login .campo {
    animation: entrar-campo 0.7s var(--ease) both;
    animation-delay: calc(0.22s + var(--i, 0) * 0.09s);
}

.card.cadastro .form-cadastro .troca,
.card:not(.cadastro) .form-login .troca {
    animation: entrar-campo 0.6s var(--ease) both;
}

@keyframes entrar-campo {
    from { opacity: 0; transform: translateY(14px); filter: blur(4px); }
    to { opacity: 1; transform: none; filter: blur(0); }
}

/* caixinha de aviso */
.toast {
    position: absolute;
    left: 50%;
    bottom: 22px;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: calc(100% - 48px);
    padding: 12px 16px 12px 12px;
    border-radius: 14px;
    background: rgba(28, 29, 34, 0.94);
    border: 1px solid rgba(255, 122, 112, 0.35);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
    color: var(--texto);
    font-size: 0.86rem;
    line-height: 1.35;
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 16px) scale(0.96);
    transition: opacity 0.35s ease, transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.toast.ativo {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
}

.toast-icone {
    flex: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--erro);
    color: #1a0b0a;
    font-weight: 700;
    font-size: 0.85rem;
}

.toast-msg {
    min-width: 0;
}

.overlay-arte {
    position: absolute;
    inset: 0;
    clip-path: url("#recorte-onda");
}

html.abre-cadastro .overlay-arte,
.card.cadastro .overlay-arte {
    transform: scaleX(-1);
    transition: transform 0.9s var(--ease);
}

.overlay-arte svg,
.arte {
    width: 100%;
    height: 100%;
    display: block;
}

.arte {
    position: absolute;
    inset: 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.9s var(--ease), transform 0.9s var(--ease);
}

.mensagem h2 {
    display: flex;
    flex-direction: column;
    font-size: 2.6rem;
    line-height: 1.05;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 16px;
}

.grad {
    color: var(--texto);
    opacity: 0.85;
}

.mensagem p {
    max-width: 240px;
    color: rgba(255, 255, 255, 0.82);
    font-size: 0.96rem;
    line-height: 1.55;
    margin-bottom: 26px;
}

.fantasma {
    position: relative;
    overflow: hidden;
    height: 48px;
    padding: 0 26px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.6);
    background: transparent;
    color: #fff;
    font-size: 0.96rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.25s ease, border-color 0.25s ease, transform 0.2s ease, color 0.25s ease;
}

.fantasma::before {
    content: "";
    position: absolute;
    inset: 0;
    background: #fff;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.35s var(--ease);
    z-index: -1;
}

.fantasma:hover {
    color: var(--acento);
    border-color: #fff;
    transform: translateY(-2px);
}

.fantasma:hover::before {
    transform: scaleX(1);
}

.fantasma:active {
    transform: translateY(0);
}

.fantasma span {
    display: inline-block;
    transition: transform 0.3s var(--ease);
}

.fantasma:hover span {
    transform: translateX(4px);
}

.msg-volta {
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
}

html.abre-cadastro .msg-ola,
.card.cadastro .msg-ola {
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
}

html.abre-cadastro .msg-volta,
.card.cadastro .msg-volta {
    opacity: 1;
    pointer-events: auto;
    transform: none;
}

/* ===== RESPONSIVO: TABLET E CELULAR ===== */

@media (max-width: 900px) {
    .card {
        height: auto;
        display: flex;
        flex-direction: column;
    }

    .overlay {
        position: relative;
        order: -1;
        width: 100%;
        height: 300px;
        transform: none !important;
    }

    .overlay-arte,
    html.abre-cadastro .overlay-arte,
    .card.cadastro .overlay-arte {
        clip-path: url("#recorte-mobile");
        transform: none;
    }

    .overlay-texto {
        padding: 36px 28px 48px;
    }

    .formularios {
        position: relative;
        display: grid;
    }

    .form,
    .form-login,
    .form-cadastro,
    html.abre-cadastro .form-login,
    html.abre-cadastro .form-cadastro,
    .card.cadastro .form-login,
    .card.cadastro .form-cadastro {
        position: relative;
        grid-area: 1 / 1;
        align-self: start;
        left: 0;
        width: 100%;
        height: auto;
        padding: 28px 24px 32px;
        transform: none;
    }

    .form-cadastro {
        display: flex;
    }

    html.abre-cadastro .form-login,
    .card.cadastro .form-login {
        display: flex;
        opacity: 0;
        pointer-events: none;
    }

    html.abre-cadastro .form-cadastro,
    .card.cadastro .form-cadastro {
        display: flex;
        opacity: 1;
        pointer-events: auto;
    }

    .form h2,
    .sucesso h3 {
        font-size: 2rem;
    }

    .mensagem h2 {
        font-size: 2.2rem;
    }

    .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: 260px;
    }

    .overlay-texto {
        padding: 28px 24px 40px;
    }

    .mensagem h2 {
        font-size: 2rem;
    }

    .mensagem p {
        font-size: 0.9rem;
        margin-bottom: 18px;
    }

    .troca {
        position: static;
        margin-bottom: 8px;
    }

    .form-cadastro .troca {
        left: auto;
    }

    .campo input {
        height: 50px;
        font-size: 16px; /* evita zoom automatico no iPhone */
    }

    .enviar {
        height: 50px;
    }

    .social {
        height: 42px;
    }
}

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

.campo input.sacudir {
    animation: sacudir 0.45s var(--ease);
}

html.abre-cadastro .form,
html.abre-cadastro .overlay,
html.abre-cadastro .arte,
html.abre-cadastro .mensagem {
    transition: none !important;
}


/* ===== CONFIRMACAO NO CANTO ESQUERDO (computador) =====
   o formulario da direita some e a confirmacao volta na area da esquerda */
@media (min-width: 901px) {
    .overlay-texto {
        transition: opacity 0.9s var(--ease);
    }

    .card.com-sucesso .overlay-texto {
        opacity: 0;
        pointer-events: none;
    }

    .card.com-sucesso .troca {
        opacity: 0;
        pointer-events: none;
    }

    .troca {
        transition: opacity 0.6s ease;
    }

    .card.com-sucesso .form-login,
    .card.com-sucesso .form-cadastro {
        z-index: 6; /* fica por cima do painel para a confirmacao aparecer na esquerda */
    }

    .form-login .sucesso,
    .form-cadastro .sucesso {
        position: absolute;
        top: 0;
        width: 104%;
        height: 100%;
        justify-content: center;
        padding: 0 56px;
        background: rgba(18, 19, 23, 0.94);
    }

    .form-login .sucesso {
        left: -100%;
    }

    .form-cadastro .sucesso {
        left: 0;
    }
}
