body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

body:has(.login-page) {
    background-color: #faf6f2;
}

html:has(.login-page) {
    background-color: #faf6f2;
}

.main-container {
    flex: 1;
    display: flex;
    flex-direction: column;
}

body:has(.login-page) .main-container {
    flex: 0 1 auto;
}

/*
 * Zeplin artboard 1440×1222 (#faf6f2). Map img margins to this block (below live header):
 *   Cover Group-1321315782: 1186×655; margin 81px 0 0 254px  → top 0 here, left 17.64%
 *   Form Group-1321315777: 317.4×357; margin 145px … 63px   → pad-top 64px, left 63px
 *   Footer Group-1321315714: margin-top 153px below hero band → margin-bottom on inner
 * Header Group-1321315773 (81px) = base.html listing_menu_items, not an img.
 */
.login-page {
    --login-artboard-w: 1440;
    --login-cover-scale: 1.1;
    --login-hero-h: calc(655px * var(--login-cover-scale));
    /* Zeplin: cover box starts ~254px; form ends ~380px — extra cream before art shows */
    --login-cover-offset-x: clamp(32px, calc(254 / var(--login-artboard-w) * 100vw - 63px), 120px);
    --login-fade-solid-end: 380px;
    --login-fade-transparent: 680px;
    /* < 1 zooms out (Zeplin object-fit: contain — full art visible, less edge crop) */
    --login-cover-zoom: 1;
    flex: 0 0 auto;
    display: flex;
    width: 100%;
    max-width: none;
    margin: 0;
    background-color: #faf6f2;
}

.login-page__inner {
    position: relative;
    width: 100%;
    max-width: none;
    margin: 0;
    overflow: hidden;
}

/* Full width; height-fit + zoom (not cover) to avoid cropping sides like Zeplin contain */
.login-page__cover {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: var(--login-hero-h);
    background-color: #faf6f2;
    background-image: url("/assets/images/login/cover.webp");
    background-repeat: no-repeat;
    background-size: auto calc(var(--login-hero-h) * var(--login-cover-zoom));
    background-position: calc(100% + var(--login-cover-offset-x)) center;
    pointer-events: none;
}

.login-page__cover::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        90deg,
        #faf6f2 0,
        #faf6f2 var(--login-fade-solid-end),
        rgba(250, 246, 242, 0.92) calc(var(--login-fade-solid-end) + 80px),
        rgba(250, 246, 242, 0.45) calc(var(--login-fade-solid-end) + 180px),
        transparent var(--login-fade-transparent)
    );
}

.login-page__form-column {
    position: relative;
    z-index: 1;
    box-sizing: border-box;
    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
    min-height: var(--login-hero-h);
    padding-top: 150px;
    padding-left: calc(63 / var(--login-artboard-w) * min(100vw, 1440px));
    padding-right: 1rem;
    padding-bottom: 0;
    background: transparent;
}

.login-page__form {
    width: 317.4px;
    max-width: calc(100% - 1rem);
    box-sizing: border-box;
}

.login-page__title {
    display: flex;
    flex-direction: column;
    margin: 0 0 1.5rem;
    font-family: 'Abhaya Libre', serif;
    font-size: 2.75rem;
    font-weight: 700;
    line-height: 1.06;
    color: var(--hoa-rust);
}

.login-page__title-line {
    display: block;
}

.login-page__social {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    margin-bottom: 1.25rem;
}

.login-page__social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    height: 40px;
    min-height: 40px;
    max-height: 40px;
    padding: 0 12px;
    font-family: 'Raleway', sans-serif;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.2;
    color: var(--hoa-dark-blue);
    background-color: #fff;
    border: 1px solid var(--hoa-light-grey);
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    box-sizing: border-box;
}

.login-page__social-btn:hover,
.login-page__social-btn:focus-visible {
    border-color: var(--hoa-rust);
    text-decoration: none;
    color: var(--hoa-dark-blue);
}

