/* =========================================================
   ZIGGURAT LOGIN v3 — EXACT MOCKUP
   ========================================================= */

:root{
    --zg-navy:#0b3150;
    --zg-navy-deep:#071d31;
    --zg-teal:#13b4ad;
    --zg-teal-soft:#4bd7d1;
    --zg-text:#18364d;
    --zg-muted:#718493;
    --zg-border:#cbd8e1;
    --zg-danger:#b83f49;
}

*{
    box-sizing:border-box;
}

html,
body{
    margin:0;
    width:100%;
    min-height:100%;
}

body.zg-login-page{
    min-height:100vh;
    overflow:hidden;
    color:var(--zg-text);

    font-family:
        "Vazirmatn",
        "IRANSansX",
        "Segoe UI",
        Tahoma,
        Arial,
        sans-serif;

    -webkit-font-smoothing:antialiased;
    text-rendering:optimizeLegibility;
}

button,
input{
    font:inherit;
}

.zg-sr-only{
    position:absolute !important;
    width:1px !important;
    height:1px !important;
    padding:0 !important;
    margin:-1px !important;
    overflow:hidden !important;
    clip:rect(0,0,0,0) !important;
    white-space:nowrap !important;
    border:0 !important;
}

/* =========================================================
   FULL-SCREEN ZIGGURAT BACKGROUND
   ========================================================= */

.zg-login-shell{
    position:fixed;
    inset:0;

    width:100vw;
    height:100vh;
    height:100dvh;
    min-height:0;

    overflow:hidden;

    background:
        linear-gradient(
            0deg,
            rgba(4,18,31,.42) 0%,
            rgba(4,18,31,.04) 31%,
            rgba(4,18,31,.03) 100%
        ),
        url("../images/ziggurat-login-bg.jpg")
        center 46% / cover no-repeat;
}

/* =========================================================
   ORGANIZATION LOGOS — TOGETHER AT TOP LEFT
   ========================================================= */

.zg-org-brands{
    position:fixed;
    z-index:4;

    top:12px;
    left:34px;

    display:flex;
    align-items:center;
    justify-content:flex-start;
    gap:11px;

    direction:ltr;
    padding:0;

    background:transparent;
}

.zg-org-brand{
    position:static;

    display:flex;
    align-items:center;
    justify-content:center;

    background:transparent;
}

.zg-org-brand img{
    display:block;
    max-width:100%;
    max-height:100%;
    object-fit:contain;

    filter:
        drop-shadow(0 2px 3px rgba(0,0,0,.25))
        drop-shadow(0 7px 15px rgba(0,0,0,.14));
}

.zg-org-brand--university{
    width:126px;
    height:78px;
}

.zg-org-brand--ifda{
    width:88px;
    height:74px;
}

.zg-org-brands__divider{
    display:block;
    width:1px;
    height:48px;

    background:
        linear-gradient(
            180deg,
            transparent,
            rgba(255,255,255,.48) 18%,
            rgba(255,255,255,.48) 82%,
            transparent
        );
}

/* =========================================================
   FLOATING LOGIN CARD
   ========================================================= */

.zg-login-card{
    position:fixed;
    z-index:5;

    top:43%;
    right:clamp(34px,5.4vw,92px);
    transform:translateY(-50%);

    width:clamp(385px,26vw,455px);

    padding:22px 31px 27px;

    border:1px solid rgba(255,255,255,.78);
    border-radius:26px;

    background:
        linear-gradient(
            155deg,
            rgba(255,255,255,.975) 0%,
            rgba(248,248,246,.945) 100%
        );

    box-shadow:
        0 28px 64px rgba(1,20,35,.25),
        0 5px 16px rgba(1,20,35,.12);

    backdrop-filter:blur(12px);
}

.zg-login-card__brand{
    height:100px;
    margin:0 0 11px;

    display:flex;
    align-items:center;
    justify-content:center;

    overflow:hidden;
}

.zg-main-logo{
    display:block;
    width:min(340px,92%);
    max-height:96px;
    object-fit:contain;
}

/* ----------------------------
   Error message
   ---------------------------- */

.zg-login-alert{
    display:flex;
    align-items:center;
    gap:8px;

    margin:0 0 12px;
    padding:9px 11px;

    border:1px solid #efcfd3;
    border-radius:10px;

    background:#fff6f7;
    color:var(--zg-danger);

    font-size:12px;
    line-height:1.65;
    font-weight:650;
}

.zg-login-alert svg{
    width:18px;
    height:18px;
    flex:0 0 auto;

    fill:none;
    stroke:currentColor;
    stroke-width:1.8;
    stroke-linecap:round;
    stroke-linejoin:round;
}

