/* ==========================================================================
   Halaman Login JIBAS - responsive (mobile first)
   Warna modul diatur lewat class di <body>: lg-akademik | lg-keuangan | lg-kepegawaian
   ========================================================================== */

:root
{
    --lg-accent: #1565d8;
    --lg-accent-dark: #0f4fb0;
    --lg-accent-soft: #e8f0fc;
    --lg-ink: #1b2430;
    --lg-muted: #5b6675;
    --lg-line: #cfd6df;
    --lg-danger: #b3261e;
    --lg-danger-bg: #fdecea;
}

body.lg-akademik    { --lg-accent: #1565d8; --lg-accent-dark: #0f4fb0; --lg-accent-soft: #e8f0fc; }
body.lg-keuangan    { --lg-accent: #0f7b53; --lg-accent-dark: #0a5c3e; --lg-accent-soft: #e5f5ee; }
body.lg-infoguru    { --lg-accent: #1d7a52; --lg-accent-dark: #14573a; --lg-accent-soft: #e5f5ee; }
body.lg-kepegawaian { --lg-accent: #c2410c; --lg-accent-dark: #9a3309; --lg-accent-soft: #fdeee6; }

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body.lg-body
{
    position: relative;
    isolation: isolate;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    min-height: 100dvh;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.45;
    color: var(--lg-ink);
    background: #14263f;
}

/* Latar belakang: pseudo-element fixed supaya halus di iOS/Android */
body.lg-body::before
{
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        linear-gradient(160deg, rgba(8, 22, 46, .55), rgba(8, 22, 46, .82)),
        url("../images/background15.jpg") center / cover no-repeat,
        #14263f;
}

.lg-wrap
{
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 24px 16px;
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
    padding-bottom: max(24px, env(safe-area-inset-bottom));
}

/* ---------- Kartu ---------- */
.lg-card
{
    width: 100%;
    max-width: 440px;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 18px 50px rgba(0, 0, 0, .35);
}

/* Panel merek (logo + judul) */
.lg-brand
{
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 16px;
    padding: 18px 22px;
    color: #fff;
    background: linear-gradient(135deg, var(--lg-accent), var(--lg-accent-dark));
}

.lg-logo
{
    display: block;
    flex: 0 0 auto;
    width: auto;
    height: auto;
    max-width: 72px;
    max-height: 76px;
    object-fit: contain;
}

.lg-icon
{
    display: block;
    flex: 0 0 auto;
    width: 56px;
    height: 56px;
    padding: 12px;
    color: #fff;
    background: rgba(255, 255, 255, .18);
    border-radius: 16px;
}

.lg-brand-text { min-width: 0; }

.lg-brand-sub
{
    display: block;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .14em;
    text-transform: uppercase;
    opacity: .9;
}

.lg-brand-title
{
    margin: 2px 0 0;
    font-size: 26px;
    line-height: 1.15;
    font-weight: 700;
    letter-spacing: .02em;
    text-transform: uppercase;
    overflow-wrap: anywhere;
}

/* ---------- Form ---------- */
.lg-main { padding: 24px 22px 22px; }

.lg-hello
{
    margin: 0 0 18px;
    font-size: 15px;
    color: var(--lg-muted);
}

.lg-field { margin-bottom: 16px; }

.lg-label
{
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 600;
    color: var(--lg-ink);
}

.lg-input
{
    display: block;
    width: 100%;
    height: 50px;
    margin: 0;
    padding: 0 14px;
    font: inherit;
    font-size: 16px; /* 16px mencegah iOS memperbesar layar saat fokus */
    color: var(--lg-ink);
    background: #fff;
    border: 1.5px solid var(--lg-line);
    border-radius: 10px;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    transition: border-color .15s, box-shadow .15s;
}

.lg-input::placeholder { color: #8d97a5; }

.lg-input:hover { border-color: #aab3bf; }

.lg-input:focus
{
    border-color: var(--lg-accent);
    box-shadow: 0 0 0 4px var(--lg-accent-soft);
}

.lg-input[aria-invalid="true"] { border-color: var(--lg-danger); }

.lg-pass { position: relative; }
.lg-pass .lg-input { padding-right: 52px; }

.lg-eye
{
    position: absolute;
    top: 50%;
    right: 4px;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin: 0;
    padding: 0;
    color: var(--lg-muted);
    background: transparent;
    border: 0;
    border-radius: 8px;
    cursor: pointer;
}

.lg-eye:hover { color: var(--lg-ink); }
.lg-eye:focus-visible { outline: 2px solid var(--lg-accent); outline-offset: -2px; }
.lg-eye svg { width: 22px; height: 22px; display: block; }
.lg-eye .lg-eye-off { display: none; }
.lg-eye[aria-pressed="true"] .lg-eye-on { display: none; }
.lg-eye[aria-pressed="true"] .lg-eye-off { display: block; }

/* Pesan kesalahan */
.lg-error
{
    margin: 0 0 16px;
    padding: 11px 14px;
    font-size: 14px;
    color: var(--lg-danger);
    background: var(--lg-danger-bg);
    border-left: 4px solid var(--lg-danger);
    border-radius: 8px;
}

.lg-error[hidden] { display: none; }

/* Tombol */
.lg-btn
{
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    height: 50px;
    margin: 4px 0 0;
    padding: 0 18px;
    font: inherit;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: .02em;
    color: #fff;
    background: var(--lg-accent);
    border: 0;
    border-radius: 10px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background-color .15s, transform .05s;
}

.lg-btn:hover { background: var(--lg-accent-dark); }
.lg-btn:active { transform: translateY(1px); }
.lg-btn:focus-visible { outline: 3px solid var(--lg-accent-soft); outline-offset: 2px; box-shadow: 0 0 0 2px var(--lg-accent); }
.lg-btn[disabled] { opacity: .75; cursor: wait; }

.lg-btn .lg-spin
{
    display: none;
    width: 18px;
    height: 18px;
    border: 2.5px solid rgba(255, 255, 255, .45);
    border-top-color: #fff;
    border-radius: 50%;
    animation: lg-rotate .7s linear infinite;
}

.lg-btn.is-loading .lg-spin { display: inline-block; }

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

/* Tautan kembali */
.lg-back
{
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 44px;
    margin-top: 12px;
    font-size: 15px;
    font-weight: 600;
    color: var(--lg-accent);
    text-decoration: none;
    border-radius: 8px;
}

.lg-back:hover { text-decoration: underline; }
.lg-back:focus-visible { outline: 2px solid var(--lg-accent); outline-offset: 2px; }

/* ---------- Footer & mitra ---------- */
.lg-partners,
.lg-footer-extra
{
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px 18px;
    width: 100%;
    max-width: 440px;
    color: #fff;
    font-size: 12px;
    text-align: center;
}

.lg-partners:empty, .lg-footer-extra:empty { display: none; }

.lg-partners > div, .lg-footer-extra > div,
#Partner, #Footer
{
    position: static !important;
    max-width: 100%;
}

.lg-partners img, .lg-footer-extra img { max-width: 100%; height: auto; }
.lg-partners a, .lg-footer-extra a { color: #fff; }

.divVersionInfo
{
    max-width: 440px;
    margin: 0;
    padding: 6px 14px;
    font-size: 12px;
    line-height: 1.5;
    text-align: center;
    color: rgba(255, 255, 255, .92);
    background: rgba(0, 0, 0, .38);
    border-radius: 999px;
    overflow-wrap: anywhere;
}

.divVersionInfo span { display: inline-block; margin: 0 6px; }

/* ---------- Layar >= 720px : dua kolom ---------- */
@media (min-width: 720px)
{
    .lg-card
    {
        max-width: 780px;
        flex-direction: row;
        min-height: 380px;
    }

    .lg-brand
    {
        flex: 0 0 290px;
        flex-direction: column;
        justify-content: center;
        gap: 22px;
        padding: 36px 28px;
        text-align: center;
    }

    .lg-logo { max-width: 150px; max-height: 210px; }
    .lg-icon { width: 96px; height: 96px; padding: 20px; border-radius: 24px; }

    .lg-brand-sub { font-size: 13px; }
    .lg-brand-title { font-size: 30px; }

    .lg-main
    {
        flex: 1 1 auto;
        display: flex;
        flex-direction: column;
        justify-content: center;
        padding: 40px 44px;
    }

    .lg-partners, .lg-footer-extra, .divVersionInfo { max-width: 780px; }
}

/* ---------- Layar sangat kecil ---------- */
@media (max-width: 359px)
{
    .lg-wrap { padding: 12px 10px; }
    .lg-brand { padding: 14px 16px; gap: 12px; }
    .lg-brand-title { font-size: 22px; }
    .lg-main { padding: 20px 16px 18px; }
}

/* ---------- Layar pendek (HP landscape) ---------- */
@media (max-height: 480px) and (orientation: landscape)
{
    .lg-wrap { justify-content: flex-start; padding-top: 12px; }
    .lg-hello { display: none; }
}

@media (prefers-reduced-motion: reduce)
{
    .lg-btn .lg-spin { animation-duration: 2s; }
    .lg-input, .lg-btn { transition: none; }
}
