@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@200;300;400;600;700&display=swap');

*{
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

body{
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    /* background: url('/static/images/ImmaginePippo5.jpeg') no-repeat; */
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.5), /* color at the top */
        rgba(0, 0, 0, 0.2) 50%, /* color in the middle */
        rgba(0, 0, 0, 0.4) 100% /* color at the bottom */
      ),
      url('/static/images/ImmaginePippo8.jpeg'); 
    background-size: cover;
    background-position: center;
}
header{
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 99;
}
header img {
    width: 150px; /* Adjust the width as needed */
    height: auto; /* Maintain aspect ratio */
    margin: 0px 0px; /* Adjust margins for spacing */
}

.navigation a {
    position: relative;
    font-size: 20px;
    color: #fff;
    text-decoration: none;
    font-weight: 500;
    margin-left: 20px;
    text-shadow: 2px 2px 2px rgba(255, 255, 255, 0.5); /* White text shadow */

}
.navigation a::after{
    content: '';
    position: absolute;
    left: 0;
    bottom: -6px;
    width: 100%;
    height: 3px;
    background: #fff;
    border-radius: 5px;
    transform-origin: right;
    transform: scaleX(0);
    transition: transform 0.5s;
}
.navigation a:hover::after{
    transform-origin: left;
    transform: scaleX(1);

}
.navigation .btnLogin-popup{
    width: 130px;
    height: 50px;
    background: transparent;
    border: 2px solid #fff;
    outline: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.1em;
    color: #fff;
    font-weight: 500;
    margin-left: 40px;
    transition: 0.5s;
}
.navigation .btnLogin-popup:hover{
    background: #fff;
    color: #162938;
}

/* .wrapper {
    position: relative;
    width: 400px;
    height: 460px;
    background: rgba(255, 255, 255, 0.6);
    border: 2px solid rgba(255, 255, 255, 0.7);
    border-radius: 20px;
    backdrop-filter: blur(20px);
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.2);
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    transform: scale(0);
    transition: transform .5s ease, height .2s ease;
} */
.wrapper {
    position: relative;
    width: 80%; /* 80% della larghezza dello schermo */
    max-width: 400px; /* Limita la larghezza massima */
    height: 460px;
    background: rgba(255, 255, 255, 0.6); /* Background traslucido */
    border: 2px solid rgba(255, 255, 255, 0.7);
    border-radius: 20px;
    backdrop-filter: blur(20px);
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.2);
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    transform: scale(0);
    transition: transform .5s ease, height .2s ease;
}

.wrapper.active-popup{
    transform: scale(1);
    z-index: 100;
}
.wrapper.active{
   height: 600px; 
}
.wrapper .form-box{
    width: 100%;
    padding: 40px;
} 
.wrapper .form-box.login{
    transition: transform .18s ease;
    transform: translateX(0);
}

.wrapper.active .form-box.login{
    transition: none;
    transform: translateX(-400px);
}

.wrapper .form-box.register{
    position: absolute;
    transform: translateX(400px);
}
.wrapper.active .form-box.register{
    transition: transform .18s ease;
    transform: translateX(0);
}

.wrapper .icon-close{
    position: absolute;
    top: 0;
    right: 0;
    width: 45px;
    height: 45px;
    background: #162938;
    font-size: 2em;
    color: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    border-bottom-left-radius: 20px;
    cursor: pointer;
    z-index: 1;
}


.form-box h2 {
    font-size: 2em;
    color: #162938;
    text-align: center;
}
.input-box {
    position: relative;
    width: 100%;
    height: 50px;
    border-bottom: 2px solid #162938;
    margin: 30px 0;
    transition: 0.5s;
}
.input-box label{
    position: absolute;
    top: 50%;
    left: 5px;
    transform: translateY(-50%);
    font-size: 1em;
    color: #162938;
    font-weight: 500;
    pointer-events: none;
    transition: 0.5s;
}
.input-box input:focus~label,
.input-box input:valid~label{
    top: -5px;


}
.input-box input{
    width: 100%;
    height: 100%;
    background: transparent;
    border: none;
    outline: none;
    font-size: 1em;
    color: #162938;
    font-weight: 600;
    padding: 0 35px 0 5px;
}
.input-box .icon{
    position: absolute;
    right: 8px;
    font-size: 1.2em;
    color: #162938;
    line-height: 57px;

}
.remember-forgot{
    font-size: .9em;
    color: #162938;
    font-weight: 500;
    margin: -15px 0 15px;
    display: flex;
    justify-content: space-between;
}