/* ----------------------------
   Form
   ---------------------------- */

.zg-login-form{
    display:grid;
    gap:15px;
}

.zg-field label{
    display:block;
    margin:0 0 7px;

    color:#263d50;

    font-size:13px;
    line-height:1.6;
    font-weight:700;
}

.zg-input{
    position:relative;
}

.zg-input input{
    width:100%;
    height:52px;

    padding:0 47px;

    border:1px solid var(--zg-border);
    border-radius:11px;

    outline:none;

    background:rgba(255,255,255,.90);
    color:#22394d;

    font-size:13.5px;

    box-shadow:
        inset 0 1px 1px rgba(12,50,78,.03);

    transition:
        border-color .16s ease,
        box-shadow .16s ease,
        background .16s ease;
}

.zg-input input::placeholder{
    color:#9ba9b5;
}

.zg-input input:hover{
    border-color:#b9c9d3;
}

.zg-input input:focus{
    border-color:#19b5ad;
    background:#fff;

    box-shadow:
        0 0 0 4px rgba(19,180,173,.10);
}

.zg-input__icon,
.zg-password-toggle{
    position:absolute;
    top:50%;
    transform:translateY(-50%);

    display:grid;
    place-items:center;

    color:#71869a;
}

.zg-input__icon{
    right:14px;
    width:22px;
    height:22px;

    pointer-events:none;
}

.zg-password-toggle{
    left:10px;

    width:34px;
    height:34px;

    padding:0;

    border:0;
    border-radius:8px;

    background:transparent;

    cursor:pointer;

    transition:
        background .15s ease,
        color .15s ease;
}

.zg-password-toggle:hover{
    background:#eaf5f5;
    color:#078f89;
}

.zg-input__icon svg,
.zg-password-toggle svg{
    width:20px;
    height:20px;

    fill:none;
    stroke:currentColor;
    stroke-width:1.7;
    stroke-linecap:round;
    stroke-linejoin:round;
}

.zg-login-submit{
    width:100%;
    height:56px;

    margin-top:3px;

    border:0;
    border-radius:11px;

    display:flex;
    align-items:center;
    justify-content:center;
    gap:13px;

    background:
        linear-gradient(
            105deg,
            #0a5480 0%,
            #07968f 58%,
            #13b4ad 100%
        );

    color:#fff;

    box-shadow:
        0 13px 28px rgba(0,117,128,.23);

    cursor:pointer;

    font-size:14px;
    font-weight:820;

    transition:
        transform .15s ease,
        box-shadow .15s ease,
        filter .15s ease;
}

.zg-login-submit:hover{
    transform:translateY(-1px);
    filter:saturate(1.05);

    box-shadow:
        0 16px 34px rgba(0,117,128,.29);
}

.zg-login-submit:focus-visible,
.zg-password-toggle:focus-visible{
    outline:3px solid rgba(19,180,173,.26);
    outline-offset:2px;
}

.zg-login-submit svg{
    width:20px;
    height:20px;

    fill:none;
    stroke:currentColor;
    stroke-width:1.9;
    stroke-linecap:round;
    stroke-linejoin:round;
}

/* =========================================================
   CAPABILITIES BAR
   ========================================================= */

.zg-capabilities{
    position:fixed;
    z-index:6;

    left:3.5%;
    right:3.5%;
    bottom:12px;

    height:86px;

    display:grid;
    grid-template-columns:
        minmax(0,1fr) 1px
        minmax(0,1fr) 1px
        minmax(0,1fr) 1px
        minmax(0,1fr);

    align-items:center;

    padding:9px 22px;

    border:1px solid rgba(255,255,255,.22);
    border-radius:18px;

    background:
        linear-gradient(
            105deg,
            rgba(11,31,49,.82) 0%,
            rgba(25,43,58,.76) 100%
        );

    box-shadow:
        0 10px 26px rgba(0,0,0,.18);

    backdrop-filter:blur(12px);
}

.zg-capability{
    min-width:0;

    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    gap:4px;

    color:rgba(255,255,255,.92);

    font-size:12.5px;
    line-height:1.45;
    font-weight:500;

    text-align:center;
}

.zg-capability__icon{
    width:29px;
    height:29px;

    display:grid;
    place-items:center;

    color:#42d7d0;
}

.zg-capability__icon svg{
    width:27px;
    height:27px;

    fill:none;
    stroke:currentColor;
    stroke-width:1.55;
    stroke-linecap:round;
    stroke-linejoin:round;
}

