*{
    margin: 0;
    padding: 0;
    scroll-behavior: smooth;
}

body{
    display: flex;
    flex-direction: row;
}

#main-container{
    display: flex;
    flex-direction: row;
    margin: 0%;
    padding: 0%;
}

#login-img {
    width: 50vw;
    height: 100vh; /* force full height */
    object-fit: cover; /* keeps proportions and crops neatly */
    display: block;
}


#form-container{
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    background-color: #1a3e62; 
    width: 50vw;
    height: 100vh;
}

#form{
    display: flex;
    flex-direction: column;
    align-items: center;
    border-radius: 0.5rem;
    background-color: white;
    height: 68vh;
    width: 35vw;
}

#login{
    margin-top: 5rem;
    font-family: "Lato", sans-serif;
    font-size: 2.5rem;
    font-weight: bold;
    color: #edbd75;
    text-align: center;
}

#central-login{
    display: flex;
    flex-direction: column;
    margin-top: 3rem;
    gap: 0rem;
}

#email, #password{
    font-family: "Merriweather", serif;
    font-size: 1rem;
    height: 3.5rem;
    width: 22rem;
    background-color: #f3f4f6;
    border: none;
    border-radius: 0.5rem;
    padding-left: 1rem;
}

#remember-forgot{
    font-family: "Merriweather", serif;
    margin-top: 3rem;
    display: flex;
    flex-direction: row;
    gap: 6rem;
}

#remember{
    accent-color: #4660ff;
    cursor: pointer;
}

#forgot{
    text-decoration: none;
    color: #4660ff;
    transition: text-decoration 0.1s;
}

#forgot:hover{
    text-decoration: underline;
}

#login-btn{
    margin-top: 1rem;
    height: 3.25rem;
    width: 22.5rem;
    border-radius: 0.5rem;
    border: none;
    font-size: 1.25rem;
    font-family: "Merriweather", serif;
    color: white;
    background-color: #4660ff;
    transition: transform 0.2s ease;
}

#login-btn:hover{
    background-color: #0023ff;
    transform: scale(1.02);
}

#signup-link {
    text-decoration: none;
    margin-top: 1rem;
}

#signup-btn {
    text-decoration: none;
    color: #4660ff;
    transition: text-decoration 0.1s;
}

#signup-btn:hover{
    text-decoration: underline;
}
#form-container {
  position: relative; /* make child absolute positioning relative to this */
}

.error-message {
  position: absolute;
  top: 125px; /* adjust based on where you want it to appear */
  left: 50%;
  transform: translateX(-50%);
  background-color: #ffebee;
  color: #c62828;
  padding: 8px 14px;
  border-radius: 6px;
  border: 1px solid #ef9a9a;
  text-align: center;
  font-family: "Merriweather", serif;
  font-size: 0.95rem;
  width: 80%;
  max-width: 300px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  animation: fadeIn 0.3s ease;
  z-index: 5; /* ensures it sits above other elements */
}

@keyframes fadeIn {
  from { opacity: 0; transform: translate(-50%, -5px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}



@media screen and (max-width: 768px) {
    body, html {
        margin: 0;
        padding: 0;
        height: 100%;
        width: 100%;
        overflow: hidden;
    }

    #form-container{
        background: none;
        width: 400px;
    }

    #main-container {
        position: relative;
        height: 100vh;
         width: 100vw;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
    }

    #login-img {
            width: 100%;
            height: 40vh;
            object-fit: cover;
            position: absolute;
            top: 0;
            left: 0;
            z-index: 0;
            opacity: 0.9;
        
    }

    #form {
        position: relative;
        z-index: 1;
        background-color: rgb(255, 255, 255);
        margin-top: 8rem;
        padding: 2rem;
        padding-bottom: 2rem;
        border-top-left-radius: 8rem;        
        width: 400px;
        text-align: center;
    }

    #login {
        font-size: 2rem;
        margin-bottom: 10px;
        margin-top: 13px;
    }

    #central-login {
        display: flex;
        flex-direction: column;
        align-items: center;
        padding-bottom: 2rem;
    }

    #email, #password, #login-btn {
        width: 100%;
        margin-top: 1rem;
    }

    #remember-forgot {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
        margin-top: 1.5rem;
    }
}

@media (min-width: 1200px) and (max-width: 1500px) {
    #navbar-main {
        width: 18vw;
    }

    .main-content {
        margin-left: 18vw;
        padding: 1.5rem;
        overflow-x: hidden;
    }

    #title {
        font-size: 1.75rem;
        width: 82vw;
    }

    #logo {
        height: 4.5rem;
    }

    #form {
        width: 40vw;
        height:35rem;
    }


    #remember-forgot {
        gap: 5rem;
    }
}
