:root {
    --biru: #1A4D8F;
    --biru-muda: #2563EB;
    --biru-gelap: #0F2D5A;
    --biru-pale: #EFF6FF;
    --kuning: #F5B700;
    --kuning-muda: #FDE047;
    --abu: #F1F5F9;
    --teks: #0F172A;
    --teks-2: #475569;
    --teks-3: #94A3B8;
    --putih: #FFFFFF;
    --danger: #EF4444;
    --danger-bg: #FEF2F2;
    --danger-bd: #FECACA;
    --success: #16A34A;
    --success-bg: #F0FDF4;
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    height: 100%;
}

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    color: var(--teks);
    background: var(--biru-gelap);
    min-height: 100vh;
    display: flex;
    overflow: hidden;
}

/* ─── PANEL KIRI (Branding) ───────────────────────────── */
.panel-left {
    width: 42%;
    background:
        linear-gradient(160deg, rgba(15, 45, 90, .88) 0%, rgba(15, 45, 90, .75) 50%, rgba(26, 77, 143, .9) 100%),
        url('../images/kantor-bupati1.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 2.5rem;
    overflow: hidden;
    flex-shrink: 0;
}

/* Ornamen background */
.panel-left::before {
    content: '';
    position: absolute;
    top: -100px;
    right: -100px;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(245, 183, 0, .15) 0%, transparent 65%);
    pointer-events: none;
}

.panel-left::after {
    content: '';
    position: absolute;
    bottom: -80px;
    left: -80px;
    width: 350px;
    height: 350px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(37, 99, 235, .2) 0%, transparent 65%);
    pointer-events: none;
}

/* Grid lines dekoratif */
.panel-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, .03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .03) 1px, transparent 1px);
    background-size: 48px 48px;
}

.panel-logo {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-box {
    width: 44px;
    height: 44px;
    background: var(--kuning);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'DM Serif Display', serif;
    font-size: 1.4rem;
    color: var(--biru-gelap);
    font-weight: 900;
    flex-shrink: 0;
}

.logo-text-main {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--putih);
    letter-spacing: -.3px;
}

.logo-text-sub {
    font-size: .72rem;
    color: rgba(255, 255, 255, .5);
    font-weight: 500;
}

.panel-content {
    position: relative;
    z-index: 2;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 2rem 0;
}

.panel-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(245, 183, 0, .15);
    border: 1px solid rgba(245, 183, 0, .25);
    border-radius: 100px;
    padding: 4px 12px;
    font-size: .72rem;
    font-weight: 700;
    color: var(--kuning);
    letter-spacing: .5px;
    text-transform: uppercase;
    margin-bottom: 1.25rem;
    width: fit-content;
}

.panel-title {
    font-family: 'DM Serif Display', serif;
    font-size: clamp(1.8rem, 2.5vw, 2.6rem);
    color: var(--putih);
    line-height: 1.12;
    letter-spacing: -.3px;
    margin-bottom: 1rem;
}

.panel-title .hl {
    color: var(--kuning);
    font-style: italic;
}

.panel-desc {
    font-size: .875rem;
    color: rgba(255, 255, 255, .55);
    line-height: 1.75;
    max-width: 320px;
    margin-bottom: 2rem;
}

/* Feature list */
.feature-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: .75rem;
}

.feature-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: .825rem;
    color: rgba(255, 255, 255, .65);
    font-weight: 500;
}

.feature-list li .fi {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: rgba(255, 255, 255, .07);
    border: 1px solid rgba(255, 255, 255, .1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .8rem;
    color: var(--kuning);
    flex-shrink: 0;
}

/* Stat pills bawah */
.panel-stats {
    position: relative;
    z-index: 2;
    display: flex;
    gap: .75rem;
    flex-wrap: wrap;
}

.stat-pill {
    background: rgba(255, 255, 255, .07);
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 100px;
    padding: .4rem 1rem;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: .72rem;
    color: rgba(255, 255, 255, .65);
    font-weight: 600;
}

.stat-pill i {
    color: var(--kuning);
    font-size: .75rem;
}

/* ─── PANEL KANAN (Form) ──────────────────────────────── */
.panel-right {
    flex: 1;
    background: var(--putih);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2.5rem;
    position: relative;
    overflow-y: auto;
}

/* Aksen sudut kiri atas */
.panel-right::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle at top left, rgba(26, 77, 143, .05) 0%, transparent 70%);
    pointer-events: none;
}

