html, body {
    height: 100%;
}

.body-auth {
    font-family: sans-serif;
    color: var(--color-menu-text);
    background: var(--main-color);
    animation: backgroundFade 1.8s ease-in-out 0.4s forwards;
    display: flex;
    flex-direction: column;
}

.login-content {
    flex: 1;
    position: relative;
    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 9rem 16px 0;
}

.logo-wrapper {
    position: absolute;
    z-index: 1;
    top: 50%;
    left: 50%;
    width: 80px;
    height: 80px;
    margin: 5% 0 0 5%;
    transform: translate(-50%, -50%) scale(2);
    position-anchor: --body-anchor;
    anchor-name: --logo-anchor;
    animation: logoSlideIn 1.8s cubic-bezier(0.25, 1, 0.5, 1) 0.4s forwards;
}

.login-logo {
    width: 80px;
    height: 80px;
    filter: brightness(0) invert(1);
    animation: logoShrinkColor 1.8s cubic-bezier(0.25, 1, 0.5, 1) 0.4s forwards;
}

@keyframes logoSlideIn {
    0% {
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%) scale(2);
    }
    100% {
        top: 2rem;
        left: 1rem;
        transform: translate(0, 0) scale(1);
    }
}

@keyframes logoShrinkColor {
    0%   {
        filter: brightness(0) invert(1);
    }
    100% {
        filter: none;
    }
}

@keyframes backgroundFade {
    to { background: #fff; }
}

.login-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    animation: loginFadeIn 500ms ease-in-out 700ms forwards;
    width: 100%;
    height: 100%;
    flex: 1;
}

.login-card {
    background: white;
    border-radius: var(--main-radius);
    box-shadow: 0 0 0.75rem 0.25rem rgba(0, 0, 0, 0.08);
    width: 100%;
    max-width: 25rem;
    margin: 0 0 1.5rem;
}

h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-top: 1.25rem;
    color: #000;
    margin-bottom: 2.5rem;
    text-align: center;
    position: relative;
    opacity: 0;
    animation: loginFadeIn 500ms ease-in-out 700ms forwards;
}

.login-title::after {
    content: "";
    display: block;
    position: absolute;
    bottom: -0.5rem;
    left: 50%;
    transform: translateX(-50%);
    width: 5.63rem;
    height: 0.19rem;
    background: var(--main-color);
    border-radius: 0.13rem;
}

.input-group {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 90%;
    height: 2.5rem;
    margin-bottom: 1rem;
    border: none;
    position: relative;
}

.input-group input {
    anchor-name: --login-input;
}

span {
    width: 1.5rem;
    height: 1.5rem;
    position: absolute;
    right: 0.75rem;
}

.email-icon {
    background: url("../assets/icons/mail.svg") center center no-repeat;
}

.person-icon {
    background: url("../assets/icons/person.svg") center center no-repeat;
}

.password-icon {
    background: url("../assets/icons/lock.svg") center center no-repeat;
}

input[type="text"],
input[type="email"],
input[type="password"] {
    width: 100%;
    height: 100%;
    border: none;
    border-bottom: 0.06rem solid var(--color-light-gray);
    padding: 0 0.75rem;
    background: unset;

    &:focus {
        outline: none;
        border-bottom: 0.06rem solid var(--main-color);
    }

    &::placeholder {
        color: var(--color-light-gray);
    }
}

.user-email {
    background: url("../assets/icons/mail.svg") center center no-repeat;
}

.user-password {
    background: url("../assets/icons/lock.svg") center center no-repeat;
}

.password-icon-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s ease;
}

.password-icon-toggle.clickable {
    cursor: pointer;
}

.password-icon-toggle.clickable:hover {
    opacity: 0.7;
}

.password-icon-toggle img {
    width: 100%;
    height: 100%;
    pointer-events: none;
}

form {
    display: flex;
    align-items: center;
    flex-direction: column;
    width: 100%;
    background-color: white;
    border-radius: var(--main-radius);
    position: relative;
}

.button-container {
    display: flex;
    flex-direction: row;
    gap: 1rem;
    justify-content: center;
    align-items: center;
    margin: 2rem 0 1rem 0;
    width: 90%;
}

.btn-primary {
    width: 8.75rem;
    height: 2.5rem;
    background: var(--main-color);
    color: white;
    border: none;
    border-radius: var(--button-radius);
    cursor: pointer;
    margin: 0;
    transition: background-color 0.2s ease;
}

.btn-primary:hover {
    background: var(--color-primary-button-hover);
}

.btn-secondary {
    width: 8.75rem;
    height: 2.5rem;
    background: white;
    color: #000;
    border: 1px solid var(--color-light-gray);
    border-radius: var(--button-radius);
    cursor: pointer;
    transition: border-color 0.2s ease;
    margin: 0;
}

.btn-secondary:hover {
    border-color: var(--main-color);
}

.signup-section {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: row;
    gap: 1rem;
    transform: translateY(-50%);
    opacity: 0;
    animation: loginFadeIn 500ms ease-in-out 700ms forwards;
}

