/* ==========================================================
   Ultima Finance — Halaman Login
   ========================================================== */
:root {
    --navy-900: #050b2c;
    --navy-800: #0a1446;
    --text: #ffffff;
    --text-soft: rgba(225, 231, 255, 0.82);
    --text-muted: rgba(200, 210, 245, 0.6);
    --line: rgba(160, 180, 255, 0.28);
    --line-focus: rgba(140, 160, 255, 0.85);
    --accent: #8b6cff;
    --accent-soft: #b9a6ff;
    --grad-btn: linear-gradient(90deg, #3d63ff 0%, #6a4bf5 55%, #8a3ff0 100%);
    --radius-card: 22px;
    --radius-field: 11px;
}

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

html, body {
    margin: 0;
    min-height: 100%;
    background: var(--navy-900);
    color: var(--text);
    font-family: 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
}

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

/* ---------- Latar ---------- */
.login-page {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 40px clamp(24px, 6vw, 110px);
    background: var(--navy-900) var(--bg) left center / cover no-repeat;
}

/* ---------- Kartu ---------- */
.login-card {
    position: relative;
    width: 100%;
    max-width: 400px;
    padding: 34px 34px 24px;
    border-radius: var(--radius-card);
    background:
        linear-gradient(160deg, rgba(70, 90, 200, 0.28) 0%, rgba(20, 28, 90, 0.42) 45%, rgba(40, 20, 110, 0.38) 100%);
    border: 1px solid rgba(150, 170, 255, 0.35);
    box-shadow:
        0 30px 80px rgba(2, 6, 30, 0.55),
        inset 0 1px 0 rgba(255, 255, 255, 0.12),
        0 0 0 1px rgba(120, 100, 255, 0.08);
    backdrop-filter: blur(18px) saturate(140%);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
    animation: card-in .6s cubic-bezier(.2, .8, .2, 1) both;
}

@keyframes card-in {
    from { opacity: 0; transform: translateY(16px) scale(.98); }
    to   { opacity: 1; transform: none; }
}

/* ---------- Brand ---------- */
.brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 20px;
}
.brand-logo {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    box-shadow: 0 0 28px rgba(60, 120, 255, 0.55);
}
.brand-text { display: flex; flex-direction: column; line-height: 1; }
.brand-name {
    font-size: 27px;
    font-weight: 700;
    letter-spacing: .5px;
}
.brand-sub {
    margin-top: 4px;
    font-size: 18px;
    font-weight: 400;
    letter-spacing: 4px;
    color: var(--text-soft);
}

/* ---------- Judul ---------- */
.login-card h1 {
    margin: 0 0 6px;
    text-align: center;
    font-size: 21px;
    font-weight: 600;
    letter-spacing: -.2px;
}
.lead {
    margin: 0 auto 22px;
    max-width: 320px;
    text-align: center;
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-soft);
}

/* ---------- Alert ---------- */
.alert {
    margin: -6px 0 16px;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.5;
}
.alert-error {
    background: rgba(255, 82, 110, 0.14);
    border: 1px solid rgba(255, 110, 135, 0.45);
    color: #ffd3dc;
}
.alert-info {
    background: rgba(90, 150, 255, 0.14);
    border: 1px solid rgba(120, 170, 255, 0.45);
    color: #d6e6ff;
}

/* ---------- Field ---------- */
.field {
    position: relative;
    display: block;
    margin-bottom: 14px;
}
.field input {
    width: 100%;
    height: 46px;
    padding: 0 46px 0 44px;
    border-radius: var(--radius-field);
    border: 1px solid var(--line);
    background: rgba(10, 18, 70, 0.35);
    color: var(--text);
    font: inherit;
    font-size: 14px;
    outline: none;
    transition: border-color .2s, box-shadow .2s, background .2s;
}
.field input::placeholder { color: var(--text-soft); }
.field input:focus {
    border-color: var(--line-focus);
    background: rgba(14, 24, 90, 0.5);
    box-shadow: 0 0 0 4px rgba(110, 120, 255, 0.18);
}
.field input:-webkit-autofill {
    -webkit-text-fill-color: var(--text);
    -webkit-box-shadow: 0 0 0 100px #121c5a inset;
    caret-color: var(--text);
}

