*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    color-scheme: light only;
}

body {
    background: #f7f0f1;
    font-family: "Plus Jakarta Sans", ui-sans-serif, system-ui, sans-serif;
    min-height: 100vh;
    color-scheme: light only;
}

/* ---------- wrapper ---------- */
.login-outer {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f7f0f1;
    padding: 24px;
}

/* ---------- kartu utama ---------- */
.login-wrap {
    width: 100%;
    max-width: 820px;
    min-height: 520px;
    background: #ffffff;
    border-radius: 16px;
    overflow: hidden;
    display: grid;
    grid-template-columns: 1fr 1fr;
    box-shadow: 0 8px 40px rgba(192, 25, 44, 0.12);
}

/* ============================================================
   PANEL KIRI
   ============================================================ */
.left-panel {
    background: linear-gradient(to bottom, #c0192c, #61050f);
    padding: 40px 32px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.left-logo {
    width: 100%;
    max-width: 180px;
    height: auto;
    display: block;
    margin-bottom: 20px;
    filter: brightness(0) invert(1);
}

/* Fallback jika logo tidak ada */
.logo-text-fallback {
    font-size: 13px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 1px;
}

.logo-text-fallback-sub {
    font-size: 20px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 1.5px;
    margin-top: 2px;
}

.left-panel p {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.72);
    line-height: 1.65;
}

.step-label {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.55);
    letter-spacing: 0.6px;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.step-dots {
    display: flex;
    gap: 6px;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.28);
    transition: all 0.3s ease;
}

.dot.active {
    width: 24px;
    border-radius: 4px;
    background: #ffffff;
}

/* ============================================================
   PANEL KANAN
   ============================================================ */
.right-panel {
    padding: 40px 36px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: #ffffff;
}

.step-content {
    animation: fadeSlideIn 0.25s ease;
}

@keyframes fadeSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.right-panel h2 {
    font-size: 28px;
    font-weight: 800;
    color: #7a1020;
    margin-bottom: 6px;
    letter-spacing: -0.5px;
    line-height: 1.15;
}

.right-panel .sub {
    font-size: 13.5px;
    color: #a06070;
    margin-bottom: 28px;
    font-weight: 400;
}

/* ---------- form ---------- */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    font-size: 13px;
    color: #a06070;
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 10px 12px;
    border: 1.5px solid #e8c8cc;
    border-radius: 8px;
    font-size: 14px;
    color: #7a1020;
    background: #fdf5f6;
    outline: none;
    transition:
        border-color 0.15s,
        box-shadow 0.15s,
        background 0.15s;
    color-scheme: light only;
    font-family: inherit;
}

.form-group input::placeholder {
    color: #d4a0a8;
}

.form-group input:focus {
    border-color: #c0192c;
    box-shadow: 0 0 0 3px rgba(192, 25, 44, 0.09);
    background: #fff8f8;
}

/* ---------- password toggle ---------- */
.input-wrap {
    position: relative;
}

.input-wrap input {
    padding-right: 42px;
}

.toggle-pw {
    position: absolute;
    right: 11px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #d4a0a8;
    display: flex;
    align-items: center;
    line-height: 1;
    transition: color 0.15s;
    user-select: none;
}

.toggle-pw:hover {
    color: #c0192c;
}

/* ---------- error ---------- */
.field-error {
    display: block;
    font-size: 12px;
    color: #c0192c;
    margin-top: 4px;
    min-height: 16px;
}

/* ---------- tombol masuk (biru) ---------- */
.btn-next {
    width: 100%;
    padding: 13px;
    background: #1a6fc4;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    margin-top: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    letter-spacing: 0.2px;
    transition:
        background 0.15s,
        transform 0.1s;
    font-family: inherit;
}

.btn-next:hover:not(:disabled):not(.disabled) {
    background: #155aa0;
}

.btn-next:active:not(:disabled):not(.disabled) {
    transform: scale(0.98);
}

.btn-next:disabled,
.btn-next.disabled {
    background: #b8d4f0;
    cursor: not-allowed;
    color: #ffffff;
}

/* ============================================================
   STEP 2 — PILIH ROLE
   ============================================================ */
.loading-bar {
    width: 100%;
    height: 3px;
    background: #fdd8dc;
    border-radius: 4px;
    margin-bottom: 20px;
    overflow: hidden;
}

.loading-bar-fill {
    height: 100%;
    background: #c0192c;
    border-radius: 4px;
    width: 0;
}

.loading-bar-fill.animate {
    animation: loadBar 1s ease forwards;
}

@keyframes loadBar {
    from {
        width: 0%;
    }
    to {
        width: 100%;
    }
}

.user-info-badge {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #fdf5f6;
    border: 1.5px solid #e8c8cc;
    border-radius: 10px;
    padding: 10px 14px;
    margin-bottom: 20px;
}

.user-avatar {
    width: 38px;
    height: 38px;
    background: #fdd8dc;
    color: #c0192c;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 16px;
    flex-shrink: 0;
}

.user-meta strong {
    font-size: 13px;
    font-weight: 500;
    color: #7a1020;
    display: block;
}

.user-meta span {
    font-size: 11px;
    color: #a06070;
}

/* ---------- role grid ---------- */
.role-grid {
    display: grid;
    gap: 10px;
    margin-bottom: 4px;
}

.role-card {
    width: 100%;
    border: 1.5px solid #e8c8cc;
    border-radius: 10px;
    padding: 13px 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    background: #fdf5f6;
    text-align: left;
    transition:
        border-color 0.15s,
        background 0.15s,
        box-shadow 0.15s;
    font-family: inherit;
}

.role-card:hover {
    border-color: #c0192c;
    background: #ffeaec;
    box-shadow: 0 2px 10px rgba(192, 25, 44, 0.08);
}

.role-card.selected {
    border-color: #c0192c;
    background: #ffeaec;
}

.role-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.role-icon.op {
    background: #fdd8dc;
    color: #c0192c;
}
.role-icon.dos {
    background: #ddeeff;
    color: #185fa5;
}
.role-icon.ten {
    background: #fff3d6;
    color: #9a6800;
}
.role-icon.pim {
    background: #ddf0d8;
    color: #3b6d11;
}

.role-info {
    flex: 1;
}

.role-info strong {
    font-size: 14px;
    font-weight: 500;
    color: #7a1020;
    display: block;
    margin-bottom: 2px;
}

.role-info span {
    font-size: 12px;
    color: #a06070;
}

.role-arrow {
    color: #d4a0a8;
    flex-shrink: 0;
    transition: color 0.15s;
}

.role-card.selected .role-arrow,
.role-card:hover .role-arrow {
    color: #c0192c;
}

/* ---------- kembali ---------- */
.back-link {
    display: block;
    font-size: 12px;
    color: #a06070;
    text-align: center;
    margin-top: 14px;
    cursor: pointer;
    background: none;
    border: none;
    width: 100%;
    transition: color 0.15s;
    font-family: inherit;
}

.back-link:hover {
    color: #c0192c;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 640px) {
    .login-wrap {
        grid-template-columns: 1fr;
        min-height: unset;
    }

    .left-panel {
        padding: 28px 24px;
        min-height: 160px;
    }

    .left-bottom {
        display: none;
    }

    .right-panel {
        padding: 28px 24px;
    }
}
