/* ============================================================
   SIAKAD — Login (modern redesign)
   ============================================================ */

:root{
    --brand-1:#1d4ed8;      /* primary blue   */
    --brand-2:#0ea5e9;      /* sky            */
    --brand-3:#7c3aed;      /* violet accent  */
    --ink:#0f172a;          /* slate-900      */
    --muted:#64748b;        /* slate-500      */
    --line:#e2e8f0;         /* slate-200      */
    --bg:#f1f5f9;           /* slate-100      */
    --card:#ffffff;
    --radius:16px;
    --shadow:0 24px 60px -20px rgba(15,23,42,.25);
    --field-focus:rgba(29,78,216,.15);
}

*{box-sizing:border-box;margin:0;padding:0}

html,body{height:100%}

body{
    font-family:'Plus Jakarta Sans',-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif;
    color:var(--ink);
    background:var(--bg);
    -webkit-font-smoothing:antialiased;
}

/* ---------- Layout ---------- */
.wrapper{
    min-height:100vh;
    display:grid;
    grid-template-columns:1.05fr 1fr;
}

/* ---------- Brand panel ---------- */
.brand-panel{
    position:relative;
    overflow:hidden;
    display:flex;
    flex-direction:column;
    justify-content:center;
    padding:64px 72px;
    color:#fff;
    background:linear-gradient(135deg,var(--brand-1) 0%,var(--brand-2) 55%,var(--brand-3) 130%);
}
.brand-panel::after{
    content:"";
    position:absolute;inset:0;
    background:radial-gradient(circle at 80% 20%,rgba(255,255,255,.18),transparent 45%);
    pointer-events:none;
}
.brand-content{position:relative;z-index:2;max-width:440px}
.brand-logo{
    width:64px;height:64px;object-fit:contain;
    padding:12px;border-radius:16px;
    background:rgba(255,255,255,.15);
    backdrop-filter:blur(6px);
    margin-bottom:28px;
}
.brand-title{
    font-size:38px;line-height:1.15;font-weight:800;
    letter-spacing:-.5px;margin-bottom:18px;
}
.brand-sub{font-size:16px;line-height:1.6;color:rgba(255,255,255,.85)}
.brand-foot{
    position:relative;z-index:2;
    margin-top:auto;padding-top:40px;
    font-size:13px;color:rgba(255,255,255,.7);
}

/* ---------- Floating bubbles ---------- */
.bg-bubbles{position:absolute;inset:0;z-index:1;list-style:none;overflow:hidden}
.bg-bubbles li{
    position:absolute;display:block;bottom:-160px;
    width:40px;height:40px;
    background:rgba(255,255,255,.12);
    border-radius:12px;
    animation:rise 22s infinite;
}
.bg-bubbles li:nth-child(1){left:8%}
.bg-bubbles li:nth-child(2){left:22%;width:80px;height:80px;animation-delay:2s;animation-duration:17s}
.bg-bubbles li:nth-child(3){left:33%;animation-delay:4s}
.bg-bubbles li:nth-child(4){left:44%;width:60px;height:60px;animation-duration:18s;border-radius:50%}
.bg-bubbles li:nth-child(5){left:55%;animation-delay:.5s}
.bg-bubbles li:nth-child(6){left:66%;width:110px;height:110px;animation-delay:3s}
.bg-bubbles li:nth-child(7){left:75%;width:140px;height:140px;animation-delay:7s;border-radius:32px}
.bg-bubbles li:nth-child(8){left:82%;width:24px;height:24px;animation-delay:15s;animation-duration:30s}
.bg-bubbles li:nth-child(9){left:90%;width:18px;height:18px;animation-delay:2s;animation-duration:28s;border-radius:50%}
.bg-bubbles li:nth-child(10){left:96%;width:140px;height:140px;animation-delay:11s}

@keyframes rise{
    0%{transform:translateY(0) rotate(0);opacity:0}
    10%{opacity:1}
    100%{transform:translateY(-105vh) rotate(720deg);opacity:0}
}

/* ---------- Login panel ---------- */
.login-panel{
    display:flex;align-items:center;justify-content:center;
    padding:48px 32px;
}
.card{
    width:100%;max-width:420px;
    background:var(--card);
    border:1px solid var(--line);
    border-radius:var(--radius);
    box-shadow:var(--shadow);
    padding:44px 40px;
    animation:cardIn .6s cubic-bezier(.16,1,.3,1) both;
}
@keyframes cardIn{from{opacity:0;transform:translateY(18px)}to{opacity:1;transform:none}}

.card-head{text-align:center;margin-bottom:30px}
.card-logo{width:56px;height:56px;object-fit:contain;margin-bottom:14px}
#msg_login{font-size:22px;font-weight:700;letter-spacing:-.3px;line-height:1.3}
.card-sub{margin-top:6px;font-size:14px;color:var(--muted)}

/* ---------- Form ---------- */
.form{display:flex;flex-direction:column;gap:18px}
.field{display:flex;flex-direction:column;gap:7px}
.field-label{font-size:13px;font-weight:600;color:var(--ink)}

