* {
    box-sizing: border-box;
}
:root {
    color: rgb(255, 255, 255);
    --button-width: 150px;
    --spinner-width: $button-width/6;
    --blue: #0076d3;
    --btn-bg: #8BC34A;
    --text-light: #fefefe;
}

body html{
    margin: 0;
    padding: 0;
}

body {
    overflow: hidden;

    margin: 0; /* Remove default margin to ensure full screen layout */
    height: 100vh;
}

body::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url(../IMG/Background/Kontakt_bg.jpg);
    background-size: cover;
    background-repeat: no-repeat;
    filter: blur(10px); /* Apply blur to the background only */
    z-index: -1; /* Keeps the background behind the page content */
  }

textarea, input{
    border-radius: 17px;
    border-style: none;
    font-size: 18px;
    font-family: Courier;
    font-style: normal;
    border-style: solid;
    border-color: white;
    color: black;
    background-color: rgb(255, 255, 255, 0.5);
    border-width: 5px;
    padding: 5px;
    margin-top: 2vh;
}
textarea::placeholder,input::placeholder {
    color: black; /* Solid color for the placeholder */
  }

#formular {
    width: 50vw;
    height: 51vh;
    margin-top: 25%;
    margin-left: 5%;
    transform: translateY(-50%);
}


#fname ,#lname{
    float: left;
    width: 45%;
    height: 8%;
}
#lname{
    margin-left: 10%;
}


#email {
    margin-top: 2%;
    height: 8%;
    width: 100%;
}

#age {
    display: none;
}
#messe {
    margin-top: 2%;
    width: 100%;
    height: 60%;
}



#logo {
    position: absolute;
    top: 32%;               /* Vertical center */
    right: 15vw;              /* Horizontal center */
}

#logo img {
    height: auto;
    width: 15vw;
    position: relative;
}



/* Base button styles */
.button {
    display: inline-block;
    width: 150px;
    margin: 20px auto;
    background: #0B6633;                    /* #8bc34a;  /* Initial green color */
    color: #fefefe;
    font-size: 1.2em;
    padding: 1em;
    border-radius: 4px;
    text-align: center;
    position: relative;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    border: 0;
    transition: border-radius linear 0.05s, width linear 0.05s;
}

/* Remove outline when the button is focused */
.button:focus {
    outline: 0;
}

/* Animation for when the button is clicked (loading state) */
.button.animate {
    width: 68.1818181818px;
    height: 68.1818181818px;
    min-width: 0;
    border-radius: 50%;
    color: transparent;
    background:#0B6633; /*#8bc34a; /* Stay green until error */
}

/* After clicking, the loading circle animation */
.button.animate:before {
    position: absolute;
    content: '';
    width: 25px;
    height: 25px;
    border: 4px solid #fefefe;
    border-radius: 50%;
    border-left-color: transparent;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    animation: spin ease-in 3s forwards;
    animation-fill-mode: forwards;

}

.button.success {
    width: 68.1818181818px;
    height: 68.1818181818px;
    min-width: 0;
    border-radius: 50%;
    width: 68.1818181818px;
    height: 68.1818181818px;
    min-width: 0;
    border-radius: 50%;
    color: transparent;
    position: relative;
    background-color:#0B6633; /*#8bc34a;  /* Keep it green initially */
}

.button.success:before {
    content: '✓'; /* Or '→' or '➤' */
    color: #fff;
    position: absolute;
    font-size: 1.8rem;
    font-weight: bold;
    text-align: center;
    background-color: #0B6633;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) scale(0);
    visibility: hidden;
    opacity: 0;
    animation: successPop 0.4s ease-out forwards;
    z-index: 2;
}
  


.button.error{
    width: 68.1818181818px;
    height: 68.1818181818px;
    min-width: 0;
    border-radius: 50%;
    color: transparent;
    width: 68.1818181818px;
    height: 68.1818181818px;
    min-width: 0;
    border-radius: 50%;
    color: transparent;
    position: relative;
    background-color:#A03D3D; /*#8bc34a;  /* Keep it green initially */
    animation: vibrate ease-in 0.5s forwards;
    animation-delay: 0.03s; /* Delay to sync with other animations */
}