.remember-forgot label input {
    accent-color: #162938;
    margin-right: 3px;
}
.remember-forgot a{
    color: #162938;
    text-decoration: none;
}
.remember-forgot a:hover{
    text-decoration: underline;
}
.btn {
    width: 100%;
    height: 45px;
    background: #162938;
    border: none ;
    outline: none;
    border-radius: 6px;
    cursor: pointer;
    color: #fff;
    font-size: 1em;
}
/* Add custom styles for the disabled button */
.btn-register.disabled {
    background-color: #ccc; /* Change the background color */
    cursor: auto; /* Change the cursor */
}

.login-register{
    font-size: .9em;
    color: #162938;
    text-align: center;
    font-weight: 500;
    margin: 25px 0 10px;
}
.login-register p a {
    color: #162938;
    text-decoration: none;
    font-weight: 600;
}
.login-register p a:hover{
    text-decoration: underline;
}


/* ----------------------------------------------------------------------BADGE RECAPTCHA (SIMBOLO)----------------------------------------------------------- */

/* Modifica la posizione del badge di reCAPTCHA */
.g-recaptcha-badge {
    position: fixed !important;
    bottom: 20px !important; /* Aggiusta la distanza dal fondo della pagina */
    right: 20px !important;  /* Aggiusta la distanza da destra */
    transform: scale(0.2);   /* Riduce la dimensione del badge */
    z-index: 9999;           /* Garantisce che il badge resti visibile sopra ad altri contenuti */
}


/* ----------------------------------------------------------------------HAMBURGER----------------------------------------------------------- */
.hamburger {
    display: none; /* Initially hide the hamburger button */
    flex-direction: column;
    width: 2rem; /* Use relative units */
    height: 2rem; /* Adjust size with relative units */
    cursor: pointer;
    position: fixed; /* Fix the position relative to the viewport */
    top: 1rem; /* Distance from the top of the viewport */
    right: 1rem; /* Distance from the right of the viewport */
    z-index: 1000; /* Ensure it's above other content */
}

.hamburger .bar {
    width: 100%;
    height: 0.25rem; /* Slightly thinner bars */
    background-color: #fff;
    margin: 0.3rem 0; /* Adjust spacing between bars */
    transition: 0.4s;
}

/* Active state of hamburger for rotation */
.hamburger.active .bar:nth-child(1) {
    transform: rotate(-45deg) translate(-0.5rem, 0.5rem);
}

.hamburger.active .bar:nth-child(2) {
    opacity: 0;
}

.hamburger.active .bar:nth-child(3) {
    transform: rotate(45deg) translate(-0.5rem, -0.5rem);
}
/* --------------------------------------------------------------------------------------------------------------------------------- */

/* --------------------------------------------------------  MESSAGGI DAL BACKEND  ------------------------------------------------------------------------- */

/* Flash Messages Container */
.alert-messages {
    position: fixed;
    top: 50%;
    left: 50%;
    right: 0;
    padding: 10px;
    background-color: #333;
    color: #fff;
    text-align: center;
    z-index: 9999;
    transform: translate(-50%, -50%);
    transition: opacity 1s;
}

/* Initially set opacity to 1 (fully visible) */
.alert-messages.show {
    opacity: 1;
}

/* Set opacity to 0 (fully transparent) when hiding */
.alert-messages.hide {
    opacity: 0;
}

/* Flash Message Styles */
.alert {
    margin-bottom: 10px;
    padding: 10px 20px;
    border-radius: 5px;
}

.alert-success {
    background-color: #4CAF50; /* Green background for success messages */
    color: #fff;
}

.alert-info {
    background-color: #2196F3; /* Blue background for info messages */
    color: #fff;
}

.alert-warning {
    background-color: #FFC107; /* Yellow background for warning messages */
    color: #333;
}

.alert-danger {
    background-color: #F44336; /* Red background for error messages */
    color: #fff;
}
/* --------------------------------------------------------------------------------------------------------------------------------- */
/* --------------------------------------------------------------------------------------------------------------------------------- */

