/* ============================================================
   Halaman Login — desain split panel (branding + form)
   ============================================================ */

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

html, body {
    margin: 0;
    padding: 0;
}

body.login-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #e8eefc;
    background:
        radial-gradient(1100px 700px at 85% -10%, rgba(0, 110, 255, 0.30), transparent 60%),
        radial-gradient(900px 600px at -10% 110%, rgba(0, 170, 255, 0.22), transparent 60%),
        linear-gradient(135deg, #020817 0%, #041230 45%, #02204d 100%);
    overflow-x: hidden;
}

/* ---------- Background dekoratif ---------- */
.login-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.login-bg::before,
.login-bg::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.55;
}

.login-bg::before {
    width: 620px;
    height: 620px;
    right: -180px;
    top: -220px;
    background: #0066ff;
}

.login-bg::after {
    width: 560px;
    height: 560px;
    left: -220px;
    bottom: -260px;
    background: #00b7ff;
    opacity: 0.35;
}

.login-bg .bg-dots {
    position: absolute;
    width: 300px;
    height: 300px;
    background-image: radial-gradient(rgba(56, 189, 248, 0.55) 1.2px, transparent 1.2px);
    background-size: 14px 14px;
    opacity: 0.35;
}

.login-bg .bg-dots.dots-left  { left: 18px; top: 150px; }
.login-bg .bg-dots.dots-right { right: 24px; bottom: 90px; opacity: 0.25; }

.login-bg .bg-wave {
    position: absolute;
    left: -10%;
    right: -10%;
    height: 420px;
    border-radius: 45%;
    border: 1px solid rgba(59, 130, 246, 0.25);
    transform: rotate(-6deg);
    background: linear-gradient(120deg, rgba(37, 99, 235, 0.10), rgba(6, 182, 212, 0.06));
}

.login-bg .wave-1 { bottom: -280px; }
.login-bg .wave-2 { bottom: -330px; transform: rotate(4deg); opacity: 0.6; }

/* ---------- Topbar ---------- */
.login-topbar {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.9rem clamp(1rem, 3vw, 2.2rem);
    background: rgba(2, 8, 26, 0.55);
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.login-topbar .brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.login-topbar .brand-logo {
    height: 42px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 4px 14px rgba(59, 130, 246, 0.45));
}

.login-topbar .brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.login-topbar .brand-text strong {
    font-size: 1.05rem;
    font-weight: 700;
    color: #f8fafc;
}

.login-topbar .brand-text span {
    font-size: 0.72rem;
    color: #93a4c4;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.topbar-btn {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(15, 23, 42, 0.55);
    color: #cbd5e1;
    font-size: 0.95rem;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.topbar-btn:hover {
    color: #7dd3fc;
    border-color: rgba(14, 165, 233, 0.45);
    background: rgba(14, 165, 233, 0.12);
}

/* ---------- Kartu login ---------- */
.login-main {
    position: relative;
    z-index: 1;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(0.8rem, 2vw, 1.6rem);
}

.login-card {
    width: 100%;
    max-width: 1120px;
    min-height: 590px;
    display: grid;
    grid-template-columns: 0.92fr 1.08fr;
    border-radius: 24px;
    overflow: hidden;
    border: 1px solid rgba(96, 165, 250, 0.20);
    box-shadow: 0 40px 90px -30px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(255, 255, 255, 0.02) inset;
    background: #071228;
}

/* ---------- Panel kiri (branding) ---------- */
.brand-panel {
    position: relative;
    overflow: hidden;
    padding: clamp(2rem, 4vw, 3.4rem);
    display: flex;
    flex-direction: column;
    justify-content: center;
    color: #fff;
    background:
        radial-gradient(700px 420px at 110% -10%, rgba(125, 211, 252, 0.55), transparent 55%),
        radial-gradient(520px 520px at 10% 100%, rgba(0, 82, 255, 0.60), transparent 60%),
        linear-gradient(145deg, #0b47c8 0%, #0870ee 45%, #00a8ff 100%);
}

.brand-panel::before {
    content: '';
    position: absolute;
    inset: -20%;
    background:
        radial-gradient(closest-side at 70% 30%, rgba(56, 189, 248, 0.35), transparent),
        radial-gradient(closest-side at 20% 80%, rgba(2, 132, 199, 0.35), transparent);
    opacity: 0.9;
    pointer-events: none;
}

.brand-panel::after {
    content: '';
    position: absolute;
    right: -70px;
    top: -70px;
    width: 260px;
    height: 260px;
    background-image: radial-gradient(rgba(255, 255, 255, 0.35) 1.4px, transparent 1.5px);
    background-size: 15px 15px;
    opacity: 0.35;
    transform: rotate(8deg);
}

.brand-panel h1 {
    position: relative;
    z-index: 1;
    margin: 0;
    font-size: clamp(2.4rem, 4.6vw, 3.8rem);
    font-weight: 800;
    font-style: italic;
    line-height: 0.98;
    letter-spacing: -0.03em;
    color: #fff;
    text-shadow: 0 10px 40px rgba(0, 20, 80, 0.35);
}

.brand-panel h1 span {
    font-weight: 800;
}

.brand-panel .tagline {
    position: relative;
    z-index: 1;
    margin: 0.55rem 0 0;
    font-size: clamp(1.5rem, 2.8vw, 2.2rem);
    font-weight: 700;
    font-style: italic;
    letter-spacing: -0.02em;
    color: #ffffff;
}

.brand-panel .gold-line {
    position: relative;
    z-index: 1;
    display: block;
    width: 150px;
    height: 10px;
    margin-top: 1rem;
    background: linear-gradient(90deg, #facc15, #f59e0b);
    clip-path: polygon(0 70%, 100% 0, 100% 55%, 0 100%);
    filter: drop-shadow(0 4px 10px rgba(245, 158, 11, 0.35));
}

.brand-panel .brand-wave {
    position: absolute;
    left: -25%;
    right: -25%;
    bottom: -95px;
    height: 330px;
    border-radius: 50%;
    border-top: 1px solid rgba(255, 255, 255, 0.22);
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.16), rgba(56, 189, 248, 0.05) 45%, transparent 72%);
    transform: rotate(-8deg);
    pointer-events: none;
}

.brand-panel .brand-wave::after {
    content: '';
    position: absolute;
    left: -6%;
    right: -6%;
    top: 42px;
    height: 250px;
    border-radius: 50%;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.10), transparent 65%);
    transform: rotate(3deg);
}