.field-control{
    position:relative;display:flex;align-items:center;
    background:#f8fafc;
    border:1.5px solid var(--line);
    border-radius:11px;
    transition:border-color .18s,box-shadow .18s,background .18s;
}
.field-control:focus-within{
    border-color:var(--brand-1);
    background:#fff;
    box-shadow:0 0 0 4px var(--field-focus);
}
.field-control .ico{
    width:20px;height:20px;flex:none;
    margin-left:14px;fill:var(--muted);
}
.field-control input,
.field-control select{
    flex:1;width:100%;border:0;outline:0;background:transparent;
    font:inherit;font-size:15px;color:var(--ink);
    padding:13px 14px;
}
.field-control input::placeholder{color:#94a3b8}

/* ---------- Custom select (tahun akademik) ---------- */
.cselect{position:relative;width:100%}
.cselect-native{display:none}

.cselect-trigger{
    display:flex;align-items:center;gap:0;
    width:100%;cursor:pointer;
    background:#f8fafc;
    border:1.5px solid var(--line);
    border-radius:11px;
    font:inherit;font-size:15px;font-weight:500;color:var(--ink);
    padding:0;
    transition:border-color .18s,box-shadow .18s,background .18s;
}
.cselect-trigger .ico{
    width:20px;height:20px;flex:none;margin-left:14px;fill:var(--muted);
}
.cselect-value{flex:1;text-align:left;padding:13px 14px}
.cselect-caret{
    width:20px;height:20px;flex:none;margin-right:14px;
    fill:none;stroke:var(--muted);stroke-width:2;stroke-linecap:round;stroke-linejoin:round;
    transition:transform .22s,stroke .18s;
}
.cselect.open .cselect-trigger,
.cselect-trigger:focus-visible{
    border-color:var(--brand-1);background:#fff;outline:none;
    box-shadow:0 0 0 4px var(--field-focus);
}
.cselect.open .cselect-caret{transform:rotate(180deg);stroke:var(--brand-1)}

/* dropdown panel */
.cselect-list{
    position:absolute;z-index:30;left:0;right:0;top:calc(100% + 8px);
    list-style:none;margin:0;padding:6px;
    background:#fff;
    border:1px solid var(--line);
    border-radius:13px;
    box-shadow:0 18px 40px -12px rgba(15,23,42,.28);
    max-height:240px;overflow:auto;
    opacity:0;visibility:hidden;transform:translateY(-6px) scale(.98);
    transform-origin:top center;
    transition:opacity .18s,transform .18s,visibility .18s;
}
.cselect.open .cselect-list{opacity:1;visibility:visible;transform:none}

.cselect-opt{
    display:flex;align-items:center;justify-content:space-between;gap:10px;
    padding:11px 12px;border-radius:9px;cursor:pointer;
    font-size:14.5px;font-weight:500;color:var(--ink);
    transition:background .14s,color .14s;
}
.cselect-opt:hover{background:#f1f5f9}
.cselect-opt.is-selected{background:var(--field-focus);color:var(--brand-1);font-weight:600}
.cselect-check{
    width:18px;height:18px;flex:none;opacity:0;
    fill:none;stroke:var(--brand-1);stroke-width:2.4;stroke-linecap:round;stroke-linejoin:round;
    transition:opacity .14s;
}
.cselect-opt.is-selected .cselect-check{opacity:1}

/* scrollbar halus */
.cselect-list::-webkit-scrollbar{width:8px}
.cselect-list::-webkit-scrollbar-thumb{background:#cbd5e1;border-radius:8px;border:2px solid #fff}

.toggle-pass{
    border:0;background:transparent;cursor:pointer;
    padding:0 12px;display:flex;align-items:center;
}
.toggle-pass svg{width:20px;height:20px;fill:#94a3b8;transition:fill .15s}
.toggle-pass:hover svg,.toggle-pass.on svg{fill:var(--brand-1)}

/* ---------- Submit ---------- */
#login-button{
    margin-top:6px;
    display:flex;align-items:center;justify-content:center;gap:8px;
    width:100%;padding:14px;
    border:0;border-radius:11px;cursor:pointer;
    font:inherit;font-size:15px;font-weight:700;color:#fff;
    background:linear-gradient(135deg,var(--brand-1),var(--brand-2));
    box-shadow:0 12px 24px -10px rgba(29,78,216,.7);
    transition:transform .12s,box-shadow .2s,filter .2s;
}
#login-button svg{width:20px;height:20px;fill:none;stroke:#fff;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
#login-button:hover{filter:brightness(1.05);box-shadow:0 16px 30px -10px rgba(29,78,216,.8)}
#login-button:active{transform:translateY(1px)}

/* ---------- Success state (driven by login.js) ---------- */
.wrapper.form-success .card{text-align:center}
.wrapper.form-success #msg_login{
    color:var(--brand-1);
    animation:pulse 1.4s ease-in-out infinite;
}
@keyframes pulse{0%,100%{opacity:1}50%{opacity:.55}}

/* ---------- Responsive ---------- */
@media (max-width:900px){
    .wrapper{grid-template-columns:1fr}
    .brand-panel{display:none}
    .login-panel{
        min-height:100vh;
        background:linear-gradient(135deg,var(--brand-1) 0%,var(--brand-2) 60%,var(--brand-3) 130%);
    }
}
@media (max-width:480px){
    .card{padding:34px 24px;border-radius:14px}
    .login-panel{padding:24px 16px}
}