/* ---------------------ERRORE DI MATCHING TRA LE PASSWORD DURANTE LA REGISTRAZIONE" */
/* Add custom styles for the password mismatch error message */
.error-message {
    font-size: 0.9em; /* Adjust the font size as needed */
    color: red; /* Red color for error messages */
    position: absolute;
    left: 0;
}

/* Adjust spacing between the error message and input */
.input-box.error .error-message {
    top: calc(100% + 10px); /* Increase the spacing */
}

/* Show the error message only when there's an error */
.input-box.error .error-message {
    display: block;
}

/* Hide the error message by default */
.error-message {
    display: none;
}
#error-message-container {
    position: relative;
}

#password-match-error {
    color: #f44336; /* Set the error message color to red or your preferred color */
    font-size: 14px;
    margin-top: 5px; /* Add some space between the input and the error message */
}

.remember-forgot {
    margin-top: 10px; /* Add some space between the checkbox and the error message */
}

input:-webkit-autofill {
    
    -webkit-box-shadow: 0 0 0 1000px;
    background-color: transparent;
    border-radius: 5px !important; /* Add rounded corners */
    box-shadow: 0 0 0px 1000px rgb(222, 201, 201) inset !important;}



/* Show hamburger on small screens */
@media (max-width: 700px) {
    .hamburger {
        display: flex; /* Make the hamburger visible on smaller screens */
    }
}

/* ---------Media query for smaller screens--------------- */
@media (max-width: 700px) {
    .wrapper {
        top: 70%; /* Adjust the percentage to lower or raise the position */
        transform: translate(0%, +20%) scale(0);
        transition: transform .5s ease, height .2s ease;
    }
    .wrapper.active-popup{
        transform: scale(1);;
    }

    header {
        padding: 10px 15px; /* Adjust header padding */
    }

    header img {
        width: 100px; /* Adjust logo size */
    }

    .navigation {
        display: none; /* Initially hide navigation links */
        flex-direction: column;
        align-items: center;
        position: absolute;
        top: 150px; /* Adjust top position as needed */
        right: 0;
        background: rgba(0, 0, 0, 0.5); /* Semi-transparent background */
        width: 100%;
        transition: 0.5s;
    }

    .navigation a {
        margin: 10px 0; /* Adjust spacing between links */
    }

    .navigation.active {
        display: flex; /* Show navigation links when active */
        align-items: center;
    }

    .navigation .btnLogin-popup {
        margin-top: 10px; /* Adjust spacing between button and links */
        padding: 8px 12px;
        font-size: 0.9em;
        margin-left: 0;
    }

    /* Show hamburger button for small screens */
    .hamburger {
        display: flex;
    }
}


/* Media query per iPhone 13 */
@media only screen 
and (min-device-width: 390px) 
and (max-device-width: 428px) 
and (-webkit-device-pixel-ratio: 3) {
        /* Inserisci qui le regole CSS per l'iPhone 13 */
        .hamburger {
            margin-left: 200px; /* Regola personalizzata per iPhone 13 */
        }
        .wrapper {
            top: 70%; /* Adjust the percentage to lower or raise the position */
            transform: translate(0%, +20%) scale(0);
            transition: transform .5s ease, height .2s ease;
        }
        .wrapper.active-popup{
            transform: scale(1);;
        }

        header {
            padding: 10px 15px; /* Adjust header padding */
        }

        header img {
            width: 100px; /* Adjust logo size */
        }

        .navigation {
            display: none; /* Initially hide navigation links */
            flex-direction: column;
            align-items: center;
            position: absolute;
            top: 150px; /* Adjust top position as needed */
            right: 0;
            background: rgba(0, 0, 0, 0.5); /* Semi-transparent background */
            width: 100%;
            transition: 0.5s;
        }

        .navigation a {
            margin: 10px 0; /* Adjust spacing between links */
        }

        .navigation.active {
            display: flex; /* Show navigation links when active */
            align-items: center;
        }

        .navigation .btnLogin-popup {
            margin-top: 10px; /* Adjust spacing between button and links */
            padding: 8px 12px;
            font-size: 0.9em;
            margin-left: 0;
        }

        /* Show hamburger button for small screens */
        .hamburger {
            display: flex;
        }
}