.login-box {
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 1;
}

/* Header form */
.login-header {
    margin-bottom: 2rem;
}

.login-eyebrow {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: .75rem;
}

.login-eyebrow span {
    font-size: .72rem;
    font-weight: 700;
    color: var(--teks-3);
    text-transform: uppercase;
    letter-spacing: .8px;
}

.eyebrow-line {
    flex: 1;
    height: 1px;
    background: var(--abu);
}

.login-title {
    font-family: 'DM Serif Display', serif;
    font-size: 1.9rem;
    color: var(--biru-gelap);
    line-height: 1.1;
    letter-spacing: -.3px;
    margin-bottom: .5rem;
}

.login-sub {
    font-size: .83rem;
    color: var(--teks-2);
    line-height: 1.6;
}

/* Tahun anggaran selector */
.tahun-selector {
    background: var(--abu);
    border-radius: 12px;
    padding: .875rem 1rem;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 1.5rem;
    border: 1.5px solid transparent;
    transition: border-color .2s;
    cursor: pointer;
}

.tahun-selector:hover {
    border-color: rgba(26, 77, 143, .2);
}

.tahun-selector .ts-icon {
    width: 36px;
    height: 36px;
    border-radius: 9px;
    background: var(--biru);
    color: var(--putih);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .9rem;
    flex-shrink: 0;
}

.tahun-selector .ts-label {
    font-size: .72rem;
    color: var(--teks-2);
    font-weight: 600;
}

.tahun-selector .ts-val {
    font-size: .9rem;
    font-weight: 800;
    color: var(--teks);
}

.tahun-selector .ts-arrow {
    margin-left: auto;
    color: var(--teks-3);
    font-size: .9rem;
    transition: transform .2s;
}

/* Form controls */
.form-group {
    margin-bottom: 1.1rem;
}

.form-label {
    font-size: .78rem;
    font-weight: 700;
    color: var(--teks);
    margin-bottom: .4rem;
    display: block;
}

.input-wrap {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--teks-3);
    font-size: 1rem;
    pointer-events: none;
    transition: color .2s;
}

.form-control {
    width: 100%;
    background: var(--abu);
    border: 1.5px solid transparent;
    border-radius: 10px;
    padding: .75rem 1rem .75rem 2.75rem;
    font-size: .875rem;
    font-family: 'Plus Jakarta Sans', sans-serif;
    color: var(--teks);
    transition: all .2s;
    outline: none;
}

.form-control::placeholder {
    color: var(--teks-3);
}

.form-control:focus {
    background: var(--putih);
    border-color: var(--biru);
    box-shadow: 0 0 0 3px rgba(26, 77, 143, .1);
}

.form-control:focus+.input-icon,
.input-wrap:focus-within .input-icon {
    color: var(--biru);
}

/* Toggle password */
.toggle-pw {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 4px;
    color: var(--teks-3);
    cursor: pointer;
    font-size: 1rem;
    transition: color .2s;
    line-height: 1;
}

.toggle-pw:hover {
    color: var(--biru);
}

/* Error state */
.form-control.is-invalid {
    border-color: var(--danger);
    background: var(--putih);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, .1);
}

