/* ══════════════════════════════════════════════════════════════════════
   صفحه ورود
   دسکتاپ: دو ستون؛ راست تصویر مه‌آلود کارخانه با نام سامانه، چپ فرم ورود.
   موبایل: تصویر نوار بالای صفحه و کارت فرم که رویش بالا می‌آید.
   ══════════════════════════════════════════════════════════════════════ */

.login-body {
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    padding: 0;
    background: var(--bg);
}

.login-shell {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(400px, 1fr);   /* RTL: ستون اول سمت راست */
    min-height: 100vh;
    min-height: 100dvh;
}

/* ── تصویر ────────────────────────────────────────────────────────── */

.login-visual {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 40px;
    background: #dfe8f2 url("../image/plant-bg.webp") 78% bottom / cover no-repeat;   /* سیلو و برج سمت راست در قاب */
}

/* آسمان آبی سازمانی تا وسط (جای متن)، پایین خود کارخانه */
.login-visual::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg,
        rgba(13, 71, 161, .92) 0%, rgba(17, 82, 170, .8) 42%, rgba(21, 101, 192, .4) 64%, rgba(255, 255, 255, 0) 82%);
}

.login-visual-text {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 520px;
    margin-bottom: 12vh;              /* کمی بالاتر از مرکز، روی آسمان نه روی سازه‌ها */
    color: #fff;
    text-align: center;
    animation: login-rise .6s ease-out both;
}

.login-logos {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 22px;
}

.login-logo {
    display: grid;
    place-items: center;
    width: 76px;
    height: 76px;
    padding: 10px;
    background: rgba(255, 255, 255, .92);
    border-radius: 22px;
    box-shadow: 0 12px 30px rgba(8, 30, 70, .25);
}

.login-logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.login-logo b {
    font-size: 22px;
    font-weight: 800;
    color: var(--primary-d, #0d47a1);
}

.login-visual-text h2 {
    margin: 0;
    font-size: clamp(24px, 2.5vw, 36px);
    font-weight: 800;
    line-height: 1.5;
    text-shadow: 0 2px 14px rgba(8, 30, 70, .25);
}

/* «دادمان»: طلایی گرم روی آسمان آبی */
/* «دادمان»: آبی آسمانی روشن تا روی زمینه‌ی آبی تیره بدرخشد */
.login-brandword {
    background: linear-gradient(120deg, #ffffff 0%, #b3e5fc 40%, #4fc3f7 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
    text-shadow: none;
    filter: drop-shadow(0 0 14px rgba(3, 169, 244, .55));
}

/* نام انگلیسی زیر عنوان */
.login-title-en {
    margin: 8px 0 0;
    font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: clamp(11px, 1vw, 13.5px);
    font-weight: 500;
    letter-spacing: .22em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .9);
    text-shadow: 0 1px 8px rgba(8, 30, 70, .3);
}

.login-title-en span {
    font-weight: 800;
    color: #b3e5fc;
}

/* ── فرم ──────────────────────────────────────────────────────────── */

.login-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 22px;
    padding: 40px 32px 24px;
    background: var(--card);
    box-shadow: 12px 0 40px rgba(13, 71, 161, .10);
    z-index: 1;
}

.login-box {
    width: 100%;
    max-width: 380px;
    animation: login-rise .45s ease-out both;
}

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

.login-title {
    margin: 0 0 6px;
    font-size: 22px;
    font-weight: 800;
    color: var(--text);
}

.login-lead {
    margin: 0 0 22px;
    font-size: 13px;
    color: var(--muted);
}

.login-alert {
    margin-bottom: 16px;
    padding: 10px 14px;
    font-size: 13px;
    border-radius: 12px;
}

.login-alert.is-error {
    color: var(--danger, #c62828);
    background: var(--danger-soft, #fdecea);
    border: 1px solid currentColor;
}

.login-alert.is-info {
    color: var(--primary);
    background: var(--primary-soft);
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.login-field {
    display: block;
    margin: 0;
}

.login-label {
    display: block;
    margin-bottom: 7px;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-2);
}

.login-input {
    position: relative;
    display: flex;
    align-items: center;
}

.login-input > svg {
    position: absolute;
    left: 14px;
    width: 19px;
    height: 19px;
    fill: none;
    stroke: var(--muted);
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
    pointer-events: none;
}

.login-input input {
    width: 100%;
    height: 50px;
    padding: 0 46px;
    font-family: inherit;
    font-size: 15px;
    color: var(--text);
    text-align: left;
    background: var(--card-2);
    border: 1.5px solid var(--border);
    border-radius: 14px;
    outline: none;
    transition: border-color .2s, box-shadow .2s, background .2s;
}

.login-input input::placeholder {
    color: var(--muted);
    opacity: .7;
}

.login-input input:focus {
    background: var(--card);
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-soft);
}

.login-input:focus-within > svg {
    stroke: var(--primary);
}

.login-eye {
    position: absolute;
    right: 6px;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    padding: 0;
    background: none;
    border: 0;
    border-radius: 10px;
    cursor: pointer;
}

.login-eye svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: var(--muted);
    stroke-width: 1.7;
}