.field svg,
.btn-login svg,
.check svg {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.field-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    width: 18px;
    height: 18px;
    transform: translateY(-50%);
    color: var(--text-soft);
    pointer-events: none;
}

.toggle-pass {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--text-soft);
    cursor: pointer;
    transition: color .2s, background .2s;
}
.toggle-pass:hover { color: #fff; background: rgba(255, 255, 255, 0.06); }
.toggle-pass:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.toggle-pass svg { width: 19px; height: 19px; }
.toggle-pass .eye-closed { display: none; }
.toggle-pass[aria-pressed="true"] .eye-open { display: none; }
.toggle-pass[aria-pressed="true"] .eye-closed { display: block; }

/* ---------- Ingat saya / lupa ---------- */
.form-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 2px 0 20px;
}
.remember {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-size: 13px;
    cursor: pointer;
    user-select: none;
}
.remember input { position: absolute; opacity: 0; width: 0; height: 0; }
.check {
    width: 19px;
    height: 19px;
    display: grid;
    place-items: center;
    border-radius: 5px;
    border: 1.5px solid var(--line);
    background: rgba(10, 18, 70, 0.35);
    transition: background .2s, border-color .2s;
}
.check svg { width: 12px; height: 12px; stroke-width: 2.6; color: #fff; opacity: 0; transition: opacity .15s; }
.remember input:checked + .check {
    background: linear-gradient(135deg, #7d5cff, #a35cf5);
    border-color: transparent;
}
.remember input:checked + .check svg { opacity: 1; }
.remember input:focus-visible + .check { outline: 2px solid var(--accent); outline-offset: 2px; }

.forgot {
    color: var(--accent-soft);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
}
.forgot:hover { color: #fff; text-decoration: underline; }

/* ---------- Tombol ---------- */
.btn-login {
    width: 100%;
    height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 1px solid rgba(190, 170, 255, 0.45);
    border-radius: var(--radius-field);
    background: var(--grad-btn);
    color: #fff;
    font: inherit;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: .3px;
    cursor: pointer;
    box-shadow: 0 12px 30px rgba(100, 70, 255, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.25);
    transition: transform .15s, box-shadow .2s, filter .2s;
}
.btn-login svg { width: 20px; height: 20px; stroke-width: 1.9; }
.btn-login:hover { filter: brightness(1.1); box-shadow: 0 16px 36px rgba(100, 70, 255, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.25); }
.btn-login:active { transform: translateY(1px); }
.btn-login:focus-visible { outline: 3px solid rgba(185, 166, 255, 0.7); outline-offset: 3px; }
.btn-login.is-loading { cursor: progress; filter: saturate(.7) brightness(.95); }

.copyright {
    margin: 18px 0 0;
    text-align: center;
    font-size: 11px;
    color: var(--text-muted);
}

/* ---------- Responsif ---------- */
@media (max-width: 1100px) {
    .login-page { padding-right: 40px; }
    .login-card { max-width: 380px; padding: 30px 28px 22px; }
}

/* Layar sempit: kartu di tengah, latar digelapkan agar teks gambar tidak bertabrakan */
@media (max-width: 900px) {
    .login-page {
        justify-content: center;
        padding: 32px 20px;
        background:
            linear-gradient(rgba(5, 11, 44, 0.72), rgba(5, 11, 44, 0.82)),
            var(--bg) 20% center / cover no-repeat,
            var(--navy-900);
    }
}

@media (max-width: 480px) {
    .login-card { padding: 26px 20px 20px; border-radius: 18px; }
    .brand-logo { width: 46px; height: 46px; }
    .brand-name { font-size: 23px; }
    .brand-sub  { font-size: 15px; letter-spacing: 3px; }
    .login-card h1 { font-size: 19px; }
    .lead { font-size: 12.5px; margin-bottom: 18px; }
}

@media (prefers-reduced-motion: reduce) {
    .login-card { animation: none; }
    * { transition: none !important; }
}