/* Gambar gedung juga pada panel kiri (bagian dari konten yang terpusat) */
.brand-panel .brand-building {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 220px;
    margin-top: 1.2rem;
    background: url('../../img/gedung.png') center bottom / contain no-repeat;
    opacity: 0.95;
    -webkit-mask-image: linear-gradient(to top, #000 58%, transparent 100%);
    mask-image: linear-gradient(to top, #000 58%, transparent 100%);
    pointer-events: none;
    filter: drop-shadow(0 -8px 28px rgba(0, 30, 90, 0.30));
}

.brand-panel h1,
.brand-panel .tagline,
.brand-panel .gold-line {
    z-index: 2;
}

/* ---------- Panel kanan (form) ---------- */
.form-panel {
    position: relative;
    overflow: hidden;
    padding: clamp(1.4rem, 2.4vw, 2rem) clamp(1.4rem, 2.6vw, 2.4rem);
    display: flex;
    flex-direction: column;
    justify-content: center;
    background:
        radial-gradient(600px 300px at 100% 0%, rgba(14, 165, 233, 0.10), transparent 60%),
        linear-gradient(180deg, #0a1733 0%, #071228 100%);
}

.form-panel .form-inner {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 440px;
    margin: auto;
}

.form-logo {
    display: block;
    height: 54px;
    width: auto;
    margin: 0 auto 0.8rem;
    object-fit: contain;
    filter: drop-shadow(0 6px 18px rgba(14, 165, 233, 0.35));
}

.form-panel h2 {
    margin: 0;
    text-align: center;
    font-size: clamp(1.35rem, 2vw, 1.6rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #f8fafc;
}

.form-panel .form-sub {
    margin: 0.3rem 0 1rem;
    text-align: center;
    font-size: 0.84rem;
    color: #94a3b8;
}

/* ---------- Alert ---------- */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.8rem 0.95rem;
    border-radius: 12px;
    margin-bottom: 1rem;
    font-size: 0.82rem;
    line-height: 1.4;
}

.alert-error {
    color: #fecaca;
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.35);
}

.alert i {
    margin-top: 0.1rem;
}

/* ---------- Form ---------- */
.field {
    margin-bottom: 0.8rem;
}

.field > label {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: #b6c4de;
    letter-spacing: 0.01em;
}

.input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrap > i:first-child {
    position: absolute;
    left: 0.9rem;
    color: #7c8db0;
    font-size: 0.9rem;
    pointer-events: none;
}

.input-wrap select,
.input-wrap input {
    width: 100%;
    height: 48px;
    padding: 0 2.7rem 0 2.5rem;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    background: #0d1a34;
    color: #e8eefc;
    font-family: inherit;
    font-size: 0.92rem;
    font-weight: 500;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    appearance: none;
    -webkit-appearance: none;
}

.input-wrap select {
    padding-right: 2.4rem;
    cursor: pointer;
    background-image:
        linear-gradient(45deg, transparent 50%, #7c8db0 50%),
        linear-gradient(135deg, #7c8db0 50%, transparent 50%);
    background-position:
        calc(100% - 1.15rem) 50%,
        calc(100% - 0.8rem) 50%;
    background-size: 7px 7px, 7px 7px;
    background-repeat: no-repeat;
}

.input-wrap select option,
.input-wrap select optgroup {
    background: #0d1a34;
    color: #e8eefc;
}

.input-wrap input::placeholder {
    color: #64748b;
}

.input-wrap select:focus,
.input-wrap input:focus {
    border-color: rgba(56, 189, 248, 0.7);
    box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.14);
    background: #0f1f3e;
}

.control-group {
    display: flex;
    gap: 0.55rem;
    align-items: stretch;
}

.control-group .input-wrap {
    flex: 1;
}

.icon-square {
    width: 48px;
    flex: 0 0 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    background: #0d1a34;
    color: #93c5fd;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.icon-square:hover {
    border-color: rgba(56, 189, 248, 0.6);
    background: rgba(14, 165, 233, 0.12);
    color: #7dd3fc;
}

.toggle-password {
    position: absolute;
    right: 0.55rem;
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 9px;
    background: transparent;
    color: #7c8db0;
    cursor: pointer;
    transition: color 0.2s ease, background 0.2s ease;
}

.toggle-password:hover {
    color: #7dd3fc;
    background: rgba(14, 165, 233, 0.10);
}

.form-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin: 0.2rem 0 1.15rem;
    flex-wrap: wrap;
}

.check {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.82rem;
    color: #cbd5e1;
    cursor: pointer;
    user-select: none;
}

.check input {
    width: 16px;
    height: 16px;
    accent-color: #22d3ee;
    cursor: pointer;
}

.link-btn {
    border: none;
    background: transparent;
    padding: 0;
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    color: #38bdf8;
    cursor: pointer;
    text-decoration: none;
}

.link-btn:hover {
    color: #7dd3fc;
    text-decoration: underline;
}

.btn-login {
    width: 100%;
    height: 50px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    border: none;
    border-radius: 12px;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 700;
    color: #04121f;
    cursor: pointer;
    background: linear-gradient(90deg, #0ea5e9 0%, #22d3ee 55%, #38bdf8 100%);
    box-shadow: 0 14px 30px -12px rgba(34, 211, 238, 0.65);
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.btn-login:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 18px 36px -12px rgba(34, 211, 238, 0.8);
    filter: brightness(1.05);
}

.btn-login:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    box-shadow: none;
}

.secure-note {
    position: relative;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    margin: 0.95rem 0 0;
    font-size: 0.76rem;
    color: #9fb0cd;
    text-shadow: 0 1px 3px rgba(2, 8, 26, 0.9);
}

/* ---------- Footer ---------- */
.login-footer {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 0.8rem clamp(1rem, 3vw, 2.2rem);
    font-size: 0.76rem;
    color: #7c8db0;
    background: rgba(2, 8, 26, 0.55);
    border-top: 1px solid rgba(148, 163, 184, 0.10);
}

.login-footer b {
    color: #cbd5e1;
}

.server-time {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.server-time a {
    color: #9fb3d4;
    margin-left: 0.15rem;
}

.server-time a:hover {
    color: #7dd3fc;
}

/* ---------- Responsif ---------- */
@media (max-width: 900px) {
    .login-card {
        grid-template-columns: 1fr;
        min-height: 0;
        max-width: 520px;
    }

    .brand-panel {
        padding: 1.5rem 1.6rem;
        min-height: 170px;
    }

    .brand-panel h1 {
        margin-top: 1rem;
        font-size: 2.1rem;
    }

    .brand-panel .tagline {
        font-size: 1.35rem;
    }

    .form-panel {
        padding: 1.6rem 1.4rem 1.4rem;
    }

    .login-footer {
        justify-content: center;
        text-align: center;
    }
}

@media (max-width: 520px) {
    .login-topbar {
        padding: 0.65rem 0.9rem;
    }

    .login-topbar .brand-text span {
        display: none;
    }

    .login-main {
        padding: 0.8rem;
    }

    .login-card {
        border-radius: 18px;
    }

    .brand-panel h1 {
        font-size: 1.8rem;
    }

    .form-panel h2 {
        font-size: 1.3rem;
    }

    .input-wrap select,
    .input-wrap input,
    .btn-login {
        height: 48px;
    }

    .icon-square {
        width: 48px;
        flex-basis: 48px;
    }
}