.login-eye:hover svg,
.login-eye.is-on svg {
    stroke: var(--primary);
}

.login-eye.is-on::after {          /* خط روی چشم: رمز نمایش داده شده */
    content: "";
    position: absolute;
    width: 22px;
    height: 1.8px;
    background: var(--primary);
    transform: rotate(-40deg);
    border-radius: 2px;
}

.login-caps {
    margin: -8px 0 0;
    font-size: 12px;
    color: var(--warn, #ef6c00);
}

.login-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 52px;
    margin-top: 4px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, var(--primary, #1565c0), var(--primary-d, #0d47a1));
    border: 0;
    border-radius: 14px;
    box-shadow: 0 10px 22px rgba(13, 71, 161, .25);
    cursor: pointer;
    transition: transform .2s, box-shadow .2s, opacity .2s;
}

.login-submit svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform .2s;
}

.login-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(13, 71, 161, .32);
}

.login-submit:hover svg {
    transform: translateX(-3px);
}

.login-submit:focus-visible {
    outline: 3px solid var(--primary-soft);
    outline-offset: 2px;
}

.login-submit:disabled {
    opacity: .75;
    cursor: progress;
    transform: none;
}

.login-support {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    text-align: right;
    margin-top: 24px;
    padding: 12px 14px;
    background: var(--card-2);
    border: 1px dashed var(--border);
    border-radius: 14px;
}

.login-support > svg {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    padding: 8px;
    fill: none;
    stroke: var(--primary);
    stroke-width: 1.7;
    stroke-linejoin: round;
    background: var(--primary-soft);
    border-radius: 50%;
}

.login-support div {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 2px 12px;
    font-size: 13px;
}

.login-support-title {
    width: 100%;
    font-size: 12px;
    color: var(--muted);
}

.login-support a {
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
}

.login-support a:hover {
    color: var(--primary);
}

.login-support-hours {
    font-size: 12px;
    color: var(--muted);
}

.login-note {
    margin: 12px 0 0;
    font-size: 12px;
    text-align: center;
    color: var(--muted);
}

.login-copy {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    max-width: 380px;
    padding-top: 14px;
    font-size: 11.5px;
    line-height: 1.8;
    text-align: center;
    color: var(--muted);
    border-top: 1px solid var(--border);
}

.login-copy b {
    font-size: 13px;
    font-weight: 800;
    color: var(--primary);
}

@keyframes login-rise {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    .login-box, .login-visual-text { animation: none; }
}

/* ── تم تیره ───────────────────────────────────────────────────────── */

body.dark .login-visual {
    background-color: #10161c;
    background-image: url("../image/plant-bg-dark.webp");
}

body.dark .login-visual::before {
    background: linear-gradient(180deg,
        rgba(8, 24, 52, .9) 0%, rgba(13, 50, 110, .6) 38%, rgba(16, 22, 28, .2) 62%, rgba(16, 22, 28, 0) 80%);
}

body.dark .login-logo {
    background: rgba(255, 255, 255, .9);
}

body.dark .login-panel {
    box-shadow: none;
}

/* ── تبلت ──────────────────────────────────────────────────────────── */

@media (max-width: 1024px) {
    .login-shell {
        grid-template-columns: minmax(0, 1fr) minmax(380px, 1fr);
    }

    .login-visual {
        padding: 40px 28px;
    }
}

/* ── موبایل: تصویر بالا با لوگوها و عنوان، کارت فرم رویش ───────────── */

@media (max-width: 760px) {
    .login-shell {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
    }

    .login-visual {
        min-height: 290px;
        padding: 30px 20px 76px;
        background-size: 230% auto;
        background-position: 38% bottom;
    }

    .login-visual::before {
        background: linear-gradient(180deg,
            rgba(13, 71, 161, .9) 0%, rgba(21, 101, 192, .68) 50%, rgba(21, 101, 192, .18) 85%, rgba(255, 255, 255, 0) 100%);
    }

    .login-visual-text {
        margin-bottom: 0;
    }

    .login-logos {
        gap: 12px;
        margin-bottom: 16px;
    }

    .login-logo {
        width: 62px;
        height: 62px;
        padding: 8px;
        border-radius: 18px;
    }

    .login-visual-text h2 {
        font-size: 22px;
    }

    .login-title-en {
        letter-spacing: .14em;
    }

    .login-panel {
        position: relative;
        justify-content: flex-start;
        margin-top: -48px;
        padding: 28px 20px calc(18px + env(safe-area-inset-bottom));
        border-radius: 26px 26px 0 0;
        box-shadow: 0 -12px 30px rgba(13, 71, 161, .14);
    }

    .login-box {
        max-width: 440px;
    }

    .login-title {
        font-size: 19px;
    }

    .login-copy {
        margin-top: auto;
    }

    body.dark .login-panel {
        box-shadow: 0 -12px 30px rgba(0, 0, 0, .4);
    }
}

/* «DADMAN · LASTING DATA» زیر عنوان روی تصویر */
.login-brand-en {
    margin-top: 6px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .3em;
    color: rgba(255, 255, 255, .72);
}