.login-page__social-icon {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
}

.login-page__social-icon--apple {
    width: 32px;
    height: 32px;
    color: var(--hoa-dark-grey);
}

.login-page__social-icon--google {
    width: 22px;
    height: 22px;
    display: block;
}

.login-page__divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0 0 1.25rem;
    font-family: 'Raleway', sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--hoa-medium-grey);
}

.login-page__divider::before,
.login-page__divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background-color: var(--hoa-light-grey);
}

.login-page__sent-text {
    margin: 0 0 1.75rem;
    font-family: 'Raleway', sans-serif;
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--hoa-dark-blue);
}

.login-page__resend-prompt {
    margin: 0 0 0.75rem;
    font-family: 'Raleway', sans-serif;
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--hoa-dark-blue);
}

.login-page__field {
    width: 100%;
    max-width: none;
    margin-bottom: 1rem;
}

.login-page__field .hoa-text-input {
    height: 40px;
    min-height: 40px;
    max-height: 40px;
    padding: 0 16px;
    font-size: 0.875rem;
    border: 1px solid var(--hoa-light-grey);
    border-radius: 8px;
    box-sizing: border-box;
    transition: border-color 0.2s ease;
}

.login-page__field .hoa-text-input:hover,
.login-page__field .hoa-text-input:focus {
    outline: none;
    border-color: var(--hoa-rust);
}

.login-page__submit {
    width: 100%;
    height: 40px;
    min-height: 40px;
    max-height: 40px;
    margin-top: 0;
    padding: 0 16px;
    background-color: var(--hoa-rust);
    font-family: 'Raleway', sans-serif;
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #fff;
    border: none;
    border-radius: 10px;
    border-top-left-radius: 0;
    box-sizing: border-box;
    text-decoration: none;
}

.login-page__submit:hover {
    background-color: #b45d45;
    color: #fff;
    text-decoration: none;
}

.login-page__legal {
    margin: 1rem 0 0;
    font-family: 'Raleway', sans-serif;
    font-size: 0.6875rem;
    line-height: 1.45;
    color: var(--hoa-medium-grey);
}

.login-page__legal a {
    text-decoration: underline;
    text-underline-offset: 0.15rem;
    color: var(--hoa-dark-grey);
}

.login-page__messages {
    margin-bottom: 1rem;
    font-size: 0.875rem;
    line-height: 1.5;
}

.login-page__messages .success {
    color: var(--hoa-dark-grey);
}

.login-page__messages .error {
    color: #c62828;
}

.login-page__errors {
    color: #c62828;
    font-size: 0.8125rem;
    margin: 0 0 1rem;
    padding-left: 1.25rem;
}

@media (min-width: 1440px) {
    .login-page__form-column {
        padding-left: 63px;
    }

    .login-page__form {
        width: 317.4px;
    }
}

@media (max-width: 1024px) {
    .login-page__form-column {
        display: flex;
        flex-direction: column;
        align-items: center;
        min-height: 0;
        padding: 2rem 1.5rem 1.5rem;
    }

    .login-page__form {
        width: 100%;
        max-width: 317.4px;
        margin: 0 auto;
    }

    .login-page__title {
        text-align: center;
    }

    .login-page__legal {
        text-align: center;
    }
}

@media (max-width: 900px) {
    .login-page {
        max-width: none;
    }

    .login-page__inner {
        min-height: auto;
        margin-bottom: 0;
    }

    .login-page__form-column {
        min-height: 0;
        padding: 1.5rem 1.5rem 0;
    }

    .login-page__cover {
        position: relative;
        left: auto;
        width: 100%;
        height: 16rem;
        background-size: cover;
        background-position: center right;
    }

    .login-page__form {
        width: 100%;
        max-width: 317.4px;
    }

    .login-page__cover::before {
        background: linear-gradient(
            180deg,
            #faf6f2 0%,
            rgba(250, 246, 242, 0.75) 25%,
            transparent 55%
        );
    }
}