/* Error state for the button with the "!" symbol */
.button.error:before {
    content: '!';  
    color: #fff;
    position: absolute;
    font-size: 1.8rem;
    font-weight: bold;
    text-align: center;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) scale(0);
    visibility: hidden;
    opacity: 0;
    animation: error 0.5s forwards;

    z-index: 1;
}


/* Spinner animation */
@keyframes spin {
    0% {
        transform: translate(-50%, -50%) rotate(0deg) scale(1);
    }
    99% {
        transform: translate(-50%, -50%) rotate(2160deg) scale(1);
    }
    100%{
        transform: translate(-50%, -50%) rotate(2160deg) scale(1);
        opacity: 0;
        visibility: hidden;
    }
}

@keyframes successPop {
    0% {
        transform: translate(-50%, -50%) scale(0);
        background-color:#0B6633;
        opacity: 0;
        visibility: hidden;
    }
    60% {
        transform: translate(-50%, -50%) scale(1.2);
        background-color:#0B6633;
        opacity: 1;
        visibility: visible;
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        background-color:#0B6633;
        opacity: 1;
        visibility: visible;
    }
}



/* Error animation (for the "!" symbol) */
@keyframes error {
    from {
        transform: translate(-50%, -50%) scale(0); /* Start from scaled down */
        opacity: 0; /* Initially hidden */
        visibility: hidden; /* Initially hidden */
        background-color: #A03D3D;      /* #8bc34a; /* Stay green until error */
    }
    to {
        transform: translate(-50%, -50%) scale(1); /* Scale it to full size */
        opacity: 1; /* Make it visible */
        visibility: visible; /* Ensure it's visible */
        background-color: #A03D3D; /* Turn red at the end of the animation */
    }
}

/* Vibrate effect when there's an error (after the exclamation mark shows) */
@keyframes vibrate {
    0%, 30%, 60%, 85%, 100% {
        left: 0;
        background-color: #A03D3D; /* Red background when vibrating */
    }
    10%, 40%, 90%, 70% {
        left: -2px;
        background-color: #A03D3D;
    }
    20%, 50%, 80%, 95% {
        left: 2px;
        background-color: #A03D3D;
    }
}

@media only screen and (max-width: 640px) {
    .nav_mobile{
        position: absolute;
        bottom: 0;
    }

    #logo{
        position: fixed;
        bottom: 12%;
        top: auto;
        height: 18%;
        width: 25%;
        left: 50%;
        transform: translateX(-50%);
    }

    #logo img{
        left: 50%;
        top: 50%;
        transform: translate(-50%,-50%);
        height: 100%;
        width: auto;
    }

    #formular {
        width: 90%;
        height: 65%;
        position: fixed;
        top: auto;
        bottom: 33%;
        left: 50%;
        transform: translateX(-55%);
    }

    #fname ,#lname{
        float: left;
        width: 45%;
        height: 6vh;
    }

    #lname {
        margin-left: 10%;
    }
    #email {
    margin-top: 2%;
    height: 6vh;
    width: 100%;
    }

    #formular #messe{
        height: 40%;
    }

    #id{
        width: 100%;
    }
    
    #ds {
        left: 0%;
        position: fixed;
        top: 66.75%;
    }
    #ds_text{
        position: fixed;
        top: 69.5%;
        left: 10%;
    }

    .wrapper {
        position: fixed;
        left: 50%;
        top: 87%;
        transform: translateX(-50%);
        height: 70px;
        width: 0px;
        display: flex;
        justify-content: center;
        align-items: center;
        padding: 0;
        margin: 0;
        background: transparent;
        z-index: 999; /* Make sure it's on top */
        background: transparent;
      }
      
      .button {
        height: 10%;
        width: 122px;
        margin: 0;
        padding: 0;
        background-color: #0B6633;
        color: white;
        border: none;
        font-size: 1.2em;
        display: flex;
        justify-content: center;
        align-items: center;
        position: relative;
      }
      
      
    .button.animate {
        width: 50px;
        height: 50px;
    }
    
    .button.error{
        width: 50px;
        height: 50px;
    }

    .button.success {
        width: 50px;
        height: 50px;
    }

    .button.animate:before,
    .button.success:before,
    .button.error:before {
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
    }

      
    

}
