
/* =========================================
   ELECTRICAL INVENTORY
   SOFT UI LOGIN DESIGN
   ========================================= */

.auth-page:has(.login-emblem) {
    --login-bg: #eaf0f8;
    --login-card: #f9fbfe;
    --login-navy: #173652;
    --login-blue: #3978b8;
    --login-muted: #75879e;
    --login-border: #d9e2ef;
    position: relative;
    isolation: isolate;
    direction: rtl;
    width: 100%;
    min-height: 100vh;
    min-height: 100svh;
    margin: 0;
    padding: 0;
    display: grid;
    place-items: center;
    background: radial-gradient( ellipse at 80% 15%, #ffffff 0%, #eaf0f8 55%, #dce6f3 100% );
    font-family: 'IRANSansX', sans-serif;
    overflow: hidden;
}

    /* =========================================
   DESKTOP BACKGROUND IMAGE
   ========================================= */

    .auth-page:has(.login-emblem)::before {
        content: "";
        position: absolute;
        z-index: -1;
        inset: 18px auto 18px 18px;
        width: 44%;
        height: auto;
        background-color: #c4d3e3;
        background-image: linear-gradient( 180deg, transparent 50%, rgba(16, 43, 75, .25) ), url('/images/backgrounds/login-warehouse.jpg');
        background-size: cover;
        background-position: center;
        border-radius: 30px;
        clip-path: none;
        opacity: 1;
        box-shadow: 10px 10px 30px rgba(69, 94, 125, .15), -5px -5px 15px rgba(255, 255, 255, .8);
    }

    .auth-page:has(.login-emblem)::after {
        display: none;
    }

/* =========================================
   MAIN LAYOUT
   ========================================= */

.auth-shell:has(.login-emblem) {
    position: relative;
    display: flex;
    justify-content: flex-start;
    width: 100%;
    max-width: none;
    min-height: 100svh;
    margin: 0;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    overflow: visible;
}

    .auth-shell:has(.login-emblem) .auth-brand {
        display: none;
    }

    .auth-shell:has(.login-emblem) .auth-panel {
        position: relative;
        isolation: isolate;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        width: 54%;
        max-width: none;
        min-height: 100svh;
        padding: 35px 40px 145px;
        background: transparent;
        border: none;
        border-radius: 0;
        box-shadow: none;
    }

    .auth-shell:has(.login-emblem) .auth-panel-inner {
        position: static;
        width: 100%;
        max-width: 460px;
        margin: 0 auto;
    }

/* =========================================
   RAISED COMPANY LOGO
   ========================================= */

.auth-panel .login-emblem {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 115px;
    height: 115px;
    margin: 0 auto 20px;
    padding: 17px;
    background: linear-gradient( 145deg, #ffffff, #e1e9f4 );
    border: 2px solid rgba(255, 255, 255, .9);
    border-radius: 30px;
    box-shadow: 9px 9px 20px rgba(130, 153, 184, .28), -7px -7px 18px rgba(255, 255, 255, .95);
    transform: none;
}

.login-company-logo {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    mix-blend-mode: multiply;
}

/* =========================================
   COMPANY HEADING
   ========================================= */

.login-company-heading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    text-align: center;
    color: var(--login-navy);
}

    .login-company-heading strong {
        font-size: clamp(22px, 2.1vw, 30px);
        font-weight: 700;
        line-height: 1.7;
    }

    .login-company-heading span {
        font-size: 12px;
        font-weight: 400;
        color: var(--login-muted);
    }

.login-heading-divider {
    width: 60%;
    height: 1px;
    margin: 20px auto;
    background: linear-gradient( 90deg, transparent, #bdcfe3, transparent );
}

/* =========================================
   SYSTEM TITLE
   ========================================= */

.login-heading {
    position: relative;
    margin: 0;
    padding: 25px 24px 12px;
    text-align: center;
    background: var(--login-card);
    border: 1px solid #ffffff;
    border-bottom: 0;
    border-radius: 26px 26px 0 0;
    box-shadow: 0 -6px 20px rgba(255, 255, 255, .45), 10px 0 25px rgba(112, 139, 174, .08);
}

.auth-shell:has(.login-emblem) .login-heading h1 {
    margin: 0;
    color: var(--login-navy);
    font-size: clamp(19px, 1.8vw, 26px);
    font-weight: 700;
    line-height: 1.8;
}

.login-heading p {
    margin: 6px 0 0;
    font-size: 13px;
    font-weight: 400;
    color: var(--login-muted);
}

/* =========================================
   RAISED LOGIN CARD
   ========================================= */

.auth-shell:has(.login-emblem) .auth-form {
    position: relative;
    display: grid;
    gap: 16px;
    margin: 0;
    padding: 15px 24px 27px;
    background: var(--login-card);
    border: 1px solid #ffffff;
    border-top: 0;
    border-radius: 0 0 26px 26px;
    box-shadow: 10px 12px 25px rgba(112, 139, 174, .17), -8px 8px 22px rgba(255, 255, 255, .7);
}

/* =========================================
   RECESSED INPUT FIELDS
   ========================================= */

.auth-shell:has(.login-emblem) .auth-field {
    position: relative;
}

    .auth-shell:has(.login-emblem) .auth-field label {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip-path: inset(50%);
    }

    .auth-shell:has(.login-emblem) .auth-field input {
        width: 100%;
        min-height: 56px;
        padding: 12px 48px 12px 16px;
        background-color: #edf2f8;
        background-repeat: no-repeat;
        background-position: right 15px center;
        background-size: 22px;
        border: 1px solid #dce5f0;
        border-radius: 13px;
        box-shadow: inset 3px 3px 7px rgba(132, 154, 182, .13), inset -3px -3px 7px rgba(255, 255, 255, .85);
        color: var(--login-navy);
        font-family: inherit;
        font-size: 16px;
        direction: rtl;
        text-align: right;
        transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
    }

        .auth-shell:has(.login-emblem) .auth-field input::placeholder {
            color: #75879e;
        }

        .auth-shell:has(.login-emblem) .auth-field input:focus {
            outline: none;
            background-color: #ffffff;
            border-color: #82a9d0;
            box-shadow: 0 0 0 3px rgba(57, 120, 184, .12);
        }

/* Username icon */

.auth-shell:has(.login-emblem) #auth-username {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2352708f' stroke-width='1.7'%3E%3Ccircle cx='12' cy='7' r='4'/%3E%3Cpath d='M3 22v-3a9 9 0 0 1 18 0v3z'/%3E%3C/svg%3E");
}

/* Password icon */

.auth-shell:has(.login-emblem) #auth-password {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2352708f' stroke-width='1.7'%3E%3Crect x='5' y='10' width='14' height='12' rx='2'/%3E%3Cpath d='M8 10V6a4 4 0 0 1 8 0v4M12 14v4'/%3E%3C/svg%3E");
    padding-left: 50px;
}