.btn-signup {
    padding: 0.63rem 1rem;
    background: var(--main-color);
    color: white;
    border: none;
    border-radius: var(--button-radius);
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.btn-signup:hover {
    background: var(--color-primary-button-hover);
}

footer {
    a {
        color: #ffffff;
        text-decoration: none;
        font-size: 0.88rem;
        margin-bottom: 2rem;

        &:hover {
            cursor: pointer;
        }
    }
}

.legal-link {
    font-size: 0.88rem;
    color: var(--color-menu-item);
    text-decoration: none;
    transition: color 0.2s ease;
}

.legal-link:hover {
    color: var(--main-color);
}

.bottom-section {
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    height: 100%;
    position: fixed;
    padding: 2rem;
}

@media (min-width: 480px) {
    @keyframes logoSlideIn {
        0% {
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%) scale(1);
        }
        100% {
            top: 2rem;
            left: 1rem;
            transform: translate(0, 0) scale(1);
        }
    }

    .logo-wrapper {
        width: 100px;
        height: 100px;
    }

    .login-logo {
        width: 100px;
        height: 100px;
    }
}

@media (min-width: 768px) {
    @keyframes logoSlideIn {
        0% {
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%) scale(1.5);
        }
        100% {
            top: 2rem;
            left: 1rem;
            transform: translate(0, 0) scale(1);
        }
    }

    .signup-section {
        position: absolute;
        right: 2%;
        position-anchor: --logo-anchor;
        top: anchor(center);
    }


    .logo-wrapper {
        width: 120px;
        height: 120px;
    }

    .login-logo {
        width: 120px;
        height: 120px;
    }

    .signup-section {
        right: 3rem;
    }

    .legal-link {
        font-size: 1rem;
    }

    .btn-signup {
        font-size: 1rem;
    }

    .login-card {
        max-width: 27.5rem;
        margin: 5rem 0 1.65rem;

        form {
            padding: 1.5rem;
        }

        h2 {
            font-size: 2.75rem;
        }

        input[type="text"],
        input[type="email"],
        input[type="password"] {
            font-size: 1.1rem;
            height: 2.75rem;
        }

        .btn-primary,
        .btn-secondary {
            font-size: 1.1rem;
            width: 9.625rem;
            height: 2.75rem;
        }

        .btn-signup {
            font-size: 1.1rem;
            padding: 0.69rem 1.1rem;
        }
    }
}

@media (min-width: 1400px) {
    @keyframes logoSlideIn {
        0% {
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%) scale(2);
        }
        100% {
            top: 2rem;
            left: 1rem;
            transform: translate(0, 0) scale(1);
        }
    }

    .logo-wrapper {
        margin: 4% 0 0 4%;
    }

    .signup-section {
        gap: 2rem;

        p {
            font-size: 1.5rem;
        }

        .btn-signup {
            font-size: 1.5rem;
        }
    }

    .login-card {
        max-width: 32.5rem;
        margin: 5.85rem 0 0;
        form {
            padding: 2rem;
        }

        h2 {
            font-size: 3.25rem;
        }

        input[type="text"],
        input[type="email"],
        input[type="password"] {
            font-size: 1.3rem;
            height: 3.25rem;
        }

        .btn-primary,
        .btn-secondary {
            font-size: 1.3rem;
            width: 11.375rem;
            height: 3.25rem;
        }

        .btn-signup {
            font-size: 1.3rem;
            padding: 0.82rem 1.3rem;
        }
    }

    .legal-link {
        font-size: 1.25rem;
    }
}

@media (min-width: 3000px) {
    .login-card {
        max-width: 37.5rem;
        margin: 6.75rem 0 2.25rem;

        form {
            padding: 2.5rem;
        }

        h2 {
            font-size: 3.75rem;
        }

        input[type="text"],
        input[type="email"],
        input[type="password"] {
            font-size: 1.5rem;
            height: 3.75rem;
        }

        .btn-primary,
        .btn-secondary {
            font-size: 1.5rem;
            width: 13.125rem;
            height: 3.75rem;
        }

        .btn-signup {
            font-size: 1.5rem;
            padding: 0.94rem 1.5rem;
        }
    }

    .legal-link {
        font-size: 1.5rem;
    }

    .signup-section {
        gap: 2.5rem;

        p {
            font-size: 2rem;
        }

        .btn-signup {
            font-size: 2rem;
        }
    }
}

.error-message {
    color: #ff4646;
    font-size: 0.75rem;
    display: block;
    position: absolute;
    position-anchor: --login-input;
    top: anchor(bottom);
    left: anchor(left);
    padding-top: 0.25rem;
    white-space: nowrap;
    z-index: 10;
    pointer-events: none;
}

.auth-error-message {
    color: #ff4646;
    font-size: 0.75rem;
    display: block;
    text-align: center;
    position: absolute;
    bottom: 0.5rem;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    pointer-events: none;
}

.input-group input:focus {
    outline: none;
}