.invalid-msg {
    font-size: .72rem;
    color: var(--danger);
    margin-top: .35rem;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Alert error */
.alert-error {
    background: var(--danger-bg);
    border: 1.5px solid var(--danger-bd);
    border-radius: 10px;
    padding: .875rem 1rem;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 1.25rem;
    display: none;
}

.alert-error i {
    color: var(--danger);
    font-size: 1rem;
    flex-shrink: 0;
    margin-top: 1px;
}

.alert-error span {
    font-size: .8rem;
    color: var(--danger);
    font-weight: 500;
    line-height: 1.5;
}

/* Tombol submit */
.btn-login {
    width: 100%;
    background: var(--biru);
    color: var(--putih);
    border: none;
    border-radius: 10px;
    padding: .875rem 1rem;
    font-size: .95rem;
    font-weight: 700;
    font-family: 'Plus Jakarta Sans', sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: all .2s;
    position: relative;
    overflow: hidden;
}

.btn-login:hover:not(:disabled) {
    background: var(--biru-muda);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(26, 77, 143, .3);
}

.btn-login:active:not(:disabled) {
    transform: translateY(0);
}

.btn-login:disabled {
    opacity: .7;
    cursor: not-allowed;
    transform: none;
}

/* Loading spinner */
.btn-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, .35);
    border-top-color: var(--putih);
    border-radius: 50%;
    animation: spin .7s linear infinite;
    display: none;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Divider */
.divider {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 1.25rem 0;
}

.divider-line {
    flex: 1;
    height: 1px;
    background: var(--abu);
}

.divider span {
    font-size: .72rem;
    color: var(--teks-3);
    font-weight: 600;
    white-space: nowrap;
}

/* Info badge */
.info-badge {
    background: var(--biru-pale);
    border: 1.5px solid rgba(26, 77, 143, .12);
    border-radius: 10px;
    padding: .75rem 1rem;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.info-badge i {
    color: var(--biru);
    font-size: .9rem;
    flex-shrink: 0;
    margin-top: 1px;
}

.info-badge span {
    font-size: .75rem;
    color: var(--biru);
    font-weight: 500;
    line-height: 1.6;
}

/* Footer form */
.login-footer {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--abu);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .5rem;
}

.login-footer-logo {
    font-size: .72rem;
    color: var(--teks-3);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.login-footer-logo .dot {
    width: 18px;
    height: 18px;
    border-radius: 5px;
    background: var(--biru);
    color: var(--kuning);
    font-size: .65rem;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'DM Serif Display', serif;
}

.login-footer-reg {
    font-size: .68rem;
    color: var(--teks-3);
    text-align: right;
}

/* ─── TAHUN DROPDOWN ─────────────────────────────────── */
.tahun-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: var(--putih);
    border: 1.5px solid rgba(26, 77, 143, .12);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(26, 77, 143, .12);
    z-index: 100;
    overflow: hidden;
    display: none;
}

.tahun-dropdown.show {
    display: block;
    animation: dropDown .15s ease;
}

@keyframes dropDown {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tahun-opt {
    padding: .65rem 1rem;
    font-size: .85rem;
    font-weight: 600;
    color: var(--teks);
    cursor: pointer;
    transition: background .15s;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.tahun-opt:hover {
    background: var(--biru-pale);
    color: var(--biru);
}

.tahun-opt.active {
    background: var(--biru);
    color: var(--putih);
}

.tahun-opt.active i {
    display: block;
}

.tahun-opt i {
    display: none;
    font-size: .8rem;
}

/* ─── RESPONSIVE ─────────────────────────────────────── */
@media (max-width: 768px) {
    body {
        flex-direction: column;
        overflow: auto;
    }

    .panel-left {
        width: 100%;
        min-height: auto;
        padding: 1.75rem;
    }

    .panel-content {
        padding: 1.5rem 0;
    }

    .panel-title {
        font-size: 1.5rem;
    }

    .panel-desc,
    .feature-list {
        display: none;
    }

    .panel-right {
        padding: 2rem 1.25rem;
    }
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    20% {
        transform: translateX(-8px);
    }

    40% {
        transform: translateX(8px);
    }

    60% {
        transform: translateX(-5px);
    }

    80% {
        transform: translateX(5px);
    }
}