/* =========================================
   PASSWORD VISIBILITY
   ========================================= */

.auth-password {
    position: relative;
}

.auth-shell:has(.login-emblem) .auth-reveal {
    position: absolute;
    top: 50%;
    left: 6px;
    bottom: auto;
    transform: translateY(-50%);
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: #52708f;
    cursor: pointer;
}

.auth-reveal:not([hidden]) {
    display: grid;
    place-items: center;
}

.auth-reveal .eye-slash {
    display: none;
}

.auth-reveal[aria-pressed="true"] .eye-slash {
    display: block;
}

/* =========================================
   RAISED LOGIN BUTTON
   ========================================= */

.auth-shell:has(.login-emblem) .auth-submit {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 56px;
    margin-top: 6px;
    padding: 12px 48px;
    background: linear-gradient( 145deg, #3978b8 0%, #28598f 55%, #173e70 100% );
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: 13px;
    box-shadow: 0 6px 0 #16365d, 0 10px 18px rgba(29, 65, 109, .23), inset 0 1px 1px rgba(255, 255, 255, .3);
    color: #ffffff;
    font-family: inherit;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}

    .auth-shell:has(.login-emblem) .auth-submit svg {
        position: absolute;
        right: 16px;
    }

    .auth-shell:has(.login-emblem) .auth-submit:hover {
        filter: brightness(1.08);
    }

    .auth-shell:has(.login-emblem) .auth-submit:active {
        transform: translateY(4px);
        box-shadow: 0 2px 0 #16365d, 0 4px 8px rgba(29, 65, 109, .2);
    }

/* =========================================
   ERROR MESSAGE
   ========================================= */

.auth-shell:has(.login-emblem) .auth-error {
    position: relative;
    margin: 0;
    padding: 12px 18px;
    background: #fff0f0;
    border: 1px solid #f2caca;
    color: #b42323;
    font-size: 13px;
    line-height: 1.8;
}

/* =========================================
   COMPANY FOOTER
   ========================================= */

.login-footer {
    position: relative;
    margin: 24px auto 0;
    text-align: center;
    color: #75879e;
    font-size: 11px;
}

/* =========================================
   THREE-DIMENSIONAL WAVES
   ========================================= */

.auth-panel .login-decoration {
    position: absolute;
    z-index: -1;
    inset: auto 0 0 0;
    width: 100%;
    height: 135px;
    background-image: url('/images/backgrounds/login-skyline.svg');
    background-repeat: no-repeat;
    background-position: center bottom;
    background-size: 100% 100%;
    pointer-events: none;
}

/* =========================================
   MOBILE AND TABLET
   ========================================= */

@media (max-width: 800px) {

    .auth-page:has(.login-emblem) {
        padding: 0;
        background: radial-gradient( ellipse at 50% 0%, #ffffff, #eaf0f8 60%, #dce6f3 100% );
    }

        /* No heavy image on mobile */

        .auth-page:has(.login-emblem)::before,
        .auth-page:has(.login-emblem)::after {
            display: none;
            background-image: none;
        }

    .auth-shell:has(.login-emblem) {
        display: block;
        width: 100%;
        min-height: 100svh;
    }

        .auth-shell:has(.login-emblem) .auth-panel {
            display: flex;
            flex-direction: column;
            justify-content: center;
            width: 100%;
            max-width: none;
            min-height: 100svh;
            padding: 35px 22px 120px;
        }

        .auth-shell:has(.login-emblem) .auth-panel-inner {
            width: 100%;
            max-width: 400px;
        }

    .auth-panel .login-emblem {
        width: 100px;
        height: 100px;
        margin: 0 auto 17px;
        padding: 15px;
        border-radius: 26px;
    }

    .login-company-heading strong {
        font-size: 23px;
    }

    .login-company-heading span {
        font-size: 11px;
    }

    .login-heading-divider {
        margin: 17px auto;
    }

    .login-heading {
        padding: 22px 15px 12px;
        border-radius: 23px 23px 0 0;
    }

    .auth-shell:has(.login-emblem) .login-heading h1 {
        font-size: clamp(17px, 4.6vw, 21px);
    }

    .login-heading p {
        font-size: 12px;
    }

    .auth-shell:has(.login-emblem) .auth-form {
        padding: 14px 18px 25px;
        gap: 14px;
        border-radius: 0 0 23px 23px;
    }

    .auth-shell:has(.login-emblem) .auth-field input {
        min-height: 53px;
        font-size: 16px;
    }

    .auth-shell:has(.login-emblem) .auth-submit {
        min-height: 53px;
        font-size: 15px;
    }

    .login-footer {
        margin-top: 22px;
        font-size: 10px;
    }

    .auth-panel .login-decoration {
        height: 105px;
    }
}

/* =========================================
   SMALL MOBILE
   ========================================= */

@media (max-width: 380px) {

    .auth-shell:has(.login-emblem) .auth-panel {
        padding: 25px 16px 100px;
    }

    .auth-panel .login-emblem {
        width: 85px;
        height: 85px;
        padding: 12px;
    }

    .login-company-heading strong {
        font-size: 20px;
    }

    .auth-shell:has(.login-emblem) .auth-form {
        padding-inline: 15px;
    }

    .auth-panel .login-decoration {
        height: 80px;
    }
}

/* =========================================
   SHORT SCREENS
   ========================================= */

@media (max-height: 720px) {

    .auth-panel .login-emblem {
        width: 85px;
        height: 85px;
        padding: 12px;
        margin-bottom: 12px;
    }

    .login-heading-divider {
        margin: 12px auto;
    }

    .auth-shell:has(.login-emblem) .auth-panel {
        padding-top: 20px;
        padding-bottom: 100px;
    }

    .auth-panel .login-decoration {
        height: 80px;
    }
}

@media (prefers-reduced-motion: reduce) {

    .auth-form input,
    .auth-form button {
        transition: none;
    }
}

@media (max-width: 800px) {

    .auth-shell:has(.login-emblem) .auth-panel {
        justify-content: flex-start;
        padding-top: 30px;
        padding-bottom: 110px;
    }

    .auth-panel .login-emblem {
        margin-top: 0;
        margin-bottom: 12px;
    }

    .login-heading-divider {
        margin: 12px auto;
    }

    .login-footer {
        margin-top: 18px;
    }
}

/* =========================================
   MOBILE FULL SCREEN LOGIN
   ========================================= */

@media (max-width: 800px) {

    .auth-page:has(.login-emblem) {
        height: 100dvh;
        min-height: 100dvh;
        padding: 0;
        overflow: hidden;
    }

    .auth-shell:has(.login-emblem) {
        height: 100%;
        min-height: 0;
    }

        .auth-shell:has(.login-emblem) .auth-panel {
            box-sizing: border-box;
            height: 100%;
            min-height: 0;
            width: 100%;
            justify-content: flex-start;
            padding: 20px 22px 85px;
            overflow-y: auto;
        }

    /* Company logo */

    .auth-panel .login-emblem {
        box-sizing: border-box;
        width: clamp(65px, 12dvh, 95px);
        height: clamp(65px, 12dvh, 95px);
        padding: 12px;
        margin: 0 auto 12px;
        border-radius: 24px;
    }

    .login-company-heading {
        gap: 2px;
    }

        .login-company-heading strong {
            font-size: 21px;
            line-height: 1.6;
        }

        .login-company-heading span {
            font-size: 11px;
        }

    .login-heading-divider {
        margin: 12px auto;
    }

    /* Login card */

    .login-heading {
        padding: 16px 12px 8px;
    }

    .auth-shell:has(.login-emblem) .login-heading h1 {
        font-size: 18px;
        line-height: 1.7;
    }

    .login-heading p {
        margin-top: 3px;
        font-size: 12px;
    }

    .auth-shell:has(.login-emblem) .auth-form {
        padding: 12px 18px 22px;
        gap: 12px;
    }

    .auth-shell:has(.login-emblem) .auth-field input {
        box-sizing: border-box;
        min-height: 48px;
        height: 48px;
        font-size: 16px;
    }

    .auth-shell:has(.login-emblem) .auth-submit {
        min-height: 48px;
        height: 48px;
        margin-top: 4px;
        font-size: 15px;
    }

    /* Footer */

    .login-footer {
        margin-top: 15px;
        font-size: 10px;
    }

    /* Bottom 3D waves */

    .auth-panel .login-decoration {
        height: clamp(112px, 23dvh, 210px);
    }
}

/* Small-height mobile screens */

@media (max-width: 800px) and (max-height: 650px) {

    .auth-shell:has(.login-emblem) .auth-panel {
        padding: 10px 18px 55px;
    }

    .auth-panel .login-emblem {
        width: 65px;
        height: 65px;
        padding: 9px;
        margin-bottom: 8px;
    }

    .login-company-heading strong {
        font-size: 19px;
    }

    .login-heading-divider {
        margin: 8px auto;
    }

    .login-heading {
        padding-top: 12px;
    }

    .auth-shell:has(.login-emblem) .auth-form {
        gap: 9px;
        padding-bottom: 18px;
    }

    .login-footer {
        margin-top: 10px;
    }

    .auth-panel .login-decoration {
        height: clamp(72px, 17dvh, 112px);
    }
}
