﻿/* =========================================================
   APARTEMENT MANAGEMENT
   Login Page
   ========================================================= */

.login-page {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    min-height: 100dvh;
    background: #f5f7f6;
    overflow-x: hidden;
}


/* =========================================================
   Shell
   ========================================================= */

.login-shell {
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(420px, 0.85fr);
    direction: ltr;
    background: #f5f7f6;
}


/* =========================================================
   Building Side
   ========================================================= */

.login-building {
    position: relative;
    min-width: 0;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #ffffff;
}


/*
    IMPORTANT:
    The image is NOT cropped.
*/
.building-image-wrapper {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.building-image {
    display: block;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    object-position: center;
    margin: 0;
}


/* =========================================================
   Artistic Overlay
   ========================================================= */

.building-art-overlay {
    position: absolute;
    z-index: 2;
    inset: 0;
    pointer-events: none;
    background: linear-gradient( to right, rgba(255, 255, 255, 0) 40%, rgba(255, 255, 255, 0.04) 50%, rgba(255, 255, 255, 0.12) 60%, rgba(255, 255, 255, 0.28) 70%, rgba(255, 255, 255, 0.50) 80%, rgba(255, 255, 255, 0.75) 90%, #ffffff 100% );
}





/* =========================================================
   Building Message
   ========================================================= */

.building-message {
    position: absolute;
    z-index: 4;
    top: 9%;
    left: 8%;
    direction: rtl;
    color: #6f7774;
    text-shadow: 0 2px 10px rgba(255, 255, 255, 0.45);
}

.building-message-line {
    width: 42px;
    height: 2px;
    margin-bottom: 16px;
    background: #7f8884;
    border-radius: 100px;
}


.building-message span,
.building-message strong {
    display: block;
    font-size: clamp(1.3rem, 2.2vw, 2.2rem);
    line-height: 1.6;
}


.building-message strong {
    font-weight: 700;
}


/* =========================================================
   Building Footer
   ========================================================= */

.building-footer {
    position: absolute;
    z-index: 3;
    left: 8%;
    bottom: 6%;
    display: flex;
    flex-direction: column;
    gap: 5px;
    color: rgba(255, 255, 255, 0.82);
    font-size: 0.62rem;
    letter-spacing: 0.25em;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}


/* =========================================================
   Login Panel
   ========================================================= */

.login-panel {
    min-width: 0;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    direction: rtl;
    background: radial-gradient( circle at 80% 10%, rgba(25, 135, 84, 0.045), transparent 30% ), #ffffff;
}


/* =========================================================
   Login Content
   ========================================================= */

.login-content {
    width: min(430px, calc(100% - 72px));
    padding: 50px 0;
}


/* =========================================================
   Brand
   ========================================================= */

.login-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 48px;
}


.brand-mark {
    width: 55px;
    height: 55px;
    flex: 0 0 55px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 17px;
    background: linear-gradient( 145deg, #198754, #126b43 );
    color: #ffffff;
    font-size: 1.25rem;
    box-shadow: 0 13px 30px rgba(25, 135, 84, 0.18);
}


.brand-title {
    color: #18332d;
    font-size: 1.22rem;
    font-weight: 700;
    line-height: 1.5;
}


.brand-subtitle {
    margin-top: 3px;
    color: #89948f;
    font-size: 0.76rem;
}


/* =========================================================
   Heading
   ========================================================= */

.login-heading {
    margin-bottom: 30px;
}


.heading-eyebrow {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 9px;
    color: #198754;
    font-size: 0.75rem;
    font-weight: 600;
}


    .heading-eyebrow span {
        width: 22px;
        height: 2px;
        border-radius: 100px;
        background: #198754;
    }


.login-heading h1 {
    margin: 0 0 9px;
    color: #182c27;
    font-size: clamp(1.7rem, 3vw, 2.1rem);
    font-weight: 700;
    line-height: 1.4;
}


.login-heading p {
    margin: 0;
    max-width: 370px;
    color: #8a9691;
    font-size: 0.84rem;
    line-height: 2;
}


/* =========================================================
   Validation
   ========================================================= */

.login-validation {
    margin-bottom: 20px;
    padding: 11px 14px;
    border-radius: 10px;
    background: #fff4f4;
    color: #b42318;
    font-size: 0.78rem;
}


/* =========================================================
   Fields
   ========================================================= */

.form-field {
    margin-bottom: 21px;
}


.form-label-custom {
    display: block;
    margin-bottom: 8px;
    color: #34453f;
    font-size: 0.81rem;
    font-weight: 600;
}


.input-box {
    position: relative;
}


.input-icon {
    position: absolute;
    right: 17px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    color: #9aa6a1;
    font-size: 0.9rem;
    pointer-events: none;
    transition: color 0.2s ease;
}


.custom-input {
    width: 100%;
    height: 54px;
    padding: 0 48px 0 17px;
    border: 1px solid #d8dfdc;
    border-radius: 13px;
    background: #fbfcfb;
    color: #243731;
    font-family: inherit;
    font-size: 0.86rem;
    box-shadow: none;
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}


    .custom-input::placeholder {
        color: #aeb8b4;
    }


    .custom-input:hover {
        border-color: #c4ceca;
    }


    .custom-input:focus {
        border-color: #198754;
        background: #ffffff;
        box-shadow: 0 0 0 4px rgba(25, 135, 84, 0.08);
        outline: none;
    }


.input-box:focus-within .input-icon {
    color: #198754;
}


.field-error {
    display: block;
    margin-top: 6px;
    color: #c0392b;
    font-size: 0.72rem;
}


/* =========================================================
   Remember
   ========================================================= */

.login-options {
    margin: 2px 0 24px;
}


.remember-option {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: #68766f;
    font-size: 0.77rem;
    cursor: pointer;
    user-select: none;
}


    .remember-option input {
        position: absolute;
        opacity: 0;
        pointer-events: none;
    }


.remember-box {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #cbd4d0;
    border-radius: 5px;
    color: transparent;
    font-size: 0.6rem;
    transition: all 0.2s ease;
}


.remember-option input:checked + .remember-box {
    background: #198754;
    border-color: #198754;
    color: #ffffff;
}


/* =========================================================
   Login Button
   ========================================================= */

.login-button {
    width: 100%;
    height: 55px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    border: 0;
    border-radius: 13px;
    background: linear-gradient( 135deg, #198754, #126b43 );
    color: #ffffff;
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    box-shadow: 0 12px 25px rgba(25, 135, 84, 0.19);
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}


    .login-button:hover {
        color: #ffffff;
        filter: brightness(1.04);
        transform: translateY(-1px);
        box-shadow: 0 16px 30px rgba(25, 135, 84, 0.24);
    }


    .login-button:active {
        transform: translateY(0);
    }


    .login-button i {
        font-size: 0.72rem;
    }


/* =========================================================
   Register Divider
   ========================================================= */

.register-divider {
    display: flex;
    align-items: center;
    gap: 13px;
    margin: 23px 0;
}


    .register-divider span {
        flex: 1;
        height: 1px;
        background: #e4e9e6;
    }


    .register-divider em {
        color: #a5afaa;
        font-size: 0.72rem;
        font-style: normal;
    }


/* =========================================================
   Register Button
   ========================================================= */

.register-button {
    width: 100%;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    border: 1px solid #b9c7c1;
    border-radius: 13px;
    background: transparent;
    color: #126b43;
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}


    .register-button:hover {
        color: #126b43;
        background: #f3f8f5;
        border-color: #198754;
        transform: translateY(-1px);
    }


    .register-button i {
        font-size: 0.82rem;
    }


/* =========================================================
   Footer
   ========================================================= */

.login-footer {
    margin-top: 42px;
    text-align: center;
    color: #a1aba7;
}


.footer-line {
    width: 100%;
    height: 1px;
    margin-bottom: 22px;
    background: #e8ecea;
}


.footer-icon {
    width: 34px;
    height: 34px;
    margin: 0 auto 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #b0bbb6;
    font-size: 0.85rem;
}


.login-footer p {
    margin: 0;
    font-size: 0.72rem;
    font-weight: 600;
}


.login-footer > span {
    display: block;
    margin-top: 3px;
    font-size: 0.68rem;
}


/* =========================================================
   Tablet
   ========================================================= */

@media (max-width: 1100px) {

    .login-shell {
        grid-template-columns: minmax(0, 1fr) minmax(390px, 0.9fr);
    }


    .login-content {
        width: min(400px, calc(100% - 56px));
    }


    .building-message {
        left: 6%;
    }


    .building-footer {
        left: 6%;
    }
}


/* =========================================================
   Mobile
   ========================================================= */

@media (max-width: 767.98px) {

    .login-shell {
        min-height: 100dvh;
        display: flex;
        flex-direction: column;
        background: #ffffff;
    }


    /* =====================================================
       Building Image
       ===================================================== */

    .login-building {
        position: relative;
        width: 100%;
        /*
           No fixed height.
           The image determines its own height.
        */

        height: auto;
        min-height: 0;
        aspect-ratio: auto;
        flex: 0 0 auto;
        overflow: hidden;
        background: #ffffff;
    }


    .building-image-wrapper {
        position: relative;
        inset: auto;
        width: 100%;
        height: auto;
        display: block;
        overflow: visible;
    }


    /*
       IMPORTANT:
       The complete original image is always visible.
       No crop.
    */

    .building-image {
        display: block;
        width: 100%;
        height: auto;
        max-width: 100%;
        object-fit: initial;
        object-position: center;
        margin: 0;
    }


    /* =====================================================
       Artistic Fade Into Login
       ===================================================== */

    .building-art-overlay {
        position: absolute;
        z-index: 2;
        inset: 0;
        pointer-events: none;
        background: linear-gradient( to bottom, rgba(255, 255, 255, 0) 62%, rgba(255, 255, 255, 0.02) 68%, rgba(255, 255, 255, 0.20) 76%, rgba(255, 255, 255, 0.62) 87%, #ffffff 100% );
    }


        /*
       Remove the dark desktop vignette.
       On mobile we want the image to dissolve
       naturally into the white login area.
    */

        .building-art-overlay::after {
            display: none;
        }


    /* =====================================================
       Building Message
       ===================================================== */

    .building-message {
        top: 9%;
        left: 7%;
        z-index: 4;
    }


        .building-message span,
        .building-message strong {
            font-size: clamp(1rem, 4vw, 1.35rem);
            line-height: 1.55;
        }


    .building-message-line {
        width: 28px;
        margin-bottom: 9px;
    }


    /* =====================================================
       Building Footer
       ===================================================== */

    .building-footer {
        left: 7%;
        bottom: 9%;
        z-index: 4;
        font-size: 0.5rem;
    }


    /* =====================================================
       Login Panel
       ===================================================== */

    .login-panel {
        width: 100%;
        min-height: 0;
        display: block;
        margin-top: -1px;
        background: #ffffff;
    }


    .login-content {
        width: 100%;
        padding: 28px 24px 38px;
    }


    /* =====================================================
       Brand
       ===================================================== */

    .login-brand {
        margin-bottom: 32px;
    }


    .brand-mark {
        width: 47px;
        height: 47px;
        flex-basis: 47px;
        border-radius: 14px;
        font-size: 1.05rem;
    }


    .brand-title {
        font-size: 1.05rem;
    }


    .brand-subtitle {
        font-size: 0.70rem;
    }


    /* =====================================================
       Heading
       ===================================================== */

    .login-heading {
        margin-bottom: 12px;
        text-align: center;
    }


        .login-heading h1 {
            font-size: 1.65rem;
        }


        .login-heading p {
            font-size: 0.80rem;
        }


    /* =====================================================
       Inputs
       ===================================================== */

    .custom-input {
        height: 52px;
    }


    .login-button {
        height: 53px;
    }


    .register-button {
        height: 51px;
    }


    /* =====================================================
       Footer
       ===================================================== */

    .login-footer {
        margin-top: 34px;
    }
}


/* =========================================================
   Small Mobile
   ========================================================= */

@media (max-width: 380px) {

    .login-content {
        padding: 25px 20px 32px;
    }


    .login-brand {
        margin-bottom: 27px;
    }


    .login-heading h1 {
        font-size: 1.5rem;
    }


    .form-field {
        margin-bottom: 18px;
    }


    .custom-input,
    .login-button {
        height: 50px;
    }
}


/* =========================================================
   Reduced Motion
   ========================================================= */

@media (prefers-reduced-motion: reduce) {

    .custom-input,
    .login-button,
    .register-button,
    .input-icon,
    .remember-box {
        transition: none;
    }
}
