.background-overlay {
    position: fixed;
    inset: 0;
    /* top:0; right:0; bottom:0; left:0 */
    background-color: rgba(255, 255, 255, 1);
    /* Start: hidden */
    z-index: 1;
}

/* Image */
.homepage-image {
    width: 100px;
    height: 122px;
    position: absolute;
    z-index: 2;

    /* Start position: center */
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(2);
}

@keyframes backgroundFadeOut {
    0% {
        opacity: 1;
    }

    100% {
        opacity: 0;
    }
}

/* Animation */
@keyframes startAnimation {
    0% {
        top: 50%;
        left: 50%;
        width: 274px;
        height: 334px;
        transform: translate(-50%, -50%) scale(2);

    }

    100% {
        top: 73px;
        /* top */
        left: 77px;
        /* left */
        transform: translate(0, 0) scale(1);
    }
}


/* Animation class */
.animated {
    animation: startAnimation 0.5s ease-in-out forwards;
}

.animation-skipped {
    top: 73px;
    left: 77px;
    transform: translate(0, 0) scale(1);
}

.bg-animated {
    animation: backgroundFadeOut 0.5s ease-in-out forwards;
}

@keyframes backgroundFadeOutMobile {
    0% {
        opacity: 1;
    }

    100% {
        opacity: 0;
    }
}

header {
    width: 279px;
    height: 49px;
    position: absolute;
    top: 60px;
    right: 100px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin: 0;
    padding: 0;
}

header p {
    font-style: normal;
    font-weight: 400;
    font-size: 20px;
    color: #000000;
    width: 153px;
    height: 24px;
    margin: 0;
    padding: 0;

}

header .btn-signup {
    width: 91px;
    height: 49px;
    background-color: #2A3647;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 700;
    padding: 0;
    transition: transform 100ms ease, box-shadow 100ms ease;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

header .btn-signup:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
    background-color: #29ABE2;
}

.login-page main {
    max-width: 652px;
    max-height: 449px;
    width: min(100%, 652px);
    position: relative;
    margin: 0 auto;
    background-color: white;
    border-radius: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}


.wrapper.max-width-1440 {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 120px 16px 80px;
}

section {
    width: auto;
    height: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 11px;

}

form {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

form img {
    width: 24px;
    height: 24px;
}

.form-header {
    font-style: normal;
    font-weight: bold;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.form-header h1 {
    font-size: clamp(48px, 5vw, 61px);
    line-height: 1.2;
    margin: 0;
    padding-bottom: 10px;
}

.underline-div {
    width: 90px;
    height: 3px;
    background-color: #29ABE2;
    margin-bottom: 30px;
}

.input-fields {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 40px;
    width: 100%;
    max-width: 422px;
    height: auto;
}

.input-field-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 6px;
}

.input-control {
    position: relative;
    height: 48px;
}

input::placeholder {
    color: #999;
    /* Optional: change placeholder color */

    /* Text inset from the left edge of the field */
}

.input-fields input {
    width: 100%;
    height: 48px;
    padding: 10px 48px 10px 21px;
    border: 1px solid #D1D1D1;
    border-radius: 10px;
    font-size: 1.25rem;
    font-weight: 400;
    font-style: normal;
    transition: border-color 100ms ease;
}

.input-fields input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 5px rgba(0, 123, 255, 0.3);
}

.input-icon-email {
    position: absolute;
    top: 50%;
    right: 15px;
    transform: translateY(-50%);
}

.input-icon-password {
    position: absolute;
    top: 50%;
    right: 15px;
    transform: translateY(-50%);
}

.visibilty-btn.d-none {
    display: none;
}

.input-error {
    border: 1px solid #ff3b3b !important;
    outline: none;
    box-shadow: none;
}


.field-error {
    position: absolute;
    /* absolute positioning */
    top: 100%;
    /* directly under the input */
    left: 0;
    font-size: 14px;
    color: #ff3b3b;
    line-height: 1.2;
    opacity: 0;
    /* initially hidden */
    transform: translateY(-10px);
    /* slightly above */
    transition: opacity 0.3s ease, transform 0.3s ease;
    /* smooth animation */
    pointer-events: none;
    /* input stays clickable */
}

/* Show error: slide down */
.field-error.show {
    opacity: 1;
    transform: translateY(0);
}



.error-msg {
    color: red;
    font-size: 0.85rem;
    display: none;
    margin-top: 8px;
    word-wrap: break-word;
    white-space: normal;
}

.form-buttons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 35px;
    width: 100%;
    max-width: 422px;
}

.form-buttons button {
    height: 48px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 21px;
    font-weight: 700;
    font-style: bold;
    transition: transform 100ms ease, box-shadow 100ms ease;
}

.btn-left {
    width: 110px;
    background-color: #2A3647;
    color: white;
    padding: 0;
}

.btn-left:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
    background-color: #29ABE2;
}

.btn-right {
    width: 177px;
    background-color: white;
    color: black;
    padding: 0;
    border: 2px solid #2A3647 !important;
}

.btn-right:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
    color: #29ABE2;
    border-color: #29ABE2 !important;
}

