:root {
    --navy: #0b1437;
    --navy-2: #111c4e;
    --blue: #3b82f6;
    --violet: #8b5cf6;
    --cyan: #22d3ee;
    --text: #e8ecff;
    --muted: #a5b0d6;
    /* Ukuran vertikal mengikuti tinggi layar agar selalu pas 1 layar */
    --vpad: clamp(18px, 5vh, 48px);
    --field-h: clamp(42px, 6.4vh, 54px);
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
    margin: 0;
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
    background: radial-gradient(1200px 800px at 10% 10%, #1b2a6b 0%, transparent 60%),
                radial-gradient(1000px 700px at 90% 90%, #2a1458 0%, transparent 55%),
                var(--navy);
    color: var(--text);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ===== Background animasi ===== */
.bg-orbs { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.orb { position: absolute; border-radius: 50%; filter: blur(80px); opacity: .55; animation: float 18s ease-in-out infinite; }
.o1 { width: 420px; height: 420px; background: var(--blue); top: -120px; left: -100px; }
.o2 { width: 380px; height: 380px; background: var(--violet); bottom: -120px; right: -80px; animation-delay: -6s; }
.o3 { width: 260px; height: 260px; background: var(--cyan); top: 45%; left: 45%; opacity: .25; animation-delay: -12s; }
@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(60px, -40px) scale(1.08); }
    66% { transform: translate(-40px, 50px) scale(.95); }
}
.grid-overlay {
    position: absolute; inset: 0;
    background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
                      linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
    background-size: 44px 44px;
    -webkit-mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
    mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
}

/* ===== Layout: tepat 1 layar ===== */
.login-shell {
    position: relative; z-index: 1;
    height: 100vh; height: 100dvh; min-height: 520px;
    display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    overflow: hidden;
}
.brand-panel {
    min-height: 0; overflow: hidden;
    padding: var(--vpad) clamp(28px, 4.2vw, 64px);
    display: flex; flex-direction: column; justify-content: space-between; gap: clamp(14px, 3vh, 32px);
}
.brand-top { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }
.brand-logo { width: clamp(40px, 6.4vh, 52px); height: clamp(40px, 6.4vh, 52px); filter: drop-shadow(0 8px 24px rgba(59,130,246,.5)); }
.brand-name { font-weight: 800; font-size: clamp(1.1rem, 2.6vh, 1.35rem); letter-spacing: .3px; line-height: 1.2; }
.brand-school { color: var(--muted); font-size: clamp(.8rem, 1.8vh, .9rem); }

.brand-hero { max-width: 580px; }
.chip {
    display: inline-flex; gap: 8px; align-items: center; padding: clamp(5px, .9vh, 7px) 14px; border-radius: 999px;
    background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.12); font-size: clamp(.74rem, 1.7vh, .82rem); color: #cbd5ff;
    -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.brand-hero h1 {
    font-size: clamp(1.55rem, min(3.1vw, 5.6vh), 3rem); font-weight: 800; line-height: 1.15; letter-spacing: -.5px;
    margin: clamp(10px, 2.2vh, 20px) 0 clamp(8px, 1.6vh, 14px);
}
.grad { background: linear-gradient(90deg, #60a5fa, #a78bfa 50%, #22d3ee); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand-hero p { color: var(--muted); font-size: clamp(.86rem, min(1.2vw, 2.1vh), 1.04rem); line-height: 1.65; margin: 0; }

.feature-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(10px, 1.4vw, 14px); max-width: 660px; flex-shrink: 0; }
.feature {
    display: flex; gap: 12px; align-items: flex-start; padding: clamp(10px, 1.8vh, 16px); border-radius: 16px; min-width: 0;
    background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.08);
    -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
    transition: transform .25s, background .25s;
}
.feature:hover { transform: translateY(-4px); background: rgba(255,255,255,.08); }
.feature i { font-size: 1.2rem; line-height: 1; color: #93c5fd; background: rgba(59,130,246,.15); padding: 8px 9px; border-radius: 10px; flex-shrink: 0; }
.feature b { display: block; font-size: .86rem; line-height: 1.3; }
.feature span { display: block; color: var(--muted); font-size: .75rem; line-height: 1.45; margin-top: 3px; }

.form-panel {
    position: relative; min-height: 0; overflow-y: auto;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: var(--vpad) clamp(16px, 3vw, 40px) calc(var(--vpad) + 18px);
    scrollbar-width: thin;
}
.glass-card {
    width: 100%; max-width: 430px; flex-shrink: 0;
    padding: clamp(20px, 4.6vh, 40px) clamp(22px, 2.6vw, 36px); border-radius: clamp(20px, 3vh, 28px);
    background: linear-gradient(160deg, rgba(255,255,255,.12), rgba(255,255,255,.04));
    border: 1px solid rgba(255,255,255,.16);
    box-shadow: 0 30px 80px rgba(2,6,23,.55), inset 0 1px 0 rgba(255,255,255,.15);
    -webkit-backdrop-filter: blur(22px); backdrop-filter: blur(22px);
    animation: rise .7s cubic-bezier(.2,.8,.2,1) both;
}
@keyframes rise { from { opacity: 0; transform: translateY(24px) scale(.98); } to { opacity: 1; transform: none; } }

.mobile-brand { display: none; align-items: center; gap: 12px; margin-bottom: 22px; }
.mobile-brand img { width: 44px; height: 44px; }
.mobile-brand b { display: block; font-size: 1.1rem; }
.mobile-brand small { color: var(--muted); }

.glass-card h2 { font-weight: 800; font-size: clamp(1.3rem, 3.6vh, 1.7rem); line-height: 1.2; margin: 0 0 6px; }
.lead-sub { color: var(--muted); margin: 0 0 clamp(12px, 3vh, 26px); font-size: clamp(.84rem, 1.9vh, .95rem); line-height: 1.5; }

.field { margin-bottom: clamp(10px, 2.1vh, 18px); }
.field label { font-size: .82rem; font-weight: 600; color: #cfd8ff; margin-bottom: clamp(4px, 1vh, 8px); display: block; }
.input-wrap { position: relative; }
.input-wrap > i { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: #8ea0d8; font-size: 1.05rem; line-height: 1; transition: color .2s; }
.input-wrap input {
    display: block; width: 100%; height: var(--field-h); padding: 0 48px; border-radius: 14px; font: inherit; font-size: .98rem; color: #fff;
    background: rgba(8,14,44,.55); border: 1.5px solid rgba(255,255,255,.12); outline: none; transition: all .2s;
}
.input-wrap input::placeholder { color: #6f7db0; }
.input-wrap input:focus { border-color: #60a5fa; background: rgba(8,14,44,.75); box-shadow: 0 0 0 4px rgba(59,130,246,.2); }
.input-wrap:focus-within > i { color: #93c5fd; }
.toggle-pass { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: #8ea0d8; padding: 8px 10px; border-radius: 10px; line-height: 1; }
.toggle-pass:hover { color: #fff; background: rgba(255,255,255,.08); }
.caps-warn { display: none; font-size: .78rem; color: #fbbf24; margin-top: 6px; }
.caps-warn.show { display: block; }

.btn-login {
    width: 100%; height: var(--field-h); border: 0; border-radius: 14px; margin-top: clamp(2px, .8vh, 8px); font: inherit; font-weight: 700; font-size: 1rem; color: #fff;
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    background: linear-gradient(100deg, #2563eb, #7c3aed 60%, #2563eb); background-size: 200% 100%;
    box-shadow: 0 12px 30px rgba(79,70,229,.45); transition: background-position .5s, transform .15s, box-shadow .2s;
    cursor: pointer;
}
.btn-login:hover { background-position: 100% 0; box-shadow: 0 16px 38px rgba(79,70,229,.6); }
.btn-login:active { transform: scale(.98); }
.btn-login .bi { font-size: 1.5rem; line-height: 1; transition: transform .2s; }
.btn-login:hover .bi { transform: translateX(4px); }
.btn-login.loading { pointer-events: none; opacity: .85; }

.alert-glass {
    display: flex; gap: 10px; align-items: center; padding: 10px 14px; border-radius: 12px; margin-bottom: clamp(10px, 2vh, 18px); font-size: .86rem;
    background: rgba(239,68,68,.15); border: 1px solid rgba(239,68,68,.4); color: #fecaca; animation: shake .4s;
}
@keyframes shake { 25% { transform: translateX(-6px); } 50% { transform: translateX(6px); } 75% { transform: translateX(-3px); } }

.role-hint { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: clamp(12px, 2.8vh, 24px); }
.role-hint span { font-size: .72rem; padding: 5px 10px; border-radius: 999px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.08); color: #b8c3ea; }
.foot-note { text-align: center; color: #7f8bb8; font-size: .8rem; margin: clamp(8px, 1.8vh, 16px) 0 0; }
.copyright {
    position: absolute; left: 16px; right: 16px; bottom: clamp(8px, 2vh, 18px);
    color: #6b78a8; font-size: .74rem; text-align: center; line-height: 1.4;
}

/* ===== Layar laptop pendek: rapatkan bertahap ===== */
@media (min-width: 901px) and (max-height: 760px) {
    .feature span { display: none; }
    .feature { align-items: center; }
}
@media (min-width: 901px) and (max-height: 640px) {
    .role-hint { display: none; }
    .brand-hero p { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
}
@media (min-width: 901px) and (max-height: 560px) {
    .feature-list, .foot-note, .chip { display: none; }
}
/* Pengaman otomatis (diatur script) bila konten masih melebihi layar */
.fit-1 .feature span, .fit-1 .role-hint { display: none; }
.fit-1 .feature { align-items: center; }
.fit-2 .brand-hero p { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.fit-2 .foot-note, .fit-2 .lead-sub { display: none; }
.fit-3 .feature-list, .fit-3 .chip { display: none; }

/* ===== Lebar tablet/laptop kecil ===== */
@media (min-width: 901px) and (max-width: 1150px) {
    .feature { flex-direction: column; gap: 8px; }
    .feature span { display: none; }
}

/* ===== Ponsel & tablet tegak ===== */
@media (max-width: 900px) {
    .login-shell { grid-template-columns: 1fr; height: auto; min-height: 100vh; min-height: 100dvh; overflow: visible; }
    .brand-panel { display: none; }
    .mobile-brand { display: flex; }
    .form-panel { min-height: 100vh; min-height: 100dvh; overflow: visible; padding: 24px 16px 56px; }
    .glass-card { padding: 30px 22px; border-radius: 22px; }
    :root { --field-h: 52px; }
}