.background-overlay {
    position: fixed;
    inset: 0;

    background-color: rgba(255, 255, 255, 1);

    z-index: 1;
}

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

    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(2);
}

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

    100% {
        opacity: 0;
    }
}

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

    }

    100% {
        top: 80px;

        left: 77px;

        transform: translate(0, 0) scale(1);
    }
}

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

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

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

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

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

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

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

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

header p {
    font-style: normal;
    font-weight: 400;
    font-size: 20px;
    color: #000000;
    white-space: nowrap;
    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;
    min-height: 449px;
    width: min(100%, 652px);
    position: relative;
    margin: 0 auto;
    background-color: white;
    border-radius: 30px;
    box-shadow: 0 0 14px 3px rgba(0, 0, 0, 0.14);
}

.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 16px;

}

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;
    font-weight: 700;
    color: var(--color-text);
}

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

.input-fields {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 56px;
    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;

}

.input-fields input {
    width: 100%;
    height: 48px;
    padding: 10px 48px 10px 21px;
    border: 1px solid var(--color-border-field-hover);
    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: var(--color-border-field-focus);
    box-shadow: var(--focus-ring);
}

.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;

    top: 100%;

    left: 0;
    font-size: 14px;
    color: #ff3b3b;
    line-height: 1.2;
    opacity: 0;

    transform: translateY(-10px);

    transition: opacity 0.3s ease, transform 0.3s ease;

    pointer-events: none;

}

.field-error.show {
    opacity: 1;
    transform: translateY(0);
}

.error-msg {
    color: red;
    font-size: 14px;
    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: var(--color-text-strong);
    padding: 0;
    border: 1px solid var(--color-primary) !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: var(--color-text-subtle);
    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) {

    .animated {
        animation: startAnimationMobile 1000ms linear forwards;
    }

    .animation-skipped {
        top: 37px;
        left: 38px;
    }

    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-overlay {
        position: fixed;
        inset: 0;
        background-color: rgba(255, 255, 255, 1);
        z-index: 1;
    }

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

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

@media screen and (max-width: 480px) {
    .login-page .wrapper.max-width-1440 {
        flex-direction: column;
        justify-content: center;
        padding: 128px 16px 80px;
    }

    section {
        padding: 20px 16px;
    }

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

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

    header {
        position: static;
        order: 1;
        width: auto;
        height: auto;
        margin-top: 32px;
        justify-content: center;
    }

    footer {
        bottom: 0px;
    }

    .error-msg {
        word-wrap: break-word;
    }
}

@media screen and (max-width: 428px) {
    section {
        padding: 32px 16px;
    }

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

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

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

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

    .form-buttons button,
    .btn-left,
    .btn-right {
        width: 180px;
        height: 51px;
        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: 480px) and (max-height: 750px) {
    .login-page main {
        min-height: auto;
    }
}

@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;
    }

    .animated {
        animation-name: startAnimationSmall;
    }

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

    .animation-skipped {
        top: 24px;
        left: 24px;
    }

}

@media screen and (max-width: 800px) and (min-height: 600px) {
    section {
        padding: 10px 16px 20px 16px;
    }
}