footer {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 246px;
    height: 35px;
    gap: 8px;
    position: absolute;
    bottom: 20px;
    font-style: normal;
    font-weight: 400;
    font-size: 16px;
    left: 50%;
    transform: translate(-50%, -50%);
}

footer a {
    text-decoration: none;
    color: #A8A8A8;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-grow: 1;
    transition: transform 100ms ease, box-shadow 100ms ease;
}

footer a:hover {
    transform: translateY(-1px);
    color: #29ABE2;
}

.footer-left {
    width: 121px;
    height: 35px;
}

.footer-right {
    width: 109px;
    height: 35px;
}

@media (max-width: 800px) {

    header p,
    header .btn-signup {
        text-align: center;

    }

    main {
        max-width: 90%;
        width: 100%;
    }

    footer {
        width: auto;
    }
}


@media screen and (min-width: 481px) and (max-width: 800px) {

    /* ================= BACKGROUND ================= */
    .background-overlay {
        position: fixed;
        inset: 0;
        background-color: rgba(255, 255, 255, 1);
        z-index: 1;
    }

    .bg-animated {
        animation: backgroundFadeOutMobile 500ms ease-in-out forwards;
    }

    @keyframes backgroundFadeOut {
        0% {
            opacity: 1;
        }

        100% {
            opacity: 0;
        }
    }

    /* ================= LOGO ================= */
    .homepage-image {
        height: auto;
        position: absolute;
        z-index: 2;
    }

    /* Logo starts AFTER the background */
    .animated {
        animation-delay: 500ms;
        /* exactly after background */
        animation: startAnimationMobile 1000ms linear forwards;
    }

    @keyframes startAnimationMobile {
        0% {
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%) scale(2);
        }

        100% {
            top: 30px;
            left: 30px;
            transform: translate(0, 0) scale(1);
        }
    }
}

@media screen and (max-width:600px) {
    .homepage-image {
        width: 60px;
    }
}

@media screen and (max-width: 480px) {
    .wrapper.max-width-1440 {
        padding: 20px 11px 56px
    }

    section {
        padding: 20px 11px;
    }

    /* ================= BACKGROUND ================= */
    .background-overlay {
        position: fixed;
        inset: 0;
        background-color: rgba(42, 54, 71, 1);
        z-index: 1;
    }

    .bg-animated {
        animation: backgroundFadeOutMobile 500ms ease-in-out forwards;
    }

    @keyframes backgroundFadeOut {
        0% {
            opacity: 1;
        }

        100% {
            opacity: 0;
        }
    }

    /* ================= LOGO ================= */
    .homepage-image {
        width: 40px;
        height: auto;
        position: absolute;
        z-index: 2;
    }

    /* Logo starts AFTER the background */
    .animated {
        animation-delay: 500ms;
        /* exactly after background */
        animation: startAnimationMobile 1000ms linear forwards;
    }

    @keyframes startAnimationMobile {
        0% {
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%) scale(2);
        }

        100% {
            top: 30px;
            left: 30px;
            transform: translate(0, 0) scale(1);
        }
    }

    header {
        position: absolute;
        top: 81%;
        transform: translateX(50%);
        right: 50%;
        justify-content: space-around;
    }

    footer {
        bottom: 0px;
    }

    .error-msg {
        font-size: 0.75rem;
        word-wrap: break-word;
    }
}

@media screen and (max-width: 428px) {
    .wrapper.max-width-1440 {
        padding: 32px 16px 80px;
    }

    section {
        padding: 40px 16px;
    }

    .login-page main {
        width: 100%;
        max-width: 350px;
        height: auto;
    }

    .input-fields {
        margin-bottom: 24px;
        gap: 16px;
    }

    .input-fields input {
        padding: 10px 38px 10px 14px;
    }

    .form-buttons {
        flex-direction: column;
        gap: 16px;
        max-width: 100%;
        width: 100%;
        padding: 0;
        box-sizing: border-box;
    }

    .form-buttons button,
    .btn-left,
    .btn-right {
        width: 100%;
        max-width: none;
        box-sizing: border-box;
    }

    .input-icon-email,
    .input-icon-password {
        right: 10px;
    }

    footer {
        transform: translate(-50%, -6%);
    }

}

@media screen and (max-width: 375px) {
    .form-header h1 {
        padding-bottom: 0px;
    }

    .login-page main {
        max-height: fit-content;
    }

    .underline-div {
        margin-bottom: 20px;
    }

    .input-fields {
        margin-bottom: 20px;
        gap: 18px;
    }

    @keyframes startAnimationMobile {
        0% {
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%) scale(2);
        }

        100% {
            top: 15px;
            left: 30px;
            transform: translate(0, 0) scale(1);
        }
    }

    .homepage-image {
        width: 30px;
        height: auto;
        position: absolute;
        z-index: 2;
    }

}

@media screen and (min-height: 600px) {

    @keyframes startAnimationMobile {
        0% {
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%) scale(2);
        }

        100% {
            top: 15px;
            left: 30px;
            transform: translate(0, 0) scale(1);
        }
    }

    .animated {
        animation-delay: 500ms;
        /* exactly after background */
        animation: startAnimationMobile 1000ms linear forwards;
    }

    section {
        padding: 10px 11px 20px 11px;
    }
}




