@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800;900&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

/* Prevent scrolling effect */
body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: #000;
    overflow: hidden; /* Prevent scrolling */
    width: 100vw;
    height: 100vh;
}
.wrap {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 0; /* Lower z-index for background triangles */
    perspective: 1000px;
    overflow: hidden; /* Prevent background animations from causing scrolling */
    display: flex;
    justify-content: center;
    align-items: center;
}
.wrapper {
    position: relative;
    width: 100%;
    max-width: 400px;
    height: 450px;
    perspective: 1000px;
    padding: 0%;
    border-radius: 10px;
    transition: .5s;
}

.wrapper:hover {
    border: 5px solid #0ef;
    box-shadow: 0 0 20px #0ef, inset 0 0 20px #0ef;
}

.form-container {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.8s;
}

.wrapper.flipped .form-container {
    transform: rotateY(180deg);
}

.form-box {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.6);
    border: 5px solid #333;
    border-radius: 15px;
    box-shadow: none; /* Disable shadow on inactive state */
    transition: all 0.3s ease-in-out;
}

.wrapper:hover .form-box {
    box-shadow: 0 0 20px #0ef, inset 0 0 20px #0ef;
}

h2 {
    font-size: 1.8em;
    text-align: center;
    color: #fff;
    margin-bottom: 20px;
    transition: .5s;
}

.wrapper:hover h2 {
    color: #0ef;
}

.input-box {
    position: relative;
    width: 100%;
    margin: 20px 0;
}

.input-box input {
    width: 100%;
    height: 45px;
    background: transparent;
    border: 2px solid #333;
    outline: none;
    border-radius: 5px;
    font-size: 1em;
    color: #fff;
    padding: 10px 45px;
    transition: .5s;
}

.wrapper:hover .input-box input {
    border: 2px solid #0ef;
    box-shadow: 0 0 10px #0ef, inset 0 0 10px #0ef;
}

.input-box input::placeholder {
    color: rgba(255, 255, 255, .3);
}

.input-box .icon {
    position: absolute;
    top: 50%;
    left: 10px;
    transform: translateY(-50%);
    color: #fff;
    font-size: 1.5em;
    transition: .5s;
}

.wrapper:hover .input-box .icon {
    color: #0ef;
}

.forgot-pass {
    margin: -10px 0 15px;
    text-align: right;
}

.forgot-pass a {
    color: #fff;
    text-decoration: underline;
}

button {
    width: 100%;
    height: 45px;
    background: linear-gradient(45deg, #333, #444);
    border: none;
    outline: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1.1em;
    color: #fff;
    font-weight: 500;
    transition: .5s;
}

button:hover {
    background: #0ef;
    color: #000;
    box-shadow: 0 0 20px #0ef;
}

button:focus {
    outline: 2px solid #0ef;
}

.register-link {
    font-size: .9em;
    text-align: center;
    margin: 20px 0;
}

.register-link p {
    color: #fff;
}

.register-link a {
    color: #333;
    text-decoration: none;
    font-weight: 600;
}

#registerForm {
    transform: rotateY(180deg);
}

.wrapper:hover .register-link a {
    color: #0ef;
}

.register-link a:hover {
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 768px) {
    .wrapper {
        max-width: 350px;
        height: 400px;
    }

    h2 {
        font-size: 1.6em;
    }

    button {
        font-size: 1em;
    }
}

@media (max-width: 480px) {
    .wrapper {
        max-width: 300px;
        height: 450px;
    }

    h2 {
        font-size: 1.4em;
    }

    .input-box input {
        font-size: 0.9em;
        padding: 10px 40px;
    }

    .input-box .icon {
        font-size: 1.3em;
    }

    button {
        height: 40px;
        font-size: 0.9em;
    }
}

@media (max-width: 320px) {
    .wrapper {
        max-width: 260px;
        height: 480px;
    }

    h2 {
        font-size: 1.2em;
    }

    .input-box input {
        font-size: 0.8em;
        padding: 8px 35px;
    }

    .input-box .icon {
        font-size: 1.2em;
    }

    button {
        height: 35px;
        font-size: 0.8em;
    }
}
/* Triangle Styling */
.tri {
    position: absolute;
    width: 0;
    height: 0;
    border-left: 5px solid transparent; /* Reduced size */
    border-right: 5px solid transparent; /* Reduced size */
    border-bottom: 10px solid lightgray; /* Light gray color */
    transform-origin: 50% 50%;
    animation: randomMovement 10s infinite ease-in-out;
    opacity: 0.8;
}

/* Keyframes for random movement */
@keyframes randomMovement {
    0% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(150px, 100px) rotate(180deg); }
    50% { transform: translate(-200px, -150px) rotate(360deg); }
    75% { transform: translate(250px, -100px) rotate(540deg); }
    100% { transform: translate(0, 0) rotate(720deg); }
}
.wrap {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 0; /* Lower z-index for background triangles */
    perspective: 1000px;
    overflow: hidden; /* Prevent background animations from causing scrolling */
}
/* Adjusting the size of the background animation to prevent overflow */
.wrap .triangle {
    position: absolute;
    width: 0;
    height: 0;
    border-left: 30px solid transparent; /* Reduce size here */
    border-right: 30px solid transparent;
    border-bottom: 60px solid rgba(233, 30, 99, 0.7); /* Reduce height here */
    animation: move 10s infinite linear;
}

.wrap .triangle:nth-child(2) {
    border-bottom-color: rgba(0, 188, 212, 0.7);
    animation-duration: 12s;
}

.wrap .triangle:nth-child(3) {
    border-bottom-color: rgba(156, 39, 176, 0.7);
    animation-duration: 15s;
}

/* Keyframes to handle triangle animation */
@keyframes move {
    from {
        transform: translateY(0px);
    }
    to {
        transform: translateY(-1000px); /* Adjust height to prevent overflow */
    }
}
/* Keyframes to handle triangle animation */
@keyframes move {
    from {
        transform: translateY(0px);
    }
    to {
        transform: translateY(-1000px); /* Adjust height to prevent overflow */
    }
}
