/* =====================================================================
   صفحه‌ی ورود — هم‌زبان با داشبورد و پوسته‌ی پنل
   ===================================================================== */

/* قالب اصلی برای صفحات پنل ساخته شده و روی صفحه‌ی ورود اسکرول افقی می‌سازد */
html:has(.lg-page),
body:has(.lg-page) {
    overflow: hidden !important;
    margin: 0;
    padding: 0;
}

body:has(.lg-page) .content-wrapper,
body:has(.lg-page) .content-body {
    padding: 0 !important;
    margin: 0 !important;
}

.lg-page {
    --lg-ink: #0F1A2E;
    --lg-ink-2: #3D4C66;
    --lg-ink-3: #5A6B85;
    --lg-primary: #1D4ED8;
    --lg-hairline: #E3E9F3;
    --lg-t: .18s cubic-bezier(.4, 0, .2, 1);

    color-scheme: light;

    /* تمام‌صفحه، مستقل از padding قالب اصلی */
    position: fixed;
    inset: 0;
    z-index: 10;
    display: grid;
    place-items: center;
    padding: 28px 18px;
    overflow: auto;
    background: linear-gradient(140deg, #0B1B45 0%, #12266B 42%, #1D4ED8 78%, #2F6BEA 100%);
    font-family: "primary-font", "IRANSans", "Segoe UI", Tahoma, sans-serif;
}

/* دو هاله‌ی نوری پس‌زمینه */
.lg-page::before,
.lg-page::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

.lg-page::before {
    width: 620px; height: 620px;
    inset-block-start: -240px;
    inset-inline-end: -160px;
    background: radial-gradient(closest-side, rgba(255, 255, 255, .16), transparent 70%);
}

.lg-page::after {
    width: 520px; height: 520px;
    inset-block-end: -220px;
    inset-inline-start: -140px;
    background: radial-gradient(closest-side, rgba(217, 119, 6, .30), transparent 70%);
}

/* ───────── کارت ───────── */
.lg-card {
    position: relative;
    z-index: 1;
    width: min(940px, 100%);
    display: grid;
    grid-template-columns: 1.05fr .95fr;
    border-radius: 22px;
    overflow: hidden;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 32px 70px rgba(6, 16, 40, .40), 0 2px 0 rgba(255, 255, 255, .35) inset;
    animation: lg-in .5s cubic-bezier(.2, .8, .2, 1) both;
}

@keyframes lg-in {
    from { opacity: 0; transform: translateY(18px) scale(.985); }
    to   { opacity: 1; transform: none; }
}

/* ───────── ستون فرم ───────── */
.lg-form {
    padding: 44px 44px 38px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.lg-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 26px;
}

.lg-brand__mark {
    flex: none;
    width: 46px; height: 46px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    color: #fff;
    background: linear-gradient(135deg, #3B82F6, #1D4ED8);
    box-shadow: 0 8px 20px rgba(29, 78, 216, .35);
}

.lg-brand__mark svg { width: 23px; height: 23px; }

.lg-brand__text b {
    display: block;
    font-size: 16px;
    font-weight: 800;
    color: var(--lg-ink);
    letter-spacing: -.01em;
    line-height: 1.4;
}

.lg-brand__text small { font-size: 11.5px; color: var(--lg-ink-3); }

.lg-title {
    font-size: 21px;
    font-weight: 800;
    color: var(--lg-ink);
    margin: 0 0 6px;
    letter-spacing: -.015em;
}

.lg-sub {
    font-size: 12.5px;
    color: var(--lg-ink-3);
    line-height: 1.9;
    margin: 0 0 26px;
}

/* ───────── فیلدها ───────── */
.lg-field { margin-bottom: 16px; }

.lg-field > label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: var(--lg-ink-2);
    margin-bottom: 7px;
}

.lg-input {
    position: relative;
    display: flex;
    align-items: center;
    border: 1.5px solid var(--lg-hairline);
    border-radius: 12px;
    background: #F8FAFD;
    transition: border-color var(--lg-t), box-shadow var(--lg-t), background var(--lg-t);
}

.lg-input:focus-within {
    border-color: var(--lg-primary);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(29, 78, 216, .12);
}

.lg-input__icon {
    flex: none;
    display: grid;
    place-items: center;
    width: 42px;
    color: var(--lg-ink-3);
}

.lg-input__icon svg { width: 17px; height: 17px; }

.lg-input input {
    flex: 1 1 auto;
    min-width: 0;
    border: none;
    outline: none;
    background: transparent;
    padding: 13px 2px 13px 0;
    font-size: 14px;
    font-family: inherit;
    color: var(--lg-ink);
    letter-spacing: .02em;
}

.lg-input input::placeholder { color: #9AA8BE; letter-spacing: 0; }

/* شماره‌ها و رمز همیشه چپ‌چین بمانند */
.lg-input input[type="password"],
.lg-input input[inputmode="numeric"] {
    direction: ltr;
    text-align: start;
    unicode-bidi: isolate;
}

/* دکمه‌ی نمایش رمز */
.lg-eye {
    flex: none;
    width: 42px;
    height: 100%;
    border: none;
    background: transparent;
    color: var(--lg-ink-3);
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: color var(--lg-t);
}

.lg-eye:hover { color: var(--lg-primary); }
.lg-eye svg { width: 17px; height: 17px; }

/* ───────── دکمه‌ی ورود ───────── */
.lg-submit {
    width: 100%;
    margin-top: 8px;
    padding: 13px 18px;
    border: none;
    border-radius: 12px;
    font-family: inherit;
    font-size: 14.5px;
    font-weight: 700;
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    background: linear-gradient(135deg, #2F6BEA, #1D4ED8 55%, #0F2A6B);
    box-shadow: 0 10px 24px rgba(29, 78, 216, .32);
    transition: transform var(--lg-t), box-shadow var(--lg-t), filter var(--lg-t);
}

.lg-submit:hover { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(29, 78, 216, .40); }
.lg-submit:active { transform: translateY(0); }
.lg-submit:focus-visible { outline: 3px solid rgba(29, 78, 216, .35); outline-offset: 2px; }
.lg-submit[disabled] { filter: grayscale(.35) brightness(.95); cursor: progress; transform: none; }
.lg-submit svg { width: 17px; height: 17px; }

/* اسپینر حالت در حال ارسال */
.lg-spin {
    width: 15px; height: 15px;
    border: 2px solid rgba(255, 255, 255, .35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: lg-rot .7s linear infinite;
}

@keyframes lg-rot { to { transform: rotate(360deg); } }

/* ───────── پیام خطا ───────── */
.lg-alert {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    padding: 11px 13px;
    margin-bottom: 18px;
    border-radius: 11px;
    background: #FBEAEA;
    border: 1px solid #E9B4B4;
    color: #8C1D18;
    font-size: 12.5px;
    line-height: 1.8;
}

.lg-alert svg { flex: none; width: 16px; height: 16px; margin-top: 3px; }

.lg-foot {
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid var(--lg-hairline);
    font-size: 11.5px;
    color: var(--lg-ink-3);
    text-align: center;
    line-height: 1.9;
}

/* ───────── ستون تصویر ───────── */
.lg-side {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 22px;
    padding: 44px 38px;
    color: #fff;
    background: linear-gradient(160deg, #0B1B45 0%, #14297A 60%, #1D4ED8 100%);
    overflow: hidden;
}

.lg-side::after {
    content: "";
    position: absolute;
    inset-block-start: -30%;
    inset-inline-start: -20%;
    width: 70%; height: 70%;
    border-radius: 50%;
    background: radial-gradient(closest-side, rgba(255, 255, 255, .14), transparent 70%);
}

.lg-side > * { position: relative; }

.lg-side img { width: min(230px, 78%); margin: 0 auto; opacity: .95; }

.lg-side h2 {
    font-size: 16.5px;
    font-weight: 800;
    margin: 0;
    text-align: center;
    line-height: 1.85;
    color: #fff;
}

.lg-feats { display: grid; gap: 11px; margin: 0; padding: 0; list-style: none; }

.lg-feats li {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12.5px;
    color: rgba(255, 255, 255, .88);
}

.lg-feats i {
    flex: none;
    width: 22px; height: 22px;
    border-radius: 7px;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, .14);
    border: 1px solid rgba(255, 255, 255, .2);
    font-size: 10px;
    font-style: normal;
}

/* ───────── واکنش‌گرا ───────── */
@media (max-width: 860px) {
    .lg-card { grid-template-columns: 1fr; }
    .lg-side { order: -1; padding: 26px 24px; gap: 14px; }
    .lg-side img { width: 130px; }
    .lg-feats { display: none; }
    .lg-form { padding: 30px 26px 26px; }
}

@media (prefers-reduced-motion: reduce) {
    .lg-card, .lg-submit, .lg-input { animation: none !important; transition: none !important; }
}
