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

body {
    background: black;
    color: white;
    font-family: 'Inter';
    min-height: 100vh;
}

.container {
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 10px;
    opacity: 0;
    animation: fadeIn 2.5s ease forwards;
    animation-delay: 1s;
}

.header {
    margin-bottom: 40px;
}

.logo {
    width: clamp(190px, 14vw, 200px);
    height: auto;
}

.hero {
    margin-bottom: 2px;
}

.hero h1 {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 300%;
    font-size: clamp(300%, 5vw, 500%);
    font-weight: bold;
    letter-spacing: 3px;
    margin-top: 40px;
    line-height: 0.9;
    opacity: 0;
    animation: fadeIn 2.5s ease forwards;
    animation-delay: 4s;
}

.subtitle,
.access,
.input button {
    font-family: 'Inter', sans-serif;
}

.subtitle {
    font-size: clamp(70%, 2vw, 100%);
    font-weight: 150;
    letter-spacing: 2px;
    opacity: 0;
    animation: fadeIn 2.5s ease forwards;
    animation-delay: 1.5s;
}

.signup {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 30px;
}

.access {
    font-size: 18px;
    margin-bottom: 15px;
}

form {
    width: 30%;
    min-width: 280px;
    perspective: 1000px; /* Mantiene el contexto 3D para el botón hijo */
    opacity: 0;
    animation: fadeIn 2.5s ease forwards;
    animation-delay: 4s;
}

input {
    width: 100%;
    padding: 5px;
    margin-bottom: 12px;
    background: black;
    border: 1px solid white;
    color: white;
    text-align: center;
    font-family: 'Inter';
    font-size: 14px;
}

button {
    position: relative; /* Necesario para posicionar las caras absolutas */
    width: 100%;
    padding: 5px;
    height: 30px;
    border: none;
    background: white;
    color: black;
    cursor: pointer;
    font-family: 'Inter';
    font-size: 14px;
    
    /* Se eliminó overflow: hidden para no romper la perspectiva 3D */
    transform-style: preserve-3d;
    transition:
        transform 1.2s cubic-bezier(.68,-0.55,.27,1.55),
        background .8s;
}

button:disabled {
    cursor: default;
}

/* Caras del botón */
button .front,
button .back {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    backface-visibility: hidden; /* Oculta la cara que queda al revés */
    transition: opacity .3s;
}

button .front {
    transform: rotateX(0deg);
}

button .back {
    /* (media vuelta de espaldas) y se quitó visibility: hidden */
    transform: rotateX(180deg); 
}

/* Spinner */
button .spinner {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 18px;
    height: 18px;
    margin-left: -9px;
    margin-top: -9px;
    border: 2px solid rgba(0, 0, 0, .15);
    border-top: 2px solid black;
    border-radius: 50%;
    animation: spin 1.2s linear infinite;
    opacity: 0;
    transition: opacity .6s;
}

/* Estado loading: Oculta textos y muestra spinner */
button.loading .front {
    opacity: 0;
}

button.loading .back {
    opacity: 0;
}

button.loading .spinner {
    opacity: 1;
}

/* Estado éxito: Da media vuelta completa */
button.success {
    transform: rotateX(180deg); /* Corregido a 180deg para que coincida con .back */
    background: #e8e8e8;
}

input:disabled {
    opacity: .6;
    cursor: default;
}

.social {
    letter-spacing: 3px;
    margin-top: 50px;
    display: flex;
    gap: 20px;
    opacity: 0;
    animation: fadeIn 2.5s ease forwards;
    animation-delay: 4s;

}

.social a {
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 10px;
}

.social img {
    width: 18px;
    opacity: 0;
    animation: fadeIn 2.5s ease forwards;
    animation-delay: 4s;
}

/* Animación única para el spinner */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}



@media (orientation: portrait) {

    .header {
        margin-bottom: 2px;
    }

    .logo {
        width: 50vw;
        margin-bottom: 4.5vh;
    }

    .hero {
        margin-bottom: 4vh;
    }

    .hero h1 {
        font-size: 12vw;
        letter-spacing: 2px;
        margin-top: 25px;
        line-height: 0.95;
    }

    .subtitle {
        font-size: 4vw;
        letter-spacing: 1px;
        margin-bottom: 6vh;
    }

    .signup {
        padding: 20px;
    }

    .access {
        font-size: 16px;
        margin-bottom: 12px;
    }

    form {
        width: 70vw;
        min-width: 0;
    }

    input {
        padding: 8px;
        margin-bottom: 10px;
        font-size: 16px;
    }

    button {
        padding: 8px;
        height: 40px;
        font-size: 16px;
    }

    .social {
        margin-top: 35px;
        gap: 15px;
    }

    .social a {
        font-size: 3vw;
        gap: 6px;
    }

    .social img {
        width: 16px;
    }
}