.zg-capability-divider{
    display:block;

    width:1px;
    height:48px;

    background:
        linear-gradient(
            180deg,
            transparent,
            rgba(255,255,255,.58) 18%,
            rgba(255,255,255,.58) 82%,
            transparent
        );
}

/* =========================================================
   VIEWPORT HEIGHT ADAPTATION — ZOOM 100% SAFE
   ========================================================= */

@media (max-height:900px) and (min-width:901px){
    .zg-org-brands{
        top:10px;
        left:28px;
    }

    .zg-org-brand--university{
        width:116px;
        height:70px;
    }

    .zg-org-brand--ifda{
        width:80px;
        height:68px;
    }

    .zg-org-brands__divider{
        height:44px;
    }

    .zg-login-card{
        top:42%;
        width:420px;
        padding:19px 28px 23px;
    }

    .zg-login-card__brand{
        height:76px;
        margin-bottom:6px;
    }

    .zg-main-logo{
        max-height:75px;
    }

    .zg-login-form{
        gap:10px;
    }

    .zg-field label{
        margin-bottom:4px;
        font-size:12px;
    }

    .zg-input input{
        height:45px;
    }

    .zg-login-submit{
        height:48px;
    }

    .zg-capabilities{
        bottom:10px;
        height:80px;
    }
}

@media (max-height:760px) and (min-width:901px){
    .zg-org-brands{
        top:7px;
    }

    .zg-org-brand--university{
        width:102px;
        height:61px;
    }

    .zg-org-brand--ifda{
        width:70px;
        height:59px;
    }

    .zg-org-brands__divider{
        height:38px;
    }

    .zg-login-card{
        top:40%;
        width:400px;
        padding:16px 25px 19px;
    }

    .zg-login-card__brand{
        height:64px;
        margin-bottom:4px;
    }

    .zg-main-logo{
        max-height:63px;
    }

    .zg-login-form{
        gap:8px;
    }

    .zg-input input{
        height:41px;
    }

    .zg-login-submit{
        height:44px;
    }

    .zg-capabilities{
        left:3%;
        right:3%;
        bottom:7px;
        height:72px;
    }

    .zg-capability{
        font-size:11.5px;
    }

    .zg-capability__icon,
    .zg-capability__icon svg{
        width:24px;
        height:24px;
    }

    .zg-capability-divider{
        height:40px;
    }
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width:1100px){
    .zg-login-card{
        right:42px;
        width:410px;
    }

    .zg-org-brands{
        left:24px;
    }
}

@media (max-width:900px){
    body.zg-login-page{
        overflow:auto;
    }

    .zg-login-shell{
        position:relative;
        inset:auto;
        min-height:900px;
        width:100%;
        height:auto;

        background-position:center center;
    }

    .zg-login-card{
        position:absolute;
        top:175px;
        right:50%;

        width:min(450px,calc(100% - 36px));

        transform:translateX(50%);
    }

    .zg-org-brands{
        position:absolute;
        top:20px;
        left:20px;
        gap:10px;
    }

    .zg-org-brand--university{
        width:132px;
        height:82px;
    }

    .zg-org-brand--ifda{
        width:92px;
        height:78px;
    }

    .zg-org-brands__divider{
        height:52px;
    }

    .zg-capabilities{
        position:absolute;
        left:18px;
        right:18px;
        bottom:20px;

        height:auto;
        min-height:170px;

        grid-template-columns:1fr 1fr;
        gap:8px 12px;

        padding:15px;
    }

    .zg-capability-divider{
        display:none;
    }

    .zg-capability{
        flex-direction:row;
        justify-content:flex-start;

        padding:7px 10px;

        border:1px solid rgba(255,255,255,.11);
        border-radius:10px;

        background:rgba(255,255,255,.035);

        text-align:right;
    }
}

@media (max-width:520px){
    .zg-login-shell{
        min-height:860px;
    }

    .zg-org-brands{
        left:14px;
        gap:8px;
    }

    .zg-org-brand--university{
        width:108px;
        height:70px;
    }

    .zg-org-brand--ifda{
        width:76px;
        height:68px;
    }

    .zg-org-brands__divider{
        height:44px;
    }

    .zg-login-card{
        top:145px;

        padding:21px 20px 25px;
        border-radius:21px;
    }

    .zg-login-card__brand{
        height:85px;
    }

    .zg-main-logo{
        max-height:82px;
    }

    .zg-capabilities{
        min-height:195px;
    }
}

@media (prefers-reduced-motion:reduce){
    *,
    *::before,
    *::after{
        transition:none !important;
        animation:none !important;
    }
}
